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
63ec9c86
Commit
63ec9c86
authored
Oct 25, 2023
by
litengwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
双规小程序接口
parent
6ad426a3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
108 deletions
+35
-108
CheckController.java
...join/amos/patrol/business/controller/CheckController.java
+2
-0
CheckServiceImpl.java
...n/amos/patrol/business/service/impl/CheckServiceImpl.java
+11
-2
PlanTaskServiceImpl.java
...mos/patrol/business/service/impl/PlanTaskServiceImpl.java
+2
-1
IJobService.java
...main/java/com/yeejoin/amos/patrol/quartz/IJobService.java
+1
-1
JobService.java
.../main/java/com/yeejoin/amos/patrol/quartz/JobService.java
+19
-104
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/controller/CheckController.java
View file @
63ec9c86
...
@@ -221,6 +221,8 @@ public class CheckController extends AbstractBaseController {
...
@@ -221,6 +221,8 @@ public class CheckController extends AbstractBaseController {
AgencyUserModel
user
=
getUserInfo
();
AgencyUserModel
user
=
getUserInfo
();
String
userId
=
user
.
getUserId
();
String
userId
=
user
.
getUserId
();
String
realName
=
user
.
getRealName
();
String
realName
=
user
.
getRealName
();
requestParam
.
setUserId
(
userId
);
requestParam
.
setUserName
(
realName
);
requestParam
.
setIsOffline
(
requestParam
.
getIsOffline
()==
null
?
false
:
requestParam
.
getIsOffline
());
requestParam
.
setIsOffline
(
requestParam
.
getIsOffline
()==
null
?
false
:
requestParam
.
getIsOffline
());
try
{
try
{
if
(
planTask
!=
null
)
{
if
(
planTask
!=
null
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/CheckServiceImpl.java
View file @
63ec9c86
...
@@ -518,10 +518,19 @@ public class CheckServiceImpl implements ICheckService {
...
@@ -518,10 +518,19 @@ public class CheckServiceImpl implements ICheckService {
check
.
setOrgCode
(
requestParam
.
getOrgCode
());
check
.
setOrgCode
(
requestParam
.
getOrgCode
());
check
.
setUserId
(
requestParam
.
getUserId
());
check
.
setUserId
(
requestParam
.
getUserId
());
StringBuffer
deptName
=
new
StringBuffer
();
if
(
planTask
.
getUserDept
().
indexOf
(
","
)
>
0
)
{
List
<
String
>
depts
=
Arrays
.
asList
(
planTask
.
getUserDept
().
split
(
","
));
depts
.
stream
().
forEach
(
dept
->
{
deptName
.
append
(
dept
.
split
(
"@"
)[
2
]).
append
(
","
);
});
}
check
.
setDepName
(
deptName
.
substring
(
0
,
deptName
.
length
()
-
1
));
check
.
setUserName
(
requestParam
.
getUserName
());
check
.
setUserName
(
requestParam
.
getUserName
());
check
.
setDepId
(
requestParam
.
getDepId
());
//
check.setDepId(requestParam.getDepId());
check
.
setDepName
(
requestParam
.
getDepName
());
//
check.setDepName(requestParam.getDepName());
check
.
setCheckMode
(
requestParam
.
getCheckMode
());
check
.
setCheckMode
(
requestParam
.
getCheckMode
());
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/PlanTaskServiceImpl.java
View file @
63ec9c86
...
@@ -1151,7 +1151,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -1151,7 +1151,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
});
});
}
}
// 生成巡检记录
// 生成巡检记录
jobService
.
createCheckRecord
(
planTask
);
jobService
.
createCheckRecord
(
planTask
,
userId
);
}
}
...
@@ -1491,6 +1491,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -1491,6 +1491,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
input
.
setDataJson
(
action
.
getDataJson
());
input
.
setDataJson
(
action
.
getDataJson
());
input
.
setIsMultiline
(
action
.
getIsMultiline
());
input
.
setIsMultiline
(
action
.
getIsMultiline
());
input
.
setIsMust
(
action
.
getIsMust
());
input
.
setIsMust
(
action
.
getIsMust
());
input
.
setInputValue
(
null
);
if
(
null
!=
check
)
{
if
(
null
!=
check
)
{
for
(
CheckInput
ck
:
check
.
getCheckInput
()
for
(
CheckInput
ck
:
check
.
getCheckInput
()
)
{
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/quartz/IJobService.java
View file @
63ec9c86
...
@@ -62,6 +62,6 @@ public interface IJobService {
...
@@ -62,6 +62,6 @@ public interface IJobService {
*/
*/
public
void
msgJobPerform
(
long
msgId
,
String
jobType
,
String
jobName
);
public
void
msgJobPerform
(
long
msgId
,
String
jobType
,
String
jobName
);
public
void
createCheckRecord
(
PlanTask
planTask
);
public
void
createCheckRecord
(
PlanTask
planTask
,
String
userId
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/quartz/JobService.java
View file @
63ec9c86
package
com
.
yeejoin
.
amos
.
patrol
.
quartz
;
package
com
.
yeejoin
.
amos
.
patrol
.
quartz
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
...
@@ -205,14 +206,14 @@ public class JobService implements IJobService {
...
@@ -205,14 +206,14 @@ public class JobService implements IJobService {
});
});
}
}
log
.
info
(
"更新plan_task 和 plan_task_detail表完成,planTask:{}"
,
planTask
);
log
.
info
(
"更新plan_task 和 plan_task_detail表完成,planTask:{}"
,
planTask
);
// 巡检站端与中心级数据同步
//
// 巡检站端与中心级数据同步
TransactionSynchronizationManager
.
registerSynchronization
(
new
TransactionSynchronization
()
{
//
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
@Override
//
@Override
public
void
afterCommit
()
{
//
public void afterCommit() {
// 事物提交后业务逻辑
//
// 事物提交后业务逻辑
patrolDataSyncService
.
planTaskDetailDataSync
(
planTaskDetails
);
//
patrolDataSyncService.planTaskDetailDataSync(planTaskDetails);
}
//
}
});
//
});
if
(
PlanTaskFinishStatusEnum
.
OVERTIME
.
getValue
()
==
status
)
{
if
(
PlanTaskFinishStatusEnum
.
OVERTIME
.
getValue
()
==
status
)
{
createOmissionCheckRecord
(
planTask
);
createOmissionCheckRecord
(
planTask
);
}
}
...
@@ -249,8 +250,9 @@ public class JobService implements IJobService {
...
@@ -249,8 +250,9 @@ public class JobService implements IJobService {
List
<
String
>
ids
=
Arrays
.
asList
(
planTask
.
getUserId
().
split
(
","
));
List
<
String
>
ids
=
Arrays
.
asList
(
planTask
.
getUserId
().
split
(
","
));
List
<
String
>
depts
=
Arrays
.
asList
(
planTask
.
getUserDept
().
split
(
","
));
List
<
String
>
depts
=
Arrays
.
asList
(
planTask
.
getUserDept
().
split
(
","
));
depts
.
stream
().
forEach
(
dept
->
{
depts
.
stream
().
forEach
(
dept
->
{
deptMap
.
put
(
dept
.
substring
(
0
,
dept
.
indexOf
(
"@"
)),
dept
.
substring
(
dept
.
indexOf
(
"@"
)
+
1
));
deptMap
.
put
(
dept
.
split
(
"@"
)[
0
],
dept
.
split
(
"@"
)[
2
]);
deptId
.
append
(
dept
.
substring
(
dept
.
indexOf
(
"@"
)
+
1
)).
append
(
","
);
deptName
.
append
(
dept
.
split
(
"@"
)[
2
]).
append
(
","
);
deptId
.
append
(
dept
.
split
(
"@"
)[
0
]).
append
(
","
);
});
});
Set
<
String
>
departmentOrgCode
=
new
HashSet
<>();
Set
<
String
>
departmentOrgCode
=
new
HashSet
<>();
for
(
String
key
:
deptMap
.
keySet
())
{
for
(
String
key
:
deptMap
.
keySet
())
{
...
@@ -264,28 +266,6 @@ public class JobService implements IJobService {
...
@@ -264,28 +266,6 @@ public class JobService implements IJobService {
String
realNames
=
""
;
String
realNames
=
""
;
}
else
{
String
realNames
=
""
;
// deptMap.put(planTask.getUserDept().split(","), planTask.getUserDept().substring(planTask.getUserDept().indexOf("@") + 1));
//
// FeignClientResult<List<Map<String, Object>>> departmentModeldate = jcsFeignClient.selectByIdDeptList(deptMap.get(planTask.getUserId()));
// List<Map<String, Object>> departmentModel = departmentModeldate.getResult();
//
// if (departmentModel.size() > 0) {
// departmentModel.stream().forEach(model -> {
// deptName.append(model.get("bizOrgName").toString());
// });
// } else {
// deptName.append("其他").append(",");
// }
// FeignClientResult<List<Map<String, Object>>> agencyUserModelsDate = jcsFeignClient.selectByAmosOrgIdDeptList(planTask.getUserId());
// List<Map<String, Object>> agencyUserModels = agencyUserModelsDate.getResult();
//
// if (!agencyUserModels.isEmpty()) {
// realNames = agencyUserModels.stream().map(map -> map.get("bizOrgName").toString()).collect(Collectors.joining(","));
// }
userName
.
append
(
realNames
);
}
}
List
<
Check
>
checkList
=
new
ArrayList
<>();
List
<
Check
>
checkList
=
new
ArrayList
<>();
...
@@ -301,7 +281,7 @@ public class JobService implements IJobService {
...
@@ -301,7 +281,7 @@ public class JobService implements IJobService {
}
else
{
}
else
{
check
.
setUserName
(
userName
.
toString
());
check
.
setUserName
(
userName
.
toString
());
}
}
check
.
setDepId
(
deptId
.
toString
().
substring
(
0
,
deptId
.
length
()
-
1
));
//
check.setDepId(deptId.toString().substring(0, deptId.length() - 1));
check
.
setDepName
(
deptName
.
toString
());
check
.
setDepName
(
deptName
.
toString
());
check
.
setPointId
(
arg
.
getPointId
());
check
.
setPointId
(
arg
.
getPointId
());
...
@@ -343,61 +323,8 @@ public class JobService implements IJobService {
...
@@ -343,61 +323,8 @@ public class JobService implements IJobService {
CheckInput
checkInput1
=
iCheckInputDao
.
saveAndFlush
(
checkInput
);
CheckInput
checkInput1
=
iCheckInputDao
.
saveAndFlush
(
checkInput
);
checkInputIdList
.
add
(
checkInput1
.
getId
());
checkInputIdList
.
add
(
checkInput1
.
getId
());
}
}
//漏检修改APP待办通知状态不展示
Plan
plan
=
new
Plan
();
plan
.
setId
(
planTask
.
getPlanId
());
try
{
updateTaskStatus
(
plan
);
}
catch
(
InnerInvokException
e
)
{
log
.
error
(
"待办消息不存在"
);
}
}
}
String
usrIds
=
planTask
.
getUserId
();
if
(!
ObjectUtils
.
isEmpty
(
usrIds
))
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
String
[]
ids
=
usrIds
.
split
(
","
);
for
(
String
userId
:
usrIds
.
split
(
","
))
{
if
(
ObjectUtils
.
isEmpty
(
userId
))
{
continue
;
}
planTaskMapper
.
reformStatistics
(
userId
,
sdf
.
format
(
new
Date
()),
planTask
.
getOrgCode
());
}
}
// 向3d推送数据,发送消息推送
checkIds
.
forEach
(
checkId
->
{
try
{
asyncTask
.
pushCheckInfoTo3D
(
checkId
);
asyncTask
.
pushCheckMessage
(
checkId
);
}
catch
(
InterruptedException
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
e
.
printStackTrace
();
}
});
//数字换流站页面刷新
try
{
webMqttComponent
.
publish
(
patrolTopic
,
""
);
}
catch
(
Exception
e
)
{
log
.
error
(
"数字换流站页面推送失败-----------"
+
e
.
getMessage
());
}
// 巡检站端与中心级数据同步
TransactionSynchronizationManager
.
registerSynchronization
(
new
TransactionSynchronization
()
{
@Override
public
void
afterCommit
()
{
// 事物提交后业务逻辑
patrolDataSyncService
.
checkDataSync
(
checkList
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"idList"
,
checkInputIdList
);
List
<
CheckInputSyncBo
>
checkInputSyncBoList
=
checkInputMapper
.
getCheckInputSyncBoList
(
map
);
patrolDataSyncService
.
checkInputBoDataSync
(
checkInputSyncBoList
);
List
<
CheckInput
>
checkInputList
=
checkInputMapper
.
findByIdIn
(
map
);
patrolDataSyncService
.
checkInputDataSync
(
checkInputList
);
}
});
}
}
...
@@ -406,7 +333,7 @@ public class JobService implements IJobService {
...
@@ -406,7 +333,7 @@ public class JobService implements IJobService {
*
*
* @param planTask
* @param planTask
*/
*/
public
void
createCheckRecord
(
PlanTask
planTask
)
{
public
void
createCheckRecord
(
PlanTask
planTask
,
String
userId
)
{
List
<
PlanTaskPointInputItemBo
>
planTaskPointInputItems
=
planTaskMapper
.
getPlanTaskPointInputItemByPlanTaskId
(
planTask
.
getId
(),
PlanTaskDetailStatusEnum
.
NOTSTARTED
.
getValue
());
List
<
PlanTaskPointInputItemBo
>
planTaskPointInputItems
=
planTaskMapper
.
getPlanTaskPointInputItemByPlanTaskId
(
planTask
.
getId
(),
PlanTaskDetailStatusEnum
.
NOTSTARTED
.
getValue
());
Map
<
Long
,
Check
>
checkMap
=
new
HashMap
<>();
Map
<
Long
,
Check
>
checkMap
=
new
HashMap
<>();
Set
<
Long
>
checkIds
=
new
HashSet
<
Long
>();
Set
<
Long
>
checkIds
=
new
HashSet
<
Long
>();
...
@@ -419,7 +346,8 @@ public class JobService implements IJobService {
...
@@ -419,7 +346,8 @@ public class JobService implements IJobService {
List
<
String
>
depts
=
Arrays
.
asList
(
planTask
.
getUserDept
().
split
(
","
));
List
<
String
>
depts
=
Arrays
.
asList
(
planTask
.
getUserDept
().
split
(
","
));
depts
.
stream
().
forEach
(
dept
->
{
depts
.
stream
().
forEach
(
dept
->
{
deptMap
.
put
(
dept
.
split
(
"@"
)[
0
],
dept
.
split
(
"@"
)[
2
]);
deptMap
.
put
(
dept
.
split
(
"@"
)[
0
],
dept
.
split
(
"@"
)[
2
]);
// deptId.append(dept.substring(dept.indexOf("@") + 1)).append(",");
deptName
.
append
(
dept
.
split
(
"@"
)[
2
]).
append
(
","
);
deptId
.
append
(
dept
.
split
(
"@"
)[
0
]).
append
(
","
);
});
});
Set
<
String
>
departmentOrgCode
=
new
HashSet
<>();
Set
<
String
>
departmentOrgCode
=
new
HashSet
<>();
for
(
String
key
:
deptMap
.
keySet
())
{
for
(
String
key
:
deptMap
.
keySet
())
{
...
@@ -432,27 +360,13 @@ public class JobService implements IJobService {
...
@@ -432,27 +360,13 @@ public class JobService implements IJobService {
}
}
String
realNames
=
""
;
String
realNames
=
""
;
FeignClientResult
<
AgencyUserModel
>
agencyUserModelsDate
=
Privilege
.
agencyUserClient
.
queryByUserId
(
planTask
.
getUserId
());
FeignClientResult
<
AgencyUserModel
>
agencyUserModelsDate
=
Privilege
.
agencyUserClient
.
queryByUserId
(
userId
);
AgencyUserModel
agencyUserModel
=
agencyUserModelsDate
.
getResult
();
if
(
agencyUserModel
!=
null
)
{
realNames
=
agencyUserModel
.
getRealName
().
join
(
","
);
userName
.
append
(
realNames
);
}
}
else
{
String
realNames
=
""
;
deptId
.
append
(
planTask
.
getUserDept
().
substring
(
planTask
.
getUserDept
().
indexOf
(
"@"
)
+
1
)).
append
(
","
);
deptMap
.
put
(
planTask
.
getUserDept
().
substring
(
0
,
planTask
.
getUserDept
().
indexOf
(
"@"
)),
planTask
.
getUserDept
().
substring
(
planTask
.
getUserDept
().
indexOf
(
"@"
)
+
1
));
FeignClientResult
<
AgencyUserModel
>
agencyUserModelsDate
=
Privilege
.
agencyUserClient
.
queryByUserId
(
planTask
.
getUserId
());
AgencyUserModel
agencyUserModel
=
agencyUserModelsDate
.
getResult
();
AgencyUserModel
agencyUserModel
=
agencyUserModelsDate
.
getResult
();
if
(
agencyUserModel
!=
null
)
{
if
(
agencyUserModel
!=
null
)
{
realNames
=
agencyUserModel
.
getRealName
().
join
(
","
);
realNames
=
agencyUserModel
.
getRealName
().
join
(
","
);
userName
.
append
(
realNames
);
userName
.
append
(
realNames
);
}
}
userName
.
append
(
realNames
);
}
}
List
<
Check
>
checkList
=
new
ArrayList
<>();
List
<
Check
>
checkList
=
new
ArrayList
<>();
...
@@ -550,7 +464,7 @@ public class JobService implements IJobService {
...
@@ -550,7 +464,7 @@ public class JobService implements IJobService {
@Transactional
@Transactional
public
void
taskJobPerform
(
long
taskId
,
String
jobType
,
String
jobName
)
{
public
void
taskJobPerform
(
long
taskId
,
String
jobType
,
String
jobName
)
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
log
.
error
(
"开始执行定时任务========"
);
if
(
iTaskDao
.
existsById
(
taskId
))
{
if
(
iTaskDao
.
existsById
(
taskId
))
{
Task
task
=
iTaskDao
.
findById
(
taskId
).
get
();
Task
task
=
iTaskDao
.
findById
(
taskId
).
get
();
...
@@ -640,6 +554,7 @@ public class JobService implements IJobService {
...
@@ -640,6 +554,7 @@ public class JobService implements IJobService {
if
(
iPlanTaskDao
.
existsById
(
planTaskId
))
{
if
(
iPlanTaskDao
.
existsById
(
planTaskId
))
{
PlanTask
planTask
=
iPlanTaskDao
.
findById
(
planTaskId
).
get
();
PlanTask
planTask
=
iPlanTaskDao
.
findById
(
planTaskId
).
get
();
log
.
error
(
"开始执行定时任务添加的任务==========>>{}"
,
JSON
.
toJSONString
(
planTask
));
if
(
XJConstant
.
STATUS_MONITOR_START
.
equals
(
jobType
))
{
if
(
XJConstant
.
STATUS_MONITOR_START
.
equals
(
jobType
))
{
if
(
PlanTaskFinishStatusEnum
.
NOTSTARTED
.
getValue
()
==
planTask
.
getFinishStatus
())
{
if
(
PlanTaskFinishStatusEnum
.
NOTSTARTED
.
getValue
()
==
planTask
.
getFinishStatus
())
{
planTask
.
setFinishStatus
(
PlanTaskFinishStatusEnum
.
UNDERWAY
.
getValue
());
planTask
.
setFinishStatus
(
PlanTaskFinishStatusEnum
.
UNDERWAY
.
getValue
());
...
...
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