制度图导出带出关键控制矩阵
This commit is contained in:
parent
56c39716d5
commit
b0c88e20d3
@ -7,11 +7,13 @@ import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.output.extend.GenerLogExd;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryPropertyCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.cache.DesignerShapeRelationCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.dao.DesignerShapeRelationDao;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.model.DesignerShapeRelationModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.util.CoeDesignerUtil;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryPropertyModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.upfile.constant.CoeFileConstant;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.upfile.dao.UpFileDao;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.upfile.model.UpfileModel;
|
||||
@ -722,11 +724,73 @@ public class OutputWordUtil {
|
||||
//paragraph.appendBreak(BreakType.Page_Break);
|
||||
//Section section2 = doc.addSection();
|
||||
|
||||
//关键控制点风险矩阵 开始
|
||||
PALRepositoryPropertyModel riskMatrixInfo = PALRepositoryPropertyCache.getPropertyByPropertyId(repositoryModel.getId(), "riskMatrixInfo");
|
||||
if(null!=riskMatrixInfo){
|
||||
JSONObject jsonObject = JSONObject.parseObject(riskMatrixInfo.getPropertyValue());
|
||||
JSONArray tableInfo = jsonObject.getJSONArray("table");
|
||||
//添加段落,设置一级序列
|
||||
Paragraph paragraph_risk = section.addParagraph();
|
||||
ParagraphFormat paragraphFormat_risk = paragraph_risk.getFormat();
|
||||
paragraphFormat_risk.setHorizontalAlignment(Left);
|
||||
TextRange tr = paragraph_risk.appendText("关键控制点风险矩阵");
|
||||
tr.getCharacterFormat().setBold(true);
|
||||
tr.getCharacterFormat().setFontName("宋体");
|
||||
tr.getCharacterFormat().setFontSize(12f);
|
||||
paragraph_risk.applyStyle(BuiltinStyle.Body_Text); //应用标题1样式
|
||||
//定义表格数据
|
||||
String[] header = {"关键控制点", "控制描述","对应风险控制","角色/岗位"};
|
||||
//添加表格的表头
|
||||
Table table = section.addTable(true);
|
||||
table.resetCells(tableInfo.size(),header.length);
|
||||
table.getTableFormat().isAutoResized(true);
|
||||
table.autoFit(AutoFitBehaviorType.Auto_Fit_To_Window);
|
||||
TableRow row = table.getRows().get(0);
|
||||
row.isHeader(true);
|
||||
row.setHeight(20);
|
||||
row.setHeightType(TableRowHeightType.Exactly);
|
||||
for (int i = 0; i < header.length; i++) {
|
||||
row.getCells().get(i).getCellFormat().setVerticalAlignment(VerticalAlignment.Middle);
|
||||
Paragraph p = row.getCells().get(i).addParagraph();
|
||||
p.getFormat().setHorizontalAlignment(HorizontalAlignment.Center);
|
||||
TextRange txtRange = p.appendText(header[i]);
|
||||
txtRange.getCharacterFormat().setBold(true);
|
||||
txtRange.getCharacterFormat().setFontName("宋体");
|
||||
txtRange.getCharacterFormat().setFontSize(10.5f);
|
||||
}
|
||||
//添加数据到表中
|
||||
for (int i = 1; i < tableInfo.size(); i++) {
|
||||
JSONObject cellInfo = tableInfo.getJSONObject(i);
|
||||
TableRow dataRow = table.getRows().get(i);
|
||||
dataRow.setHeight(25);
|
||||
dataRow.setHeightType(TableRowHeightType.Exactly);
|
||||
dataRow.getRowFormat().setBackColor(Color.white);
|
||||
int flagNum = 0;
|
||||
for (String cellKey : cellInfo.keySet()) {
|
||||
if(cellKey.equals("id")){
|
||||
continue;
|
||||
}
|
||||
dataRow.getCells().get(flagNum).getCellFormat().setVerticalAlignment(VerticalAlignment.Middle);
|
||||
//设置固定列宽
|
||||
//dataRow.getCells().get(0).setWidth(50);
|
||||
//dataRow.getCells().get(1).setWidth(150);
|
||||
//dataRow.getCells().get(c).addParagraph().appendText(data[r][c]);
|
||||
|
||||
TextRange text =dataRow.getCells().get(flagNum).addParagraph().appendText(cellInfo.getString(cellKey));
|
||||
text.getCharacterFormat().setFontName("宋体");
|
||||
text.getCharacterFormat().setFontSize(10.5f);
|
||||
dataRow.getRowFormat().setHorizontalAlignment(RowAlignment.Center);
|
||||
dataRow.getCells().get(flagNum).getCellFormat();
|
||||
flagNum++;
|
||||
}
|
||||
}
|
||||
Paragraph paragraph_blank = section.addParagraph();
|
||||
}
|
||||
//关键控制点风险矩阵 结束
|
||||
|
||||
//相关文件 R_relevant_flies
|
||||
JSONArray relevant_flies = new JSONArray(); //组织职责Table
|
||||
List<DesignerShapeRelationModel> relationList2 = DesignerShapeRelationCache.getListByAttrId(repositoryModel.getId(), "", "related_files");
|
||||
|
||||
relationList2.sort(Comparator.comparing(DesignerShapeRelationModel::getShapeText));
|
||||
|
||||
|
||||
@ -810,7 +874,6 @@ public class OutputWordUtil {
|
||||
txtRange.getCharacterFormat().setBold(true);
|
||||
txtRange.getCharacterFormat().setFontName("宋体");
|
||||
txtRange.getCharacterFormat().setFontSize(10.5f);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -850,9 +913,6 @@ public class OutputWordUtil {
|
||||
Paragraph paragraph_blank = section.addParagraph();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int extercount = 0;
|
||||
//外部相关文件
|
||||
JSONArray ExternalCorrelationFileArray = new JSONArray(); //外部相关文件Table
|
||||
|
||||
Loading…
Reference in New Issue
Block a user