Commit e4055cb3 authored by 黄重's avatar 黄重

结构化代码提交

parent c34f51ac
......@@ -5,7 +5,7 @@ public class Td {
private String colType;
private String content;
private int width;
private boolean needFill;
// private boolean needFill;
public String getColType() {
return colType;
......@@ -31,12 +31,12 @@ public class Td {
this.width = width;
}
public boolean isNeedFill() {
return needFill;
}
public void setNeedFill(boolean needFill) {
this.needFill = needFill;
}
// public boolean isNeedFill() {
// return needFill;
// }
//
// public void setNeedFill(boolean needFill) {
// this.needFill = needFill;
// }
}
\ No newline at end of file
......@@ -73,6 +73,10 @@ public class ParsingXmlUtils {
*/
public static TableXML parsingTableXML(String tableXMLPath) {
File xmlFile = new File(tableXMLPath);
if(tableXMLPath.contains("4fbf7eab25f645d8b5937d7e022d2f1a.xml")) {
System.out.println(tableXMLPath);
}
if (!xmlFile.isFile() || !xmlFile.exists()) {
return null;
}
......@@ -80,7 +84,9 @@ public class ParsingXmlUtils {
if (null == document) {
return null;
}
return TableXML.newInstance(document.getRootElement());
TableXML TableXML1 = TableXML.newInstance(document.getRootElement());
// return TableXML.newInstance(document.getRootElement());
return TableXML1;
}
/**
......
......@@ -38,6 +38,7 @@ public class ComparisonData {
}
public String putComparisonContent(String rowId, String titleId, String itemId, String value) {
// System.out.println( "keys:" +rowId +","+ titleId+","+itemId + " value :" + value + "\r\n");
return comparisonContentMap.put(Keys.of(rowId, titleId, itemId), value);
}
......
......@@ -80,7 +80,7 @@ public class ComparisonTable extends KTable {
* @return
*/
private String receiveContent(int row, int col) {
if (col < headColList.size()) {
if (col < headColList.size()) {
if (row == 0) return Optional.of(headColList.get(col)).map(Column::getName).orElse("");
if (row == 1) return "";
return Optional.of(Keys.of(rowList.get(row - 2), headColList.get(col).getId())).map(headContentMap::get).orElse("");
......@@ -90,6 +90,9 @@ public class ComparisonTable extends KTable {
if (row == 0) return Optional.of(titleColList.get(col / itemSize)).map(Column::getName).orElse("");
if (row == 1) return Optional.of(itemColList.get(col % itemSize)).map(Column::getName).orElse("");
try {
System.out.println( "keys:" +rowList.get(row - 2) +","+ titleColList.get(col / itemSize).getId()+","+itemColList.get(col % itemSize).getId() + " value :" + comparisonContentMap.get(Keys.of(rowList.get(row - 2), titleColList.get(col / itemSize).getId(), itemColList.get(col % itemSize).getId())) + "\r\n");
// System.out.println(Keys.of(rowList.get(row - 2), titleColList.get(col / itemSize).getId(), itemColList.get(col % itemSize).getId()));
// System.out.println(comparisonContentMap.get(Keys.of(rowList.get(row - 2), titleColList.get(col / itemSize).getId(), itemColList.get(col % itemSize).getId())));
return Optional.of(Keys.of(rowList.get(row - 2), titleColList.get(col / itemSize).getId(), itemColList.get(col % itemSize).getId())).map(comparisonContentMap::get).orElse("");
} catch (Exception e) {
return "";
......
......@@ -207,6 +207,7 @@ public class JsonUtil {
if (ObjectUtil.isNull(t)) {
return null;
}
System.out.println(JSONUtil.toJsonPrettyStr(t));
return JSONUtil.toJsonPrettyStr(t);
}
......
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/Utils-1.0.0.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
......
......@@ -19,18 +19,9 @@ Require-Bundle: org.eclipse.ui,
com.gx.obe.action,
com.gx.obe.bind;bundle-version="1.0.0",
com.gx.obe.component;bundle-version="1.0.0",
com.gx.obe.common.widget
com.gx.obe.common.widget,
com.gx.obe.httputil;bundle-version="1.0.0"
Export-Package: com.gx.obe.evaluation.struct.enumeration,
com.gx.obe.http,
com.gx.obe.http.converter,
com.gx.obe.http.core,
com.gx.obe.http.entity,
com.gx.obe.http.exception,
com.gx.obe.http.json,
com.gx.obe.http.jsons,
com.gx.obe.http.ssl,
com.gx.obe.http.test,
com.gx.obe.http.util,
com.gx.obe.struct,
com.gx.obe.struct.beans,
com.gx.obe.struct.composite,
......@@ -47,5 +38,4 @@ Export-Package: com.gx.obe.evaluation.struct.enumeration,
com.gx.obe.struct.utils,
com.gx.obe.struct.value_list,
com.gx.obe.struct.widget
Bundle-ClassPath: lib/Utils-1.0.0.jar,
.
Bundle-ClassPath: .
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
lib/Utils-1.0.0.jar
.
package com.gx.obe.struct.beans;
import java.util.ArrayList;
import java.util.List;
/**
* @Description: 表格xml
* @author chenxw
*/
public class TableXML2 {
private List<Tr> headList = new ArrayList<Tr>();
private List<Tr> bodyList = new ArrayList<Tr>();
public List<Tr> getHeadList() {
return headList;
}
public void setHeadList(List<Tr> headList) {
this.headList = headList;
}
public List<Tr> getBodyList() {
return bodyList;
}
public void setBodyList(List<Tr> bodyList) {
this.bodyList = bodyList;
}
}
package com.gx.obe.struct.beans;
public class Td {
private String colType;
private String content;
private int width;
private boolean needFill;
public String getColType() {
return colType;
}
public String getContent() {
return content;
}
public int getWidth() {
return width;
}
public void setColType(String colType) {
this.colType = colType;
}
public void setContent(String content) {
this.content = content;
}
public void setWidth(int width) {
this.width = width;
}
public boolean isNeedFill() {
return needFill;
}
public void setNeedFill(boolean needFill) {
this.needFill = needFill;
}
}
\ No newline at end of file
package com.gx.obe.struct.beans;
public class Tr {
private Td[] tds;
private boolean isTitle;
private boolean isCount;
private String subjectTableID;
public void setTds(Td[] tds) {
this.tds = tds;
}
public Td[] getTds() {
return tds;
}
public void setTitle(boolean isTitle) {
this.isTitle = isTitle;
}
public boolean isTitle() {
return isTitle;
}
public void setSubjectTableID(String subjectTableID) {
this.subjectTableID = subjectTableID;
}
public String getSubjectTableID() {
return subjectTableID;
}
public void setCount(boolean isCount) {
this.isCount = isCount;
}
public boolean isCount() {
return isCount;
}
}
\ No newline at end of file
......@@ -19,16 +19,22 @@ import com.gx.obe.component.comparison.ComparisonTable;
import com.gx.obe.component.rx.RxSwt;
import com.gx.obe.component.utils.CompositeUtils;
import com.gx.obe.components.core.Constants;
import com.gx.obe.components.core.vo.TableXML;
import com.gx.obe.components.core.vo.TableXML.Tr;
import com.gx.obe.components.core.vo.TableXML.Tr.Td;
//import com.gx.obe.components.core.vo.TableXML;
//import com.gx.obe.components.core.vo.TableXML.Tr;
//import com.gx.obe.components.core.vo.TableXML.Tr.Td;
import com.gx.obe.http.json.JsonUtil;
import com.gx.obe.struct.beans.TableXML2;
import com.gx.obe.struct.beans.Td;
import com.gx.obe.struct.beans.TemplateTable;
import com.gx.obe.struct.beans.Tr;
import com.gx.obe.struct.service.TemplateTableService;
import com.gx.obe.util.utils.CollectionUtils;
import com.gx.obe.util.utils.StringUtils;
import com.gx.obe.web.entity.Supplier;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
public class TemplateTableComparisonComposite extends Composite {
private final TemplateTableService templateTableService = new TemplateTableService();
......@@ -54,12 +60,20 @@ public class TemplateTableComparisonComposite extends Composite {
if (CollectionUtils.isNull(templateTableList)) {
return null;
}
// List<Tr> trList = null;
int rowCount = 0;
Map<String, TemplateTable> templateTableMap = templateTableList.stream().collect(Collectors.toMap(TemplateTable::getSupplierId, Function.identity()));
for(TemplateTable templateTable : templateTableList) {
TableXML2 tableXML = JsonUtil.jsonToBean(templateTable.getTableInfo(), TableXML2.class);
if(rowCount < tableXML.getBodyList().size()) {
rowCount = tableXML.getBodyList().size();
}
}
TemplateTable templateTable = templateTableMap.get(Constants.BIDDING_ID);
if (templateTable == null) {
return null;
}
TableXML tableXML = JsonUtil.jsonToBean(templateTable.getTableInfo(), TableXML.class);
TableXML2 tableXML = JsonUtil.jsonToBean(templateTable.getTableInfo(), TableXML2.class);
if (tableXML == null) {
return null;
}
......@@ -73,25 +87,41 @@ public class TemplateTableComparisonComposite extends Composite {
return null;
}
ComparisonData comparisonData = new ComparisonData();
tableXML.getBodyList().forEach(body -> Optional.ofNullable(getContent(body, indexCol.getAsInt())).filter(StringUtils::isNotEmpty).ifPresent(comparisonData::addRow));
supplierList.forEach(supplier -> {
// for(Tr tr : tableXML.getBodyList()) {
// System.out.println(getContent(tr, indexCol.getAsInt()));
// comparisonData.addRow(getContent(tr, indexCol.getAsInt()));
// }
for(int index = 0; index < rowCount; index++) {
comparisonData.addRow((index + 1) + "");
}
// tableXML.getBodyList().forEach(body -> Optional.ofNullable(getContent(body, indexCol.getAsInt())).filter(StringUtils::isNotEmpty).ifPresent(comparisonData::addRow));
for(Supplier supplier : supplierList) {
comparisonData.addTitleCol(new Column(supplier.getId(), supplier.getSupplierName()));
});
}
// supplierList.forEach(supplier -> {
// comparisonData.addTitleCol(new Column(supplier.getId(), supplier.getSupplierName()));
// });
IntStream.range(0, head.getTds().length).forEach(i -> {
comparisonDataInit(templateTableMap, tableXML, head, indexCol.getAsInt(), i, supplierList, comparisonData);
});
for(int index = 0;index < head.getTds().length; index++) {
comparisonDataInit(templateTableMap, tableXML, head, indexCol.getAsInt(), index, supplierList, comparisonData);
}
// IntStream.range(0, head.getTds().length).forEach(i -> {
// comparisonDataInit(templateTableMap, tableXML, head, indexCol.getAsInt(), i, supplierList, comparisonData);
// });
return comparisonData;
}
private void comparisonDataInit(Map<String, TemplateTable> templateTableMap, TableXML tableXML, Tr head, int indexCol, int col, List<Supplier> supplierList, ComparisonData comparisonData) {
private void comparisonDataInit(Map<String, TemplateTable> templateTableMap, TableXML2 tableXML, Tr head, int indexCol, int col, List<Supplier> supplierList, ComparisonData comparisonData) {
Td td = head.getTds()[col];
// supplierList.forEach(supplier -> {
// supplierComparisonDataInit(templateTableMap, indexCol, col, supplier, comparisonData);
// });
for(Supplier supplier : supplierList) {
supplierComparisonDataInit(templateTableMap, indexCol, col, supplier, comparisonData);
}
// comparisonData.addItemCol(new Column(col + "", td.getContent()));
comparisonData.addItemCol(new Column(col + "", td.getContent()));
// if (td.isNeedFill()) {
// comparisonData.addItemCol(new Column(col + "", td.getContent()));
// supplierList.forEach(supplier -> {
// supplierComparisonDataInit(templateTableMap, indexCol, col, supplier, comparisonData);
// });
// } else {
// comparisonData.addHeadCol(new Column(col + "", td.getContent()));
// tableXML.getBodyList().forEach(body -> {
......@@ -105,20 +135,29 @@ public class TemplateTableComparisonComposite extends Composite {
if (supplierTemplateTable == null) {
return;
}
TableXML supplierTableXML = JsonUtil.jsonToBean(supplierTemplateTable.getTableInfo(), TableXML.class);
TableXML2 supplierTableXML = JsonUtil.jsonToBean(supplierTemplateTable.getTableInfo(), TableXML2.class);
if (supplierTableXML == null) {
return;
}
supplierTableXML.getBodyList().forEach(body -> {
comparisonData.putComparisonContent(getContent(body, indexCol), supplier.getId(), col + "", getContent(body, col));
});
for(Tr tes: supplierTableXML.getBodyList()) {
comparisonData.putComparisonContent(getContent(tes, indexCol), supplier.getId(), col + "", getContent(tes, col));
}
// System.out.println(comparisonData.getComparisonContentMap());
// System.out.println();
// supplierTableXML.getBodyList().forEach(body -> {
// comparisonData.putComparisonContent(getContent(body, indexCol), supplier.getId(), col + "", getContent(body, col));
// });
}
private String getContent(Tr tr, int col) {
// System.out.println(col);
// System.out.println(tr.getTds()[col].getContent());
return tr.getTds()[col].getContent();
}
@Override
protected void checkSubclass() {}
}
package com.gx.obe.struct.composite;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.OptionalInt;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import com.gx.obe.bind.prop.Prop;
import com.gx.obe.component.comparison.Column;
import com.gx.obe.component.comparison.ComparisonData;
import com.gx.obe.component.comparison.ComparisonTable;
import com.gx.obe.component.rx.RxSwt;
import com.gx.obe.component.utils.CompositeUtils;
import com.gx.obe.components.core.Constants;
//import com.gx.obe.components.core.vo.TableXML;
//import com.gx.obe.components.core.vo.TableXML.Tr;
//import com.gx.obe.components.core.vo.TableXML.Tr.Td;
import com.gx.obe.http.json.JsonUtil;
import com.gx.obe.struct.beans.TableXML2;
import com.gx.obe.struct.beans.Td;
import com.gx.obe.struct.beans.TemplateTable;
import com.gx.obe.struct.beans.Tr;
import com.gx.obe.struct.service.TemplateTableService;
import com.gx.obe.util.utils.CollectionUtils;
import com.gx.obe.util.utils.StringUtils;
import com.gx.obe.web.entity.Supplier;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
public class TemplateTableComparisonComposite2 extends Composite {
private final TemplateTableService templateTableService = new TemplateTableService();
private final Prop<ComparisonData> comparisonData = new Prop<>();
public TemplateTableComparisonComposite2(Composite parent, int style) {
super(parent, style);
setLayout(new FillLayout(SWT.HORIZONTAL));
comparisonData.bind(t -> {
CompositeUtils.disposeChildren(this);
new ComparisonTable(this, t);
this.layout();
});
}
public void refresh(String tenderId, String relChapterType, String dataCode, List<Supplier> supplierList) {
RxSwt.run(() -> getComparisonData(tenderId, relChapterType, dataCode, supplierList)).checkWidget(this).exe(comparisonData::set);
}
private ComparisonData getComparisonData(String tenderId, String relChapterType, String dataCode, List<Supplier> supplierList) {
List<TemplateTable> templateTableList = templateTableService.getTemplateTableList(tenderId, relChapterType, dataCode);
if (CollectionUtils.isNull(templateTableList)) {
return null;
}
Map<String, TemplateTable> templateTableMap = templateTableList.stream().collect(Collectors.toMap(TemplateTable::getSupplierId, Function.identity()));
TemplateTable templateTable = templateTableMap.get(Constants.BIDDING_ID);
if (templateTable == null) {
return null;
}
TableXML2 tableXML = JsonUtil.jsonToBean(templateTable.getTableInfo(), TableXML2.class);
if (tableXML == null) {
return null;
}
List<Tr> headList = tableXML.getHeadList();
if (headList.size() != 1) {
return null;
}
Tr head = headList.get(0);
OptionalInt indexCol = IntStream.range(0, head.getTds().length).filter(i -> "序号".equals(head.getTds()[i].getContent())).findAny();
if (!indexCol.isPresent()) {
return null;
}
ComparisonData comparisonData = new ComparisonData();
tableXML.getBodyList().forEach(body -> Optional.ofNullable(getContent(body, indexCol.getAsInt())).filter(StringUtils::isNotEmpty).ifPresent(comparisonData::addRow));
supplierList.forEach(supplier -> {
comparisonData.addTitleCol(new Column(supplier.getId(), supplier.getSupplierName()));
});
IntStream.range(0, head.getTds().length).forEach(i -> {
comparisonDataInit(templateTableMap, tableXML, head, indexCol.getAsInt(), i, supplierList, comparisonData);
});
return comparisonData;
}
private void comparisonDataInit(Map<String, TemplateTable> templateTableMap, TableXML2 tableXML, Tr head, int indexCol, int col, List<Supplier> supplierList, ComparisonData comparisonData) {
Td td = head.getTds()[col];
supplierList.forEach(supplier -> {
supplierComparisonDataInit(templateTableMap, indexCol, col, supplier, comparisonData);
});
if (td.isNeedFill()) {
comparisonData.addItemCol(new Column(col + "", td.getContent()));
} else {
comparisonData.addHeadCol(new Column(col + "", td.getContent()));
tableXML.getBodyList().forEach(body -> {
comparisonData.putHeadContent(getContent(body, indexCol), col + "", getContent(body, col));
});
}
}
private void supplierComparisonDataInit(Map<String, TemplateTable> templateTableMap, int indexCol, int col, Supplier supplier, ComparisonData comparisonData) {
TemplateTable supplierTemplateTable = templateTableMap.get(supplier.getId());
if (supplierTemplateTable == null) {
return;
}
TableXML2 supplierTableXML = JsonUtil.jsonToBean(supplierTemplateTable.getTableInfo(), TableXML2.class);
if (supplierTableXML == null) {
return;
}
for(Tr tes: supplierTableXML.getBodyList()) {
comparisonData.putComparisonContent(getContent(tes, indexCol), supplier.getId(), col + "", getContent(tes, col));
}
// supplierTableXML.getBodyList().forEach(body -> {
// comparisonData.putComparisonContent(getContent(body, indexCol), supplier.getId(), col + "", getContent(body, col));
// });
}
private String getContent(Tr tr, int col) {
return tr.getTds()[col].getContent();
}
@Override
protected void checkSubclass() {}
}
......@@ -114,7 +114,7 @@ public class TemplateTableListComposite extends Composite {
RxSwt.run(() -> evaluationContentService.getEvaluationContentListByFactorCode(tenderId, factorCode)).checkWidget(this).other(ArrayList::new).exe(l -> {
TemplateTableData data = new TemplateTableData();
data.tenderId = tenderId;
data.evaluationContentList = l.stream().filter(t -> DataCategoryEnum.MD.getKey().equals(t.getDataCategory())).collect(Collectors.toList());
data.evaluationContentList = l.stream().filter(t -> DataCategoryEnum.TT.getKey().equals(t.getDataCategory())).collect(Collectors.toList());
data.supplierList = supplierList;
this.templateTableData.set(data);
});
......
......@@ -135,7 +135,7 @@ public class ParsingStructThread implements Runnable {
});
} catch (Exception e) {
messageProgress.message("解析招标结构化数据失败,请检查是否下载招标文件!", -1);
System.out.println(e.getMessage());
// System.out.println(e.getMessage());
return;
}
messageProgress.message("结构化标书结构解析成功!", 1);
......@@ -151,7 +151,7 @@ public class ParsingStructThread implements Runnable {
});
} catch (Exception e) {
messageProgress.message("解析投标结构化数据失败!", -1);
System.out.println(e.getStackTrace());
// System.out.println(e.getStackTrace());
return;
}
messageProgress.message("解析投标结构化数据成功!", 1);
......@@ -180,21 +180,20 @@ public class ParsingStructThread implements Runnable {
*/
private void parsingSupplierBidFileStruct(Supplier supplier, Map<String, Set<String>> relChapterTypeSetMap, String bidFilePath) {
//获取BidFileIndexTree.xml中fileItem列表
System.out.println(supplier.getSupplierName());
System.out.println(relChapterTypeSetMap);
// System.out.println(supplier.getSupplierName());
// System.out.println(relChapterTypeSetMap);
ParsingStructXmlUtils.resolverBidFileIndexTree(bidFilePath).filter(t -> !t.isEmpty()).ifPresent(el -> {
//解析小范本表单数据
Optional.ofNullable(relChapterTypeSetMap.get(DataCategoryEnum.TDI.getKey())).ifPresent(l -> structDateInfo.getTemplateDataItemList().addAll(l.stream().map(t -> {
System.out.println("resolverObeTemplateDataItem");
// System.out.println("resolverObeTemplateDataItem");
return ParsingStructXmlUtils.resolverObeTemplateDataItem(tenderId, supplier.getId(), t, el, bidFilePath);
}).filter(Optional::isPresent).map(Optional::get).flatMap(List::stream).collect(Collectors.toList())));
//解析小范本表格数据
System.out.println("resolverTemplateTable");
Optional.ofNullable(relChapterTypeSetMap.get(DataCategoryEnum.TT.getKey())).ifPresent(l -> structDateInfo.getTemplateTableList().addAll(l.stream().map(t -> {
// System.out.println(bidFilePath);
return ParsingStructXmlUtils.resolverTemplateTable(tenderId, supplier.getId(), t, el, bidFilePath);
}).filter(Optional::isPresent).map(Optional::get).flatMap(List::stream).collect(Collectors.toList())));
//解析对象结构化数据
System.out.println("parsingModelData");
Optional.ofNullable(relChapterTypeSetMap.get(DataCategoryEnum.MD.getKey())).ifPresent(l -> l.stream().forEach(t -> parsingModelData(t, supplier, el, bidFilePath)));
});
}
......@@ -210,7 +209,6 @@ public class ParsingStructThread implements Runnable {
private void parsingModelData(String relChapterType, Supplier supplier, List<Element> fileItemElementList, String bidFilePath) {
//获取结构化数据xml文件地址
RelChapterTypeHandler handler = new RelChapterTypeHandler(relChapterType);
System.out.println(relChapterType);
Optional<ModelDataTypeEnum> modelDataTypeEnum = Optional.of(handler.getRelChapterType()).map(ModelDataTypeEnum.MAP::get);
fileItemElementList.stream().filter(t -> {
......@@ -219,8 +217,8 @@ public class ParsingStructThread implements Runnable {
ModelData modelData = initModelData(supplier.getId(), modelDataTypeEnum.map(ModelDataTypeEnum.EQ_ProjectLeader::equals).orElse(false) ? handler.getRelChapterType() : relChapterType);
structDateInfo.getModelDataList().add(modelData);
System.out.println(handler.getMark());
System.out.println(relChapterType);
// System.out.println(handler.getMark());
// System.out.println(relChapterType);
modelDataTypeEnum.map(ModelDataTypeEnum::getClassEnum).ifPresent(t -> parsingModelDataDetail(t, modelData.getId(), xmlFilePath, handler.getMark()));
});
}
......@@ -250,31 +248,31 @@ public class ParsingStructThread implements Runnable {
* @param string
*/
private void parsingModelDataDetail(ModelDataClassEnum modelDataEnum, String modelDataId, String xmlFilePath, String mark) {
System.out.println("parsingModelDataDetail");
// System.out.println("parsingModelDataDetail");
Consumer<ParsingStructXmlUtils.AttachmentFileOperation> consumer = t -> ParsingStructXmlUtils.resolverAttachmentFile(t).ifPresent(structDateInfo.getAttachmentFileList()::addAll);
switch (modelDataEnum) {
case BusinessLicense:
System.out.println("BusinessLicense");
// System.out.println("BusinessLicense");
ParsingStructXmlUtils.resolverBusinessLicense(tenderId, modelDataId, xmlFilePath, consumer).ifPresent(structDateInfo.getBusinessLicenseList()::addAll);
break;
case BidderInfo:
System.out.println("BidderInfo");
// System.out.println("BidderInfo");
ParsingStructXmlUtils.resolverBidderBasicInfo(tenderId, modelDataId, xmlFilePath, consumer).ifPresent(structDateInfo.getBidderBasicInfoList()::addAll);
break;
case Finance:
System.out.println("Finance");
// System.out.println("Finance");
ParsingStructXmlUtils.resolverFinance(tenderId, modelDataId, xmlFilePath, consumer).ifPresent(structDateInfo.getFinanceList()::addAll);
break;
case Performance:
System.out.println("Performance");
// System.out.println("Performance");
ParsingStructXmlUtils.resolverPerformance(tenderId, modelDataId, xmlFilePath, consumer, mark).ifPresent(structDateInfo.getPerformanceList()::addAll);
break;
case ProjectLeader:
System.out.println("ProjectLeader");
// System.out.println("ProjectLeader");
ParsingStructXmlUtils.resolverProjectLeader(tenderId, modelDataId, xmlFilePath, consumer).ifPresent(structDateInfo.getProjectLeaderList()::addAll);
break;
case Qualification:
System.out.println("Qualification");
// System.out.println("Qualification");
ParsingStructXmlUtils.resolverQualification(tenderId, modelDataId, xmlFilePath, consumer).ifPresent(structDateInfo.getQualificationList()::addAll);
break;
default:
......@@ -290,7 +288,7 @@ public class ParsingStructThread implements Runnable {
* @return
*/
private ModelData initModelData(String supplierId, String relChapterType) {
System.out.println("initModelData");
// System.out.println("initModelData");
ModelData modelData = new ModelData();
modelData.setId(UuidUtils.getUUID());
modelData.setTenderId(tenderId);
......
......@@ -137,16 +137,16 @@ public class ParsingStructXmlUtils {
return Optional.empty();
}
return fileItemElementList.stream().filter(t -> {
// System.out.println(t.elementTextTrim("chapterType"));
return relChapterType.equals(t.elementTextTrim("chapterType"));
}).findAny().map(t -> t.element("tableList")).map(t -> t.elements("tableInfo")).map(l -> {
return streamElement(l).map(ParsingStructXmlUtils::initTemplateTable).peek(t -> {
t.setTenderId(tenderId);
t.setSupplierId(supplierId);
t.setRelChapterType(relChapterType);
if (Stream.of("CompletedAchievements", "OngoingAchievements").anyMatch(Predicate.isEqual(relChapterType))) {
t.setDataCode(relChapterType);
}
// if (Stream.of("CompletedAchievements", "OngoingAchievements").anyMatch(Predicate.isEqual(relChapterType))) {
// t.setDataCode(relChapterType);
// }
System.out.println(t.getXmlPath());
Optional.ofNullable(bidFilePath).map(p -> p.concat(t.getXmlPath())).map(ParsingXmlUtils::parsingTableXML).map(JsonUtil::jsonObjectToStr).ifPresent(t::setTableInfo);
}).collect(Collectors.toList());
});
......@@ -155,7 +155,7 @@ public class ParsingStructXmlUtils {
public static Optional<List<TemplateTable>> resolverTemplateTable(String tenderId, String relChapterType) {
String biddingFilePath = Constants.getBiddingFilePath(tenderId);
Document document = XmlUtils.getXmlDocument(biddingFilePath + TENDER_STRUCT);
System.out.println();
if (document == null) {
throw new RuntimeException();
}
......@@ -185,7 +185,8 @@ public class ParsingStructXmlUtils {
TemplateTable templateTable = new TemplateTable();
String tableId = templateTableElement.elementTextTrim("tableId");
templateTable.setId(StringUtils.isEmpty(tableId) ? UuidUtils.getUUID() : tableId);
templateTable.setDataCode(templateTableElement.elementTextTrim("bookMarkName"));
templateTable.setDataCode(templateTableElement.elementTextTrim("dataCode"));
System.out.println(templateTableElement.elementTextTrim("dataCode"));
templateTable.setXmlPath(templateTableElement.elementTextTrim("xmlPath"));
templateTable.setTableName(templateTableElement.elementTextTrim("tableName"));
return templateTable;
......@@ -746,7 +747,6 @@ public class ParsingStructXmlUtils {
* @return
*/
public static Optional<List<AttachmentFile>> resolverAttachmentFile(AttachmentFileOperation attachmentFileOperation) {
System.out.println("resolverAttachmentFile");
Optional<AttachmentFileOperation> attachmentFileOperationOptional = Optional.ofNullable(attachmentFileOperation);
Consumer<AttachmentFile> action = a -> {
attachmentFileOperationOptional.map(t -> t.tenderId).ifPresent(t -> a.setTenderId(t));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment