Przeglądaj źródła

积分添加事务

v-qinpengfei 5 lat temu
rodzic
commit
c276654bec

+ 6 - 1
src/main/java/com/poteviohealth/cgp/integration/controller/feign/IntegrationFeignController.java

@@ -62,6 +62,11 @@ public class IntegrationFeignController {
     @ResponseBody
     @OperationLog(type = OperateType.FEIGN,description = "新增积分详情数据")
     public VaultsResponse saveDetail(@RequestBody List<CustomerIntegration> customerIntegration){
-        return iIntegralDetailService.saveDetail(customerIntegration);
+        try {
+            return iIntegralDetailService.saveDetail(customerIntegration);
+        }catch (Exception e){
+            return VaultsResponse.failed();
+        }
+
     }
 }

+ 1 - 0
src/main/java/com/poteviohealth/cgp/integration/service/impl/IntegralDetailServiceImpl.java

@@ -108,6 +108,7 @@ public class IntegralDetailServiceImpl extends BaseServiceImpl<IntegralDetailMap
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public VaultsResponse saveDetail(List<CustomerIntegration> customerIntegration) {
 
         List<IntegralDetail> list = IntegralConverter.INSTANCE.model2FeginDTO(customerIntegration);