Bläddra i källkod

fix 题库导入

he2802 3 år sedan
förälder
incheckning
2208afb7c1

+ 9 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/CertificateServiceImpl.java

@@ -14,6 +14,7 @@ import com.zhongzheng.modules.base.domain.Certificate;
 import com.zhongzheng.modules.base.mapper.CertificateMapper;
 import com.zhongzheng.modules.base.service.ICertificateService;
 import com.zhongzheng.modules.base.vo.CertificateVo;
+import com.zhongzheng.modules.course.domain.CourseSection;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -110,10 +111,16 @@ public class CertificateServiceImpl extends ServiceImpl<CertificateMapper, Certi
 
     private boolean checkNameUnique(Certificate entity) {
         Certificate info = getOne(new LambdaQueryWrapper<Certificate>()
-                .eq(Certificate::getCertificateName,entity.getCertificateName())
+                .eq(Certificate::getCertificateName,entity.getCertificateName()).ne(Certificate::getStatus,-1)
                 .last("limit 1"));
         if (Validator.isNotNull(info)) {
-            return true;
+            if(Validator.isNotEmpty(entity.getId())){
+                if(entity.getId().longValue() != info.getId().longValue()){
+                    return true;
+                }
+            }else{
+                return true;
+            }
         }
         return false;
     }