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
d99fa404
Commit
d99fa404
authored
Sep 23, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.redis缓存的流程数据在事务回滚后可能和数据库数据不一致问题处理
parent
5f8aa960
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
16 deletions
+81
-16
ApplicationRunnerImpl.java
...n/amos/boot/module/jg/biz/init/ApplicationRunnerImpl.java
+14
-14
ICompensateFlowDataOfRedis.java
...oot/module/jg/biz/service/ICompensateFlowDataOfRedis.java
+31
-0
JgInstallationNoticeServiceImpl.java
.../jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
+23
-1
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+13
-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/init/ApplicationRunnerImpl.java
View file @
d99fa404
...
@@ -103,81 +103,81 @@ public class ApplicationRunnerImpl implements ApplicationRunner {
...
@@ -103,81 +103,81 @@ public class ApplicationRunnerImpl implements ApplicationRunner {
@Override
@Override
public
void
run
(
ApplicationArguments
args
)
{
public
void
run
(
ApplicationArguments
args
)
{
//
TODO 增加删除启动时, 完成时
//
流程最新的任务id缓存,流程执行时并发校验
// 使用登记数据初始化
// 使用登记数据初始化
List
<
JgUseRegistration
>
jgUseRegistrations
=
useRegistrationService
.
list
(
new
LambdaQueryWrapper
<
JgUseRegistration
>().
ne
(
JgUseRegistration:
:
getStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()));
List
<
JgUseRegistration
>
jgUseRegistrations
=
useRegistrationService
.
list
(
new
LambdaQueryWrapper
<
JgUseRegistration
>().
ne
(
JgUseRegistration:
:
getStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
())
.
isNotNull
(
JgUseRegistration:
:
getInstanceId
)
);
jgUseRegistrations
.
forEach
(
jgUseRegistration
->
{
jgUseRegistrations
.
forEach
(
jgUseRegistration
->
{
commonService
.
saveExecuteFlowData2Redis
(
jgUseRegistration
.
getInstanceId
(),
useRegistrationService
.
buildInstanceRuntimeData
(
jgUseRegistration
));
commonService
.
saveExecuteFlowData2Redis
(
jgUseRegistration
.
getInstanceId
(),
useRegistrationService
.
buildInstanceRuntimeData
(
jgUseRegistration
));
});
});
// 安装告知数据初始化
// 安装告知数据初始化
List
<
JgInstallationNotice
>
jgInstallationNotices
=
installationNoticeService
.
list
(
new
LambdaQueryWrapper
<
JgInstallationNotice
>().
ne
(
JgInstallationNotice:
:
getNoticeStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
()));
List
<
JgInstallationNotice
>
jgInstallationNotices
=
installationNoticeService
.
list
(
new
LambdaQueryWrapper
<
JgInstallationNotice
>().
ne
(
JgInstallationNotice:
:
getNoticeStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
())
.
isNotNull
(
JgInstallationNotice:
:
getInstanceId
)
);
jgInstallationNotices
.
forEach
(
jgInstallation
->
{
jgInstallationNotices
.
forEach
(
jgInstallation
->
{
commonService
.
saveExecuteFlowData2Redis
(
jgInstallation
.
getInstanceId
(),
installationNoticeService
.
buildInstanceRuntimeData
(
jgInstallation
));
commonService
.
saveExecuteFlowData2Redis
(
jgInstallation
.
getInstanceId
(),
installationNoticeService
.
buildInstanceRuntimeData
(
jgInstallation
));
});
});
// 维修告知数据初始化
// 维修告知数据初始化
List
<
JgMaintainNotice
>
jgMaintainNotices
=
jgMaintainNoticeService
.
list
(
new
LambdaQueryWrapper
<
JgMaintainNotice
>().
ne
(
JgMaintainNotice:
:
getNoticeStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
()));
List
<
JgMaintainNotice
>
jgMaintainNotices
=
jgMaintainNoticeService
.
list
(
new
LambdaQueryWrapper
<
JgMaintainNotice
>().
ne
(
JgMaintainNotice:
:
getNoticeStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
())
.
isNotNull
(
JgMaintainNotice:
:
getInstanceId
)
);
jgMaintainNotices
.
forEach
(
jgInstallation
->
{
jgMaintainNotices
.
forEach
(
jgInstallation
->
{
commonService
.
saveExecuteFlowData2Redis
(
jgInstallation
.
getInstanceId
(),
jgMaintainNoticeService
.
buildInstanceRuntimeData
(
jgInstallation
));
commonService
.
saveExecuteFlowData2Redis
(
jgInstallation
.
getInstanceId
(),
jgMaintainNoticeService
.
buildInstanceRuntimeData
(
jgInstallation
));
});
});
// 改造告知数据初始化
// 改造告知数据初始化
List
<
JgReformNotice
>
jgReformNotices
=
jgReformNoticeService
.
list
(
new
LambdaQueryWrapper
<
JgReformNotice
>().
ne
(
JgReformNotice:
:
getNoticeStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
()));
List
<
JgReformNotice
>
jgReformNotices
=
jgReformNoticeService
.
list
(
new
LambdaQueryWrapper
<
JgReformNotice
>().
ne
(
JgReformNotice:
:
getNoticeStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
())
.
isNotNull
(
JgReformNotice:
:
getInstanceId
)
);
jgReformNotices
.
forEach
(
jgInstallation
->
{
jgReformNotices
.
forEach
(
jgInstallation
->
{
commonService
.
saveExecuteFlowData2Redis
(
jgInstallation
.
getInstanceId
(),
jgReformNoticeService
.
buildInstanceRuntimeData
(
jgInstallation
));
commonService
.
saveExecuteFlowData2Redis
(
jgInstallation
.
getInstanceId
(),
jgReformNoticeService
.
buildInstanceRuntimeData
(
jgInstallation
));
});
});
// 移装告知数据初始化
// 移装告知数据初始化
List
<
JgTransferNotice
>
jgTransferNotices
=
jgTransferNoticeService
.
list
(
new
LambdaQueryWrapper
<
JgTransferNotice
>().
ne
(
JgTransferNotice:
:
getNoticeStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
()));
List
<
JgTransferNotice
>
jgTransferNotices
=
jgTransferNoticeService
.
list
(
new
LambdaQueryWrapper
<
JgTransferNotice
>().
ne
(
JgTransferNotice:
:
getNoticeStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
())
.
isNotNull
(
JgTransferNotice:
:
getInstanceId
)
);
jgTransferNotices
.
forEach
(
jgInstallation
->
{
jgTransferNotices
.
forEach
(
jgInstallation
->
{
commonService
.
saveExecuteFlowData2Redis
(
jgInstallation
.
getInstanceId
(),
jgTransferNoticeService
.
buildInstanceRuntimeData
(
jgInstallation
));
commonService
.
saveExecuteFlowData2Redis
(
jgInstallation
.
getInstanceId
(),
jgTransferNoticeService
.
buildInstanceRuntimeData
(
jgInstallation
));
});
});
// 设备移交数据初始化
// 设备移交数据初始化
List
<
JgEquipTransfer
>
jgEquipTransfers
=
jgEquipTransferService
.
list
(
new
LambdaQueryWrapper
<
JgEquipTransfer
>().
ne
(
JgEquipTransfer:
:
getApplyStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
()));
List
<
JgEquipTransfer
>
jgEquipTransfers
=
jgEquipTransferService
.
list
(
new
LambdaQueryWrapper
<
JgEquipTransfer
>().
ne
(
JgEquipTransfer:
:
getApplyStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
())
.
isNotNull
(
JgEquipTransfer:
:
getInstanceId
)
);
jgEquipTransfers
.
forEach
(
jgInstallation
->
{
jgEquipTransfers
.
forEach
(
jgInstallation
->
{
commonService
.
saveExecuteFlowData2Redis
(
jgInstallation
.
getInstanceId
(),
jgEquipTransferService
.
buildInstanceRuntimeData
(
jgInstallation
));
commonService
.
saveExecuteFlowData2Redis
(
jgInstallation
.
getInstanceId
(),
jgEquipTransferService
.
buildInstanceRuntimeData
(
jgInstallation
));
});
});
// 移转变更登记数据初始化
// 移转变更登记数据初始化
List
<
JgChangeRegistrationTransfer
>
jgChangeRegistrationTransfers
=
changeRegistrationTransferService
.
list
(
new
LambdaQueryWrapper
<
JgChangeRegistrationTransfer
>().
ne
(
JgChangeRegistrationTransfer:
:
getAuditStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()));
List
<
JgChangeRegistrationTransfer
>
jgChangeRegistrationTransfers
=
changeRegistrationTransferService
.
list
(
new
LambdaQueryWrapper
<
JgChangeRegistrationTransfer
>().
ne
(
JgChangeRegistrationTransfer:
:
getAuditStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
())
.
isNotNull
(
JgChangeRegistrationTransfer:
:
getInstanceId
)
);
jgChangeRegistrationTransfers
.
forEach
(
jgChangeRegistrationTransfer
->
{
jgChangeRegistrationTransfers
.
forEach
(
jgChangeRegistrationTransfer
->
{
commonService
.
saveExecuteFlowData2Redis
(
jgChangeRegistrationTransfer
.
getInstanceId
(),
changeRegistrationTransferService
.
buildInstanceRuntimeData
(
jgChangeRegistrationTransfer
));
commonService
.
saveExecuteFlowData2Redis
(
jgChangeRegistrationTransfer
.
getInstanceId
(),
changeRegistrationTransferService
.
buildInstanceRuntimeData
(
jgChangeRegistrationTransfer
));
});
});
// 改造变更登记数据初始化
// 改造变更登记数据初始化
List
<
JgChangeRegistrationReform
>
jgChangeRegistrationReforms
=
changeRegistrationReformService
.
list
(
new
LambdaQueryWrapper
<
JgChangeRegistrationReform
>().
ne
(
JgChangeRegistrationReform:
:
getAuditStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()));
List
<
JgChangeRegistrationReform
>
jgChangeRegistrationReforms
=
changeRegistrationReformService
.
list
(
new
LambdaQueryWrapper
<
JgChangeRegistrationReform
>().
ne
(
JgChangeRegistrationReform:
:
getAuditStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
())
.
isNotNull
(
JgChangeRegistrationReform:
:
getInstanceId
)
);
jgChangeRegistrationReforms
.
forEach
(
jgInstallation
->
{
jgChangeRegistrationReforms
.
forEach
(
jgInstallation
->
{
commonService
.
saveExecuteFlowData2Redis
(
jgInstallation
.
getInstanceId
(),
changeRegistrationReformService
.
buildInstanceRuntimeData
(
jgInstallation
));
commonService
.
saveExecuteFlowData2Redis
(
jgInstallation
.
getInstanceId
(),
changeRegistrationReformService
.
buildInstanceRuntimeData
(
jgInstallation
));
});
});
// 单位变更登记数据初始化
// 单位变更登记数据初始化
List
<
JgChangeRegistrationUnit
>
jgChangeRegistrationUnits
=
changeRegistrationUnitService
.
list
(
new
LambdaQueryWrapper
<
JgChangeRegistrationUnit
>().
ne
(
JgChangeRegistrationUnit:
:
getStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()));
List
<
JgChangeRegistrationUnit
>
jgChangeRegistrationUnits
=
changeRegistrationUnitService
.
list
(
new
LambdaQueryWrapper
<
JgChangeRegistrationUnit
>().
ne
(
JgChangeRegistrationUnit:
:
getStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
())
.
isNotNull
(
JgChangeRegistrationUnit:
:
getInstanceId
)
);
jgChangeRegistrationUnits
.
forEach
(
jgInstallation
->
{
jgChangeRegistrationUnits
.
forEach
(
jgInstallation
->
{
commonService
.
saveExecuteFlowData2Redis
(
jgInstallation
.
getInstanceId
(),
changeRegistrationUnitService
.
buildInstanceRuntimeData
(
jgInstallation
));
commonService
.
saveExecuteFlowData2Redis
(
jgInstallation
.
getInstanceId
(),
changeRegistrationUnitService
.
buildInstanceRuntimeData
(
jgInstallation
));
});
});
// 启用停用登记数据初始化
// 启用停用登记数据初始化
List
<
JgEnableDisable
>
jgEnableDisables
=
jgEnableDisableService
.
list
(
new
LambdaQueryWrapper
<
JgEnableDisable
>().
ne
(
JgEnableDisable:
:
getAuditStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()));
List
<
JgEnableDisable
>
jgEnableDisables
=
jgEnableDisableService
.
list
(
new
LambdaQueryWrapper
<
JgEnableDisable
>().
ne
(
JgEnableDisable:
:
getAuditStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
())
.
isNotNull
(
JgEnableDisable:
:
getInstanceId
)
);
jgEnableDisables
.
forEach
(
jgEnableDisable
->
{
jgEnableDisables
.
forEach
(
jgEnableDisable
->
{
commonService
.
saveExecuteFlowData2Redis
(
jgEnableDisable
.
getInstanceId
(),
jgEnableDisableService
.
buildInstanceRuntimeData
(
jgEnableDisable
));
commonService
.
saveExecuteFlowData2Redis
(
jgEnableDisable
.
getInstanceId
(),
jgEnableDisableService
.
buildInstanceRuntimeData
(
jgEnableDisable
));
});
});
// 维保备案登记数据初始化
// 维保备案登记数据初始化
List
<
JgMaintenanceContract
>
jgMaintenanceContracts
=
maintenanceContractService
.
list
(
new
LambdaQueryWrapper
<
JgMaintenanceContract
>().
ne
(
JgMaintenanceContract:
:
getStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()));
List
<
JgMaintenanceContract
>
jgMaintenanceContracts
=
maintenanceContractService
.
list
(
new
LambdaQueryWrapper
<
JgMaintenanceContract
>().
ne
(
JgMaintenanceContract:
:
getStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
())
.
isNotNull
(
JgMaintenanceContract:
:
getInstanceId
)
);
jgMaintenanceContracts
.
forEach
(
jgInstallation
->
{
jgMaintenanceContracts
.
forEach
(
jgInstallation
->
{
commonService
.
saveExecuteFlowData2Redis
(
jgInstallation
.
getInstanceId
(),
maintenanceContractService
.
buildInstanceRuntimeData
(
jgInstallation
));
commonService
.
saveExecuteFlowData2Redis
(
jgInstallation
.
getInstanceId
(),
maintenanceContractService
.
buildInstanceRuntimeData
(
jgInstallation
));
});
});
// 注销报废登记数据初始化
// 注销报废登记数据初始化
List
<
JgScrapCancel
>
jgScrapCancels
=
scrapCancelService
.
list
(
new
LambdaQueryWrapper
<
JgScrapCancel
>().
ne
(
JgScrapCancel:
:
getAuditStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()));
List
<
JgScrapCancel
>
jgScrapCancels
=
scrapCancelService
.
list
(
new
LambdaQueryWrapper
<
JgScrapCancel
>().
ne
(
JgScrapCancel:
:
getAuditStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
())
.
isNotNull
(
JgScrapCancel:
:
getInstanceId
)
);
jgScrapCancels
.
forEach
(
jgScrapCancel
->
{
jgScrapCancels
.
forEach
(
jgScrapCancel
->
{
commonService
.
saveExecuteFlowData2Redis
(
jgScrapCancel
.
getInstanceId
(),
scrapCancelService
.
buildInstanceRuntimeData
(
jgScrapCancel
));
commonService
.
saveExecuteFlowData2Redis
(
jgScrapCancel
.
getInstanceId
(),
scrapCancelService
.
buildInstanceRuntimeData
(
jgScrapCancel
));
});
});
// 单位名称变更数据初始化
// 单位名称变更数据初始化
List
<
JgChangeRegistrationName
>
jgChangeRegistrationNames
=
changeRegistrationNameService
.
list
(
new
LambdaQueryWrapper
<
JgChangeRegistrationName
>().
ne
(
JgChangeRegistrationName:
:
getAuditStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()));
List
<
JgChangeRegistrationName
>
jgChangeRegistrationNames
=
changeRegistrationNameService
.
list
(
new
LambdaQueryWrapper
<
JgChangeRegistrationName
>().
ne
(
JgChangeRegistrationName:
:
getAuditStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
())
.
isNotNull
(
JgChangeRegistrationName:
:
getInstanceId
)
);
jgChangeRegistrationNames
.
forEach
(
registrationName
->
{
jgChangeRegistrationNames
.
forEach
(
registrationName
->
{
commonService
.
saveExecuteFlowData2Redis
(
registrationName
.
getInstanceId
(),
changeRegistrationNameService
.
buildInstanceRuntimeData
(
registrationName
));
commonService
.
saveExecuteFlowData2Redis
(
registrationName
.
getInstanceId
(),
changeRegistrationNameService
.
buildInstanceRuntimeData
(
registrationName
));
});
});
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/ICompensateFlowDataOfRedis.java
0 → 100644
View file @
d99fa404
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
;
/**
* @author Administrator
* redis 数据补偿
*/
public
interface
ICompensateFlowDataOfRedis
<
T
>
{
/**
* 补偿redis数据
* @param t 参数
*/
default
void
doCompensate
(
T
t
)
{
if
(
beforeCheck
(
t
))
{
compensate
(
t
);
}
}
/**
* 补偿前校验
* @param t 参数
* @return 是否检验通过
*/
boolean
beforeCheck
(
T
t
);
/**
* 补偿实现
* @param t 参数
*/
void
compensate
(
T
t
);
}
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/JgInstallationNoticeServiceImpl.java
View file @
d99fa404
...
@@ -38,6 +38,7 @@ import com.yeejoin.amos.boot.module.jg.biz.event.CancellationEvent;
...
@@ -38,6 +38,7 @@ import com.yeejoin.amos.boot.module.jg.biz.event.CancellationEvent;
import
com.yeejoin.amos.boot.module.jg.biz.event.publisher.EventPublisher
;
import
com.yeejoin.amos.boot.module.jg.biz.event.publisher.EventPublisher
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
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.ICmWorkflowService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICompensateFlowDataOfRedis
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgConstructionInfoService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgConstructionInfoService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgUseInfoService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgUseInfoService
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.CodeUtil
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.CodeUtil
;
...
@@ -98,7 +99,7 @@ import static com.alibaba.fastjson.JSON.parseArray;
...
@@ -98,7 +99,7 @@ import static com.alibaba.fastjson.JSON.parseArray;
*/
*/
@Service
@Service
@Slf4j
@Slf4j
public
class
JgInstallationNoticeServiceImpl
extends
BaseService
<
JgInstallationNoticeDto
,
JgInstallationNotice
,
JgInstallationNoticeMapper
>
implements
IJgInstallationNoticeService
{
public
class
JgInstallationNoticeServiceImpl
extends
BaseService
<
JgInstallationNoticeDto
,
JgInstallationNotice
,
JgInstallationNoticeMapper
>
implements
IJgInstallationNoticeService
,
ICompensateFlowDataOfRedis
<
JgInstallationNotice
>
{
private
static
final
String
SUBMIT_TYPE_FLOW
=
"1"
;
private
static
final
String
SUBMIT_TYPE_FLOW
=
"1"
;
private
static
final
String
PROCESS_DEFINITION_KEY
=
"installationNotificationNew"
;
private
static
final
String
PROCESS_DEFINITION_KEY
=
"installationNotificationNew"
;
...
@@ -211,6 +212,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
...
@@ -211,6 +212,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
if
(
Objects
.
isNull
(
notice
))
{
if
(
Objects
.
isNull
(
notice
))
{
return
null
;
return
null
;
}
}
// 流程数据补偿 防止redis缓存数据存在与数据库不一致问题
this
.
doCompensate
(
notice
);
Map
<
String
,
Object
>
installationInfo
=
BeanUtil
.
beanToMap
(
notice
,
false
,
true
);
Map
<
String
,
Object
>
installationInfo
=
BeanUtil
.
beanToMap
(
notice
,
false
,
true
);
installationInfo
.
put
(
"province"
,
notice
.
getProvince
()
+
"_"
+
notice
.
getProvinceName
());
installationInfo
.
put
(
"province"
,
notice
.
getProvince
()
+
"_"
+
notice
.
getProvinceName
());
...
@@ -312,6 +315,13 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
...
@@ -312,6 +315,13 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
}
}
}
}
private
void
compensateFlowDataOfRedis
(
JgInstallationNotice
notice
)
{
if
(
notice
.
getInstanceId
()
!=
null
&&
!
notice
.
getNoticeStatus
().
equals
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
()))
&&!
notice
.
getNoticeStatus
().
equals
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_DISCARD
.
getCode
()))){
commonService
.
saveExecuteFlowData2Redis
(
notice
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
notice
));
}
}
private
List
<
Map
<
String
,
Object
>>
getEquipListMaps
(
Iterable
<
ESEquipmentCategoryDto
>
equips
)
{
private
List
<
Map
<
String
,
Object
>>
getEquipListMaps
(
Iterable
<
ESEquipmentCategoryDto
>
equips
)
{
List
<
Map
<
String
,
Object
>>
arrayList
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
arrayList
=
new
ArrayList
<>();
equips
.
forEach
(
equip
->
{
equips
.
forEach
(
equip
->
{
...
@@ -1726,4 +1736,15 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
...
@@ -1726,4 +1736,15 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
jgInstallationNoticeEqService
.
updateBatchById
(
jgInstallationNoticeEqs
);
jgInstallationNoticeEqService
.
updateBatchById
(
jgInstallationNoticeEqs
);
return
Boolean
.
TRUE
;
return
Boolean
.
TRUE
;
}
}
@Override
public
boolean
beforeCheck
(
JgInstallationNotice
notice
)
{
return
notice
.
getInstanceId
()
!=
null
&&
!
notice
.
getNoticeStatus
().
equals
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
()))
&&!
notice
.
getNoticeStatus
().
equals
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_DISCARD
.
getCode
()));
}
@Override
public
void
compensate
(
JgInstallationNotice
notice
)
{
commonService
.
saveExecuteFlowData2Redis
(
notice
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
notice
));
}
}
}
\ No newline at end of file
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/JgUseRegistrationServiceImpl.java
View file @
d99fa404
...
@@ -38,6 +38,7 @@ import com.yeejoin.amos.boot.module.jg.biz.event.publisher.EventPublisher;
...
@@ -38,6 +38,7 @@ import com.yeejoin.amos.boot.module.jg.biz.event.publisher.EventPublisher;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.WorkFlowFeignService
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.WorkFlowFeignService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICommonService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICommonService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICompensateFlowDataOfRedis
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgInspectionDetectionInfoService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgInspectionDetectionInfoService
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.CodeUtil
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.CodeUtil
;
import
com.yeejoin.amos.boot.module.ymt.api.common.StringUtil
;
import
com.yeejoin.amos.boot.module.ymt.api.common.StringUtil
;
...
@@ -107,7 +108,7 @@ import static java.util.stream.Collectors.toList;
...
@@ -107,7 +108,7 @@ import static java.util.stream.Collectors.toList;
*/
*/
@Service
@Service
@Slf4j
@Slf4j
public
class
JgUseRegistrationServiceImpl
extends
BaseService
<
JgUseRegistrationDto
,
JgUseRegistration
,
JgUseRegistrationMapper
>
implements
IJgUseRegistrationService
{
public
class
JgUseRegistrationServiceImpl
extends
BaseService
<
JgUseRegistrationDto
,
JgUseRegistration
,
JgUseRegistrationMapper
>
implements
IJgUseRegistrationService
,
ICompensateFlowDataOfRedis
<
JgUseRegistration
>
{
private
static
final
String
DEFINITION_KEY
=
"useRegistration"
;
private
static
final
String
DEFINITION_KEY
=
"useRegistration"
;
private
final
List
<
String
>
NOT_FLOWING_STATE
=
Arrays
.
asList
(
"使用单位待提交"
,
"一级受理已驳回"
,
"使用单位已撤回"
,
"已作废"
);
private
final
List
<
String
>
NOT_FLOWING_STATE
=
Arrays
.
asList
(
"使用单位待提交"
,
"一级受理已驳回"
,
"使用单位已撤回"
,
"已作废"
);
...
@@ -1685,6 +1686,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -1685,6 +1686,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
public
Map
<
String
,
Object
>
getDetail
(
String
record
,
Long
sequenceNbr
)
{
public
Map
<
String
,
Object
>
getDetail
(
String
record
,
Long
sequenceNbr
)
{
if
(!
ObjectUtils
.
isEmpty
(
sequenceNbr
))
{
if
(!
ObjectUtils
.
isEmpty
(
sequenceNbr
))
{
JgUseRegistration
jgUseRegistration
=
this
.
getBaseMapper
().
selectById
(
sequenceNbr
);
JgUseRegistration
jgUseRegistration
=
this
.
getBaseMapper
().
selectById
(
sequenceNbr
);
this
.
doCompensate
(
jgUseRegistration
);
LambdaQueryWrapper
<
JgRegistrationHistory
>
lambda
=
new
QueryWrapper
<
JgRegistrationHistory
>().
lambda
();
LambdaQueryWrapper
<
JgRegistrationHistory
>
lambda
=
new
QueryWrapper
<
JgRegistrationHistory
>().
lambda
();
lambda
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
sequenceNbr
);
lambda
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
sequenceNbr
);
JgRegistrationHistory
jgRegistrationHistory
=
jgRegistrationHistoryService
.
getBaseMapper
().
selectOne
(
lambda
);
JgRegistrationHistory
jgRegistrationHistory
=
jgRegistrationHistoryService
.
getBaseMapper
().
selectOne
(
lambda
);
...
@@ -3360,4 +3362,13 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -3360,4 +3362,13 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
return
true
;
return
true
;
}
}
@Override
public
boolean
beforeCheck
(
JgUseRegistration
jgUseRegistration
)
{
return
jgUseRegistration
.
getInstanceId
()
!=
null
&&
!
jgUseRegistration
.
getStatus
().
equals
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
())
&&
!
jgUseRegistration
.
getStatus
().
equals
(
FlowStatusEnum
.
TO_BE_DISCARD
.
getName
());
}
@Override
public
void
compensate
(
JgUseRegistration
jgUseRegistration
)
{
commonService
.
saveExecuteFlowData2Redis
(
jgUseRegistration
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
jgUseRegistration
));
}
}
}
\ 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