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
2f4da6d3
Commit
2f4da6d3
authored
Aug 03, 2022
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改nug
parent
e23ef89a
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
323 additions
and
1 deletion
+323
-1
PlanTaskController.java
...n/amos/patrol/business/controller/PlanTaskController.java
+126
-0
CheckServiceImpl.java
...n/amos/patrol/business/service/impl/CheckServiceImpl.java
+102
-0
PlanTaskServiceImpl.java
...mos/patrol/business/service/impl/PlanTaskServiceImpl.java
+85
-0
RouteServiceImpl.java
...n/amos/patrol/business/service/impl/RouteServiceImpl.java
+2
-0
ICheckService.java
...oin/amos/patrol/business/service/intfc/ICheckService.java
+1
-0
IPlanTaskService.java
.../amos/patrol/business/service/intfc/IPlanTaskService.java
+4
-0
dbTemplate_plan_task.xml
...rol/src/main/resources/db/mapper/dbTemplate_plan_task.xml
+3
-1
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/controller/PlanTaskController.java
View file @
2f4da6d3
...
...
@@ -579,6 +579,132 @@ public class PlanTaskController extends AbstractBaseController {
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"根据计划任务ID查询计划任务详情和任务点(<font color='blue'>手机app</font>)"
,
notes
=
"根据计划任务ID查询计划任务详情和任务点(<font color='blue'>手机app</font>)"
)
@RequestMapping
(
value
=
"/queryPlanTaskByIdNew"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
qryPlanTaskByIdNew
(
@ApiParam
(
value
=
"巡检计划任务ID"
,
required
=
true
)
@RequestParam
(
required
=
true
)
Long
planTaskId
)
{
try
{
Map
<
String
,
Object
>
response
=
new
HashMap
<
String
,
Object
>();
Map
task
=
planTaskService
.
queryPlanTaskById
(
planTaskId
);
if
(
ObjectUtils
.
isEmpty
(
task
)
||
ObjectUtils
.
isEmpty
(
task
.
get
(
"planTaskId"
)))
{
return
CommonResponseUtil
.
failure
(
"该计划已刷新,请重新选择!!!"
);
}
List
points
=
planTaskService
.
getPlanTaskPoints
(
planTaskId
);
String
[]
userIds
=
task
.
get
(
"userId"
).
toString
().
split
(
","
);
for
(
String
userId
:
userIds
)
{
task
.
put
(
"userId"
,
userId
);
}
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
task
.
put
(
"checkDate"
,
sdf
.
format
(
task
.
get
(
"checkDate"
)
!=
null
?
sdf
.
parse
(
task
.
get
(
"checkDate"
).
toString
())
:
new
Date
()));
response
.
put
(
"planTask"
,
task
);
response
.
put
(
"points"
,
points
);
return
CommonResponseUtil
.
success
(
response
);
}
catch
(
Exception
e
)
{
return
CommonResponseUtil
.
failure
(
e
.
getMessage
());
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"根据任务id和点id获取“未开始”任务点详情(<font color='blue'>手机app</font>)"
,
notes
=
"根据任务id和点id获取“未开始”任务点详情(<font color='blue'>手机app</font>)"
)
@RequestMapping
(
value
=
"/v2/queryPointPlanTaskDetailNew"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryPointPlanTaskDetailInVersion2New
(
@ApiParam
(
value
=
"巡检计划任务ID"
,
required
=
true
)
@RequestParam
(
required
=
true
)
Long
planTaskId
,
@ApiParam
(
value
=
"巡检点ID"
,
required
=
true
)
@RequestParam
(
required
=
true
)
Long
pointId
)
{
try
{
AppPointCheckRespone
result
=
planTaskService
.
queryPointPlanTaskDetailInVersion2New
(
planTaskId
,
pointId
);
if
(
ObjectUtils
.
isEmpty
(
result
))
{
return
CommonResponseUtil
.
failure
(
"该计划巡检点已更新,请退回重新选择"
);
}
return
CommonResponseUtil
.
success
(
result
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
CommonResponseUtil
.
failure
(
e
.
getMessage
());
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
// @Authorization(ingore = true)
@ApiOperation
(
value
=
"根据计划任务ID和点ID初始化巡检页面(<font color='blue'>手机app</font>)"
,
notes
=
"根据计划任务ID和点ID初始化巡检页面((<font color='blue'>手机app</font>)"
)
@RequestMapping
(
value
=
"/v2/initPlanTaskNew"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
qryPlanTaskDetailByIdInVersion2New
(
@ApiParam
(
value
=
"巡检计划任务ID"
)
@RequestParam
(
required
=
false
)
Long
planTaskId
,
@ApiParam
(
value
=
"巡检点id"
,
required
=
true
)
@RequestParam
Long
pointId
)
{
try
{
Map
<
String
,
Object
>
response
=
new
HashMap
<
String
,
Object
>();
if
(
planTaskId
!=
null
&&
planTaskId
>
0
)
{
Point
point
=
pointService
.
queryPointById
(
pointId
);
if
(!
XJConstant
.
IS_FIXED_YES
.
equals
(
point
.
getIsFixed
()))
{
// 1.校验当前点的执行情况,不能重复巡检及超时巡检
HashMap
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"planTaskId"
,
planTaskId
);
List
<
CodeOrderVo
>
list
=
planTaskService
.
queryCodeOrderVo
(
params
);
if
(
ObjectUtils
.
isEmpty
(
list
))
{
return
CommonResponseUtil
.
failure
(
"该计划已刷新,请重新选择!!!"
);
}
if
(
list
.
get
(
0
).
getStatus
()
==
PlanTaskFinishStatusEnum
.
OVERTIME
.
getValue
())
{
return
CommonResponseUtil
.
failure
(
"任务已超时!"
);
}
if
(
list
.
get
(
0
).
getStatus
()
==
PlanTaskFinishStatusEnum
.
FINISHED
.
getValue
())
{
return
CommonResponseUtil
.
failure
(
"任务已结束!"
);
}
//2.顺序执行->按照点planTaskId,查询出所有点并按照orderNo排序,判断上一个点的执行情况
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
if
(
list
.
get
(
i
).
getPointId
().
longValue
()
==
pointId
)
{
if
(!
PlanTaskDetailStatusEnum
.
NOTSTARTED
.
getValue
().
equals
(
list
.
get
(
i
).
getIsFinish
()))
{
return
CommonResponseUtil
.
failure
(
"任务已结束!"
);
}
if
(
TaskIsOrderEnum
.
ISORDER
.
getValue
().
equals
(
list
.
get
(
0
).
getInOrder
()))
{
if
(
i
>
0
&&
PlanTaskDetailStatusEnum
.
NOTSTARTED
.
getValue
().
equals
(
list
.
get
(
i
-
1
).
getIsFinish
()))
{
return
CommonResponseUtil
.
failure
(
"请按顺序执行!"
);
}
}
}
}
}
Map
taskDetail
=
planTaskService
.
findPlanTaskByTaskIdAndPointId
(
planTaskId
,
pointId
);
taskDetail
.
put
(
"shotMaxNumber"
,
point
.
getShotMaxNumber
());
taskDetail
.
put
(
"shotMinNumber"
,
point
.
getShotMinNumber
());
response
.
put
(
"planTask"
,
taskDetail
);
Long
routeId
=
Long
.
valueOf
(
taskDetail
.
get
(
"routeId"
).
toString
());
List
<
PointInputItemVo
>
inputItems
=
routeService
.
listRoutePointInputItem
(
routeId
,
pointId
);
List
<
Map
<
String
,
Object
>>
pointClassify
=
pointService
.
queryPointClassifyByRouteIdAndPointId
(
routeId
,
pointId
);
pointClassify
.
removeAll
(
Collections
.
singleton
(
null
));
response
.
put
(
"class"
,
pointClassify
);
response
.
put
(
"checkItem"
,
pointService
.
getClassifyRiskDescMap
(
inputItems
));
log
.
info
(
JSONObject
.
toJSONString
(
response
));
return
CommonResponseUtil
.
success
(
response
);
}
else
{
Point
point
=
pointService
.
queryPointById
(
pointId
);
JSONObject
inputItems
=
pointService
.
getClassifyRiskDescMap
(
pointId
);
response
.
put
(
"checkItem"
,
inputItems
);
List
<
PointClassify
>
catalogs
=
pointService
.
queryPointClassify
(
pointId
);
response
.
put
(
"class"
,
catalogs
);
response
.
put
(
"point"
,
point
);
log
.
info
(
JSONObject
.
toJSONString
(
response
));
return
CommonResponseUtil
.
success
(
response
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"请求异常"
,
e
);
return
CommonResponseUtil
.
failure
(
e
.
getMessage
());
}
}
/**
* 查询任务点详情
*
...
...
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 @
2f4da6d3
...
...
@@ -1001,6 +1001,108 @@ public class CheckServiceImpl implements ICheckService {
}
@Override
public
AppPointCheckRespone
queryCheckPointDetailInVersion2New
(
long
checkId
)
{
List
<
PointCheckDetailBo
>
list
=
checkMapper
.
findCheckPointInputItem
(
checkId
);
AppPointCheckRespone
pointCheckRespone
=
new
AppPointCheckRespone
();
if
(!
list
.
isEmpty
())
{
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
(
action
.
getPhotoData
());
});
Check
check
=
checkDao
.
findById
(
checkId
).
get
();
pointCheckRespone
.
setPointId
(
pointCheckDetailBo
.
getPointId
());
pointCheckRespone
.
setPointName
(
pointCheckDetailBo
.
getPointName
());
pointCheckRespone
.
setPointNo
(
pointCheckDetailBo
.
getPointNo
());
pointCheckRespone
.
setPointStatus
(
pointCheckDetailBo
.
getPointStatus
());
pointCheckRespone
.
setPlanName
(
pointCheckDetailBo
.
getPlanName
());
pointCheckRespone
.
setRemark
(
pointCheckDetailBo
.
getCheckRemark
());
pointCheckRespone
.
setCheckTime
(
pointCheckDetailBo
.
getCheckTime
());
pointCheckRespone
.
setStrCheckTime
(
DateUtil
.
getLongDate
(
pointCheckDetailBo
.
getCheckTime
()));
pointCheckRespone
.
setCheckId
(
pointCheckDetailBo
.
getCheckId
());
pointCheckRespone
.
setPointImgUrls
(
pointImgUrls
);
pointCheckRespone
.
setScore
(
check
.
getScore
()
+
""
);
pointCheckRespone
.
setUsername
(
pointCheckDetailBo
.
getUsername
());
pointCheckRespone
.
setDepartmentName
(
pointCheckDetailBo
.
getDepartmentName
());
JSONObject
appResponeMap
=
new
JSONObject
();
list
.
forEach
(
action
->
{
List
<
String
>
pointInputImgUrls
=
new
ArrayList
<>();
List
<
CheckShot
>
pointInputShot
=
checkShotDao
.
findAllByCheckIdAndCheckInputIdAndClassifyId
(
pointCheckDetailBo
.
getCheckId
(),
action
.
getCheckInputId
(),
action
.
getClassifyId
());
pointInputShot
.
forEach
(
inputShot
->
{
pointInputImgUrls
.
add
(
inputShot
.
getPhotoData
());
});
AppCheckInputRespone
appCheckInputRespone
=
new
AppCheckInputRespone
();
appCheckInputRespone
.
setCheckInputId
(
action
.
getCheckInputId
());
appCheckInputRespone
.
setInputName
(
action
.
getInputName
());
appCheckInputRespone
.
setInputStatus
(
action
.
getInputStatus
());
appCheckInputRespone
.
setRiskDesc
(
action
.
getRiskDesc
());
appCheckInputRespone
.
setInputValue
(
action
.
getInputValue
());
appCheckInputRespone
.
setItemType
(
action
.
getItemType
());
appCheckInputRespone
.
setDataJson
(
action
.
getDataJson
());
appCheckInputRespone
.
setIsMust
(
action
.
getIsMust
());
appCheckInputRespone
.
setIsMultiline
(
action
.
getIsMultiline
());
appCheckInputRespone
.
setPictureJson
(
action
.
getPictureJson
());
appCheckInputRespone
.
setOrderNo
(
action
.
getOrderNo
());
appCheckInputRespone
.
setPointInputImgUrls
(
pointInputImgUrls
);
appCheckInputRespone
.
setClassifyId
(
action
.
getClassifyId
());
appCheckInputRespone
.
setClassifyName
(
action
.
getClassifyName
());
appCheckInputRespone
.
setRemark
(
action
.
getRemark
());
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
);
});
pointCheckRespone
.
setAppCheckInput
(
appResponeMap
);
return
pointCheckRespone
;
}
return
pointCheckRespone
;
}
@Override
public
Map
<
String
,
Object
>
queryRecordByPointId
(
HashMap
<
String
,
Object
>
req
)
{
// if (!ObjectUtils.isEmpty(req.get("userId"))) {
...
...
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 @
2f4da6d3
...
...
@@ -1476,6 +1476,91 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
return
pointCheckRespone
;
}
@Override
public
AppPointCheckRespone
queryPointPlanTaskDetailInVersion2New
(
Long
planTaskId
,
Long
pointId
)
{
AppPointCheckRespone
pointCheckRespone
=
new
AppPointCheckRespone
();
Check
check
=
checkDao
.
findByPlanTaskIdAndPointId
(
planTaskId
,
pointId
);
if
(
check
!=
null
)
{
pointCheckRespone
=
checkService
.
queryCheckPointDetailInVersion2New
(
check
.
getId
());
}
else
{
PointCheckDetailBo
planPointInfo
=
planTaskMapper
.
getPointPlanTaskInfo
(
planTaskId
,
pointId
);
if
(
planPointInfo
!=
null
)
{
pointCheckRespone
.
setPointId
(
pointId
);
pointCheckRespone
.
setPointName
(
planPointInfo
.
getPointName
());
pointCheckRespone
.
setPointNo
(
planPointInfo
.
getPointNo
());
pointCheckRespone
.
setPointStatus
(
"0"
);
pointCheckRespone
.
setPlanName
(
planPointInfo
.
getPlanName
());
List
<
PointCheckDetailBo
>
pointInputs
=
planTaskMapper
.
getPointInputByRouteIdAndPointId
(
planPointInfo
.
getRouteId
(),
planPointInfo
.
getPointId
());
JSONObject
appResponeMap
=
new
JSONObject
();
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
.
setItemType
(
action
.
getItemType
());
input
.
setOrderNo
(
action
.
getOrderNo
());
input
.
setPictureJson
(
action
.
getPictureJson
());
input
.
setClassifyId
(
action
.
getClassifyId
());
input
.
setClassifyName
(
action
.
getClassifyName
());
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
(
action
);
classifyJson
.
put
(
riskDesc
,
riskDescArr
);
appResponeMap
.
put
(
classifyName
,
classifyJson
);
});
pointCheckRespone
.
setAppCheckInput
(
appResponeMap
);
}
else
{
return
null
;
}
}
return
pointCheckRespone
;
}
@Override
public
String
getCumulativePlanCountByOrgCode
(
String
loginOrgCode
)
{
return
planTaskMapper
.
getCumulativePlanCountByOrgCode
(
loginOrgCode
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/RouteServiceImpl.java
View file @
2f4da6d3
...
...
@@ -645,10 +645,12 @@ public class RouteServiceImpl implements IRouteService {
public
List
<
HashMap
<
String
,
Object
>>
queryRouteListByOrgCode
(
String
orgCode
,
String
userId
,
String
deptId
)
{
return
routeMapper
.
queryRouteListByOrgCode
(
orgCode
,
userId
,
deptId
);
}
@Override
public
List
<
HashMap
<
String
,
Object
>>
queryRouteListByOrgCodeNew
(
String
orgCode
,
String
userId
)
{
return
routeMapper
.
queryRouteListByOrgCodeNew
(
orgCode
,
userId
);
}
@Override
public
void
exchangeRoutePointOrderNumber
(
long
src
,
long
target
)
{
List
<
Long
>
ids
=
new
ArrayList
<>();
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/intfc/ICheckService.java
View file @
2f4da6d3
...
...
@@ -74,6 +74,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
queryCheckPointDetailInVersion2New
(
long
checkId
);
/**
* 巡检统计
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/intfc/IPlanTaskService.java
View file @
2f4da6d3
...
...
@@ -150,6 +150,10 @@ public interface IPlanTaskService {
AppPointCheckRespone
queryPointPlanTaskDetailInVersion2
(
String
toke
,
String
product
,
String
appKey
,
Long
planTaskId
,
Long
pointId
);
AppPointCheckRespone
queryPointPlanTaskDetailInVersion2New
(
Long
planTaskId
,
Long
pointId
);
Map
<
String
,
Object
>
getPlanTaskStatisticsForApp
(
HashMap
<
String
,
Object
>
params
);
/**
...
...
amos-boot-system-patrol/src/main/resources/db/mapper/dbTemplate_plan_task.xml
View file @
2f4da6d3
...
...
@@ -632,6 +632,7 @@
ppt.begin_time checkTime,
ppl.dept_id checkDepartmentId,
ppt.user_id userId,
ppt.user_name userName,
pptd.`status` pointStatus
FROM
p_plan_task_detail pptd
...
...
@@ -669,7 +670,8 @@
LEFT JOIN p_input_item pii ON pii.id = ppii.input_item_id
WHERE prp.point_id = #{pointId}
AND prp.route_id =#{routeId}
AND NOT FIND_IN_SET(prpi.point_input_item_id,prp.exclude_items)
<!--AND NOT FIND_IN_SET(prpi.point_input_item_id,prp.exclude_items)-->
AND (FIND_IN_SET(prpi.point_input_item_id,prp.exclude_items) is null or FIND_IN_SET(prpi.point_input_item_id,prp.exclude_items)
<![CDATA[<=]]>
0)
ORDER BY
prpi.order_no
...
...
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