上传文件替换代码
This commit is contained in:
parent
912c76b29f
commit
90d105bc3e
@ -513,29 +513,49 @@ public class UpFileExcelAndPptController {
|
||||
|
||||
XSLFTable tables = (XSLFTable) shape;
|
||||
XSLFTableRow firstRow = tables.getRows().get(1);
|
||||
// 获取表格的第一行
|
||||
for (int i = 0; i < versionHistoryTable.size(); i++) {
|
||||
|
||||
|
||||
JSONObject obj2 = versionHistoryTable.getJSONObject(i);
|
||||
// 替换参数
|
||||
if (i==0){
|
||||
for (int col = 0; col < firstRow.getCells().size(); col++) {
|
||||
XSLFTableCell cell = firstRow.getCells().get(col);
|
||||
String text = cell.getText();
|
||||
if(versionHistoryTable.size()==1){
|
||||
JSONObject obj2 = versionHistoryTable.getJSONObject(0);
|
||||
for (int col = 0; col < firstRow.getCells().size(); col++) {
|
||||
XSLFTableCell cell = firstRow.getCells().get(col);
|
||||
String text = cell.getText();
|
||||
|
||||
text = text.replace("{{version}}", obj2.getString("P_versions"));
|
||||
text = text.replace("{{company}}", obj2.getString("Issuing_department"));
|
||||
text = text.replace("{{creauser}}", obj2.getString("Drafted_and_revised_by"));
|
||||
text = text.replace("{{date}}", obj2.getString("Drafted_and_revised_date"));
|
||||
text = text.replace("{{shen_user}}",obj2.getString("auditor") );
|
||||
text = text.replace("{{fuhe_user}}", obj2.getString("reviewer"));
|
||||
text = text.replace("{{shenpi_user}}", obj2.getString("approver"));
|
||||
text = text.replace("{{person}}", obj2.getString("Contents_and_reasons_for_revision"));
|
||||
cell.setText(text);
|
||||
text = text.replace("{{version}}", obj2.getString("P_versions"));
|
||||
text = text.replace("{{company}}", obj2.getString("Issuing_department"));
|
||||
text = text.replace("{{creauser}}", obj2.getString("Drafted_and_revised_by"));
|
||||
text = text.replace("{{date}}", obj2.getString("Drafted_and_revised_date"));
|
||||
text = text.replace("{{shen_user}}",obj2.getString("auditor") );
|
||||
text = text.replace("{{fuhe_user}}", obj2.getString("reviewer"));
|
||||
text = text.replace("{{shenpi_user}}", obj2.getString("approver"));
|
||||
text = text.replace("{{person}}", obj2.getString("Contents_and_reasons_for_revision"));
|
||||
cell.setText(text);
|
||||
|
||||
}
|
||||
}else {
|
||||
}
|
||||
}else {
|
||||
|
||||
|
||||
JSONObject obj2 = versionHistoryTable.getJSONObject(0);
|
||||
for (int col = 0; col < firstRow.getCells().size(); col++) {
|
||||
XSLFTableCell cell = firstRow.getCells().get(col);
|
||||
String text = cell.getText();
|
||||
|
||||
text = text.replace("{{version}}", obj2.getString("P_versions"));
|
||||
text = text.replace("{{company}}", obj2.getString("Issuing_department"));
|
||||
text = text.replace("{{creauser}}", obj2.getString("Drafted_and_revised_by"));
|
||||
text = text.replace("{{date}}", obj2.getString("Drafted_and_revised_date"));
|
||||
text = text.replace("{{shen_user}}",obj2.getString("auditor") );
|
||||
text = text.replace("{{fuhe_user}}", obj2.getString("reviewer"));
|
||||
text = text.replace("{{shenpi_user}}", obj2.getString("approver"));
|
||||
text = text.replace("{{person}}", obj2.getString("Contents_and_reasons_for_revision"));
|
||||
cell.setText(text);
|
||||
|
||||
}
|
||||
|
||||
for (int i =1; i < versionHistoryTable.size(); i++) {
|
||||
|
||||
JSONObject obj = versionHistoryTable.getJSONObject(i);
|
||||
// 替换参数
|
||||
XSLFTableRow newRow = table.addRow();
|
||||
|
||||
// 复制单元格
|
||||
@ -548,20 +568,21 @@ public class UpFileExcelAndPptController {
|
||||
XSLFTableCell cell = newRow.getCells().get(col);
|
||||
String text = cell.getText();
|
||||
|
||||
text = text.replace("{{version}}", obj2.getString("P_versions"));
|
||||
text = text.replace("{{company}}", obj2.getString("Issuing_department"));
|
||||
text = text.replace("{{creauser}}", obj2.getString("Drafted_and_revised_by"));
|
||||
text = text.replace("{{date}}", obj2.getString("Drafted_and_revised_date"));
|
||||
text = text.replace("{{shen_user}}",obj2.getString("auditor") );
|
||||
text = text.replace("{{fuhe_user}}", obj2.getString("reviewer"));
|
||||
text = text.replace("{{shenpi_user}}", obj2.getString("approver"));
|
||||
text = text.replace("{{person}}", obj2.getString("Contents_and_reasons_for_revision"));
|
||||
text = text.replace("{{version}}", obj.getString("P_versions"));
|
||||
text = text.replace("{{company}}", obj.getString("Issuing_department"));
|
||||
text = text.replace("{{creauser}}", obj.getString("Drafted_and_revised_by"));
|
||||
text = text.replace("{{date}}", obj.getString("Drafted_and_revised_date"));
|
||||
text = text.replace("{{shen_user}}",obj.getString("auditor") );
|
||||
text = text.replace("{{fuhe_user}}", obj.getString("reviewer"));
|
||||
text = text.replace("{{shenpi_user}}", obj.getString("approver"));
|
||||
text = text.replace("{{person}}", obj.getString("Contents_and_reasons_for_revision"));
|
||||
cell.setText(text);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// 获取表格的第一行
|
||||
SDK.getLogAPI().consoleInfo("asddasdasdas");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user