|
@@ -2,9 +2,7 @@ package com.example.xiaoshiweixinback.service;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
-import com.baomidou.mybatisplus.extension.conditions.update.UpdateChainWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.example.xiaoshiweixinback.business.common.base.Records;
|
|
@@ -12,6 +10,8 @@ import com.example.xiaoshiweixinback.business.common.base.SystemFile;
|
|
|
import com.example.xiaoshiweixinback.business.exception.BusinessException;
|
|
|
import com.example.xiaoshiweixinback.business.exception.ExceptionEnum;
|
|
|
import com.example.xiaoshiweixinback.business.utils.BeanUtil;
|
|
|
+import com.example.xiaoshiweixinback.business.utils.CacheUtil;
|
|
|
+import com.example.xiaoshiweixinback.business.utils.LoginUtils;
|
|
|
import com.example.xiaoshiweixinback.business.utils.ToolUtil;
|
|
|
import com.example.xiaoshiweixinback.domain.*;
|
|
|
import com.example.xiaoshiweixinback.entity.dto.ProductCategoryDTO;
|
|
@@ -19,6 +19,7 @@ import com.example.xiaoshiweixinback.entity.dto.productCategory.AddCategoryDTO;
|
|
|
import com.example.xiaoshiweixinback.entity.dto.productCategory.CategoryIdDTO;
|
|
|
import com.example.xiaoshiweixinback.entity.dto.productCategory.CategoryIdsDTO;
|
|
|
import com.example.xiaoshiweixinback.entity.dto.productCategory.EditCategoryDTO;
|
|
|
+import com.example.xiaoshiweixinback.entity.vo.PersonnelVO;
|
|
|
import com.example.xiaoshiweixinback.entity.vo.ProductCategoryVO;
|
|
|
import com.example.xiaoshiweixinback.entity.vo.productCategory.SelectCategoryLevelVO;
|
|
|
import com.example.xiaoshiweixinback.entity.vo.productCategory.SelectCategoryVO;
|
|
@@ -53,6 +54,7 @@ public class ProductCategoryService extends ServiceImpl<ProductCategoryMapper, P
|
|
|
private final PersonService personService;
|
|
|
private final FileManagerService fileManagerService;
|
|
|
private final ProductCategoryMapper productCategoryMapper;
|
|
|
+ private final CacheUtil cacheUtil;
|
|
|
@Autowired
|
|
|
private AssoCategoryFileMapper assoCategoryFileMapper;
|
|
|
|
|
@@ -77,13 +79,7 @@ public class ProductCategoryService extends ServiceImpl<ProductCategoryMapper, P
|
|
|
if (StringUtils.isNotEmpty(name)) {
|
|
|
queryWrapper.like(ProductCategory::getName, name);
|
|
|
}
|
|
|
-
|
|
|
-// if (parentId == 0) {
|
|
|
-// queryWrapper.isNull(ProductCategory::getParentId);
|
|
|
-// } else if (parentId != 0){
|
|
|
-// }
|
|
|
queryWrapper.eq(ProductCategory::getParentId, parentId);
|
|
|
-
|
|
|
if (ifConcern != null && ifConcern) {
|
|
|
//获取关注的
|
|
|
List<Integer> ids = assoPersonCategoryService.getChoosedProductCategoryIds();
|
|
@@ -92,6 +88,7 @@ public class ProductCategoryService extends ServiceImpl<ProductCategoryMapper, P
|
|
|
}
|
|
|
queryWrapper.in(ProductCategory::getId, ids);
|
|
|
}
|
|
|
+ queryWrapper.orderByDesc(ProductCategory::getCreateTime);
|
|
|
|
|
|
List<ProductCategory> productCategoryList = new ArrayList<>();
|
|
|
if (size != null && current != null) {
|
|
@@ -234,6 +231,8 @@ public class ProductCategoryService extends ServiceImpl<ProductCategoryMapper, P
|
|
|
category.setName(categoryDTO.getName());
|
|
|
category.setDescription(categoryDTO.getDescription());
|
|
|
category.setSearchCondition(categoryDTO.getSearchCondition());
|
|
|
+ PersonnelVO personnelVO = cacheUtil.getLoginUser(LoginUtils.getToken());
|
|
|
+ category.setCreateId(personnelVO.getId().toString());
|
|
|
category.insert();
|
|
|
Integer categoryId = category.getId();
|
|
|
if (!CollectionUtils.isEmpty(categoryDTO.getFileGuids())) {
|