Преглед на файлове

修复代码走查打回问题,更新科目分析刷新为计算中

ting.yin преди 1 година
родител
ревизия
519f6423cd

+ 0 - 2
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/mark/service/Impl/MarkServiceImpl.java

@@ -1691,7 +1691,6 @@ public class MarkServiceImpl implements MarkService {
                                     && markStepDTO.getSubNumber().equals(question.getSubNumber())) {
                                 ScoreItem si = sList.get(i);
                                 si.setScore(null);
-                                sList.add(i, si);
                             }
                         }
                     }
@@ -1809,7 +1808,6 @@ public class MarkServiceImpl implements MarkService {
                         && markStepDTO.getSubNumber().equals(question.getSubNumber())) {
                     ScoreItem si = sList.get(i);
                     si.setScore(null);
-                    sList.add(i, si);
                 }
             }
         }

+ 19 - 1
stmms-web/src/main/java/cn/com/qmth/stmms/admin/config/SystemAuthController.java

@@ -14,8 +14,11 @@ import cn.com.qmth.stmms.common.enums.Role;
 import cn.com.qmth.stmms.common.enums.SystemAuthType;
 import cn.com.qmth.stmms.common.utils.AesUtils;
 import cn.com.qmth.stmms.common.utils.Encodes;
+
 import com.qmth.boot.tools.models.ByteArray;
+
 import net.sf.json.JSONObject;
+
 import org.apache.commons.io.IOUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -30,6 +33,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.util.Date;
@@ -85,7 +89,8 @@ public class SystemAuthController extends BaseController {
     @Logging(menu = "修改授权配置", type = LogType.UPDATE)
     @RoleRequire(Role.SYS_ADMIN)
     @RequestMapping(value = "/update", method = RequestMethod.POST)
-    public String update(HttpServletRequest request, SystemAuth systemAuth, MultipartFile file) {
+    public String update(HttpServletRequest request, RedirectAttributes redirectAttributes, SystemAuth systemAuth,
+            MultipartFile file) {
         if (SystemAuthType.ONLINE.equals(systemAuth.getType())) {
             SolarHttpUtil httpUtil = new SolarHttpUtil(systemAuth.getAccessKey(), systemAuth.getAccessSecret(), host,
                     uri);
@@ -101,6 +106,7 @@ public class SystemAuthController extends BaseController {
                 authCache.setAuth(false);
                 authCache.setDoubleTrack(false);
                 authCache.setExpireTime(null);
+                addMessage(redirectAttributes, "授权验证失败");
             }
         } else {
             try {
@@ -108,7 +114,12 @@ public class SystemAuthController extends BaseController {
                 JSONObject json = AppLicenseUtil.parseLicense(ByteArray.fromInputStream(file.getInputStream()).value());
                 authCache.parseJson(json);
                 authService.save(systemAuth);
+                if (json == null) {
+                    addMessage(redirectAttributes, "授权文件解析失败");
+                }
             } catch (IOException e) {
+                addMessage(redirectAttributes, "授权文件解析失败");
+                e.printStackTrace();
                 log.error("parseLicense error", e);
             }
         }
@@ -134,4 +145,11 @@ public class SystemAuthController extends BaseController {
         IOUtils.copy(new ByteArrayInputStream(data), response.getOutputStream());
     }
 
+    protected void addMessage(RedirectAttributes redirectAttributes, String... messages) {
+        StringBuilder sb = new StringBuilder();
+        for (String message : messages) {
+            sb.append(message).append(messages.length > 1 ? "<br/>" : "");
+        }
+        redirectAttributes.addFlashAttribute("message", sb.toString());
+    }
 }

+ 3 - 5
stmms-web/src/main/java/cn/com/qmth/stmms/admin/exam/LibraryController.java

@@ -364,11 +364,9 @@ public class LibraryController extends BaseExamController {
                     lockService.watch(LockType.GROUP, library.getExamId(), library.getSubjectCode(),
                             library.getGroupNumber());
                     lockService.waitlock(LockType.STUDENT, library.getStudentId());
-
-                    if (((libraryService.hasApplied(library, wu.getId())
-                            && (library.getStatus().equals(LibraryStatus.MARKED)) || library.getStatus().equals(
-                            LibraryStatus.INSPECTED)) && markService.rejectLibrary(library,
-                            rejectResult.getQuestionList(), wu.getId(), rejectResult.getReason()))) {
+                    if ( libraryService.hasApplied(library, wu.getId())
+                         &&  (library.getStatus().equals(LibraryStatus.MARKED)|| library.getStatus().equals(LibraryStatus.INSPECTED))
+                         &&  markService.rejectLibrary(library,rejectResult.getQuestionList(), wu.getId(), rejectResult.getReason())) {
                         libraryService.releaseByLibrary(library);
                         obj.accumulate("success", true);
                     } else {

+ 5 - 2
stmms-web/src/main/webapp/WEB-INF/views/modules/report/reportSubjectRange.jsp

@@ -91,17 +91,20 @@
 <script type="text/javascript">
 $(document).ready(function () {
 	var old = "${oldSubjectCode}";
+	var locked = "${locked}";
 	if(old==""){
 	    $('#btnSubmit').attr("type","button");
 	    $('#refresh').hide();
     }else{
     	$('#btnSubmit').attr("type","hidden");
     	$('#refresh').show();
-    	var locked = '${locked}';
     	if(locked!='false'){
+    		$('#refresh').text("计算中");
 	    	window.setTimeout(function(){
 	    		goSearch();
-	    	},30*1000);
+	    	},5*1000);
+    	}else{
+    		$('#refresh').text("刷新");
     	}
     }
 });