Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gdtel-gztel-school-center
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴学德
gdtel-gztel-school-center
Commits
8cd5dba6
Commit
8cd5dba6
authored
Feb 17, 2020
by
黄森林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
宽带产品功能提交
parent
fd9069c9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
28 deletions
+34
-28
common/src/main/java/com/winsun/bean/Product.java
+7
-1
common/src/main/java/com/winsun/bean/UniversityInfo.java
+1
-1
service-manager/src/main/java/com/winsun/controller/ProductController.java
+26
-26
No files found.
common/src/main/java/com/winsun/bean/Product.java
View file @
8cd5dba6
...
...
@@ -18,7 +18,7 @@ public class Product implements Serializable {
/**
* 主键
*/
@TableId
(
value
=
"product
I
d"
,
type
=
IdType
.
AUTO
)
@TableId
(
value
=
"product
_i
d"
,
type
=
IdType
.
AUTO
)
private
int
productId
;
...
...
@@ -97,7 +97,13 @@ public class Product implements Serializable {
*/
private
String
productPrice
;
/**
* 宽带速率
*/
private
String
productMeal
;
/**
* 包年包月情况
*/
private
String
productRate
;
private
String
productIntroductionPic2
;
private
String
productIntroductionPic3
;
...
...
common/src/main/java/com/winsun/bean/UniversityInfo.java
View file @
8cd5dba6
...
...
@@ -18,7 +18,7 @@ public class UniversityInfo implements Serializable {
/**
* 主键
*/
@TableId
(
value
=
"university
I
d"
,
type
=
IdType
.
AUTO
)
@TableId
(
value
=
"university
_i
d"
,
type
=
IdType
.
AUTO
)
private
int
universityId
;
...
...
service-manager/src/main/java/com/winsun/controller/ProductController.java
View file @
8cd5dba6
...
...
@@ -15,10 +15,7 @@ import com.winsun.utils.MyBatisPlusUpdateUtils;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
java.sql.Timestamp
;
import
java.util.Date
;
...
...
@@ -28,12 +25,13 @@ import java.util.Map;
/**
* 宽带管理
*
* @Author: chancy
* @Date: 2020/2/12 17:26
*/
@Slf4j
@RestController
@RequestMapping
(
"/
school/
product"
)
@RequestMapping
(
"/product"
)
public
class
ProductController
extends
BaseController
{
private
static
ProductMapper
productMapper
;
...
...
@@ -45,6 +43,7 @@ public class ProductController extends BaseController {
/**
* 宽带添加
*
* @param product 添加对象json字符串
* @return
*/
...
...
@@ -70,8 +69,8 @@ public class ProductController extends BaseController {
* @param id 需要删除的id
* @return
*/
@Permission
(
menuname
=
"删除宽带信息"
,
value
=
"delete"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
String
>
deleteProduct
(
@
RequestParam
(
"id"
)
String
id
)
{
@Permission
(
menuname
=
"删除宽带信息"
,
value
=
"delete
/{id}
"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
String
>
deleteProduct
(
@
PathVariable
(
"id"
)
String
id
)
{
ShiroUser
user
=
getShiroUser
();
if
(!
user
.
getRoleNames
().
stream
().
anyMatch
(
roleName
->
StringUtils
.
equalsAny
(
roleName
,
"超级管理员"
)))
{
return
ResponseData
.
error
(
"无数据权限"
);
...
...
@@ -82,7 +81,7 @@ public class ProductController extends BaseController {
wrapper
.
eq
(
"product_id"
,
id
);
Map
<
String
,
Object
>
dataMapping
=
new
HashMap
<>();
dataMapping
.
put
(
"product_last_update_time"
,
timestamp
);
dataMapping
.
put
(
"product_state"
,
"1"
);
dataMapping
.
put
(
"product_state"
,
"1"
);
productMapper
.
updateForSet
(
MyBatisPlusUpdateUtils
.
toUpdateSet
(
dataMapping
),
wrapper
);
return
ResponseData
.
success
(
"删除完毕!"
);
}
...
...
@@ -99,45 +98,46 @@ public class ProductController extends BaseController {
if
(!
user
.
getRoleNames
().
stream
().
anyMatch
(
roleName
->
StringUtils
.
equalsAny
(
roleName
,
"超级管理员"
)))
{
return
ResponseData
.
error
(
"无数据权限"
);
}
Product
sale
=
JSON
.
parseObject
(
product
,
Product
.
class
);
Product
pro
=
JSON
.
parseObject
(
product
,
Product
.
class
);
Wrapper
wrapper
=
new
EntityWrapper
<>();
wrapper
.
eq
(
"product_id"
,
sale
.
getProductId
());
/**
* 待定............................
*/
wrapper
.
eq
(
"product_id"
,
pro
.
getProductId
());
Date
date
=
new
Date
();
Timestamp
timestamp
=
new
Timestamp
(
date
.
getTime
());
Map
<
String
,
Object
>
dataMapping
=
new
HashMap
<>();
dataMapping
.
put
(
"product_last_update_time"
,
timestamp
);
dataMapping
.
put
(
"product_introduction"
,
pro
.
getProductIntroduction
());
dataMapping
.
put
(
"product_set_meal_introduction"
,
pro
.
getProductSetMealIntroduction
());
dataMapping
.
put
(
"product_meal_price"
,
pro
.
getProductMealPrice
());
dataMapping
.
put
(
"product_meal"
,
pro
.
getProductMeal
());
dataMapping
.
put
(
"product_title"
,
pro
.
getProductTitle
());
dataMapping
.
put
(
"product_university"
,
pro
.
getProductUniversity
());
dataMapping
.
put
(
"product_price"
,
pro
.
getProductPrice
());
dataMapping
.
put
(
"product_region"
,
pro
.
getProductRegion
());
dataMapping
.
put
(
"product_rate"
,
pro
.
getProductRate
());
productMapper
.
updateForSet
(
MyBatisPlusUpdateUtils
.
toUpdateSet
(
dataMapping
),
wrapper
);
return
ResponseData
.
success
(
"修改完毕!"
);
}
/**
*寬帶查詢展示
*
寬帶查詢展示
*
* @param productUniversity 适用学校
* @param productRegion 区域
* @param productTitle 宽带标题
* @param productState 宽带狀態
* @param pageIndex
* @param productRegion 区域
* @param pageSize
* @return
*/
@Permission
(
menuname
=
"查询宽带信息"
,
value
=
"list"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
Page
<
Product
>>
listProduct
(
@RequestParam
(
"productUniversity"
)
String
productUniversity
,
@RequestParam
(
"productRegion"
)
String
productRegion
,
@RequestParam
(
"productTitle"
)
String
productTitle
,
@RequestParam
(
"productState"
)
String
productState
,
@RequestParam
(
name
=
"pageIndex"
,
required
=
false
)
int
pageIndex
,
@RequestParam
(
name
=
"pageSize"
,
required
=
false
)
int
pageSize
)
{
public
ResponseData
<
Page
<
Product
>>
listProduct
(
@RequestParam
(
name
=
"productUniversity"
,
required
=
false
)
String
productUniversity
,
@RequestParam
(
name
=
"productRegion"
,
required
=
false
)
String
productRegion
,
@RequestParam
(
name
=
"pageNo"
)
int
pageNo
,
@RequestParam
(
name
=
"pageSize"
)
int
pageSize
)
{
ShiroUser
user
=
getShiroUser
();
if
(!
user
.
getRoleNames
().
stream
().
anyMatch
(
roleName
->
StringUtils
.
equalsAny
(
roleName
,
"超级管理员"
)))
{
return
ResponseData
.
error
(
"无数据权限"
);
}
Wrapper
<
Product
>
wrapper
=
new
EntityWrapper
();
wrapper
.
like
(
StringUtils
.
isNotBlank
(
productUniversity
),
"product_university"
,
productUniversity
,
SqlLike
.
LEFT
);
wrapper
.
like
(
StringUtils
.
isNotBlank
(
productTitle
),
"product_title"
,
productTitle
,
SqlLike
.
DEFAULT
);
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
productRegion
),
"product_region"
,
productRegion
);
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
productState
),
"product_state"
,
productState
);
Page
<
Product
>
page
=
new
Page
<>(
pageIndex
,
pageSize
);
wrapper
.
like
(
StringUtils
.
isNotBlank
(
productUniversity
),
"product_university"
,
productUniversity
,
SqlLike
.
DEFAULT
);
wrapper
.
like
(
StringUtils
.
isNotBlank
(
productRegion
),
"product_region"
,
productRegion
,
SqlLike
.
DEFAULT
);
wrapper
.
eq
(
"product_state"
,
"0"
);
Page
<
Product
>
page
=
new
Page
<>(
pageNo
,
pageSize
);
List
<
Product
>
products
=
productMapper
.
selectPage
(
page
,
wrapper
);
page
.
setRecords
(
products
);
return
ResponseData
.
success
(
page
,
"查询完毕!"
);
...
...
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