Explorar el Código

张丁 重新提交目标措施导出

zhangding hace 3 años
padre
commit
873ea7584c

+ 12 - 6
master/src/main/java/com/ruoyi/project/plant/controller/TTargetmeasuresController.java

@@ -300,11 +300,15 @@ public class TTargetmeasuresController extends BaseController
                     selectMeasure.setTargetlistId(l.getId());
                     List<TTargetmeasures> measures = tTargetmeasuresService.selectTTargetmeasuresList(selectMeasure);
                     for (TTargetmeasures m : measures) {
-                        String[] responsibles = m.getResponsible().split(",");
+                        String[] responsibles={};
+                        if(m.getResponsible()!=null){
+                            responsibles= m.getResponsible().split(",");
+                        }
                         m.setResponsiblesNum(responsibles.length * 16);
                         String responsiblesName = "";
                         for (int i = 0; i < responsibles.length; i++) {
-                            String name = tStaffmgrService.selectTStaffmgrByStaffId(responsibles[i]).getName();
+                            String name ="";
+                    name = tStaffmgrService.selectTStaffmgrByStaffId(responsibles[i]).getName();
                             if (i == 0) {
                                 responsiblesName = name;
                             }else {
@@ -313,10 +317,12 @@ public class TTargetmeasuresController extends BaseController
                         }
                         m.setResponsible(responsiblesName);
                     }
-                    l.setMeasure(measures.get(0));
-                    l.setMeasuresNum(measures.size());
-                    measures.remove(0);
-                    l.setTargetmeasures(measures);
+                    if(measures != null && measures.size() > 0){
+                        l.setMeasure(measures.get(0));
+                        l.setMeasuresNum(measures.size());
+                        measures.remove(0);
+                        l.setTargetmeasures(measures);
+                    }
                 }
                 list.setSecondaryList(targetlists);
             }

+ 1 - 0
master/src/main/resources/application.yml

@@ -55,6 +55,7 @@ spring:
     db-history-used: true
   freemarker:
     checkTemplateLocation: false
+    classic-compatible: true
   # 文件上传
   servlet:
      multipart:

+ 12 - 11
master/src/main/resources/freeMaker/measuresFMaker.ftl

@@ -111,7 +111,7 @@
 					</td>
 				</tr>
 				<#list list.secondaryList as secondary>
-					<tr style="height:${secondary.measure.responsiblesNum}pt; page-break-inside:avoid; page-break-after:auto;">
+				<tr style="height:${(secondary.measure.responsiblesNum)!""}pt; page-break-inside:avoid; page-break-after:auto;">
 						<td rowspan="${secondary.measuresNum}" style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:middle; width:2.58%">
 							<p style="margin:0pt; orphans:0; text-align:center; widows:0">
 								<span style="font-family:SimSun; font-size:8pt">${secondary.item}</span>
@@ -124,17 +124,17 @@
 						</td>
 						<td rowspan="${secondary.measuresNum}" style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:middle; width:15.34%; word-wrap:break-word; word-break:break-all;">
 							<p style="margin:0pt; orphans:0; text-align:center; widows:0">
-								<span style="font-family:SimSun; font-size:8pt">${secondary.targets}</span>
+								<span style="font-family:SimSun; font-size:8pt">${(secondary.targets)!""}</span>
 							</p>
 						</td>
 						<td style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:middle; width:31.96%; word-wrap:break-word; word-break:break-all;">
 							<p style="margin:0pt; orphans:0; text-align:justify; widows:0">
-								<span style="font-family:SimSun; font-size:8pt">${secondary.measure.measures}</span>
+								<span style="font-family:SimSun; font-size:8pt">${(secondary.measure.measures)!""}</span>
 							</p>
 						</td>
 						<td style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:middle; width:10.48%; word-wrap:break-word; word-break:break-all;">
 							<p style="margin:0pt; orphans:0; text-align:center; widows:0">
-								<span style="font-family:SimSun; font-size:8pt">${secondary.measure.responsible}</span>
+								<span style="font-family:SimSun; font-size:8pt">${(secondary.measure.responsible)!""}</span>
 							</p>
 						</td>
 						<td style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:middle; width:11.68%">
@@ -144,20 +144,20 @@
 						</td>
 						<td style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:middle; width:10.18%">
 							<p style="margin:0pt; orphans:0; text-align:center; widows:0">
-								<span style="font-family:SimSun; font-size:8pt">${secondary.measure.expectedDate?string("yyyy-MM-dd")}</span>
+								<span style="font-family:SimSun; font-size:8pt">${(secondary.measure.expectedDate?string("yyyy-MM-dd"))!}</span>
 							</p>
 						</td>
 					</tr>
-					<#list secondary.targetmeasures as measure>
-						<tr style="height:${measure.responsiblesNum}pt; page-break-inside:avoid; page-break-after:auto;">
+					<#list (secondary.targetmeasures)! as measure>
+						<tr style="height:${(measure.responsiblesNum)!""}pt; page-break-inside:avoid; page-break-after:auto;">
 							<td style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:middle; width:31.96%; word-wrap:break-word; word-break:break-all;">
 								<p style="margin:0pt; orphans:0; text-align:justify; widows:0">
-									<span style="font-family:SimSun; font-size:8pt">${measure.measures}</span>
+									<span style="font-family:SimSun; font-size:8pt">${(measure.measures)!""}</span>
 								</p>
 							</td>
 							<td style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:middle; width:10.48%; word-wrap:break-word; word-break:break-all;">
 								<p style="margin:0pt; orphans:0; text-align:center; widows:0">
-									<span style="font-family:SimSun; font-size:8pt">${measure.responsible}</span>
+									<span style="font-family:SimSun; font-size:8pt">${(measure.responsible0)!""}</span>
 								</p>
 							</td>
 							<td style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:middle; width:11.68%">
@@ -167,7 +167,7 @@
 							</td>
 							<td style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:middle; width:10.18%">
 								<p style="margin:0pt; orphans:0; text-align:center; widows:0">
-									<span style="font-family:SimSun; font-size:8pt">${measure.expectedDate?string("yyyy-MM-dd")}</span>
+									<span style="font-family:SimSun; font-size:8pt">${(measure.expectedDate?string("yyyy-MM-dd"))!}</span>
 								</p>
 							</td>
 						</tr>
@@ -190,6 +190,7 @@
 				<td style="width:108.05pt; border:none">
 				</td>
 			</tr>
+
 		</table>
 		<p style="margin:0pt; orphans:0; text-align:justify; widows:0">
 	<span style="font-family:SimSun; font-size:10.5pt; font-weight:bold">
@@ -197,4 +198,4 @@
 		</p>
 	</div>
 </body>
-</html>
+</html>