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
9a411522
Commit
9a411522
authored
Aug 02, 2022
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
bbfd15d0
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
516 additions
and
68 deletions
+516
-68
CheckController.java
...join/amos/patrol/business/controller/CheckController.java
+78
-0
PlanTaskController.java
...n/amos/patrol/business/controller/PlanTaskController.java
+53
-1
PointController.java
...join/amos/patrol/business/controller/PointController.java
+44
-0
CheckRecordParam.java
.../yeejoin/amos/patrol/business/param/CheckRecordParam.java
+30
-0
CheckServiceImpl.java
...n/amos/patrol/business/service/impl/CheckServiceImpl.java
+262
-33
PlanServiceImpl.java
...in/amos/patrol/business/service/impl/PlanServiceImpl.java
+9
-7
PlanTaskServiceImpl.java
...mos/patrol/business/service/impl/PlanTaskServiceImpl.java
+27
-22
ICheckService.java
...oin/amos/patrol/business/service/intfc/ICheckService.java
+1
-1
dbTemplate_plan_task.xml
...rol/src/main/resources/db/mapper/dbTemplate_plan_task.xml
+2
-2
pointMapper.xml
...ystem-patrol/src/main/resources/db/mapper/pointMapper.xml
+10
-2
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 @
9a411522
...
...
@@ -137,7 +137,85 @@ public class CheckController extends AbstractBaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"保存巡检记录<font color='blue'>手机app</font>"
,
notes
=
"保存巡检记录<font color='blue'>手机app</font>"
)
@RequestMapping
(
value
=
"/saveRecordNew"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
saveCheckRecordNew
(
@ApiParam
(
value
=
"检查信息"
,
required
=
false
)
@RequestBody
(
required
=
true
)
CheckRecordParam
requestParam
)
{
Toke
token
=
new
Toke
();
token
.
setProduct
(
request
.
getHeader
(
"product"
));
token
.
setToke
(
request
.
getHeader
(
"X-Access-Token"
));
token
.
setAppKey
(
request
.
getHeader
(
"appKey"
));
int
statu
=
-
1
;
PlanTask
planTask
=
null
;
if
(
requestParam
.
getPlanTaskId
()!=
null
&&
requestParam
.
getPlanTaskId
()
!=
0
){
planTask
=
planTaskService
.
selectPlanTaskStatus
(
requestParam
.
getPlanTaskId
());
}
AgencyUserModel
user
=
getUserInfo
();
String
userId
=
user
.
getUserId
();
String
realName
=
user
.
getRealName
();
requestParam
.
setIsOffline
(
requestParam
.
getIsOffline
()==
null
?
false
:
requestParam
.
getIsOffline
());
try
{
if
(
planTask
!=
null
)
{
if
(!
ToolUtils
.
transBeanList
(
planTask
.
getUserId
()).
contains
(
userId
.
toString
()))
{
return
CommonResponseUtil
.
failure
(
"无权执行该任务"
);
}
statu
=
planTask
.
getFinishStatus
();
if
(!
requestParam
.
getIsOffline
()
&&
statu
==
PlanTaskFinishStatusEnum
.
OVERTIME
.
getValue
())
{
return
CommonResponseUtil
.
failure
(
"任务已超时,上传失败!"
);
}
else
if
(
statu
==
PlanTaskFinishStatusEnum
.
FINISHED
.
getValue
()){
return
CommonResponseUtil
.
failure
(
"任务已完成!"
);
}
Date
checkTime
=
requestParam
.
getIsOffline
()?
DateUtil
.
getLongDate
(
requestParam
.
getCheckTime
()):
new
Date
();
Date
beginTime
=
DateUtil
.
getLongDate
(
planTask
.
getBeginTime
());
Date
endTime
=
DateUtil
.
getLongDate
(
planTask
.
getEndTime
());
int
beginCompareTo
=
checkTime
.
compareTo
(
beginTime
);
int
endCompareTo
=
checkTime
.
compareTo
(
endTime
);
if
(
beginCompareTo
==
-
1
||
endCompareTo
==
1
){
return
CommonResponseUtil
.
failure
(
"请在计划时间内完成任务!"
);
}
}
int
count
=
checkService
.
checkHasRecord
(
requestParam
);
if
(
count
<
1
||
requestParam
.
getPlanTaskId
()
<
1
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
// String orgCode = getOrgCode(reginParams);
String
orgCode
=
reginParams
.
getPersonIdentity
().
getBizOrgCode
();
// String departmentId = getDepartmentId(reginParams);
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
requestParam
.
setOrgCode
(
orgCode
);
requestParam
.
setUserId
(
getUserId
());
requestParam
.
setCheckDepartmentId
(
personIdentity
.
getCompanyId
());
requestParam
.
setUserName
(
personIdentity
.
getPersonName
());
requestParam
.
setDepId
(
personIdentity
.
getCompanyId
());
requestParam
.
setDepName
(
personIdentity
.
getCompanyName
());
CheckDto
checkDto
=
checkService
.
saveCheckRecordNew
(
requestParam
,
token
);
if
(
StringUtil
.
isNotEmpty
(
checkDto
)){
asyncTaskf
(
checkDto
.
getCheckId
());
}
is
.
pointCheckInfoPushToB
(
checkDto
.
getCheckId
());
//数字换流站页面刷新
try
{
webMqttComponent
.
publish
(
patrolTopic
,
""
);
}
catch
(
Exception
e
){
log
.
error
(
"数字换流站页面推送失败-----------"
+
e
.
getMessage
());
}
return
CommonResponseUtil
.
success
(
checkDto
);
}
else
{
return
CommonResponseUtil
.
success
(
"无需重新巡检"
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
// TODO Auto-generated catch block
log
.
error
(
e
.
getMessage
());
return
CommonResponseUtil
.
failure
(
"数据提交失败"
);
}
}
...
...
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 @
9a411522
...
...
@@ -39,6 +39,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import
javax.servlet.http.HttpServletResponse
;
import
javax.ws.rs.GET
;
import
javax.ws.rs.POST
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
...
...
@@ -89,6 +90,57 @@ public class PlanTaskController extends AbstractBaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"根据用户条件查询所有计划任务(<font color='blue'>手机app</font>)"
,
notes
=
"根据用户条件查询所有计划任务(<font color='blue'>手机app</font>)"
)
@RequestMapping
(
value
=
"/queryPlanTaskNew"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
qryLoginUserPlanTaskNew
(
@ApiParam
(
value
=
"查询条件"
)
@RequestBody
(
required
=
false
)
List
<
CommonRequest
>
queryRequests
,
@ApiParam
(
value
=
"分页参数"
,
defaultValue
=
"current=0&pageSize=10或pageNumber0&pageSize=10"
)
CommonPageable
pageable
)
{
HashMap
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
ReginParams
reginParams
=
getSelectedOrgInfo
();
PlanTaskPageParamUtil
.
fillPlanTask
(
queryRequests
,
params
);
params
.
put
(
"orgCode"
,
reginParams
.
getPersonIdentity
().
getCompanyBizOrgCode
());
params
.
put
(
"pageSize"
,
pageable
.
getPageSize
());
params
.
put
(
"offset"
,
pageable
.
getPageNumber
()
*
pageable
.
getPageSize
());
if
(
ObjectUtils
.
isEmpty
(
params
.
get
(
"orderBy"
)))
{
params
.
put
(
"orderBy"
,
"beginTime desc"
);
}
if
(
params
.
get
(
"orderBy"
).
toString
().
contains
(
"taskPlanNum"
))
{
params
.
put
(
"orderBy"
,
params
.
get
(
"orderBy"
)
+
",beginTime asc"
);
}
try
{
Page
<
Map
<
String
,
Object
>>
page
=
planTaskService
.
getPlanTasks
(
getToken
(),
getProduct
(),
getAppKey
(),
params
);
return
CommonResponseUtil
.
success
(
page
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
CommonResponseUtil
.
failure
(
e
.
getMessage
());
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"计划执行重做"
,
notes
=
"计划执行重做"
)
@RequestMapping
(
value
=
"/regenPlanTaskNew"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
planTaskReGenNew
(
...
...
@@ -175,7 +227,7 @@ public class PlanTaskController extends AbstractBaseController {
@ApiOperation
(
value
=
"执行计划导出"
,
notes
=
"执行计划导出"
)
@GetMapping
(
value
=
"/reportPlanTaskNew"
,
produces
=
"application/vnd.ms-excel;charset=UTF-8"
)
public
void
planTaskReportNew
(
@ApiParam
(
value
=
"导出参数"
,
required
=
false
)
@Request
Param
(
required
=
false
)
PlanTaskPageParam
params
,
@ApiParam
(
value
=
"导出参数"
,
required
=
false
)
@Request
Body
(
required
=
false
)
PlanTaskPageParam
params
,
HttpServletResponse
response
)
{
try
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/controller/PointController.java
View file @
9a411522
...
...
@@ -566,6 +566,50 @@ public class PointController extends AbstractBaseController {
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"查询巡检点信息(<font color='blue'>手机app</font>)"
,
notes
=
"查询巡检点信息(<font color='blue'>手机app</font>)"
)
@PostMapping
(
value
=
"/queryPointByPageNew"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
queryPointByPageNew
(
@ApiParam
(
value
=
"查询条件"
,
required
=
false
)
@RequestBody
(
required
=
false
)
List
<
CommonRequest
>
queryRequests
,
@ApiParam
(
value
=
"分页参数"
,
required
=
true
,
defaultValue
=
"pageNumber=0&pageSize=10"
)
CommonPageable
commonPageable
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
reginParams
.
getPersonIdentity
().
getCompanyBizOrgCode
();
if
(
ObjectUtils
.
isEmpty
(
reginParams
))
{
return
CommonResponseUtil
.
failure
(
"用户session过期"
);
}
try
{
CommonRequest
commonRequest
=
new
CommonRequest
();
commonRequest
.
setName
(
"orgCode"
);
commonRequest
.
setValue
(
orgCode
);
queryRequests
.
add
(
commonRequest
);
HashMap
<
String
,
Object
>
param
=
PointParamUtils
.
fillTaskInfo
(
queryRequests
);
Page
<
PointVo
>
pointList
=
iPointService
.
queryPointByPage
(
param
,
commonPageable
);
return
CommonResponseUtil
.
success
(
pointList
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
CommonResponseUtil
.
failure
(
"查询巡检点信息失败"
);
}
}
/**
* 更新巡检点
*
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/param/CheckRecordParam.java
View file @
9a411522
...
...
@@ -12,6 +12,36 @@ public class CheckRecordParam {
private
String
orgCode
;
private
String
checkDepartmentId
;
private
List
<
String
>
checkRecordImg
;
private
String
userName
;
private
String
depId
;
private
String
depName
;
public
String
getUserName
()
{
return
userName
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
public
String
getDepId
()
{
return
depId
;
}
public
void
setDepId
(
String
depId
)
{
this
.
depId
=
depId
;
}
public
String
getDepName
()
{
return
depName
;
}
public
void
setDepName
(
String
depName
)
{
this
.
depName
=
depName
;
}
/**
* 检查项分类
*/
...
...
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 @
9a411522
...
...
@@ -355,18 +355,8 @@ public class CheckServiceImpl implements ICheckService {
}
else
{
check
.
setScore
(
Integer
.
parseInt
(
XJConstant
.
POINT_NOT_SCORE
));
}
// check = checkDao.save(check);
try
{
check
=
checkDao
.
save
(
check
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
check
=
checkDao
.
save
(
check
);
List
<
CheckShot
>
imgList
=
new
ArrayList
<>();
for
(
CheckInput
item
:
checkItemList
)
{
item
.
setCheckId
(
check
.
getId
());
//检查点图片保存 checkInputId
...
...
@@ -429,36 +419,275 @@ public class CheckServiceImpl implements ICheckService {
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
planTaskMapper
.
reformStatistics
(
user
.
getUserId
(),
sdf
.
format
(
new
Date
()),
requestParam
.
getOrgCode
());
}
// 任务完成、同步修改待办任务状态
Plan
plan
=
planService
.
queryPlanById
(
check
.
getPlanId
());
if
(!
ObjectUtils
.
isEmpty
(
plan
)
&&
plan
.
getIsSingleExecution
()){
// 单人执行
updateTaskStatus
(
plan
.
getId
(),
user
.
getUserId
());
}
else
{
// 多人执行
updateTaskStatus
(
plan
.
getId
(),
null
);
}
if
(
check
.
getPlanId
()!=
0
){
// 任务完成、同步修改待办任务状态
Plan
plan
=
planService
.
queryPlanById
(
check
.
getPlanId
());
if
(!
ObjectUtils
.
isEmpty
(
plan
)
&&
plan
.
getIsSingleExecution
()){
// 单人执行
updateTaskStatus
(
plan
.
getId
(),
user
.
getUserId
());
}
else
{
// 多人执行
updateTaskStatus
(
plan
.
getId
(),
null
);
}
}
return
new
CheckDto
(
check
.
getId
(),
unqualifiedcheckItemList
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
null
;
}
}
private
void
updateTaskStatus
(
Long
id
,
String
userId
){
try
{
MessageModel
model
=
new
MessageModel
();
model
.
setRelationId
(
String
.
valueOf
(
id
));
model
.
setIsRead
(
true
);
model
.
setMsgType
(
"patrolSystem"
);
if
(!
ObjectUtils
.
isEmpty
(
userId
)){
model
.
setUserId
(
userId
);
}
FeignClientResult
<
MessageModel
>
update
=
Systemctl
.
messageClient
.
update
(
model
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
@Override
@Transactional
public
CheckDto
saveCheckRecordNew
(
CheckRecordParam
requestParam
,
Toke
token
)
{
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
)
&&
!
ObjectUtils
.
isEmpty
(
requestParam
.
getPlanTaskId
())
&&
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
();
routeParam
.
put
(
"routeId"
,
planTask
.
getRouteId
());
routeParam
.
put
(
"pointId"
,
requestParam
.
getPointId
());
if
(
ObjectUtils
.
isEmpty
(
check
))
{
check
=
new
Check
();
}
check
.
setPlanTaskDetailId
(
Long
.
parseLong
(
detail
.
get
(
"planTaskDetailId"
).
toString
()));
check
.
setRouteId
(
Long
.
parseLong
(
detail
.
get
(
"routeId"
).
toString
()));
check
.
setRouteName
(
detail
.
get
(
"routeName"
).
toString
());
check
.
setPlanTaskId
(
requestParam
.
getPlanTaskId
());
check
.
setPlanId
(
planTask
.
getPlanId
());
check
.
setPlanName
(
detail
.
get
(
"planName"
).
toString
());
check
.
setPointName
(
detail
.
get
(
"pointName"
).
toString
());
requestParam
.
setPointName
(
detail
.
get
(
"pointName"
).
toString
());
}
}
else
{
taskDetail
=
new
PlanTaskDetail
();
planTask
=
new
PlanTask
();
check
.
setPlanTaskDetailId
(
0
);
check
.
setRouteId
(
0
);
check
.
setPlanTaskId
(
0
);
check
.
setPlanId
(
0
);
}
check
.
setPointId
(
requestParam
.
getPointId
());
if
(
ObjectUtils
.
isEmpty
(
requestParam
.
getPointName
()))
{
check
.
setPointName
(
point
==
null
?
""
:
point
.
getName
());
}
check
.
setRemark
(
requestParam
.
getRemark
());
check
.
setCheckTime
(
DateUtil
.
getLongDate
(
requestParam
.
getCheckTime
()));
check
.
setUploadTime
(
new
Date
());
check
.
setOrgCode
(
requestParam
.
getOrgCode
());
check
.
setUserId
(
requestParam
.
getUserId
());
check
.
setUserName
(
requestParam
.
getUserName
());
check
.
setDepId
(
requestParam
.
getDepId
());
check
.
setDepName
(
requestParam
.
getDepName
());
check
.
setCheckMode
(
requestParam
.
getCheckMode
());
List
<
CheckInputParam
>
list
=
requestParam
.
getCheckItems
();
List
<
CheckInput
>
checkItemList
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
unqualifiedcheckItemList
=
Lists
.
newArrayList
();
String
error
=
""
;
HashMap
<
String
,
String
>
errorClassifyNames
=
new
HashMap
<>();
List
<
EquipmentInputItemRo
>
equipmentInputItemRoList
=
new
ArrayList
<>();
int
score
=
0
;
for
(
CheckInputParam
item
:
list
)
{
String
pointClassifyName
=
null
;
PointClassify
pointClassify
=
null
;
if
(
StringUtil
.
isNotEmpty
(
item
.
getClassifyIds
())
&&
iPointClassifyDao
.
existsById
(
item
.
getClassifyIds
()))
{
pointClassify
=
iPointClassifyDao
.
findById
(
item
.
getClassifyIds
()).
get
();
pointClassifyName
=
pointClassify
.
getName
();
}
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
()
+
""
));
checkInput
.
setInputName
(
inputItem
.
getName
());
checkInput
.
setOrderNo
(
inputItem
.
getOrderNo
());
checkInput
.
setRemark
(
item
.
getRemark
());
//1.校验结果
if
(
XJConstant
.
INPUT_ITEM_SELECT
.
equals
(
inputItem
.
getItemType
()))
{
checkInput
=
paraseSelect
(
checkInput
,
inputItem
.
getDataJson
(),
item
,
inputItem
.
getIsScore
());
}
else
if
(
XJConstant
.
INPUT_ITEM_NUMBER
.
equals
(
inputItem
.
getItemType
()))
{
checkInput
=
paraseNumber
(
checkInput
,
inputItem
.
getDataJson
(),
item
,
inputItem
.
getIsScore
());
}
else
if
(
XJConstant
.
INPUT_ITEM_TEXT
.
equals
(
inputItem
.
getItemType
()))
{
checkInput
=
paraseText
(
checkInput
,
inputItem
.
getDataJson
(),
item
,
inputItem
.
getIsScore
());
}
if
(
XJConstant
.
NO
.
equals
(
checkInput
.
getIsOk
()))
{
String
classifyName
=
pointClassifyName
!=
null
?
pointClassifyName
+
"-"
:
""
;
error
+=
(
classifyName
+
inputItem
.
getName
()
+
"="
+
(
ObjectUtils
.
isEmpty
(
item
.
getInputValue
())
?
""
:
item
.
getInputValue
())
+
";"
);
errorClassifyNames
.
put
(
pointClassifyName
!=
null
?
pointClassifyName
:
""
,
""
);
checkInput
.
setIsOk
(
CheckStatusEnum
.
UNQUALIFIED
.
getCode
());
Map
<
String
,
Object
>
unCheckMap
=
Maps
.
newHashMap
();
unCheckMap
.
put
(
"itemId"
,
item
.
getInputItemId
());
unCheckMap
.
put
(
"routeId"
,
check
.
getRouteId
());
unCheckMap
.
put
(
"pointId"
,
requestParam
.
getPointId
());
unCheckMap
.
put
(
"name"
,
inputItem
.
getName
());
unCheckMap
.
put
(
"inputValue"
,
item
.
getInputValue
());
unqualifiedcheckItemList
.
add
(
unCheckMap
);
}
else
{
checkInput
.
setIsOk
(
CheckStatusEnum
.
QUALIFIED
.
getCode
());
}
checkInput
.
setRoutePointItemId
(
item
.
getRoutePointItemId
());
checkInput
.
setInputValue
(
item
.
getInputValue
());
checkInput
.
setPointClassifyId
(
item
.
getClassifyIds
());
checkInput
.
setPointClassifyName
(
pointClassifyName
);
score
+=
checkInput
.
getScore
();
checkItemList
.
add
(
checkInput
);
EquipmentInputItemRo
equipmentInputItemRo
=
new
EquipmentInputItemRo
();
if
(!
StringUtils
.
isBlank
(
pointClassify
.
getName
()))
{
equipmentInputItemRo
.
setEquipmentName
(
pointClassify
.
getName
());
}
equipmentInputItemRo
.
setCheckResult
(
item
.
getInputValue
());
equipmentInputItemRo
.
setRuleType
(
RuleTypeEnum
.
CHECKRESULT
.
getCode
());
equipmentInputItemRo
.
setCheckContent
(
inputItem
.
getItemNo
());
if
(!
StringUtils
.
isBlank
(
pointClassify
.
getEquipmentId
()))
{
equipmentInputItemRoList
.
add
(
equipmentInputItemRo
);
}
}
if
(!
ObjectUtils
.
isEmpty
(
error
)
&&
error
.
endsWith
(
";"
))
{
error
.
substring
(
0
,
error
.
length
()
-
1
);
check
.
setIsOk
(
CheckStatusEnum
.
UNQUALIFIED
.
getCode
());
}
else
{
check
.
setIsOk
(
CheckStatusEnum
.
QUALIFIED
.
getCode
());
}
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
));
}
// check = checkDao.save(check);
try
{
check
=
checkDao
.
save
(
check
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
List
<
CheckShot
>
imgList
=
new
ArrayList
<>();
for
(
CheckInput
item
:
checkItemList
)
{
item
.
setCheckId
(
check
.
getId
());
//检查点图片保存 checkInputId
Check
finalCheck
=
check
;
list
.
forEach
(
x
->
{
if
(
x
.
getInputItemId
()
==
item
.
getInputId
()
&&
(
x
.
getClassifyIds
()
==
item
.
getPointClassifyId
()
||
x
.
getClassifyIds
()
==
null
))
{
if
(
x
.
getCheckInputImg
()
!=
null
&&
x
.
getCheckInputImg
().
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
x
.
getCheckInputImg
().
size
();
i
++)
{
CheckShot
img
=
new
CheckShot
();
img
.
setCheckId
(
finalCheck
.
getId
());
img
.
setOrgCode
(
finalCheck
.
getOrgCode
());
img
.
setCreateDate
(
new
Date
());
img
.
setPointName
(
finalCheck
.
getPointName
());
img
.
setShotType
(
"1"
.
equals
(
point
.
getIsFixed
())
?
"定点"
:
"普通"
);
img
.
setPhotoData
(
x
.
getCheckInputImg
().
get
(
i
));
img
.
setCheckInputId
(
x
.
getInputItemId
());
if
(
item
.
getPointClassifyId
()
==
null
)
{
img
.
setClassifyId
(
0
);
}
else
{
img
.
setClassifyId
(
item
.
getPointClassifyId
());
}
imgList
.
add
(
img
);
}
}
}
});
}
//现场图片保存
if
(
requestParam
.
getCheckRecordImg
()
!=
null
&&
requestParam
.
getCheckRecordImg
().
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
requestParam
.
getCheckRecordImg
().
size
();
i
++)
{
CheckShot
img
=
new
CheckShot
();
img
.
setCheckId
(
check
.
getId
());
img
.
setOrgCode
(
check
.
getOrgCode
());
img
.
setCreateDate
(
new
Date
());
img
.
setPointName
(
check
.
getPointName
());
img
.
setCheckInputId
(
0
);
img
.
setShotType
(
"1"
.
equals
(
point
.
getIsFixed
())
?
"定点"
:
"普通"
);
img
.
setPhotoData
(
requestParam
.
getCheckRecordImg
().
get
(
i
));
img
.
setClassifyId
(
0
);
imgList
.
add
(
img
);
}
}
List
<
CheckInput
>
checkInputList
=
checkInputDao
.
saveAll
(
checkItemList
);
//规则请求结果
checkInputList
.
forEach
(
checkInput
->
{
InputItem
inputItem
=
inputItemDao
.
findById
(
checkInput
.
getInputId
()).
get
();
for
(
int
i
=
0
;
i
<
equipmentInputItemRoList
.
size
();
i
++)
{
if
(
inputItem
.
getItemNo
().
equals
(
equipmentInputItemRoList
.
get
(
i
).
getCheckContent
()))
{
equipmentInputItemRoList
.
get
(
i
).
setCheckInputId
(
Long
.
valueOf
(
checkInput
.
getId
()).
toString
());
}
}
});
equipmentHandlerService
.
getRulesCheckResult
(
equipmentInputItemRoList
,
token
);
if
(
imgList
.
size
()
>
0
)
{
checkService
.
saveCheckImg
(
imgList
);
}
if
(
check
.
getPlanTaskId
()
>
0
)
{
planTaskDetailMapper
.
finishTaskDetail
(
Long
.
parseLong
(
detail
.
get
(
"planTaskDetailId"
).
toString
()),
requestParam
.
getPointId
(),
requestParam
.
getPlanTaskId
(),
requestParam
.
getUserId
());
}
else
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
planTaskMapper
.
reformStatistics
(
requestParam
.
getUserId
(),
sdf
.
format
(
new
Date
()),
requestParam
.
getOrgCode
());
}
if
(
check
.
getPlanId
()!=
0
)
{
// 任务完成、同步修改待办任务状态
Plan
plan
=
planService
.
queryPlanById
(
check
.
getPlanId
());
if
(!
ObjectUtils
.
isEmpty
(
plan
)
&&
plan
.
getIsSingleExecution
())
{
// 单人执行
updateTaskStatus
(
plan
.
getId
(),
requestParam
.
getUserId
());
}
else
{
// 多人执行
updateTaskStatus
(
plan
.
getId
(),
null
);
}
}
CheckDto
checkDto
=
new
CheckDto
(
check
.
getId
(),
unqualifiedcheckItemList
);
return
checkDto
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
null
;
}
}
private
void
updateTaskStatus
(
Long
id
,
String
userId
)
{
try
{
MessageModel
model
=
new
MessageModel
();
model
.
setRelationId
(
String
.
valueOf
(
id
));
model
.
setIsRead
(
true
);
model
.
setMsgType
(
"patrolSystem"
);
if
(!
ObjectUtils
.
isEmpty
(
userId
))
{
model
.
setUserId
(
userId
);
}
FeignClientResult
<
MessageModel
>
update
=
Systemctl
.
messageClient
.
update
(
model
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
@Override
public
void
delCheckById
(
List
<
Long
>
list
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/PlanServiceImpl.java
View file @
9a411522
package
com
.
yeejoin
.
amos
.
patrol
.
business
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.*
;
import
com.yeejoin.amos.patrol.core.util.StringUtil
;
import
org.slf4j.Logger
;
...
...
@@ -144,8 +140,14 @@ public class PlanServiceImpl implements IPlanService {
@Override
public
Plan
queryPlanById
(
Long
id
)
{
Plan
plan
=
planDao
.
findById
(
id
).
get
();
return
plan
;
Optional
<
Plan
>
plan
=
planDao
.
findById
(
id
);
if
(
Optional
.
ofNullable
(
plan
).
isPresent
()){
return
null
;
}
else
{
return
plan
.
get
();
}
}
@Override
...
...
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 @
9a411522
...
...
@@ -1146,30 +1146,35 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
return
new
PageImpl
<>(
content
,
pageParam
,
total
);
}
content
=
planTaskMapper
.
getPlanTasks
(
params
);
if
(!
CollectionUtils
.
isEmpty
(
content
))
{
Set
<
String
>
userIds
=
Sets
.
newHashSet
();
content
.
forEach
(
e
->
{
String
userId
=
e
.
get
(
"userId"
).
toString
();
if
(
StringUtil
.
isNotEmpty
(
userId
))
{
userIds
.
add
(
userId
);
}
});
List
<
AgencyUserModel
>
userModelList
=
remoteSecurityService
.
listUserByUserIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
userIds
));
Map
<
String
,
String
>
userModelMap
=
userModelList
.
stream
().
collect
(
Collectors
.
toMap
(
AgencyUserModel:
:
getUserId
,
AgencyUserModel:
:
getRealName
,
(
k1
,
k2
)
->
k2
));
List
<
String
>
userNames
=
new
ArrayList
<>();
// Set<String> userIds = Sets.newHashSet();
// content.forEach(e -> {
// String userId = e.get("userId").toString();
// if (StringUtil.isNotEmpty(userId)) {
// userIds.add(userId);
// }
// });
// List<AgencyUserModel> userModelList = remoteSecurityService.listUserByUserIds(toke, product, appKey, Joiner.on(",").join(userIds));
// Map<String, String> userModelMap = userModelList.stream().collect(Collectors.toMap(AgencyUserModel::getUserId, AgencyUserModel::getRealName, (k1, k2) -> k2));
// List<String> userNames = new ArrayList<>();
// content.forEach(e -> {
// userNames.clear();
// String[] userIds1 = e.get("userId").toString().split(",");
// for (String userId : userIds1) {
// if (!ObjectUtils.isEmpty(userModelMap.get(userId))) {
// userNames.add(userModelMap.get(userId));
// }
// }
// if (userNames.size() > 0) {
// e.put("executiveName", Joiner.on(",").join(userNames));
// } else {
// e.put("executiveName", " ");
// }
// });
content
.
forEach
(
e
->
{
userNames
.
clear
();
String
[]
userIds1
=
e
.
get
(
"userId"
).
toString
().
split
(
","
);
for
(
String
userId
:
userIds1
)
{
if
(!
ObjectUtils
.
isEmpty
(
userModelMap
.
get
(
userId
)))
{
userNames
.
add
(
userModelMap
.
get
(
userId
));
}
}
if
(
userNames
.
size
()
>
0
)
{
e
.
put
(
"executiveName"
,
Joiner
.
on
(
","
).
join
(
userNames
));
}
else
{
e
.
put
(
"executiveName"
,
" "
);
}
e
.
put
(
"executiveName"
,
e
.
get
(
"userName"
)
);
});
return
new
PageImpl
<>(
content
,
pageParam
,
total
);
}
...
...
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 @
9a411522
...
...
@@ -45,7 +45,7 @@ public interface ICheckService {
void
saveCheckImg
(
List
<
CheckShot
>
imgList
);
CheckDto
saveCheckRecord
(
CheckRecordParam
requestParam
,
AgencyUserModel
user
,
DepartmentBo
departmentModel
,
Toke
token
);
CheckDto
saveCheckRecordNew
(
CheckRecordParam
requestParam
,
Toke
token
);
/**
* 巡检记录删除
*
...
...
amos-boot-system-patrol/src/main/resources/db/mapper/dbTemplate_plan_task.xml
View file @
9a411522
...
...
@@ -303,9 +303,9 @@
<if
test=
"checkDate != null and checkDate != '' "
>
and a.beginTime
<![CDATA[<=]]>
#{checkDate} and a.endTime
<![CDATA[>=]]>
#{checkDate}
</if>
<if
test=
"finishStatus != null"
>
and a.finishStatus = #{finishStatus}
</if>
<if
test=
"orgCode != null and orgCode !=''"
>
and
(a.OrgCode LIKE CONCAT( #{orgCode}, '-%' ) or a.OrgCode= #{orgCode}
)
and
a.OrgCode LIKE CONCAT( #{orgCode}, '%'
)
</if>
<if
test=
"departmentId != null and departmentId != 0 "
>
and a.userDept like concat('%', #{departmentId}, '%')
</if
>
<!-- <if test="departmentId != null and departmentId != 0 ">and a.userDept like concat('%', #{departmentId}, '%')</if>--
>
<if
test=
"startTime != null and startTime != '' and endTime != null and endTime != '' "
>
AND (
(
...
...
amos-boot-system-patrol/src/main/resources/db/mapper/pointMapper.xml
View file @
9a411522
...
...
@@ -200,6 +200,7 @@
'$'
)
</if>
AND p.is_delete = 0
and ( select COUNT(p_point_classify.id) fROM p_point_classify where p_point_classify.point_id =p.id) >0
<if
test=
"name!=null"
>
AND ( p.point_no LIKE CONCAT('%', #{name},'%')
OR p.NAME LIKE CONCAT('%', #{name},'%'))
</if>
<if
test=
"query != null and query != ''"
>
...
...
@@ -229,7 +230,10 @@
</otherwise>
</choose>
</if>
<if
test=
"orgCode!=null "
>
and p.org_Code= #{orgCode}
</if>
<!-- <if test="orgCode!=null "> and p.org_Code= #{orgCode} </if>-->
<if
test=
"orgCode!=null "
>
and p.biz_org_code LIKE CONCAT (#{orgCode} ,'%')
</if>
</where>
</select>
...
...
@@ -253,6 +257,8 @@
'$'
)
</if>
AND p.is_delete = 0
and ( select COUNT(p_point_classify.id) fROM p_point_classify where p_point_classify.point_id =p.id) >0
<if
test=
"name!=null"
>
AND ( p.point_no LIKE CONCAT('%', #{name},'%')
OR p.NAME LIKE CONCAT('%', #{name},'%'))
</if>
<if
test=
"query != null and query != ''"
>
...
...
@@ -308,7 +314,9 @@
) -->
</if>
<if
test=
"orgCode!=null "
>
and p.org_Code= #{orgCode}
</if>
<!-- <if test="orgCode!=null "> and p.org_Code= #{orgCode} </if>-->
<if
test=
"orgCode!=null "
>
and p.biz_org_code LIKE CONCAT (#{orgCode} ,'%')
</if>
</where>
limit #{offset},#{pageSize};
</select>
...
...
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