xiaof 3 ani în urmă
părinte
comite
d097628327

+ 3 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/util/FreemarkerUtil.java

@@ -92,8 +92,9 @@ public class FreemarkerUtil {
             ClassifyEnum classifyEnum = (ClassifyEnum) dataMap.get("printType");
             JSONObject jsonObject = JSONObject.parseObject(basicAttachment.getPath());
             String path = (String) jsonObject.get(SystemConstant.PATH);
-            String ftlPath = path.substring(0, path.lastIndexOf("/"));
-            String ftlName = path.substring(path.lastIndexOf("/") + 1, path.lastIndexOf("."));
+            int last = path.lastIndexOf("/") == -1 ? path.lastIndexOf("\\") : path.lastIndexOf("/");
+            String ftlPath = path.substring(0, last);
+            String ftlName = path.substring(last + 1, path.lastIndexOf("."));
 
             Configuration configuration = new Configuration(Configuration.VERSION_2_3_29);
             File templates = null;