Przeglądaj źródła

操作日志插入失败,不影响主流程回滚

houweiyu 4 lat temu
rodzic
commit
beaccda2ef

+ 1 - 5
src/main/java/fcb/project/manager/core/controller/AuditController.java

@@ -239,10 +239,6 @@ public class AuditController extends BaseController{
                     if(null != rsp){
                         log.info("code = {} , msg = {}" , rsp.getCode() , rsp.getMsg());
                     }
-                    int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "审核管理" , "审核管理/审核下线/" + tmHouse.getHouseTitle() + "-失败");
-                    if(ins != 1){
-                        log.info("插入操作记录失败");
-                    }
                     throw new CommonBaseException(ResultCodeEnum.D101 , "更新看看场景状态失败");
                 }
 
@@ -250,7 +246,7 @@ public class AuditController extends BaseController{
             //通知720,告知房源下线(审核通过/上线:4, 下线:3)
             panoService.noticeVrAuditStatus(tmHouse.getId() , getToken() , 3);
 
-            int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "审核管理" , "审核管理/审核下线/" + tmHouse.getHouseTitle() + "-成功");
+            int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "审核管理" , "审核管理/审核下线/" + tmHouse.getHouseTitle());
             if(ins != 1){
                 log.info("插入操作记录失败");
             }

+ 5 - 29
src/main/java/fcb/project/manager/core/controller/HouseManagerController.java

@@ -266,19 +266,11 @@ public class HouseManagerController extends BaseController{
         String outPutImageResultPath = imageLocalPath + outPutImageName;
         try {
             if(!DataUtils.createQRCode(totalVrUrl ,  outPutImageResultPath , totalFile)){
-                int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "VR楼盘项目" , "更新VR项目分享二维码/" + tmHouse.getHouseTitle() + "-失败");
-                if(ins != 1){
-                    log.info("插入操作记录失败");
-                }
                 return Result.failure("生成分享二维码失败");
             }
         } catch (Exception e) {
             e.printStackTrace();
             log.info("生成分享二维码出现异常");
-            int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "VR楼盘项目" , "更新VR项目分享二维码/" + tmHouse.getHouseTitle() + "-异常");
-            if(ins != 1){
-                log.info("插入操作记录失败");
-            }
             return Result.failure("生成分享二维码出现异常");
         }
         String resultOssPath = ossPath + outPutImageName;
@@ -292,7 +284,7 @@ public class HouseManagerController extends BaseController{
         }
         tmHouseService.updateHouse(tmHouse);
 
-        int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "VR楼盘项目" , "更新VR项目分享二维码/" + tmHouse.getHouseTitle() + "-成功");
+        int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "VR楼盘项目" , "更新VR项目分享二维码/" + tmHouse.getHouseTitle());
         if(ins != 1){
             log.info("插入操作记录失败");
         }
@@ -433,13 +425,9 @@ public class HouseManagerController extends BaseController{
 
         int delete = tmHouseService.deleteHouseById(houseId);
         if(delete != 1){
-            int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "VR楼盘项目" , "删除VR项目/" + dbHouse.getHouseTitle() + "-失败");
-            if(ins != 1){
-                log.info("插入操作记录失败");
-            }
             return Result.failure("删除失败");
         }
-        int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "VR楼盘项目" , "删除VR项目/" + dbHouse.getHouseTitle() + "-成功");
+        int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "VR楼盘项目" , "删除VR项目/" + dbHouse.getHouseTitle());
         if(ins != 1){
             log.info("插入操作记录失败");
         }
@@ -497,16 +485,12 @@ public class HouseManagerController extends BaseController{
             tmHouse.setInnerVrLink(innerHostVrLink);
         }
         if(tmHouseService.updateHouse(tmHouse)){
-            int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "VR楼盘项目" , "更新VR项目/" + dbHouse.getHouseTitle() + "-成功");
+            int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "VR楼盘项目" , "更新VR项目/" + dbHouse.getHouseTitle());
             if(ins != 1){
                 log.info("插入操作记录失败");
             }
             return Result.success("修改成功");
         }else{
-            int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "VR楼盘项目" , "更新VR项目/" + dbHouse.getHouseTitle() + "-失败");
-            if(ins != 1){
-                log.info("插入操作记录失败");
-            }
             return Result.failure("修改失败");
         }
     }
@@ -555,7 +539,7 @@ public class HouseManagerController extends BaseController{
                 log.info("更新房源的审批id失败");
                 throw new CommonBaseException(ResultCodeEnum.D101 , "更新房源的审批记录失败");
             }
-            int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "审核管理" , "提交审核/" + dbHouse.getHouseTitle() + "-成功");
+            int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "审核管理" , "提交审核/" + dbHouse.getHouseTitle());
             if(ins != 1){
                 log.info("插入操作记录失败");
             }
@@ -564,10 +548,6 @@ public class HouseManagerController extends BaseController{
             map.put("auditId" , tmAudit.getId());
            return Result.success(map);
         }else{
-            int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "审核管理" , "提交审核/" + dbHouse.getHouseTitle() + "-失败");
-            if(ins != 1){
-                log.info("插入操作记录失败");
-            }
             return Result.failure("提交失败");
         }
     }
@@ -619,10 +599,6 @@ public class HouseManagerController extends BaseController{
         dbHouse.setAuditTime(null);
         dbHouse.setStatus(HouseStatus.DRAFT.getCode());
         if(!tmHouseService.updateHouse(dbHouse)){
-            int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "审核管理" , "撤销审核/" + dbHouse.getHouseTitle() + "-失败");
-            if(ins != 1){
-                log.info("插入操作记录失败");
-            }
             throw new CommonBaseException(ResultCodeEnum.D101 , "撤销房源的审批记录失败");
         }
 
@@ -631,7 +607,7 @@ public class HouseManagerController extends BaseController{
             throw new CommonBaseException(ResultCodeEnum.D101 , "删除审批记录失败");
         }
 
-        int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "审核管理" , "撤销审核/" + dbHouse.getHouseTitle() + "-成功");
+        int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "审核管理" , "撤销审核/" + dbHouse.getHouseTitle());
         if(ins != 1){
             log.info("插入操作记录失败");
         }

+ 3 - 15
src/main/java/fcb/project/manager/core/controller/ProjectController.java

@@ -92,16 +92,12 @@ public class ProjectController extends BaseController {
             tmEstate.setCreateByName(tokenMap.getNickName());
         }
         if (tmEstateService.insertNew(tmEstate)) {
-            int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "VR楼盘项目" , "创建楼盘/" + dbEstate.getEstateName() + "-成功");
+            int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "VR楼盘项目" , "创建楼盘/" + dbEstate.getEstateName());
             if(ins != 1){
                 log.info("插入操作记录失败");
             }
             return Result.success("新增成功");
         } else {
-            int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "VR楼盘项目" , "创建楼盘/" + dbEstate.getEstateName() + "-失败");
-            if(ins != 1){
-                log.info("插入操作记录失败");
-            }
             return Result.failure("新增失败");
         }
     }
@@ -136,13 +132,9 @@ public class ProjectController extends BaseController {
         }
         int delete = tmEstateService.deleteEstateById(estateId);
         if (delete != 1) {
-            int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "VR楼盘项目" , "删除楼盘/" + dbEstate.getEstateName() + "-失败");
-            if(ins != 1){
-                log.info("插入操作记录失败");
-            }
             return Result.failure("删除失败");
         }
-        int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "VR楼盘项目" , "删除楼盘/" + dbEstate.getEstateName() + "-成功");
+        int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "VR楼盘项目" , "删除楼盘/" + dbEstate.getEstateName());
         if(ins != 1){
             log.info("插入操作记录失败");
         }
@@ -167,16 +159,12 @@ public class ProjectController extends BaseController {
 
         }
         if (tmEstateService.updateEstate(tmEstate)) {
-            int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "VR楼盘项目" , "修改楼盘/" + dbEstate.getEstateName() + "-成功");
+            int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "VR楼盘项目" , "修改楼盘/" + dbEstate.getEstateName());
             if(ins != 1){
                 log.info("插入操作记录失败");
             }
             return Result.success("修改成功");
         } else {
-            int ins = tmOperationService.addNewWithTypeAndContent(getContextUserInfo() , "VR楼盘项目" , "修改楼盘/" + dbEstate.getEstateName() + "-失败");
-            if(ins != 1){
-                log.info("插入操作记录失败");
-            }
             return Result.failure("修改失败");
         }
     }