|
@@ -1,8 +1,6 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.diagbot.entity.DeptInfo;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
@@ -11,15 +9,12 @@ import com.diagbot.service.impl.DeptInfoServiceImpl;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.DateUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
-import com.diagbot.util.StringUtil;
|
|
|
import com.diagbot.util.UserUtils;
|
|
|
import com.diagbot.vo.AddDeptInfoVO;
|
|
|
import com.diagbot.vo.GetDeptInfoVO;
|
|
|
import com.diagbot.vo.UpdateDeptInfoVO;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
/**
|
|
|
* @Description:
|
|
|
* @Author:zhaops
|
|
@@ -85,19 +80,11 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
|
|
|
|
|
|
|
|
|
public IPage<DeptInfo> getDeptInfo(GetDeptInfoVO getDeptInfoVO){
|
|
|
- IPage iPage =new Page();
|
|
|
- BeanUtil.copyProperties(getDeptInfoVO,iPage);
|
|
|
- QueryWrapper<DeptInfo> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey());
|
|
|
- if (StringUtil.isNotEmpty(getDeptInfoVO.getName())){
|
|
|
- queryWrapper.eq("name",getDeptInfoVO.getName());
|
|
|
- }
|
|
|
- List<DeptInfo> deptInfoList = this.list(queryWrapper);
|
|
|
- if (ListUtil.isEmpty(deptInfoList)){
|
|
|
+ IPage iPage = this.getAllDeptInfo(getDeptInfoVO);
|
|
|
+ if (ListUtil.isEmpty(iPage.getRecords())){
|
|
|
throw new CommonException(CommonErrorCode.FAIL,
|
|
|
"获取科室信息失败");
|
|
|
}
|
|
|
- iPage.setRecords(deptInfoList);
|
|
|
return iPage;
|
|
|
}
|
|
|
}
|