Commit eabb6bd3 by ThomasAdv

添加事务注解,去除todo标识

1 parent fece0554
......@@ -107,9 +107,9 @@ public class DataReportRabbitMQConsumer {
if (CollectionUtils.isNotEmpty(modelDTO.getModelFieldMappings())) {
Map<String, Object> existModelData = getExistModelData(modelDTO);
if (existModelData == null) {
addModelData(modelDTO);
thiz.addModelData(modelDTO);
}else{
updateModelData(modelDTO, existModelData);
thiz.updateModelData(modelDTO, existModelData);
}
}else{
log.error("model field mapping is empty, model:{}", modelDTO);
......@@ -125,7 +125,8 @@ public class DataReportRabbitMQConsumer {
* @author caiym
* @date 2023年09月15日 17:14:42
*/
private void updateModelData(ModelDTO modelDTO, Map<String, Object> existModelData) {
@Transactional(propagation= Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public void updateModelData(ModelDTO modelDTO, Map<String, Object> existModelData) {
log.info("updateModelData, modelDTO:{}, existModelData:{}", modelDTO, existModelData);
if (CollectionUtils.isNotEmpty(modelDTO.getModelFieldMappings())) {
Map<String, Object> fieldMap = mergeModelData(modelDTO, existModelData);
......@@ -287,7 +288,8 @@ public class DataReportRabbitMQConsumer {
* @author caiym
* @date 2023年09月15日 17:14:29
*/
private void addModelData(ModelDTO modelDTO) {
@Transactional(propagation= Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public void addModelData(ModelDTO modelDTO) {
log.info("addModelData, modelDTO:{}", modelDTO);
if (CollectionUtils.isNotEmpty(modelDTO.getModelFieldMappings())) {
JSONObject exJson = new JSONObject();
......
......@@ -60,6 +60,8 @@ public class ModelService {
}
}
@Transactional(propagation= Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public void insertTable(String sql){
try{
modelMapper.insertTable(sql);
......@@ -69,6 +71,7 @@ public class ModelService {
}
}
@Transactional(propagation= Propagation.REQUIRED,rollbackFor=RpcServiceException.class)
public void updateTable(String sql){
try{
modelMapper.updateTable(sql);
......
......@@ -55,7 +55,6 @@ public class OneIdService {
RpcAssert.assertNotNull(param.getBusinessType(), DefaultErrorEnum.DATA_NULL,"param.getBusinessType() not be null");
RpcAssert.assertNotEmpty(param.getOneIdFieldJson(), DefaultErrorEnum.DATA_NULL,"param.getOneIdFieldJson() not be empty");
List<OneIdFieldConfigDTO> readyMatchOneIdFieldConfigs = getReadyMatchOneIdFieldConfigs(param);
//TODO 分布式锁
String finalOneId = null;
if (CollectionUtils.isNotEmpty(readyMatchOneIdFieldConfigs)) {
for (OneIdFieldConfigDTO readyMatchOneIdFieldConfig : readyMatchOneIdFieldConfigs) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!