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
0cadb562
Commit
0cadb562
authored
Dec 08, 2021
by
wangtian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增定制服务查询、修改接口;
新增条码图书查询接口。
parent
a5a4a078
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
352 additions
and
0 deletions
+352
-0
FunctionEnum.java
...n/java/io/office/common/enumpack/manage/FunctionEnum.java
+34
-0
ProductController.java
...o/office/modules/manage/controller/ProductController.java
+15
-0
UserFunctionBindingController.java
...ules/manage/controller/UserFunctionBindingController.java
+109
-0
ProductDao.java
src/main/java/io/office/modules/manage/dao/ProductDao.java
+1
-0
UserFunctionBindingDao.java
.../io/office/modules/manage/dao/UserFunctionBindingDao.java
+24
-0
UserFunctionBindingEntity.java
...fice/modules/manage/entity/UserFunctionBindingEntity.java
+35
-0
ProductService.java
...java/io/office/modules/manage/service/ProductService.java
+2
-0
UserFunctionBindingService.java
...ce/modules/manage/service/UserFunctionBindingService.java
+27
-0
ProductServiceImpl.java
...ffice/modules/manage/service/impl/ProductServiceImpl.java
+8
-0
UserFunctionBindingServiceImpl.java
...s/manage/service/impl/UserFunctionBindingServiceImpl.java
+71
-0
ProductDao.xml
src/main/resources/mapper/manage/ProductDao.xml
+4
-0
UserFunctionBindingDao.xml
src/main/resources/mapper/manage/UserFunctionBindingDao.xml
+22
-0
No files found.
src/main/java/io/office/common/enumpack/manage/FunctionEnum.java
0 → 100644
View file @
0cadb562
package
io
.
office
.
common
.
enumpack
.
manage
;
/**
* @author ZYF
* @description
* @date 2021/12/7
*/
public
enum
FunctionEnum
{
Business_Information_Service_Platform
(
"0"
,
"商务信息服务平台"
),
Import_Commodity_Data_Dulletin
(
"1"
,
"进口商品数据通报"
),
Bar_Code_MicroStation
(
"2"
,
"条码微站"
),
Traceability_Platform
(
"3"
,
"追溯平台"
),
Bar_Code_Commercial_Bridge
(
"4"
,
"条码商桥"
),
Commodity_QR_Code
(
"5"
,
"商品二维码"
),
GDSN
(
"6"
,
"GDSN"
),
Barcode_RF_Software_Detection_Service
(
"7"
,
"条码/射频/软件检测服务"
),
ECODE
(
"8"
,
"ECODE"
),
Educational_Knowledge_Management_Platform
(
"9"
,
"教育知识管理平台"
),
Barcode_Information_Query
(
"10"
,
"条码信息查询"
),
Product_Service
(
"11"
,
"产品服务"
),
Platform_Service
(
"12"
,
"平台服务"
),
More_Customization
(
"13"
,
"更多定制"
);
private
String
code
;
private
String
msg
;
FunctionEnum
(
String
code
)
{
this
.
code
=
code
;
}
FunctionEnum
(
String
code
,
String
message
)
{
this
.
code
=
code
;
this
.
msg
=
message
;
}
}
src/main/java/io/office/modules/manage/controller/ProductController.java
View file @
0cadb562
...
...
@@ -114,4 +114,19 @@ public class ProductController extends AbstractController {
}
}
/**
* 分页查图书
* @param param:分页参数
* @return
*/
@RequestMapping
(
"/api/findPage"
)
// @RequiresPermissions("manage:product:findPage")
public
R
findPage
(
@RequestBody
Map
<
String
,
String
>
param
){
Page
<
ProductEntity
>
pag
=
this
.
productService
.
findPage
(
new
Page
(
Integer
.
valueOf
(
param
.
get
(
"page"
)),
Integer
.
valueOf
(
param
.
get
(
"size"
))));
PageUtils
pageUtils
=
new
PageUtils
(
pag
);
return
R
.
ok
().
put
(
"page"
,
pageUtils
);
}
}
src/main/java/io/office/modules/manage/controller/UserFunctionBindingController.java
0 → 100644
View file @
0cadb562
package
io
.
office
.
modules
.
manage
.
controller
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
import
io.office.modules.sys.controller.AbstractController
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
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.UserFunctionBindingEntity
;
import
io.office.modules.manage.service.UserFunctionBindingService
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
/**
* ${comments}
*
* @author zyf
* @email
* @date 2021-12-07 15:22:24
*/
@RestController
@RequestMapping
(
"/userfunctionbinding"
)
public
class
UserFunctionBindingController
extends
AbstractController
{
@Autowired
private
UserFunctionBindingService
userFunctionBindingService
;
/**
* 查询
*/
@RequestMapping
(
"/api/find"
)
public
R
find
(){
Integer
id
=
getUserId
().
intValue
();
if
(
id
==
null
){
return
R
.
error
(
"用户信息有误"
);
}
Object
[]
functionids
=
userFunctionBindingService
.
queryList
(
id
);
return
R
.
ok
().
put
(
"functionids"
,
functionids
);
}
/**
* 修改
*/
@RequestMapping
(
"/api/update"
)
// @RequiresPermissions("manage:userfunctionbinding:update")
public
R
update
(
@RequestBody
Integer
[]
functionids
){
Integer
id
=
getUserId
().
intValue
();
if
(
id
==
null
){
return
R
.
error
(
"用户信息有误"
);
}
userFunctionBindingService
.
Modify
(
functionids
,
id
);
return
R
.
ok
();
}
/**
* 保存
*/
@RequestMapping
(
"/api/save"
)
// @RequiresPermissions("manage:userfunctionbinding:save")
public
R
save
(
@RequestBody
Integer
[]
functionids
){
//遍历插入数据
for
(
int
functionid
:
functionids
)
{
UserFunctionBindingEntity
ufb
=
new
UserFunctionBindingEntity
();
ufb
.
setUserId
(
getUserId
().
intValue
());
ufb
.
setFuncId
(
functionid
);
userFunctionBindingService
.
save
(
ufb
);
}
return
R
.
ok
();
}
/**
* 列表
*/
@RequestMapping
(
"/api/list"
)
// @RequiresPermissions("manage:userfunctionbinding:list")
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
){
PageUtils
page
=
userFunctionBindingService
.
queryPage
(
params
);
return
R
.
ok
().
put
(
"page"
,
page
);
}
/**
* 信息
*/
@RequestMapping
(
"/api/info/{id}"
)
// @RequiresPermissions("manage:userfunctionbinding:info")
public
R
info
(
@PathVariable
(
"id"
)
Integer
id
){
UserFunctionBindingEntity
userFunctionBinding
=
userFunctionBindingService
.
getById
(
id
);
return
R
.
ok
().
put
(
"userFunctionBinding"
,
userFunctionBinding
);
}
/**
* 删除
*/
@RequestMapping
(
"/delete"
)
// @RequiresPermissions("manage:userfunctionbinding:delete")
public
R
delete
(
@RequestBody
Integer
[]
ids
){
userFunctionBindingService
.
removeByIds
(
Arrays
.
asList
(
ids
));
return
R
.
ok
();
}
}
src/main/java/io/office/modules/manage/dao/ProductDao.java
View file @
0cadb562
...
...
@@ -20,4 +20,5 @@ import java.util.Map;
public
interface
ProductDao
extends
BaseMapper
<
ProductEntity
>
{
List
<
ProductEntity
>
selectProductList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
,
Page
page
);
List
<
ProductEntity
>
findPage
(
Page
page
);
}
src/main/java/io/office/modules/manage/dao/UserFunctionBindingDao.java
0 → 100644
View file @
0cadb562
package
io
.
office
.
modules
.
manage
.
dao
;
import
io.office.modules.manage.entity.UserFunctionBindingEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
/**
* ${comments}
*
* @author zyf
* @email
* @date 2021-12-07 15:22:24
*/
@Mapper
@Component
public
interface
UserFunctionBindingDao
extends
BaseMapper
<
UserFunctionBindingEntity
>
{
List
<
UserFunctionBindingEntity
>
queryListById
(
int
id
);
void
deleteUserFunctionBindingById
(
int
id
);
}
src/main/java/io/office/modules/manage/entity/UserFunctionBindingEntity.java
0 → 100644
View file @
0cadb562
package
io
.
office
.
modules
.
manage
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
java.io.Serializable
;
import
lombok.Data
;
/**
* ${comments}
*
* @author zyf
* @email
* @date 2021-12-07 15:22:24
*/
@Data
@TableName
(
"user_function_binding"
)
public
class
UserFunctionBindingEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* $column.comments
*/
@TableId
private
Integer
id
;
/**
* $column.comments
*/
private
Integer
userId
;
/**
* $column.comments
*/
private
Integer
funcId
;
}
src/main/java/io/office/modules/manage/service/ProductService.java
View file @
0cadb562
...
...
@@ -29,5 +29,7 @@ public interface ProductService extends IService<ProductEntity> {
R
verifyProduct
(
ProductEntity
product
,
SysUserEntity
user
);
Page
<
ProductEntity
>
selectProductList
(
Map
<
String
,
Object
>
params
,
Page
page
);
Page
<
ProductEntity
>
findPage
(
Page
page
);
}
src/main/java/io/office/modules/manage/service/UserFunctionBindingService.java
0 → 100644
View file @
0cadb562
package
io
.
office
.
modules
.
manage
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
io.office.common.utils.PageUtils
;
import
io.office.modules.manage.entity.UserFunctionBindingEntity
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
/**
* ${comments}
*
* @author zyf
* @email
* @date 2021-12-07 15:22:24
*/
@Service
public
interface
UserFunctionBindingService
extends
IService
<
UserFunctionBindingEntity
>
{
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
);
Object
[]
queryList
(
Integer
id
);
void
Modify
(
Integer
[]
functionids
,
int
id
);
}
src/main/java/io/office/modules/manage/service/impl/ProductServiceImpl.java
View file @
0cadb562
...
...
@@ -82,4 +82,11 @@ public class ProductServiceImpl extends ServiceImpl<ProductDao, ProductEntity> i
return
page
;
}
@Override
public
Page
<
ProductEntity
>
findPage
(
Page
page
)
{
List
<
ProductEntity
>
list
=
this
.
productDao
.
findPage
(
page
);
page
.
setRecords
(
list
);
return
page
;
}
}
\ No newline at end of file
src/main/java/io/office/modules/manage/service/impl/UserFunctionBindingServiceImpl.java
0 → 100644
View file @
0cadb562
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
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.service.impl.ServiceImpl
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.Query
;
import
io.office.modules.manage.dao.UserFunctionBindingDao
;
import
io.office.modules.manage.entity.UserFunctionBindingEntity
;
import
io.office.modules.manage.service.UserFunctionBindingService
;
/**
* ${comments}
*
* @author zyf
* @email
* @date 2021-12-07 15:22:24
*/
@Service
(
"userFunctionBindingService"
)
public
class
UserFunctionBindingServiceImpl
extends
ServiceImpl
<
UserFunctionBindingDao
,
UserFunctionBindingEntity
>
implements
UserFunctionBindingService
{
@Autowired
UserFunctionBindingDao
userFunctionBindingDao
;
@Override
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
IPage
<
UserFunctionBindingEntity
>
page
=
this
.
page
(
new
Query
<
UserFunctionBindingEntity
>().
getPage
(
params
),
new
QueryWrapper
<
UserFunctionBindingEntity
>()
);
return
new
PageUtils
(
page
);
}
@Override
public
Object
[]
queryList
(
Integer
id
)
{
List
<
UserFunctionBindingEntity
>
userFunctionBindingEntities
=
userFunctionBindingDao
.
queryListById
(
id
);
//查不到用户关联功能返回空数组
if
(
userFunctionBindingEntities
==
null
)
{
return
null
;
}
List
<
Integer
>
list
=
new
ArrayList
<>();
for
(
UserFunctionBindingEntity
userFunctionBindingEntity
:
userFunctionBindingEntities
)
{
list
.
add
(
userFunctionBindingEntity
.
getFuncId
());
}
Object
[]
functionids
=
list
.
toArray
();
return
functionids
;
}
@Override
public
void
Modify
(
Integer
[]
functionids
,
int
id
)
{
//先删除原先的用户功能关系
userFunctionBindingDao
.
deleteUserFunctionBindingById
(
id
);
//遍历插入数据
for
(
int
functionid
:
functionids
)
{
UserFunctionBindingEntity
ufb
=
new
UserFunctionBindingEntity
();
ufb
.
setUserId
(
id
);
ufb
.
setFuncId
(
functionid
);
save
(
ufb
);
}
}
}
\ No newline at end of file
src/main/resources/mapper/manage/ProductDao.xml
View file @
0cadb562
...
...
@@ -57,4 +57,7 @@
</if>
order by a.id desc
</select>
<select
id=
"findPage"
resultType=
"io.office.modules.manage.entity.ProductEntity"
>
select * from product where levels > 0 and categoryid=1 ORDER BY levels DESC, adddate DESC
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapper/manage/UserFunctionBindingDao.xml
0 → 100644
View file @
0cadb562
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"io.office.modules.manage.dao.UserFunctionBindingDao"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"io.office.modules.manage.entity.UserFunctionBindingEntity"
id=
"userFunctionBindingMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"funcId"
column=
"func_id"
/>
</resultMap>
<delete
id=
"deleteUserFunctionBindingById"
>
delete from user_function_binding where user_id=#{id}
</delete>
<select
id=
"queryListById"
resultType=
"io.office.modules.manage.entity.UserFunctionBindingEntity"
>
select * from user_function_binding where user_id=#{id}
</select>
</mapper>
\ No newline at end of file
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