jindi hai 1 ano
pai
achega
5c8fce95ea

+ 41 - 33
.idea/workspace.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="ChangeListManager">
-    <list default="true" id="7f042d7d-b621-4a07-8bfd-3e8d4f7f1687" name="Default Changelist" comment="基础功能修改">
+    <list default="true" id="7f042d7d-b621-4a07-8bfd-3e8d4f7f1687" name="Default Changelist" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/logs/project_image_synthesis.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/project_image_synthesis.log" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/springboot-function/src/main/java/com/xmnk/springbootfunction/service/impl/TemplateServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/springboot-function/src/main/java/com/xmnk/springbootfunction/service/impl/TemplateServiceImpl.java" afterDir="false" />
@@ -154,7 +154,8 @@
       <workItem from="1688103730755" duration="2140000" />
       <workItem from="1688105941639" duration="40659000" />
       <workItem from="1688200043275" duration="2963000" />
-      <workItem from="1688203851804" duration="5838000" />
+      <workItem from="1688203851804" duration="6020000" />
+      <workItem from="1688346173572" duration="3264000" />
     </task>
     <task id="LOCAL-00001" summary="first">
       <created>1688011457362</created>
@@ -254,7 +255,14 @@
       <option name="project" value="LOCAL" />
       <updated>1688202616816</updated>
     </task>
-    <option name="localTasksCounter" value="15" />
+    <task id="LOCAL-00015" summary="换行修改">
+      <created>1688209899146</created>
+      <option name="number" value="00015" />
+      <option name="presentableId" value="LOCAL-00015" />
+      <option name="project" value="LOCAL" />
+      <updated>1688209899146</updated>
+    </task>
+    <option name="localTasksCounter" value="16" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
@@ -264,11 +272,11 @@
     <MESSAGE value="first" />
     <MESSAGE value="增加元素标题&amp;&amp;增加图片定时删除任务" />
     <MESSAGE value="打包缺少字体  重新打包" />
-    <MESSAGE value="换行修改" />
     <MESSAGE value="基础功能修改" />
     <MESSAGE value="打包" />
     <MESSAGE value="表结构" />
-    <option name="LAST_COMMIT_MESSAGE" value="表结构" />
+    <MESSAGE value="换行修改" />
+    <option name="LAST_COMMIT_MESSAGE" value="换行修改" />
   </component>
   <component name="WindowStateProjectService">
     <state x="2472" y="179" key="#Project_Structure" timestamp="1686980712134">
@@ -299,10 +307,10 @@
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
     <state x="2635" y="222" key="#xdebugger.evaluate/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688122971764" />
-    <state x="2377" y="112" key="CommitChangelistDialog2" timestamp="1688202616081">
+    <state x="2377" y="112" key="CommitChangelistDialog2" timestamp="1688209895630">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state x="2377" y="112" key="CommitChangelistDialog2/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688202616081" />
+    <state x="2377" y="112" key="CommitChangelistDialog2/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688209895630" />
     <state width="1188" height="466" key="DebuggerActiveHint" timestamp="1688208590357">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
@@ -311,75 +319,75 @@
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
     <state x="2660" y="275" key="FileChooserDialogImpl/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688010935519" />
-    <state width="1877" height="425" key="GridCell.Tab.0.bottom" timestamp="1688209818139">
+    <state width="1877" height="425" key="GridCell.Tab.0.bottom" timestamp="1688349677858">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
     <state width="1877" height="380" key="GridCell.Tab.0.bottom/1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1687137042765" />
-    <state width="1877" height="425" key="GridCell.Tab.0.bottom/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688209818139" />
-    <state width="1877" height="425" key="GridCell.Tab.0.center" timestamp="1688209818139">
+    <state width="1877" height="425" key="GridCell.Tab.0.bottom/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688349677858" />
+    <state width="1877" height="425" key="GridCell.Tab.0.center" timestamp="1688349677857">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
     <state width="1877" height="380" key="GridCell.Tab.0.center/1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1687137042765" />
-    <state width="1877" height="425" key="GridCell.Tab.0.center/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688209818139" />
-    <state width="1877" height="425" key="GridCell.Tab.0.left" timestamp="1688209818139">
+    <state width="1877" height="425" key="GridCell.Tab.0.center/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688349677857" />
+    <state width="1877" height="425" key="GridCell.Tab.0.left" timestamp="1688349677857">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
     <state width="1877" height="380" key="GridCell.Tab.0.left/1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1687137042765" />
-    <state width="1877" height="425" key="GridCell.Tab.0.left/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688209818139" />
-    <state width="1877" height="425" key="GridCell.Tab.0.right" timestamp="1688209818139">
+    <state width="1877" height="425" key="GridCell.Tab.0.left/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688349677857" />
+    <state width="1877" height="425" key="GridCell.Tab.0.right" timestamp="1688349677857">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
     <state width="1877" height="380" key="GridCell.Tab.0.right/1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1687137042765" />
-    <state width="1877" height="425" key="GridCell.Tab.0.right/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688209818139" />
-    <state width="1877" height="171" key="GridCell.Tab.1.bottom" timestamp="1688209779579">
+    <state width="1877" height="425" key="GridCell.Tab.0.right/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688349677857" />
+    <state width="1877" height="171" key="GridCell.Tab.1.bottom" timestamp="1688349600308">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
     <state width="1877" height="380" key="GridCell.Tab.1.bottom/1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1687137042766" />
-    <state width="1877" height="171" key="GridCell.Tab.1.bottom/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688209779579" />
-    <state width="1877" height="171" key="GridCell.Tab.1.center" timestamp="1688209779579">
+    <state width="1877" height="171" key="GridCell.Tab.1.bottom/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688349600308" />
+    <state width="1877" height="171" key="GridCell.Tab.1.center" timestamp="1688349600308">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
     <state width="1877" height="380" key="GridCell.Tab.1.center/1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1687137042765" />
-    <state width="1877" height="171" key="GridCell.Tab.1.center/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688209779579" />
-    <state width="1877" height="171" key="GridCell.Tab.1.left" timestamp="1688209779579">
+    <state width="1877" height="171" key="GridCell.Tab.1.center/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688349600308" />
+    <state width="1877" height="171" key="GridCell.Tab.1.left" timestamp="1688349600308">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
     <state width="1877" height="380" key="GridCell.Tab.1.left/1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1687137042765" />
-    <state width="1877" height="171" key="GridCell.Tab.1.left/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688209779579" />
-    <state width="1877" height="171" key="GridCell.Tab.1.right" timestamp="1688209779579">
+    <state width="1877" height="171" key="GridCell.Tab.1.left/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688349600308" />
+    <state width="1877" height="171" key="GridCell.Tab.1.right" timestamp="1688349600308">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
     <state width="1877" height="380" key="GridCell.Tab.1.right/1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1687137042765" />
-    <state width="1877" height="171" key="GridCell.Tab.1.right/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688209779579" />
-    <state width="1877" height="171" key="GridCell.Tab.2.bottom" timestamp="1688209779579">
+    <state width="1877" height="171" key="GridCell.Tab.1.right/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688349600308" />
+    <state width="1877" height="171" key="GridCell.Tab.2.bottom" timestamp="1688349600309">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
     <state width="1877" height="380" key="GridCell.Tab.2.bottom/1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1687137042767" />
-    <state width="1877" height="171" key="GridCell.Tab.2.bottom/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688209779579" />
-    <state width="1877" height="171" key="GridCell.Tab.2.center" timestamp="1688209779579">
+    <state width="1877" height="171" key="GridCell.Tab.2.bottom/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688349600309" />
+    <state width="1877" height="171" key="GridCell.Tab.2.center" timestamp="1688349600308">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
     <state width="1877" height="380" key="GridCell.Tab.2.center/1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1687137042766" />
-    <state width="1877" height="171" key="GridCell.Tab.2.center/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688209779579" />
-    <state width="1877" height="171" key="GridCell.Tab.2.left" timestamp="1688209779579">
+    <state width="1877" height="171" key="GridCell.Tab.2.center/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688349600308" />
+    <state width="1877" height="171" key="GridCell.Tab.2.left" timestamp="1688349600308">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
     <state width="1877" height="380" key="GridCell.Tab.2.left/1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1687137042766" />
-    <state width="1877" height="171" key="GridCell.Tab.2.left/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688209779579" />
-    <state width="1877" height="171" key="GridCell.Tab.2.right" timestamp="1688209779579">
+    <state width="1877" height="171" key="GridCell.Tab.2.left/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688349600308" />
+    <state width="1877" height="171" key="GridCell.Tab.2.right" timestamp="1688349600309">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
     <state width="1877" height="380" key="GridCell.Tab.2.right/1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1687137042767" />
-    <state width="1877" height="171" key="GridCell.Tab.2.right/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688209779579" />
+    <state width="1877" height="171" key="GridCell.Tab.2.right/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688349600309" />
     <state x="2381" y="162" key="SettingsEditor" timestamp="1688011350889">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
     <state x="461" y="162" key="SettingsEditor/1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1687136970053" />
     <state x="2381" y="162" key="SettingsEditor/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688011350889" />
-    <state x="2472" y="253" key="Vcs.Push.Dialog.v2" timestamp="1688202625924">
+    <state x="2472" y="253" key="Vcs.Push.Dialog.v2" timestamp="1688209906545">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state x="2472" y="253" key="Vcs.Push.Dialog.v2/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688202625924" />
+    <state x="2472" y="253" key="Vcs.Push.Dialog.v2/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1688209906545" />
     <state x="2560" y="344" key="com.intellij.ide.util.TipDialog" timestamp="1688200042896">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>

BIN=BIN
TuPianHeCheng-1.0.jar


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 282 - 5563
logs/project_image_synthesis.log


+ 100 - 6
springboot-function/src/main/java/com/xmnk/springbootfunction/service/impl/TemplateServiceImpl.java

@@ -273,6 +273,8 @@ public class TemplateServiceImpl extends ServiceImpl<TemplateMapper, Template> i
                 String[] split = content.split("\n");
                 int hang = split.length;
                 int num = 0;
+                int row = 1;
+                int rowTemp = 1;
                 for (int i = 0; i < hang; i++) {
                     String contentTemp = split[i];
                     int hangTemp = contentTemp.length() / wordNum + (contentTemp.length() % wordNum == 0 ? 0 : 1);
@@ -281,14 +283,58 @@ public class TemplateServiceImpl extends ServiceImpl<TemplateMapper, Template> i
                         if (temp > contentTemp.length()) temp = contentTemp.length();
                         if (wordNum * j > contentTemp.length()) continue;
                         String contentTemp1 = contentTemp.substring(wordNum * j, temp);
-
                         //开始点位i
                         int x_i = x;
                         int y_i = y + num * lineHeight1 + lineHeight1 * (j + 1);
-                        g.drawString(contentTemp1, x_i, y_i);
+
+                        if (row == 1) {
+                            g.drawString(contentTemp1, x_i + wordWidth * 2, y_i);
+                        } else {
+                            g.drawString(contentTemp1, x_i, y_i);
+                        }
+                        row++;
                     }
                     num += (hangTemp);
-
+//                    if (rowTemp == 1) {
+//                        int hangTemp = contentTemp.length() + 2 / wordNum + (contentTemp.length() + 2 % wordNum == 0 ? 0 : 1);
+//                        for (int j = 0; j < hangTemp; j++) {
+//                            int temp = wordNum * (j + 1) > contentTemp.length() + 2 ? contentTemp.length() + 2 : wordNum * (j + 1);
+//                            if (temp > contentTemp.length() + 2) temp = contentTemp.length() + 2;
+//                            if (wordNum * j > contentTemp.length() + 2) continue;
+//                            String contentTemp1 = (contentTemp+"  ").substring(wordNum * j, temp);
+//                            //开始点位i
+//                            int x_i = x;
+//                            int y_i = y + num * lineHeight1 + lineHeight1 * (j + 1);
+//
+//                            if (row == 1) {
+//                                g.drawString(contentTemp1, x_i + wordWidth * 2, y_i);
+//                            } else {
+//                                g.drawString(contentTemp1, x_i, y_i);
+//                            }
+//                            row++;
+//                        }
+//                        num += (hangTemp);
+//                    } else {
+//                        int hangTemp = contentTemp.length() / wordNum + (contentTemp.length() % wordNum == 0 ? 0 : 1);
+//                        for (int j = 0; j < hangTemp; j++) {
+//                            int temp = wordNum * (j + 1) > contentTemp.length() ? contentTemp.length() : wordNum * (j + 1);
+//                            if (temp > contentTemp.length()) temp = contentTemp.length();
+//                            if (wordNum * j > contentTemp.length()) continue;
+//                            String contentTemp1 = contentTemp.substring(wordNum * j, temp);
+//                            //开始点位i
+//                            int x_i = x;
+//                            int y_i = y + num * lineHeight1 + lineHeight1 * (j + 1);
+//
+//                            if (row == 1) {
+//                                g.drawString(contentTemp1, x_i + wordWidth * 2, y_i);
+//                            } else {
+//                                g.drawString(contentTemp1, x_i, y_i);
+//                            }
+//                            row++;
+//                        }
+//                        num += (hangTemp);
+//                    }
+                    rowTemp++;
                     //开始点位
 //                    int x_i = x;
 //                    int y_i = y + lineHeight1 * (i + 1);
@@ -518,6 +564,8 @@ public class TemplateServiceImpl extends ServiceImpl<TemplateMapper, Template> i
                 String[] split = content.split("\n");
                 int hang = split.length;
                 int num = 0;
+                int row = 1;
+                int rowTemp = 1;
                 for (int i = 0; i < hang; i++) {
                     String contentTemp = split[i];
                     int hangTemp = contentTemp.length() / wordNum + (contentTemp.length() % wordNum == 0 ? 0 : 1);
@@ -526,19 +574,65 @@ public class TemplateServiceImpl extends ServiceImpl<TemplateMapper, Template> i
                         if (temp > contentTemp.length()) temp = contentTemp.length();
                         if (wordNum * j > contentTemp.length()) continue;
                         String contentTemp1 = contentTemp.substring(wordNum * j, temp);
-
                         //开始点位i
                         int x_i = x;
                         int y_i = y + num * lineHeight1 + lineHeight1 * (j + 1);
-                        g.drawString(contentTemp1, x_i, y_i);
+
+                        if (row == 1) {
+                            g.drawString(contentTemp1, x_i + wordWidth * 2, y_i);
+                        } else {
+                            g.drawString(contentTemp1, x_i, y_i);
+                        }
+                        row++;
                     }
                     num += (hangTemp);
-
+//                    if (rowTemp == 1) {
+//                        int hangTemp = contentTemp.length() + 2 / wordNum + (contentTemp.length() + 2 % wordNum == 0 ? 0 : 1);
+//                        for (int j = 0; j < hangTemp; j++) {
+//                            int temp = wordNum * (j + 1) > contentTemp.length() + 2 ? contentTemp.length() + 2 : wordNum * (j + 1);
+//                            if (temp > contentTemp.length() + 2) temp = contentTemp.length() + 2;
+//                            if (wordNum * j > contentTemp.length() + 2) continue;
+//                            String contentTemp1 = (contentTemp+"  ").substring(wordNum * j, temp);
+//                            //开始点位i
+//                            int x_i = x;
+//                            int y_i = y + num * lineHeight1 + lineHeight1 * (j + 1);
+//
+//                            if (row == 1) {
+//                                g.drawString(contentTemp1, x_i + wordWidth * 2, y_i);
+//                            } else {
+//                                g.drawString(contentTemp1, x_i, y_i);
+//                            }
+//                            row++;
+//                        }
+//                        num += (hangTemp);
+//                    } else {
+//                        int hangTemp = contentTemp.length() / wordNum + (contentTemp.length() % wordNum == 0 ? 0 : 1);
+//                        for (int j = 0; j < hangTemp; j++) {
+//                            int temp = wordNum * (j + 1) > contentTemp.length() ? contentTemp.length() : wordNum * (j + 1);
+//                            if (temp > contentTemp.length()) temp = contentTemp.length();
+//                            if (wordNum * j > contentTemp.length()) continue;
+//                            String contentTemp1 = contentTemp.substring(wordNum * j, temp);
+//                            //开始点位i
+//                            int x_i = x;
+//                            int y_i = y + num * lineHeight1 + lineHeight1 * (j + 1);
+//
+//                            if (row == 1) {
+//                                g.drawString(contentTemp1, x_i + wordWidth * 2, y_i);
+//                            } else {
+//                                g.drawString(contentTemp1, x_i, y_i);
+//                            }
+//                            row++;
+//                        }
+//                        num += (hangTemp);
+//                    }
+                    rowTemp++;
                     //开始点位
 //                    int x_i = x;
 //                    int y_i = y + lineHeight1 * (i + 1);
 //                    g.drawString(contentTemp, x_i, y_i);
                 }
+
+
                 //int hang = userNameWidth / w + (userNameWidth % w == 0 ? 0 : 1);
                 /*for (int i = 0; i < hang; i++) {
                     int temp = wordNum * (i + 1) > content.length() ? content.length() : wordNum * (i + 1);

BIN=BIN
springboot-function/target/classes/com/xmnk/springbootfunction/service/impl/TemplateServiceImpl.class


Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio