|
@@ -6,7 +6,9 @@ import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
import cn.com.qmth.examcloud.commons.helpers.poi.ExcelWriter;
|
|
import cn.com.qmth.examcloud.commons.helpers.poi.ExcelWriter;
|
|
import cn.com.qmth.examcloud.commons.util.PathUtil;
|
|
import cn.com.qmth.examcloud.commons.util.PathUtil;
|
|
import cn.com.qmth.examcloud.core.oe.admin.api.bean.IllegallyTypeDomain;
|
|
import cn.com.qmth.examcloud.core.oe.admin.api.bean.IllegallyTypeDomain;
|
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.ExamAuditRepo;
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.IllegallyTypeRepo;
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.IllegallyTypeRepo;
|
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamAuditEntity;
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.entity.IllegallyTypeEntity;
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.entity.IllegallyTypeEntity;
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.IllegallyTypeService;
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.IllegallyTypeService;
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.bean.IllegallyTypeInfo;
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.bean.IllegallyTypeInfo;
|
|
@@ -22,6 +24,7 @@ import org.apache.commons.fileupload.disk.DiskFileItem;
|
|
import org.apache.commons.io.FileUtils;
|
|
import org.apache.commons.io.FileUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.data.domain.Example;
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.PageRequest;
|
|
import org.springframework.data.domain.PageRequest;
|
|
import org.springframework.data.domain.Sort;
|
|
import org.springframework.data.domain.Sort;
|
|
@@ -59,6 +62,9 @@ public class IllegallyTypeController extends ControllerSupport {
|
|
@Autowired
|
|
@Autowired
|
|
IllegallyTypeRepo illegallyTypeRepo;
|
|
IllegallyTypeRepo illegallyTypeRepo;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ ExamAuditRepo examAuditRepo;
|
|
|
|
+
|
|
private static final String[] EXCEL_HEADER = new String[]{"违纪类型名称", "违纪类型代码", "排序号"};
|
|
private static final String[] EXCEL_HEADER = new String[]{"违纪类型名称", "违纪类型代码", "排序号"};
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -266,6 +272,15 @@ public class IllegallyTypeController extends ControllerSupport {
|
|
if (null == one) {
|
|
if (null == one) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //判断审核表中是否存在当前类型的违纪类型
|
|
|
|
+ ExamAuditEntity examAudit =
|
|
|
|
+ examAuditRepo.findFirstByDisciplineTypeAndCreationTimeGreaterThan(one.getCode(), one.getCreationTime());
|
|
|
|
+ boolean isIllegallyTypeInUse = (null != examAudit);
|
|
|
|
+ if (isIllegallyTypeInUse) {
|
|
|
|
+ throw new StatusException("100001","违纪类型已使用不允许删除");
|
|
|
|
+ }
|
|
|
|
+
|
|
validateRootOrgIsolation(one.getRootOrgId());
|
|
validateRootOrgIsolation(one.getRootOrgId());
|
|
illegallyTypeRepo.delete(one);
|
|
illegallyTypeRepo.delete(one);
|
|
|
|
|