📄 preadvicepagehtmlbuilder.java
字号:
content.append(hp.getDPNodeStr(field.getDPPrefix(args.iterator())));
content.append(" </td>\n");
} else if (PreAdviceFieldConstants.FIELD_DETAIL_INVOICE_NUM.equals(field.getCode())) {
content.append(" <td align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
content.append(invoiceNum);
content.append(" </td>\n");
} else if (PreAdviceFieldConstants.FIELD_DETAIL_CR_STATUS.equals(field.getCode())) {
content.append(" <td align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
content.append(crStatus);
content.append(" </td>\n");
} else if (PreAdviceFieldConstants.FIELD_DETAIL_CR_DATE.equals(field.getCode())) {
content.append(" <td align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
content.append(crDate);
content.append(" </td>\n");
} else if (PreAdviceFieldConstants.FIELD_DETAIL_CR_READY_DATE.equals(field.getCode())) {
content.append(" <td align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
content.append(crReadyDate);
content.append(" </td>\n");
}
// TODO:gejo customized field
// for customized field
else if (PreAdviceUtil.isCustomizedField(field)) {
content.append(" <td align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
try {
content.append(PreAdviceUtil.getCustomizedValue(field, soItemOid, getSc()));
} catch (ServiceException e) {
throw new RuntimeException(e);
}
content.append(" </td>\n");
// for package
} else {
// no of pack
if (PreAdviceFieldConstants.FIELD_DETAIL_PACKING.equals(field.getCode())) {
content.append(" <td class=\"");
content.append(css);
content.append("\" align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
content.append(i3 == 0 ? hp.getDPNodeStr(packagePrefix + ".no_of_pack") + " " + hp.getDPNodeStr(packagePrefix + ".unit_of_pack") : "");
content.append(" </td>\n");
} else {
content.append(" <td align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
content.append(i3 == 0 ? hp.getDPNodeStr(field.getDPPrefix(args.iterator())) : "");
content.append(" </td>\n");
} // end of package
}
}
content.append(" </tr>\n");
args.remove(args.size() - 1);
} // end of item
// Remarks
args.remove(args.size() - 1);
} // end of package
args.remove(args.size() - 1);
}
content.append("<!-- SO Information : end -->\n");
content.append("<!-- SOGroupVisitor.before: end -->\n");
content.append(" ");
return content;
}
}
// Template Method
public StringBuffer buildPage() throws ServiceException {
// build the group tree, node_list[0] is the root of the tree.
AbstractPrePostAdviceVisitor root = buildVisitors(new PrePostAdviceGroupVisitor("0") {
public StringBuffer after() {
StringBuffer content = super.after();
content.append("<script type=\"text/javascript\">\n");
content.append("</script>\n");
content.append("<!-- afterGroup: begin -->\n");
content.append(" <a name=\"anchorSummary\"/>\n");
content.append(" <table border=\"0\" width=\"75%\">\n");
content.append(" <tr class=\"TH1\">\n");
for (Iterator it = template.getSection(PreAdviceFieldConstants.SECTION_SUMMARY).getFields().iterator(); it.hasNext();) {
FieldCustomizeField field = (FieldCustomizeField) it.next();
content.append(" <td>");
content.append(field.getDispName());
content.append("</td>\n");
}
content.append(" </tr>\n");
content.append(" <tr>\n");
for (Iterator it = template.getSection(PreAdviceFieldConstants.SECTION_SUMMARY).getFields().iterator(); it.hasNext();) {
FieldCustomizeField field = (FieldCustomizeField) it.next();
content.append(" <td class=DISPLAY_FORM align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">");
content.append(hp.getDPNodeStr(field.getDpNodeStructure()));
content.append("</td>\n");
}
content.append(" </tr>\n");
content.append(" </table>\n");
content.append("<!-- afterGroup: end -->\n");
content.append(" ");
return content;
}
public StringBuffer before() throws ServiceException {
StringBuffer content = super.before();
content.append("<!-- beforeGroup.after: begin -->\n");
String adviceNum = hp.getDPNodeStr("advice_num");
PreAdviceService preService = new PreAdviceServiceImpl(getSc());
PreAdvice preAdvice = preService.getPreAdviceByNumber(adviceNum);
if (template.getSection(PreAdviceFieldConstants.SECTION_HEAD) != null) {
for (Iterator it = template.getSection(PreAdviceFieldConstants.SECTION_HEAD).getFields().iterator(); it.hasNext();) {
FieldCustomizeField field = (FieldCustomizeField) it.next();
content.append(" <table border=\"0\" width=\"100%\">\n");
content.append(" <td class=LABEL_FORM width=\"20%\">");
content.append(field.getDispName());
content.append("</td>\n");
if (DocumentFieldConstant.PRE_HEADER_GF_01.equals(field.getCode())) {
content.append(" <td class=DISPLAY_FORM align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
content.append(PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) != null ? PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) : "");
content.append(" </td>\n");
} else if (DocumentFieldConstant.PRE_HEADER_GF_02.equals(field.getCode())) {
content.append(" <td class=DISPLAY_FORM align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
content.append(PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) != null ? PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) : "");
content.append(" </td>\n");
} else if (DocumentFieldConstant.PRE_HEADER_GF_03.equals(field.getCode())) {
content.append(" <td class=DISPLAY_FORM align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
content.append(PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) != null ? PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) : "");
content.append(" </td>\n");
} else if (DocumentFieldConstant.PRE_HEADER_GF_04.equals(field.getCode())) {
content.append(" <td class=DISPLAY_FORM align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
content.append(PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) != null ? PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) : "");
content.append(" </td>\n");
} else if (DocumentFieldConstant.PRE_HEADER_GF_05.equals(field.getCode())) {
content.append(" <td class=DISPLAY_FORM align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
content.append(PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) != null ? PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) : "");
content.append(" </td>\n");
} else if (DocumentFieldConstant.PRE_HEADER_GF_06.equals(field.getCode())) {
content.append(" <td class=DISPLAY_FORM align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
content.append(PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) != null ? PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) : "");
content.append(" </td>\n");
} else if (DocumentFieldConstant.PRE_HEADER_GF_07.equals(field.getCode())) {
content.append(" <td class=DISPLAY_FORM align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
content.append(PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) != null ? PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) : "");
content.append(" </td>\n");
} else if (DocumentFieldConstant.PRE_HEADER_GF_08.equals(field.getCode())) {
content.append(" <td class=DISPLAY_FORM align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
content.append(PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) != null ? PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) : "");
content.append(" </td>\n");
} else if (DocumentFieldConstant.PRE_HEADER_GF_09.equals(field.getCode())) {
content.append(" <td class=DISPLAY_FORM align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
content.append(PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) != null ? PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) : "");
content.append(" </td>\n");
} else if (DocumentFieldConstant.PRE_HEADER_GF_10.equals(field.getCode())) {
content.append(" <td class=DISPLAY_FORM align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
content.append(PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) != null ? PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) : "");
content.append(" </td>\n");
} else if (DocumentFieldConstant.PRE_HEADER_GF_11.equals(field.getCode())) {
content.append(" <td class=DISPLAY_FORM align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
content.append(PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) != null ? PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) : "");
content.append(" </td>\n");
} else if (DocumentFieldConstant.PRE_HEADER_GF_12.equals(field.getCode())) {
content.append(" <td class=DISPLAY_FORM align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
content.append(PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) != null ? PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) : "");
content.append(" </td>\n");
} else if (DocumentFieldConstant.PRE_HEADER_GF_13.equals(field.getCode())) {
content.append(" <td class=DISPLAY_FORM align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
content.append(PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) != null ? PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) : "");
content.append(" </td>\n");
} else if (DocumentFieldConstant.PRE_HEADER_GF_14.equals(field.getCode())) {
content.append(" <td class=DISPLAY_FORM align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
content.append(PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) != null ? PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) : "");
content.append(" </td>\n");
} else if (DocumentFieldConstant.PRE_HEADER_GF_15.equals(field.getCode())) {
content.append(" <td class=DISPLAY_FORM align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
content.append(PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) != null ? PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) : "");
content.append(" </td>\n");
} else if (DocumentFieldConstant.PRE_HEADER_GF_16.equals(field.getCode())) {
content.append(" <td class=DISPLAY_FORM align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
content.append(PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) != null ? PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) : "");
content.append(" </td>\n");
} else if (DocumentFieldConstant.PRE_HEADER_GF_17.equals(field.getCode())) {
content.append(" <td class=DISPLAY_FORM align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
content.append(PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) != null ? PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) : "");
content.append(" </td>\n");
} else if (DocumentFieldConstant.PRE_HEADER_GF_18.equals(field.getCode())) {
content.append(" <td class=DISPLAY_FORM align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
content.append(PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) != null ? PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) : "");
content.append(" </td>\n");
} else if (DocumentFieldConstant.PRE_HEADER_GF_19.equals(field.getCode())) {
content.append(" <td class=DISPLAY_FORM align=\"");
content.append(getAlignByField(field.getCode()));
content.append("\">\n");
content.append(" ");
content.append(PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) != null ? PreAdviceUtil.getPreAdviceGenericField(preAdvice, field.getCode()) : "");
content.append(" </td>\n");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -