Przeglądaj źródła

调试Bug修改

xiaof 3 lat temu
rodzic
commit
da2e12510a

+ 1 - 1
src/main/java/cn/com/qmth/print/manage/controller/ConditionController.java

@@ -23,7 +23,7 @@ import java.util.stream.Collectors;
  */
 @RestController
 @RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/condition")
-@Aac(strict = BOOL.FALSE, auth = BOOL.FALSE)
+@Aac(strict = BOOL.FALSE, auth = BOOL.TRUE)
 public class ConditionController {
 
     @Autowired

+ 9 - 12
src/main/java/cn/com/qmth/print/manage/controller/ExamController.java

@@ -1,28 +1,25 @@
 package cn.com.qmth.print.manage.controller;
 
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.RequestAttribute;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
 import cn.com.qmth.print.manage.entity.ExamEntity;
 import cn.com.qmth.print.manage.service.ExamService;
 import cn.com.qmth.print.manage.service.PmSession;
 import cn.com.qmth.print.manage.service.query.ExamQuery;
-
 import com.qmth.boot.api.annotation.Aac;
 import com.qmth.boot.api.annotation.BOOL;
 import com.qmth.boot.api.constant.ApiConstant;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
 
 /**
  * @Date: 2021/11/16.
  */
 @RestController
 @RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/exam")
-@Aac(strict = BOOL.FALSE, auth = BOOL.FALSE)
+@Aac(strict = BOOL.FALSE, auth = BOOL.TRUE)
 public class ExamController extends BaseController {
 
     @Autowired
@@ -45,8 +42,8 @@ public class ExamController extends BaseController {
      * @return
      */
     @RequestMapping(value = "/list", method = RequestMethod.POST)
-    public Object list(@RequestParam Long orgId) {
-        return examService.listByOrgId(orgId);
+    public Object list() {
+        return examService.listByOrgId();
     }
 
     /**

+ 1 - 1
src/main/java/cn/com/qmth/print/manage/controller/OrgController.java

@@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 @RestController
 @RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/org")
-@Aac(strict = BOOL.FALSE, auth = BOOL.FALSE)
+@Aac(strict = BOOL.FALSE, auth = BOOL.TRUE)
 public class OrgController {
 
     @Autowired

+ 1 - 1
src/main/java/cn/com/qmth/print/manage/service/ExamService.java

@@ -11,7 +11,7 @@ import java.util.List;
 
 public interface ExamService extends IService<ExamEntity> {
 
-    List<ExamEntity> listByOrgId(Long orgId);
+    List<ExamEntity> listByOrgId();
 
     Long saveExam(ExamEntity exam);
 

+ 2 - 2
src/main/java/cn/com/qmth/print/manage/service/impl/ExamServiceImpl.java

@@ -40,9 +40,9 @@ public class ExamServiceImpl extends ServiceImpl<ExamDao, ExamEntity> implements
     private ExamDao examDao;
 
     @Override
-    public List<ExamEntity> listByOrgId(Long orgId) {
+    public List<ExamEntity> listByOrgId() {
         QueryWrapper<ExamEntity> queryWrapper = new QueryWrapper<>();
-        queryWrapper.lambda().eq(ExamEntity::getOrgId, orgId).orderByDesc(ExamEntity::getId);
+        queryWrapper.lambda().orderByDesc(ExamEntity::getId);
         return this.list(queryWrapper);
     }
 

+ 4 - 21
src/main/java/cn/com/qmth/print/manage/service/impl/ExamStudentServiceImpl.java

@@ -1,19 +1,6 @@
 package cn.com.qmth.print.manage.service.impl;
 
 import cn.com.qmth.print.manage.dao.ExamDao;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringJoiner;
-import java.util.concurrent.atomic.AtomicLong;
-
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.lang.StringUtils;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.transaction.interceptor.TransactionAspectSupport;
-import org.springframework.web.multipart.MultipartFile;
-
 import cn.com.qmth.print.manage.dao.ExamStudentDao;
 import cn.com.qmth.print.manage.dto.StudentDTO;
 import cn.com.qmth.print.manage.entity.ExamEntity;
@@ -23,7 +10,6 @@ import cn.com.qmth.print.manage.service.ExamStudentService;
 import cn.com.qmth.print.manage.service.query.ExamStudentQuery;
 import cn.com.qmth.print.manage.utils.excel.ExcelError;
 import cn.com.qmth.print.manage.utils.excel.ExcelReader;
-
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -32,8 +18,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.boot.core.exception.StatusException;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
-import org.checkerframework.checker.signature.qual.PolySignature;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
@@ -45,7 +29,6 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import java.util.StringJoiner;
-import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
 
 @Service
@@ -108,16 +91,16 @@ public class ExamStudentServiceImpl extends ServiceImpl<ExamStudentDao, ExamStud
         }
         queryWrapper.lambda().eq(ExamStudentEntity::getExamId, query.getExamId());
         if (StringUtils.isNotBlank(query.getExamNumber())) {
-            queryWrapper.lambda().eq(ExamStudentEntity::getExamNumber, query.getExamNumber());
+            queryWrapper.lambda().like(ExamStudentEntity::getExamNumber, "%" + query.getExamNumber() + "%");
         }
         if (StringUtils.isNotBlank(query.getCourseCode())) {
-            queryWrapper.lambda().eq(ExamStudentEntity::getCourseCode, query.getCourseCode());
+            queryWrapper.lambda().like(ExamStudentEntity::getCourseCode, "%" + query.getCourseCode() + "%");
         }
         if (StringUtils.isNotBlank(query.getExamSite())) {
-            queryWrapper.lambda().eq(ExamStudentEntity::getExamSite, query.getExamSite());
+            queryWrapper.lambda().like(ExamStudentEntity::getExamSite, "%" + query.getExamSite() + "%");
         }
         if (StringUtils.isNotBlank(query.getExamRoom())) {
-            queryWrapper.lambda().eq(ExamStudentEntity::getExamRoom, query.getExamRoom());
+            queryWrapper.lambda().like(ExamStudentEntity::getExamRoom, "%" + query.getExamRoom() + "%");
         }
         Page page = new Page(query.getPageNumber(), query.getPageSize());
         return this.page(page, queryWrapper);

+ 3 - 4
src/main/java/cn/com/qmth/print/manage/service/impl/OrgServiceImpl.java

@@ -15,7 +15,6 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
-import javax.annotation.Resource;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -32,10 +31,10 @@ public class OrgServiceImpl extends ServiceImpl<OrgDao, OrgEntity> implements Or
     public IPage<OrgEntity> pageQuery(OrgQuery query) {
         QueryWrapper<OrgEntity> queryWrapper = new QueryWrapper<>();
         if (StringUtils.isNotEmpty(query.getCode())) {
-            queryWrapper.lambda().like(OrgEntity::getCode, query.getCode());
+            queryWrapper.lambda().like(OrgEntity::getCode, query.getCode() + "%");
         }
         if (StringUtils.isNotEmpty(query.getName())) {
-            queryWrapper.lambda().like(OrgEntity::getName, query.getName());
+            queryWrapper.lambda().like(OrgEntity::getName, query.getName() + "%");
         }
         queryWrapper.lambda().orderByAsc(OrgEntity::getId);
         Page<OrgEntity> page = new Page<>(query.getPageNumber(), query.getPageSize());
@@ -75,7 +74,7 @@ public class OrgServiceImpl extends ServiceImpl<OrgDao, OrgEntity> implements Or
                 String accessSecret = String.valueOf(map.get("accessSecret"));
 
                 OrgEntity entity = null;
-                if(!CollectionUtils.isEmpty(orgEntities)){
+                if (!CollectionUtils.isEmpty(orgEntities)) {
                     entity = orgEntities.stream().filter(m -> m.getCode().equals(code)).findFirst().get();
                 }
                 if (entity == null) {

+ 1 - 1
src/main/java/cn/com/qmth/print/manage/service/impl/UserServiceImpl.java

@@ -26,7 +26,7 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
     public IPage<UserEntity> pageQuery(UserQuery query) {
         QueryWrapper<UserEntity> queryWrapper = new QueryWrapper<>();
         if (StringUtils.isNotEmpty(query.getLoginName())) {
-            queryWrapper.lambda().like(UserEntity::getLoginName, query.getLoginName());
+            queryWrapper.lambda().like(UserEntity::getLoginName, query.getLoginName() + "%");
         }
         if (query.getRole() != null) {
             queryWrapper.lambda().eq(UserEntity::getRole, query.getRole());

+ 2 - 2
src/main/resources/mapper/ExamDao.xml

@@ -16,10 +16,10 @@
         <where>
             pe.enable = #{query.enable}
             <if test="query.name != null and query.name != ''">
-                and pe.name = #{query.name}
+                and pe.name like concat(#{query.name},"%")
             </if>
             <if test="query.orgId != null and query.orgId != ''">
-                and pe.name = #{query.orgId}
+                and pe.org_id = #{query.orgId}
             </if>
         </where>
     </select>