提交 058aeafc authored 作者: zjm's avatar zjm

fix(PDF模块): 修改了销毁任务的PDf模版以及优化了出入库单据 字段超出的问题bug

修改了销毁任务的PDf模版以及优化了出入库单据 字段超出的问题bug
上级 5328272c
......@@ -325,6 +325,9 @@ public class JavaToPdfHtmlFreeMarker {
if (i+max==14){
String s=String.join("",toListString(documentDevice.getDeviceSerialNumber(),56));
documentDevice.setOneCount(max);
documentDevice.setModel(String.join("",toListString(documentDevice.getModel(),13)));
documentDevice.setParts(String.join("",toListString(documentDevice.getParts(),13)));
documentDevice.setRemark(String.join("",toListString(documentDevice.getRemark(),12)));
documentDevice.setDeviceSerialNumber(s);
code++;
documentDevice.setCode(code);
......@@ -338,18 +341,33 @@ public class JavaToPdfHtmlFreeMarker {
List<String> modelList= toListString(documentDevice.getModel(),13);
List<String> seqList=toListString(documentDevice.getDeviceSerialNumber(),56);
List<String> pasList=toListString(documentDevice.getParts(),13);
List<String> remarkList=toListString(documentDevice.getRemark(),12);
DocumentDevice documentDevice1=new DocumentDevice();
if (modelList.size()>differ){
documentDevice.setModel(String.join("",modelList.subList(0,differ)));
documentDevice1.setModel(String.join("",modelList.subList(differ,modelList.size())));
}else {
documentDevice.setModel(String.join("",modelList.subList(0,differ)));
}
if (seqList.size()>differ){
documentDevice.setDeviceSerialNumber(String.join("",seqList.subList(0,differ)));
documentDevice1.setDeviceSerialNumber(String.join("",seqList.subList(differ,seqList.size())));
}else {
documentDevice.setDeviceSerialNumber(String.join("",seqList.subList(0,seqList.size())));
}
if (pasList.size()>differ){
documentDevice.setParts(String.join("",pasList.subList(0,differ)));
documentDevice1.setParts(String.join("",pasList.subList(differ,pasList.size())));
}else {
documentDevice.setParts(String.join("",pasList.subList(0,pasList.size())));
}
if (remarkList.size()>differ){
documentDevice.setRemark(String.join("",remarkList.subList(0,differ)));
documentDevice1.setRemark(String.join("",remarkList.subList(differ,remarkList.size())));
}else {
documentDevice.setRemark(String.join("",remarkList));
}
code++;
documentDevice.setCode(code);
......@@ -366,6 +384,9 @@ public class JavaToPdfHtmlFreeMarker {
String s=String.join("",toListString(documentDevice.getDeviceSerialNumber(),56));
code++;
documentDevice.setCode(code);
documentDevice.setModel(String.join("",toListString(documentDevice.getModel(),13)));
documentDevice.setParts(String.join("",toListString(documentDevice.getParts(),13)));
documentDevice.setRemark(String.join("",toListString(documentDevice.getRemark(),12)));
documentDevice.setOneCount(max);
documentDevice.setDeviceSerialNumber(s);
documentDevices.add(documentDevice);
......@@ -384,9 +405,11 @@ public class JavaToPdfHtmlFreeMarker {
int partsCount=String_length(documentDevice.getParts());
int deviceSerialNumberCount=String_length(documentDevice.getDeviceSerialNumber());
int modelCount=String_length(documentDevice.getModel());
int parts = (partsCount%13>0) ? partsCount/20 + 1 : partsCount/13;
int remarkCount=String_length(documentDevice.getRemark());
int parts = (partsCount%13>0) ? partsCount/13 + 1 : partsCount/13;
int deviceSerialNumber=(deviceSerialNumberCount%56>0) ? deviceSerialNumberCount/56 + 1 : deviceSerialNumberCount/56;
int model=(modelCount%13>0) ? modelCount/13 + 1 : modelCount/13;
int remark=(remarkCount%12>0) ? remarkCount/12 + 1 : remarkCount/12;
int max=parts;
//求最大
if(max<deviceSerialNumber){
......@@ -396,10 +419,14 @@ public class JavaToPdfHtmlFreeMarker {
if(max<model) {
max = model;
}
if (max<remark){
max=remark;
}
return max;
}
private static int toMaxList(List<String> strings){
Integer count=strings.size();
return (count%6>0) ? count/6 + 1 : count/6;
......@@ -1072,7 +1099,7 @@ public class JavaToPdfHtmlFreeMarker {
Template template = freemarkerCfg.getTemplate("bill1.html");
template.setEncoding("UTF-8");
List<DocumentDevice> list=destruction.getConfirmDevices();
List<List<DocumentDevice>> listList=toList(list);
List<List<DocumentDevice>> listList=toDocList(list);
Integer count=listList.size();
for (int i=1; i<=3; i++){
Integer page=1;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论