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
2c2fdba5
Commit
2c2fdba5
authored
Jan 30, 2026
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(设备创建) : 事务回滚
1.回滚时,删除设备
parent
c51777bc
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
79 additions
and
30 deletions
+79
-30
EquipRequestParamsDto.java
...in/amos/boot/module/jg/api/dto/EquipRequestParamsDto.java
+1
-0
DataDockController.java
...mos/boot/module/jg/biz/controller/DataDockController.java
+3
-3
EsSyncTransactionHook.java
...n/amos/boot/module/jg/biz/hook/EsSyncTransactionHook.java
+49
-0
DataDockServiceImpl.java
.../boot/module/jg/biz/service/impl/DataDockServiceImpl.java
+0
-0
ElevatorDataTransactionService.java
...e/jg/biz/service/impl/ElevatorDataTransactionService.java
+0
-1
IdxBizJgRegisterInfoServiceImpl.java
.../jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
+19
-23
IdxBizJgUseInfoMapper.xml
...t-api/src/main/resources/mapper/IdxBizJgUseInfoMapper.xml
+7
-3
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/dto/EquipRequestParamsDto.java
View file @
2c2fdba5
...
...
@@ -27,6 +27,7 @@ public class EquipRequestParamsDto {
private
String
dataSource
;
private
String
orgBranchCode
;
private
String
orgBranchName
;
private
String
orgCompanyCode
;
private
String
useOrgCode
;
private
String
vehicleApanage
;
private
String
receiveCompanyCode
;
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/DataDockController.java
View file @
2c2fdba5
...
...
@@ -39,7 +39,7 @@ public class DataDockController extends BaseController {
@PostMapping
(
value
=
"/xi-an/saveEquipmentData"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"西安数据对接-设备批量导入"
,
notes
=
"西安数据对接-导入多个设备的数据文件"
)
public
ResponseModel
<?>
saveEquipmentData
(
@RequestBody
List
<
Map
<
String
,
Object
>>
equLists
)
{
return
ResponseHelper
.
buildResponse
(
dataDockService
.
xiAnSaveEquipmentData
(
equLists
));
return
ResponseHelper
.
buildResponse
(
dataDockService
.
xiAnSaveEquipmentData
(
equLists
,
getSelectedOrgInfo
()
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
...
...
@@ -57,7 +57,7 @@ public class DataDockController extends BaseController {
if
(!(
"application/vnd.ms-excel"
.
equals
(
contentType
)
||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
.
equals
(
contentType
))
||
!(
"xls"
.
equalsIgnoreCase
(
fileExtension
)
||
"xlsx"
.
equalsIgnoreCase
(
fileExtension
)))
{
return
ResponseHelper
.
buildResponse
(
"文件类型必须是 Excel 文件"
);
}
return
ResponseHelper
.
buildResponse
(
dataDockService
.
dataCheckAndImportEquipmentData
(
remark
,
file
));
return
ResponseHelper
.
buildResponse
(
dataDockService
.
dataCheckAndImportEquipmentData
(
remark
,
file
,
getSelectedOrgInfo
()
));
}
/**
...
...
@@ -137,7 +137,7 @@ public class DataDockController extends BaseController {
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"台套类设备导入字段保存"
,
notes
=
"台套类设备导入字段保存"
)
@RestEventTrigger
(
value
=
"operateLogRestEventHandler"
)
public
ResponseModel
<?>
saveEquipImportData
(
@RequestBody
Map
<
String
,
Object
>
paramMap
)
{
return
ResponseHelper
.
buildResponse
(
dataDockService
.
saveEquipImportData
(
paramMap
));
return
ResponseHelper
.
buildResponse
(
dataDockService
.
saveEquipImportData
(
paramMap
,
getSelectedOrgInfo
()
));
}
/**
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/hook/EsSyncTransactionHook.java
0 → 100644
View file @
2c2fdba5
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
hook
;
import
io.seata.tm.api.transaction.TransactionHook
;
import
lombok.extern.slf4j.Slf4j
;
@Slf4j
public
class
EsSyncTransactionHook
implements
TransactionHook
{
private
final
String
xid
;
// final保证构造后不变
public
EsSyncTransactionHook
(
String
xid
)
{
this
.
xid
=
xid
;
}
@Override
public
void
beforeBegin
()
{
log
.
info
(
"beforeBegin:{}"
,
xid
);
}
@Override
public
void
afterBegin
()
{
log
.
info
(
"afterBegin:{}"
,
xid
);
}
@Override
public
void
beforeCommit
()
{
log
.
info
(
"beforeCommit:{}"
,
xid
);
}
@Override
public
void
afterCommit
()
{
log
.
info
(
"afterCommit:{}"
,
xid
);
}
@Override
public
void
beforeRollback
()
{
log
.
info
(
"beforeRollback:{}"
,
xid
);
}
@Override
public
void
afterRollback
()
{
log
.
info
(
"afterRollback:{}"
,
xid
);
}
@Override
public
void
afterCompletion
()
{
log
.
info
(
"afterCompletion:{}"
,
xid
);
}
}
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/DataDockServiceImpl.java
View file @
2c2fdba5
This diff is collapsed.
Click to expand it.
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/ElevatorDataTransactionService.java
View file @
2c2fdba5
...
...
@@ -19,7 +19,6 @@ public class ElevatorDataTransactionService {
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
Object
saveSingleElevatorData
(
Map
<
String
,
Object
>
equ
)
{
return
dataDockService
.
saveElevatorDataInTransaction
(
equ
,
"jg_his_xa"
,
null
);
}
...
...
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/IdxBizJgRegisterInfoServiceImpl.java
View file @
2c2fdba5
...
...
@@ -56,6 +56,7 @@ import com.yeejoin.amos.boot.module.ymt.api.dto.TzsUserInfoDto;
import
com.yeejoin.amos.boot.module.ymt.api.entity.*
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.*
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.utils.FeignUtil
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
...
...
@@ -4454,6 +4455,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if
(
paramMap
==
null
)
{
throw
new
IllegalArgumentException
(
"参数Map不能为空"
);
}
try
{
LinkedHashMap
equipmentInfoForm
=
(
LinkedHashMap
)
checkAndCast
(
paramMap
.
get
(
EQUIP_INFO_FORM_ID
));
LinkedHashMap
attachmentUpload
=
(
LinkedHashMap
)
checkAndCast
(
paramMap
.
get
(
ATTACHMENT_UPLOAD
));
EquipmentInfoDto
equipInfoDto
=
this
.
createEquipmentInfoDto
(
equipmentInfoForm
,
jgVehicleInformationMapper
);
...
...
@@ -4603,16 +4605,16 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
.
map
(
s
->
DateUtil
.
parse
(
s
,
"yyyy-MM-dd"
))
.
ifPresent
(
inspectionDetectionInfo:
:
setNextInspectDate
);
// 根据条件确定增加的年数(杨生元说监管让去掉,企业自己输入)
// Optional.ofNullable(data.getInspectDate())
// .filter(s -> !s.trim().isEmpty())
// .map(dateStr -> LocalDate.parse(dateStr, DateTimeFormatter.ofPattern("yyyy-MM-dd")))
// .ifPresent(inspectDate -> {
// inspectionDetectionInfo.setInspectDate(Date.from(inspectDate.atStartOfDay(ZoneId.systemDefault()).toInstant()));
// // 计算下次检测日期(加 3 年或 4 年)
// int plusYears = SPECIAL_CYLINDER.getCode().equals(equipInfoDto.getEquDefineCode()) ? 3 : 4;
// LocalDate nextInspectDate = inspectDate.plusYears(plusYears);
// inspectionDetectionInfo.setNextInspectDate(Date.from(nextInspectDate.atStartOfDay(ZoneId.systemDefault()).toInstant()));
// });
// Optional.ofNullable(data.getInspectDate())
// .filter(s -> !s.trim().isEmpty())
// .map(dateStr -> LocalDate.parse(dateStr, DateTimeFormatter.ofPattern("yyyy-MM-dd")))
// .ifPresent(inspectDate -> {
// inspectionDetectionInfo.setInspectDate(Date.from(inspectDate.atStartOfDay(ZoneId.systemDefault()).toInstant()));
// // 计算下次检测日期(加 3 年或 4 年)
// int plusYears = SPECIAL_CYLINDER.getCode().equals(equipInfoDto.getEquDefineCode()) ? 3 : 4;
// LocalDate nextInspectDate = inspectDate.plusYears(plusYears);
// inspectionDetectionInfo.setNextInspectDate(Date.from(nextInspectDate.atStartOfDay(ZoneId.systemDefault()).toInstant()));
// });
inspectionDetectionInfoList
.
add
(
inspectionDetectionInfo
);
// 其他信息
...
...
@@ -4824,20 +4826,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
batchInsert
(
idxBizJgInspectionDetectionInfoMapper
,
inspectionDetectionInfoList
,
"检验检测信息"
);
batchInsert
(
certificateChangeRecordEqMapper
,
jgCertificateChangeRecordEqList
,
"登记证关系信息"
);
esEquipmentCategory
.
saveAll
(
esEquipmentCategoryList
);
// 使用事务同步回调确保事件在事务提交后发送
TransactionSynchronizationManager
.
registerSynchronization
(
new
TransactionSynchronization
()
{
@Override
public
void
afterCommit
()
{
eventPublisher
.
publish
(
new
EquipCreateOrEditEvent
(
this
,
BusinessTypeEnum
.
JG_NEW_EQUIP
.
name
(),
recordSet
,
EquipCreateOrEditEvent
.
EquipType
.
equip
)
);
// 事务提交成功后,发送消息
eventPublisher
.
publish
(
new
EquipCreateOrEditEvent
(
this
,
BusinessTypeEnum
.
JG_NEW_EQUIP
.
name
(),
recordSet
,
EquipCreateOrEditEvent
.
EquipType
.
equip
));
}
catch
(
Exception
e
)
{
if
(!
esEquipmentCategoryList
.
isEmpty
()){
esEquipmentCategory
.
deleteAll
(
esEquipmentCategoryList
);
}
throw
e
;
}
});
return
String
.
format
(
"导入完成,成功导入: %d 条数据!"
,
useInfoList
.
size
());
}
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/resources/mapper/IdxBizJgUseInfoMapper.xml
View file @
2c2fdba5
...
...
@@ -142,8 +142,6 @@
ibjui."REC_DATE",
ibjui."USE_UNIT_NAME",
ibjui."USE_UNIT_CREDIT_CODE",
ibjui."USC_UNIT_NAME",
ibjui."USC_UNIT_CREDIT_CODE",
ibjri."EQU_LIST" AS "EQU_LIST_CODE",
ibjri."EQU_DEFINE" AS "EQU_DEFINE_CODE",
ibjri."PRODUCT_NAME",
...
...
@@ -185,7 +183,13 @@
ibjoi."INFORMATION_SITUATION",
di."DESIGN_UNIT_CREDIT_CODE",
di."DESIGN_UNIT_NAME",
di."DESIGN_DATE"
di."DESIGN_DATE",
construction_info."USC_UNIT_CREDIT_CODE",
construction_info."USC_UNIT_NAME",
construction_info."CONSTRUCTION_TYPE",
construction_info."USC_DATE",
inspection_info."INSPECT_REPORT",
inspection_info."NEXT_INSPECT_DATE"
FROM
idx_biz_jg_use_info ibjui
LEFT JOIN (
...
...
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