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
91ead397
Commit
91ead397
authored
Feb 19, 2021
by
cq990612
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码结构
parent
695400e5
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
49 additions
and
54 deletions
+49
-54
WorkProjectMapper.xml
...gy-mapper/src/main/resources/mapper/WorkProjectMapper.xml
+6
-3
ManagerProjectsDto.java
.../main/java/cn/wisenergy/model/dto/ManagerProjectsDto.java
+2
-0
WorkHolidayService.java
...rc/main/java/cn/wisenergy/service/WorkHolidayService.java
+1
-2
WorkHolidayServiceImpl.java
...ava/cn/wisenergy/service/impl/WorkHolidayServiceImpl.java
+33
-26
WorkProjectServiceImpl.java
...ava/cn/wisenergy/service/impl/WorkProjectServiceImpl.java
+1
-0
SystemController.java
.../wisenergy/web/admin/controller/app/SystemController.java
+5
-12
WorkUserController.java
...isenergy/web/admin/controller/app/WorkUserController.java
+1
-11
No files found.
wisenergy-mapper/src/main/resources/mapper/WorkProjectMapper.xml
View file @
91ead397
...
...
@@ -64,8 +64,9 @@
work_time = #{workTime},
</if>
<if
test=
"null != costBudget"
>
cost_budget =#{costBudget}
cost_budget =#{costBudget}
,
</if>
modify_time = now()
</set>
<where>
<if
test=
"null != projectId"
>
...
...
@@ -118,10 +119,12 @@
<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,
ROUND(SUM(o.work_time)/8,2) as 'currentLaborCost',ROUND(SUM(o.work_time),2)
as 'totalCurrentWorkingHours',
cost as 'currentLaborCost',total_time
as 'totalCurrentWorkingHours',
if(now() BETWEEN p.start_time and p.end_time,'否','是') as 'isItOverdue',
if(p.create_time = p.modify_time,'否','是') as 'isThereABudgetChange'
from work_project p LEFT JOIN work_time_order o on p.id = o.project_id
from work_project p LEFT JOIN (select project_id,SUM(total_time) as 'total_time',SUM(cost)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
LEFT JOIN work_user u on u.id = up.user_id
<where>
...
...
wisenergy-model/src/main/java/cn/wisenergy/model/dto/ManagerProjectsDto.java
View file @
91ead397
...
...
@@ -49,9 +49,11 @@ public class ManagerProjectsDto implements Serializable {
@ApiModelProperty
(
name
=
"isConclusion"
,
value
=
"是否结项 :0:项目已结束、1:项目未结束"
)
private
Integer
isConclusion
;
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd"
)
@ApiModelProperty
(
name
=
"startTime"
,
value
=
"项目开始时间"
)
private
Date
startTime
;
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd"
)
@ApiModelProperty
(
name
=
"endTime"
,
value
=
"项目结束时间"
)
private
Date
endTime
;
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/WorkHolidayService.java
View file @
91ead397
...
...
@@ -16,9 +16,8 @@ import java.util.Date;
public
interface
WorkHolidayService
{
Boolean
isHoliday
(
Date
date
);
Boolean
addHoliday
(
WorkHoliday
workHoliday
);
Boolean
m
odifyHoliday
(
WorkHoliday
workHoliday
);
Boolean
addAndM
odifyHoliday
(
WorkHoliday
workHoliday
);
Boolean
deleteHoliday
(
Integer
id
);
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkHolidayServiceImpl.java
View file @
91ead397
...
...
@@ -66,8 +66,8 @@ public class WorkHolidayServiceImpl implements WorkHolidayService {
}
@Override
p
ublic
Boolean
addHoliday
(
WorkHoliday
workHoliday
)
{
p
rivate
Boolean
addHoliday
(
WorkHoliday
workHoliday
)
{
log
.
info
(
"WorkHolidayServiceImpl[]addHoliday[]input.param.workHoliday:{}"
+
workHoliday
);
verificationDate
(
workHoliday
);
List
<
WorkHoliday
>
holidays
=
workHolidayMapper
.
getByTypeAndStartDate
(
1
,
new
Date
());
...
...
@@ -88,8 +88,14 @@ public class WorkHolidayServiceImpl implements WorkHolidayService {
@Transactional
@Override
public
Boolean
m
odifyHoliday
(
WorkHoliday
workHoliday
)
{
public
Boolean
addAndM
odifyHoliday
(
WorkHoliday
workHoliday
)
{
log
.
info
(
"WorkHolidayServiceImpl[]modifyHoliday[]input.param.workHoliday:{}"
+
workHoliday
);
if
(
null
==
workHoliday
)
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
if
(
null
==
workHoliday
.
getId
())
{
return
addHoliday
(
workHoliday
);
}
else
{
workHoliday
.
setDayType
(
1
);
verificationDate
(
workHoliday
);
if
(
null
==
workHoliday
.
getId
())
{
...
...
@@ -116,6 +122,7 @@ public class WorkHolidayServiceImpl implements WorkHolidayService {
int
i
=
workHolidayMapper
.
updateById
(
workHoliday
);
return
i
>
0
;
}
}
@Transactional
@Override
...
...
@@ -155,9 +162,9 @@ public class WorkHolidayServiceImpl implements WorkHolidayService {
if
(
null
==
workHoliday
.
getDayEnd
())
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
if
(
null
==
workHoliday
.
getDayType
())
{
/*
if (null == workHoliday.getDayType()) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.INPUT_PARAM_IS_NULL);
}
}
*/
if
(
null
==
workHoliday
.
getDes
())
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
...
...
@@ -219,7 +226,7 @@ public class WorkHolidayServiceImpl implements WorkHolidayService {
}
start
=
workHoliday1
.
getDayStart
().
getTime
();
end
=
workHoliday1
.
getDayEnd
().
getTime
();
if
((
d1
-
start
>=
0
&&
d2
-
end
<=
0
)
||(
d1
-
start
<=
0
&&
d2
-
end
>=
0
)
||(
d1
-
start
<=
0
&&
d2
-
start
>=
0
)||
(
d1
-
start
>=
0
&&
d1
-
end
<=
0
))
{
if
((
d1
-
start
>=
0
&&
d2
-
end
<=
0
)
||
(
d1
-
start
<=
0
&&
d2
-
end
>=
0
)
||
(
d1
-
start
<=
0
&&
d2
-
start
>=
0
)
||
(
d1
-
start
>=
0
&&
d1
-
end
<=
0
))
{
return
true
;
}
}
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkProjectServiceImpl.java
View file @
91ead397
...
...
@@ -416,6 +416,7 @@ public class WorkProjectServiceImpl implements WorkProjectService {
}
private
PageInfo
returnPageInfo
(
List
<
ManagerProjectsDto
>
managerProjectsDto
)
{
if
(
CollectionUtils
.
isEmpty
(
managerProjectsDto
))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
WORK_PROJECT_IS_NULL
);
}
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/SystemController.java
View file @
91ead397
...
...
@@ -43,20 +43,13 @@ public class SystemController extends BaseController {
@Autowired
private
WorkUserService
workUserService
;
@ApiOperation
(
value
=
"添加工作日历"
,
notes
=
"添加工作日历"
,
httpMethod
=
"POST"
)
@ApiImplicitParam
(
name
=
"workHoliday"
,
value
=
"节假日实体类"
,
dataType
=
"WorkHoliday"
,
required
=
true
)
@PostMapping
(
"/addHoliday"
)
public
Result
<
Boolean
>
addHoliday
(
@RequestBody
WorkHoliday
workHoliday
)
{
log
.
info
(
"SystemController[]addHoliday[]input.param.workHoliday:{}"
+
workHoliday
);
Boolean
aBoolean
=
workHolidayService
.
addHoliday
(
workHoliday
);
return
getResult
(
aBoolean
);
}
@ApiOperation
(
value
=
"编辑工作日历"
,
notes
=
"编辑工作日历"
,
httpMethod
=
"PUT"
)
@ApiOperation
(
value
=
"添加和编辑工作日历"
,
notes
=
"添加和编辑工作日历"
,
httpMethod
=
"PUT"
)
@ApiImplicitParam
(
name
=
"workHoliday"
,
value
=
"节假日实体类"
,
dataType
=
"WorkHoliday"
,
required
=
true
)
@PutMapping
(
"/
m
odifyHoliday"
)
public
Result
<
Boolean
>
m
odifyHoliday
(
@RequestBody
WorkHoliday
workHoliday
)
{
@PutMapping
(
"/
addAndM
odifyHoliday"
)
public
Result
<
Boolean
>
addAndM
odifyHoliday
(
@RequestBody
WorkHoliday
workHoliday
)
{
log
.
info
(
"SystemController[]modifyHoliday[]input.param.workHoliday:{}"
+
workHoliday
);
Boolean
aBoolean
=
workHolidayService
.
m
odifyHoliday
(
workHoliday
);
Boolean
aBoolean
=
workHolidayService
.
addAndM
odifyHoliday
(
workHoliday
);
return
getResult
(
aBoolean
);
}
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/WorkUserController.java
View file @
91ead397
...
...
@@ -3,9 +3,7 @@ package cn.wisenergy.web.admin.controller.app;
import
cn.wisenergy.common.utils.exception.*
;
import
cn.wisenergy.model.dto.OrganizationStructureDto
;
import
cn.wisenergy.model.dto.ResultUser
;
import
cn.wisenergy.model.dto.UserRoleLevelDto
;
import
cn.wisenergy.service.WorkUserService
;
import
cn.wisenergy.service.utils.UserRoleLevelUtils
;
import
cn.wisenergy.web.admin.controller.common.BaseController
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
...
...
@@ -54,7 +52,7 @@ public class WorkUserController extends BaseController {
@GetMapping
(
value
=
"/login"
)
public
Result
<
ResultUser
>
login
(
String
loginName
,
String
password
,
String
source
)
{
log
.
info
(
"WorkUserController[]login[]input.param"
+
loginName
+
password
+
source
);
if
(
StringUtils
.
isEmpty
(
loginName
)
||
StringUtils
.
isEmpty
(
password
)
||
StringUtils
.
isEmpty
(
loginNam
e
))
{
if
(
StringUtils
.
isEmpty
(
loginName
)
||
StringUtils
.
isEmpty
(
password
)
||
StringUtils
.
isEmpty
(
sourc
e
))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
ResultUser
resultUser
=
workUserService
.
login
(
loginName
,
password
,
source
);
...
...
@@ -85,12 +83,4 @@ public class WorkUserController extends BaseController {
return
getResult
(
organizationStructure
);
}
@ApiOperation
(
value
=
"权限"
,
notes
=
"权限"
,
httpMethod
=
"GET"
)
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户id"
,
dataType
=
"int"
)
@GetMapping
(
value
=
"/getLevel"
)
public
Result
<
UserRoleLevelDto
>
getLevel
(
Integer
userId
)
{
List
<
UserRoleLevelDto
>
roleUserLevel
=
UserRoleLevelUtils
.
getRoleUserLevel
(
userId
);
return
getResult
(
roleUserLevel
);
}
}
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