|
@@ -13,7 +13,6 @@ import com.diagbot.exception.CommonException;
|
|
|
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.UserUtils;
|
|
|
import com.diagbot.vo.AddDeptInfoVO;
|
|
|
import com.diagbot.vo.GetDeptInfoDetialsVO;
|
|
@@ -72,6 +71,13 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
|
|
|
* @return
|
|
|
*/
|
|
|
public Boolean updateDeptInfo(UpdateDeptInfoVO updateDeptInfoVO) {
|
|
|
+ QueryWrapper<DeptInfo> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("is_deleted",IsDeleteEnum.Y.getKey());
|
|
|
+ queryWrapper.eq("id",updateDeptInfoVO.getId());
|
|
|
+ if(this.count(queryWrapper) > 0){
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,
|
|
|
+ "科室已删除");
|
|
|
+ }
|
|
|
DeptInfo deptInfo = this.getById(updateDeptInfoVO.getId());
|
|
|
BeanUtil.copyProperties(updateDeptInfoVO, deptInfo);
|
|
|
deptInfo.setModifier(UserUtils.getCurrentPrincipleID());
|
|
@@ -87,6 +93,13 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
|
|
|
* @return
|
|
|
*/
|
|
|
public Boolean deleteDeptInfo(UpdateDeptInfoVO updateDeptInfoVO) {
|
|
|
+ QueryWrapper<DeptInfo> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("is_deleted",IsDeleteEnum.Y.getKey());
|
|
|
+ queryWrapper.eq("id",updateDeptInfoVO.getId());
|
|
|
+ if(this.count(queryWrapper) > 0){
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,
|
|
|
+ "科室已删除");
|
|
|
+ }
|
|
|
DeptInfo deptInfo = new DeptInfo();
|
|
|
BeanUtil.copyProperties(updateDeptInfoVO, deptInfo);
|
|
|
deptInfo.setModifier(UserUtils.getCurrentPrincipleID());
|