|
@@ -9,6 +9,7 @@ import com.diagbot.dto.GetQuestionUsualAndTypeDTO;
|
|
|
import com.diagbot.dto.QuestionTypeDTO;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
|
import com.diagbot.entity.DeptInfo;
|
|
|
+import com.diagbot.entity.QuestionUsual;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.enums.QuestionTypeEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
@@ -121,6 +122,13 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
|
|
|
throw new CommonException(CommonErrorCode.NOT_EXISTS,
|
|
|
"科室已删除");
|
|
|
}
|
|
|
+ QueryWrapper<QuestionUsual> questionUsualQueryWrapper = new QueryWrapper<>();
|
|
|
+ questionUsualQueryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey())
|
|
|
+ .eq("dept_id",deleteDeptInfoVO.getId());
|
|
|
+ if(questionUsualFacade.count(questionUsualQueryWrapper) > 0){
|
|
|
+ throw new CommonException(CommonErrorCode.NOT_EXISTS,
|
|
|
+ "与常用标签关联未删除");
|
|
|
+ }
|
|
|
//删除操作
|
|
|
DeptInfo deptInfo = new DeptInfo();
|
|
|
deptInfo.setId(Long.parseLong(deleteDeptInfoVO.getId()));
|