Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
work_service
Project
Project
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
licc
work_service
Commits
ceb5dcfb
Commit
ceb5dcfb
authored
Mar 02, 2021
by
cq990612
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码结构
parent
95b909aa
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
16 deletions
+26
-16
BASE_RESP_CODE_ENUM.java
...wisenergy/common/utils/exception/BASE_RESP_CODE_ENUM.java
+1
-1
WorkUserMapper.java
...per/src/main/java/cn/wisenergy/mapper/WorkUserMapper.java
+1
-1
WorkProjectMapper.xml
...gy-mapper/src/main/resources/mapper/WorkProjectMapper.xml
+2
-2
WorkTimeOrderServiceImpl.java
...a/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
+16
-6
SystemController.java
.../wisenergy/web/admin/controller/app/SystemController.java
+4
-4
WorkProjectController.java
...nergy/web/admin/controller/app/WorkProjectController.java
+2
-2
No files found.
wisenergy-common/src/main/java/cn/wisenergy/common/utils/exception/BASE_RESP_CODE_ENUM.java
View file @
ceb5dcfb
...
...
@@ -51,7 +51,7 @@ public enum BASE_RESP_CODE_ENUM {
WORK_PROJECT_IS_NULL
(
"629"
,
"项目或商机为空"
),
WORK_ORDER_END
(
"630"
,
"该项目暂无待审批工单"
),
DEPT_IS_NULL
(
"631"
,
"该部门不存在"
),
MANAGER_NOT_PROJECT
(
"632"
,
"该管理没有可管理的项目
"
),
USER_NOT_LEVEL
(
"632"
,
"该用户没有权限,请联系管理员添加权限
"
),
DEPT_NOT_FOUND
(
"633"
,
"部门信息未找到"
),
FAILEDTO_DELETE_DATA
(
"634"
,
"删除数据失败"
),
CENTRE_NOT_FOUND
(
"635"
,
"中心信息未找到"
),
...
...
wisenergy-mapper/src/main/java/cn/wisenergy/mapper/WorkUserMapper.java
View file @
ceb5dcfb
...
...
@@ -44,6 +44,6 @@ public interface WorkUserMapper extends BaseMapper<WorkUser> {
List
<
WorkRole
>
getUserRole
(
Integer
id
);
int
updateStatusById
(
Integer
userId
,
Integer
status
);
int
updateStatusById
(
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"status"
)
Integer
status
);
}
wisenergy-mapper/src/main/resources/mapper/WorkProjectMapper.xml
View file @
ceb5dcfb
...
...
@@ -119,10 +119,10 @@
<select
id=
"getManagerProjectsDto"
resultType=
"cn.wisenergy.model.dto.ManagerProjectsDto"
>
select p.id,p.oa_project_id,p.project_name,p.type,p.create_time,p.is_conclusion,
GROUP_CONCAT(DISTINCT(u.name)) as 'participants',p.cost_budget,p.work_time,p.start_time,p.end_time,
if(cost is NULL,0
.00,cost) as 'currentLaborCost',if(total_time is NULL,0.00,total_time
) as 'totalCurrentWorkingHours',
if(cost is NULL,0
,0 + cast(cost as char)) as 'currentLaborCost',if(total_time is NULL,0,0 + cast(total_time as char)
) as 'totalCurrentWorkingHours',
if(p.end_time>=curdate(),'否','是') as 'isItOverdue',
if(p.create_time = p.modify_time,'否','是') as 'isThereABudgetChange'
from work_project p LEFT JOIN (select project_id,SUM(total_time) as 'total_time',SUM(cost) as 'cost'
from work_project p LEFT JOIN (select project_id,SUM(total_time) as 'total_time',SUM(cost)
/10000
as 'cost'
FROM work_project_time_cost
GROUP BY project_id) o on p.id = o.project_id
LEFT JOIN work_user_project up ON p.id = up.project_id
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
View file @
ceb5dcfb
...
...
@@ -348,7 +348,9 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
public
PageInfo
<
WorkTimeOrderDto
>
getExamine
(
Integer
userId
,
Integer
projectId
,
Integer
type
,
Integer
page
,
Integer
pageSize
,
List
<
Integer
>
status
)
{
log
.
info
(
"WorkOrderServiceImpl[]getExamine[]input.param.userId:{},projectId:{},type:{},page:{},size:{},status:{}"
+
userId
,
projectId
,
type
,
page
,
pageSize
,
status
);
// 判断当前用户是否是管理员
isManager
(
userId
);
if
(
UserRoleLevelUtils
.
isManagerLevel
(
userId
,
LevelEnum
.
EXAMINE
.
getLevelName
()))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
USER_NOT_LEVEL
);
}
WorkUser
user
=
workUserService
.
getById
(
userId
);
// PC端
return
pageExamine
(
user
,
projectId
,
type
,
page
,
pageSize
,
status
);
...
...
@@ -365,7 +367,9 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
@Override
public
List
<
AppletsPendApprovalDto
>
getExamineApplets
(
Integer
userId
,
Integer
projectId
,
Integer
type
)
{
log
.
info
(
"WorkOrderServiceImpl[]getExamineApplets[]input.param.userId:{},projectId:{},type:{}"
+
userId
,
projectId
,
type
);
isManager
(
userId
);
if
(
UserRoleLevelUtils
.
isManagerLevel
(
userId
,
LevelEnum
.
EXAMINE
.
getLevelName
()))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
USER_NOT_LEVEL
);
}
WorkUser
user
=
workUserService
.
getById
(
userId
);
if
(
null
==
projectId
&&
null
==
type
)
{
return
null
;
...
...
@@ -444,8 +448,9 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
if
(
CollectionUtils
.
isEmpty
(
ids
))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
isManager
(
reviewerId
);
if
(
UserRoleLevelUtils
.
isManagerLevel
(
reviewerId
,
LevelEnum
.
EXAMINE
.
getLevelName
()))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
USER_NOT_LEVEL
);
}
int
i
=
workTimeOrderMapper
.
updateByIds
(
reviewerId
,
ids
);
if
(
i
==
0
)
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
UPDATE_DATA_FAIL
);
...
...
@@ -477,7 +482,10 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
// 判断当前用户是否有权限
isManager
(
reviewerId
);
if
(
UserRoleLevelUtils
.
isManagerLevel
(
reviewerId
,
LevelEnum
.
EXAMINE
.
getLevelName
()))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
USER_NOT_LEVEL
);
}
// 修改工单状态
int
i
=
workTimeOrderMapper
.
updateStatusById
(
reviewerId
,
id
,
reason
);
if
(
i
==
0
)
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
UPDATE_DATA_FAIL
);
...
...
@@ -503,7 +511,9 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
@Override
public
List
<
WorkTimeOrderDto
>
rejectNotSubmit
(
Integer
userId
)
{
log
.
info
(
"WorkOrderServiceImpl[]rejectById[]input.param.id:{}"
+
userId
);
isManager
(
userId
);
if
(
UserRoleLevelUtils
.
isManagerLevel
(
userId
,
LevelEnum
.
EXAMINE
.
getLevelName
()))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
USER_NOT_LEVEL
);
}
QueryWrapper
<
WorkTimeOrder
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"reviewer_id"
,
userId
);
wrapper
.
eq
(
"status"
,
REJECTED
);
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/SystemController.java
View file @
ceb5dcfb
...
...
@@ -100,13 +100,13 @@ public class SystemController extends BaseController {
return
getResult
(
allRoleAndUserRoleDto
);
}
@ApiOperation
(
value
=
"设置角色"
,
notes
=
"设置角色"
,
httpMethod
=
"P
OS
T"
)
@ApiOperation
(
value
=
"设置角色"
,
notes
=
"设置角色"
,
httpMethod
=
"P
U
T"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户id"
,
dataType
=
"int"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"roleIds"
,
value
=
"角色ids"
,
dataType
=
"String"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"status"
,
value
=
"用户状态"
,
dataType
=
"int"
,
required
=
true
)
})
@P
os
tMapping
(
"/modifyRole"
)
@P
u
tMapping
(
"/modifyRole"
)
public
Result
<
Boolean
>
modifyRole
(
Integer
userId
,
String
roleIds
,
Integer
status
)
{
log
.
info
(
"SystemController[]modifyRole[]input.param.userId:{},roleIds:{},status:{}"
+
userId
,
roleIds
,
status
);
if
(
null
==
userId
||
StringUtils
.
isBlank
(
roleIds
)
||
null
==
status
)
{
...
...
@@ -129,9 +129,9 @@ public class SystemController extends BaseController {
return
getResult
(
aBoolean
);
}
@ApiOperation
(
value
=
"删除工时类型"
,
notes
=
"删除工时类型"
,
httpMethod
=
"
PUT
"
)
@ApiOperation
(
value
=
"删除工时类型"
,
notes
=
"删除工时类型"
,
httpMethod
=
"
DELETE
"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"类型id"
,
dataType
=
"int"
,
required
=
true
)
@
Put
Mapping
(
"/modifyWorkType"
)
@
Delete
Mapping
(
"/modifyWorkType"
)
public
Result
<
Boolean
>
deleteTypeById
(
Integer
id
)
{
log
.
info
(
"SystemController[]modifyRole[]input.param.id:{}"
+
id
);
Boolean
aBoolean
=
workTypeService
.
deleteTypeById
(
id
);
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/WorkProjectController.java
View file @
ceb5dcfb
...
...
@@ -58,9 +58,9 @@ public class WorkProjectController extends BaseController {
}
@ApiOperation
(
value
=
"编辑项目/商机"
,
notes
=
"编辑项目/商机"
,
httpMethod
=
"P
OS
T"
)
@ApiOperation
(
value
=
"编辑项目/商机"
,
notes
=
"编辑项目/商机"
,
httpMethod
=
"P
U
T"
)
@ApiImplicitParam
(
name
=
"modifyProjectVo"
,
value
=
"编辑内容"
,
dataType
=
"ModifyProjectVo"
,
required
=
true
)
@P
os
tMapping
(
value
=
"/modifyProject"
)
@P
u
tMapping
(
value
=
"/modifyProject"
)
public
Result
<
Boolean
>
modifyProject
(
@RequestBody
ModifyProjectVo
modifyProjectVo
)
{
log
.
info
(
"WorkProjectController[]endProject[]input.param.modifyProjectVo:{}"
+
modifyProjectVo
);
Boolean
aBoolean
=
workProjectService
.
modifyProject
(
modifyProjectVo
);
...
...
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