Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
1aa070e4
Commit
1aa070e4
authored
Aug 17, 2021
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.记录排序枚举与任务排序枚举拆分
parent
e2bda49f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
112 additions
and
14 deletions
+112
-14
CheckRecordOrderByEnum.java
...amos/maintenance/common/enums/CheckRecordOrderByEnum.java
+75
-0
PlanTaskOrderByEnum.java
...in/amos/maintenance/common/enums/PlanTaskOrderByEnum.java
+6
-9
CheckController.java
...amos/maintenance/business/controller/CheckController.java
+10
-2
PlanTaskController.java
...s/maintenance/business/controller/PlanTaskController.java
+21
-3
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/common/enums/CheckRecordOrderByEnum.java
0 → 100644
View file @
1aa070e4
package
com
.
yeejoin
.
amos
.
maintenance
.
common
.
enums
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* @author DELL
* 维保任务排序
*/
public
enum
CheckRecordOrderByEnum
{
/**
* 维保记录排序
*/
DATE_DESC
(
"维保记录时间倒序"
,
"1"
,
"checkDate desc"
),
DATE_ASC
(
"维保记录时间正序"
,
"2"
,
"checkDate asc"
);
/**
* 名字
*/
private
String
name
;
/**
* 编号
*/
private
String
code
;
/**
* 条件
*/
private
String
oderBy
;
public
String
getOderBy
()
{
return
oderBy
;
}
public
void
setOderBy
(
String
oderBy
)
{
this
.
oderBy
=
oderBy
;
}
CheckRecordOrderByEnum
(
String
name
,
String
code
,
String
oderBy
)
{
this
.
code
=
code
;
this
.
name
=
name
;
this
.
oderBy
=
oderBy
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
static
List
<
Map
<
String
,
Object
>>
getEnumList
()
{
return
Arrays
.
stream
(
CheckRecordOrderByEnum
.
values
()).
map
(
e
->
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
e
.
getCode
(),
e
.
getName
());
return
map
;
}).
collect
(
Collectors
.
toList
());
}
public
static
CheckRecordOrderByEnum
getEumByCode
(
String
code
)
throws
Exception
{
Optional
<
CheckRecordOrderByEnum
>
op
=
Arrays
.
stream
(
CheckRecordOrderByEnum
.
values
()).
filter
(
e
->
e
.
getCode
().
equals
(
code
)).
findFirst
();
return
op
.
orElseThrow
(()->
new
Exception
(
"非法的条件"
));
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/common/enums/OrderByEnum.java
→
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/common/enums/
PlanTask
OrderByEnum.java
View file @
1aa070e4
...
...
@@ -8,7 +8,7 @@ import java.util.stream.Collectors;
* 维保任务排序
*/
public
enum
OrderByEnum
{
public
enum
PlanTask
OrderByEnum
{
/**
* 维保任务排序
*/
...
...
@@ -17,10 +17,7 @@ public enum OrderByEnum {
PLAN_TASK_NUM_ASC
(
"计划维保设施数正序"
,
"3"
,
"taskPlanNum asc"
),
PLAN_TASK_NUM_DESC
(
"计划维保设施数倒序"
,
"4"
,
"taskPlanNum desc"
),
FINISH_NUM_DESC
(
"完成数倒序"
,
"5"
,
"finishNum desc"
),
FINISH_NUM_ASC
(
"完成数正序"
,
"6"
,
"finishNum asc"
),
DATE_DESC
(
"维保记录时间倒序"
,
"7"
,
"checkDate desc"
),
DATE_ASC
(
"维保记录时间正序"
,
"8"
,
"checkDate asc"
);
FINISH_NUM_ASC
(
"完成数正序"
,
"6"
,
"finishNum asc"
);
/**
* 名字
*/
...
...
@@ -43,7 +40,7 @@ public enum OrderByEnum {
this
.
oderBy
=
oderBy
;
}
OrderByEnum
(
String
name
,
String
code
,
String
oderBy
)
{
PlanTask
OrderByEnum
(
String
name
,
String
code
,
String
oderBy
)
{
this
.
code
=
code
;
this
.
name
=
name
;
this
.
oderBy
=
oderBy
;
...
...
@@ -66,15 +63,15 @@ public enum OrderByEnum {
}
public
static
List
<
Map
<
String
,
Object
>>
getEnumList
()
{
return
Arrays
.
stream
(
OrderByEnum
.
values
()).
map
(
e
->
{
return
Arrays
.
stream
(
PlanTask
OrderByEnum
.
values
()).
map
(
e
->
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
e
.
getCode
(),
e
.
getName
());
return
map
;
}).
collect
(
Collectors
.
toList
());
}
public
static
OrderByEnum
getEumByCode
(
String
code
)
throws
Exception
{
Optional
<
OrderByEnum
>
op
=
Arrays
.
stream
(
OrderByEnum
.
values
()).
filter
(
e
->
e
.
getCode
().
equals
(
code
)).
findFirst
();
public
static
PlanTask
OrderByEnum
getEumByCode
(
String
code
)
throws
Exception
{
Optional
<
PlanTaskOrderByEnum
>
op
=
Arrays
.
stream
(
PlanTask
OrderByEnum
.
values
()).
filter
(
e
->
e
.
getCode
().
equals
(
code
)).
findFirst
();
return
op
.
orElseThrow
(()->
new
Exception
(
"非法的条件"
));
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/controller/CheckController.java
View file @
1aa070e4
...
...
@@ -10,7 +10,8 @@ import com.yeejoin.amos.maintenance.business.service.intfc.ICheckService;
import
com.yeejoin.amos.maintenance.business.util.*
;
import
com.yeejoin.amos.maintenance.business.vo.CheckAnalysisVo
;
import
com.yeejoin.amos.maintenance.business.vo.CheckInfoVo
;
import
com.yeejoin.amos.maintenance.common.enums.OrderByEnum
;
import
com.yeejoin.amos.maintenance.common.enums.CheckRecordOrderByEnum
;
import
com.yeejoin.amos.maintenance.common.enums.PlanTaskOrderByEnum
;
import
com.yeejoin.amos.maintenance.core.async.AsyncTask
;
import
com.yeejoin.amos.maintenance.core.common.request.CommonPageable
;
import
com.yeejoin.amos.maintenance.core.common.request.CommonRequest
;
...
...
@@ -507,7 +508,7 @@ public class CheckController extends AbstractBaseController {
params
.
put
(
"userId"
,
userId
);
params
.
put
(
"timeType"
,
timeType
);
params
.
put
(
"result"
,
result
);
params
.
put
(
"orderRule"
,
OrderByEnum
.
getEumByCode
(
orderRule
).
getOderBy
());
params
.
put
(
"orderRule"
,
CheckRecord
OrderByEnum
.
getEumByCode
(
orderRule
).
getOderBy
());
params
.
put
(
"beginTime"
,
beginTime
);
params
.
put
(
"endTime"
,
endTime
);
params
.
put
(
"person"
,
person
);
...
...
@@ -525,4 +526,11 @@ public class CheckController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
checkService
.
getCheckDetail
(
id
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"维保记录排序条件列表"
,
notes
=
"维保记录排序条件列表"
)
@RequestMapping
(
value
=
"/orderBy/list"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
getOrderByList
()
{
return
CommonResponseUtil
.
success
(
CheckRecordOrderByEnum
.
getEnumList
());
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/controller/PlanTaskController.java
View file @
1aa070e4
...
...
@@ -9,8 +9,9 @@ import com.yeejoin.amos.maintenance.business.util.CommonResponseUtil;
import
com.yeejoin.amos.maintenance.business.util.FileHelper
;
import
com.yeejoin.amos.maintenance.business.util.PlanTaskPageParamUtil
;
import
com.yeejoin.amos.maintenance.business.vo.PlanTaskVo
;
import
com.yeejoin.amos.maintenance.common.enums.OrderByEnum
;
import
com.yeejoin.amos.maintenance.common.enums.
PlanTask
OrderByEnum
;
import
com.yeejoin.amos.maintenance.common.enums.PlanTaskDetailIsFinishEnum
;
import
com.yeejoin.amos.maintenance.common.enums.PlanTaskFinishStatusEnum
;
import
com.yeejoin.amos.maintenance.core.common.request.CommonPageable
;
import
com.yeejoin.amos.maintenance.core.common.request.CommonRequest
;
import
com.yeejoin.amos.maintenance.core.framework.PersonIdentify
;
...
...
@@ -236,7 +237,7 @@ public class PlanTaskController extends AbstractBaseController {
params
.
put
(
"startTime"
,
startTime
);
params
.
put
(
"endTime"
,
endTime
);
params
.
put
(
"finishStatus"
,
finishStatus
);
params
.
put
(
"orderBy"
,
OrderByEnum
.
getEumByCode
(
orderBy
).
getOderBy
());
params
.
put
(
"orderBy"
,
PlanTask
OrderByEnum
.
getEumByCode
(
orderBy
).
getOderBy
());
CommonPageable
pageable
=
new
CommonPageable
(
pageNumber
,
pageSize
);
return
CommonResponseUtil
.
success
(
planTaskService
.
getPlanTasks
(
params
,
pageable
));
}
...
...
@@ -252,9 +253,25 @@ public class PlanTaskController extends AbstractBaseController {
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"维保设施完成状态下拉
枚举数据
"
)
@ApiOperation
(
value
=
"维保设施完成状态下拉
列表
"
)
@GetMapping
(
value
=
"/taskDetail/finishStatus/list"
)
public
CommonResponse
planTaskPointDetail
()
{
return
CommonResponseUtil
.
success
(
PlanTaskDetailIsFinishEnum
.
getEnumList
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"计划任务完成状态列表"
,
notes
=
"计划任务完成状态列表"
)
@RequestMapping
(
value
=
"/finishStatus/list"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
getPlanTaskFinishStatus
()
{
return
CommonResponseUtil
.
success
(
PlanTaskFinishStatusEnum
.
getEnumList
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"维保任务排序条件"
,
notes
=
"维保任务排序条件"
)
@RequestMapping
(
value
=
"/orderBy/list"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
getOrderByList
()
{
return
CommonResponseUtil
.
success
(
PlanTaskOrderByEnum
.
getEnumList
());
}
}
\ No newline at end of file
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