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
dc338d51
Commit
dc338d51
authored
Feb 24, 2021
by
cq990612
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码结构
parent
8e052980
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
2 deletions
+26
-2
WorkType.java
...-model/src/main/java/cn/wisenergy/model/app/WorkType.java
+24
-1
WorkTimeOrderServiceImpl.java
...a/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
+0
-1
WorkTypeServiceImpl.java
...n/java/cn/wisenergy/service/impl/WorkTypeServiceImpl.java
+2
-0
No files found.
wisenergy-model/src/main/java/cn/wisenergy/model/app/WorkType.java
View file @
dc338d51
...
@@ -7,6 +7,8 @@ import io.swagger.annotations.ApiModelProperty;
...
@@ -7,6 +7,8 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
/**
/**
* @Authotr:陈奇
* @Authotr:陈奇
* @QQ1799796883
* @QQ1799796883
...
@@ -14,7 +16,11 @@ import lombok.EqualsAndHashCode;
...
@@ -14,7 +16,11 @@ import lombok.EqualsAndHashCode;
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@EqualsAndHashCode
(
callSuper
=
false
)
@ApiModel
(
value
=
"WorkType"
,
description
=
"项目类型类"
)
@ApiModel
(
value
=
"WorkType"
,
description
=
"项目类型类"
)
public
class
WorkType
{
public
class
WorkType
implements
Serializable
,
Comparable
{
private
final
static
Integer
[]
TYPE_ORDER
=
{
1
,
2
,
5
,
6
,
7
,
3
,
4
};
private
static
final
long
serialVersionUID
=
8842083047098059912L
;
@ApiModelProperty
(
name
=
"id"
,
value
=
"主键id"
)
@ApiModelProperty
(
name
=
"id"
,
value
=
"主键id"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
private
Integer
id
;
...
@@ -24,4 +30,21 @@ public class WorkType {
...
@@ -24,4 +30,21 @@ public class WorkType {
@ApiModelProperty
(
name
=
"reviewer"
,
value
=
"检查者:1:该项目负责人 2:系统自动 3:部门或中心负责人"
)
@ApiModelProperty
(
name
=
"reviewer"
,
value
=
"检查者:1:该项目负责人 2:系统自动 3:部门或中心负责人"
)
private
Integer
reviewer
;
private
Integer
reviewer
;
@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
(
id
.
equals
(
TYPE_ORDER
[
i
]))
{
thisI
=
i
;
}
if
(
workType
.
getId
().
equals
(
TYPE_ORDER
[
i
]))
{
oI
=
i
;
}
}
return
thisI
-
oI
;
}
}
}
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
View file @
dc338d51
...
@@ -541,7 +541,6 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
...
@@ -541,7 +541,6 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
if
(!
CollectionUtils
.
isEmpty
(
workTypes
))
{
if
(!
CollectionUtils
.
isEmpty
(
workTypes
))
{
projectsDto
.
setWorkTypes
(
workTypes
);
projectsDto
.
setWorkTypes
(
workTypes
);
}
}
// 2.获取可填报的项目
// 2.获取可填报的项目
projectsDto
.
setProjectInfoDto
(
getProjectInfoDto
(
userId
));
projectsDto
.
setProjectInfoDto
(
getProjectInfoDto
(
userId
));
// 3.获取可审批的项目
// 3.获取可审批的项目
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkTypeServiceImpl.java
View file @
dc338d51
...
@@ -11,6 +11,7 @@ import org.springframework.stereotype.Service;
...
@@ -11,6 +11,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -33,6 +34,7 @@ public class WorkTypeServiceImpl implements WorkTypeService {
...
@@ -33,6 +34,7 @@ public class WorkTypeServiceImpl implements WorkTypeService {
if
(
CollectionUtils
.
isEmpty
(
workTypes
))
{
if
(
CollectionUtils
.
isEmpty
(
workTypes
))
{
return
null
;
return
null
;
}
}
Collections
.
sort
(
workTypes
);
return
workTypes
;
return
workTypes
;
}
}
...
...
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