提交修改
This commit is contained in:
parent
63eb63451d
commit
ad2b5d4c5d
@ -14,19 +14,19 @@ public class VvCategoryPropertyRequest {
|
||||
/***
|
||||
* 属性名称
|
||||
*/
|
||||
private String categoryPropertyName;
|
||||
private String adminCategoryPropertyName;
|
||||
|
||||
|
||||
/**
|
||||
* 类目名称
|
||||
*/
|
||||
private String categoryName;
|
||||
private String adminCategoryName;
|
||||
|
||||
|
||||
/***
|
||||
* 类目id
|
||||
*/
|
||||
private Long categoryId;
|
||||
private Long adminCategoryId;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@ import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/mm/category/property")
|
||||
@RequestMapping("/mm/admin/category/property")
|
||||
public class CategoryPropertyController {
|
||||
|
||||
@Autowired
|
||||
@ -46,9 +46,9 @@ public class CategoryPropertyController {
|
||||
@Override
|
||||
public List doSelect(IPage page) {
|
||||
return vvCategoryPropertyDao.selectVvProperByCondition(page,
|
||||
vvPropertyRequest.getCategoryPropertyName(),
|
||||
vvPropertyRequest.getCategoryName(),
|
||||
vvPropertyRequest.getCategoryId());
|
||||
vvPropertyRequest.getAdminCategoryPropertyName(),
|
||||
vvPropertyRequest.getAdminCategoryName(),
|
||||
vvPropertyRequest.getAdminCategoryId());
|
||||
|
||||
}
|
||||
});
|
||||
@ -76,15 +76,18 @@ public class CategoryPropertyController {
|
||||
*/
|
||||
@RequestMapping("/insertOrUpdate")
|
||||
public R insert(@RequestBody List<VvPropertyInsertOrUpdateRequest> vvPropertyInsertOrUpdateRequestList) {
|
||||
|
||||
for(VvPropertyInsertOrUpdateRequest vvPropertyInsertOrUpdateRequest : vvPropertyInsertOrUpdateRequestList){
|
||||
VvCategoryPropertyEntity vvPropertyEntity = new VvCategoryPropertyEntity();
|
||||
BeanUtils.copyProperties(vvPropertyInsertOrUpdateRequest, vvPropertyEntity);
|
||||
vvCategoryPropertyDao.insertOrUpdateVvCategoryProperty(vvPropertyEntity);
|
||||
|
||||
if (CollectionUtils.isNotEmpty(vvPropertyInsertOrUpdateRequest.getVvCategoryPropertyValueEntities())) {
|
||||
int i = 1;
|
||||
for (VvCategoryPropertyValueEntity vvPropertyValueEntity : vvPropertyInsertOrUpdateRequest.getVvCategoryPropertyValueEntities()) {
|
||||
vvPropertyValueEntity.setCategoryPropertyId(vvPropertyEntity.getId());
|
||||
vvPropertyValueEntity.setDefaultSort(i);
|
||||
vvCategoryPropertyValueDao.insertOrUpdateVvCategoryPropertyValue(vvPropertyValueEntity);
|
||||
i ++ ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user