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
1c207e6d
Commit
1c207e6d
authored
Nov 23, 2023
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
f79a83ad
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
77 additions
and
12 deletions
+77
-12
CheckController.java
...join/amos/patrol/business/controller/CheckController.java
+28
-4
PlanTaskMapper.java
...ejoin/amos/patrol/business/dao/mapper/PlanTaskMapper.java
+3
-1
PointCheckDetailBo.java
...os/patrol/business/entity/mybatis/PointCheckDetailBo.java
+6
-0
CheckServiceImpl.java
...n/amos/patrol/business/service/impl/CheckServiceImpl.java
+17
-0
PlanTaskServiceImpl.java
...mos/patrol/business/service/impl/PlanTaskServiceImpl.java
+7
-6
IJobService.java
...main/java/com/yeejoin/amos/patrol/quartz/IJobService.java
+2
-1
JobService.java
.../main/java/com/yeejoin/amos/patrol/quartz/JobService.java
+0
-0
application-dev.properties
...spatrol-biz/src/main/resources/application-dev.properties
+1
-0
dbTemplate_plan_task.xml
...biz/src/main/resources/db/mapper/dbTemplate_plan_task.xml
+13
-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/controller/CheckController.java
View file @
1c207e6d
...
...
@@ -9,6 +9,7 @@ import com.yeejoin.amos.patrol.business.constants.XJConstant;
import
com.yeejoin.amos.patrol.business.dao.mapper.CheckMapper
;
import
com.yeejoin.amos.patrol.business.dao.mapper.PlanTaskMapper
;
import
com.yeejoin.amos.patrol.business.dao.mapper.PointMapper
;
import
com.yeejoin.amos.patrol.business.dao.repository.ESPlanTaskList
;
import
com.yeejoin.amos.patrol.business.dao.repository.ICheckInputDao
;
import
com.yeejoin.amos.patrol.business.dto.*
;
import
com.yeejoin.amos.patrol.business.param.CheckInfoPageParam
;
...
...
@@ -28,7 +29,10 @@ import com.yeejoin.amos.patrol.core.common.response.GraphInitDataResponse;
import
com.yeejoin.amos.patrol.core.enums.QueryOperatorEnum
;
import
com.yeejoin.amos.patrol.core.util.DateUtil
;
import
com.yeejoin.amos.patrol.core.util.StringUtil
;
import
com.yeejoin.amos.patrol.dao.entity.ESPlanTaskListDto
;
import
com.yeejoin.amos.patrol.dao.entity.PlanTask
;
import
com.yeejoin.amos.patrol.dao.entity.PlanTaskDetail
;
import
com.yeejoin.amos.patrol.dao.entity.Point
;
import
com.yeejoin.amos.patrol.feign.RemoteSecurityService
;
import
com.yeejoin.amos.patrol.mqtt.WebMqttComponent
;
import
com.yeejoin.amos.patrol.quartz.JobService
;
...
...
@@ -208,7 +212,8 @@ public class CheckController extends AbstractBaseController {
return
ResponseHelper
.
buildResponse
(
"提交成功"
);
}
@Autowired
ESPlanTaskList
esPlanTaskList
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"保存巡检记录<font color='blue'>手机app</font>"
,
notes
=
"保存巡检记录<font color='blue'>手机app</font>"
)
...
...
@@ -254,13 +259,32 @@ public class CheckController extends AbstractBaseController {
requestParam
.
setOrgCode
(
orgCode
);
requestParam
.
setUserId
(
getUserId
());
CheckDto
checkDto
=
checkService
.
saveCheckRecordNew
(
requestParam
,
planTask
);
Long
planTaskId
=
requestParam
.
getPlanTaskId
();
ESPlanTaskListDto
esPlanTaskListDto
=
esPlanTaskList
.
findById
(
String
.
valueOf
(
planTaskId
)).
get
();
Map
task
=
planTaskMapper
.
queryPlanTaskById
(
planTaskId
);
esPlanTaskListDto
.
setFinshNum
(
ObjectUtils
.
isEmpty
(
task
.
get
(
"finshNum"
))
?
"0"
:
task
.
get
(
"finshNum"
).
toString
());
esPlanTaskListDto
.
setOmission
(
ObjectUtils
.
isEmpty
(
task
.
get
(
"omission"
))
?
"0"
:
task
.
get
(
"omission"
).
toString
());
esPlanTaskListDto
.
setUnqualified
(
ObjectUtils
.
isEmpty
(
task
.
get
(
"unqualified"
))
?
"0"
:
task
.
get
(
"unqualified"
).
toString
());
esPlanTaskListDto
.
setUnplan
(
ObjectUtils
.
isEmpty
(
task
.
get
(
"unplan"
))
?
"0"
:
task
.
get
(
"unplan"
).
toString
());
esPlanTaskListDto
.
setTaskPlanNum
(
ObjectUtils
.
isEmpty
(
task
.
get
(
"taskPlanNum"
))
?
"0"
:
task
.
get
(
"taskPlanNum"
).
toString
());
List
<
PlanTaskDetail
>
planTaskDetailList
=
planTaskMapper
.
selectTaskDetails
(
String
.
valueOf
(
planTaskId
));
for
(
PlanTaskDetail
planTaskDetail
:
planTaskDetailList
)
{
Point
point
=
pointMapper
.
selectPointInfo
(
planTaskDetail
.
getPointId
());
planTaskDetail
.
setName
(
point
.
getName
());
planTaskDetail
.
setPointNo
(
point
.
getPointNo
());
}
esPlanTaskListDto
.
setPoints
(
planTaskDetailList
);
esPlanTaskList
.
save
(
esPlanTaskListDto
);
List
<
String
>
ids
=
new
ArrayList
<>();
ids
.
add
(
String
.
valueOf
(
planTaskId
));
Map
<
String
,
Object
>
map
=
planTaskMapper
.
selectTaskStatus
(
planTaskId
);
if
(
map
.
get
(
"status"
).
toString
().
equals
(
String
.
valueOf
(
PlanTaskFinishStatusEnum
.
FINISHED
)))
{
jobService
.
updateEsPlanTaskList
(
ids
,
Integer
.
parseInt
(
map
.
get
(
"status"
).
toString
()));
if
(
map
.
get
(
"status"
).
toString
().
equals
(
String
.
valueOf
(
PlanTaskFinishStatusEnum
.
FINISHED
.
getValue
())))
{
ESPlanTaskListDto
esPlanTaskListDto1
=
esPlanTaskList
.
findById
(
String
.
valueOf
(
planTaskId
)).
get
();
esPlanTaskListDto1
.
setFinishStatus
(
map
.
get
(
"status"
).
toString
());
esPlanTaskList
.
save
(
esPlanTaskListDto1
);
jobService
.
updateEsPlanTaskList
(
ids
,
Integer
.
parseInt
(
map
.
get
(
"status"
).
toString
()),
"app"
,
requestParam
);
// 更新统计表
if
(
planTask
.
getPlanType
().
equals
(
String
.
valueOf
(
PlanTaskTypeStatusEnum
.
day
.
getValue
())))
{
planTaskMapper
.
updateSingle
(
P_STATIC_DAY
,
XJConstant
.
RISK_NUM
==
Integer
.
parseInt
(
map
.
get
(
"riskStatus"
).
toString
())
?
1
:
0
,
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/dao/mapper/PlanTaskMapper.java
View file @
1c207e6d
...
...
@@ -231,7 +231,7 @@ public interface PlanTaskMapper extends BaseMapper {
List
<
PlanTask
>
getPlanTaskTListByPlanId
(
long
planId
,
int
finishStatus
);
void
updatePlanTaskByPlanId
(
List
<
Long
>
ids
,
int
finishStatus
);
void
updatePlanTaskByPlanId
(
@Param
(
value
=
"ids"
)
List
<
Long
>
ids
,
int
finishStatus
);
void
updatePlanTaskDetailsByPlanId
(
@Param
(
value
=
"ids"
)
List
<
Long
>
ids
);
...
...
@@ -274,4 +274,6 @@ public interface PlanTaskMapper extends BaseMapper {
Long
selectRoutId
(
String
id
);
List
<
String
>
selectPlanTaskIdLists
(
long
planId
,
int
status
,
int
status1
);
List
<
PlanTask
>
selectTaskList
(
@Param
(
value
=
"ids"
)
List
<
String
>
ids
);
}
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/entity/mybatis/PointCheckDetailBo.java
View file @
1c207e6d
...
...
@@ -6,6 +6,8 @@ public class PointCheckDetailBo {
private
Long
id
;
private
long
pointId
;
private
long
inputItemId
;
private
String
pointName
;
...
...
@@ -23,6 +25,10 @@ public class PointCheckDetailBo {
return
id
;
}
public
long
getInputItemId
()
{
return
inputItemId
;
}
public
String
getDefaultValue
()
{
return
defaultValue
;
}
...
...
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 @
1c207e6d
...
...
@@ -39,6 +39,7 @@ import com.yeejoin.amos.patrol.core.util.DateUtil;
import
com.yeejoin.amos.patrol.core.util.StringUtil
;
import
com.yeejoin.amos.patrol.dao.entity.*
;
import
com.yeejoin.amos.patrol.feign.RemoteSecurityService
;
import
com.yeejoin.amos.patrol.quartz.IJobService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.assertj.core.util.Sets
;
...
...
@@ -114,6 +115,9 @@ public class CheckServiceImpl implements ICheckService {
private
CheckInputMapper
checkInputMapper
;
@Autowired
ESTaskDetail
esTaskDetail
;
@Autowired
private
IdxFeign
idxFeign
;
private
String
P_STATIC_DAY
=
"p_static_day"
;
...
...
@@ -468,6 +472,9 @@ public class CheckServiceImpl implements ICheckService {
}
@Autowired
IJobService
jobService
;
@Override
@Transactional
...
...
@@ -605,6 +612,13 @@ public class CheckServiceImpl implements ICheckService {
taskDetail
.
setStatus
(
CheckStatusEnum
.
QUALIFIED
.
getCode
());
}
planTaskDetailDao
.
saveAndFlush
(
taskDetail
);
ESTaskDetailDto
esTaskDetailDto
=
esTaskDetail
.
findById
(
String
.
valueOf
(
taskDetail
.
getId
())).
get
();
esTaskDetailDto
.
setPointStatus
(
String
.
valueOf
(
taskDetail
.
getIsFinish
()));
Long
routId
=
planTaskMapper
.
selectRoutId
(
String
.
valueOf
(
taskDetail
.
getTaskNo
()));
JSONObject
jsonObject
=
jobService
.
getCheckInput
(
routId
,
taskDetail
.
getPointId
(),
"update"
,
requestParam
);
esTaskDetailDto
.
setAppCheckInput
(
jsonObject
);
esTaskDetail
.
save
(
esTaskDetailDto
);
check
.
setError
(
error
);
check
.
setErrorClassify
(
StringUtils
.
join
(
errorClassifyNames
.
keySet
(),
","
));
...
...
@@ -927,6 +941,9 @@ public class CheckServiceImpl implements ICheckService {
pointImgUrls
.
add
(
action
.
getPhotoData
());
});
Check
check
=
checkDao
.
findById
(
checkId
).
get
();
pointCheckRespone
.
setId
(
planPointInfo
.
getId
());
pointCheckRespone
.
setPlanTaskId
(
planTaskId
);
pointCheckRespone
.
setTaskStatus
(
planPointInfo
.
getTaskStatus
());
pointCheckRespone
.
setPointStatus
(
planPointInfo
.
getPointStatus
());
pointCheckRespone
.
setBeginTime
(
planPointInfo
.
getBeginTime
());
...
...
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 @
1c207e6d
...
...
@@ -964,7 +964,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
taskDetail
.
setName
(
point
.
getName
());
taskDetail
.
setPointNo
(
point
.
getPointNo
());
AppPointCheckRespone
appPointCheckRespone
=
planService
.
queryPointPlanTaskDetail
(
null
,
null
,
null
,
taskDetail
.
getTaskNo
(),
taskDetail
.
getPointId
());
JSONObject
jsonObject
=
jobService
.
getCheckInput
(
routId
,
taskDetail
.
getPointId
());
JSONObject
jsonObject
=
jobService
.
getCheckInput
(
routId
,
taskDetail
.
getPointId
()
,
"save"
,
null
);
appPointCheckRespone
.
setAppCheckInput
(
jsonObject
);
ESTaskDetailDto
esTaskDetailDto
=
JSONObject
.
parseObject
(
toJSONString
(
appPointCheckRespone
),
ESTaskDetailDto
.
class
);
...
...
@@ -1322,16 +1322,16 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
planTaskDetailMapper
.
finishTaskDetail
(
action
.
getId
(),
action
.
getPointId
(),
action
.
getPlanTask
().
getId
(),
userId
);
AppPointCheckRespone
appPointCheckRespone
=
planService
.
queryPointPlanTaskDetail
(
null
,
null
,
null
,
action
.
getTaskNo
(),
action
.
getPointId
());
JSONObject
jsonObject
=
jobService
.
getCheckInput
(
routId
,
action
.
getPointId
());
ESTaskDetailDto
esTaskDetailDto
=
esTaskDetail
.
findById
(
String
.
valueOf
(
appPointCheckRespone
.
getId
())).
get
();
JSONObject
jsonObject
=
jobService
.
getCheckInput
(
routId
,
action
.
getPointId
(),
"update"
,
null
);
appPointCheckRespone
.
setAppCheckInput
(
jsonObject
);
ESTaskDetailDto
esTaskDetailDto
=
JSONObject
.
parseObject
(
toJSONString
(
appPointCheckRespone
),
ESTaskDetailDto
.
class
);
esTaskDetailDto
.
setPointImgUrls
(
new
ArrayList
<>());
esTaskDetail
.
save
(
esTaskDetailDto
);
return
action
;
}).
collect
(
Collectors
.
toList
());
}
ESPlanTaskListDto
esPlanTaskListDto
=
JSONObject
.
parseObject
(
toJSONString
(
planTask
),
ESPlanTaskListDto
.
class
);
ESPlanTaskListDto
esPlanTaskListDto
=
esPlanTaskList
.
findById
(
String
.
valueOf
(
planTask
.
getId
())).
get
();
Map
task
=
queryPlanTaskById
(
Long
.
valueOf
(
id
));
esPlanTaskListDto
.
setFinshNum
(
ObjectUtils
.
isEmpty
(
task
.
get
(
"finshNum"
))
?
"0"
:
task
.
get
(
"finshNum"
).
toString
());
esPlanTaskListDto
.
setOmission
(
ObjectUtils
.
isEmpty
(
task
.
get
(
"omission"
))
?
"0"
:
task
.
get
(
"omission"
).
toString
());
...
...
@@ -1339,6 +1339,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
esPlanTaskListDto
.
setUnplan
(
ObjectUtils
.
isEmpty
(
task
.
get
(
"unplan"
))
?
"0"
:
task
.
get
(
"unplan"
).
toString
());
esPlanTaskListDto
.
setTaskPlanNum
(
ObjectUtils
.
isEmpty
(
task
.
get
(
"taskPlanNum"
))
?
"0"
:
task
.
get
(
"taskPlanNum"
).
toString
());
esPlanTaskListDto
.
setPoints
(
planTaskDetails
);
esPlanTaskList
.
save
(
esPlanTaskListDto
);
// 生成巡检记录
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/quartz/IJobService.java
View file @
1c207e6d
package
com
.
yeejoin
.
amos
.
patrol
.
quartz
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.patrol.business.param.CheckRecordParam
;
import
com.yeejoin.amos.patrol.dao.entity.Msg
;
import
com.yeejoin.amos.patrol.dao.entity.PlanTask
;
import
com.yeejoin.amos.patrol.dao.entity.Task
;
...
...
@@ -65,6 +66,6 @@ public interface IJobService {
public
void
createCheckRecord
(
PlanTask
planTask
,
String
userId
);
public
JSONObject
getCheckInput
(
Long
routeId
,
Long
pointId
);
public
JSONObject
getCheckInput
(
Long
routeId
,
Long
pointId
,
String
type
,
CheckRecordParam
requestParam
);
}
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/quartz/JobService.java
View file @
1c207e6d
This diff is collapsed.
Click to expand it.
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/resources/application-dev.properties
View file @
1c207e6d
...
...
@@ -107,6 +107,7 @@ is.zxj=true
fire-rescue
=
1432549862557130753
## ES properties:
action.auto_create_index
:
true
elasticsearch.username
=
elastic
elasticsearch.password
=
a123456
spring.elasticsearch.rest.uris
=
http://172.16.10.243:9200
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/resources/db/mapper/dbTemplate_plan_task.xml
View file @
1c207e6d
...
...
@@ -722,6 +722,7 @@
<select
id=
"getPointInputByRouteIdAndPointId"
resultType=
"com.yeejoin.amos.patrol.business.entity.mybatis.PointCheckDetailBo"
parameterType=
"long"
>
SELECT
pii.id inputItemId,
pii.name inputName,
pii.id checkInputId,
ppc.id classifyId,
...
...
@@ -1749,4 +1750,15 @@
plan_id = #{planId}
AND (finish_status = #{status} or finish_status = #{status1} )
</select>
<select
id=
"selectTaskList"
resultType=
"com.yeejoin.amos.patrol.dao.entity.PlanTask"
>
select
*
from
"p_plan_task"
where id in
<foreach
item=
"id"
collection=
"newList"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</select>
</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