|
@@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.itextpdf.text.Element;
|
|
import com.itextpdf.text.Element;
|
|
import com.itextpdf.text.pdf.*;
|
|
import com.itextpdf.text.pdf.*;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.poi.ss.usermodel.*;
|
|
import org.apache.poi.ss.usermodel.*;
|
|
import org.apache.poi.util.IOUtils;
|
|
import org.apache.poi.util.IOUtils;
|
|
@@ -44,6 +45,7 @@ import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
+@Slf4j
|
|
@Service
|
|
@Service
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
|
|
public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
|
|
@@ -315,13 +317,16 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
|
|
String coords = config.getCoords();
|
|
String coords = config.getCoords();
|
|
String formula = config.getFormula();
|
|
String formula = config.getFormula();
|
|
|
|
|
|
- if("Archive['startDate']~Archive['endDate']".equals(formula)){
|
|
|
|
|
|
+ /*if("Archive['startDate']~Archive['endDate']".equals(formula)){
|
|
Object archive = variables.get("Archive");
|
|
Object archive = variables.get("Archive");
|
|
- ArchivesAuto auto=(ArchivesAuto)archive;
|
|
|
|
- if(auto.getStartDate()==null && auto.getEndDate()==null){
|
|
|
|
|
|
+ Map auto=(Map)archive;
|
|
|
|
+ log.info(auto.get("name")+"-时间调试 s:"+auto.get("startDate") +"e:"+auto.get("endDate"));
|
|
|
|
+ if((auto.get("startDate")==null || StringUtils.isEmpty(auto.get("startDate").toString()))
|
|
|
|
+ && (auto.get("endDate")==null || StringUtils.isEmpty(auto.get("endDate").toString())))
|
|
|
|
+ {
|
|
formula="";
|
|
formula="";
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
if(variables.containsKey("ArchiveFile") && variables.get("ArchiveFile") instanceof List
|
|
if(variables.containsKey("ArchiveFile") && variables.get("ArchiveFile") instanceof List
|
|
&& formula.indexOf("ArchiveFile") >= 0){
|
|
&& formula.indexOf("ArchiveFile") >= 0){
|
|
@@ -338,15 +343,6 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
|
|
if (multiLineconfig != null) {
|
|
if (multiLineconfig != null) {
|
|
String coords = multiLineconfig.getCoords();
|
|
String coords = multiLineconfig.getCoords();
|
|
String formula = multiLineconfig.getFormula();
|
|
String formula = multiLineconfig.getFormula();
|
|
-
|
|
|
|
- if("Archive['startDate']~Archive['endDate']".equals(formula)){
|
|
|
|
- Object archive = variables.get("Archive");
|
|
|
|
- ArchivesAuto auto=(ArchivesAuto)archive;
|
|
|
|
- if(auto.getStartDate()==null && auto.getEndDate()==null){
|
|
|
|
- formula="";
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
handleArchiveFile(coords, formula, variables, file_path, excelUrl, dataInfo,urls,fileName, archivesAuto.getProjectId());
|
|
handleArchiveFile(coords, formula, variables, file_path, excelUrl, dataInfo,urls,fileName, archivesAuto.getProjectId());
|
|
|
|
|
|
}else {
|
|
}else {
|
|
@@ -486,6 +482,14 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
|
|
|
|
|
|
|
|
|
|
String key = config.getId() + "__" + dataVO.getY() + "_" + dataVO.getX();
|
|
String key = config.getId() + "__" + dataVO.getY() + "_" + dataVO.getX();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if("Archive['startDate']~Archive['endDate']".equals(formula)){
|
|
|
|
+ log.info("起止时间object:"+object.toString());
|
|
|
|
+ if("null~null".equals(object)){
|
|
|
|
+ object="";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
dataInfo.put(key, object);
|
|
dataInfo.put(key, object);
|
|
}
|
|
}
|
|
|
|
|