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
f656f15c
Commit
f656f15c
authored
4 years ago
by
cq990612
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码结构
parent
b68e38ca
chenqi5.0
chenqi
chenqi2.0
chenqi3.0
chenqi4.0
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
31 additions
and
85 deletions
+31
-85
WorkTypeMapper.xml
...nergy-mapper/src/main/resources/mapper/WorkTypeMapper.xml
+2
-2
WorkType.java
...-model/src/main/java/cn/wisenergy/model/app/WorkType.java
+10
-15
WorkTimeOrderService.java
.../main/java/cn/wisenergy/service/WorkTimeOrderService.java
+1
-6
WorkCentreServiceImpl.java
...java/cn/wisenergy/service/impl/WorkCentreServiceImpl.java
+1
-2
WorkCollectServiceImpl.java
...ava/cn/wisenergy/service/impl/WorkCollectServiceImpl.java
+4
-4
WorkDeptServiceImpl.java
...n/java/cn/wisenergy/service/impl/WorkDeptServiceImpl.java
+3
-3
WorkHolidayServiceImpl.java
...ava/cn/wisenergy/service/impl/WorkHolidayServiceImpl.java
+0
-1
WorkProjectServiceImpl.java
...ava/cn/wisenergy/service/impl/WorkProjectServiceImpl.java
+2
-5
WorkTimeOrderServiceImpl.java
...a/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
+7
-33
WorkTypeServiceImpl.java
...n/java/cn/wisenergy/service/impl/WorkTypeServiceImpl.java
+1
-1
WorkTimeOrderController.java
...rgy/web/admin/controller/app/WorkTimeOrderController.java
+0
-9
Trigger.java
...n/src/main/java/cn/wisenergy/web/config/auto/Trigger.java
+0
-4
No files found.
wisenergy-mapper/src/main/resources/mapper/WorkTypeMapper.xml
View file @
f656f15c
...
...
@@ -18,7 +18,7 @@
<select
id=
"getAll"
resultType=
"cn.wisenergy.model.app.WorkType"
>
SELECT id,`name`,reviewer,status
SELECT id,`name`,reviewer,status
,sort
FROM work_type
</select>
...
...
@@ -28,7 +28,7 @@
WHERE reviewer = #{reviewer}
</select>
<select
id=
"getByIsStatus"
resultType=
"cn.wisenergy.model.app.WorkType"
>
SELECT id,name,reviewer,status
SELECT id,name,reviewer,status
,sort
FROM work_type
<where>
<if
test=
"null != status"
>
...
...
This diff is collapsed.
Click to expand it.
wisenergy-model/src/main/java/cn/wisenergy/model/app/WorkType.java
View file @
f656f15c
...
...
@@ -16,9 +16,9 @@ import java.io.Serializable;
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@ApiModel
(
value
=
"WorkType"
,
description
=
"项目类型类"
)
public
class
WorkType
implements
Serializable
,
Comparable
{
public
class
WorkType
implements
Serializable
,
Comparable
<
WorkType
>{
private
final
static
Integer
[]
TYPE_ORDER
=
{
1
,
3
,
2
};
private
static
final
long
serialVersionUID
=
8842083047098059912L
;
@ApiModelProperty
(
name
=
"id"
,
value
=
"主键id"
)
...
...
@@ -34,20 +34,15 @@ public class WorkType implements Serializable, Comparable{
@ApiModelProperty
(
name
=
"status"
,
value
=
"0:禁用 1:正常"
)
private
Integer
status
;
@ApiModelProperty
(
name
=
"sort"
,
value
=
"排序"
)
private
Integer
sort
;
@Override
public
int
compareTo
(
Object
o
)
{
WorkType
workType
=
(
WorkType
)
o
;
int
thisI
=
0
;
int
oI
=
0
;
for
(
int
i
=
0
;
i
<
TYPE_ORDER
.
length
;
i
++)
{
if
(
reviewer
.
equals
(
TYPE_ORDER
[
i
]))
{
thisI
=
i
;
}
if
(
workType
.
getReviewer
().
equals
(
TYPE_ORDER
[
i
]))
{
oI
=
i
;
}
}
return
thisI
-
oI
;
public
int
compareTo
(
WorkType
o
)
{
return
this
.
sort
-
o
.
getSort
();
}
}
This diff is collapsed.
Click to expand it.
wisenergy-service/src/main/java/cn/wisenergy/service/WorkTimeOrderService.java
View file @
f656f15c
...
...
@@ -120,10 +120,5 @@ public interface WorkTimeOrderService {
*/
int
statusYes
(
Integer
userId
,
Date
workDay
);
/**
* 功能:获取工单变更分页
* @param managerOrderVo 分页套件
* @return PageInfo
*/
PageInfo
getOrderPageInfo
(
ManagerOrderVo
managerOrderVo
);
}
This diff is collapsed.
Click to expand it.
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkCentreServiceImpl.java
View file @
f656f15c
...
...
@@ -77,7 +77,6 @@ public class WorkCentreServiceImpl implements WorkCentreService {
WorkCentre
workCentre
=
workCentreMapper
.
selectById
(
centreId
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>(
5
);
map
.
put
(
"centre_id"
,
workCentre
.
getId
());
List
<
WorkDept
>
workDeptList
=
workDeptMapper
.
getDeptByCondition
(
map
);
return
workDeptList
;
return
workDeptMapper
.
getDeptByCondition
(
map
);
}
}
This diff is collapsed.
Click to expand it.
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkCollectServiceImpl.java
View file @
f656f15c
...
...
@@ -186,11 +186,11 @@ public class WorkCollectServiceImpl implements WorkCollectService {
/**
* 获取当月已经填的并满8小时
* @param userId
* @param month
* @return
* @param userId
用户id
* @param month
日期
* @return
日期集合
*/
p
ublic
List
<
Date
>
getNotCompletedByMonth
(
Integer
userId
,
Date
month
)
{
p
rivate
List
<
Date
>
getNotCompletedByMonth
(
Integer
userId
,
Date
month
)
{
boolean
flag
=
DateUtil
.
isYearAndMonthEqual
(
month
,
new
Date
());
List
<
Date
>
workDays
=
statisticsService
.
currentMonthWorkDays
(
month
,
flag
);
List
<
WorkCollect
>
completedCollect
=
workCollectMapper
.
getCompletedByUserIdAndMonth
(
userId
,
month
);
...
...
This diff is collapsed.
Click to expand it.
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkDeptServiceImpl.java
View file @
f656f15c
...
...
@@ -100,7 +100,7 @@ public class WorkDeptServiceImpl implements WorkDeptService {
@Override
public
Boolean
updateById
(
WorkDept
workDept
)
{
log
.
info
(
"WorkDeptServiceImpl[]updateById[]input.param.workDept:{}"
+
workDept
);
if
(
null
==
workDept
||
null
==
workDept
.
getId
(
))
{
if
(
(
null
==
workDept
)
||
(
null
==
workDept
.
getId
()
))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
int
i
=
workDeptMapper
.
updateById
(
workDept
);
...
...
@@ -123,8 +123,8 @@ public class WorkDeptServiceImpl implements WorkDeptService {
/**
* 获取管理员所管理的项目的部门
*
* @param userId
* @return
* @param userId
管理员id
* @return
部门
*/
@Override
public
List
<
WorkDept
>
getDeptOfProjectOfManager
(
Integer
userId
)
{
...
...
This diff is collapsed.
Click to expand it.
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkHolidayServiceImpl.java
View file @
f656f15c
...
...
@@ -228,7 +228,6 @@ public class WorkHolidayServiceImpl implements WorkHolidayService {
}
long
d1
=
workHoliday
.
getDayStart
().
getTime
();
long
d2
=
workHoliday
.
getDayEnd
().
getTime
();
long
v
=
d2
-
d1
;
long
start
;
long
end
;
...
...
This diff is collapsed.
Click to expand it.
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkProjectServiceImpl.java
View file @
f656f15c
...
...
@@ -70,9 +70,6 @@ public class WorkProjectServiceImpl implements WorkProjectService {
@Autowired
private
WorkProjectChangeService
workProjectChangeService
;
@Autowired
private
WorkCentreService
workCentreService
;
/**
* 功能:根据项目id获取项目
...
...
@@ -392,8 +389,8 @@ public class WorkProjectServiceImpl implements WorkProjectService {
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"status"
,
1
);
List
<
WorkUser
>
byMap
=
workUserService
.
getByMap
(
map
);
StringBu
ffer
before
=
new
StringBuff
er
();
StringBu
ffer
after
=
new
StringBuff
er
();
StringBu
ilder
before
=
new
StringBuild
er
();
StringBu
ilder
after
=
new
StringBuild
er
();
String
userModifyBefore
=
""
;
String
userModifyAfter
=
""
;
if
(!
CollectionUtils
.
isEmpty
(
byMap
))
{
...
...
This diff is collapsed.
Click to expand it.
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
View file @
f656f15c
...
...
@@ -10,9 +10,7 @@ import cn.wisenergy.model.app.*;
import
cn.wisenergy.model.dto.*
;
import
cn.wisenergy.model.enums.LevelEnum
;
import
cn.wisenergy.model.enums.LevelRankEnum
;
import
cn.wisenergy.model.enums.ManagerEnum
;
import
cn.wisenergy.model.enums.StatusEnum
;
import
cn.wisenergy.model.vo.ManagerOrderVo
;
import
cn.wisenergy.service.*
;
import
cn.wisenergy.service.utils.UserRoleLevelUtils
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
...
@@ -83,11 +81,11 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
// 工单状态
private
final
static
Integer
COMPLETED
=
StatusEnum
.
COMPLETED
.
getCode
();
private
final
static
Integer
APPROVED
=
StatusEnum
.
APPROVED
.
getCode
();
private
final
static
Integer
REJECTED
=
StatusEnum
.
REJECTED
.
getCode
();
private
final
static
Integer
RE_SUBMIT
=
StatusEnum
.
RE_SUBMIT
.
getCode
();
private
final
static
Integer
AUTOMATIC_AUDIT
=
StatusEnum
.
AUTOMATIC_AUDIT
.
getCode
();
private
final
Integer
COMPLETED
=
StatusEnum
.
COMPLETED
.
getCode
();
private
final
Integer
APPROVED
=
StatusEnum
.
APPROVED
.
getCode
();
private
final
Integer
REJECTED
=
StatusEnum
.
REJECTED
.
getCode
();
private
final
Integer
RE_SUBMIT
=
StatusEnum
.
RE_SUBMIT
.
getCode
();
private
final
Integer
AUTOMATIC_AUDIT
=
StatusEnum
.
AUTOMATIC_AUDIT
.
getCode
();
/**
* 功能; 获取某日填报情况
...
...
@@ -340,7 +338,6 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
List
<
Integer
>
typeIds
=
workTypeService
.
getIdByReviewer
(
1
);
System
.
out
.
println
(
typeIds
);
int
size
=
list
.
size
();
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
for
(
int
j
=
i
+
1
;
j
<
size
;
j
++)
{
...
...
@@ -589,7 +586,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
return
projectsDto
;
}
p
ublic
List
<
ProjectManagerDto
>
getProjectManagerDto
(
WorkUser
user
,
List
<
WorkType
>
workTypes
)
{
p
rivate
List
<
ProjectManagerDto
>
getProjectManagerDto
(
WorkUser
user
,
List
<
WorkType
>
workTypes
)
{
List
<
UserRoleLevelDto
>
roleUserLevel
=
UserRoleLevelUtils
.
getRoleUserLevel
(
user
.
getId
());
if
(
CollectionUtils
.
isEmpty
(
roleUserLevel
))
{
...
...
@@ -893,17 +890,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
return
null
;
}
// 判断当前用户是否是管理员
private
void
isManager
(
Integer
userId
)
{
if
(
null
==
userId
)
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
// 判断当前用户是否为管理
List
<
Integer
>
roles
=
UserRoleLevelUtils
.
getRole
(
userId
);
if
(
1
==
roles
.
size
()
&&
ManagerEnum
.
NOT_MANAGER
.
getCode
().
equals
(
roles
.
get
(
0
)))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
THE_USER_NOT_MANAGER_PLASE_MANAGER_LOGIN
);
}
}
private
String
getTypeName
(
Integer
type
,
List
<
WorkType
>
workTypes
)
{
if
(!
CollectionUtils
.
isEmpty
(
workTypes
))
{
...
...
@@ -944,19 +931,6 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
* @param managerOrderVo 分页套件
* @return PageInfo
*/
@Override
public
PageInfo
getOrderPageInfo
(
ManagerOrderVo
managerOrderVo
)
{
log
.
info
(
"WorkOrderServiceImpl[]getOrderPageInfo[]input.param.managerOrderVo:{}"
+
managerOrderVo
);
if
(
null
==
managerOrderVo
||
null
==
managerOrderVo
.
getUserId
())
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
// 1.判断管理员是否有权限 TODO
int
page
=
null
==
managerOrderVo
.
getPage
()
?
1
:
managerOrderVo
.
getPage
();
int
pageSize
=
null
==
managerOrderVo
.
getPageSize
()
?
10
:
managerOrderVo
.
getPageSize
();
PageHelper
.
startPage
(
page
,
pageSize
);
return
null
;
}
}
This diff is collapsed.
Click to expand it.
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkTypeServiceImpl.java
View file @
f656f15c
...
...
@@ -94,7 +94,7 @@ public class WorkTypeServiceImpl implements WorkTypeService {
if
(
CollectionUtils
.
isEmpty
(
workTypes
))
{
return
null
;
}
if
(
null
!=
isSort
&&
1
==
isSort
)
{
if
(
(
null
!=
isSort
)
&&
(
1
==
isSort
)
)
{
Collections
.
sort
(
workTypes
);
}
return
workTypes
;
...
...
This diff is collapsed.
Click to expand it.
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/WorkTimeOrderController.java
View file @
f656f15c
...
...
@@ -9,7 +9,6 @@ import cn.wisenergy.model.dto.AppletsPendApprovalDto;
import
cn.wisenergy.model.dto.CreateWorkOrderDto
;
import
cn.wisenergy.model.dto.ProjectsDto
;
import
cn.wisenergy.model.dto.WorkTimeOrderDto
;
import
cn.wisenergy.model.vo.ManagerOrderVo
;
import
cn.wisenergy.service.WorkTimeOrderService
;
import
cn.wisenergy.web.admin.controller.common.BaseController
;
import
com.github.pagehelper.PageInfo
;
...
...
@@ -162,12 +161,4 @@ public class WorkTimeOrderController extends BaseController {
return
getResult
(
workTimeOrderDtos
);
}
@ApiOperation
(
value
=
"工单管理分页"
,
notes
=
"工单管理分页"
,
httpMethod
=
"POST"
)
@ApiImplicitParam
(
name
=
"managerOrderVo"
,
value
=
"工单管理分页条件类"
,
dataType
=
"ManagerOrderVo"
,
required
=
true
)
@PostMapping
(
value
=
"/managerOrderPageInfo"
)
public
Result
<
PageInfo
>
managerOrderPageInfo
(
@RequestBody
ManagerOrderVo
managerOrderVo
)
{
log
.
info
(
"WorkTimeOrderController[]managerOrderPageInfo[]input.param.ManagerOrderVo"
+
managerOrderVo
);
return
getResult
(
null
);
}
}
This diff is collapsed.
Click to expand it.
wisenergy-web-admin/src/main/java/cn/wisenergy/web/config/auto/Trigger.java
View file @
f656f15c
...
...
@@ -5,7 +5,6 @@ import cn.wisenergy.common.utils.exception.BaseCustomException;
import
cn.wisenergy.mapper.WorkTimeOrderMapper
;
import
cn.wisenergy.model.app.WorkSubmitAdopt
;
import
cn.wisenergy.model.app.WorkTimeOrder
;
import
cn.wisenergy.model.enums.StatusEnum
;
import
cn.wisenergy.service.WorkCollectService
;
import
cn.wisenergy.service.WorkSubmitAdoptService
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -36,9 +35,6 @@ public class Trigger implements SchedulingConfigurer {
@Autowired
private
WorkSubmitAdoptService
workSubmitAdoptService
;
private
final
static
Integer
COMPLETED
=
StatusEnum
.
COMPLETED
.
getCode
();
private
final
static
Integer
RE_SUBMIT
=
StatusEnum
.
RE_SUBMIT
.
getCode
();
private
final
static
Integer
AUTOMATIC_AUDIT
=
StatusEnum
.
AUTOMATIC_AUDIT
.
getCode
();
@Override
public
void
configureTasks
(
ScheduledTaskRegistrar
scheduledTaskRegistrar
)
{
...
...
This diff is collapsed.
Click to expand it.
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