Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
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
87c9e60d
Commit
87c9e60d
authored
Feb 20, 2021
by
cq990612
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码结构
parent
f3bcbe9d
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
85 additions
and
24 deletions
+85
-24
WorkTimeOrderMapper.xml
...-mapper/src/main/resources/mapper/WorkTimeOrderMapper.xml
+2
-1
WorkLevel.java
...model/src/main/java/cn/wisenergy/model/app/WorkLevel.java
+2
-3
WorkTimeOrder.java
...l/src/main/java/cn/wisenergy/model/app/WorkTimeOrder.java
+1
-0
HolidayAndAutoDto.java
...c/main/java/cn/wisenergy/model/dto/HolidayAndAutoDto.java
+3
-0
LevelEnum.java
...del/src/main/java/cn/wisenergy/model/enums/LevelEnum.java
+8
-12
WorkTypeService.java
...e/src/main/java/cn/wisenergy/service/WorkTypeService.java
+4
-0
WorkHolidayServiceImpl.java
...ava/cn/wisenergy/service/impl/WorkHolidayServiceImpl.java
+9
-0
WorkTypeServiceImpl.java
...n/java/cn/wisenergy/service/impl/WorkTypeServiceImpl.java
+30
-0
UserRoleLevelUtils.java
...n/java/cn/wisenergy/service/utils/UserRoleLevelUtils.java
+1
-7
SystemController.java
.../wisenergy/web/admin/controller/app/SystemController.java
+25
-1
No files found.
wisenergy-mapper/src/main/resources/mapper/WorkTimeOrderMapper.xml
View file @
87c9e60d
...
...
@@ -76,6 +76,7 @@
<if
test=
"isOvertime != null"
>
and is_overtime = #{isOvertime}
</if>
<if
test=
"createTime != null"
>
and create_time
>
= #{createTime}
</if>
<if
test=
"modifyTime != null"
>
and #{modifyTime}
>
= modify_time
</if>
<if
test=
"rejectTime !=null"
>
and reject_time = #{rejectTime}
</if>
</sql>
<resultMap
id=
"dayWorkTimeAndType"
type=
"cn.wisenergy.model.dto.DayWorkTimeAndType"
>
...
...
@@ -175,7 +176,7 @@
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
work_id, user_id, project_id, dept_id, work_time, work_day, status, reviewer_id, des, reason, type, is_overtime, create_time, modify_time
work_id, user_id, project_id, dept_id, work_time, work_day, status, reviewer_id, des, reason, type, is_overtime, create_time, modify_time
,reject_time
</sql>
<select
id=
"statisticsByProjectType"
resultMap=
"monthlyWorkHourStatistics"
>
...
...
wisenergy-model/src/main/java/cn/wisenergy/model/app/WorkLevel.java
View file @
87c9e60d
...
...
@@ -2,7 +2,6 @@ package cn.wisenergy.model.app;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -27,8 +26,8 @@ public class WorkLevel {
@ApiModelProperty
(
name
=
"icon"
,
value
=
"图标"
)
private
String
icon
;
/**附加字段*/
@
TableField
(
exist
=
false
)
@
ApiModelProperty
(
name
=
"path"
,
value
=
"路径"
)
private
String
path
;
...
...
wisenergy-model/src/main/java/cn/wisenergy/model/app/WorkTimeOrder.java
View file @
87c9e60d
...
...
@@ -68,6 +68,7 @@ public class WorkTimeOrder implements Serializable {
@ApiModelProperty
(
name
=
"modifyTime"
,
value
=
"工单修改时间"
)
private
Date
modifyTime
;
@ApiModelProperty
(
name
=
"rejectTime"
,
value
=
"驳回时间"
)
private
Date
rejectTime
;
...
...
wisenergy-model/src/main/java/cn/wisenergy/model/dto/HolidayAndAutoDto.java
View file @
87c9e60d
...
...
@@ -2,6 +2,7 @@ package cn.wisenergy.model.dto;
import
cn.wisenergy.model.app.WorkHoliday
;
import
cn.wisenergy.model.app.WorkSubmitAdopt
;
import
cn.wisenergy.model.app.WorkType
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
...
...
@@ -17,4 +18,6 @@ public class HolidayAndAutoDto {
List
<
WorkHoliday
>
workHolidays
;
WorkSubmitAdopt
workSubmitAdopt
;
List
<
WorkType
>
workTypes
;
}
wisenergy-model/src/main/java/cn/wisenergy/model/enums/LevelEnum.java
View file @
87c9e60d
...
...
@@ -5,28 +5,24 @@ package cn.wisenergy.model.enums;
* @QQ1799796883
*/
public
enum
LevelEnum
{
EXAMINE
(
"工时审批"
,
"/index"
),
STATISTICS
(
"统计"
,
"/statistical"
),
PROJECT_MANAGER
(
"项目/商机管理"
,
"/projects"
),
TIMEEXPORT
(
"工时导出"
,
"/export"
),
SYSTEMSETTINGS
(
"系统设置"
,
"/systemSettings"
),
ACCOUNTMANAGEMENT
(
"账号管理"
,
"/accountSetting"
),
EXAMINE
(
"工时审批"
),
STATISTICS
(
"统计"
),
PROJECT_MANAGER
(
"项目/商机管理"
),
TIMEEXPORT
(
"工时导出"
),
SYSTEMSETTINGS
(
"系统设置"
),
ACCOUNTMANAGEMENT
(
"账号管理"
),
;
private
String
LevelName
;
public
String
getPath
()
{
return
path
;
}
private
String
path
;
LevelEnum
(
String
LevelName
,
String
path
)
{
LevelEnum
(
String
LevelName
)
{
this
.
LevelName
=
LevelName
;
this
.
path
=
path
;
}
public
String
getLevelName
()
{
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/WorkTypeService.java
View file @
87c9e60d
...
...
@@ -13,4 +13,8 @@ public interface WorkTypeService {
List
<
WorkType
>
getAll
();
List
<
Integer
>
getIdByReviewer
(
Integer
reviewer
);
Boolean
addAndModifyWorkType
(
WorkType
workType
);
Boolean
deleteTypeById
(
Integer
id
);
}
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkHolidayServiceImpl.java
View file @
87c9e60d
...
...
@@ -5,10 +5,12 @@ import cn.wisenergy.common.utils.exception.BaseCustomException;
import
cn.wisenergy.mapper.WorkHolidayMapper
;
import
cn.wisenergy.model.app.WorkHoliday
;
import
cn.wisenergy.model.app.WorkSubmitAdopt
;
import
cn.wisenergy.model.app.WorkType
;
import
cn.wisenergy.model.dto.HolidayAndAutoDto
;
import
cn.wisenergy.model.enums.LevelEnum
;
import
cn.wisenergy.service.WorkHolidayService
;
import
cn.wisenergy.service.WorkSubmitAdoptService
;
import
cn.wisenergy.service.WorkTypeService
;
import
cn.wisenergy.service.utils.UserRoleLevelUtils
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -39,6 +41,9 @@ public class WorkHolidayServiceImpl implements WorkHolidayService {
@Autowired
private
WorkSubmitAdoptService
workSubmitAdoptService
;
@Autowired
private
WorkTypeService
workTypeService
;
@Override
public
Boolean
isHoliday
(
Date
date
)
{
log
.
info
(
"WorkHolidayServiceImpl[]workHolidayMapper[]input.param.date:{}"
+
date
);
...
...
@@ -149,6 +154,10 @@ public class WorkHolidayServiceImpl implements WorkHolidayService {
List
<
WorkHoliday
>
workHolidays
=
workHolidayMapper
.
getByTypeAndStartDate
(
1
,
new
Date
());
WorkSubmitAdopt
submitAdopt
=
workSubmitAdoptService
.
getById
(
1
);
holidayAndAutoDto
.
setWorkHolidays
(
workHolidays
).
setWorkSubmitAdopt
(
submitAdopt
);
List
<
WorkType
>
workTypes
=
workTypeService
.
getAll
();
if
(!
CollectionUtils
.
isEmpty
(
workTypes
))
{
holidayAndAutoDto
.
setWorkTypes
(
workTypes
);
}
return
holidayAndAutoDto
;
}
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkTypeServiceImpl.java
View file @
87c9e60d
...
...
@@ -45,4 +45,34 @@ public class WorkTypeServiceImpl implements WorkTypeService {
}
return
ids
;
}
@Override
public
Boolean
addAndModifyWorkType
(
WorkType
workType
)
{
log
.
info
(
"WorkTypeServiceImpl[]modifyTypeById[]input.param.workType:{}"
+
workType
);
if
(
null
==
workType
||
(
null
==
workType
.
getName
()
&&
null
==
workType
.
getReviewer
()))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
if
(
null
==
workType
.
getId
())
{
if
(
null
==
workType
.
getName
()
||
null
==
workType
.
getReviewer
())
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
int
insert
=
workTypeMapper
.
insert
(
workType
);
return
insert
>
0
;
}
else
{
int
i
=
workTypeMapper
.
updateById
(
workType
);
return
i
>
0
;
}
}
@Override
public
Boolean
deleteTypeById
(
Integer
id
)
{
log
.
info
(
"WorkTypeServiceImpl[]deleteTypeById[]input.param.id:{}"
+
id
);
if
(
null
==
id
)
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
int
i
=
workTypeMapper
.
deleteById
(
id
);
return
i
>
0
;
}
}
wisenergy-service/src/main/java/cn/wisenergy/service/utils/UserRoleLevelUtils.java
View file @
87c9e60d
...
...
@@ -96,13 +96,7 @@ public class UserRoleLevelUtils {
if
(
CollectionUtils
.
isEmpty
(
workLevels
))
{
return
null
;
}
for
(
LevelEnum
value
:
LevelEnum
.
values
())
{
for
(
WorkLevel
workLevel
:
workLevels
)
{
if
(
value
.
getLevelName
().
equals
(
workLevel
.
getName
()))
{
workLevel
.
setPath
(
value
.
getPath
());
}
}
}
workLevels
.
sort
(
new
Comparator
<
WorkLevel
>()
{
@Override
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/SystemController.java
View file @
87c9e60d
...
...
@@ -5,10 +5,12 @@ import cn.wisenergy.common.utils.exception.BaseCustomException;
import
cn.wisenergy.common.utils.exception.Result
;
import
cn.wisenergy.model.app.WorkHoliday
;
import
cn.wisenergy.model.app.WorkSubmitAdopt
;
import
cn.wisenergy.model.app.WorkType
;
import
cn.wisenergy.model.dto.AllRoleAndUserRoleDto
;
import
cn.wisenergy.model.dto.HolidayAndAutoDto
;
import
cn.wisenergy.service.WorkHolidayService
;
import
cn.wisenergy.service.WorkSubmitAdoptService
;
import
cn.wisenergy.service.WorkTypeService
;
import
cn.wisenergy.service.WorkUserService
;
import
cn.wisenergy.web.admin.controller.common.BaseController
;
import
io.swagger.annotations.Api
;
...
...
@@ -43,6 +45,9 @@ public class SystemController extends BaseController {
@Autowired
private
WorkUserService
workUserService
;
@Autowired
private
WorkTypeService
workTypeService
;
@ApiOperation
(
value
=
"添加和编辑工作日历"
,
notes
=
"添加和编辑工作日历"
,
httpMethod
=
"PUT"
)
@ApiImplicitParam
(
name
=
"workHoliday"
,
value
=
"节假日实体类"
,
dataType
=
"WorkHoliday"
,
required
=
true
)
...
...
@@ -62,7 +67,7 @@ public class SystemController extends BaseController {
return
getResult
(
aBoolean
);
}
@ApiOperation
(
value
=
"获取工作日历
和审批时限"
,
notes
=
"获取工作日历和审批时限
"
,
httpMethod
=
"GET"
)
@ApiOperation
(
value
=
"获取工作日历
、审批时限和工时类型"
,
notes
=
"获取工作日历、审批时限和工时类型
"
,
httpMethod
=
"GET"
)
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"管理员id"
,
dataType
=
"int"
,
required
=
true
)
@GetMapping
(
"/getHolidayAndAuto"
)
public
Result
<
HolidayAndAutoDto
>
getHolidayAndAuto
(
Integer
userId
)
{
...
...
@@ -111,4 +116,23 @@ public class SystemController extends BaseController {
return
getResult
(
aBoolean
);
}
@ApiOperation
(
value
=
"添加和修改工时类型"
,
notes
=
"添加和修改工时类型"
,
httpMethod
=
"PUT"
)
@ApiImplicitParam
(
name
=
"workType"
,
value
=
"工时类型"
,
dataType
=
"WorkType"
,
required
=
true
)
@PutMapping
(
"/addAndModifyWorkType"
)
public
Result
<
Boolean
>
addAndModifyWorkType
(
@RequestBody
WorkType
workType
)
{
log
.
info
(
"SystemController[]modifyRole[]input.param.workType:{}"
+
workType
);
Boolean
aBoolean
=
workTypeService
.
addAndModifyWorkType
(
workType
);
return
getResult
(
aBoolean
);
}
@ApiOperation
(
value
=
"删除工时类型"
,
notes
=
"删除工时类型"
,
httpMethod
=
"PUT"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"类型id"
,
dataType
=
"int"
,
required
=
true
)
@PutMapping
(
"/modifyWorkType"
)
public
Result
<
Boolean
>
deleteTypeById
(
Integer
id
)
{
log
.
info
(
"SystemController[]modifyRole[]input.param.id:{}"
+
id
);
Boolean
aBoolean
=
workTypeService
.
deleteTypeById
(
id
);
return
getResult
(
aBoolean
);
}
}
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