Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1-office-web-sit
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴迪
gs1-office-web-sit
Commits
138975e0
Commit
138975e0
authored
Dec 30, 2024
by
吴迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GS1页面
parent
f531085f
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
96 additions
and
42 deletions
+96
-42
WebMvcConfig.java
src/main/java/io/office/modules/app/config/WebMvcConfig.java
+0
-0
KnowledgecategoryController.java
...odules/manage/controller/KnowledgecategoryController.java
+21
-13
KnowledgeinfoController.java
...ce/modules/manage/controller/KnowledgeinfoController.java
+25
-13
KnowledgecategoryService.java
...fice/modules/manage/service/KnowledgecategoryService.java
+3
-0
KnowledgeinfoService.java
...o/office/modules/manage/service/KnowledgeinfoService.java
+5
-3
KnowledgecategoryServiceImpl.java
...les/manage/service/impl/KnowledgecategoryServiceImpl.java
+19
-3
KnowledgeinfoServiceImpl.java
...modules/manage/service/impl/KnowledgeinfoServiceImpl.java
+23
-10
No files found.
src/main/java/io/office/modules/app/config/WebMvcConfig.java
View file @
138975e0
src/main/java/io/office/modules/manage/controller/KnowledgecategoryController.java
View file @
138975e0
package
io
.
office
.
modules
.
manage
.
controller
;
import
java.util.Arrays
;
import
java.util.Map
;
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.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 {
QueryWrapper
<
KnowledgecategoryEntity
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"categorylevels"
,
"2"
);
queryWrapper
.
eq
(
"parentCategoryID"
,
knowledgecategory
.
getParentcategoryid
());
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
);
}
}
src/main/java/io/office/modules/manage/controller/KnowledgeinfoController.java
View file @
138975e0
package
io
.
office
.
modules
.
manage
.
controller
;
import
java.util.Date
;
import
java.util.List
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
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.service.KnowledgeinfoService
;
import
io.office.modules.sys.controller.AbstractController
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
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.RestController
;
import
io.office.modules.manage.entity.KnowledgeinfoEntity
;
import
io.office.modules.manage.service.KnowledgeinfoService
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -138,4 +131,23 @@ public class KnowledgeinfoController extends AbstractController {
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
);
}
}
src/main/java/io/office/modules/manage/service/KnowledgecategoryService.java
View file @
138975e0
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
io.office.common.utils.PageUtils
;
import
io.office.modules.manage.entity.KnowledgecategoryEntity
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -16,5 +17,7 @@ import java.util.Map;
public
interface
KnowledgecategoryService
extends
IService
<
KnowledgecategoryEntity
>
{
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
);
List
<
KnowledgecategoryEntity
>
getCategoryList
(
KnowledgecategoryEntity
knowledgecategory
);
}
src/main/java/io/office/modules/manage/service/KnowledgeinfoService.java
View file @
138975e0
...
...
@@ -4,11 +4,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
io.office.common.utils.PageUtils
;
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.NewsParams
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -26,5 +24,9 @@ public interface KnowledgeinfoService extends IService<KnowledgeinfoEntity> {
KnowledgeinfoEntity
knowledgeinfoById
(
Integer
id
);
List
<
KnowledgeinfoEntity
>
getKnowledgeInfoList
(
KnowledgeinfoEntity
knowledgeinfoEntity
);
}
src/main/java/io/office/modules/manage/service/impl/KnowledgecategoryServiceImpl.java
View file @
138975e0
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.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.Query
;
import
io.office.modules.manage.dao.KnowledgecategoryDao
;
import
io.office.modules.manage.entity.KnowledgecategoryEntity
;
import
io.office.modules.manage.service.KnowledgecategoryService
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
@Service
(
"knowledgecategoryService"
)
...
...
@@ -26,4 +27,19 @@ public class KnowledgecategoryServiceImpl extends ServiceImpl<KnowledgecategoryD
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
);
}
}
src/main/java/io/office/modules/manage/service/impl/KnowledgeinfoServiceImpl.java
View file @
138975e0
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.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.Query
;
import
io.office.modules.manage.dao.KnowledgeinfoDao
;
import
io.office.modules.manage.entity.KnowledgeinfoEntity
;
import
io.office.modules.manage.entity.dto.KnowledgeCategoryVo
;
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"
)
...
...
@@ -49,5 +46,21 @@ public class KnowledgeinfoServiceImpl extends ServiceImpl<KnowledgeinfoDao, Know
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
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment