提交 76e9b193 authored 作者: 133's avatar 133

[zjm] 模版提交

上级 2f40e07b
...@@ -24,7 +24,7 @@ public class Revenue { ...@@ -24,7 +24,7 @@ public class Revenue {
@ApiModelProperty(value = "型号") @ApiModelProperty(value = "型号")
private String model; private String model;
@ApiModelProperty(value = "部件") @ApiModelProperty(value = "名称")
private String part; private String part;
@ApiModelProperty(value = "横向") @ApiModelProperty(value = "横向")
...@@ -54,4 +54,17 @@ public class Revenue { ...@@ -54,4 +54,17 @@ public class Revenue {
@ApiModelProperty(value = "报废") @ApiModelProperty(value = "报废")
private Integer scrapped; private Integer scrapped;
@ApiModelProperty(value = "销毁")
private Integer destory;
@ApiModelProperty(value = "丢失")
private Integer loss;
@ApiModelProperty(value = "丢失")
private String des;
private Integer oneCount;
} }
...@@ -27,12 +27,6 @@ public class RevenueEntity { ...@@ -27,12 +27,6 @@ public class RevenueEntity {
@ApiModelProperty(name = "决算单位") @ApiModelProperty(name = "决算单位")
private String revenueUnit; private String revenueUnit;
@ApiModelProperty(name = "决算专管员A")
private String revenueUserA;
@ApiModelProperty(name = "决算专管员B")
private String revenueUserB;
@ApiModelProperty(name = "决算时间") @ApiModelProperty(name = "决算时间")
private String time; private String time;
} }
...@@ -275,6 +275,7 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -275,6 +275,7 @@ public class JavaToPdfHtmlFreeMarker {
List<List<DocumentDevice>> lists=new ArrayList<>(); List<List<DocumentDevice>> lists=new ArrayList<>();
List<DocumentDevice> documentDevices=new ArrayList<>(); List<DocumentDevice> documentDevices=new ArrayList<>();
int i=0; int i=0;
Integer code=0;
for (int j=0;j< deviceList.size();j++){ for (int j=0;j< deviceList.size();j++){
DocumentDevice documentDevice=deviceList.get(j); DocumentDevice documentDevice=deviceList.get(j);
int max= toMax2(documentDevice); int max= toMax2(documentDevice);
...@@ -282,6 +283,8 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -282,6 +283,8 @@ public class JavaToPdfHtmlFreeMarker {
String s=String.join("",toListString(documentDevice.getDeviceSerialNumber(),56)); String s=String.join("",toListString(documentDevice.getDeviceSerialNumber(),56));
documentDevice.setOneCount(max); documentDevice.setOneCount(max);
documentDevice.setDeviceSerialNumber(s); documentDevice.setDeviceSerialNumber(s);
code++;
documentDevice.setCode(code);
documentDevices.add(documentDevice); documentDevices.add(documentDevice);
lists.add(documentDevices); lists.add(documentDevices);
documentDevices=new ArrayList<>(); documentDevices=new ArrayList<>();
...@@ -300,21 +303,26 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -300,21 +303,26 @@ public class JavaToPdfHtmlFreeMarker {
if (seqList.size()>differ){ if (seqList.size()>differ){
documentDevice.setDeviceSerialNumber(String.join("",seqList.subList(0,differ))); documentDevice.setDeviceSerialNumber(String.join("",seqList.subList(0,differ)));
documentDevice1.setDeviceSerialNumber(String.join("",seqList.subList(differ,seqList.size()))); documentDevice1.setDeviceSerialNumber(String.join("",seqList.subList(differ,seqList.size())));
} }
if (pasList.size()>differ){ if (pasList.size()>differ){
documentDevice.setParts(String.join("",pasList.subList(0,differ))); documentDevice.setParts(String.join("",pasList.subList(0,differ)));
documentDevice1.setParts(String.join("",pasList.subList(differ,pasList.size()))); documentDevice1.setParts(String.join("",pasList.subList(differ,pasList.size())));
} }
code++;
documentDevice.setCode(code);
documentDevice.setOneCount(differ); documentDevice.setOneCount(differ);
documentDevices.add(documentDevice); documentDevices.add(documentDevice);
lists.add(documentDevices); lists.add(documentDevices);
documentDevices=new ArrayList<>(); documentDevices=new ArrayList<>();
code++;
documentDevice1.setCode(code);
documentDevice1.setOneCount(max-differ); documentDevice1.setOneCount(max-differ);
documentDevices.add(documentDevice1); documentDevices.add(documentDevice1);
i=max-differ; i=max-differ;
}else { }else {
String s=String.join("",toListString(documentDevice.getDeviceSerialNumber(),56)); String s=String.join("",toListString(documentDevice.getDeviceSerialNumber(),56));
code++;
documentDevice.setCode(code);
documentDevice.setOneCount(max); documentDevice.setOneCount(max);
documentDevice.setDeviceSerialNumber(s); documentDevice.setDeviceSerialNumber(s);
documentDevices.add(documentDevice); documentDevices.add(documentDevice);
...@@ -531,16 +539,16 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -531,16 +539,16 @@ public class JavaToPdfHtmlFreeMarker {
}else { }else {
data.put("srcB","\""+documents.getSrcB()+"\""); data.put("srcB","\""+documents.getSrcB()+"\"");
} }
List<DocumentDevice> list1=new ArrayList<>(); // List<DocumentDevice> list1=new ArrayList<>();
AtomicInteger i= new AtomicInteger(1); // AtomicInteger i= new AtomicInteger(1);
list.forEach( // list.forEach(
documentDevice -> { // documentDevice -> {
documentDevice.setCode(i.get()); // documentDevice.setCode(i.get());
i.set(i.get() + 1); // i.set(i.get() + 1);
list1.add(documentDevice); // list1.add(documentDevice);
} // }
); // );
data.put("documentDevices",list1); data.put("documentDevices",list);
return data; return data;
} }
...@@ -553,16 +561,7 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -553,16 +561,7 @@ public class JavaToPdfHtmlFreeMarker {
data.put("unit",confirm.getUnit()); data.put("unit",confirm.getUnit());
data.put("page",page); data.put("page",page);
data.put("count",count); data.put("count",count);
List<DocumentDevice> list1=new ArrayList<>(); data.put("documentDevices",list);
AtomicInteger i= new AtomicInteger(1);
list.forEach(
documentDevice -> {
documentDevice.setCode(i.get());
i.set(i.get() + 1);
list1.add(documentDevice);
}
);
data.put("documentDevices",list1);
return data; return data;
} }
...@@ -572,7 +571,6 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -572,7 +571,6 @@ public class JavaToPdfHtmlFreeMarker {
data.put("unit",confirm.getUnit()); data.put("unit",confirm.getUnit());
data.put("page",page); data.put("page",page);
data.put("count",count); data.put("count",count);
data.put("checks",list); data.put("checks",list);
data.put("time",time); data.put("time",time);
return data; return data;
...@@ -786,18 +784,19 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -786,18 +784,19 @@ public class JavaToPdfHtmlFreeMarker {
} else if (i + max > 24) { } else if (i + max > 24) {
//当前页面少了多少行 //当前页面少了多少行
int differ = 24 - i; int differ = 24 - i;
check.setSeqStirng(toALLSeqStirng(stringList.subList(0, differ * 7))); check.setSeqStirng(toALLSeqStirng(stringList.subList(0, (differ-1) * 7)));
check.setOneCount(differ - 1); check.setOneCount(differ - 1);
checkList2.add(check); checkList2.add(check);
lists.add(checkList2); lists.add(checkList2);
checkList2 = new ArrayList<>(); checkList2 = new ArrayList<>();
List<String> strings = stringList.subList(differ * 7, stringList.size()); List<String> strings = stringList.subList((differ-1) * 7, stringList.size());
Integer max2 = toMaxList(strings); Integer max2 = toMaxList(strings);
Check check1 = new Check();
int count = (max2 % 24 > 0) ? max2 / 24 + 1 : max2 / 24; int count = (max2 % 24 > 0) ? max2 / 24 + 1 : max2 / 24;
if (count != 1) { if (count != 1) {
int o = 1; int o = 1;
while (o <= count - 1) { while (o <= count - 1) {
Check check1 = new Check();
check1.setSeqStirng(toALLSeqStirng(strings.subList((o - 1) * 7 * 24, o * 7 * 24))); check1.setSeqStirng(toALLSeqStirng(strings.subList((o - 1) * 7 * 24, o * 7 * 24)));
check1.setOneCount(24); check1.setOneCount(24);
checkList2.add(check1); checkList2.add(check1);
...@@ -809,6 +808,7 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -809,6 +808,7 @@ public class JavaToPdfHtmlFreeMarker {
Integer max4 = toMaxList(endList); Integer max4 = toMaxList(endList);
int count1 = (max4 % 24 > 0) ? max4 / 24 + 1 : max4 / 24; int count1 = (max4 % 24 > 0) ? max4 / 24 + 1 : max4 / 24;
if (count1 == 24) { if (count1 == 24) {
Check check1 = new Check();
check1.setSeqStirng(toALLSeqStirng(endList)); check1.setSeqStirng(toALLSeqStirng(endList));
check1.setOneCount(24); check1.setOneCount(24);
checkList2.add(check1); checkList2.add(check1);
...@@ -816,19 +816,19 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -816,19 +816,19 @@ public class JavaToPdfHtmlFreeMarker {
checkList2 = new ArrayList<>(); checkList2 = new ArrayList<>();
i = 0; i = 0;
} else { } else {
Check check1 = new Check();
check1.setOneCount(max4); check1.setOneCount(max4);
check1.setSeqStirng(toALLSeqStirng(endList)); check1.setSeqStirng(toALLSeqStirng(endList));
checkList2.add(check1); checkList2.add(check1);
i = max4; i = max4;
} }
} else { } else {
Check check1 = new Check();
check1.setOneCount(toMaxList(strings)); check1.setOneCount(toMaxList(strings));
check1.setSeqStirng(toALLSeqStirng(strings)); check1.setSeqStirng(toALLSeqStirng(strings));
checkList2.add(check1); checkList2.add(check1);
i = toMaxList(strings); i = toMaxList(strings);
} }
} else { } else {
check.setSeqStirng(toALLSeqStirng(stringList)); check.setSeqStirng(toALLSeqStirng(stringList));
check.setOneCount(max - 1); check.setOneCount(max - 1);
...@@ -1056,13 +1056,13 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -1056,13 +1056,13 @@ public class JavaToPdfHtmlFreeMarker {
data.put("time",local1); data.put("time",local1);
data.put("page",page); data.put("page",page);
data.put("count",count); data.put("count",count);
AtomicInteger i= new AtomicInteger(1); // AtomicInteger i= new AtomicInteger(1);
list.forEach( // list.forEach(
workHandoverDevice -> { // workHandoverDevice -> {
workHandoverDevice.setCode(i.get()); // workHandoverDevice.setCode(i.get());
i.set(i.get()+1); // i.set(i.get()+1);
} // }
); // );
data.put("documentDevices",list); data.put("documentDevices",list);
return data; return data;
...@@ -1163,19 +1163,24 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -1163,19 +1163,24 @@ public class JavaToPdfHtmlFreeMarker {
deviceList= deviceList.stream().sorted(Comparator.comparing(DocumentDevice::getModel)).collect(Collectors.toList()); deviceList= deviceList.stream().sorted(Comparator.comparing(DocumentDevice::getModel)).collect(Collectors.toList());
List<DocumentDevice> documentDevices=new ArrayList<>(); List<DocumentDevice> documentDevices=new ArrayList<>();
int i=0; int i=0;
Integer code=0;
for (DocumentDevice documentDevice : deviceList) { for (DocumentDevice documentDevice : deviceList) {
int max = toVerificationMax(documentDevice); int max = toVerificationMax(documentDevice);
if (i + max == 34) { if (i + max == 34) {
code++;
documentDevice.setCode(code);
documentDevices.add(documentDevice); documentDevices.add(documentDevice);
lists.add(documentDevices); lists.add(documentDevices);
documentDevices = new ArrayList<>(); documentDevices = new ArrayList<>();
i = 0; i = 0;
} else if (i + max > 34) { } else if (i + max > 34) {
documentDevice.setCode(code);
lists.add(documentDevices); lists.add(documentDevices);
documentDevices = new ArrayList<>(); documentDevices = new ArrayList<>();
documentDevices.add(documentDevice); documentDevices.add(documentDevice);
i = max; i = max;
} else { } else {
documentDevice.setCode(code);
documentDevices.add(documentDevice); documentDevices.add(documentDevice);
i = i + max; i = i + max;
} }
...@@ -1215,23 +1220,29 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -1215,23 +1220,29 @@ public class JavaToPdfHtmlFreeMarker {
*/ */
private static List<List<DocumentDevice>> toConfirmList(List<DocumentDevice> deviceList){ private static List<List<DocumentDevice>> toConfirmList(List<DocumentDevice> deviceList){
deviceList.stream().sorted(Comparator.comparing(DocumentDevice::getModel)).collect(Collectors.toList()); deviceList.stream().sorted(Comparator.comparing(DocumentDevice::getModel)).collect(Collectors.toList());
Integer code=0;
List<List<DocumentDevice>> lists=new ArrayList<>(); List<List<DocumentDevice>> lists=new ArrayList<>();
List<DocumentDevice> documentDevices=new ArrayList<>(); List<DocumentDevice> documentDevices=new ArrayList<>();
int i=0; int i=0;
for (DocumentDevice documentDevice : deviceList) { for (DocumentDevice documentDevice : deviceList) {
int max = toMax(documentDevice); int max = toMax(documentDevice);
if (i + max == 34) { if (i + max == 34) {
code++;
documentDevice.setCode(code);
documentDevices.add(documentDevice); documentDevices.add(documentDevice);
lists.add(documentDevices); lists.add(documentDevices);
documentDevices = new ArrayList<>(); documentDevices = new ArrayList<>();
i = 0; i = 0;
} else if (i + max > 34) { } else if (i + max > 34) {
code++;
documentDevice.setCode(code);
lists.add(documentDevices); lists.add(documentDevices);
documentDevices = new ArrayList<>(); documentDevices = new ArrayList<>();
documentDevices.add(documentDevice); documentDevices.add(documentDevice);
i = max; i = max;
} else { } else {
code++;
documentDevice.setCode(code);
documentDevices.add(documentDevice); documentDevices.add(documentDevice);
i = i + max; i = i + max;
} }
...@@ -1246,13 +1257,15 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -1246,13 +1257,15 @@ public class JavaToPdfHtmlFreeMarker {
private static int String_length(String value) { private static int String_length(String value) {
int valueLength = 0; int valueLength = 0;
String chinese = "[\u4e00-\u9fa5]"; if (value!=null) {
for (int i = 0; i < value.length(); i++) { String chinese = "[\u4e00-\u9fa5]";
String temp = value.substring(i, i + 1); for (int i = 0; i < value.length(); i++) {
if (temp.matches(chinese)) { String temp = value.substring(i, i + 1);
valueLength += 2; if (temp.matches(chinese)) {
} else { valueLength += 2;
valueLength += 1; } else {
valueLength += 1;
}
} }
} }
return valueLength; return valueLength;
...@@ -1380,6 +1393,7 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -1380,6 +1393,7 @@ public class JavaToPdfHtmlFreeMarker {
List<List<WorkHandoverDevice>> lists=new ArrayList<>(); List<List<WorkHandoverDevice>> lists=new ArrayList<>();
List<WorkHandoverDevice> list=new ArrayList<>(); List<WorkHandoverDevice> list=new ArrayList<>();
AtomicInteger count = new AtomicInteger(); AtomicInteger count = new AtomicInteger();
int code=0;
for (int i=0;i<workHandoverDevices.size();i++){ for (int i=0;i<workHandoverDevices.size();i++){
WorkHandoverDevice workHandoverDevice=workHandoverDevices.get(i); WorkHandoverDevice workHandoverDevice=workHandoverDevices.get(i);
int len=workHandoverDevice.getSeqs().length(); int len=workHandoverDevice.getSeqs().length();
...@@ -1392,11 +1406,15 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -1392,11 +1406,15 @@ public class JavaToPdfHtmlFreeMarker {
while (page<pageCount-1) { while (page<pageCount-1) {
if (page==0) { if (page==0) {
workHandoverDevice.setSeqs(workHandoverDevice.getSeqs().substring(page * 1568, (page + 1) * 1568)); workHandoverDevice.setSeqs(workHandoverDevice.getSeqs().substring(page * 1568, (page + 1) * 1568));
code++;
workHandoverDevice.setCode(code);
list.add(workHandoverDevice); list.add(workHandoverDevice);
lists.add(list); lists.add(list);
}else { }else {
WorkHandoverDevice workHandoverDevice1=new WorkHandoverDevice(); WorkHandoverDevice workHandoverDevice1=new WorkHandoverDevice();
workHandoverDevice1.setSeqs(deviceSerialNumber.substring(page * 1568, (page + 1) * 1568)); workHandoverDevice1.setSeqs(deviceSerialNumber.substring(page * 1568, (page + 1) * 1568));
code++;
workHandoverDevice1.setCode(code);
list.add(workHandoverDevice1); list.add(workHandoverDevice1);
lists.add(list); lists.add(list);
} }
...@@ -1405,10 +1423,14 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -1405,10 +1423,14 @@ public class JavaToPdfHtmlFreeMarker {
} }
WorkHandoverDevice workHandoverDevice1=new WorkHandoverDevice(); WorkHandoverDevice workHandoverDevice1=new WorkHandoverDevice();
workHandoverDevice1.setSeqs(deviceSerialNumber.substring((pageCount-1)*784, len)); workHandoverDevice1.setSeqs(deviceSerialNumber.substring((pageCount-1)*784, len));
code++;
workHandoverDevice1.setCode(code);
list.add(workHandoverDevice1); list.add(workHandoverDevice1);
count.set(len-(pageCount-1)*784); count.set(len-(pageCount-1)*784);
} else if (len==784){ } else if (len==784){
workHandoverDevice.setSeqs(toString(workHandoverDevice.getSeqs())); workHandoverDevice.setSeqs(toString(workHandoverDevice.getSeqs()));
code++;
workHandoverDevice.setCode(code);
list.add(workHandoverDevice); list.add(workHandoverDevice);
lists.add(list); lists.add(list);
list=new ArrayList<>(); list=new ArrayList<>();
...@@ -1419,20 +1441,28 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -1419,20 +1441,28 @@ public class JavaToPdfHtmlFreeMarker {
WorkHandoverDevice workHandoverDevice1 = new WorkHandoverDevice(); WorkHandoverDevice workHandoverDevice1 = new WorkHandoverDevice();
workHandoverDevice1.setSeqs(toString(workHandoverDevice1.getSeqs().substring(784 - count.get(), len))); workHandoverDevice1.setSeqs(toString(workHandoverDevice1.getSeqs().substring(784 - count.get(), len)));
workHandoverDevice.setSeqs(toString(workHandoverDevice1.getSeqs().substring(0, 784 - count.get()))); workHandoverDevice.setSeqs(toString(workHandoverDevice1.getSeqs().substring(0, 784 - count.get())));
code++;
workHandoverDevice.setCode(code);
list.add(workHandoverDevice); list.add(workHandoverDevice);
lists.add(list); lists.add(list);
list = new ArrayList<>(); list = new ArrayList<>();
code++;
workHandoverDevice1.setCode(code);
list.add(workHandoverDevice1); list.add(workHandoverDevice1);
int num = workHandoverDevice1.getSeqs().length(); int num = workHandoverDevice1.getSeqs().length();
int yu = num % 56; int yu = num % 56;
count.set(num + yu); count.set(num + yu);
}else { }else {
code++;
workHandoverDevice.setCode(code);
list.add(workHandoverDevice); list.add(workHandoverDevice);
lists.add(list); lists.add(list);
list = new ArrayList<>(); list = new ArrayList<>();
count.set(0); count.set(0);
} }
}else { }else {
code++;
workHandoverDevice.setCode(code);
workHandoverDevice.setSeqs(toString(workHandoverDevice.getSeqs())); workHandoverDevice.setSeqs(toString(workHandoverDevice.getSeqs()));
list.add(workHandoverDevice); list.add(workHandoverDevice);
int yu=len%56; int yu=len%56;
...@@ -1490,7 +1520,7 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -1490,7 +1520,7 @@ public class JavaToPdfHtmlFreeMarker {
template.setEncoding("UTF-8"); template.setEncoding("UTF-8");
List<Revenue> list=revenueEntity.getRevenueList(); List<Revenue> list=revenueEntity.getRevenueList();
List<List<Revenue>> listList=toRevenueList(list); List<List<Revenue>> listList=toRevenueList2(list);
int count=listList.size(); int count=listList.size();
Integer page=1; Integer page=1;
for (List<Revenue> list1:listList) { for (List<Revenue> list1:listList) {
...@@ -1525,19 +1555,88 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -1525,19 +1555,88 @@ public class JavaToPdfHtmlFreeMarker {
data.put("page",page); data.put("page",page);
data.put("count",count); data.put("count",count);
data.put("time",revenueEntity.getTime()); data.put("time",revenueEntity.getTime());
List<Revenue> list1=new ArrayList<>(); // List<Revenue> list1=new ArrayList<>();
AtomicInteger i= new AtomicInteger(1); // AtomicInteger i= new AtomicInteger(1);
list.forEach( // list.forEach(
revenue -> { // revenue -> {
revenue.setCode(i.get()); // revenue.setCode(i.get());
i.set(i.get() + 1); // i.set(i.get() + 1);
list1.add(revenue); // list1.add(revenue);
} // }
); // );
data.put("revenues",list1); data.put("revenues",list);
return data; return data;
} }
public static List<List<Revenue>> toRevenueList2(List<Revenue> deviceList) throws UnsupportedEncodingException {
List<List<Revenue>> lists=new ArrayList<>();
List<Revenue> revenues=new ArrayList<>();
Integer code=0;
int i=0;
for (int j=0;j< deviceList.size();j++){
Revenue revenue=deviceList.get(j);
int max= toRevenueMax(revenue);
if (i+max==18){
revenue.setModel(String.join("",toListString(revenue.getModel(),20)));
revenue.setDes(String.join("",toListString(revenue.getDes(),10)));
revenue.setPart(String.join("",toListString(revenue.getPart(),20)));
revenue.setOneCount(max);
code++;
revenue.setCode(code);
revenues.add(revenue);
lists.add(revenues);
revenues = new ArrayList<>();
i=0;
}else if (i+max>18){
//当前页面少了多少行
int differ=18-i;
List<String> modelList= toListString(revenue.getModel(),20);
List<String> pasList=toListString(revenue.getPart(),20);
List<String> desList=toListString(revenue.getDes(),10);
Revenue revenue1=new Revenue();
if (modelList.size()>differ){
revenue.setModel(String.join("",modelList.subList(0,differ)));
revenue1.setModel(String.join("",modelList.subList(differ,modelList.size())));
}
if (pasList.size()>differ){
revenue.setPart(String.join("",pasList.subList(0,differ)));
revenue1.setPart(String.join("",pasList.subList(differ,pasList.size())));
}
if (desList.size()>differ){
revenue.setDes(String.join("",desList.subList(0,differ)));
revenue1.setDes(String.join("",desList.subList(differ,desList.size())));
}
code++;
revenue.setCode(code);
revenue.setOneCount(differ);
revenues.add(revenue);
lists.add(revenues);
revenues=new ArrayList<>();
revenue1.setOneCount(max-differ);
code++;
revenue1.setCode(code);
revenues.add(revenue1);
i=max-differ;
}else {
code++;
revenue.setModel(String.join("",toListString(revenue.getModel(),20)));
revenue.setDes(String.join("",toListString(revenue.getDes(),10)));
revenue.setPart(String.join("",toListString(revenue.getPart(),20)));
revenue.setCode(code);
revenue.setOneCount(max);
revenues.add(revenue);
i=i+max;
}
}
if (revenues.size()!=0){
lists.add(revenues);
}
return lists;
}
private static List<List<Revenue>> toRevenueList(List<Revenue> deviceList){ private static List<List<Revenue>> toRevenueList(List<Revenue> deviceList){
List<List<Revenue>> lists=new ArrayList<>(); List<List<Revenue>> lists=new ArrayList<>();
List<Revenue> revenues=new ArrayList<>(); List<Revenue> revenues=new ArrayList<>();
...@@ -1569,13 +1668,19 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -1569,13 +1668,19 @@ public class JavaToPdfHtmlFreeMarker {
private static Integer toRevenueMax(Revenue revenue){ private static Integer toRevenueMax(Revenue revenue){
int partsCount=String_length(revenue.getPart()); int partsCount=String_length(revenue.getPart());
int modelCount=String_length(revenue.getModel()); int modelCount=String_length(revenue.getModel());
int parts = (partsCount%11>0) ? partsCount/11 + 1 : partsCount/11; int desCount=String_length(revenue.getDes());
int model=(modelCount%11>0) ? modelCount/11 + 1 : modelCount/11; int parts = (partsCount%20>0) ? partsCount/20 + 1 : partsCount/20;
int model=(modelCount%20>0) ? modelCount/20 + 1 : modelCount/20;
int des=(desCount%10>0) ? desCount/10 + 1 : desCount/10;
int max=parts; int max=parts;
//求最大 //求最大
if(max<model){ if(max<model){
max=model; max=model;
} }
if (max<des){
max=des;
}
return max; return max;
} }
......
...@@ -298,27 +298,27 @@ ...@@ -298,27 +298,27 @@
<td colspan="3" class="td13" style="text-align: left">${dev.seqStirng!}</td> <td colspan="3" class="td13" style="text-align: left">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 14> <#elseif dev.oneCount == 14>
<td colspan="3" class="td14" style="text-align: left">${dev.seqStirng!}</td> <td colspan="3" class="td14" style="text-align: left">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 14> <#elseif dev.oneCount == 15>
<td colspan="3" class="td15" style="text-align: left">${dev.seqStirng!}</td> <td colspan="3" class="td15" style="text-align: left">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 14> <#elseif dev.oneCount == 16>
<td colspan="3" class="td16" style="text-align: left">${dev.seqStirng!}</td> <td colspan="3" class="td16" style="text-align: left">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 14> <#elseif dev.oneCount == 17>
<td colspan="3" class="td17" style="text-align: left">${dev.seqStirng!}</td> <td colspan="3" class="td17" style="text-align: left">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 14> <#elseif dev.oneCount == 18>
<td colspan="3" class="td18" style="text-align: left">${dev.seqStirng!}</td> <td colspan="3" class="td18" style="text-align: left">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 14> <#elseif dev.oneCount == 19>
<td colspan="3" class="td19" style="text-align: left">${dev.seqStirng!}</td> <td colspan="3" class="td19" style="text-align: left">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 14> <#elseif dev.oneCount == 20>
<td colspan="3" class="td20" style="text-align: left">${dev.seqStirng!}</td> <td colspan="3" class="td20" style="text-align: left">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 14> <#elseif dev.oneCount == 21>
<td colspan="3" class="td21" style="text-align: left">${dev.seqStirng!}</td> <td colspan="3" class="td21" style="text-align: left">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 14> <#elseif dev.oneCount == 22>
<td colspan="3" class="td22" style="text-align: left">${dev.seqStirng!}</td> <td colspan="3" class="td22" style="text-align: left">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 14> <#elseif dev.oneCount == 23>
<td colspan="3" class="td23" style="text-align: left">${dev.seqStirng!}</td> <td colspan="3" class="td23" style="text-align: left">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 14> <#elseif dev.oneCount == 24>
<td colspan="3" class="td24" style="text-align: left">${dev.seqStirng!}</td> <td colspan="3" class="td24" style="text-align: left">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 14> <#elseif dev.oneCount == 25>
<td colspan="3" class="td25" style="text-align: left">${dev.seqStirng!}</td> <td colspan="3" class="td25" style="text-align: left">${dev.seqStirng!}</td>
</#if> </#if>
</tr> </tr>
...@@ -327,8 +327,11 @@ ...@@ -327,8 +327,11 @@
</div> </div>
</div> </div>
<p class="person" style="margin-top: 20px;font-size: 10px;width: 100%;text-align: left;"> <p class="person" style="margin-top: 20px;font-size: 10px;width: 100%;text-align: left;">
<span style="width: 200px;text-align: center;width: 49%;margin: 0;">制表单位:${unit!}</span> <span style="width: 200px;text-align: center;width: 24%;margin: 0;">制表单位:${unit!}</span>
<span style="width: 200px;text-align: center;width: 49%;margin: 0;">制表时间:${time!}</span> <span style="width: 200px;text-align: center;width: 24%;margin: 0;">制表时间:${time!}</span>
<span style="width: 200px;text-align: center;width: 24%;margin: 0;">经办人:</span>
<span style="width: 200px;text-align: center;width: 24%;margin: 0;">审核人:</span>
</p> </p>
</div> </div>
</div> </div>
......
...@@ -152,6 +152,7 @@ ...@@ -152,6 +152,7 @@
.returnTablePrint .tableList { .returnTablePrint .tableList {
height:508px; height:508px;
border-bottom: none; border-bottom: none;
overflow: hidden;
} }
.returnTablePrint .line2>>>.el-table tbody tr:nth-child(odd) { .returnTablePrint .line2>>>.el-table tbody tr:nth-child(odd) {
...@@ -163,7 +164,7 @@ ...@@ -163,7 +164,7 @@
} }
.returnTablePrint .line3 { .returnTablePrint .line3 {
border: 1px solid #7f7f7f; border-bottom: 1px solid #7f7f7f;
border-top: none; border-top: none;
width: 100%; width: 100%;
height: 94px; height: 94px;
...@@ -176,15 +177,18 @@ ...@@ -176,15 +177,18 @@
.returnTablePrint .line3 .left { .returnTablePrint .line3 .left {
display: inline-block; display: inline-block;
width: 49.5%; width: 32%;
text-align: center;
box-sizing: border-box; box-sizing: border-box;
/*padding-left: 20px;*/ /*padding-left: 20px;*/
position: relative; position: relative;
line-height: 94px; line-height: 94px;
} }
.returnTablePrint .line3 .left span{
width: 100%;
}
.returnTablePrint .line3 .left { .returnTablePrint .line3 .left {
border-right: 1px solid #7f7f7f; /*border-right: 1px solid #7f7f7f;*/
/*padding-bottom: 40px;*/ /*padding-bottom: 40px;*/
} }
...@@ -251,9 +255,75 @@ ...@@ -251,9 +255,75 @@
margin-left: 50px; margin-left: 50px;
} }
table.altrowstable2 {
width: 100%;
font-size: 16px;
color: #000;
border-width: 0px;
border-color: #a9c6c9;
border-collapse: collapse;
text-align: center;
table-layout: fixed;
word-break: break-all;
}
table.altrowstable2 th {
height: 25px;
line-height:25px;
font-size: 15px;
background-color: #fff;
border:1px solid #bebebe;
padding-top: 0;
}
table.altrowstable2 td {
height: 25px;
line-height:25px;
font-size: 15px;
word-break: break-all;
word-wrap: break-word;
border:1px solid #bebebe;
width: 100%;
}
.td2{
height: 50px !important;
}
.td3{
height: 75px !important;
}
.td4{
height: 100px !important;
}
.td5{
height: 125px !important;
}
.td6{
height: 150px !important;
}
.td7{
height: 175px !important;
}
.td8{
height: 200px !important;
}
.td9{
height: 225px !important;
}
.td10{
height: 250px !important;
}
.td11{
height: 275px !important;
}
.td12{
height: 300px !important;
}
.td13{
height: 325px !important;
}
table.altrowstable { table.altrowstable {
width: 100%; width: 100%;
font-size: 11px; font-size: 16px;
color: #000; color: #000;
border-width: 0px; border-width: 0px;
border-color: #a9c6c9; border-color: #a9c6c9;
...@@ -264,26 +334,27 @@ ...@@ -264,26 +334,27 @@
} }
table.altrowstable th { table.altrowstable th {
border-style: solid;
background-color: #dedede;
border: 1px solid #bebebe;
height: 24px; height: 24px;
line-height: 24px; line-height:24px;
font-size: 15px; font-size: 15px;
background-color: #ebebeb;
marign-top:none;
border:1px solid #bebebe;
padding-top: 0;
padding-bottom: 0;
} }
table.altrowstable td { table.altrowstable td {
border-width: 0px;
height: 24px; height: 24px;
line-height: 24px; line-height:24px;
font-size: 15px; font-size: 15px;
/*border-style: solid;*/ word-break: normal;
/*border-color: #a9c6c9;*/ word-wrap: normal;
/*border: 1px solid #bebebe;*/ border:1px solid #bebebe;
word-break: break-all; border-bottom: none;
word-wrap: break-word;
width: 100%; width: 100%;
} }
table.altrowstable tr:nth-child(odd){ table.altrowstable tr:nth-child(odd){
background-color: #f8f8f8; background-color: #f8f8f8;
} }
...@@ -332,18 +403,25 @@ ...@@ -332,18 +403,25 @@
<div class="line2 tableList"> <div class="line2 tableList">
<table class="altrowstable" id="alternatecolor"> <table class="altrowstable" id="alternatecolor">
<tr> <tr>
<th width="70px">序号</th> <th width="70px" rowspan="2">序号</th>
<th>型号</th> <th width="150px" rowspan="2">型号</th>
<th>部件</th> <th width="150px" rowspan="2">名称</th>
<th>纵向</th> <th rowspan="2">纵向</th>
<th>横向</th> <th rowspan="2">横向</th>
<th>委托</th> <th rowspan="2">委托</th>
<th>其他</th> <th rowspan="2">其他</th>
<th>合计</th> <th rowspan="2">合计</th>
<th>代管</th> <th rowspan="2">代管</th>
<th colspan="5">本年</th>
<th width="100px" rowspan="2">备注</th>
</tr>
<tr>
<th>收到</th> <th>收到</th>
<th>发出</th> <th>发出</th>
<th>报废</th> <th>报废</th>
<th>销毁</th>
<th>丢失</th>
</tr> </tr>
<#list revenues as dev> <#list revenues as dev>
<tr> <tr>
...@@ -361,13 +439,353 @@ ...@@ -361,13 +439,353 @@
<td>${dev.received!}</td> <td>${dev.received!}</td>
<td>${dev.giveOut!}</td> <td>${dev.giveOut!}</td>
<td>${dev.scrapped!}</td> <td>${dev.scrapped!}</td>
<td>${dev.destory!}</td>
<td>${dev.loss!}</td>
<#if dev.oneCount == 1>
<td>${dev.des!}</td>
<#elseif dev.oneCount == 2>
<td class="td2">${dev.des!}</td>
<#elseif dev.oneCount == 3>
<td class="td3">${dev.des!}</td>
<#elseif dev.oneCount == 4>
<td class="td4">${dev.des!}</td>
<#elseif dev.oneCount == 5>
<td class="td5">${dev.des!}</td>
<#elseif dev.oneCount == 6>
<td class="td6">${dev.des!}</td>
<#elseif dev.oneCount == 7>
<td class="td7">${dev.des!}</td>
<#elseif dev.oneCount == 8>
<td class="td8">${dev.des!}</td>
<#elseif dev.oneCount == 9>
<td class="td9">${dev.des!}</td>
<#elseif dev.oneCount == 10>
<td class="td10">${dev.des!}</td>
<#elseif dev.oneCount == 11>
<td class="td11">${dev.des!}</td>
<#elseif dev.oneCount == 12>
<td class="td12">${dev.des!}</td>
<#elseif dev.oneCount == 13>
<td class="td13">${dev.des!}</td>
<#elseif dev.oneCount == 14>
<td class="td14">${dev.des!}</td>
</#if>
</tr> </tr>
</#list> </#list>
</table> </table>
<table class="altrowstable2" id="alternatecolor">
<tr style="border-bottom: 1px solid #dedede;">
<th width="70px"></th>
<th width="150px"></th>
<th width="150px"></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th width="100px"></th>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</div> </div>
</div> </div>
<div class="line3" style="position: relative;"> <div class="line3" style="position: relative;">
<span class="left"> <span class="left">
<span>
<span style="position: absolute; top: 0px; left: 8px;"
class="label">单位盖章:</span>
<span class="value"></span>
</span>
</span>
<span class="left">
<span> <span>
<span style="position: absolute; top: 0px; left: 8px;" <span style="position: absolute; top: 0px; left: 8px;"
class="label">专管员签名:</span> class="label">专管员签名:</span>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论