提交修改
This commit is contained in:
parent
2b6fbece7e
commit
20a8fac546
@ -10,6 +10,7 @@ package com.heyu.api.data.dao.vv;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.heyu.api.data.entity.vv.VvPropertyEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.lz.mybatis.plugin.annotations.LIKE;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@ -38,5 +39,5 @@ public interface VvPropertyDao extends BaseMapper<VvPropertyEntity> {
|
||||
|
||||
|
||||
|
||||
List<VvPropertyEntity> selectVvProperByCondition(IPage page, String propertyName, String categoryName, Long categoryId);
|
||||
List<VvPropertyEntity> selectVvProperByCondition(IPage page, @LIKE String propertyName,@LIKE String categoryName, Long categoryId);
|
||||
}
|
||||
@ -9,8 +9,12 @@ package com.heyu.api.data.dao.vv;
|
||||
*/
|
||||
import com.heyu.api.data.entity.vv.VvPropertyValueEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
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 VvPropertyValueDao extends BaseMapper<VvPropertyValueEntity> {
|
||||
|
||||
@ -33,4 +37,6 @@ public interface VvPropertyValueDao extends BaseMapper<VvPropertyValueEntity> {
|
||||
int deleteVvPropertyValueById(@Param("id")Long id);
|
||||
|
||||
|
||||
@OrderBy(VvPropertyValueEntity.default_sort)
|
||||
List<VvPropertyValueEntity> selectVvPropertyValueByPropertyId(Long propertyId);
|
||||
}
|
||||
@ -1,10 +1,11 @@
|
||||
package com.heyu.api.data.dto;
|
||||
package com.heyu.api.data.dto.vv;
|
||||
|
||||
import com.heyu.api.data.entity.vv.VvCategoryEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class VvCategoryDTO extends VvCategoryEntity {
|
||||
public class
|
||||
VvCategoryDTO extends VvCategoryEntity {
|
||||
/***
|
||||
* 是否有child
|
||||
*/
|
||||
@ -0,0 +1,14 @@
|
||||
package com.heyu.api.data.dto.vv;
|
||||
|
||||
import com.heyu.api.data.entity.vv.VvPropertyEntity;
|
||||
import com.heyu.api.data.entity.vv.VvPropertyValueEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
public class VvPropertyDTO extends VvPropertyEntity {
|
||||
|
||||
private List<VvPropertyValueEntity> vvPropertyValueList;
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.heyu.api.alibaba.request.mm;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class VvPropertyCategoryRequest {
|
||||
|
||||
|
||||
|
||||
|
||||
/***
|
||||
* 类目id
|
||||
*/
|
||||
private Long categoryId;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -5,7 +5,7 @@ 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.VvCategoryDTO;
|
||||
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;
|
||||
|
||||
@ -3,20 +3,24 @@ package com.heyu.api.controller.mm;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.alibaba.request.mm.VvPropertyRequest;
|
||||
import com.heyu.api.data.dao.vv.VvPropertyDao;
|
||||
import com.heyu.api.data.dao.vv.VvPropertyValueDao;
|
||||
import com.heyu.api.data.dto.vv.VvPropertyDTO;
|
||||
import com.heyu.api.data.entity.vv.VvCategoryEntity;
|
||||
import com.heyu.api.data.entity.vv.VvPropertyEntity;
|
||||
import com.heyu.api.data.entity.vv.VvPropertyValueEntity;
|
||||
import com.heyu.api.data.utils.R;
|
||||
import com.heyu.api.utils.ISelect;
|
||||
import com.heyu.api.utils.PPageUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@ -31,12 +35,13 @@ public class PropertyController {
|
||||
@Autowired
|
||||
private VvPropertyValueDao vvPropertyValueDao;
|
||||
|
||||
|
||||
/***
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
public R list(VvPropertyRequest vvPropertyRequest) {
|
||||
PPageUtils pageUtils = PPageUtils.startPage(vvPropertyRequest.getPageNum(), vvPropertyRequest.getPageSize())
|
||||
PPageUtils pageUtils = PPageUtils.startPage(vvPropertyRequest.getPageNum(), vvPropertyRequest.getPageSize())
|
||||
.doSelect(new ISelect() {
|
||||
@Override
|
||||
public List doSelect(IPage page) {
|
||||
@ -49,21 +54,22 @@ public class PropertyController {
|
||||
}
|
||||
});
|
||||
|
||||
List<VvPropertyEntity> vvPropertyEntities = pageUtils.getRows();
|
||||
|
||||
List<VvPropertyDTO> vvPropertyDTOS = new ArrayList<>();
|
||||
for (VvPropertyEntity vvPropertyEntity : vvPropertyEntities) {
|
||||
VvPropertyDTO vvPropertyDTO = new VvPropertyDTO();
|
||||
BeanUtils.copyProperties(vvPropertyEntity, vvPropertyDTO);
|
||||
List<VvPropertyValueEntity> vvPropertyValueEntityList = vvPropertyValueDao.selectVvPropertyValueByPropertyId(vvPropertyEntity.getId());
|
||||
vvPropertyDTO.setVvPropertyValueList(vvPropertyValueEntityList);
|
||||
vvPropertyDTOS.add(vvPropertyDTO);
|
||||
}
|
||||
|
||||
pageUtils.setRows(vvPropertyDTOS);
|
||||
return R.ok().setData(pageUtils);
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* 属性列表
|
||||
*/
|
||||
@RequestMapping("/category/list")
|
||||
public R list(VvCategoryRequest vvCategoryRequest) {
|
||||
|
||||
return R.ok().setData("");
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* 插入或更新
|
||||
* @param vvCategoryEntity
|
||||
@ -84,7 +90,6 @@ public class PropertyController {
|
||||
return R.ok().setData("保存成功");
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* 排序
|
||||
*/
|
||||
@ -92,30 +97,8 @@ public class PropertyController {
|
||||
public R updateSortIndex(VvCategoryIndexSortRequest vvCategorySortRequest) {
|
||||
|
||||
|
||||
|
||||
|
||||
return R.ok().setData("保存成功");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user