瀏覽代碼

daqian modify for file upload

daqian 4 年之前
父節點
當前提交
c45ac9e3a7

+ 2 - 1
.gitignore

@@ -74,7 +74,7 @@ cmake-build-*/
 
 # IntelliJ
 out/
-
+.idea/
 # mpeltonen/sbt-idea plugin
 .idea_modules/
 
@@ -155,3 +155,4 @@ local.properties
 .worksheet
 
 /src/main/webapp/upload/avatar/
+/target/classes/

+ 81 - 0
jfinal-club.iml

@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
+    <output url="file://$MODULE_DIR$/target/classes" />
+    <output-test url="file://$MODULE_DIR$/target/test-classes" />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
+      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+      <excludeFolder url="file://$MODULE_DIR$/target" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="library" name="Maven: com.jfinal:jfinal:4.8" level="project" />
+    <orderEntry type="library" name="Maven: com.jfinal:jfinal-undertow:2.0" level="project" />
+    <orderEntry type="library" name="Maven: io.undertow:undertow-core:2.0.28.Final" level="project" />
+    <orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.0.Final" level="project" />
+    <orderEntry type="library" name="Maven: org.jboss.xnio:xnio-api:3.3.8.Final" level="project" />
+    <orderEntry type="library" scope="RUNTIME" name="Maven: org.jboss.xnio:xnio-nio:3.3.8.Final" level="project" />
+    <orderEntry type="library" name="Maven: io.undertow:undertow-servlet:2.0.28.Final" level="project" />
+    <orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:4.0.1" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.1" level="project" />
+    <orderEntry type="library" name="Maven: org.slf4j:slf4j-nop:1.7.29" level="project" />
+    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.29" level="project" />
+    <orderEntry type="library" name="Maven: com.alibaba:druid:1.0.29" level="project" />
+    <orderEntry type="module-library">
+      <library name="Maven: com.alibaba:jconsole:1.8.0">
+        <CLASSES>
+          <root url="jar://C:/Program Files/Java/jdk1.8.0_231/lib/jconsole.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library name="Maven: com.alibaba:tools:1.8.0">
+        <CLASSES>
+          <root url="jar://C:/Program Files/Java/jdk1.8.0_231/lib/tools.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.15" level="project" />
+    <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
+    <orderEntry type="library" name="Maven: mysql:mysql-connector-java:5.1.44" level="project" />
+    <orderEntry type="library" name="Maven: com.jfinal:cos:2019.8" level="project" />
+    <orderEntry type="library" name="Maven: net.sf.ehcache:ehcache-core:2.6.11" level="project" />
+    <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.9" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.commons:commons-email:1.2" level="project" />
+    <orderEntry type="library" name="Maven: javax.mail:mail:1.4.1" level="project" />
+    <orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
+    <orderEntry type="library" name="Maven: org.jsoup:jsoup:1.9.2" level="project" />
+    <orderEntry type="library" name="Maven: joda-time:joda-time:2.9.3" level="project" />
+    <orderEntry type="library" name="Maven: it.sauronsoftware.cron4j:cron4j:2.2.5" level="project" />
+    <orderEntry type="library" name="Maven: com.google.zxing:javase:3.2.1" level="project" />
+    <orderEntry type="library" name="Maven: com.google.zxing:core:3.2.1" level="project" />
+    <orderEntry type="library" name="Maven: com.beust:jcommander:1.48" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.4" level="project" />
+    <orderEntry type="library" name="Maven: commons-io:commons-io:2.6" level="project" />
+    <orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-dysmsapi:1.0.0" level="project" />
+    <orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-core:2.4.2" level="project" />
+    <orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-sms:3.0.0-rc1" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.3" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.6" level="project" />
+    <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.2" level="project" />
+    <orderEntry type="library" name="Maven: commons-httpclient:commons-httpclient:3.1" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.12" level="project" />
+    <orderEntry type="library" name="Maven: org.jodconverter:jodconverter-local:4.3.0" level="project" />
+    <orderEntry type="library" name="Maven: org.jodconverter:jodconverter-core:4.3.0" level="project" />
+    <orderEntry type="library" scope="RUNTIME" name="Maven: com.google.code.gson:gson:2.8.6" level="project" />
+    <orderEntry type="library" name="Maven: org.openoffice:juh:4.1.2" level="project" />
+    <orderEntry type="library" name="Maven: org.openoffice:jurt:4.1.2" level="project" />
+    <orderEntry type="library" name="Maven: org.openoffice:ridl:4.1.2" level="project" />
+    <orderEntry type="library" name="Maven: org.openoffice:unoil:4.1.2" level="project" />
+    <orderEntry type="library" name="Maven: org.icepdf.os:icepdf-core:6.2.2" level="project" />
+    <orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.54" level="project" />
+    <orderEntry type="library" name="Maven: org.bouncycastle:bcprov-ext-jdk15on:1.54" level="project" />
+    <orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.54" level="project" />
+  </component>
+</module>

+ 2 - 2
pom.xml

@@ -173,9 +173,9 @@
         </dependency>
 
         <dependency>
-            <groupId>org.apache.commons</groupId>
+            <groupId>commons-io</groupId>
             <artifactId>commons-io</artifactId>
-            <version>1.3.2</version>
+            <version>2.6</version>
         </dependency>
         <!-- 阿里云短信jar包 start -->
         <dependency>

+ 22 - 40
src/main/java/com/jfinal/club/_admin/banners/BannersAdminController.java

@@ -79,42 +79,32 @@ public class BannersAdminController extends BaseController {
         UploadFile uf = null;
         try {
             uf = getFile("filenames", mySettingSrv.getAvatarTempDir(), mySettingSrv.getAvatarMaxSize());
-            if (uf == null) {
-                renderJson(Ret.fail("msg", "请先选择上传文件"));
-                return;
-            }
-        } catch (Exception e) {
-            if (e instanceof com.jfinal.upload.ExceededSizeException) {
-                renderJson(Ret.fail("msg", "文件大小超出范围"));
-            } else {
-                if (uf != null) {
-                    // 只有出现异常时才能删除,不能在 finally 中删,因为后面需要用到上传文件
-                    uf.getFile().delete();
+
+            Banners banners = getModel(Banners.class);
+            if (uf == null){
+                if(banners.getId() == null){
+                    renderJson(Ret.fail("msg", "请先选择上传文件"));
+                    return;
+                }
+            }else {
+                Ret ret = mySettingSrv.uploadAvatar(1, uf);
+                if (ret.isOk()) {   //上传成功则将文件 url 径暂存起来,供下个环节进行裁切
+                    String avatarUrl = ret.get("avatarUrl").toString();
+                    banners.setPicurl(avatarUrl);
+                } else {
+                    renderJson(ret);
                 }
-                renderJson(Ret.fail("msg", e.getMessage()));
             }
-            return;
-        }
-        Banners banners = getModel(Banners.class);
-        Ret ret = mySettingSrv.uploadAvatar(1, uf);
-        if (ret.isOk()) {   // 上传成功则将文件 url 径暂存起来,供下个环节进行裁切
-            String avatarUrl = ret.get("avatarUrl").toString();
-            banners.setPicurl(avatarUrl);
-            Ret ret1 = bannersService.saveBanner(banners);
-            renderJson(ret1);
-        } else {
-            renderJson(ret);
-        }
-    }
 
+            Ret ret1;
+            if(banners.getId() == null){
+                ret1 = bannersService.saveBanner(banners);
+            }else {
+                ret1 = bannersService.updateBanner(banners);
+            }
+            //renderJson(ret1);
+            redirect("edit?id="+banners.getId());
 
-    /**
-     * 提交修改
-     */
-    public void update() {
-        UploadFile uf = null;
-        try {
-            uf = getFile("filenames", mySettingSrv.getAvatarTempDir(), mySettingSrv.getAvatarMaxSize());
         } catch (Exception e) {
             if (e instanceof com.jfinal.upload.ExceededSizeException) {
                 renderJson(Ret.fail("msg", "文件大小超出范围"));
@@ -127,14 +117,6 @@ public class BannersAdminController extends BaseController {
             }
             return;
         }
-        Banners banners = getBean(Banners.class);
-        if (uf != null) {
-            Ret ret = mySettingSrv.uploadAvatar(1, uf);
-            String avatarUrl = ret.get("avatarUrl").toString();
-            banners.setPicurl(avatarUrl);
-        }
-        Ret ret = bannersService.updateBanner(banners);
-        renderJson(ret);
     }
 
 //    /**

+ 6 - 2
src/main/java/com/jfinal/club/_admin/doc/DocAdminController.java

@@ -35,7 +35,6 @@ import java.util.List;
  */
 public class DocAdminController extends BaseController {
 
-
     @Inject
     IndexService indexSrv;
 
@@ -78,6 +77,12 @@ public class DocAdminController extends BaseController {
         render("add_edit.html");
     }
 
+    public void convert(){
+        Integer docId = getInt("id");
+        docAdminService.docConvert(docId);
+        redirect("edit?id="+docId);
+    }
+
     public void delete() {
         Ret ret = usersDocService.deleteById(getParaToInt("id"));
         renderJson(ret);
@@ -126,7 +131,6 @@ public class DocAdminController extends BaseController {
     /**
      * 提交修改
      */
-    @Before(DocAdminValidator.class)
     public void update() {
         Doc doc = getBean(Doc.class);
         Ret ret = usersDocService.updateDoc(doc, "", 0);

+ 34 - 3
src/main/java/com/jfinal/club/_admin/doc/DocAdminService.java

@@ -17,23 +17,55 @@
 
 package com.jfinal.club._admin.doc;
 
+import com.jfinal.club.common.doc.convert.PdfTransferUtil;
+import com.jfinal.club.common.doc.convert.TransferUtil;
 import com.jfinal.club.common.model.Doc;
 import com.jfinal.club.common.model.Project;
+import com.jfinal.kit.PathKit;
 import com.jfinal.kit.Ret;
 import com.jfinal.kit.StrKit;
 import com.jfinal.plugin.activerecord.Db;
 import com.jfinal.plugin.activerecord.Page;
+import lombok.extern.log4j.Log4j;
 
+import java.io.File;
+import java.nio.file.Paths;
 import java.util.Date;
 
 /**
  * project 管理业务
  */
+@Log4j
 public class DocAdminService {
-
-
     private Doc dao = new Doc().dao();
 
+    /**
+     * 文档转换
+     * @param docId
+     */
+    public void docConvert(int docId){
+        Doc doc = dao.findById(docId);
+        if(null == doc){
+            return;
+        }
+        try {
+
+            String pdfFilePath = TransferUtil.transferWordToPdf(doc.getDocurl());
+            if(null != pdfFilePath){
+                doc.setCovertStatus(1);
+                doc.setCoverturl(pdfFilePath);
+                String imgPath = PdfTransferUtil.pdf2Pic(pdfFilePath);
+                doc.setImgUrl(imgPath);
+                log.info("id:"+docId+" convert success!");
+            }else {
+                doc.setCovertStatus(9);
+                log.info("id:"+docId+" convert error!");
+            }
+            doc.update();
+        } catch (Exception e) {
+            log.error("file convert",e);
+        }
+    }
 
     public Page<Doc> paginate(int pageNum, String text) {
         String parm = "";
@@ -102,5 +134,4 @@ public class DocAdminService {
         Db.update("update project set report = 0 where id=?", id);
         return Ret.ok("msg", "解除锁定成功");
     }
-
 }

+ 5 - 0
src/main/java/com/jfinal/club/common/banner/BannersService.java

@@ -6,6 +6,7 @@ import com.jfinal.kit.Ret;
 import com.jfinal.plugin.activerecord.Page;
 
 import java.util.Date;
+import java.util.List;
 
 public class BannersService {
 
@@ -23,6 +24,10 @@ public class BannersService {
         return bannersdao.paginate(1, size, "select *", "from banners where type = ? order by sort desc ,addtime desc", type);
     }
 
+    public List<Banners> selectAllBanners(){
+        return bannersdao.findAll();
+    }
+
     /**
      * @return
      * @Author Cc

+ 5 - 4
src/main/java/com/jfinal/club/common/doc/convert/PdfTransferUtil.java

@@ -1,5 +1,6 @@
 package com.jfinal.club.common.doc.convert;
 
+import com.jfinal.kit.PathKit;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.io.FilenameUtils;
 import org.icepdf.core.pobjects.Document;
@@ -106,9 +107,9 @@ public class PdfTransferUtil {
         try{
             File returnFile = Paths.get(FilenameUtils.getPath(pdfPath),FilenameUtils.getBaseName(pdfPath)+".png").toFile();
             Document document = new Document();
-            document.setFile(pdfPath);
+            document.setFile(Paths.get(PathKit.getWebRootPath(),pdfPath).toString());
             //缩放比例
-            float scale = 2.5f;
+            float scale = 0.5f;
             //旋转角度
             float rotation = 0f;
 
@@ -116,14 +117,14 @@ public class PdfTransferUtil {
                 BufferedImage image = (BufferedImage)document.getPageImage(0, GraphicsRenderingHints.SCREEN, org.icepdf.core.pobjects.Page.BOUNDARY_CROPBOX, rotation, scale);
                 RenderedImage rendImage = image;
                 try {
-                    ImageIO.write(rendImage, "png", returnFile);
+                    ImageIO.write(rendImage, "png",Paths.get(PathKit.getWebRootPath(),returnFile.getPath()).toFile());
                 } catch (Exception e) {
                     log.error("pdf2Pic",e);
                 }
                 image.flush();
             //}
             document.dispose();
-            return returnFile.getPath();
+            return "/" + returnFile.getPath();
         }catch (Exception ex){
             log.error("pdf2Pic",ex);
         }

+ 11 - 8
src/main/java/com/jfinal/club/common/doc/convert/TransferUtil.java

@@ -1,5 +1,6 @@
 package com.jfinal.club.common.doc.convert;
 
+import com.jfinal.kit.PathKit;
 import com.jfinal.upload.UploadFile;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.io.FileUtils;
@@ -44,25 +45,27 @@ public class TransferUtil {
      * @return 相同文件夹下的转换后的pdf文件 如/test/wd_20190517151515333.pdf
      * @throws Exception
      */
-    public static File transferWordToPdf(String originLocalFilePath) throws Exception {
+    public static String transferWordToPdf(String originContextFilePath) throws Exception {
         //转换成本地实际磁盘路径
-        File inputFile = new File(originLocalFilePath);
+        File inputFile = new File(Paths.get(PathKit.getWebRootPath(),originContextFilePath).toString());
 
-        if (!inputFile.exists() || !inputFile.isFile() || isOfficeFile(FilenameUtils.getExtension(originLocalFilePath))) {
-            throw new Exception("文件 -> pdf转换错误  当前文件不是office 文档或文件不存在: " + originLocalFilePath);
+        if (!inputFile.exists() || !inputFile.isFile() || !isOfficeFile(FilenameUtils.getExtension(originContextFilePath))) {
+            log.error("文件 -> pdf转换错误  当前文件不是office 文档或文件不存在: {}",originContextFilePath);
+            return null;
         }
 
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern(datetimePattern);
         String timeNow = formatter.format(LocalDateTime.now());
 
-        File newPdfWebPath = Paths.get(FilenameUtils.getPath(originLocalFilePath),"pdf",timeNow+".pdf").toFile();
+        String newPdfWebPath = Paths.get(FilenameUtils.getPath(originContextFilePath),"pdf",timeNow+".pdf").toString();
+
         try {
-            JodConverter.convert(inputFile).to(newPdfWebPath).execute();
+            JodConverter.convert(inputFile).to(Paths.get(PathKit.getWebRootPath(),newPdfWebPath).toFile()).execute();
         } catch (Exception e) {
             log.error("word->pdf 转换错误------------> Exception: ", e);
-            throw e;
+            return null;
         }
-        return newPdfWebPath;
+        return "/" + newPdfWebPath;
     }
 
     /**

+ 48 - 0
src/main/java/com/jfinal/club/common/model/base/BaseDoc.java

@@ -101,6 +101,48 @@ public abstract class BaseDoc<M extends BaseDoc<M>> extends Model<M> implements
 		return getStr("docurl");
 	}
 
+	/**
+	 * 转换后的文档路径
+	 */
+	public void setCoverturl(java.lang.String coverturl) {
+		set("coverturl", coverturl);
+	}
+	
+	/**
+	 * 转换后的文档路径
+	 */
+	public java.lang.String getCoverturl() {
+		return getStr("coverturl");
+	}
+
+	/**
+	 * 图片URL
+	 */
+	public void setImgUrl(java.lang.String imgUrl) {
+		set("imgUrl", imgUrl);
+	}
+	
+	/**
+	 * 图片URL
+	 */
+	public java.lang.String getImgUrl() {
+		return getStr("imgUrl");
+	}
+
+	/**
+	 * 转换状态 0 待转码  1 转码成功 9 文档格式不正确,无法转码
+	 */
+	public void setCovertStatus(java.lang.Integer covertStatus) {
+		set("covertStatus", covertStatus);
+	}
+	
+	/**
+	 * 转换状态 0 待转码  1 转码成功 9 文档格式不正确,无法转码
+	 */
+	public java.lang.Integer getCovertStatus() {
+		return getInt("covertStatus");
+	}
+
 	/**
 	 * 默认待审核 0  审核通过1 审核驳回 2
 	 */
@@ -157,10 +199,16 @@ public abstract class BaseDoc<M extends BaseDoc<M>> extends Model<M> implements
 		return getInt("loveing");
 	}
 
+	/**
+	 * 添加时间
+	 */
 	public void setAddtime(java.util.Date addtime) {
 		set("addtime", addtime);
 	}
 	
+	/**
+	 * 添加时间
+	 */
 	public java.util.Date getAddtime() {
 		return get("addtime");
 	}

+ 2 - 2
src/main/java/com/jfinal/club/common/model/base/BaseDoctype.java

@@ -54,14 +54,14 @@ public abstract class BaseDoctype<M extends BaseDoctype<M>> extends Model<M> imp
 	}
 
 	/**
-	 * 普通 1 精品 2
+	 * 普通 1 精品 2  3词条 4问答
 	 */
 	public void setType(java.lang.Integer type) {
 		set("type", type);
 	}
 	
 	/**
-	 * 普通 1 精品 2
+	 * 普通 1 精品 2  3词条 4问答
 	 */
 	public java.lang.Integer getType() {
 		return getInt("type");

+ 8 - 1
src/main/java/com/jfinal/club/index/IndexController.java

@@ -16,6 +16,7 @@ package com.jfinal.club.index;
 
 import com.jfinal.aop.Before;
 import com.jfinal.aop.Inject;
+import com.jfinal.club.common.banner.BannersService;
 import com.jfinal.club.common.controller.BaseController;
 import com.jfinal.club.common.interceptor.AuthCacheClearInterceptor;
 import com.jfinal.club.common.model.Doc;
@@ -55,6 +56,9 @@ public class IndexController extends BaseController {
     @Inject
     QuestionsService questionsService;
 
+    @Inject
+    BannersService bannersService;
+
     /**
      * @return void
      * @Author Cc
@@ -64,12 +68,15 @@ public class IndexController extends BaseController {
      **/
     @Before(TypeIntreceptor.class)
     public void index() {
+        setAttr("banners", bannersService.selectAllBanners());
+
         Page<Doc> docBySort = usersDocService.getDocBySort(1, 6);
-        setAttr("docBySort", docBySort);
+        setAttr("docBySort", docBySort.getList());
         Page<Userct> userctBySort = userCtService.getUserctBySort(1, 9);
         setAttr("userctBySort", userctBySort);
         Page<Questions> quesBySort = questionsService.getQuesBySort(1, 5);
         setAttr("quesBySort", quesBySort);
+
         render("index.html");
     }
 

+ 2 - 1
src/main/java/com/jfinal/club/my/setting/MySettingService.java

@@ -64,7 +64,8 @@ public class MySettingService {
 
 			String avatarUrl = "/upload" + getAvatarTempDir() + accountId + "_" + System.currentTimeMillis() + extName;
 			String saveFile = PathKit.getWebRootPath() + avatarUrl;
-			ImageKit.zoom(500, uf.getFile(), saveFile);
+			//ImageKit.zoom(500, uf.getFile(), saveFile);
+			uf.getFile().renameTo(new File(saveFile));
 			return Ret.ok("avatarUrl", avatarUrl);
 		}
 		catch (Exception e) {

+ 2 - 25
src/main/webapp/_view/_admin/banners/add_edit.html

@@ -15,19 +15,15 @@
 ### 内容区域
 <div class="jfa-content-box" id="jfa-content-box">
     <div class="jfa-content" id="jfa-content">
-        <form class="clearfix margin-top-25" enctype="multipart/form-data" id="myArticleForm" action="/admin/banners/#(isAdd ? 'save' : 'update')"
-              method="post">
-
+        <form class="clearfix margin-top-25" enctype="multipart/form-data" id="myArticleForm" action="/admin/banners/save" method="post">
             #if(isEdit)
             <input type="hidden" name="banners.id" value="#(banners.id)"/>
             #end
-
             <input type="hidden" id="type" name="banners.type" value="#(type)"/>
 
             <div class="form-group margin-bottom-20">
                 <label>Banners名称</label>
-                <input type="text" class="form-control" name="banners.title" value="#(banners.title??)"
-                       placeholder="Banners名称"/>
+                <input type="text" class="form-control" name="banners.title" value="#(banners.title??)" placeholder="Banners名称"/>
             </div>
 
             <div class="form-group margin-bottom-20">
@@ -77,25 +73,6 @@
 <script type="text/javascript">
     $(document).ready(function () {
 
-        var type = $("#type").val();
-
-        $("#myArticleForm").ajaxForm({
-            dataType: "json"
-            , beforeSubmit: function (formData, jqForm, options) {
-            }
-            , success: function (ret) {
-                if (ret.state == "ok") {
-                    location.href = "/admin/banners?type=" + type + "&p=#(p ?? 1)";
-                } else {
-                    showFailMsg(ret.msg);
-                }
-            }
-            , error: function (ret) {
-                alert(ret.statusText);
-            }
-            , complete: function (ret) {
-            } 	      // 无论是 success 还是 error,最终都会被回调
-        });
     });
 </script>
 

+ 1 - 1
src/main/webapp/_view/_admin/banners/index.html

@@ -52,7 +52,7 @@
                         </a>
                         <a data-delete
                            data-title="#escape(x.title)"
-                           data-action="/admin/doc/delete?id=#(x.id)">
+                           data-action="/admin/banners/delete?id=#(x.id)">
                             <i class="fa fa-trash" title="删除"></i>
                         </a>
                     </td>

+ 32 - 0
src/main/webapp/_view/_admin/doc/add_edit.html

@@ -37,6 +37,38 @@
                 <label>文档文件</label>
                 <a class="input-text" download="#(doc.docurl??)" href="#(doc.docurl??)">点击下载</a>
             </div>
+
+            <div class="form-group margin-bottom-20">
+                <label>请求转码</label>
+                <a class="input-text" href="convert?id=#(doc.id??)">点击转码</a>
+            </div>
+
+            <div class="form-group margin-bottom-20">
+                <label>文件转码状态</label>
+                <a class="input-text" href="javascript:void(0)">
+                    #if(doc.covertStatus == 0)
+                    待转码
+                    #else if(doc.covertStatus == 1)
+                    转码成功
+                    #else
+                    文档格式不正确无法转码
+                    #end
+                </a>
+            </div>
+
+            #if(doc.covertStatus == 1)
+            <div class="form-group margin-bottom-20">
+                <label>转码后文件</label>
+                <a class="input-text" download="#(doc.coverturl??)" href="#(doc.coverturl??)">点击下载</a>
+            </div>
+            <div class="form-group margin-bottom-20">
+                <label>预览图片</label>
+                <img src="#(doc.imgUrl??)"/>
+            </div>
+            #end
+
+
+
             <div class="form-group margin-bottom-20">
                 <label>文档分类</label>
                 <select class="form-control" class="related-project-name" name="doc.doctype">

+ 26 - 51
src/main/webapp/_view/index/index.html

@@ -43,7 +43,7 @@
                 <div class="swiper-wrapper">
                     #for(x : banners)
                     #if(x.type == 1)
-                    <a href="#(x.urls)" class="swiper-slide"><img src="#(x.picurl)"></a>
+                    <a href="#(x.urls)" class="swiper-slide"><img style="width: 930px;height: 320px" src="#(x.picurl)"></a>
                     #end
                     #end
                 </div>
@@ -51,18 +51,6 @@
             <div class="pagination"></div>
         </div>
 
-        <script>
-            var iSwiper = new Swiper('.banner .swiper-container', {
-                pagination: '.pagination',
-                paginationClickable: true,
-                autoplay: 5000,
-                autoplayDisableOnInteraction: false,
-                calculateHeight: true,
-                loop: true,
-                speed: 1000,
-            });
-        </script>
-
         #if(loginUsers)
         <div class="ques_right">
             <div class="ques_top">
@@ -70,12 +58,12 @@
                 <p class="my_name">#(loginUsers.phone)</p>
             </div>
             <div class="ques_tj clearfix">
-                <a href="center.html">
+                <a href="/doc">
                     <span>0</span>
                     我的文档
                 </a>
 
-                <a href="my_ct.html">
+                <a href="/ct">
                     <span>0</span>
                     我的词条
                 </a>
@@ -93,8 +81,8 @@
                 <input type="password" name="pwds" id="pwds" placeholder="密码">
             </p>
             <div class="login_index_enter">
-                <a href="reg">注册</a>
-                <a href="forget.html">忘记密码</a>
+                <a href="/reg">注册</a>
+                <a href="/login/forgetPassword">忘记密码</a>
             </div>
             <a class="index_sc_btn" id="loginHref" href="javascript:void(0)" onclick="">登录</a>
         </div>
@@ -110,36 +98,12 @@
         <a target="_blank" href="file.html">查看更多 <i class="icon_more"></i></a>
     </div>
     <div class="file_indexlist clearfix">
-        <div class="tab_hotlist">
-            <a target="_blank" class="tab_pic" href="file_detail.html"><img src="images/index_wd_1.jpg" alt=""></a>
-            <a target="_blank" class="tab_tit" href="file_detail.html">餐饮行业企业纠纷范本</a>
-        </div>
-
-        <div class="tab_hotlist">
-            <a target="_blank" class="tab_pic" href="file_detail.html"><img src="images/index_wd_2.jpg" alt=""></a>
-            <a target="_blank" class="tab_tit" href="file_detail.html">退出合作协议范本</a>
-        </div>
-
-        <div class="tab_hotlist">
-            <a target="_blank" class="tab_pic" href="file_detail.html"><img src="images/index_wd_3.jpg" alt=""></a>
-            <a target="_blank" class="tab_tit" href="file_detail.html">两人股份合作协议书</a>
-        </div>
-
-        <div class="tab_hotlist">
-            <a target="_blank" class="tab_pic" href="file_detail.html"><img src="images/index_wd_4.jpg" alt=""></a>
-            <a target="_blank" class="tab_tit" href="file_detail.html">公司间房屋租赁合同</a>
-        </div>
-
-        <div class="tab_hotlist">
-            <a target="_blank" class="tab_pic" href="file_detail.html"><img src="images/index_wd_5.jpg" alt=""></a>
-            <a target="_blank" class="tab_tit" href="file_detail.html">光伏发电三方合作协议</a>
-        </div>
-
-        <div class="tab_hotlist">
-            <a target="_blank" class="tab_pic" href="file_detail.html"><img src="images/index_wd_6.jpg" alt=""></a>
-            <a target="_blank" class="tab_tit" href="file_detail.html">企业债务债权纠纷协议</a>
-        </div>
-
+        #for(x : docBySort)
+            <div class="tab_hotlist">
+                <a target="_blank" class="tab_pic" href="file_detail?id=#(x.id)"><img style="height: 226px;width: 160px" src="#(x.imgUrl)" alt=""></a>
+                <a target="_blank" class="tab_tit" href="file_detail?id=#(x.id)">#(x.docname)</a>
+            </div>
+        #end
     </div>
 
 </div>
@@ -149,12 +113,12 @@
 <div class="pd40 index_content mainbox clearfix">
     <div class="file_index_gy clearfix">
         <p class="file_index_tit">法律百科<span>内容优质、开放的法律百科全书</span></p>
-        <a target="_blank" href="baikeList">查看更多 <i class="icon_more"></i></a>
+        <a target="_blank" href="/ct/baikeIndex">查看更多 <i class="icon_more"></i></a>
     </div>
     <div class="baike_indexlist clearfix">
         #for(x : userctBySort.list)
         #if(for.index == 0)
-        <a target="_blank" href="ctDetail?id=#(x.id)" class="baike_index_left">
+        <a target="_blank" href="/ct/ctDetail?id=#(x.id)" class="baike_index_left">
             <img src="#(x.imgs)" alt="">
             <div class="baike_index_bot">
                 <p class="baike_index_tit">#(x.ctname)</p>
@@ -166,7 +130,7 @@
         <div class="baike_index_center">
             #for(x : userctBySort.list)
             #if(for.index > 0 && for.index<4)
-            <a target="_blank" href="ctDetail?id=#(x.id)">
+            <a target="_blank" href="/ct/ctDetail?id=#(x.id)">
                 <span class="index_bk_pic"><img src="#(x.imgs)" alt=""></span>
                 <div class="index_bk_text">
                     <p class="index_bk_tit">#(x.ctname)</p>
@@ -262,7 +226,7 @@
             #for(x : banners)
             #if(x.type == 0)
             <a href="#(x.urls)">
-                <img src="#(x.picurl)" alt="#(x.title)">
+                <img style="width: 153px;height: 49px" src="#(x.picurl)" alt="#(x.title)">
             </a>
             #end
             #end
@@ -272,9 +236,20 @@
 </div>
 
 #define js()
+<script type="text/javascript" src="/assets/js/swiper.min.js"></script>
 <script type="text/javascript" src="/assets/layer/layer/layer.js"></script>
 <script type="text/javascript">
     $(document).ready(function () {
+        var iSwiper = new Swiper('.banner .swiper-container', {
+            pagination: '.pagination',
+            paginationClickable: true,
+            autoplay: 5000,
+            autoplayDisableOnInteraction: false,
+            calculateHeight: true,
+            loop: true,
+            speed: 1000,
+        });
+
         $("#loginHref").click(function () {
             $.ajax({
                 url: "/login/doLogin",

二進制
src/main/webapp/upload/avatar/0/1.jpg


+ 152 - 0
src/main/webapp/upload/avatar/3_1585205209065.docx

@@ -0,0 +1,152 @@
+报价单:
+
+品牌,单位,总可用数量 改成只读属性  已修改    ok
+如果金额这栏是可修改状态,但是修改金额后却不能倒推已修改
+
+备注栏请添加在金额后 已修改OK
+
+
+
+
+报表备注 不可输入信息 已修改  OK
+
+
+
+
+
+
+
+
+
+新系统中请将网络订货单号全显示,且作废按钮是暗的,不可使用。请修改。  已修改  点击待审核单据,并没有出现内容,问题不知道有没有解决
+
+
+
+
+
+
+
+对比新老系统,新系统中,销货单在输入状态时, 那个作废按钮是可以使用的额,但是等到审核后,作废按钮反而是不可使用,这个颠倒了。
+销货单---作废按钮功能:只在销货单"审核"状态下,作废功能有效,点击作废按钮,销货单已作废,销货单发货状态自动更新为"已作废"  已修改   ok
+
+
+当提示信息,请不单提醒产品型号,把所对应的产品的序号提示出来。 已修改   OK
+
+销货单单号重复,两个终端同时新建销货单,提交单据,两笔销货单号码重复,请更正。 已修改
+
+
+
+
+
+销货单状态更新显示结果不对,没有按条件显示所有销货单,单据有遗漏如S1908140008,S1908140009等  已修改
+
+
+
+出货仓库 这一栏 不用显示。 已修改   OK
+
+
+
+
+
+同一笔网上订单,导2遍销货单,提交时不会提示,大于网上订货数量。 已修改   系统里面没有网单,无法测试
+
+
+
+订货未销,点击导出按钮后,本应跳到销货单,但单据并未有更改。 已修改  ok
+
+
+
+
+
+客户基本资料中可修改的字段,即使修改后提交,并未作出修改。 已修改    OK
+
+
+业务助理 选择的时候 添加下拉选择,而非输入  已修改  OK
+
+
+请添加双击后能快捷打开单据 已修改   OK
+
+
+
+
+
+
+
+
+
+销售合同请保留原先格式 已修改   修改不对
+
+
+
+点击清空按钮后,仅上面的客户编号中信息清空,下面的列表内容还是存在。 已修改    OK
+
+
+应该是这种状态 
+
+
+
+
+
+点击查找合同后仅显示已审核单据,未审核的应该也要体现。请修正 已修改    没有修改政正确
+
+
+
+
+
+
+产品基本资料中,不能进行排序。  已修改    OK 双击也不能快捷打开单据,请添加此功能 已修改   这个双击有自己的想法,不知道点击在什么地方才会打开,我试验的几次都没有打开。不确定是否修改
+
+
+
+
+
+
+ 点击上面按钮没有反应,且需要添加搜索,导出单据,刷新等按钮。如图所示 已修改   没有修改好
+
+
+
+ 
+库存异动查询中也需添加那些按钮,如图所示 已修改  添加按钮,但没有起到作用
+
+
+
+请添加指令:统计期间若未选择,则不能预览。并且所属公司也必须进行选择,不选择则无法预览 已修改    OK 但因为没有数据,所以看不到内容
+
+
+
+
+销货未开票中,这些指令也都没有,请设置 已修改(未核对)
+
+
+订货单导出到销货单,跳转到销货模块后,   按钮点击无效,请重新设置功能。  已修改
+报价单导出销货单,问题同上。 已修改   ok
+
+胡:
+1.弹窗可以改变尺寸,所有字段可以全部显示  目前那个窗体需要显示全请标明 可以先手动调节尺寸  窗体自动适应的已经在研究之中
+2. 产品基本资料清空按钮没有用 已修改   没有   依次类推,客户基本资料中点击清空也会还是有一部分遗漏数据
+
+3. 报价单修改单价折扣没改变,已修改  OK
+
+可用库存未显示 已修改   OK
+4. 状态更新单据作废情况下 发货状态需更改 "已作废"  已修改 -未核对
+5. 客户基本资料 按查询速度太慢  已优化-未核对
+陈:1.重复打开窗体,任务栏标签消失 已修改 -未核对
+   
+   
+2. 订货单和销货单的折扣应该按照系统中产品最低折扣来走,但是实际是关联了客户基本资料中的折扣,没有关联产品的折扣,这样导致只要客户基本资料的折扣高于产品的折扣,就无法正常打单,全部要勾选特价。只有报价单是应该关联客户基本资料中的客户折扣的。 已修改 -未核对
+姜
+ 报价单和销货单审核后不能改价格和折扣,换个抬头后折扣没有跳掉,还是保留着前个客户的折扣,已修改 -未核对回传或者移动方向键都可以修改2.销货单产品全部Delete后就空白了,不能再填产品 已修改-未核对
+   3. 销货单和打印不一样 已修改-未核对
+   
+   
+   
+   
+   1.客户基本资料 -- 子母客户关系,关系到应收款金额统计,销项发票,应收款报表
+   销售合同 -- 上级客户显示, 已修改-未核对
+ 新ERP登入反映速度很慢  已优化-未核对
+ 订单未销报表,单据显示不完整  已修改-未核对
+ 库存异动添加 售价   已修改 打印查看时金额显示售价-未核对
+ 销货单 修改后 审核与取消审核同时存在 已修改-未核对
+   
+   
+   

文件差異過大導致無法顯示
+ 1086 - 0
work/tiezuiwang/src/main/webapp/upload/avatar/pdf/20200327214950545.pdf