Browse Source

代码优化

wangyu 6 years ago
parent
commit
c5441f3cb7
1 changed files with 6 additions and 20 deletions
  1. 6 20
      icssman-service/src/main/java/com/diagbot/facade/DeptInfoFacade.java

+ 6 - 20
icssman-service/src/main/java/com/diagbot/facade/DeptInfoFacade.java

@@ -4,8 +4,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.DeptInfoDTO;
 import com.diagbot.entity.DeptInfo;
 import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.exception.CommonErrorCode;
-import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.DeptInfoServiceImpl;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.DateUtil;
@@ -40,12 +38,8 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
         deptInfo.setGmtCreate(now);
         deptInfo.setModifier(userId);
         deptInfo.setGmtModified(now);
-        Boolean flag = this.save(deptInfo);
-        if(!flag){
-            throw new CommonException(CommonErrorCode.FAIL,
-                    "科室信息添加失败");
-        }
-        return flag;
+        this.save(deptInfo);
+        return true;
     }
 
     /**
@@ -58,12 +52,8 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
         BeanUtil.copyProperties(updateDeptInfoVO,deptInfo);
         deptInfo.setModifier(UserUtils.getCurrentPrincipleID());
         deptInfo.setGmtModified(DateUtil.now());
-        Boolean flag = this.updateById(deptInfo);
-        if(!flag){
-            throw new CommonException(CommonErrorCode.FAIL,
-                    "科室信息修改失败");
-        }
-        return flag;
+        this.updateById(deptInfo);
+        return true;
     }
 
     /**
@@ -77,12 +67,8 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
         deptInfo.setModifier(UserUtils.getCurrentPrincipleID());
         deptInfo.setIsDeleted(IsDeleteEnum.Y.getKey());
         deptInfo.setGmtModified(DateUtil.now());
-        Boolean flag = this.updateById(deptInfo);
-        if(!flag){
-            throw new CommonException(CommonErrorCode.FAIL,
-                    "科室信息删除失败");
-        }
-        return flag;
+        this.updateById(deptInfo);
+        return true;
     }