Pārlūkot izejas kodu

Merge branch 'dev_v2.2.0' of http://git.qmth.com.cn/wangliang/distributed-print-service into dev_v2.2.0

xiaof 3 gadi atpakaļ
vecāks
revīzija
152b48b629

+ 4 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java

@@ -1731,6 +1731,10 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                 .stream()
                 .filter(e -> OrgTypeEnum.COLLEGE.equals(e.getType()))
                 .collect(Collectors.toList());
+//        List<SysOrg> collegeList = sysOrgService.findByConnectByParentId(teachingRoom.getId(),true)
+//                .stream()
+//                .filter(e -> OrgTypeEnum.COLLEGE.equals(e.getType()))
+//                .collect(Collectors.toList());
         if (CollectionUtils.isEmpty(collegeList)){
             throw ExceptionResultEnum.ERROR.exception("找不到学院");
         }

+ 5 - 7
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/PrintCommonServiceServiceImpl.java

@@ -43,10 +43,7 @@ import org.springframework.util.FileCopyUtils;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
+import java.io.*;
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import java.util.*;
@@ -335,9 +332,10 @@ public class PrintCommonServiceServiceImpl implements PrintCommonService {
 
     /**
      * 保存html附件和该html转成pdf的附件
-     * @param fileName 文件名称
+     *
+     * @param fileName    文件名称
      * @param htmlContent html内容
-     * @param userId 创建人
+     * @param userId      创建人
      * @return 两个附件对象
      */
     @Transactional
@@ -396,7 +394,7 @@ public class PrintCommonServiceServiceImpl implements PrintCommonService {
                 // htmlMd5
                 jsonObject.put("htmlMd5", DigestUtils.md5Hex(new FileInputStream(localHtmlFile)));
                 jsonObject.put("pdfMd5", fileMd5);
-            }else {//上传至服务器
+            } else {//上传至服务器
                 File finalFile = new File(stringJoiner.toString());
                 if (!finalFile.exists()) {
                     finalFile.getParentFile().mkdirs();

+ 3 - 3
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/OrgCenterDataDisposeServiceImpl.java

@@ -60,9 +60,9 @@ public class OrgCenterDataDisposeServiceImpl implements OrgCenterDataDisposeServ
             String logo = String.valueOf(map.get("logo"));
             String accessKey = String.valueOf(map.get("accessKey"));
             String accessSecret = String.valueOf(map.get("accessSecret"));
-            Map typeMap = JSONObject.parseObject(String.valueOf(map.get("type")));
-            String typeCode = String.valueOf(typeMap.get("code"));
-            String typeName = String.valueOf(typeMap.get("name"));
+//            Map typeMap = JSONObject.parseObject(String.valueOf(map.get("type")));
+//            String typeCode = String.valueOf(typeMap.get("code"));
+//            String typeName = String.valueOf(typeMap.get("name"));
 
             List<BasicSchool> oldSchoolList = basicSchoolList.stream().filter(e -> e.getCode().equals(code)).collect(Collectors.toList());
             if (oldSchoolList.size() > 1) {

+ 12 - 10
teachcloud-common/src/main/java/com/qmth/teachcloud/common/util/FileStoreUtil.java

@@ -35,9 +35,9 @@ public class FileStoreUtil {
      * @param inputStream 流
      * @param type        fileStore类型
      */
-    public void ossUpload(String dirName, InputStream inputStream,String md5, String type) throws Exception {
+    public void ossUpload(String dirName, InputStream inputStream, String md5, String type) throws Exception {
         log.info("ossUpload is come in");
-        fileService.getFileStore(type).write(dirName, inputStream,md5);
+        fileService.getFileStore(type).write(dirName, inputStream, md5);
         log.info("dirName:{}", dirName);
     }
 
@@ -48,7 +48,7 @@ public class FileStoreUtil {
      * @param file    文件
      * @param type    fileStore类型
      */
-    public void ossUpload(String dirName, File file,String md5, String type) throws Exception {
+    public void ossUpload(String dirName, File file, String md5, String type) throws Exception {
         log.info("ossUpload is come in");
         fileService.getFileStore(type).write(dirName, new FileInputStream(file), md5);
         log.info("dirName:{}", dirName);
@@ -108,17 +108,18 @@ public class FileStoreUtil {
 
     /**
      * 获取文件访问url
+     *
      * @param objectPath 文件路径
-     * @param type 文件上传的类型
+     * @param type       文件上传的类型
      * @return
      */
     public String getPrivateUrl(String objectPath, String type) {
         String server;
-        if ("public".equals(type)){
+        if ("public".equals(type)) {
             server = dictionaryConfig.fssPublicDomain().getServer();
-        }else if ("private".equals(type)){
+        } else if ("private".equals(type)) {
             server = dictionaryConfig.fssPrivateDomain().getServer();
-        }else {
+        } else {
             throw ExceptionResultEnum.ERROR.exception("文件存储store类型不存在");
         }
 
@@ -127,12 +128,13 @@ public class FileStoreUtil {
 
     /**
      * 根据数据库文件路径判断文件上传类型
+     *
      * @param path 路径
      * @return 类型
      */
-    public UploadFileEnum getUploadEnumByPath(String path){
-        path = path.replaceAll("\\\\","/");
-        String target = path.substring(0,path.indexOf('/'));
+    public UploadFileEnum getUploadEnumByPath(String path) {
+        path = path.replaceAll("\\\\", "/");
+        String target = path.substring(0, path.indexOf('/'));
         return UploadFileEnum.valueOf(target.toUpperCase());
     }