Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
drp
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
drp
Commits
8689a575
Commit
8689a575
authored
Mar 18, 2015
by
reedmi
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/custom-for-wangli' into custom-for-wangli
parents
da1c9307
b4c4de23
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
57 additions
and
27 deletions
+57
-27
src/main/java/com/originspark/drp/controllers/UserController.java
.../java/com/originspark/drp/controllers/UserController.java
+42
-13
src/main/java/com/originspark/drp/service/users/UserServiceBean.java
...va/com/originspark/drp/service/users/UserServiceBean.java
+2
-1
src/main/webapp/drp/app/controller/users/ManagerController.js
...main/webapp/drp/app/controller/users/ManagerController.js
+1
-1
src/main/webapp/drp/app/controller/users/RegulatorController.js
...in/webapp/drp/app/controller/users/RegulatorController.js
+1
-1
src/main/webapp/drp/app/controller/users/WareKeeperController.js
...n/webapp/drp/app/controller/users/WareKeeperController.js
+1
-1
src/main/webapp/drp/app/model/users/ManagerModel.js
src/main/webapp/drp/app/model/users/ManagerModel.js
+1
-1
src/main/webapp/drp/app/model/users/RegulatorModel.js
src/main/webapp/drp/app/model/users/RegulatorModel.js
+1
-1
src/main/webapp/drp/app/model/users/WareKeeperModel.js
src/main/webapp/drp/app/model/users/WareKeeperModel.js
+1
-1
src/main/webapp/drp/app/view/users/ManagerView.js
src/main/webapp/drp/app/view/users/ManagerView.js
+1
-1
src/main/webapp/drp/app/view/users/ManagerViewForm.js
src/main/webapp/drp/app/view/users/ManagerViewForm.js
+1
-1
src/main/webapp/drp/app/view/users/RegulatorView.js
src/main/webapp/drp/app/view/users/RegulatorView.js
+1
-1
src/main/webapp/drp/app/view/users/RegulatorViewForm.js
src/main/webapp/drp/app/view/users/RegulatorViewForm.js
+3
-3
src/main/webapp/drp/base/controller/MainController.js
src/main/webapp/drp/base/controller/MainController.js
+1
-1
No files found.
src/main/java/com/originspark/drp/controllers/UserController.java
View file @
8689a575
...
...
@@ -15,7 +15,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.originspark.drp.models.User
;
import
com.originspark.drp.util.SessionUtil
;
import
com.originspark.drp.util.enums.Status
;
import
com.originspark.drp.util.enums.UserType
;
import
com.originspark.drp.util.json.FilterRequest
;
import
com.originspark.drp.util.json.IdsJson
;
import
com.originspark.drp.util.json.JsonUtils
;
...
...
@@ -24,26 +26,48 @@ import com.originspark.drp.util.json.JsonUtils;
@RequestMapping
(
"users"
)
public
class
UserController
extends
BaseController
{
@RequestMapping
(
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/{type}"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
String
create
(
@RequestBody
User
user
)
{
public
String
create
(
@PathVariable
String
type
,
@RequestBody
User
user
)
{
if
(
type
==
null
||
""
.
equals
(
type
))
{
return
ok
(
"参数错误"
);
}
User
currentUser
=
getCurrentUser
();
if
(
currentUser
==
null
||
!
UserType
.
MANAGER
.
equals
(
currentUser
.
getType
()))
{
return
ok
(
"权限不足"
);
}
user
.
setType
(
UserType
.
valueOf
(
type
.
toUpperCase
()));
user
.
setPassword
(
"123456"
);
userService
.
save
(
user
);
return
ok
(
"创建成功"
);
}
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@RequestMapping
(
value
=
"/{
type}/{
id}"
,
method
=
RequestMethod
.
DELETE
)
@ResponseBody
public
String
delete
(
@PathVariable
Long
id
)
{
public
String
delete
(
@PathVariable
String
type
,
@PathVariable
Long
id
)
{
if
(
type
==
null
||
""
.
equals
(
type
)
||
id
==
null
||
id
<
1
)
{
return
ok
(
"参数错误"
);
}
User
currentUser
=
getCurrentUser
();
if
(
currentUser
==
null
||
!
UserType
.
MANAGER
.
equals
(
currentUser
.
getType
()))
{
return
ok
(
"权限不足"
);
}
User
leader
=
userService
.
findById
(
User
.
class
,
id
);
leader
.
setStatus
(
Status
.
DESTORYED
);
userService
.
update
(
leader
);
return
ok
(
"注销成功"
);
}
@RequestMapping
(
value
=
"/deleteBatch"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/
{type}/
deleteBatch"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
String
deleteBatch
(
HttpServletRequest
request
){
public
String
deleteBatch
(
@PathVariable
String
type
,
HttpServletRequest
request
){
if
(
type
==
null
||
""
.
equals
(
type
))
{
return
ok
(
"参数错误"
);
}
User
currentUser
=
getCurrentUser
();
if
(
currentUser
==
null
||
!
UserType
.
MANAGER
.
equals
(
currentUser
.
getType
()))
{
return
ok
(
"权限不足"
);
}
String
data
=
request
.
getParameter
(
"data"
);
ObjectMapper
mapper
=
new
ObjectMapper
();
IdsJson
json
=
null
;
...
...
@@ -63,10 +87,16 @@ public class UserController extends BaseController {
return
ok
(
"注销成功"
);
}
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
PUT
)
@RequestMapping
(
value
=
"/{
type}/{
id}"
,
method
=
RequestMethod
.
PUT
)
@ResponseBody
public
String
update
(
@PathVariable
Long
id
,
@RequestBody
User
user
)
{
public
String
update
(
@PathVariable
String
type
,
@PathVariable
Long
id
,
@RequestBody
User
user
)
{
if
(
type
==
null
||
""
.
equals
(
type
)
||
id
==
null
||
id
<
1
)
{
return
ok
(
"参数错误"
);
}
User
currentUser
=
getCurrentUser
();
if
(
currentUser
==
null
||
!
UserType
.
MANAGER
.
equals
(
currentUser
.
getType
()))
{
return
ok
(
"权限不足"
);
}
User
existingLeader
=
userService
.
findById
(
User
.
class
,
id
);
if
(
existingLeader
==
null
)
{
return
failure
(
"您要更新的领导不存在"
);
...
...
@@ -84,13 +114,12 @@ public class UserController extends BaseController {
return
ok
(
"更新成功"
);
}
@RequestMapping
(
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/{type}"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
String
list
(
@RequestParam
int
start
,
@RequestParam
int
limit
,
@RequestParam
(
required
=
false
)
Object
filter
)
{
public
String
list
(
@PathVariable
String
type
,
@RequestParam
int
start
,
@RequestParam
int
limit
,
@RequestParam
(
required
=
false
)
Object
filter
)
{
List
<
FilterRequest
>
filters
=
new
ArrayList
<
FilterRequest
>();
filters
.
add
(
new
FilterRequest
(
"type"
,
"Leader"
));
filters
.
add
(
new
FilterRequest
(
"type"
,
type
.
toUpperCase
()
));
if
(
filter
!=
null
)
{
filters
.
addAll
(
JsonUtils
.
getListFromJsonArray
(
filter
));
...
...
src/main/java/com/originspark/drp/service/users/UserServiceBean.java
View file @
8689a575
...
...
@@ -17,6 +17,7 @@ import com.originspark.drp.models.User;
import
com.originspark.drp.models.User.COLUMNS
;
import
com.originspark.drp.util.enums.Gender
;
import
com.originspark.drp.util.enums.Status
;
import
com.originspark.drp.util.enums.UserType
;
import
com.originspark.drp.util.json.FilterRequest
;
@Transactional
...
...
@@ -80,7 +81,7 @@ public class UserServiceBean extends BaseDAOSupport<User> implements UserService
switch
(
column
)
{
case
TYPE
:
if
(
value
!=
null
&&
!
value
.
equals
(
""
))
{
criteria
.
add
(
cb
.
equal
(
user
.
get
(
"type"
),
value
));
criteria
.
add
(
cb
.
equal
(
user
.
get
(
"type"
),
UserType
.
valueOf
(
value
)
));
}
break
;
case
NAME:
...
...
src/main/webapp/drp/app/controller/users/ManagerController.js
View file @
8689a575
...
...
@@ -91,7 +91,7 @@ Ext.define("drp.app.controller.users.ManagerController", {
deleteManager
:
function
(
btn
)
{
//me.deleteModel(btn, managerGrid, "负责人");
me
.
deleteBatchModel
(
btn
,
managerGrid
,
"
负责人
"
,
"
/projectM
anager/deleteBatch
"
);
me
.
deleteBatchModel
(
btn
,
managerGrid
,
"
负责人
"
,
"
users/m
anager/deleteBatch
"
);
},
submitManagerForm
:
function
(
btn
)
{
...
...
src/main/webapp/drp/app/controller/users/RegulatorController.js
View file @
8689a575
...
...
@@ -90,7 +90,7 @@ Ext.define("drp.app.controller.users.RegulatorController", {
},
deleteRegulator
:
function
(
btn
)
{
me
.
deleteBatchModel
(
btn
,
regulatorGrid
,
"
经手人
"
,
"
/materialKeepe
r/deleteBatch
"
);
me
.
deleteBatchModel
(
btn
,
regulatorGrid
,
"
经手人
"
,
"
users/regulato
r/deleteBatch
"
);
},
submitRegulatorForm
:
function
(
btn
)
{
...
...
src/main/webapp/drp/app/controller/users/WareKeeperController.js
View file @
8689a575
...
...
@@ -91,7 +91,7 @@ Ext.define("drp.app.controller.users.WareKeeperController", {
deleteWareKeeper
:
function
(
btn
)
{
//me.deleteModel(btn, wareKeeperGrid, "库管");
me
.
deleteBatchModel
(
btn
,
wareKeeperGrid
,
"
库管
"
,
"
/wareKeeper/deleteBatch
"
);
me
.
deleteBatchModel
(
btn
,
wareKeeperGrid
,
"
库管
"
,
"
users
/wareKeeper/deleteBatch
"
);
},
submitWareKeeperForm
:
function
(
btn
)
{
...
...
src/main/webapp/drp/app/model/users/ManagerModel.js
View file @
8689a575
...
...
@@ -2,7 +2,7 @@ Ext.define("drp.app.model.users.ManagerModel", {
extend
:
"
drp.app.model.users.AbstractUserModel
"
,
proxy
:
{
type
:
'
rest
'
,
url
:
'
manager
'
,
url
:
'
users/
manager
'
,
reader
:
{
type
:
"
json
"
,
root
:
"
data
"
,
...
...
src/main/webapp/drp/app/model/users/RegulatorModel.js
View file @
8689a575
...
...
@@ -2,7 +2,7 @@ Ext.define("drp.app.model.users.RegulatorModel", {
extend
:
"
drp.app.model.users.AbstractUserModel
"
,
proxy
:
{
type
:
'
rest
'
,
url
:
'
regulator
'
,
url
:
'
users/
regulator
'
,
reader
:
{
type
:
"
json
"
,
root
:
"
data
"
,
...
...
src/main/webapp/drp/app/model/users/WareKeeperModel.js
View file @
8689a575
...
...
@@ -2,7 +2,7 @@ Ext.define("drp.app.model.users.WareKeeperModel", {
extend
:
"
drp.app.model.users.AbstractUserModel
"
,
proxy
:
{
type
:
'
rest
'
,
url
:
'
wareKeeper
'
,
url
:
'
users/
wareKeeper
'
,
reader
:
{
type
:
"
json
"
,
root
:
"
data
"
,
...
...
src/main/webapp/drp/app/view/users/ManagerView.js
View file @
8689a575
...
...
@@ -100,7 +100,7 @@ Ext.define('drp.app.view.users.ManagerView', {
},
{
xtype
:
'
button
'
,
margin
:
'
5 0 0 20
'
,
action
:
'
search
Project
Manager
'
,
action
:
'
searchManager
'
,
icon
:
'
resources/images/icons/search.png
'
,
text
:
'
查询
'
},
{
...
...
src/main/webapp/drp/app/view/users/ManagerViewForm.js
View file @
8689a575
...
...
@@ -15,7 +15,7 @@ Ext.define("drp.app.view.users.ManagerViewForm", {
margin
:
'
5 0 0 5
'
,
name
:
'
name
'
,
allowBlank
:
false
,
fieldLabel
:
'
名称
<font color="red">*</font>
'
fieldLabel
:
'
姓名
<font color="red">*</font>
'
},
{
xtype
:
'
textfield
'
,
anchor
:
'
60%
'
,
...
...
src/main/webapp/drp/app/view/users/RegulatorView.js
View file @
8689a575
...
...
@@ -3,7 +3,7 @@ Ext.define('drp.app.view.users.RegulatorView', {
alias
:
'
widget.regulatorview
'
,
margins
:
'
0 0 0 0
'
,
border
:
0
,
title
:
'
<center height=40>
材料员
</center>
'
,
title
:
'
<center height=40>
经手人
</center>
'
,
autoScroll
:
true
,
closable
:
true
,
layout
:
{
...
...
src/main/webapp/drp/app/view/users/RegulatorViewForm.js
View file @
8689a575
Ext
.
define
(
"
drp.app.view.users.MaterialKeeperViewForm
"
,
{
extend
:
'
Ext.panel.Panel
'
,
alias
:
'
widget.
materialkeepe
rviewform
'
,
alias
:
'
widget.
regulato
rviewform
'
,
author
:
'
100%
'
,
autoScroll
:
true
,
items
:
[{
...
...
@@ -85,13 +85,13 @@ Ext.define("drp.app.view.users.MaterialKeeperViewForm", {
items
:
[{
xtype
:
'
button
'
,
margin
:
'
5 0 0 5
'
,
action
:
'
submit
MaterialKeepe
rForm
'
,
action
:
'
submit
Regulato
rForm
'
,
width
:
80
,
text
:
'
确认
'
},
{
xtype
:
'
button
'
,
margin
:
'
5 0 0 5
'
,
action
:
'
close
MaterialKeepe
rForm
'
,
action
:
'
close
Regulato
rForm
'
,
width
:
80
,
text
:
'
取消
'
}]
...
...
src/main/webapp/drp/base/controller/MainController.js
View file @
8689a575
...
...
@@ -50,7 +50,7 @@ Ext.define("drp.base.controller.MainController", {
else
if
(
record
.
data
[
"
id
"
]
==
"
menu_manager
"
){
//库管员
itemViewXtype
=
"
managerview
"
;
itemViewController
=
"
drp.app.controller.users.ManagerController
"
;
itemViewName
=
"
drp.app.view.users.Ma
terialKeep
erView
"
;
itemViewName
=
"
drp.app.view.users.Ma
nag
erView
"
;
}
else
if
(
record
.
data
[
"
id
"
]
==
"
menu_warekeeper
"
){
//负责人
itemViewXtype
=
"
warekeeperview
"
;
itemViewController
=
"
drp.app.controller.users.WareKeeperController
"
;
...
...
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