diff --git a/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvAdminCategoryDao.java b/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvAdminCategoryDao.java new file mode 100644 index 0000000..d647183 --- /dev/null +++ b/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvAdminCategoryDao.java @@ -0,0 +1,50 @@ +package com.heyu.api.data.dao.vv; +/** +*

+* 类目表 服务类 +*

+* +* @author quyixiao +* @since 2025-08-24 +*/ + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.heyu.api.data.entity.vv.VvAdminCategoryEntity; +import com.lz.mybatis.plugin.annotations.IN; +import com.lz.mybatis.plugin.annotations.OrderBy; +import com.lz.mybatis.plugin.annotations.OrderType; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface VvAdminCategoryDao extends BaseMapper { + + + VvAdminCategoryEntity selectVvAdminCategoryById(@Param("id")Long id); + + + Long insertVvAdminCategory(VvAdminCategoryEntity vvAdminCategory); + + + Long insertOrUpdateVvAdminCategory(VvAdminCategoryEntity vvAdminCategory); + + + int updateVvAdminCategoryById(VvAdminCategoryEntity vvAdminCategory); + + + int updateCoverVvAdminCategoryById(VvAdminCategoryEntity vvAdminCategory); + + + int deleteVvAdminCategoryById(@Param("id")Long id); + + + List selectVvCategoryAll(); + + + @OrderBy(value={VvAdminCategoryEntity.default_sort},type={OrderType.ASC}) + List selectVvCategoryByParentId(Integer parentId); + + List selectVvCategoryByIds(@IN List id); +} \ No newline at end of file diff --git a/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvAppCategoryDao.java b/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvAppCategoryDao.java new file mode 100644 index 0000000..9cd4b0f --- /dev/null +++ b/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvAppCategoryDao.java @@ -0,0 +1,53 @@ +package com.heyu.api.data.dao.vv; +/** +*

+* 类目表 服务类 +*

+* +* @author quyixiao +* @since 2025-08-24 +*/ + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.heyu.api.data.entity.vv.VvAppCategoryEntity; +import com.lz.mybatis.plugin.annotations.IN; +import com.lz.mybatis.plugin.annotations.OrderBy; +import com.lz.mybatis.plugin.annotations.OrderType; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface VvAppCategoryDao extends BaseMapper { + + + VvAppCategoryEntity selectVvAppCategoryById(@Param("id")Long id); + + + Long insertVvAppCategory(VvAppCategoryEntity vvAppCategory); + + + Long insertOrUpdateVvAppCategory(VvAppCategoryEntity vvAppCategory); + + + int updateVvAppCategoryById(VvAppCategoryEntity vvAppCategory); + + + int updateCoverVvAppCategoryById(VvAppCategoryEntity vvAppCategory); + + + int deleteVvAppCategoryById(@Param("id")Long id); + + + + List selectVvCategoryAll(); + + + + + @OrderBy(value={VvAppCategoryEntity.default_sort},type={OrderType.ASC}) + List selectVvCategoryByParentId(Integer parentId); + + List selectVvCategoryByIds(@IN List id); +} \ No newline at end of file diff --git a/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvCategoryDao.java b/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvCategoryDao.java deleted file mode 100644 index 1ba2309..0000000 --- a/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvCategoryDao.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.heyu.api.data.dao.vv; -/** -*

-* 类目表 服务类 -*

-* -* @author quyixiao -* @since 2025-08-20 -*/ -import com.heyu.api.data.entity.vv.VvCategoryEntity; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.lz.mybatis.plugin.annotations.IN; -import com.lz.mybatis.plugin.annotations.OrderBy; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -@Mapper -public interface VvCategoryDao extends BaseMapper { - - - VvCategoryEntity selectVvCategoryById(@Param("id") Long id); - - - Long insertVvCategory(VvCategoryEntity vvCategory); - - - Long insertOrUpdateVvCategory(VvCategoryEntity vvCategory); - - - int updateVvCategoryById(VvCategoryEntity vvCategory); - - - int updateCoverVvCategoryById(VvCategoryEntity vvCategory); - - - int deleteVvCategoryById(@Param("id") Long id); - - List selectVvCategoryAll(); - - @OrderBy(VvCategoryEntity.default_sort) - List selectVvCategoryByParentId(Integer parentId); - - - - List selectVvCategoryByIds(@IN List id); -} \ No newline at end of file diff --git a/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvCategoryPropertyDao.java b/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvCategoryPropertyDao.java index 8601c90..260b54c 100644 --- a/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvCategoryPropertyDao.java +++ b/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvCategoryPropertyDao.java @@ -7,12 +7,11 @@ package com.heyu.api.data.dao.vv; * @author quyixiao * @since 2025-08-20 */ + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.heyu.api.data.entity.vv.VvCategoryPropertyEntity; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.lz.mybatis.plugin.annotations.IF; -import com.lz.mybatis.plugin.annotations.IN; -import com.lz.mybatis.plugin.annotations.OrderBy; +import com.lz.mybatis.plugin.annotations.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -42,13 +41,15 @@ public interface VvCategoryPropertyDao extends BaseMapper selectVvProperByCondition(IPage page, - @IF String propertyName, - @IF String categoryName, + @IF @LIKE String propertyName, + @IF @LIKE String categoryName, @IF Long categoryId); - @OrderBy(VvCategoryPropertyEntity.default_sort) + @OrderBy(value={VvCategoryPropertyEntity.default_sort}, type={OrderType.ASC}) List selectVvPropertyByIds(@IN List id); } \ No newline at end of file diff --git a/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvCategoryPropertyValueDao.java b/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvCategoryPropertyValueDao.java index b7421e8..525f84a 100644 --- a/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvCategoryPropertyValueDao.java +++ b/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvCategoryPropertyValueDao.java @@ -11,6 +11,7 @@ import com.heyu.api.data.entity.vv.VvCategoryPropertyValueEntity; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.lz.mybatis.plugin.annotations.IN; import com.lz.mybatis.plugin.annotations.OrderBy; +import com.lz.mybatis.plugin.annotations.OrderType; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -38,9 +39,10 @@ public interface VvCategoryPropertyValueDao extends BaseMapper selectVvPropertyValueByPropertyId(Long categoryPropertyId); - @OrderBy(VvCategoryPropertyValueEntity.default_sort) + @OrderBy(value={VvCategoryPropertyValueEntity.default_sort},type={OrderType.ASC}) List selectVvPropertyValueByIds(@IN List id); } \ No newline at end of file diff --git a/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvProductDao.java b/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvProductDao.java index 429a5e7..170b085 100644 --- a/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvProductDao.java +++ b/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvProductDao.java @@ -39,7 +39,7 @@ public interface VvProductDao extends BaseMapper { int deleteVvProductById(@Param("id") Long id); - @OrderBy(VvProductEntity.default_sort) + @OrderBy(value={VvProductEntity.default_sort},type={OrderType.ASC}) List selectVvProductByFrontPage(Integer frontPage); diff --git a/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvProductDetailDao.java b/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvProductDetailDao.java index 5c6af89..abbbfef 100644 --- a/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvProductDetailDao.java +++ b/api-mapper/src/main/java/com/heyu/api/data/dao/vv/VvProductDetailDao.java @@ -1,15 +1,17 @@ package com.heyu.api.data.dao.vv; /** -*

-* 商品详描 服务类 -*

-* -* @author quyixiao -* @since 2025-08-20 -*/ + *

+ * 商品详描 服务类 + *

+ * + * @author quyixiao + * @since 2025-08-20 + */ + import com.heyu.api.data.entity.vv.VvProductDetailEntity; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.lz.mybatis.plugin.annotations.OrderBy; +import com.lz.mybatis.plugin.annotations.OrderType; import com.lz.mybatis.plugin.annotations.Realy; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -20,33 +22,30 @@ import java.util.List; public interface VvProductDetailDao extends BaseMapper { - VvProductDetailEntity selectVvProductDetailById(@Param("id")Long id); + VvProductDetailEntity selectVvProductDetailById(@Param("id") Long id); - Long insertVvProductDetail(VvProductDetailEntity vvProductDetail); + Long insertVvProductDetail(VvProductDetailEntity vvProductDetail); - Long insertOrUpdateVvProductDetail(VvProductDetailEntity vvProductDetail); + Long insertOrUpdateVvProductDetail(VvProductDetailEntity vvProductDetail); - int updateVvProductDetailById(VvProductDetailEntity vvProductDetail); + int updateVvProductDetailById(VvProductDetailEntity vvProductDetail); - int updateCoverVvProductDetailById(VvProductDetailEntity vvProductDetail); + int updateCoverVvProductDetailById(VvProductDetailEntity vvProductDetail); - int deleteVvProductDetailById(@Param("id")Long id); + int deleteVvProductDetailById(@Param("id") Long id); + @OrderBy(value = {VvProductDetailEntity.default_sort}, type = {OrderType.ASC}) + List selectVvProductDetailByProductId(Long productId); - @OrderBy(VvProductDetailEntity.default_sort) - List selectVvProductDetailByProductId(Long productId); - - - - @Realy - int deleteVvProductDetailRealById(@Param("id")Long id); + @Realy + int deleteVvProductDetailRealById(@Param("id") Long id); } \ No newline at end of file diff --git a/api-mapper/src/main/java/com/heyu/api/data/dto/vv/VvCategoryDTO.java b/api-mapper/src/main/java/com/heyu/api/data/dto/vv/VvAdminCategoryCategoryDTO.java similarity index 55% rename from api-mapper/src/main/java/com/heyu/api/data/dto/vv/VvCategoryDTO.java rename to api-mapper/src/main/java/com/heyu/api/data/dto/vv/VvAdminCategoryCategoryDTO.java index abaa6bd..7e34b40 100644 --- a/api-mapper/src/main/java/com/heyu/api/data/dto/vv/VvCategoryDTO.java +++ b/api-mapper/src/main/java/com/heyu/api/data/dto/vv/VvAdminCategoryCategoryDTO.java @@ -1,11 +1,11 @@ package com.heyu.api.data.dto.vv; -import com.heyu.api.data.entity.vv.VvCategoryEntity; +import com.heyu.api.data.entity.vv.VvAdminCategoryEntity; import lombok.Data; @Data public class -VvCategoryDTO extends VvCategoryEntity { +VvAdminCategoryCategoryDTO extends VvAdminCategoryEntity { /*** * 是否有child */ diff --git a/api-mapper/src/main/java/com/heyu/api/data/entity/vv/VvAdminCategoryEntity.java b/api-mapper/src/main/java/com/heyu/api/data/entity/vv/VvAdminCategoryEntity.java new file mode 100644 index 0000000..3cdd5ce --- /dev/null +++ b/api-mapper/src/main/java/com/heyu/api/data/entity/vv/VvAdminCategoryEntity.java @@ -0,0 +1,201 @@ +package com.heyu.api.data.entity.vv; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import com.lz.mybatis.plugin.annotations.AS; + +import java.math.BigDecimal; +import java.util.Date;import java.util.Date; +/** +*类目表 +* @author quyixiao +* @since 2025-08-24 +*/ + +@Data +@TableName("vv_admin_category") +public class VvAdminCategoryEntity implements java.io.Serializable { +private static final long serialVersionUID = 1L; + + public final static String CLASS_NAME ="com.heyu.api.data.entity.vv.VvAdminCategoryEntity:"; + + public final static String all = CLASS_NAME + "*"; + public final static String id_ = CLASS_NAME + "id"; // + 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 modify_time = CLASS_NAME + "modify_time"; // 修改时间 + 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 name_ = CLASS_NAME + "name"; // 名称 + public final static String level_ = CLASS_NAME + "level"; // 层级 + public final static String default_sort = CLASS_NAME + "default_sort"; // 排序 + // + @TableId(value = "id", type = IdType.AUTO) + private Long id; + //是否删除:0 否 1 删除 + private Integer isDelete; + //创建时间 + private Date createTime; + //修改时间 + private Date modifyTime; + //父亲类目id + private Long parentId; + //图片url + private String imageUrl; + //名称 + private String name; + //层级 + private Integer level; + //排序 + private Integer defaultSort; + /** + * + * @return + */ + public Long getId() { + return id; + } + /** + * + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * 是否删除:0 否 1 删除 + * @return + */ + public Integer getIsDelete() { + return isDelete; + } + /** + * 是否删除:0 否 1 删除 + * @param isDelete + */ + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + /** + * 创建时间 + * @return + */ + public Date getCreateTime() { + return createTime; + } + /** + * 创建时间 + * @param createTime + */ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** + * 修改时间 + * @return + */ + public Date getModifyTime() { + return modifyTime; + } + /** + * 修改时间 + * @param modifyTime + */ + public void setModifyTime(Date modifyTime) { + this.modifyTime = modifyTime; + } + + /** + * 父亲类目id + * @return + */ + public Long getParentId() { + return parentId; + } + /** + * 父亲类目id + * @param parentId + */ + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + /** + * 图片url + * @return + */ + public String getImageUrl() { + return imageUrl; + } + /** + * 图片url + * @param imageUrl + */ + public void setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + } + + /** + * 名称 + * @return + */ + public String getName() { + return name; + } + /** + * 名称 + * @param name + */ + public void setName(String name) { + this.name = name; + } + + /** + * 层级 + * @return + */ + public Integer getLevel() { + return level; + } + /** + * 层级 + * @param level + */ + public void setLevel(Integer level) { + this.level = level; + } + + /** + * 排序 + * @return + */ + public Integer getDefaultSort() { + return defaultSort; + } + /** + * 排序 + * @param defaultSort + */ + public void setDefaultSort(Integer defaultSort) { + this.defaultSort = defaultSort; + } + + @Override + public String toString() { + return "VvAdminCategoryEntity{" + + ",id=" + id + + ",isDelete=" + isDelete + + ",createTime=" + createTime + + ",modifyTime=" + modifyTime + + ",parentId=" + parentId + + ",imageUrl=" + imageUrl + + ",name=" + name + + ",level=" + level + + ",defaultSort=" + defaultSort + + "}"; + } +} \ No newline at end of file diff --git a/api-mapper/src/main/java/com/heyu/api/data/entity/vv/VvCategoryEntity.java b/api-mapper/src/main/java/com/heyu/api/data/entity/vv/VvAppCategoryEntity.java similarity index 96% rename from api-mapper/src/main/java/com/heyu/api/data/entity/vv/VvCategoryEntity.java rename to api-mapper/src/main/java/com/heyu/api/data/entity/vv/VvAppCategoryEntity.java index e990bd2..ad01547 100644 --- a/api-mapper/src/main/java/com/heyu/api/data/entity/vv/VvCategoryEntity.java +++ b/api-mapper/src/main/java/com/heyu/api/data/entity/vv/VvAppCategoryEntity.java @@ -10,15 +10,15 @@ import java.util.Date;import java.util.Date; /** *类目表 * @author quyixiao -* @since 2025-08-20 +* @since 2025-08-24 */ @Data -@TableName("vv_category") -public class VvCategoryEntity implements java.io.Serializable { +@TableName("vv_app_category") +public class VvAppCategoryEntity implements java.io.Serializable { private static final long serialVersionUID = 1L; - public final static String CLASS_NAME ="com.heyu.api.data.entity.vv.VvCategoryEntity:"; + public final static String CLASS_NAME ="com.heyu.api.data.entity.vv.VvAppCategoryEntity:"; public final static String all = CLASS_NAME + "*"; public final static String id_ = CLASS_NAME + "id"; // @@ -186,7 +186,7 @@ private static final long serialVersionUID = 1L; @Override public String toString() { - return "VvCategoryEntity{" + + return "VvAppCategoryEntity{" + ",id=" + id + ",isDelete=" + isDelete + ",createTime=" + createTime + diff --git a/api-mapper/src/main/java/com/heyu/api/data/service/impl/vv/VvAdminCategoryServiceImpl.java b/api-mapper/src/main/java/com/heyu/api/data/service/impl/vv/VvAdminCategoryServiceImpl.java new file mode 100644 index 0000000..1d7d978 --- /dev/null +++ b/api-mapper/src/main/java/com/heyu/api/data/service/impl/vv/VvAdminCategoryServiceImpl.java @@ -0,0 +1,68 @@ +package com.heyu.api.data.service.impl.vv; +/** +*

+* 类目表 服务类 +*

+* +* @author quyixiao +* @since 2025-08-24 +*/ + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.heyu.api.data.dao.vv.VvAdminCategoryDao; +import com.heyu.api.data.entity.vv.VvAdminCategoryEntity; +import com.heyu.api.data.service.vv.VvAdminCategoryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +@Service +public class VvAdminCategoryServiceImpl extends ServiceImpl implements VvAdminCategoryService { + + + @Autowired + private VvAdminCategoryDao vvAdminCategoryDao; + + + + @Override + public VvAdminCategoryEntity selectVvAdminCategoryById(Long id){ + return vvAdminCategoryDao.selectVvAdminCategoryById(id); + } + + + + @Override + public Long insertVvAdminCategory(VvAdminCategoryEntity vvAdminCategory){ + return vvAdminCategoryDao.insertVvAdminCategory(vvAdminCategory); + } + + + + @Override + public Long insertOrUpdateVvAdminCategory(VvAdminCategoryEntity vvAdminCategory){ + return vvAdminCategoryDao.insertOrUpdateVvAdminCategory(vvAdminCategory); + } + + + + @Override + public int updateVvAdminCategoryById(VvAdminCategoryEntity vvAdminCategory){ + return vvAdminCategoryDao.updateVvAdminCategoryById(vvAdminCategory); + } + + + + @Override + public int updateCoverVvAdminCategoryById(VvAdminCategoryEntity vvAdminCategory){ + return vvAdminCategoryDao.updateCoverVvAdminCategoryById(vvAdminCategory); + } + + + + @Override + public int deleteVvAdminCategoryById(Long id){ + return vvAdminCategoryDao.deleteVvAdminCategoryById(id); + } + + + +} diff --git a/api-mapper/src/main/java/com/heyu/api/data/service/impl/vv/VvAppCategoryServiceImpl.java b/api-mapper/src/main/java/com/heyu/api/data/service/impl/vv/VvAppCategoryServiceImpl.java new file mode 100644 index 0000000..b365aac --- /dev/null +++ b/api-mapper/src/main/java/com/heyu/api/data/service/impl/vv/VvAppCategoryServiceImpl.java @@ -0,0 +1,68 @@ +package com.heyu.api.data.service.impl.vv; +/** +*

+* 类目表 服务类 +*

+* +* @author quyixiao +* @since 2025-08-24 +*/ + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.heyu.api.data.dao.vv.VvAppCategoryDao; +import com.heyu.api.data.entity.vv.VvAppCategoryEntity; +import com.heyu.api.data.service.vv.VvAppCategoryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +@Service +public class VvAppCategoryServiceImpl extends ServiceImpl implements VvAppCategoryService { + + + @Autowired + private VvAppCategoryDao vvAppCategoryDao; + + + + @Override + public VvAppCategoryEntity selectVvAppCategoryById(Long id){ + return vvAppCategoryDao.selectVvAppCategoryById(id); + } + + + + @Override + public Long insertVvAppCategory(VvAppCategoryEntity vvAppCategory){ + return vvAppCategoryDao.insertVvAppCategory(vvAppCategory); + } + + + + @Override + public Long insertOrUpdateVvAppCategory(VvAppCategoryEntity vvAppCategory){ + return vvAppCategoryDao.insertOrUpdateVvAppCategory(vvAppCategory); + } + + + + @Override + public int updateVvAppCategoryById(VvAppCategoryEntity vvAppCategory){ + return vvAppCategoryDao.updateVvAppCategoryById(vvAppCategory); + } + + + + @Override + public int updateCoverVvAppCategoryById(VvAppCategoryEntity vvAppCategory){ + return vvAppCategoryDao.updateCoverVvAppCategoryById(vvAppCategory); + } + + + + @Override + public int deleteVvAppCategoryById(Long id){ + return vvAppCategoryDao.deleteVvAppCategoryById(id); + } + + + +} diff --git a/api-mapper/src/main/java/com/heyu/api/data/service/impl/vv/VvCategoryServiceImpl.java b/api-mapper/src/main/java/com/heyu/api/data/service/impl/vv/VvCategoryServiceImpl.java deleted file mode 100644 index f107668..0000000 --- a/api-mapper/src/main/java/com/heyu/api/data/service/impl/vv/VvCategoryServiceImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.heyu.api.data.service.impl.vv; -/** -*

-* 类目表 服务类 -*

-* -* @author quyixiao -* @since 2025-08-20 -*/ - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.heyu.api.data.dao.vv.VvCategoryDao; -import com.heyu.api.data.entity.vv.VvCategoryEntity; -import com.heyu.api.data.service.vv.VvCategoryService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -@Service -public class VvCategoryServiceImpl extends ServiceImpl implements VvCategoryService { - - - @Autowired - private VvCategoryDao vvCategoryDao; - - - - @Override - public VvCategoryEntity selectVvCategoryById(Long id){ - return vvCategoryDao.selectVvCategoryById(id); - } - - - - @Override - public Long insertVvCategory(VvCategoryEntity vvCategory){ - return vvCategoryDao.insertVvCategory(vvCategory); - } - - - - @Override - public Long insertOrUpdateVvCategory(VvCategoryEntity vvCategory){ - return vvCategoryDao.insertOrUpdateVvCategory(vvCategory); - } - - - - @Override - public int updateVvCategoryById(VvCategoryEntity vvCategory){ - return vvCategoryDao.updateVvCategoryById(vvCategory); - } - - - - @Override - public int updateCoverVvCategoryById(VvCategoryEntity vvCategory){ - return vvCategoryDao.updateCoverVvCategoryById(vvCategory); - } - - - - @Override - public int deleteVvCategoryById(Long id){ - return vvCategoryDao.deleteVvCategoryById(id); - } - - @Override - public List selectVvCategoryAll() { - return vvCategoryDao.selectVvCategoryAll(); - } - - -} diff --git a/api-mapper/src/main/java/com/heyu/api/data/service/vv/VvAdminCategoryService.java b/api-mapper/src/main/java/com/heyu/api/data/service/vv/VvAdminCategoryService.java new file mode 100644 index 0000000..a9f70e7 --- /dev/null +++ b/api-mapper/src/main/java/com/heyu/api/data/service/vv/VvAdminCategoryService.java @@ -0,0 +1,34 @@ +package com.heyu.api.data.service.vv; +/** +*

+* 类目表 服务类 +*

+* +* @author quyixiao +* @since 2025-08-24 +*/ +import com.baomidou.mybatisplus.extension.service.IService; +import com.heyu.api.data.entity.vv.VvAdminCategoryEntity; +public interface VvAdminCategoryService extends IService { + + + + VvAdminCategoryEntity selectVvAdminCategoryById(Long id); + + + Long insertVvAdminCategory(VvAdminCategoryEntity vvAdminCategory); + + + Long insertOrUpdateVvAdminCategory(VvAdminCategoryEntity vvAdminCategory); + + + int updateVvAdminCategoryById(VvAdminCategoryEntity vvAdminCategory); + + + int updateCoverVvAdminCategoryById(VvAdminCategoryEntity vvAdminCategory); + + + int deleteVvAdminCategoryById(Long id); + + +} \ No newline at end of file diff --git a/api-mapper/src/main/java/com/heyu/api/data/service/vv/VvAppCategoryService.java b/api-mapper/src/main/java/com/heyu/api/data/service/vv/VvAppCategoryService.java new file mode 100644 index 0000000..410d0d0 --- /dev/null +++ b/api-mapper/src/main/java/com/heyu/api/data/service/vv/VvAppCategoryService.java @@ -0,0 +1,34 @@ +package com.heyu.api.data.service.vv; +/** +*

+* 类目表 服务类 +*

+* +* @author quyixiao +* @since 2025-08-24 +*/ +import com.baomidou.mybatisplus.extension.service.IService; +import com.heyu.api.data.entity.vv.VvAppCategoryEntity; +public interface VvAppCategoryService extends IService { + + + + VvAppCategoryEntity selectVvAppCategoryById(Long id); + + + Long insertVvAppCategory(VvAppCategoryEntity vvAppCategory); + + + Long insertOrUpdateVvAppCategory(VvAppCategoryEntity vvAppCategory); + + + int updateVvAppCategoryById(VvAppCategoryEntity vvAppCategory); + + + int updateCoverVvAppCategoryById(VvAppCategoryEntity vvAppCategory); + + + int deleteVvAppCategoryById(Long id); + + +} \ No newline at end of file diff --git a/api-mapper/src/main/java/com/heyu/api/data/service/vv/VvCategoryService.java b/api-mapper/src/main/java/com/heyu/api/data/service/vv/VvCategoryService.java deleted file mode 100644 index b44e92b..0000000 --- a/api-mapper/src/main/java/com/heyu/api/data/service/vv/VvCategoryService.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.heyu.api.data.service.vv; -/** -*

-* 类目表 服务类 -*

-* -* @author quyixiao -* @since 2025-08-20 -*/ -import com.baomidou.mybatisplus.extension.service.IService; -import com.heyu.api.data.entity.vv.VvCategoryEntity; - -import java.util.List; - -public interface VvCategoryService extends IService { - - - - VvCategoryEntity selectVvCategoryById(Long id); - - - Long insertVvCategory(VvCategoryEntity vvCategory); - - - Long insertOrUpdateVvCategory(VvCategoryEntity vvCategory); - - - int updateVvCategoryById(VvCategoryEntity vvCategory); - - - int updateCoverVvCategoryById(VvCategoryEntity vvCategory); - - - int deleteVvCategoryById(Long id); - - - List selectVvCategoryAll(); -} \ No newline at end of file diff --git a/api-mapper/src/main/resources/mapper/vv/VvAdminCategoryDao.xml b/api-mapper/src/main/resources/mapper/vv/VvAdminCategoryDao.xml new file mode 100644 index 0000000..a7bd193 --- /dev/null +++ b/api-mapper/src/main/resources/mapper/vv/VvAdminCategoryDao.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/api-mapper/src/main/resources/mapper/vv/VvCategoryDao.xml b/api-mapper/src/main/resources/mapper/vv/VvAppCategoryDao.xml similarity index 71% rename from api-mapper/src/main/resources/mapper/vv/VvCategoryDao.xml rename to api-mapper/src/main/resources/mapper/vv/VvAppCategoryDao.xml index 056dcce..ec59d34 100644 --- a/api-mapper/src/main/resources/mapper/vv/VvCategoryDao.xml +++ b/api-mapper/src/main/resources/mapper/vv/VvAppCategoryDao.xml @@ -1,6 +1,6 @@ - + diff --git a/api-mapper/src/test/java/com/test/xxx/MysqlMain_insert.java b/api-mapper/src/test/java/com/test/xxx/MysqlMain_insert.java index 8bc6053..a8d4401 100644 --- a/api-mapper/src/test/java/com/test/xxx/MysqlMain_insert.java +++ b/api-mapper/src/test/java/com/test/xxx/MysqlMain_insert.java @@ -94,7 +94,8 @@ public class MysqlMain_insert { List list = new ArrayList(); - list.add(new TablesBean("vv_category_property_value")); + list.add(new TablesBean("vv_app_category")); + list.add(new TablesBean("vv_admin_category")); List list2 = new ArrayList(); diff --git a/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvCategoryIndexSortRequest.java b/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvAdminCategoryIndexSortRequest.java similarity index 67% rename from api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvCategoryIndexSortRequest.java rename to api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvAdminCategoryIndexSortRequest.java index 98b7f34..b40c093 100644 --- a/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvCategoryIndexSortRequest.java +++ b/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvAdminCategoryIndexSortRequest.java @@ -5,13 +5,13 @@ package com.heyu.api.alibaba.request.mm; import lombok.Data; @Data -public class VvCategoryIndexSortRequest { +public class VvAdminCategoryIndexSortRequest { /** * 类目id */ - private Long categoryId; + private Long adminCategoryId; /** diff --git a/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvAdminCategoryRequest.java b/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvAdminCategoryRequest.java new file mode 100644 index 0000000..606085a --- /dev/null +++ b/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvAdminCategoryRequest.java @@ -0,0 +1,15 @@ +package com.heyu.api.alibaba.request.mm; + + +import lombok.Data; + +@Data +public class VvAdminCategoryRequest { + + /*** + * 父亲id + */ + private Integer parentId = 0 ; + + +} diff --git a/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvCategorySortRequest.java b/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvAdminCategorySortRequest.java similarity index 54% rename from api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvCategorySortRequest.java rename to api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvAdminCategorySortRequest.java index 6411e26..4995944 100644 --- a/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvCategorySortRequest.java +++ b/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvAdminCategorySortRequest.java @@ -7,10 +7,10 @@ import lombok.Data; import java.util.List; @Data -public class VvCategorySortRequest { +public class VvAdminCategorySortRequest { - private List categoryIds; + private List adminCategoryIds; } diff --git a/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvAppCategoryIndexSortRequest.java b/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvAppCategoryIndexSortRequest.java new file mode 100644 index 0000000..ae7d511 --- /dev/null +++ b/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvAppCategoryIndexSortRequest.java @@ -0,0 +1,22 @@ + +package com.heyu.api.alibaba.request.mm; + + +import lombok.Data; + +@Data +public class VvAppCategoryIndexSortRequest { + + + /** + * app 类目id + */ + private Long appCategoryId; + + + /** + * 排序 + */ + private int defaultSort; + +} diff --git a/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvCategoryRequest.java b/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvAppCategoryRequest.java similarity index 79% rename from api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvCategoryRequest.java rename to api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvAppCategoryRequest.java index 2657d8b..9bc0079 100644 --- a/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvCategoryRequest.java +++ b/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvAppCategoryRequest.java @@ -4,7 +4,7 @@ package com.heyu.api.alibaba.request.mm; import lombok.Data; @Data -public class VvCategoryRequest { +public class VvAppCategoryRequest { /*** * 父亲id diff --git a/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvAppCategorySortRequest.java b/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvAppCategorySortRequest.java new file mode 100644 index 0000000..a055e72 --- /dev/null +++ b/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvAppCategorySortRequest.java @@ -0,0 +1,18 @@ + +package com.heyu.api.alibaba.request.mm; + + +import lombok.Data; + +import java.util.List; + +@Data +public class VvAppCategorySortRequest { + + + /*** + * app 类目id + */ + private List appCategoryIds; + +} diff --git a/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvCategoryPropertyRequest.java b/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvCategoryPropertyRequest.java index a7e2f3d..460121b 100644 --- a/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvCategoryPropertyRequest.java +++ b/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvCategoryPropertyRequest.java @@ -6,16 +6,26 @@ import lombok.Data; @Data public class VvCategoryPropertyRequest { - private Integer pageNum; + private Integer pageNum = 1 ; - private Integer pageSize; + private Integer pageSize = 10; - private String propertyName; + /*** + * 属性名称 + */ + private String categoryPropertyName; + + /** + * 类目名称 + */ private String categoryName; + /*** + * 类目id + */ private Long categoryId; diff --git a/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvPropertyInsertOrUpdateRequest.java b/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvPropertyInsertOrUpdateRequest.java index eda3af4..2c7bfeb 100644 --- a/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvPropertyInsertOrUpdateRequest.java +++ b/api-third/src/main/java/com/heyu/api/alibaba/request/mm/VvPropertyInsertOrUpdateRequest.java @@ -8,15 +8,9 @@ import java.util.List; @Data public class VvPropertyInsertOrUpdateRequest extends VvCategoryPropertyEntity { - - /*** * 属性值列表 */ private List vvCategoryPropertyValueEntities; - - - - } diff --git a/api-web/api-interface/src/main/java/com/heyu/api/controller/mm/AdminCategoryController.java b/api-web/api-interface/src/main/java/com/heyu/api/controller/mm/AdminCategoryController.java new file mode 100644 index 0000000..becf018 --- /dev/null +++ b/api-web/api-interface/src/main/java/com/heyu/api/controller/mm/AdminCategoryController.java @@ -0,0 +1,99 @@ +package com.heyu.api.controller.mm; + + +import com.heyu.api.alibaba.request.mm.VvAdminCategoryIndexSortRequest; +import com.heyu.api.alibaba.request.mm.VvAdminCategoryRequest; +import com.heyu.api.alibaba.request.mm.VvAdminCategorySortRequest; +import com.heyu.api.data.dao.vv.VvAdminCategoryDao; +import com.heyu.api.data.dto.vv.VvAdminCategoryCategoryDTO; +import com.heyu.api.data.entity.vv.VvAdminCategoryEntity; +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("/mm/admin/category") +public class AdminCategoryController { + + @Autowired + private VvAdminCategoryDao vvAdminCategoryDao; + + /*** + * 列表 + * + * + * http://localhost:8888/mm/category/list + * + * + */ + @RequestMapping("/list") + public R list(@RequestBody VvAdminCategoryRequest vvCategoryRequest) { + List vvCategoryEntities = vvAdminCategoryDao.selectVvCategoryAll(); + List list = vvAdminCategoryDao.selectVvCategoryByParentId(vvCategoryRequest.getParentId()); + List vvCategoryDTOS = new ArrayList<>(); + for (VvAdminCategoryEntity vvCategoryEntity : list) { + VvAdminCategoryCategoryDTO vvCategoryDTO = new VvAdminCategoryCategoryDTO(); + BeanUtils.copyProperties(vvCategoryEntity, vvCategoryDTO); + boolean has = hasChild(vvCategoryEntity, vvCategoryEntities); + vvCategoryDTO.setHasChild(has ? 1 : 0); + vvCategoryDTOS.add(vvCategoryDTO); + } + return R.ok().setData(vvCategoryDTOS); + } + + /*** + * 插入或更新 + * @param vvCategoryEntity + * @return + */ + @RequestMapping("/insertOrUpdate") + public R insert(@RequestBody VvAdminCategoryEntity vvCategoryEntity) { + vvAdminCategoryDao.insertOrUpdateVvAdminCategory(vvCategoryEntity); + return R.ok().setData("保存成功"); + } + + /*** + * 排序 + */ + @RequestMapping("/sort") + public R sort(@RequestBody VvAdminCategorySortRequest vvCategorySortRequest) { + List list = vvAdminCategoryDao.selectVvCategoryByIds(vvCategorySortRequest.getAdminCategoryIds()); + List categoryIds = vvCategorySortRequest.getAdminCategoryIds(); + for (VvAdminCategoryEntity vvCategoryEntity : list) { + int index = categoryIds.indexOf(vvCategoryEntity.getId()) + 1; + vvCategoryEntity.setDefaultSort(index); + vvAdminCategoryDao.insertOrUpdateVvAdminCategory(vvCategoryEntity); + } + return R.ok().setData("保存成功"); + } + + + /*** + * 排序 + */ + @RequestMapping("/update/sort/index") + public R updateSortIndex(@RequestBody VvAdminCategoryIndexSortRequest vvCategorySortRequest) { + VvAdminCategoryEntity vvCategory = vvAdminCategoryDao.selectVvAdminCategoryById(vvCategorySortRequest.getAdminCategoryId()); + vvCategory.setDefaultSort(vvCategorySortRequest.getDefaultSort()); + vvAdminCategoryDao.insertOrUpdateVvAdminCategory(vvCategory); + return R.ok().setData("保存成功"); + } + + public boolean hasChild(VvAdminCategoryEntity vvCategoryEntity, List vvCategoryEntities) { + for (VvAdminCategoryEntity categoryEntity : vvCategoryEntities) { + if (vvCategoryEntity.getId().equals(categoryEntity.getParentId())) { + return true; + } + } + return false; + } + +} diff --git a/api-web/api-interface/src/main/java/com/heyu/api/controller/mm/AppCategoryController.java b/api-web/api-interface/src/main/java/com/heyu/api/controller/mm/AppCategoryController.java new file mode 100644 index 0000000..c64635d --- /dev/null +++ b/api-web/api-interface/src/main/java/com/heyu/api/controller/mm/AppCategoryController.java @@ -0,0 +1,100 @@ +package com.heyu.api.controller.mm; + + +import com.heyu.api.alibaba.request.mm.VvAppCategoryIndexSortRequest; +import com.heyu.api.alibaba.request.mm.VvAppCategoryRequest; +import com.heyu.api.alibaba.request.mm.VvAppCategorySortRequest; +import com.heyu.api.data.dao.vv.VvAppCategoryDao; +import com.heyu.api.data.dto.vv.VvAdminCategoryCategoryDTO; +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("/mm/app/category") +public class AppCategoryController { + + @Autowired + private VvAppCategoryDao vvAppCategoryDao; + + /*** + * 列表 + * + * + * http://localhost:8888/mm/category/list + */ + @RequestMapping("/list") + public R list(@RequestBody VvAppCategoryRequest vvCategoryRequest) { + List vvCategoryEntities = vvAppCategoryDao.selectVvCategoryAll(); + List list = vvAppCategoryDao.selectVvCategoryByParentId(vvCategoryRequest.getParentId()); + List vvCategoryDTOS = new ArrayList<>(); + for (VvAppCategoryEntity vvCategoryEntity : list) { + VvAdminCategoryCategoryDTO vvCategoryDTO = new VvAdminCategoryCategoryDTO(); + BeanUtils.copyProperties(vvCategoryEntity, vvCategoryDTO); + boolean has = hasChild(vvCategoryEntity, vvCategoryEntities); + vvCategoryDTO.setHasChild(has ? 1 : 0); + vvCategoryDTOS.add(vvCategoryDTO); + } + return R.ok().setData(vvCategoryDTOS); + } + + + /*** + * 插入或更新 + * @param vvCategoryEntity + * @return + */ + @RequestMapping("/insertOrUpdate") + public R insert(@RequestBody VvAppCategoryEntity vvCategoryEntity) { + vvAppCategoryDao.insertOrUpdateVvAppCategory(vvCategoryEntity); + return R.ok().setData("保存成功"); + } + + + /*** + * 排序 + */ + @RequestMapping("/sort") + public R sort(@RequestBody VvAppCategorySortRequest vvCategorySortRequest) { + List list = vvAppCategoryDao.selectVvCategoryByIds(vvCategorySortRequest.getAppCategoryIds()); + List categoryIds = vvCategorySortRequest.getAppCategoryIds(); + for (VvAppCategoryEntity vvCategoryEntity : list) { + int index = categoryIds.indexOf(vvCategoryEntity.getId()) + 1; + vvCategoryEntity.setDefaultSort(index); + vvAppCategoryDao.insertOrUpdateVvAppCategory(vvCategoryEntity); + } + return R.ok().setData("保存成功"); + } + + + /*** + * 排序 + */ + @RequestMapping("/update/sort/index") + public R updateSortIndex(@RequestBody VvAppCategoryIndexSortRequest vvCategorySortRequest) { + VvAppCategoryEntity vvCategory = vvAppCategoryDao.selectVvAppCategoryById(vvCategorySortRequest.getAppCategoryId()); + vvCategory.setDefaultSort(vvCategorySortRequest.getDefaultSort()); + vvAppCategoryDao.insertOrUpdateVvAppCategory(vvCategory); + return R.ok().setData("保存成功"); + } + + + public boolean hasChild(VvAppCategoryEntity vvCategoryEntity, List vvCategoryEntities) { + for (VvAppCategoryEntity categoryEntity : vvCategoryEntities) { + if (vvCategoryEntity.getId().equals(categoryEntity.getParentId())) { + return true; + } + } + return false; + } + +} diff --git a/api-web/api-interface/src/main/java/com/heyu/api/controller/mm/CategoryController.java b/api-web/api-interface/src/main/java/com/heyu/api/controller/mm/CategoryController.java deleted file mode 100644 index 6029163..0000000 --- a/api-web/api-interface/src/main/java/com/heyu/api/controller/mm/CategoryController.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.heyu.api.controller.mm; - - -import com.heyu.api.alibaba.request.mm.VvCategoryIndexSortRequest; -import com.heyu.api.alibaba.request.mm.VvCategoryRequest; -import com.heyu.api.alibaba.request.mm.VvCategorySortRequest; -import com.heyu.api.data.dao.vv.VvCategoryDao; -import com.heyu.api.data.dto.vv.VvCategoryDTO; -import com.heyu.api.data.entity.vv.VvCategoryEntity; -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("/mm/category") -public class CategoryController { - - @Autowired - private VvCategoryDao vvCategoryDao; - - /*** - * 列表 - * - * - * http://localhost:8888/mm/category/list - * - * - */ - @RequestMapping("/list") - public R list(@RequestBody VvCategoryRequest vvCategoryRequest) { - List vvCategoryEntities = vvCategoryDao.selectVvCategoryAll(); - List list = vvCategoryDao.selectVvCategoryByParentId(vvCategoryRequest.getParentId()); - List vvCategoryDTOS = new ArrayList<>(); - for (VvCategoryEntity vvCategoryEntity : list) { - VvCategoryDTO vvCategoryDTO = new VvCategoryDTO(); - BeanUtils.copyProperties(vvCategoryEntity, vvCategoryDTO); - boolean has = hasChild(vvCategoryEntity, vvCategoryEntities); - vvCategoryDTO.setHasChild(has ? 1 : 0); - vvCategoryDTOS.add(vvCategoryDTO); - } - return R.ok().setData(vvCategoryDTOS); - } - - - - - /*** - * 插入或更新 - * @param vvCategoryEntity - * @return - */ - @RequestMapping("/insertOrUpdate") - public R insert(@RequestBody VvCategoryEntity vvCategoryEntity) { - vvCategoryDao.insertOrUpdateVvCategory(vvCategoryEntity); - return R.ok().setData("保存成功"); - } - - /*** - * 排序 - */ - @RequestMapping("/sort") - public R sort(@RequestBody VvCategorySortRequest vvCategorySortRequest) { - List list = vvCategoryDao.selectVvCategoryByIds(vvCategorySortRequest.getCategoryIds()); - List categoryIds = vvCategorySortRequest.getCategoryIds(); - for (VvCategoryEntity vvCategoryEntity : list) { - int index = categoryIds.indexOf(vvCategoryEntity.getId()) + 1; - vvCategoryEntity.setDefaultSort(index); - vvCategoryDao.updateVvCategoryById(vvCategoryEntity); - } - return R.ok().setData("保存成功"); - } - - - /*** - * 排序 - */ - @RequestMapping("/update/sort/index") - public R updateSortIndex(@RequestBody VvCategoryIndexSortRequest vvCategorySortRequest) { - VvCategoryEntity vvCategory = vvCategoryDao.selectVvCategoryById(vvCategorySortRequest.getCategoryId()); - vvCategory.setDefaultSort(vvCategorySortRequest.getDefaultSort()); - vvCategoryDao.updateVvCategoryById(vvCategory); - return R.ok().setData("保存成功"); - } - - public boolean hasChild(VvCategoryEntity vvCategoryEntity, List vvCategoryEntities) { - for (VvCategoryEntity categoryEntity : vvCategoryEntities) { - if (vvCategoryEntity.getId().equals(categoryEntity.getParentId())) { - return true; - } - } - return false; - } - -} diff --git a/api-web/api-interface/src/main/java/com/heyu/api/controller/mm/PropertyController.java b/api-web/api-interface/src/main/java/com/heyu/api/controller/mm/CategoryPropertyController.java similarity index 50% rename from api-web/api-interface/src/main/java/com/heyu/api/controller/mm/PropertyController.java rename to api-web/api-interface/src/main/java/com/heyu/api/controller/mm/CategoryPropertyController.java index d3783d7..76f430c 100644 --- a/api-web/api-interface/src/main/java/com/heyu/api/controller/mm/PropertyController.java +++ b/api-web/api-interface/src/main/java/com/heyu/api/controller/mm/CategoryPropertyController.java @@ -1,6 +1,7 @@ package com.heyu.api.controller.mm; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.metadata.IPage; import com.heyu.api.alibaba.request.mm.*; import com.heyu.api.data.dao.vv.VvCategoryPropertyDao; @@ -15,6 +16,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections.CollectionUtils; 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; @@ -23,8 +25,8 @@ import java.util.List; @Slf4j @RestController -@RequestMapping("/mm/property") -public class PropertyController { +@RequestMapping("/mm/category/property") +public class CategoryPropertyController { @Autowired private VvCategoryPropertyDao vvCategoryPropertyDao; @@ -38,12 +40,15 @@ public class PropertyController { * 列表 */ @RequestMapping("/list") - public R list(VvCategoryPropertyRequest vvPropertyRequest) { + public R list(@RequestBody VvCategoryPropertyRequest vvPropertyRequest) { PPageUtils pageUtils = PPageUtils.startPage(vvPropertyRequest.getPageNum(), vvPropertyRequest.getPageSize()).doSelect(new ISelect() { @Override public List doSelect(IPage page) { - return vvCategoryPropertyDao.selectVvProperByCondition(page, vvPropertyRequest.getPropertyName(), vvPropertyRequest.getCategoryName(), vvPropertyRequest.getCategoryId()); + return vvCategoryPropertyDao.selectVvProperByCondition(page, + vvPropertyRequest.getCategoryPropertyName(), + vvPropertyRequest.getCategoryName(), + vvPropertyRequest.getCategoryId()); } }); @@ -70,26 +75,82 @@ public class PropertyController { * @return */ @RequestMapping("/insertOrUpdate") - public R insert(VvPropertyInsertOrUpdateRequest vvPropertyInsertOrUpdateRequest) { + public R insert(@RequestBody List vvPropertyInsertOrUpdateRequestList) { - VvCategoryPropertyEntity vvPropertyEntity = new VvCategoryPropertyEntity(); + for(VvPropertyInsertOrUpdateRequest vvPropertyInsertOrUpdateRequest : vvPropertyInsertOrUpdateRequestList){ + VvCategoryPropertyEntity vvPropertyEntity = new VvCategoryPropertyEntity(); + BeanUtils.copyProperties(vvPropertyInsertOrUpdateRequest, vvPropertyEntity); + vvCategoryPropertyDao.insertOrUpdateVvCategoryProperty(vvPropertyEntity); - BeanUtils.copyProperties(vvPropertyInsertOrUpdateRequest, vvPropertyEntity); - vvCategoryPropertyDao.insertOrUpdateVvCategoryProperty(vvPropertyEntity); - - if (CollectionUtils.isNotEmpty(vvPropertyInsertOrUpdateRequest.getVvCategoryPropertyValueEntities())) { - for (VvCategoryPropertyValueEntity vvPropertyValueEntity : vvPropertyInsertOrUpdateRequest.getVvCategoryPropertyValueEntities()) { - vvCategoryPropertyValueDao.insertOrUpdateVvCategoryPropertyValue(vvPropertyValueEntity); + if (CollectionUtils.isNotEmpty(vvPropertyInsertOrUpdateRequest.getVvCategoryPropertyValueEntities())) { + for (VvCategoryPropertyValueEntity vvPropertyValueEntity : vvPropertyInsertOrUpdateRequest.getVvCategoryPropertyValueEntities()) { + vvCategoryPropertyValueDao.insertOrUpdateVvCategoryPropertyValue(vvPropertyValueEntity); + } } } return R.ok().setData("保存成功"); } + + public static void main(String[] args) { + VvPropertyInsertOrUpdateRequest vvCategoryPropertyEntity1 = new VvPropertyInsertOrUpdateRequest(); + + vvCategoryPropertyEntity1.setCategoryId(17L); + vvCategoryPropertyEntity1.setCategoryName("项圈"); + vvCategoryPropertyEntity1.setCategoryPropertyName("珍珠直径"); + vvCategoryPropertyEntity1.setDefaultSort(1); + + + VvCategoryPropertyValueEntity vvCategoryPropertyValueEntity11 = new VvCategoryPropertyValueEntity(); + vvCategoryPropertyValueEntity11.setCategoryPropertyValue("5-5.5mm"); + + VvCategoryPropertyValueEntity vvCategoryPropertyValueEntity12 = new VvCategoryPropertyValueEntity(); + vvCategoryPropertyValueEntity12.setCategoryPropertyValue("5.5-6mm"); + + + List vvCategoryPropertyValueEntities1 = new ArrayList<>(); + vvCategoryPropertyValueEntities1.add(vvCategoryPropertyValueEntity11); + vvCategoryPropertyValueEntities1.add(vvCategoryPropertyValueEntity12); + vvCategoryPropertyEntity1.setVvCategoryPropertyValueEntities(vvCategoryPropertyValueEntities1); + + + + + VvPropertyInsertOrUpdateRequest vvCategoryPropertyEntity2 = new VvPropertyInsertOrUpdateRequest(); + vvCategoryPropertyEntity2.setCategoryId(17L); + vvCategoryPropertyEntity2.setCategoryName("项圈"); + vvCategoryPropertyEntity2.setCategoryPropertyName("颜色分类"); + vvCategoryPropertyEntity2.setDefaultSort(2); + + + + VvCategoryPropertyValueEntity vvCategoryPropertyValueEntity21 = new VvCategoryPropertyValueEntity(); + vvCategoryPropertyValueEntity21.setCategoryPropertyValue("【臻藏】极光镜面AKOYA/ S925银扣"); + + VvCategoryPropertyValueEntity vvCategoryPropertyValueEntity22 = new VvCategoryPropertyValueEntity(); + vvCategoryPropertyValueEntity22.setCategoryPropertyValue("【臻品】GUILD极光大证 / 18K金扣"); + + List vvCategoryPropertyValueEntities2 = new ArrayList<>(); + vvCategoryPropertyValueEntities2.add(vvCategoryPropertyValueEntity21); + vvCategoryPropertyValueEntities2.add(vvCategoryPropertyValueEntity22); + + vvCategoryPropertyEntity2.setVvCategoryPropertyValueEntities(vvCategoryPropertyValueEntities2); + + + List vvPropertyInsertOrUpdateRequestList = new ArrayList<>(); + vvPropertyInsertOrUpdateRequestList.add(vvCategoryPropertyEntity1); + vvPropertyInsertOrUpdateRequestList.add(vvCategoryPropertyEntity2); + + System.out.println(JSON.toJSONString(vvPropertyInsertOrUpdateRequestList)); + + + } + /*** * 排序 */ @RequestMapping("/sort") - public R sort(VvCategoryPropertySortRequest vvPropertySortRequest) { + public R sort(@RequestBody VvCategoryPropertySortRequest vvPropertySortRequest) { List propertyEntities = vvCategoryPropertyDao.selectVvPropertyByIds(vvPropertySortRequest.getCategoryPropertyIds()); for (VvCategoryPropertyEntity propertyEntity : propertyEntities) { propertyEntity.setDefaultSort(vvPropertySortRequest.getCategoryPropertyIds().indexOf(propertyEntity.getId()) + 1); @@ -103,7 +164,7 @@ public class PropertyController { * 排序 */ @RequestMapping("/value/sort") - public R sortValue(VvCategoryPropertyValueSortRequest vvPropertyValueSortRequest) { + public R sortValue(@RequestBody VvCategoryPropertyValueSortRequest vvPropertyValueSortRequest) { List propertyEntities = vvCategoryPropertyValueDao.selectVvPropertyValueByIds(vvPropertyValueSortRequest.getCategoryPropertyValueIds()); for (VvCategoryPropertyValueEntity propertyEntity : propertyEntities) { propertyEntity.setDefaultSort(vvPropertyValueSortRequest.getCategoryPropertyValueIds().indexOf(propertyEntity.getId()) + 1); @@ -116,7 +177,7 @@ public class PropertyController { * 排序 */ @RequestMapping("/update/sort/index") - public R updateSortIndex(VvCategoryPropertyIndexSortRequest vvCategorySortRequest) { + public R updateSortIndex(@RequestBody VvCategoryPropertyIndexSortRequest vvCategorySortRequest) { VvCategoryPropertyEntity vvPropertyEntity = vvCategoryPropertyDao.selectVvCategoryPropertyById(vvCategorySortRequest.getCategoryPropertyId()); vvPropertyEntity.setDefaultSort(vvCategorySortRequest.getDefaultSort()); vvCategoryPropertyDao.insertOrUpdateVvCategoryProperty(vvPropertyEntity); @@ -128,7 +189,7 @@ public class PropertyController { * 排序 */ @RequestMapping("/update/value/sort/index") - public R updateSortIndex(VvCategoryPropertyIndexValueSortRequest vvCategorySortRequest) { + public R updateSortIndex(@RequestBody VvCategoryPropertyIndexValueSortRequest vvCategorySortRequest) { VvCategoryPropertyValueEntity vvPropertyValue = vvCategoryPropertyValueDao.selectVvCategoryPropertyValueById(vvCategorySortRequest.getCategoryPropertyValueId()); vvPropertyValue.setDefaultSort(vvCategorySortRequest.getDefaultSort()); vvCategoryPropertyValueDao.insertOrUpdateVvCategoryPropertyValue(vvPropertyValue); diff --git a/api-web/api-interface/src/main/java/com/heyu/api/controller/mm/ProductController.java b/api-web/api-interface/src/main/java/com/heyu/api/controller/mm/ProductController.java index df247d1..3752cba 100644 --- a/api-web/api-interface/src/main/java/com/heyu/api/controller/mm/ProductController.java +++ b/api-web/api-interface/src/main/java/com/heyu/api/controller/mm/ProductController.java @@ -324,7 +324,7 @@ public class ProductController { @RequestMapping("/test/save") public R save(@RequestBody VvProductDTO vvProductDTO) { - VvProductEntity vvProduct = vvProductDao.selectVvProductById(3L); + VvProductEntity vvProduct = vvProductDao.selectVvProductById(4L); VvProductPropertyEntity vvProductPropertyEntity1 = vvProductPropertyDao.selectVvProductPropertyById(1L); diff --git a/api-web/api-interface/src/main/java/com/heyu/api/controller/vv/AppOrderController.java b/api-web/api-interface/src/main/java/com/heyu/api/controller/vv/AppOrderController.java index cc8a72e..f3c3eaa 100644 --- a/api-web/api-interface/src/main/java/com/heyu/api/controller/vv/AppOrderController.java +++ b/api-web/api-interface/src/main/java/com/heyu/api/controller/vv/AppOrderController.java @@ -226,8 +226,8 @@ public class AppOrderController { for (VvSkuPropertyValueEntity vvSkuPropertyValueEntity : vvSkuPropertyValueEntities) { PropertyNameValue propertyNameValue = new PropertyNameValue(); - propertyNameValue.setPropertyName(vvSkuPropertyValueEntity.getPropertyName()); - propertyNameValue.setPropertyValue(vvSkuPropertyValueEntity.getPropertyValue()); + propertyNameValue.setPropertyName(vvSkuPropertyValueEntity.getProductPropertyName()); + propertyNameValue.setPropertyValue(vvSkuPropertyValueEntity.getProductPropertyValue()); propertyNameValues.add(propertyNameValue); } diff --git a/api-web/api-interface/src/main/java/com/heyu/api/controller/vv/AppShoppingCartController.java b/api-web/api-interface/src/main/java/com/heyu/api/controller/vv/AppShoppingCartController.java index fe4885b..69cba74 100644 --- a/api-web/api-interface/src/main/java/com/heyu/api/controller/vv/AppShoppingCartController.java +++ b/api-web/api-interface/src/main/java/com/heyu/api/controller/vv/AppShoppingCartController.java @@ -84,8 +84,8 @@ public class AppShoppingCartController { for (VvSkuPropertyValueEntity vvSkuPropertyValueEntity : vvSkuPropertyValueEntities) { PropertyNameValue propertyNameValue = new PropertyNameValue(); - propertyNameValue.setPropertyName(vvSkuPropertyValueEntity.getPropertyName()); - propertyNameValue.setPropertyValue(vvSkuPropertyValueEntity.getPropertyValue()); + propertyNameValue.setPropertyName(vvSkuPropertyValueEntity.getProductPropertyName()); + propertyNameValue.setPropertyValue(vvSkuPropertyValueEntity.getProductPropertyValue()); propertyNameValues.add(propertyNameValue); }