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
382450df
Commit
382450df
authored
Dec 06, 2023
by
lisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改任务生成定时任务bug
parent
a32c8e94
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
12 deletions
+49
-12
PlanMapper.java
...m/yeejoin/amos/patrol/business/dao/mapper/PlanMapper.java
+2
-0
PlanTaskServiceImpl.java
...mos/patrol/business/service/impl/PlanTaskServiceImpl.java
+39
-12
dbTemplate_plan.xml
...trol-biz/src/main/resources/db/mapper/dbTemplate_plan.xml
+8
-0
No files found.
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/dao/mapper/PlanMapper.java
View file @
382450df
...
@@ -60,4 +60,6 @@ public interface PlanMapper extends BaseMapper {
...
@@ -60,4 +60,6 @@ public interface PlanMapper extends BaseMapper {
void
initUpdatePlanNextGenDate
();
void
initUpdatePlanNextGenDate
();
Plan
getPlan
(
String
planId
);
Plan
getPlan
(
String
planId
);
int
checkData
(
@Param
(
"planId"
)
Long
planId
);
}
}
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/PlanTaskServiceImpl.java
View file @
382450df
...
@@ -438,7 +438,10 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -438,7 +438,10 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
if
(
plan
==
null
)
{
if
(
plan
==
null
)
{
throw
new
YeeException
(
"计划不存在"
);
throw
new
YeeException
(
"计划不存在"
);
}
}
// 校验计划数据是否异常
if
(!
checkData
(
plan
.
getId
())){
throw
new
YeeException
(
"计划数据异常!"
);
}
//2.数据必输校验,不满足直接return,不再向下进行
//2.数据必输校验,不满足直接return,不再向下进行
Boolean
fileFlag
=
PlanTaskUtil
.
checkMustFile
(
plan
);
Boolean
fileFlag
=
PlanTaskUtil
.
checkMustFile
(
plan
);
if
(!
fileFlag
)
{
if
(!
fileFlag
)
{
...
@@ -689,6 +692,16 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -689,6 +692,16 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
}
/**
/**
* 校验计划数据是否异常
* @return
*/
private
Boolean
checkData
(
Long
planId
)
{
if
(
planMapper
.
checkData
(
planId
)
>
0
)
{
return
true
;
}
return
false
;
}
/**
* 自动任务执行
* 自动任务执行
*/
*/
@Override
@Override
...
@@ -710,6 +723,10 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -710,6 +723,10 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
//2.循环遍历执行
//2.循环遍历执行
HashMap
<
String
,
Object
>
paramMap
=
new
HashMap
<
String
,
Object
>();
HashMap
<
String
,
Object
>
paramMap
=
new
HashMap
<
String
,
Object
>();
for
(
Plan
plan
:
planList
)
{
for
(
Plan
plan
:
planList
)
{
// 校验计划数据是否异常
if
(!
checkData
(
plan
.
getId
())){
continue
;
}
// tzs修改为查询用户组id
// tzs修改为查询用户组id
if
(
StringUtils
.
isEmpty
(
plan
.
getUserGroupId
()))
if
(
StringUtils
.
isEmpty
(
plan
.
getUserGroupId
()))
continue
;
continue
;
...
@@ -1113,14 +1130,28 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -1113,14 +1130,28 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
Map
<
String
,
List
<
AppCheckInputRespone
>>
collect2
=
pointInputs
.
stream
().
collect
(
Collectors
.
groupingBy
(
AppCheckInputRespone:
:
getPointId
));
Map
<
String
,
List
<
AppCheckInputRespone
>>
collect2
=
pointInputs
.
stream
().
collect
(
Collectors
.
groupingBy
(
AppCheckInputRespone:
:
getPointId
));
for
(
Map
<
String
,
String
>
excludeItem
:
excludeItems
)
{
for
(
Map
<
String
,
String
>
excludeItem
:
excludeItems
)
{
String
[]
exclude_items
=
excludeItem
.
get
(
"exclude_items"
).
split
(
","
);
List
<
AppCheckInputRespone
>
appCheckInputRespones
=
collect2
.
get
(
String
.
valueOf
(
excludeItem
.
get
(
"point_id"
)));
List
<
AppCheckInputRespone
>
appCheckInputRespones
=
collect2
.
get
(
String
.
valueOf
(
excludeItem
.
get
(
"point_id"
)));
if
(
excludeItem
.
containsKey
(
"exclude_items"
)
&&
!
ObjectUtils
.
isEmpty
(
excludeItem
.
get
(
"exclude_items"
))){
String
[]
exclude_items
=
excludeItem
.
get
(
"exclude_items"
).
split
(
","
);
List
<
AppCheckInputRespone
>
appCheckInputRespones1
=
new
ArrayList
<>();
List
<
AppCheckInputRespone
>
appCheckInputRespones1
=
new
ArrayList
<>();
for
(
String
exclude_item
:
exclude_items
)
{
for
(
String
exclude_item
:
exclude_items
)
{
appCheckInputRespones1
.
add
(
appCheckInputRespones
.
stream
().
filter
(
x
->
x
.
getPointInputItemId
().
equals
(
exclude_item
)).
collect
(
Collectors
.
toList
()).
get
(
0
));
List
<
AppCheckInputRespone
>
collect
=
appCheckInputRespones
.
stream
().
filter
(
x
->
x
.
getPointInputItemId
().
equals
(
exclude_item
)).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
collect
)
&&
!
ObjectUtils
.
isEmpty
(
collect
.
get
(
0
))){
continue
;
}
appCheckInputRespones1
.
add
(
collect
.
get
(
0
));
}
}
appCheckInputRespones
.
removeAll
(
appCheckInputRespones1
);
appCheckInputRespones
.
removeAll
(
appCheckInputRespones1
);
}
collect2
.
put
(
String
.
valueOf
(
excludeItem
.
get
(
"point_id"
)),
appCheckInputRespones
);
collect2
.
put
(
String
.
valueOf
(
excludeItem
.
get
(
"point_id"
)),
appCheckInputRespones
);
// String[] exclude_items = excludeItem.get("exclude_items").split(",");
// List<AppCheckInputRespone> appCheckInputRespones = collect2.get(String.valueOf(excludeItem.get("point_id")));
// List<AppCheckInputRespone> appCheckInputRespones1 = new ArrayList<>();
// for (String exclude_item : exclude_items) {
// appCheckInputRespones1.add(appCheckInputRespones.stream().filter(x -> x.getPointInputItemId().equals(exclude_item)).collect(Collectors.toList()).get(0));
// }
// appCheckInputRespones.removeAll(appCheckInputRespones1);
// collect2.put(String.valueOf(excludeItem.get("point_id")), appCheckInputRespones);
}
}
for
(
ESTaskDetailDto
esTaskDetailDto
:
esTaskDetailDtos
)
{
for
(
ESTaskDetailDto
esTaskDetailDto
:
esTaskDetailDtos
)
{
...
@@ -1864,21 +1895,17 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -1864,21 +1895,17 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
meBuilder
.
must
(
QueryBuilders
.
wildcardQuery
(
"userId"
,
"*"
+
test
+
"*"
));
meBuilder
.
must
(
QueryBuilders
.
wildcardQuery
(
"userId"
,
"*"
+
test
+
"*"
));
boolMust
.
must
(
meBuilder
);
boolMust
.
must
(
meBuilder
);
}
}
if
(!
ObjectUtils
.
isEmpty
(
params
.
get
(
"orgCode"
)))
{
if
(!
ObjectUtils
.
isEmpty
(
params
.
get
(
"finishStatus"
)))
{
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
query
.
must
(
QueryBuilders
.
matchPhraseQuery
(
"
orgCode"
,
"*"
+
params
.
get
(
"orgCode
"
)
+
"*"
));
query
.
must
(
QueryBuilders
.
matchPhraseQuery
(
"
finishStatus"
,
"*"
+
params
.
get
(
"finishStatus
"
)
+
"*"
));
boolMust
.
must
(
query
);
boolMust
.
must
(
query
);
}
}
if
(!
ObjectUtils
.
isEmpty
(
params
.
get
(
"
finishStatus
"
)))
{
if
(!
ObjectUtils
.
isEmpty
(
params
.
get
(
"
type
"
)))
{
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
query
.
must
(
QueryBuilders
.
matchPhraseQuery
(
"
finishStatus"
,
"*"
+
params
.
get
(
"finishStatus
"
)
+
"*"
));
query
.
must
(
QueryBuilders
.
matchPhraseQuery
(
"
type"
,
"*"
+
params
.
get
(
"type
"
)
+
"*"
));
boolMust
.
must
(
query
);
boolMust
.
must
(
query
);
}
}
// if (!ObjectUtils.isEmpty(params.get("type"))) {
// BoolQueryBuilder query = QueryBuilders.boolQuery();
// query.must(QueryBuilders.matchPhraseQuery("type", "*" + params.get("type") + "*"));
// boolMust.must(query);
// }
if
(!
ObjectUtils
.
isEmpty
(
params
.
get
(
"startTime"
)))
{
if
(!
ObjectUtils
.
isEmpty
(
params
.
get
(
"startTime"
)))
{
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/resources/db/mapper/dbTemplate_plan.xml
View file @
382450df
...
@@ -174,4 +174,11 @@
...
@@ -174,4 +174,11 @@
<select
id=
"getPlan"
resultType=
"com.yeejoin.amos.patrol.dao.entity.Plan"
>
<select
id=
"getPlan"
resultType=
"com.yeejoin.amos.patrol.dao.entity.Plan"
>
select * from p_plan where id = #{planId}
select * from p_plan where id = #{planId}
</select>
</select>
<select
id=
"checkData"
resultType=
"java.lang.Integer"
>
SELECT count(1) FROM "p_plan" plan
INNER JOIN p_route_point route on plan.route_id = route.route_id
INNER JOIN p_point_inputitem item on route.point_id = item.point_id
WHERE plan.id = #{planId}
</select>
</mapper>
</mapper>
\ 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