|
@@ -1,11 +1,13 @@
|
|
|
package org.jeecg.modules.system.app.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
import org.jeecg.common.exception.JeecgBootException;
|
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
@@ -32,6 +34,7 @@ import static org.jeecg.common.constant.CommonConstant.SC_INTERNAL_SERVER_ERROR_
|
|
|
* @Version: V1.0
|
|
|
*/
|
|
|
@Service
|
|
|
+@Slf4j
|
|
|
public class AppCategoryServiceImpl extends ServiceImpl<AppCategoryMapper, AppCategory> implements IAppCategoryService {
|
|
|
|
|
|
@Resource
|
|
@@ -91,6 +94,16 @@ public class AppCategoryServiceImpl extends ServiceImpl<AppCategoryMapper, AppCa
|
|
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
String orgCode = loginUser.getOrgCode();
|
|
|
AppSite site = appSiteMapper.selectOne(Wrappers.<AppSite>lambdaQuery().eq(AppSite::getOrgCode, orgCode));
|
|
|
+ if (ObjectUtil.isEmpty(site)) {
|
|
|
+ log.info("当前账号无门店信息,判定为平台用户:{}", orgCode);
|
|
|
+ List<AppCategory> appCategories = baseMapper.selectList(Wrappers.<AppCategory>lambdaQuery());
|
|
|
+ for (AppCategory appCategory : appCategories){
|
|
|
+ AppCategoryVO vo = new AppCategoryVO();
|
|
|
+ BeanUtils.copyProperties(appCategory, vo);
|
|
|
+ list.add(vo);
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
String categoryIds = site.getCategoryId();
|
|
|
if (StringUtils.isNotEmpty(categoryIds)){
|
|
|
for (String id : categoryIds.split(",")) {
|