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
bd038335
Commit
bd038335
authored
Nov 01, 2023
by
litengwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
保存代码优化
parent
cb186ac4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
105 deletions
+7
-105
CheckController.java
...join/amos/patrol/business/controller/CheckController.java
+2
-52
CheckServiceImpl.java
...n/amos/patrol/business/service/impl/CheckServiceImpl.java
+3
-51
ICheckService.java
...oin/amos/patrol/business/service/intfc/ICheckService.java
+1
-1
dbTemplate_plan.xml
...trol-biz/src/main/resources/db/mapper/dbTemplate_plan.xml
+1
-1
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 @
bd038335
...
...
@@ -204,10 +204,6 @@ public class CheckController extends AbstractBaseController {
@RequestMapping
(
value
=
"/saveRecordNew"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
ResponseModel
<
Object
>
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
;
log
.
info
(
"手机app保存巡检记录++++++++++++++++++++++: {}"
,
JSON
.
toJSONString
(
requestParam
));
...
...
@@ -250,58 +246,12 @@ public class CheckController extends AbstractBaseController {
}
}
int
count
=
checkService
.
checkHasRecord
(
requestParam
);
if
(
count
<
1
||
requestParam
.
getPlanTaskId
()
<
1
||
requestParam
.
getIsOffline
()
)
{
if
(
count
<
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.setUserName(personIdentity.getPersonName());
// if (reginParams.getDepartment() != null && reginParams.getDepartment().getSequenceNbr() != null) {
//
// // requestParam.setDepId(reginParams.getDepartment().getSequenceNbr().toString());
// requestParam.setCheckDepartmentId(reginParams.getDepartment().getSequenceNbr().toString());
// }
// if (personIdentity != null) {
// requestParam.setDepId(personIdentity.getCompanyId());
// requestParam.setDepName(personIdentity.getCompanyName());
// }
CheckDto
checkDto
=
checkService
.
saveCheckRecordNew
(
requestParam
,
token
);
// if(StringUtil.isNotEmpty(checkDto)){
//
// RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
// CompletableFuture<Void> getAddressTask = CompletableFuture.runAsync(() -> {
// // 解决异步任务拿不到ThreadLocal里的数据
// RequestContextHolder.setRequestAttributes(requestAttributes);
// // asyncTaskf(checkDto.getCheckId());
// try {
// asyncTask.pushCheckInfoTo3D(checkDto.getCheckId());
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
// Toke toke= remoteSecurityService.getServerToken();
// messageService.pushCheckMessage(toke.getToke(),toke.getProduct(),toke.getAppKey(),checkDto.getCheckId());
// });
//
// }
//
// List<Map<String, Object>> checkInputItems = checkMapper.queryCheckInputItemsByCheckId(checkDto.getCheckId());
// publishDataToMessage(checkInputItems);
// is.pointCheckInfoPushToB(checkDto.getCheckId());
// //数字换流站页面刷新
// try {
// webMqttComponent.publish(patrolTopic, "");
//
// }catch (Exception e){
// log.error("数字换流站页面推送失败-----------"+e.getMessage());
// }
CheckDto
checkDto
=
checkService
.
saveCheckRecordNew
(
requestParam
);
return
ResponseHelper
.
buildResponse
(
checkDto
);
}
else
{
return
ResponseHelperUtil
.
buildErrorResponse
(
"无需重新巡检"
);
...
...
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 @
bd038335
...
...
@@ -463,7 +463,7 @@ public class CheckServiceImpl implements ICheckService {
@Override
@Transactional
public
CheckDto
saveCheckRecordNew
(
CheckRecordParam
requestParam
,
Toke
token
)
{
public
CheckDto
saveCheckRecordNew
(
CheckRecordParam
requestParam
)
{
try
{
PlanTaskDetail
taskDetail
=
null
;
PlanTask
planTask
=
null
;
...
...
@@ -537,7 +537,6 @@ public class CheckServiceImpl implements ICheckService {
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
;
...
...
@@ -585,24 +584,12 @@ public class CheckServiceImpl implements ICheckService {
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 (pointClassify!=null&&!StringUtils.isBlank(pointClassify.getName())) {
// equipmentInputItemRo.setEquipmentName(pointClassify.getName());
// }
// equipmentInputItemRo.setCheckResult(item.getInputValue());
// equipmentInputItemRo.setRuleType(RuleTypeEnum.CHECKRESULT.getCode());
// equipmentInputItemRo.setCheckContent(inputItem.getItemNo());
// if (pointClassify!=null&&!StringUtils.isBlank(pointClassify.getEquipmentId())) {
// equipmentInputItemRoList.add(equipmentInputItemRo);
// }
}
if
(
ObjectUtils
.
isEmpty
(
planTask
.
getRiskStatus
()))
{
planTask
.
setRiskStatus
(
XJConstant
.
NORISK_NUM
);
...
...
@@ -625,7 +612,6 @@ public class CheckServiceImpl implements ICheckService {
}
else
{
check
.
setScore
(
Integer
.
parseInt
(
XJConstant
.
POINT_NOT_SCORE
));
}
// check = checkDao.save(check);
try
{
log
.
error
(
"手机app保存巡检记录++++++++++++++++++++++"
+
check
.
toString
()
+
"<Over><Over><Over><Over>"
);
check
=
checkDao
.
save
(
check
);
...
...
@@ -683,50 +669,16 @@ public class CheckServiceImpl implements ICheckService {
checkInputDao
.
saveAndFlush
(
checkInput
);
checkInputList
.
add
(
checkInput
);
}
//规则请求结果
// 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
());
}
// 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
);
// 巡检站端与中心级数据同步
// Check finalCheck = check;
// TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
// @Override
// public void afterCommit() {
// // 事物提交后业务逻辑
// patrolDataSyncService.checkDataSync(finalCheck);
// patrolDataSyncService.checkInputDataSync(checkInputList);
//
// Map<String, Object> map = new HashMap<>();
// map.put("idList", checkInputList.stream().map(CheckInput::getId).collect(Collectors.toList()));
// List<CheckInputSyncBo> checkInputSyncBoList = checkInputMapper.getCheckInputSyncBoList(map);
// patrolDataSyncService.checkInputBoDataSync(checkInputSyncBoList);
// }
// });
return
checkDto
;
}
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/service/intfc/ICheckService.java
View file @
bd038335
...
...
@@ -36,7 +36,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
);
CheckDto
saveCheckRecordNew
(
CheckRecordParam
requestParam
);
/**
* 巡检记录删除
*
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/resources/db/mapper/dbTemplate_plan.xml
View file @
bd038335
...
...
@@ -112,7 +112,7 @@
else '是'
end
) as isFixedDateName,
IFNULL(a.plan_end,
'') planEnd,a.plan_end
planEnd,a.plan_type planType,
IFNULL(a.plan_end,
NULL)
planEnd,a.plan_type planType,
b.name routeName,a.route_id routeId,a.is_fixed_date isFixedDate,a.remark,a.remark1,
b.dept_name bizOrgCode
FROM
...
...
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