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
cda5ab1d
Commit
cda5ab1d
authored
Apr 16, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.修改设备停用启用为修改业务数据(设备状态)bug
parent
b576a7fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
3 deletions
+51
-3
JgEnableDisableServiceImpl.java
...odule/jg/biz/service/impl/JgEnableDisableServiceImpl.java
+50
-2
ReportAnalysisServiceImpl.java
...module/jg/biz/service/impl/ReportAnalysisServiceImpl.java
+1
-1
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgEnableDisableServiceImpl.java
View file @
cda5ab1d
...
...
@@ -21,8 +21,11 @@ import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgRegisterInfoService
;
import
com.yeejoin.amos.boot.module.jg.flc.api.fegin.WorkFlowFeignService
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgUseInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.RegistrationInfoMapper
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.systemctl.model.TaskV2Model
;
...
...
@@ -90,6 +93,19 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
@Autowired
private
RedissonClient
redissonClient
;
@Autowired
private
IdxBizJgUseInfoMapper
idxBizJgUseInfoMapper
;
/**
* 设备状态:启用
*/
public
static
final
String
APPLY_TYPE_QY
=
"SB_QY"
;
/**
* 设备状态:启用
*/
public
static
final
String
APPLY_TYPE_TY
=
"SB_TY"
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
JgEnableDisable
>
saveOrUpdate
(
JSONObject
map
,
ReginParams
reginParams
)
{
JgEnableDisable
jgEnableDisable
=
new
JgEnableDisable
();
...
...
@@ -230,8 +246,8 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
}
private
String
getRegistrationClass
(
JgEnableDisable
jgEnableDisable
){
//
1启用,0
停用
if
(
"1"
.
equals
(
jgEnableDisable
.
getApplyType
())){
//
SB_QY启用,SB_TY
停用
if
(
APPLY_TYPE_QY
.
equals
(
jgEnableDisable
.
getApplyType
())){
return
BusinessTypeEnum
.
JG_EQUIPMENT_START
.
getName
();
}
else
{
return
BusinessTypeEnum
.
JG_EQUIPMENT_STOP
.
getName
();
...
...
@@ -441,6 +457,8 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
TaskMessageDto
taskMessageDto
=
new
TaskMessageDto
();
BeanUtils
.
copyProperties
(
jgEnableDisable
,
taskMessageDto
);
taskMap
.
put
(
"model"
,
jgEnableDisable
);
// 更新业务数据
updateInfoOther
(
jgEnableDisable
);
commonService
.
updateTaskModel
(
taskMap
);
}
else
{
jgEnableDisable
.
setNextExecutorIds
(
workflowResultDto
.
getNextExecutorRoleIds
());
...
...
@@ -515,7 +533,37 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
}
}
private
void
updateInfoOther
(
JgEnableDisable
jgEnableDisable
)
{
// 1.更新设备的使用信息:启用->停用,停用->启用
LambdaQueryWrapper
<
JgEnableDisableEq
>
lambdaEq
=
new
QueryWrapper
<
JgEnableDisableEq
>().
lambda
();
lambdaEq
.
eq
(
JgEnableDisableEq:
:
getEnableDisableApplyId
,
jgEnableDisable
.
getSequenceNbr
());
JgEnableDisableEq
jgScrapCancelEq
=
jgEnableDisableEqMapper
.
selectOne
(
lambdaEq
);
IdxBizJgUseInfo
idxBizJgUseInfo
=
new
IdxBizJgUseInfo
();
if
(
APPLY_TYPE_QY
.
equals
(
jgEnableDisable
.
getApplyType
())){
// 1启用
idxBizJgUseInfo
.
setEquState
(
String
.
valueOf
(
EquimentEnum
.
ZAIYONG
.
getCode
()));
}
else
{
// 0停用
idxBizJgUseInfo
.
setEquState
(
String
.
valueOf
(
EquimentEnum
.
TINGYONG
.
getCode
()));
}
LambdaQueryWrapper
<
IdxBizJgUseInfo
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
IdxBizJgUseInfo:
:
getRecord
,
jgScrapCancelEq
.
getEquId
());
idxBizJgUseInfoMapper
.
update
(
idxBizJgUseInfo
,
wrapper
);
// 2.更新设备的es数据的状态:启用->停用,停用->启用
updateEquipEsData
(
jgScrapCancelEq
,
idxBizJgUseInfo
);
}
private
void
updateEquipEsData
(
JgEnableDisableEq
jgScrapCancelEq
,
IdxBizJgUseInfo
idxBizJgUseInfo
)
{
Map
<
String
,
Map
<
String
,
Object
>>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
map1
=
new
HashMap
<>();
map1
.
put
(
"EQU_STATE"
,
idxBizJgUseInfo
.
getEquState
());
resultMap
.
put
(
jgScrapCancelEq
.
getEquId
(),
map1
);
try
{
tzsServiceFeignClient
.
commonUpdateEsDataByIds
(
resultMap
);
}
catch
(
Exception
e
)
{
log
.
error
(
"更新es失败"
,
e
.
getCause
());
}
}
/**
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/ReportAnalysisServiceImpl.java
View file @
cda5ab1d
...
...
@@ -263,7 +263,7 @@ public class ReportAnalysisServiceImpl implements IReportAnalysisService {
sourceBuilder
.
query
(
boolMust
);
sourceBuilder
.
size
(
0
);
// 由于java api查询的数据为镶套,非便扁平化数据,故将 设备状态 + 监管机构 + 设备种类 + 设备类别+ 设备品种 ,作为分组条件中间用 | 分割,注意顺序 解析时按照此字段顺序解析
Script
script
=
new
Script
(
Script
.
DEFAULT_SCRIPT_TYPE
,
Script
.
DEFAULT_SCRIPT_LANG
,
"if(doc['EQU_DEFINE_CODE.keyword'].size() != 0){ return doc['EQU_STATE'].value + '|' + doc['ORG_BRANCH_CODE.keyword'].value + '|' + doc['EQU_LIST_CODE'].value + '|' + doc['EQU_CATEGORY_CODE'].value + '|' + doc['EQU_DEFINE_CODE.keyword'].value} else { return doc['EQU_STATE'].value + '|' + doc['ORG_BRANCH_CODE.keyword'].value + '|' + doc['EQU_LIST_CODE'].value + '|' + doc['EQU_CATEGORY_CODE'].value + '|'}"
,
new
HashMap
<>());
Script
script
=
new
Script
(
Script
.
DEFAULT_SCRIPT_TYPE
,
Script
.
DEFAULT_SCRIPT_LANG
,
"if(doc['EQU_DEFINE_CODE.keyword'].size() != 0){ return doc['EQU_STATE'].value + '|' + doc['ORG_BRANCH_CODE.keyword'].value + '|' + doc['EQU_LIST_CODE'].value + '|' + doc['EQU_CATEGORY_CODE'].value + '|' + doc['EQU_DEFINE_CODE.keyword'].value} else { return doc['EQU_STATE'].value + '|' + doc['ORG_BRANCH_CODE.keyword'].value + '|' + doc['EQU_LIST_CODE'].value + '|' + doc['EQU_CATEGORY_CODE'].value + '|'
+ 'no'
}"
,
new
HashMap
<>());
TermsAggregationBuilder
aggregation
=
AggregationBuilders
.
terms
(
"result"
).
script
(
script
);
sourceBuilder
.
aggregation
(
aggregation
);
searchRequest
.
source
(
sourceBuilder
);
...
...
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