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
6c519743
Commit
6c519743
authored
Feb 18, 2020
by
黄森林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
大学宽带信息管理功能完成
parent
330717e3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
22 deletions
+28
-22
common/src/main/java/com/winsun/bean/UniversityInfo.java
+3
-3
service-manager/src/main/java/com/winsun/controller/UniversityInfoController.java
+25
-19
No files found.
common/src/main/java/com/winsun/bean/UniversityInfo.java
View file @
6c519743
...
@@ -89,13 +89,13 @@ public class UniversityInfo implements Serializable {
...
@@ -89,13 +89,13 @@ public class UniversityInfo implements Serializable {
/**
/**
*
*
*/
*/
private
String
universityInstalledAddressI
D
;
private
String
universityInstalledAddressI
d
;
/**
/**
*
*
学校联系号码
*/
*/
private
String
universityContactPhone
;
private
String
universityContactPhone
;
/**
/**
*
*
收费模式
*/
*/
private
String
universityChargeMode
;
private
String
universityChargeMode
;
/**
/**
...
...
service-manager/src/main/java/com/winsun/controller/UniversityInfoController.java
View file @
6c519743
...
@@ -17,10 +17,7 @@ import com.winsun.utils.MyBatisPlusUpdateUtils;
...
@@ -17,10 +17,7 @@ import com.winsun.utils.MyBatisPlusUpdateUtils;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.sql.Timestamp
;
import
java.sql.Timestamp
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -35,7 +32,7 @@ import java.util.Map;
...
@@ -35,7 +32,7 @@ import java.util.Map;
*/
*/
@Slf4j
@Slf4j
@RestController
@RestController
@RequestMapping
(
"/
school/universityInfo
"
)
@RequestMapping
(
"/
university
"
)
public
class
UniversityInfoController
extends
BaseController
{
public
class
UniversityInfoController
extends
BaseController
{
private
static
UniversityInfoMapper
universityInfoMapper
;
private
static
UniversityInfoMapper
universityInfoMapper
;
...
@@ -47,16 +44,16 @@ public class UniversityInfoController extends BaseController {
...
@@ -47,16 +44,16 @@ public class UniversityInfoController extends BaseController {
/**
/**
* 添加大学宽带信息
* 添加大学宽带信息
* @param university
Info
添加对象的json字符串
* @param university 添加对象的json字符串
* @return
* @return
*/
*/
@Permission
(
menuname
=
"添加大学宽带信息"
,
value
=
"insert"
,
method
=
RequestMethod
.
POST
)
@Permission
(
menuname
=
"添加大学宽带信息"
,
value
=
"insert"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
String
>
insertUniversityInfo
(
@RequestParam
(
"
UniversityInfo"
)
String
universityInfo
)
{
public
ResponseData
<
String
>
insertUniversityInfo
(
@RequestParam
(
"
university"
)
String
university
)
{
ShiroUser
user
=
getShiroUser
();
ShiroUser
user
=
getShiroUser
();
if
(!
user
.
getRoleNames
().
stream
().
anyMatch
(
roleName
->
StringUtils
.
equalsAny
(
roleName
,
"超级管理员"
)))
{
if
(!
user
.
getRoleNames
().
stream
().
anyMatch
(
roleName
->
StringUtils
.
equalsAny
(
roleName
,
"超级管理员"
)))
{
return
ResponseData
.
error
(
"无数据权限"
);
return
ResponseData
.
error
(
"无数据权限"
);
}
}
UniversityInfo
uni
=
JSON
.
parseObject
(
university
Info
,
UniversityInfo
.
class
);
UniversityInfo
uni
=
JSON
.
parseObject
(
university
,
UniversityInfo
.
class
);
Date
date
=
new
Date
();
Date
date
=
new
Date
();
Timestamp
timestamp
=
new
Timestamp
(
date
.
getTime
());
Timestamp
timestamp
=
new
Timestamp
(
date
.
getTime
());
uni
.
setUniversityCreateTime
(
timestamp
);
uni
.
setUniversityCreateTime
(
timestamp
);
...
@@ -71,8 +68,8 @@ public class UniversityInfoController extends BaseController {
...
@@ -71,8 +68,8 @@ public class UniversityInfoController extends BaseController {
* @param id 需要删除的id
* @param id 需要删除的id
* @return
* @return
*/
*/
@Permission
(
menuname
=
"删除大学宽带信息"
,
value
=
"delete"
,
method
=
RequestMethod
.
POST
)
@Permission
(
menuname
=
"删除大学宽带信息"
,
value
=
"delete
/{id}
"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
String
>
deleteUniversityInfo
(
@
RequestParam
(
"id"
)
String
id
)
{
public
ResponseData
<
String
>
deleteUniversityInfo
(
@
PathVariable
(
"id"
)
Integer
id
)
{
ShiroUser
user
=
getShiroUser
();
ShiroUser
user
=
getShiroUser
();
if
(!
user
.
getRoleNames
().
stream
().
anyMatch
(
roleName
->
StringUtils
.
equalsAny
(
roleName
,
"超级管理员"
)))
{
if
(!
user
.
getRoleNames
().
stream
().
anyMatch
(
roleName
->
StringUtils
.
equalsAny
(
roleName
,
"超级管理员"
)))
{
return
ResponseData
.
error
(
"无数据权限"
);
return
ResponseData
.
error
(
"无数据权限"
);
...
@@ -83,25 +80,34 @@ public class UniversityInfoController extends BaseController {
...
@@ -83,25 +80,34 @@ public class UniversityInfoController extends BaseController {
/**
/**
* 编辑大学宽带信息
* 编辑大学宽带信息
* @param university
Info
编辑对象的json字符串
* @param university 编辑对象的json字符串
* @return
* @return
*/
*/
@Permission
(
menuname
=
"修改宽带信息"
,
value
=
"update"
,
method
=
RequestMethod
.
POST
)
@Permission
(
menuname
=
"修改宽带信息"
,
value
=
"update"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
String
>
updateUniversityInfo
(
@RequestParam
(
"university
Info"
)
String
universityInfo
)
{
public
ResponseData
<
String
>
updateUniversityInfo
(
@RequestParam
(
"university
"
)
String
university
)
{
ShiroUser
user
=
getShiroUser
();
ShiroUser
user
=
getShiroUser
();
if
(!
user
.
getRoleNames
().
stream
().
anyMatch
(
roleName
->
StringUtils
.
equalsAny
(
roleName
,
"超级管理员"
)))
{
if
(!
user
.
getRoleNames
().
stream
().
anyMatch
(
roleName
->
StringUtils
.
equalsAny
(
roleName
,
"超级管理员"
)))
{
return
ResponseData
.
error
(
"无数据权限"
);
return
ResponseData
.
error
(
"无数据权限"
);
}
}
UniversityInfo
uni
=
JSON
.
parseObject
(
university
Info
,
UniversityInfo
.
class
);
UniversityInfo
uni
=
JSON
.
parseObject
(
university
,
UniversityInfo
.
class
);
Wrapper
wrapper
=
new
EntityWrapper
<>();
Wrapper
wrapper
=
new
EntityWrapper
<>();
wrapper
.
eq
(
"university_id"
,
uni
.
getUniversityId
());
wrapper
.
eq
(
"university_id"
,
uni
.
getUniversityId
());
/**
* 待定............................
*/
Date
date
=
new
Date
();
Date
date
=
new
Date
();
Timestamp
timestamp
=
new
Timestamp
(
date
.
getTime
());
Timestamp
timestamp
=
new
Timestamp
(
date
.
getTime
());
Map
<
String
,
Object
>
dataMapping
=
new
HashMap
<>();
Map
<
String
,
Object
>
dataMapping
=
new
HashMap
<>();
dataMapping
.
put
(
"university_last_update_time"
,
timestamp
);
dataMapping
.
put
(
"university_last_update_time"
,
timestamp
);
dataMapping
.
put
(
"university_name"
,
uni
.
getUniversityName
());
dataMapping
.
put
(
"university_region"
,
uni
.
getUniversityRegion
());
dataMapping
.
put
(
"university_installed_address"
,
uni
.
getUniversityInstalledAddress
());
dataMapping
.
put
(
"university_exterior_lines"
,
uni
.
getUniversityExteriorLines
());
dataMapping
.
put
(
"university_package_number"
,
uni
.
getUniversityPackageNumber
());
dataMapping
.
put
(
"university_user_type"
,
uni
.
getUniversityUserType
());
dataMapping
.
put
(
"university_contact_phone"
,
uni
.
getUniversityContactPhone
());
dataMapping
.
put
(
"university_monthly_rent_type"
,
uni
.
getUniversityMonthlyRentType
());
dataMapping
.
put
(
"university_charge_mode"
,
uni
.
getUniversityChargeMode
());
dataMapping
.
put
(
"university_charging_attribute"
,
uni
.
getUniversityChargingAttribute
());
dataMapping
.
put
(
"speed"
,
uni
.
getSpeed
());
dataMapping
.
put
(
"public_number"
,
uni
.
getPublicNumber
());
universityInfoMapper
.
updateForSet
(
MyBatisPlusUpdateUtils
.
toUpdateSet
(
dataMapping
),
wrapper
);
universityInfoMapper
.
updateForSet
(
MyBatisPlusUpdateUtils
.
toUpdateSet
(
dataMapping
),
wrapper
);
return
ResponseData
.
success
(
"修改完毕!"
);
return
ResponseData
.
success
(
"修改完毕!"
);
}
}
...
@@ -116,14 +122,14 @@ public class UniversityInfoController extends BaseController {
...
@@ -116,14 +122,14 @@ public class UniversityInfoController extends BaseController {
*/
*/
@Permission
(
menuname
=
"查询宽带信息"
,
value
=
"list"
,
method
=
RequestMethod
.
POST
)
@Permission
(
menuname
=
"查询宽带信息"
,
value
=
"list"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
Page
<
UniversityInfo
>>
listUniversityInfo
(
@RequestParam
(
"universityName"
)
String
universityName
,
@RequestParam
(
"universityRegion"
)
String
universityRegion
,
public
ResponseData
<
Page
<
UniversityInfo
>>
listUniversityInfo
(
@RequestParam
(
"universityName"
)
String
universityName
,
@RequestParam
(
"universityRegion"
)
String
universityRegion
,
@RequestParam
(
name
=
"page
Index"
,
required
=
false
)
int
pageIndex
,
@RequestParam
(
name
=
"pageSize"
,
required
=
false
)
int
pageSize
)
{
@RequestParam
(
name
=
"page
No"
)
int
pageIndex
,
@RequestParam
(
name
=
"pageSize"
)
int
pageSize
)
{
ShiroUser
user
=
getShiroUser
();
ShiroUser
user
=
getShiroUser
();
if
(!
user
.
getRoleNames
().
stream
().
anyMatch
(
roleName
->
StringUtils
.
equalsAny
(
roleName
,
"超级管理员"
)))
{
if
(!
user
.
getRoleNames
().
stream
().
anyMatch
(
roleName
->
StringUtils
.
equalsAny
(
roleName
,
"超级管理员"
)))
{
return
ResponseData
.
error
(
"无数据权限"
);
return
ResponseData
.
error
(
"无数据权限"
);
}
}
Wrapper
<
UniversityInfo
>
wrapper
=
new
EntityWrapper
();
Wrapper
<
UniversityInfo
>
wrapper
=
new
EntityWrapper
();
wrapper
.
like
(
StringUtils
.
isNotBlank
(
universityName
),
"university
Name"
,
universityName
,
SqlLike
.
LEF
T
);
wrapper
.
like
(
StringUtils
.
isNotBlank
(
universityName
),
"university
_name"
,
universityName
,
SqlLike
.
DEFAUL
T
);
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
universityRegion
),
"universityRegion"
,
universityRegion
);
wrapper
.
like
(
StringUtils
.
isNotBlank
(
universityRegion
),
"university_region"
,
universityRegion
,
SqlLike
.
DEFAULT
);
Page
<
UniversityInfo
>
page
=
new
Page
<>(
pageIndex
,
pageSize
);
Page
<
UniversityInfo
>
page
=
new
Page
<>(
pageIndex
,
pageSize
);
List
<
UniversityInfo
>
universitys
=
universityInfoMapper
.
selectPage
(
page
,
wrapper
);
List
<
UniversityInfo
>
universitys
=
universityInfoMapper
.
selectPage
(
page
,
wrapper
);
page
.
setRecords
(
universitys
);
page
.
setRecords
(
universitys
);
...
...
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