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
37a8b900
Commit
37a8b900
authored
Nov 08, 2023
by
litengwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
保存代码优化
parent
ae971d1d
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
311 additions
and
209 deletions
+311
-209
JobService.java
.../main/java/com/yeejoin/amos/patrol/quartz/JobService.java
+3
-3
logback-dev.xml
...os-boot-module-tcm-biz/src/main/resources/logback-dev.xml
+11
-11
PatrolApplication.java
...biz/src/main/java/com/yeejoin/amos/PatrolApplication.java
+1
-0
CheckController.java
...join/amos/patrol/business/controller/CheckController.java
+4
-11
IPlanTaskDetailDao.java
...os/patrol/business/dao/repository/IPlanTaskDetailDao.java
+2
-0
RepositoryTs.java
...oin/amos/patrol/business/dao/repository/RepositoryTs.java
+14
-0
CheckServiceImpl.java
...n/amos/patrol/business/service/impl/CheckServiceImpl.java
+10
-74
PlanTaskServiceImpl.java
...mos/patrol/business/service/impl/PlanTaskServiceImpl.java
+88
-72
RepositoryTImpl.java
...in/amos/patrol/business/service/impl/RepositoryTImpl.java
+62
-0
RouteServiceImpl.java
...n/amos/patrol/business/service/impl/RouteServiceImpl.java
+43
-31
ICheckService.java
...oin/amos/patrol/business/service/intfc/ICheckService.java
+3
-2
ExecutorConfig.java
...n/java/com/yeejoin/amos/patrol/config/ExecutorConfig.java
+64
-0
LatentDanerScheduled.java
...om/yeejoin/amos/patrol/schedule/LatentDanerScheduled.java
+5
-4
dbTemplate_plan_task.xml
...biz/src/main/resources/db/mapper/dbTemplate_plan_task.xml
+1
-1
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/quartz/JobService.java
View file @
37a8b900
...
...
@@ -185,9 +185,9 @@ public class JobService implements IJobService {
iPlanTaskDetailDao
.
saveAndFlush
(
action
);
});
}
if
(
PlanTaskFinishStatusEnum
.
OVERTIME
.
getValue
()
==
status
)
{
createOmissionCheckRecord
(
planTask
);
}
//
if (PlanTaskFinishStatusEnum.OVERTIME.getValue() == status) {
//
createOmissionCheckRecord(planTask);
//
}
}
/**
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/resources/logback-dev.xml
View file @
37a8b900
...
...
@@ -37,20 +37,20 @@
<logger name="org.hibernate.engine.query.HQLQueryPlan" level="DEBUG" />
-->
<!--myibatis log configure-->
<logger
name=
"com.apache.ibatis"
level=
"
debug
"
/>
<logger
name=
"org.mybatis"
level=
"
debug
"
/>
<logger
name=
"java.sql.Connection"
level=
"
debug
"
/>
<logger
name=
"java.sql.Statement"
level=
"
debug
"
/>
<logger
name=
"java.sql.PreparedStatement"
level=
"
debug
"
/>
<logger
name=
"org.springframework"
level=
"
debug
"
/>
<logger
name=
"com.apache.ibatis"
level=
"
INFO
"
/>
<logger
name=
"org.mybatis"
level=
"
INFO
"
/>
<logger
name=
"java.sql.Connection"
level=
"
INFO
"
/>
<logger
name=
"java.sql.Statement"
level=
"
INFO
"
/>
<logger
name=
"java.sql.PreparedStatement"
level=
"
INFO
"
/>
<logger
name=
"org.springframework"
level=
"
INFO
"
/>
<logger
name=
"com.baomidou.mybatisplus"
level=
"
debug
"
/>
<logger
name=
"org.apache.activemq"
level=
"
debug
"
/>
<logger
name=
"org.typroject"
level=
"
debug
"
/>
<logger
name=
"com.yeejoin"
level=
"
debug
"
/>
<logger
name=
"com.baomidou.mybatisplus"
level=
"
INFO
"
/>
<logger
name=
"org.apache.activemq"
level=
"
INFO
"
/>
<logger
name=
"org.typroject"
level=
"
INFO
"
/>
<logger
name=
"com.yeejoin"
level=
"
INFO
"
/>
<!-- 日志输出级别 -->
<root
level=
"
debug
"
>
<root
level=
"
INFO
"
>
<!-- <appender-ref ref="FILE" /> -->
<appender-ref
ref=
"STDOUT"
/>
<!-- <appender-ref ref="ELK" />-->
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/PatrolApplication.java
View file @
37a8b900
...
...
@@ -21,6 +21,7 @@ import org.springframework.context.annotation.ComponentScan;
import
org.springframework.context.annotation.FilterType
;
import
org.springframework.core.env.Environment
;
import
org.springframework.data.jpa.repository.config.EnableJpaAuditing
;
import
org.springframework.data.jpa.repository.config.EnableJpaRepositories
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
org.springframework.web.client.RestTemplate
;
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/controller/CheckController.java
View file @
37a8b900
...
...
@@ -205,16 +205,9 @@ public class CheckController extends AbstractBaseController {
public
ResponseModel
<
Object
>
saveCheckRecordNew
(
@ApiParam
(
value
=
"检查信息"
,
required
=
false
)
@RequestBody
(
required
=
true
)
CheckRecordParam
requestParam
)
{
int
statu
=
-
1
;
PlanTask
planTask
=
null
;
PlanTask
planTask
=
planTaskService
.
selectPlanTaskStatus
(
requestParam
.
getPlanTaskId
())
;
log
.
info
(
"手机app保存巡检记录++++++++++++++++++++++: {}"
,
JSON
.
toJSONString
(
requestParam
));
if
(
requestParam
.
getPlanTaskId
()!=
null
&&
requestParam
.
getPlanTaskId
()
!=
0
){
List
<
Map
<
String
,
Object
>>
map
=
checkService
.
selectCheckById
(
requestParam
.
getPlanTaskId
(),
requestParam
.
getPointId
());
if
(!
CollectionUtils
.
isEmpty
(
map
))
{
List
<
Long
>
ids
=
map
.
stream
().
map
(
m
->
Long
.
valueOf
(
m
.
get
(
"id"
).
toString
())).
collect
(
Collectors
.
toList
());
checkService
.
delCheckByTaskId
(
requestParam
.
getPlanTaskId
(),
ids
,
requestParam
.
getPointId
());
}
planTask
=
planTaskService
.
selectPlanTaskStatus
(
requestParam
.
getPlanTaskId
());
}
AgencyUserModel
user
=
getUserInfo
();
String
userId
=
user
.
getUserId
();
String
realName
=
user
.
getRealName
();
...
...
@@ -251,7 +244,7 @@ public class CheckController extends AbstractBaseController {
String
orgCode
=
reginParams
.
getPersonIdentity
().
getBizOrgCode
();
requestParam
.
setOrgCode
(
orgCode
);
requestParam
.
setUserId
(
getUserId
());
CheckDto
checkDto
=
checkService
.
saveCheckRecordNew
(
requestParam
);
CheckDto
checkDto
=
checkService
.
saveCheckRecordNew
(
requestParam
,
planTask
);
return
ResponseHelper
.
buildResponse
(
checkDto
);
}
else
{
return
ResponseHelperUtil
.
buildErrorResponse
(
"无需重新巡检"
);
...
...
@@ -723,7 +716,7 @@ public class CheckController extends AbstractBaseController {
@RequestMapping
(
value
=
"/v2/queryCheckPointDetail"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryCheckPointDetailInVersion2
(
@RequestParam
long
checkId
)
{
try
{
AppPointCheckRespone
pointCheckRespone
=
checkService
.
queryCheckPointDetailInVersion2
(
getToken
(),
getProduct
(),
getAppKey
(),
checkId
);
AppPointCheckRespone
pointCheckRespone
=
checkService
.
queryCheckPointDetailInVersion2
(
getToken
(),
getProduct
(),
getAppKey
(),
checkId
,
null
,
null
);
return
CommonResponseUtil
.
success
(
pointCheckRespone
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/dao/repository/IPlanTaskDetailDao.java
View file @
37a8b900
...
...
@@ -3,11 +3,13 @@ package com.yeejoin.amos.patrol.business.dao.repository;
import
com.yeejoin.amos.patrol.dao.entity.PlanTaskDetail
;
import
org.springframework.data.jpa.repository.Modifying
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.data.jpa.repository.config.EnableJpaRepositories
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
@Repository
(
"planTaskDetail"
)
@EnableJpaRepositories
public
interface
IPlanTaskDetailDao
extends
BaseDao
<
PlanTaskDetail
,
Long
>
{
@Modifying
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/dao/repository/RepositoryTs.java
0 → 100644
View file @
37a8b900
package
com
.
yeejoin
.
amos
.
patrol
.
business
.
dao
.
repository
;
import
org.springframework.stereotype.Repository
;
@Repository
public
interface
RepositoryTs
{
// 批量存储的方法
<
S
>
Iterable
<
S
>
batchSave
(
Iterable
<
S
>
var1
);
// 批量更新的方法
<
S
>
Iterable
<
S
>
batchUpdate
(
Iterable
<
S
>
var1
);
}
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/CheckServiceImpl.java
View file @
37a8b900
...
...
@@ -206,15 +206,6 @@ public class CheckServiceImpl implements ICheckService {
)
{
checkShotDao
.
saveAndFlush
(
cs
);
}
// 巡检站端与中心级数据同步
TransactionSynchronizationManager
.
registerSynchronization
(
new
TransactionSynchronization
()
{
@Override
public
void
afterCommit
()
{
// 事物提交后业务逻辑
patrolDataSyncService
.
checkDataSync
(
check
);
patrolDataSyncService
.
checkShotDataSync
(
imgList
);
}
});
}
@Override
...
...
@@ -463,16 +454,14 @@ public class CheckServiceImpl implements ICheckService {
@Override
@Transactional
public
CheckDto
saveCheckRecordNew
(
CheckRecordParam
requestParam
)
{
public
CheckDto
saveCheckRecordNew
(
CheckRecordParam
requestParam
,
PlanTask
planTask
)
{
try
{
PlanTaskDetail
taskDetail
=
null
;
PlanTask
planTask
=
null
;
Check
check
=
new
Check
();
HashMap
<
String
,
Object
>
routeParam
=
new
HashMap
<
String
,
Object
>();
Map
detail
=
null
;
Boolean
isOffline
=
requestParam
.
getIsOffline
();
Point
point
=
iPointService
.
queryPointById
(
requestParam
.
getPointId
());
if
(!
ObjectUtils
.
isEmpty
(
requestParam
)
&&
...
...
@@ -480,8 +469,6 @@ public class CheckServiceImpl implements ICheckService {
&&
requestParam
.
getPlanTaskId
()
>
0
)
{
detail
=
planTaskDetailMapper
.
findPlanTaskByTaskIdAndPointId
(
requestParam
.
getPlanTaskId
(),
requestParam
.
getPointId
());
if
(!
ObjectUtils
.
isEmpty
(
detail
))
{
check
=
checkDao
.
findByPlanTaskIdAndPointId
(
requestParam
.
getPlanTaskId
(),
requestParam
.
getPointId
());
planTask
=
planTaskDao
.
findById
(
requestParam
.
getPlanTaskId
()).
get
();
Optional
<
PlanTaskDetail
>
planD
=
planTaskDetailDao
.
findById
(
Long
.
valueOf
(
detail
.
get
(
"id"
).
toString
()));
taskDetail
=
planD
.
get
();
routeParam
.
put
(
"routeId"
,
planTask
.
getRouteId
());
...
...
@@ -547,9 +534,7 @@ public class CheckServiceImpl implements ICheckService {
}
InputItem
inputItem
=
inputItemDao
.
findById
(
item
.
getInputItemId
()).
get
();
CheckInput
checkInput
=
new
CheckInput
();
if
(
isOffline
&&
check
.
getId
()
!=
0
)
{
checkInput
=
checkInputDao
.
findByCheckIdAndInputIdAndPointClassifyId
(
check
.
getId
(),
inputItem
.
getId
(),
item
.
getClassifyIds
());
}
checkInput
.
setCreateDate
(
new
Date
());
checkInput
.
setOrgCode
(
requestParam
.
getOrgCode
());
checkInput
.
setInputId
(
Long
.
valueOf
(
item
.
getInputItemId
()
+
""
));
...
...
@@ -606,15 +591,10 @@ public class CheckServiceImpl implements ICheckService {
planTaskDetailDao
.
saveAndFlush
(
taskDetail
);
check
.
setError
(
error
);
check
.
setErrorClassify
(
StringUtils
.
join
(
errorClassifyNames
.
keySet
(),
","
));
//计划外巡检是否计分 ,计划内默认都是计分
if
(
XJConstant
.
POINT_OK_SCORE
.
equals
(
point
.
getIsScore
())
||
requestParam
.
getPlanTaskId
()
!=
null
)
{
check
.
setScore
(
score
);
}
else
{
check
.
setScore
(
Integer
.
parseInt
(
XJConstant
.
POINT_NOT_SCORE
));
}
try
{
log
.
error
(
"手机app保存巡检记录++++++++++++++++++++++"
+
check
.
toString
()
+
"<Over><Over><Over><Over>"
);
check
=
checkDao
.
save
(
check
);
check
=
checkDao
.
save
AndFlush
(
check
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
@@ -664,10 +644,8 @@ public class CheckServiceImpl implements ICheckService {
imgList
.
add
(
img
);
}
}
List
<
CheckInput
>
checkInputList
=
new
ArrayList
<>();
for
(
CheckInput
checkInput
:
checkItemList
)
{
checkInputDao
.
saveAndFlush
(
checkInput
);
checkInputList
.
add
(
checkInput
);
}
if
(
imgList
.
size
()
>
0
)
{
...
...
@@ -919,19 +897,15 @@ public class CheckServiceImpl implements ICheckService {
}
@Override
public
AppPointCheckRespone
queryCheckPointDetailInVersion2
(
String
toke
,
String
product
,
String
appKey
,
long
checkId
)
{
// List list = checkMapper.queryCheckPointInputItem(planTaskId, pointId);
public
AppPointCheckRespone
queryCheckPointDetailInVersion2
(
String
toke
,
String
product
,
String
appKey
,
long
checkId
,
Long
planTaskId
,
Long
pointId
)
{
List
<
PointCheckDetailBo
>
list
=
checkMapper
.
findCheckPointInputItem
(
checkId
);
AppPointCheckRespone
pointCheckRespone
=
new
AppPointCheckRespone
();
if
(!
list
.
isEmpty
())
{
// InetAddress address = InetAddress.getLocalHost();
// String ip = address.getHostAddress();
// String ipPort = "http://" + fileIp + ":" + filePort + "/";
PointCheckDetailBo
planPointInfo
=
planTaskMapper
.
getPointPlanTaskInfo
(
planTaskId
,
pointId
);
List
<
String
>
pointImgUrls
=
new
ArrayList
<>();
PointCheckDetailBo
pointCheckDetailBo
=
list
.
get
(
0
);
List
<
CheckShot
>
pointShot
=
checkShotDao
.
findAllByCheckIdAndCheckInputIdAndClassifyId
(
pointCheckDetailBo
.
getCheckId
(),
0
l
,
0
l
);
pointShot
.
forEach
(
action
->
{
// pointImgUrls.add(fileUrl + action.getPhotoData());
pointImgUrls
.
add
(
action
.
getPhotoData
());
});
Check
check
=
checkDao
.
findById
(
checkId
).
get
();
...
...
@@ -942,25 +916,6 @@ public class CheckServiceImpl implements ICheckService {
pointCheckRespone
.
setPlanName
(
pointCheckDetailBo
.
getPlanName
());
pointCheckRespone
.
setRemark
(
pointCheckDetailBo
.
getCheckRemark
());
//pointCheckRespone.setDepartmentName(pointCheckDetailBo.getDepartmentName());
//pointCheckRespone.setUsername(pointCheckDetailBo.getUsername());
// DepartmentModel departmentBo = remoteSecurityService.getDepartmentByDeptId(toke, product, appKey,pointCheckDetailBo.getCheckDepartmentId());
// if (departmentBo != null) {
// pointCheckRespone.setDepartmentName(departmentBo.getDepartmentName());
// }
//pointCheckRespone.setDepartmentName(pointCheckDetailBo.getDepartmentName());
// List<String> userIds = Arrays.asList(pointCheckDetailBo.getUserId().split(","));
// List<AgencyUserModel> userModelList = remoteSecurityService.listUserByUserIds(toke, product, appKey,pointCheckDetailBo.getUserId());
// Map<String,String> userModelMap = userModelList.stream().collect(Collectors.toMap(AgencyUserModel::getUserId, AgencyUserModel::getRealName,(k1,k2)->k2));
// if (userModelMap != null) {
// List<String> userNameList = new ArrayList<>();
// for(String userId : userIds){
// userNameList.add(userModelMap.get(userId));
// }
// userNameList.remove("");
// userNameList.remove(null);
// pointCheckRespone.setUsername(Joiner.on(",").join(userNameList));
// }
pointCheckRespone
.
setCheckTime
(
pointCheckDetailBo
.
getCheckTime
());
pointCheckRespone
.
setStrCheckTime
(
DateUtil
.
getLongDate
(
pointCheckDetailBo
.
getCheckTime
()));
pointCheckRespone
.
setCheckId
(
pointCheckDetailBo
.
getCheckId
());
...
...
@@ -968,6 +923,7 @@ public class CheckServiceImpl implements ICheckService {
pointCheckRespone
.
setScore
(
check
.
getScore
()
+
""
);
pointCheckRespone
.
setUsername
(
pointCheckDetailBo
.
getUsername
());
pointCheckRespone
.
setDepartmentName
(
pointCheckDetailBo
.
getDepartmentName
());
List
<
AppCheckInputRespone
>
appCheckInputResponeList
=
new
ArrayList
<
AppCheckInputRespone
>();
JSONObject
appResponeMap
=
new
JSONObject
();
list
.
forEach
(
action
->
{
List
<
String
>
pointInputImgUrls
=
new
ArrayList
<>();
...
...
@@ -993,31 +949,11 @@ public class CheckServiceImpl implements ICheckService {
appCheckInputRespone
.
setClassifyName
(
action
.
getClassifyName
());
appCheckInputRespone
.
setRemark
(
action
.
getRemark
());
appCheckInputRespone
.
setPlanTaskId
(
action
.
getPlanTaskId
());
String
classifyName
=
action
.
getClassifyName
();
if
(!
StringUtil
.
isNotEmpty
(
classifyName
))
{
classifyName
=
"其他"
;
}
String
riskDesc
=
action
.
getRiskDesc
();
if
(!
StringUtil
.
isNotEmpty
(
riskDesc
))
{
riskDesc
=
XJConstant
.
DEFAULT_RISKDESC
;
}
JSONObject
classifyJson
;
if
(
appResponeMap
.
containsKey
(
classifyName
))
{
classifyJson
=
appResponeMap
.
getJSONObject
(
classifyName
);
}
else
{
classifyJson
=
new
JSONObject
();
}
JSONArray
riskDescArr
;
if
(
classifyJson
.
containsKey
(
riskDesc
))
{
riskDescArr
=
classifyJson
.
getJSONArray
(
riskDesc
);
}
else
{
riskDescArr
=
new
JSONArray
();
}
riskDescArr
.
add
(
appCheckInputRespone
);
classifyJson
.
put
(
riskDesc
,
riskDescArr
);
appResponeMap
.
put
(
classifyName
,
classifyJson
);
appCheckInputResponeList
.
add
(
appCheckInputRespone
);
});
appResponeMap
.
put
(
"items"
,
appCheckInputResponeList
);
pointCheckRespone
.
setAppCheckInput
(
appResponeMap
);
return
pointCheckRespone
;
}
...
...
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 @
37a8b900
...
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.base.Joiner
;
import
com.sun.corba.se.impl.activation.RepositoryImpl
;
import
com.yeejoin.amos.boot.biz.common.constants.RuleConstant
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
...
...
@@ -54,6 +55,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.support.TransactionSynchronization
;
...
...
@@ -141,6 +143,9 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
@Autowired
private
ICheckShotDao
iCheckShotDao
;
@Autowired
private
RepositoryTs
repositoryTs
;
private
final
String
PATROL_PLAN_TASK_KEY
=
"PATROL_PLAN_ID:"
;
private
final
String
packageId
=
"消息/addCheckRule"
;
...
...
@@ -685,6 +690,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
}
System
.
out
.
println
(
userDetailsDtos
.
size
()+
"==================="
);
return
PlanTaskUtil
.
genWholeExeData
(
timeList
,
plan
,
userDetailsDtos
,
route
);
}
...
...
@@ -697,6 +703,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
* @param plan
* @param flag 是否初始状态0-初始 1-非初始
*/
@Async
(
"asyncServiceExecutor"
)
public
void
insertPlanTaskAndDetNew
(
List
<
HashMap
<
String
,
Object
>>
list
,
Plan
plan
,
String
flag
,
Date
now
)
{
if
(
list
==
null
||
list
.
size
()
<=
0
)
{
HashMap
<
String
,
Object
>
paramMap
=
new
HashMap
<
String
,
Object
>();
...
...
@@ -732,6 +739,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
List
<
PlanTask
>
planTaskList
=
new
ArrayList
<>();
List
<
PlanTaskDetail
>
planTaskDetailListSync
=
new
ArrayList
<>();
PlanTask
planTask
=
new
PlanTask
();
List
<
PlanTask
>
taskList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
startTime
=
list
.
get
(
i
).
get
(
"BEGIN_TIME"
).
toString
();
...
...
@@ -742,11 +750,11 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
String
orgCode
=
list
.
get
(
i
).
get
(
"ORG_CODE"
)
==
null
?
"-1"
:
String
.
valueOf
(
list
.
get
(
i
).
get
(
"ORG_CODE"
));
String
unitCode
=
list
.
get
(
i
).
get
(
"UNIT_CODE"
)
==
null
?
"-1"
:
String
.
valueOf
(
list
.
get
(
i
).
get
(
"UNIT_CODE"
));
planTask
=
iplanTaskDao
.
findByUserIdAndBeginTimeAndEndTimeAndPlanIdAndRouteId
(
userId
,
startTime
,
endTime
,
plan
.
getId
(),
plan
.
getRouteId
());
if
(
planTask
!=
null
)
{
continue
;
}
//
planTask = new PlanTask();
//
planTask = iplanTaskDao.findByUserIdAndBeginTimeAndEndTimeAndPlanIdAndRouteId(userId, startTime, endTime, plan.getId(), plan.getRouteId());
//
if (planTask != null) {
//
continue;
//
}
planTask
=
new
PlanTask
();
//修改巡检p_plan_task orgcode为执行人的org_code -- add by wujunkai 20201216
planTask
.
setOrgCode
(
orgCode
);
...
...
@@ -791,7 +799,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
planTask
.
setBeginTime
(
startTime
);
planTask
.
setEndTime
(
endTime
);
// 1.保存执行数据主表
iplanTaskDao
.
saveAndFlush
(
planTask
);
// iplanTaskDao.saveAndFlush(planTask);
taskList
.
add
(
planTask
);
// 发送APP待办消息 (20220617 改为定时任务发送消息)
// sendMessage(plan, planTask);
String
executorId
=
planTask
.
getUserId
();
...
...
@@ -811,10 +820,12 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
planTaskDetailInstance
.
setStatus
(
"1"
);
}
// 2.保存执行数据明细表
planTaskDetail
.
saveAndFlush
(
planTaskDetailInstance
);
//
planTaskDetail.saveAndFlush(planTaskDetailInstance);
planTaskDetailListSync
.
add
(
planTaskDetailInstance
);
}
}
repositoryTs
.
batchSave
(
taskList
);
repositoryTs
.
batchSave
(
planTaskDetailListSync
);
// 定时任务监控
log
.
error
(
"计划重做开始添加定时任务监控========"
);
jobService
.
planTaskAddJob
(
planTask
);
...
...
@@ -1138,7 +1149,9 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
PlanTask
planTask
=
planTaskOptional
.
get
();
planTask
.
setFinishStatus
(
XJConstant
.
TASK_STATUS_FINISH
);
planTask
.
setRiskStatus
(
XJConstant
.
NORISK_NUM
);
if
(
planTask
.
getRiskStatus
()
!=
1
)
{
planTask
.
setRiskStatus
(
XJConstant
.
NORISK_NUM
);
}
iplanTaskDao
.
saveAndFlush
(
planTask
);
List
<
PlanTaskDetail
>
planTaskDetails
=
iPlanTaskDetailDao
.
findAllByTaskNoAndStatus
(
planTask
.
getId
(),
PlanTaskDetailStatusEnum
.
NOTSTARTED
.
getValue
());
if
(!
planTaskDetails
.
isEmpty
())
{
...
...
@@ -1453,58 +1466,19 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
AppPointCheckRespone
pointCheckRespone
=
new
AppPointCheckRespone
();
Check
check
=
checkDao
.
findByPlanTaskIdAndPointId
(
planTaskId
,
pointId
);
PointCheckDetailBo
planPointInfo
=
planTaskMapper
.
getPointPlanTaskInfo
(
planTaskId
,
pointId
);
pointCheckRespone
.
setTaskStatus
(
planPointInfo
.
getTaskStatus
());
pointCheckRespone
.
setPointStatus
(
planPointInfo
.
getPointStatus
());
if
(
planPointInfo
!=
null
)
{
if
(
check
!=
null
)
{
List
<
CheckShot
>
checkShots
=
iCheckShotDao
.
findAllByCheckIdAndCheckInputId
(
check
.
getId
(),
0L
);
List
<
String
>
photos
=
new
ArrayList
<>();
if
(!
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
checkShots
))
{
photos
=
checkShots
.
stream
().
map
(
e
->
{
if
(
e
!=
null
)
{
return
e
.
getPhotoData
().
replaceAll
(
"\\\\"
,
"/"
);
}
else
{
return
""
;
}
}).
collect
(
Collectors
.
toList
());
}
pointCheckRespone
.
setPointImgUrls
(
photos
);
}
pointCheckRespone
.
setPointId
(
pointId
);
pointCheckRespone
.
setPointName
(
planPointInfo
.
getPointName
());
pointCheckRespone
.
setPointNo
(
planPointInfo
.
getPointNo
());
pointCheckRespone
.
setBeginTime
(
planPointInfo
.
getBeginTime
());
pointCheckRespone
.
setEndTime
(
planPointInfo
.
getEndTime
());
pointCheckRespone
.
setPlanName
(
planPointInfo
.
getPlanName
());
pointCheckRespone
.
setShortMaxNumber
(
planPointInfo
.
getShortMaxNumber
());
pointCheckRespone
.
setShortMinNumber
(
planPointInfo
.
getShortMinNumber
());
List
<
PointCheckDetailBo
>
pointInputs
=
planTaskMapper
.
getPointInputByRouteIdAndPointId
(
planPointInfo
.
getRouteId
(),
planPointInfo
.
getPointId
());
JSONObject
appResponeMap
=
new
JSONObject
();
List
<
AppCheckInputRespone
>
appCheckInputResponeList
=
new
ArrayList
<
AppCheckInputRespone
>();
pointInputs
.
forEach
(
action
->
{
AppCheckInputRespone
input
=
new
AppCheckInputRespone
();
input
.
setInputName
(
action
.
getInputName
());
input
.
setCheckInputId
(
action
.
getCheckInputId
());
input
.
setDataJson
(
action
.
getDataJson
());
input
.
setIsMultiline
(
action
.
getIsMultiline
());
input
.
setIsMust
(
action
.
getIsMust
());
input
.
setInputValue
(
null
);
if
(
null
!=
check
)
{
for
(
CheckInput
ck
:
check
.
getCheckInput
()
)
{
if
(
ck
.
getInputId
().
toString
().
equals
(
String
.
valueOf
(
action
.
getCheckInputId
())))
{
input
.
setInputValue
(
ck
.
getInputValue
());
}
}
List
<
CheckShot
>
checkShotsNew
=
iCheckShotDao
.
findAllByCheckIdAndCheckInputId
(
check
.
getId
(),
action
.
getCheckInputId
());
List
<
String
>
photosNew
=
new
ArrayList
<>();
if
(!
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
checkShotsNew
))
{
photosNew
=
checkShotsNew
.
stream
().
map
(
e
->
{
if
(
check
!=
null
)
{
pointCheckRespone
=
checkService
.
queryCheckPointDetailInVersion2
(
toke
,
product
,
appKey
,
check
.
getId
(),
planTaskId
,
pointId
);
}
else
{
PointCheckDetailBo
planPointInfo
=
planTaskMapper
.
getPointPlanTaskInfo
(
planTaskId
,
pointId
);
pointCheckRespone
.
setTaskStatus
(
planPointInfo
.
getTaskStatus
());
pointCheckRespone
.
setPointStatus
(
planPointInfo
.
getPointStatus
());
if
(
planPointInfo
!=
null
)
{
if
(
check
!=
null
)
{
List
<
CheckShot
>
checkShots
=
iCheckShotDao
.
findAllByCheckIdAndCheckInputId
(
check
.
getId
(),
0L
);
List
<
String
>
photos
=
new
ArrayList
<>();
if
(!
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
checkShots
))
{
photos
=
checkShots
.
stream
().
map
(
e
->
{
if
(
e
!=
null
)
{
return
e
.
getPhotoData
().
replaceAll
(
"\\\\"
,
"/"
);
}
else
{
...
...
@@ -1512,22 +1486,64 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
}).
collect
(
Collectors
.
toList
());
}
input
.
setPointInputImgUrls
(
photosNew
);
pointCheckRespone
.
setPointImgUrls
(
photos
);
}
input
.
setItemType
(
action
.
getItemType
());
input
.
setOrderNo
(
action
.
getOrderNo
());
input
.
setPictureJson
(
action
.
getPictureJson
());
input
.
setClassifyId
(
action
.
getClassifyId
());
input
.
setClassifyName
(
action
.
getClassifyName
());
appCheckInputResponeList
.
add
(
input
);
pointCheckRespone
.
setPointId
(
pointId
);
pointCheckRespone
.
setPointName
(
planPointInfo
.
getPointName
());
pointCheckRespone
.
setPointNo
(
planPointInfo
.
getPointNo
());
pointCheckRespone
.
setBeginTime
(
planPointInfo
.
getBeginTime
());
pointCheckRespone
.
setEndTime
(
planPointInfo
.
getEndTime
());
pointCheckRespone
.
setPlanName
(
planPointInfo
.
getPlanName
());
pointCheckRespone
.
setShortMaxNumber
(
planPointInfo
.
getShortMaxNumber
());
pointCheckRespone
.
setShortMinNumber
(
planPointInfo
.
getShortMinNumber
());
List
<
PointCheckDetailBo
>
pointInputs
=
planTaskMapper
.
getPointInputByRouteIdAndPointId
(
planPointInfo
.
getRouteId
(),
planPointInfo
.
getPointId
());
JSONObject
appResponeMap
=
new
JSONObject
();
List
<
AppCheckInputRespone
>
appCheckInputResponeList
=
new
ArrayList
<
AppCheckInputRespone
>();
pointInputs
.
forEach
(
action
->
{
AppCheckInputRespone
input
=
new
AppCheckInputRespone
();
input
.
setInputName
(
action
.
getInputName
());
input
.
setCheckInputId
(
action
.
getCheckInputId
());
input
.
setDataJson
(
action
.
getDataJson
());
input
.
setIsMultiline
(
action
.
getIsMultiline
());
input
.
setIsMust
(
action
.
getIsMust
());
input
.
setInputValue
(
null
);
if
(
null
!=
check
)
{
for
(
CheckInput
ck
:
check
.
getCheckInput
()
)
{
if
(
ck
.
getInputId
().
toString
().
equals
(
String
.
valueOf
(
action
.
getCheckInputId
())))
{
input
.
setInputValue
(
ck
.
getInputValue
());
}
}
});
List
<
CheckShot
>
checkShotsNew
=
iCheckShotDao
.
findAllByCheckIdAndCheckInputId
(
check
.
getId
(),
action
.
getCheckInputId
());
List
<
String
>
photosNew
=
new
ArrayList
<>();
if
(!
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
checkShotsNew
))
{
photosNew
=
checkShotsNew
.
stream
().
map
(
e
->
{
if
(
e
!=
null
)
{
return
e
.
getPhotoData
().
replaceAll
(
"\\\\"
,
"/"
);
}
else
{
return
""
;
}
}).
collect
(
Collectors
.
toList
());
}
input
.
setPointInputImgUrls
(
photosNew
);
}
appResponeMap
.
put
(
"items"
,
appCheckInputResponeList
);
pointCheckRespone
.
setAppCheckInput
(
appResponeMap
);
}
input
.
setItemType
(
action
.
getItemType
());
input
.
setOrderNo
(
action
.
getOrderNo
());
input
.
setPictureJson
(
action
.
getPictureJson
());
input
.
setClassifyId
(
action
.
getClassifyId
());
input
.
setClassifyName
(
action
.
getClassifyName
());
appCheckInputResponeList
.
add
(
input
);
});
appResponeMap
.
put
(
"items"
,
appCheckInputResponeList
);
pointCheckRespone
.
setAppCheckInput
(
appResponeMap
);
}
}
return
pointCheckRespone
;
}
...
...
@@ -1536,7 +1552,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
AppPointCheckRespone
pointCheckRespone
=
new
AppPointCheckRespone
();
Check
check
=
checkDao
.
findByPlanTaskIdAndPointId
(
planTaskId
,
pointId
);
if
(
check
!=
null
)
{
pointCheckRespone
=
checkService
.
queryCheckPointDetailInVersion2
(
toke
,
product
,
appKey
,
check
.
getId
());
pointCheckRespone
=
checkService
.
queryCheckPointDetailInVersion2
(
toke
,
product
,
appKey
,
check
.
getId
()
,
null
,
null
);
}
else
{
PointCheckDetailBo
planPointInfo
=
planTaskMapper
.
getPointPlanTaskInfo
(
planTaskId
,
pointId
);
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/RepositoryTImpl.java
0 → 100644
View file @
37a8b900
package
com
.
yeejoin
.
amos
.
patrol
.
business
.
service
.
impl
;
import
com.yeejoin.amos.patrol.business.dao.repository.RepositoryTs
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.persistence.EntityManager
;
import
javax.persistence.PersistenceContext
;
import
java.util.Iterator
;
@Service
public
class
RepositoryTImpl
implements
RepositoryTs
{
private
static
final
int
BATCH_SIZE
=
1
;
@PersistenceContext
private
final
EntityManager
em
;
public
RepositoryTImpl
(
EntityManager
em
)
{
this
.
em
=
em
;
}
@Override
@Transactional
public
<
S
>
Iterable
<
S
>
batchSave
(
Iterable
<
S
>
var1
)
{
Iterator
<
S
>
iterator
=
var1
.
iterator
();
int
index
=
0
;
while
(
iterator
.
hasNext
()){
em
.
persist
(
iterator
.
next
());
index
++;
if
(
index
%
BATCH_SIZE
==
0
){
em
.
flush
();
em
.
clear
();
}
}
if
(
index
%
BATCH_SIZE
!=
0
){
em
.
flush
();
em
.
clear
();
}
return
var1
;
}
@Override
public
<
S
>
Iterable
<
S
>
batchUpdate
(
Iterable
<
S
>
var1
)
{
Iterator
<
S
>
iterator
=
var1
.
iterator
();
int
index
=
0
;
while
(
iterator
.
hasNext
()){
em
.
merge
(
iterator
.
next
());
index
++;
if
(
index
%
BATCH_SIZE
==
0
){
em
.
flush
();
em
.
clear
();
}
}
if
(
index
%
BATCH_SIZE
!=
0
){
em
.
flush
();
em
.
clear
();
}
return
var1
;
}
}
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/RouteServiceImpl.java
View file @
37a8b900
...
...
@@ -30,6 +30,8 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
javax.persistence.EntityManager
;
import
javax.persistence.PersistenceContext
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
...
...
@@ -78,6 +80,15 @@ public class RouteServiceImpl extends ServiceImpl<RouteMapper, Route> implement
@Autowired
private
IRoutePointItemDao
iRoutePointItemDao
;
@Autowired
private
RepositoryTs
repositoryTs
;
@PersistenceContext
private
final
EntityManager
em
;
public
RouteServiceImpl
(
EntityManager
em
)
{
this
.
em
=
em
;
}
@Override
@Transactional
...
...
@@ -257,43 +268,44 @@ public class RouteServiceImpl extends ServiceImpl<RouteMapper, Route> implement
points
.
add
(
rp
);
pointIds
.
add
(
rp
.
getPointId
());
});
List
<
RoutePoint
>
savedPoints
=
iRoutePointDao
.
saveAll
(
points
);
List
<
Map
<
String
,
Object
>>
pointRefItem
=
pointMapper
.
getPointRefItem
(
pointIds
);
if
(!
savedPoints
.
isEmpty
())
{
savedPoints
.
forEach
(
rp
->
{
String
excludeItems
=
rp
.
getExcludeItems
();
Set
<
Long
>
excludeItemIdSet
=
new
HashSet
<>();
if
(
excludeItems
!=
null
&&
!
excludeItems
.
isEmpty
())
{
String
[]
itemIds
=
excludeItems
.
split
(
","
);
for
(
String
itemId
:
itemIds
)
{
try
{
excludeItemIdSet
.
add
(
Long
.
valueOf
(
itemId
));
}
catch
(
Exception
e
)
{
}
for
(
RoutePoint
rt:
routePoints
)
{
em
.
persist
(
rt
);
em
.
flush
();
em
.
clear
();
String
excludeItems
=
rt
.
getExcludeItems
();
Set
<
Long
>
excludeItemIdSet
=
new
HashSet
<>();
if
(
excludeItems
!=
null
&&
!
excludeItems
.
isEmpty
())
{
String
[]
itemIds
=
excludeItems
.
split
(
","
);
for
(
String
itemId
:
itemIds
)
{
try
{
excludeItemIdSet
.
add
(
Long
.
valueOf
(
itemId
));
}
catch
(
Exception
e
)
{
}
}
final
int
[]
orderNum
=
{
1
};
pointRefItem
.
forEach
(
ref
->
{
Long
pointId
=
rp
.
getPointId
();
if
(
pointId
.
equals
(
ref
.
get
(
"pointId"
))){
if
(!
excludeItemIdSet
.
contains
(
ref
.
get
(
"itemId"
)))
{
RoutePointItem
item
=
new
RoutePointItem
();
item
.
setPointInputItemId
((
Long
)
ref
.
get
(
"id"
)
);
item
.
setRoutePointId
(
rp
.
getId
(
));
item
.
setPointClassifyId
(
ref
.
containsKey
(
"classifyId"
)?
Long
.
valueOf
(
ref
.
get
(
"classifyId"
).
toString
()):
null
);
item
.
setOrderNo
(
orderNum
[
0
]++
);
item
.
setPointId
(
pointId
);
item
.
setIsDelete
(
false
);
items
.
add
(
item
);
}
}
final
int
[]
orderNum
=
{
1
};
pointRefItem
.
forEach
(
ref
->
{
Long
pointId
=
rt
.
getPointId
();
if
(
pointId
.
equals
(
ref
.
get
(
"pointId"
)))
{
if
(!
excludeItemIdSet
.
contains
(
ref
.
get
(
"itemId"
)))
{
RoutePointItem
item
=
new
RoutePointItem
(
);
item
.
setPointInputItemId
((
Long
)
ref
.
get
(
"id"
));
item
.
setRoutePointId
(
rt
.
getId
()
);
item
.
setPointClassifyId
(
ref
.
containsKey
(
"classifyId"
)?
Long
.
valueOf
(
ref
.
get
(
"classifyId"
).
toString
()):
null
);
item
.
setOrderNo
(
orderNum
[
0
]++
);
item
.
setPointId
(
pointId
);
item
.
setIsDelete
(
false
);
items
.
add
(
item
);
}
}
);
}
});
if
(!
items
.
isEmpty
())
{
for
(
RoutePointItem
routePointItem:
items
)
{
iRoutePointItemDao
.
saveAndFlush
(
routePointItem
);
}
repositoryTs
.
batchSave
(
items
);
}
}
}
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/intfc/ICheckService.java
View file @
37a8b900
...
...
@@ -14,6 +14,7 @@ import com.yeejoin.amos.patrol.core.common.response.CommonPage;
import
com.yeejoin.amos.patrol.core.common.response.GraphInitDataResponse
;
import
com.yeejoin.amos.patrol.core.common.response.QueryCriteriaRespone
;
import
com.yeejoin.amos.patrol.dao.entity.CheckShot
;
import
com.yeejoin.amos.patrol.dao.entity.PlanTask
;
import
com.yeejoin.amos.patrol.exception.YeeException
;
import
org.springframework.data.domain.Page
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -36,7 +37,7 @@ public interface ICheckService {
void
saveCheckImg
(
List
<
CheckShot
>
imgList
);
CheckDto
saveCheckRecord
(
CheckRecordParam
requestParam
,
AgencyUserModel
user
,
DepartmentBo
departmentModel
,
Toke
token
);
CheckDto
saveCheckRecordNew
(
CheckRecordParam
requestParam
);
CheckDto
saveCheckRecordNew
(
CheckRecordParam
requestParam
,
PlanTask
planTask
);
/**
* 巡检记录删除
*
...
...
@@ -69,7 +70,7 @@ public interface ICheckService {
AppPointCheckRespone
queryCheckPointDetail
(
String
toke
,
String
product
,
String
appKey
,
long
checkId
);
AppPointCheckRespone
queryCheckPointDetailInVersion2
(
String
toke
,
String
product
,
String
appKey
,
long
checkId
);
AppPointCheckRespone
queryCheckPointDetailInVersion2
(
String
toke
,
String
product
,
String
appKey
,
long
checkId
,
Long
planTaskId
,
Long
pointId
);
AppPointCheckRespone
queryCheckPointDetailInVersion2New
(
long
checkId
);
/**
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/config/ExecutorConfig.java
0 → 100644
View file @
37a8b900
package
com
.
yeejoin
.
amos
.
patrol
.
config
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
java.util.concurrent.Executor
;
import
java.util.concurrent.ThreadPoolExecutor
;
/**
* @author 瑾年
* @className ExecutorConfig
* @date 2020/8/26 10:31
*/
@Slf4j
@Configuration
@EnableAsync
public
class
ExecutorConfig
{
/**
* 配置队列大小
* */
@Value
(
"${executor.queueCapacity}"
)
private
int
queueCapacity
;
/***
* 配置线程池中的线程的名称前缀
* */
@Value
(
"${executor.namePrefix}"
)
private
String
namePrefix
;
/**
* 线程池维护线程所允许的空闲时间
* */
@Value
(
"${executor.keepAliveSeconds}"
)
private
int
keepAliveSeconds
;
@Bean
(
name
=
"asyncServiceExecutor"
)
public
Executor
asyncServiceExecutor
()
{
log
.
info
(
"初始化异步线程池"
);
//获取cpu核心数,最大线程数和核心线程数为cpu核心数的2倍
int
curSystemThreads
=
Runtime
.
getRuntime
().
availableProcessors
()
*
2
;
log
.
info
(
"系统可用线程池个数:{}"
,
curSystemThreads
);
ThreadPoolTaskExecutor
executor
=
new
ThreadPoolTaskExecutor
();
//配置核心线程数
executor
.
setCorePoolSize
(
curSystemThreads
);
//配置最大线程数
executor
.
setMaxPoolSize
(
curSystemThreads
);
//配置队列大小
executor
.
setQueueCapacity
(
queueCapacity
);
//配置线程池中的线程的名称前缀
executor
.
setThreadNamePrefix
(
namePrefix
);
//线程池维护线程所允许的空闲时间
executor
.
setKeepAliveSeconds
(
keepAliveSeconds
);
// rejection-policy:当pool已经达到max size的时候,如何处理新任务
// CALLER_RUNS:不在新线程中执行任务,而是有调用者所在的线程来执行--拒绝策略
executor
.
setRejectedExecutionHandler
(
new
ThreadPoolExecutor
.
CallerRunsPolicy
());
//执行初始化
executor
.
initialize
();
//等待所有任务结束后再关闭线程池
executor
.
setWaitForTasksToCompleteOnShutdown
(
true
);
return
executor
;
}
}
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/schedule/LatentDanerScheduled.java
View file @
37a8b900
...
...
@@ -19,8 +19,8 @@ public class LatentDanerScheduled {
* 每1分钟执行一次:查询逾期的隐患,修改状态
*/
@Scheduled
(
cron
=
"0 0/1 * * * ?"
)
public
void
updateDangerStateOfOvertime
()
{
iLatentDangerService
.
updateDangerStateOfOvertime
();
}
//
@Scheduled(cron = "0 0/1 * * * ?")
//
public void updateDangerStateOfOvertime() {
//
iLatentDangerService.updateDangerStateOfOvertime();
//
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/resources/db/mapper/dbTemplate_plan_task.xml
View file @
37a8b900
...
...
@@ -501,7 +501,7 @@
AND ptd.id = #{planTaskId} and pptd.status = #{planTaskDetailStatus}
) temp2 on(temp1.point_id = temp2.pointId
AND temp1.route_id = temp2.routeId)
GROUP BY pointName
</select>
<!-- 巡检执行情况统计分页用 -->
<select
id=
"countChkExListData"
resultType=
"long"
>
...
...
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