Commit 138975e0 by 吴迪

GS1页面

parent f531085f
package io.office.modules.manage.controller; package io.office.modules.manage.controller;
import java.util.Arrays;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.office.modules.manage.entity.KnowledgecategoryEntity;
import io.office.modules.manage.service.KnowledgecategoryService;
import io.office.common.utils.PageUtils; import io.office.common.utils.PageUtils;
import io.office.common.utils.R; import io.office.common.utils.R;
import io.office.modules.manage.entity.KnowledgecategoryEntity;
import io.office.modules.manage.service.KnowledgecategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
...@@ -106,9 +101,22 @@ public class KnowledgecategoryController { ...@@ -106,9 +101,22 @@ public class KnowledgecategoryController {
QueryWrapper<KnowledgecategoryEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<KnowledgecategoryEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("categorylevels","2"); queryWrapper.eq("categorylevels","2");
queryWrapper.eq("parentCategoryID",knowledgecategory.getParentcategoryid()); queryWrapper.eq("parentCategoryID",knowledgecategory.getParentcategoryid());
return R.ok().put("data",knowledgecategoryService.list(queryWrapper)); return R.ok().put("data",knowledgecategoryService.list(queryWrapper));
} }
/**
* 给前端显示使用
*/
@RequestMapping("/api/getSecondCategoryList")
public R getCategoryList(@RequestBody KnowledgecategoryEntity knowledgecategory){
List<KnowledgecategoryEntity> categoryList = knowledgecategoryService.getCategoryList(knowledgecategory);
return R.ok().put("data",categoryList);
}
} }
package io.office.modules.manage.controller; package io.office.modules.manage.controller;
import java.util.Date;
import java.util.List;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.common.annotation.SysLog; import io.office.common.annotation.SysLog;
import io.office.modules.manage.entity.RetailpictureEntity; import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
import io.office.modules.manage.entity.KnowledgeinfoEntity;
import io.office.modules.manage.entity.dto.KnowledgeCategoryVo; import io.office.modules.manage.entity.dto.KnowledgeCategoryVo;
import io.office.modules.manage.service.KnowledgeinfoService;
import io.office.modules.sys.controller.AbstractController; import io.office.modules.sys.controller.AbstractController;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import io.office.modules.manage.entity.KnowledgeinfoEntity; import java.util.Date;
import io.office.modules.manage.service.KnowledgeinfoService; import java.util.List;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
...@@ -138,4 +131,23 @@ public class KnowledgeinfoController extends AbstractController { ...@@ -138,4 +131,23 @@ public class KnowledgeinfoController extends AbstractController {
return R.ok("审核成功!"); return R.ok("审核成功!");
} }
@RequestMapping("/api/list")
// @RequiresPermissions("manage:knowledgeinfo:list")
public R apiList(@RequestBody KnowledgeCategoryVo params){
Page<KnowledgeinfoEntity> page = this.knowledgeinfoService.knowledgeinfoList(params,
new Page(params.getPage(), params.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
@RequestMapping("/api/getKnowledgeInfoList")
// @RequiresPermissions("manage:knowledgeinfo:list")
public R getKnowledgeInfoList(@RequestBody KnowledgeinfoEntity knowledgeinfoEntity){
List<KnowledgeinfoEntity> knowledgeInfoList = knowledgeinfoService.getKnowledgeInfoList(knowledgeinfoEntity);
return R.ok().put("data", knowledgeInfoList);
}
} }
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils; import io.office.common.utils.PageUtils;
import io.office.modules.manage.entity.KnowledgecategoryEntity; import io.office.modules.manage.entity.KnowledgecategoryEntity;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
...@@ -16,5 +17,7 @@ import java.util.Map; ...@@ -16,5 +17,7 @@ import java.util.Map;
public interface KnowledgecategoryService extends IService<KnowledgecategoryEntity> { public interface KnowledgecategoryService extends IService<KnowledgecategoryEntity> {
PageUtils queryPage(Map<String, Object> params); PageUtils queryPage(Map<String, Object> params);
List<KnowledgecategoryEntity> getCategoryList(KnowledgecategoryEntity knowledgecategory);
} }
...@@ -4,11 +4,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -4,11 +4,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils; import io.office.common.utils.PageUtils;
import io.office.modules.manage.entity.KnowledgeinfoEntity; import io.office.modules.manage.entity.KnowledgeinfoEntity;
import io.office.modules.manage.entity.NewsEntity;
import io.office.modules.manage.entity.dto.KnowledgeCategoryVo; import io.office.modules.manage.entity.dto.KnowledgeCategoryVo;
import io.office.modules.manage.entity.dto.NewsParams;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
...@@ -26,5 +24,9 @@ public interface KnowledgeinfoService extends IService<KnowledgeinfoEntity> { ...@@ -26,5 +24,9 @@ public interface KnowledgeinfoService extends IService<KnowledgeinfoEntity> {
KnowledgeinfoEntity knowledgeinfoById(Integer id); KnowledgeinfoEntity knowledgeinfoById(Integer id);
List<KnowledgeinfoEntity> getKnowledgeInfoList(KnowledgeinfoEntity knowledgeinfoEntity);
} }
package io.office.modules.manage.service.impl; package io.office.modules.manage.service.impl;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.office.common.utils.PageUtils; import io.office.common.utils.PageUtils;
import io.office.common.utils.Query; import io.office.common.utils.Query;
import io.office.modules.manage.dao.KnowledgecategoryDao; import io.office.modules.manage.dao.KnowledgecategoryDao;
import io.office.modules.manage.entity.KnowledgecategoryEntity; import io.office.modules.manage.entity.KnowledgecategoryEntity;
import io.office.modules.manage.service.KnowledgecategoryService; import io.office.modules.manage.service.KnowledgecategoryService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service("knowledgecategoryService") @Service("knowledgecategoryService")
...@@ -26,4 +27,19 @@ public class KnowledgecategoryServiceImpl extends ServiceImpl<KnowledgecategoryD ...@@ -26,4 +27,19 @@ public class KnowledgecategoryServiceImpl extends ServiceImpl<KnowledgecategoryD
return new PageUtils(page); return new PageUtils(page);
} }
@Override
public List<KnowledgecategoryEntity> getCategoryList(KnowledgecategoryEntity knowledgecategory) {
//select * from knowledgeCategory where CategoryLevels=2 and parentCategoryID = 104 and orderNum is not null and Levels =1 ORDER BY orderNum
QueryWrapper<KnowledgecategoryEntity> queryWrapper = new QueryWrapper<>();
// 设置查询条件
queryWrapper.eq("CategoryLevels", 2)
.eq("parentCategoryID", knowledgecategory.getParentcategoryid())
.isNotNull("orderNum")
.eq("Levels", 1);
// 设置排序
queryWrapper.orderByAsc("orderNum");
// 执行查询并返回结果
return baseMapper.selectList(queryWrapper);
}
} }
package io.office.modules.manage.service.impl; package io.office.modules.manage.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.modules.manage.entity.NewsEntity;
import io.office.modules.manage.entity.dto.KnowledgeCategoryVo;
import io.office.modules.manage.entity.dto.NewsParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.office.common.utils.PageUtils; import io.office.common.utils.PageUtils;
import io.office.common.utils.Query; import io.office.common.utils.Query;
import io.office.modules.manage.dao.KnowledgeinfoDao; import io.office.modules.manage.dao.KnowledgeinfoDao;
import io.office.modules.manage.entity.KnowledgeinfoEntity; import io.office.modules.manage.entity.KnowledgeinfoEntity;
import io.office.modules.manage.entity.dto.KnowledgeCategoryVo;
import io.office.modules.manage.service.KnowledgeinfoService; import io.office.modules.manage.service.KnowledgeinfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service("knowledgeinfoService") @Service("knowledgeinfoService")
...@@ -49,5 +46,21 @@ public class KnowledgeinfoServiceImpl extends ServiceImpl<KnowledgeinfoDao, Know ...@@ -49,5 +46,21 @@ public class KnowledgeinfoServiceImpl extends ServiceImpl<KnowledgeinfoDao, Know
return knowledgeinfoDao.knowledgeinfoById(id); return knowledgeinfoDao.knowledgeinfoById(id);
} }
@Override
public List<KnowledgeinfoEntity> getKnowledgeInfoList(KnowledgeinfoEntity knowledgeinfoEntity) {
QueryWrapper<KnowledgeinfoEntity> queryWrapper = new QueryWrapper<>();
// 设置查询条件
if (knowledgeinfoEntity.getKnowledgecategoryid() != null) {
queryWrapper.eq("knowledgeCategoryID", knowledgeinfoEntity.getKnowledgecategoryid());
}
queryWrapper.ne("levels", 0)
.eq("status", 1);
// 设置排序
queryWrapper.orderByDesc("levels");
// 执行查询并返回结果
return baseMapper.selectList(queryWrapper);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment