use of com.netsteadfast.greenstep.vo.PdcaVO in project bamboobsc by billchen198318.
the class LoadPdcaDataCommand method loadDetail.
private void loadDetail(PdcaVO pdca) throws ServiceException, Exception {
Map<String, Object> paramMap = new HashMap<String, Object>();
paramMap.put("pdcaOid", pdca.getOid());
// 1. Project owner
List<String> ownerNames = this.employeeService.findForAppendNames(this.employeeService.findForAppendEmployeeOidsByPdcaOwner(pdca.getOid()));
pdca.setResponsibilityAppendNames(StringUtils.join(ownerNames.toArray(), Constants.ID_DELIMITER) + Constants.ID_DELIMITER);
// 2. Confirm employee
if (!StringUtils.isBlank(pdca.getConfirmEmpId())) {
pdca.setConfirmEmployeeName(this.getEmployeeNameNoThrow(pdca.getConfirmEmpId()));
}
// 3. Project organization/department
List<String> orgaNames = this.organizationService.findForAppendNames(this.organizationService.findForAppendOrganizationOidsByPdcaOrga(pdca.getOid()));
pdca.setOrganizationAppendNames(StringUtils.join(orgaNames.toArray(), Constants.ID_DELIMITER) + Constants.ID_DELIMITER);
// 4. Project KPIs
List<String> kpiNames = this.kpiService.findForAppendNames(this.kpiService.findForAppendOidsByPdcaKpis(pdca.getOid()));
pdca.setKpisAppendNames(StringUtils.join(kpiNames.toArray(), Constants.ID_DELIMITER) + Constants.ID_DELIMITER);
// 5. parent project
if (!StringUtils.isBlank(pdca.getParentOid())) {
PdcaVO parentPdca = new PdcaVO();
parentPdca.setOid(pdca.getParentOid());
DefaultResult<PdcaVO> pResult = this.pdcaService.findObjectByOid(parentPdca);
if (pResult.getValue() == null) {
throw new ServiceException(pResult.getSystemMessage().getValue());
}
pdca.setParentName(pResult.getValue().getTitle());
}
// 6. Documents file
List<PdcaDocVO> pdcaDocs = this.pdcaDocService.findListVOByParams(paramMap);
if (pdcaDocs != null && pdcaDocs.size() > 0) {
pdca.getDocs().addAll(pdcaDocs);
}
for (int i = 0; pdca.getDocs() != null && i < pdca.getDocs().size(); i++) {
PdcaDocVO doc = pdca.getDocs().get(i);
doc.setShowName(UploadSupportUtils.findUploadNoByteContent(doc.getUploadOid()).getShowName());
}
}
use of com.netsteadfast.greenstep.vo.PdcaVO in project bamboobsc by billchen198318.
the class LoadPdcaDataCommand method execute.
@SuppressWarnings("unchecked")
@Override
public boolean execute(Context context) throws Exception {
pdcaService = (IPdcaService<PdcaVO, BbPdca, String>) AppContext.getBean("bsc.service.PdcaService");
pdcaDocService = (IPdcaDocService<PdcaDocVO, BbPdcaDoc, String>) AppContext.getBean("bsc.service.PdcaDocService");
pdcaItemService = (IPdcaItemService<PdcaItemVO, BbPdcaItem, String>) AppContext.getBean("bsc.service.PdcaItemService");
pdcaItemDocService = (IPdcaItemDocService<PdcaItemDocVO, BbPdcaItemDoc, String>) AppContext.getBean("bsc.service.PdcaItemDocService");
pdcaAuditService = (IPdcaAuditService<PdcaAuditVO, BbPdcaAudit, String>) AppContext.getBean("bsc.service.PdcaAuditService");
employeeService = (IEmployeeService<EmployeeVO, BbEmployee, String>) AppContext.getBean("bsc.service.EmployeeService");
organizationService = (IOrganizationService<OrganizationVO, BbOrganization, String>) AppContext.getBean("bsc.service.OrganizationService");
kpiService = (IKpiService<KpiVO, BbKpi, String>) AppContext.getBean("bsc.service.KpiService");
String pdcaOid = (String) context.get("pdcaOid");
PdcaVO pdca = new PdcaVO();
pdca.setOid(pdcaOid);
DefaultResult<PdcaVO> result = pdcaService.findObjectByOid(pdca);
if (result.getValue() == null) {
this.setMessage(context, result.getSystemMessage().getValue());
} else {
pdca = result.getValue();
this.loadDetail(pdca);
this.loadPdcaItems(pdca);
this.loadAudit(pdca);
this.setResult(context, pdca);
// Action 輸出可能會要用到
context.put("pdca", pdca);
}
return false;
}
use of com.netsteadfast.greenstep.vo.PdcaVO in project bamboobsc by billchen198318.
the class PdcaReportBodyCommand method execute.
@Override
public boolean execute(Context context) throws Exception {
if (this.getResult(context) == null || !(this.getResult(context) instanceof PdcaVO)) {
return false;
}
PdcaVO pdca = (PdcaVO) this.getResult(context);
Map<String, Object> parameter = new HashMap<String, Object>();
parameter.put("pdca", pdca);
String content = TemplateUtils.processTemplate("resourceTemplate", PdcaReportBodyCommand.class.getClassLoader(), templateResource, parameter);
this.setResult(context, content);
return false;
}
use of com.netsteadfast.greenstep.vo.PdcaVO in project bamboobsc by billchen198318.
the class PdcaReportExcelCommand method createPdca.
private int createPdca(XSSFWorkbook wb, XSSFSheet sh, int row, Context context) throws Exception {
PdcaVO pdca = (PdcaVO) this.getResult(context);
Row headRow = sh.createRow(row);
headRow.setHeight((short) 700);
// --------------------------------------------------------------------------------------
XSSFColor bgColor = new XSSFColor(SimpleUtils.getColorRGB4POIColor("#d8d8d8"));
XSSFColor fnColor = new XSSFColor(SimpleUtils.getColorRGB4POIColor("#000000"));
XSSFCellStyle cellHeadStyle = wb.createCellStyle();
cellHeadStyle.setFillForegroundColor(bgColor);
cellHeadStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
XSSFFont cellHeadFont = wb.createFont();
cellHeadFont.setBold(true);
cellHeadFont.setColor(fnColor);
cellHeadStyle.setFont(cellHeadFont);
cellHeadStyle.setBorderBottom(BorderStyle.THIN);
cellHeadStyle.setBorderTop(BorderStyle.THIN);
cellHeadStyle.setBorderRight(BorderStyle.THIN);
cellHeadStyle.setBorderLeft(BorderStyle.THIN);
cellHeadStyle.setVerticalAlignment(VerticalAlignment.CENTER);
cellHeadStyle.setAlignment(HorizontalAlignment.CENTER);
cellHeadStyle.setWrapText(true);
// --------------------------------------------------------------------------------------
int cols = 6;
for (int i = 0; i < cols; i++) {
sh.setColumnWidth(i, 6000);
Cell headCell1 = headRow.createCell(i);
headCell1.setCellValue(pdca.getTitle());
headCell1.setCellStyle(cellHeadStyle);
}
sh.addMergedRegion(new CellRangeAddress(row, row, 0, cols - 1));
// --------------------------------------------------------------------------------------
XSSFColor bgLabelColor = new XSSFColor(SimpleUtils.getColorRGB4POIColor("#F2F2F2"));
XSSFCellStyle cellLabelStyle = wb.createCellStyle();
cellLabelStyle.setFillForegroundColor(bgLabelColor);
cellLabelStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
XSSFFont cellLabelFont = wb.createFont();
cellLabelFont.setBold(true);
cellLabelFont.setColor(fnColor);
cellLabelStyle.setFont(cellLabelFont);
cellLabelStyle.setBorderBottom(BorderStyle.THIN);
cellLabelStyle.setBorderTop(BorderStyle.THIN);
cellLabelStyle.setBorderRight(BorderStyle.THIN);
cellLabelStyle.setBorderLeft(BorderStyle.THIN);
cellLabelStyle.setVerticalAlignment(VerticalAlignment.CENTER);
cellLabelStyle.setAlignment(HorizontalAlignment.LEFT);
cellLabelStyle.setWrapText(true);
// --------------------------------------------------------------------------------------
XSSFColor bgNormalColor = new XSSFColor(SimpleUtils.getColorRGB4POIColor("#ffffff"));
XSSFCellStyle cellNormalStyle = wb.createCellStyle();
cellNormalStyle.setFillForegroundColor(bgNormalColor);
cellNormalStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
XSSFFont cellNormalFont = wb.createFont();
cellNormalFont.setBold(false);
cellNormalFont.setColor(fnColor);
cellNormalStyle.setFont(cellNormalFont);
cellNormalStyle.setBorderBottom(BorderStyle.THIN);
cellNormalStyle.setBorderTop(BorderStyle.THIN);
cellNormalStyle.setBorderRight(BorderStyle.THIN);
cellNormalStyle.setBorderLeft(BorderStyle.THIN);
cellNormalStyle.setVerticalAlignment(VerticalAlignment.CENTER);
cellNormalStyle.setAlignment(HorizontalAlignment.LEFT);
cellNormalStyle.setWrapText(true);
// --------------------------------------------------------------------------------------
row++;
Row labelRow = sh.createRow(row);
Cell labelCell_0_1 = labelRow.createCell(0);
labelCell_0_1.setCellValue("Responsibility");
labelCell_0_1.setCellStyle(cellLabelStyle);
Cell labelCell_0_2 = labelRow.createCell(1);
labelCell_0_2.setCellValue(pdca.getResponsibilityAppendNames());
labelCell_0_2.setCellStyle(cellNormalStyle);
Cell labelCell_0_3 = labelRow.createCell(2);
labelCell_0_3.setCellValue(pdca.getResponsibilityAppendNames());
labelCell_0_3.setCellStyle(cellNormalStyle);
sh.addMergedRegion(new CellRangeAddress(row, row, 1, 2));
Cell labelCell_0_4 = labelRow.createCell(3);
labelCell_0_4.setCellValue("Date range");
labelCell_0_4.setCellStyle(cellLabelStyle);
Cell labelCell_0_5 = labelRow.createCell(4);
labelCell_0_5.setCellValue(pdca.getStartDateDisplayValue() + " ~ " + pdca.getEndDateDisplayValue());
labelCell_0_5.setCellStyle(cellNormalStyle);
Cell labelCell_0_6 = labelRow.createCell(5);
labelCell_0_6.setCellValue(pdca.getStartDateDisplayValue() + " ~ " + pdca.getEndDateDisplayValue());
labelCell_0_6.setCellStyle(cellNormalStyle);
sh.addMergedRegion(new CellRangeAddress(row, row, 4, 5));
// --------------------------------------------------------------------------------------
row++;
labelRow = sh.createRow(row);
Cell labelCell_1_1 = labelRow.createCell(0);
labelCell_1_1.setCellValue("Confirm");
labelCell_1_1.setCellStyle(cellLabelStyle);
Cell labelCell_1_2 = labelRow.createCell(1);
labelCell_1_2.setCellValue(pdca.getConfirmEmployeeName());
labelCell_1_2.setCellStyle(cellNormalStyle);
Cell labelCell_1_3 = labelRow.createCell(2);
labelCell_1_3.setCellValue(pdca.getConfirmEmployeeName());
labelCell_1_3.setCellStyle(cellNormalStyle);
sh.addMergedRegion(new CellRangeAddress(row, row, 1, 2));
Cell labelCell_1_4 = labelRow.createCell(3);
labelCell_1_4.setCellValue("Confirm date");
labelCell_1_4.setCellStyle(cellLabelStyle);
Cell labelCell_1_5 = labelRow.createCell(4);
labelCell_1_5.setCellValue(pdca.getConfirmDateDisplayValue());
labelCell_1_5.setCellStyle(cellNormalStyle);
Cell labelCell_1_6 = labelRow.createCell(5);
labelCell_1_6.setCellValue(pdca.getConfirmDateDisplayValue());
labelCell_1_6.setCellStyle(cellNormalStyle);
sh.addMergedRegion(new CellRangeAddress(row, row, 4, 5));
// --------------------------------------------------------------------------------------
row++;
labelRow = sh.createRow(row);
Cell labelCell_2_1 = labelRow.createCell(0);
labelCell_2_1.setCellValue("Organization\nDepartment");
labelCell_2_1.setCellStyle(cellLabelStyle);
Cell labelCell_2_2 = labelRow.createCell(1);
labelCell_2_2.setCellValue(pdca.getOrganizationAppendNames());
labelCell_2_2.setCellStyle(cellNormalStyle);
Cell labelCell_2_3 = labelRow.createCell(2);
labelCell_2_3.setCellValue(pdca.getOrganizationAppendNames());
labelCell_2_3.setCellStyle(cellNormalStyle);
Cell labelCell_2_4 = labelRow.createCell(3);
labelCell_2_4.setCellValue(pdca.getOrganizationAppendNames());
labelCell_2_4.setCellStyle(cellNormalStyle);
Cell labelCell_2_5 = labelRow.createCell(4);
labelCell_2_5.setCellValue(pdca.getOrganizationAppendNames());
labelCell_2_5.setCellStyle(cellNormalStyle);
Cell labelCell_2_6 = labelRow.createCell(5);
labelCell_2_6.setCellValue(pdca.getOrganizationAppendNames());
labelCell_2_6.setCellStyle(cellNormalStyle);
sh.addMergedRegion(new CellRangeAddress(row, row, 1, 5));
// --------------------------------------------------------------------------------------
row++;
labelRow = sh.createRow(row);
Cell labelCell_3_1 = labelRow.createCell(0);
labelCell_3_1.setCellValue("KPIs");
labelCell_3_1.setCellStyle(cellLabelStyle);
Cell labelCell_3_2 = labelRow.createCell(1);
labelCell_3_2.setCellValue(pdca.getKpisAppendNames());
labelCell_3_2.setCellStyle(cellNormalStyle);
Cell labelCell_3_3 = labelRow.createCell(2);
labelCell_3_3.setCellValue(pdca.getKpisAppendNames());
labelCell_3_3.setCellStyle(cellNormalStyle);
Cell labelCell_3_4 = labelRow.createCell(3);
labelCell_3_4.setCellValue(pdca.getKpisAppendNames());
labelCell_3_4.setCellStyle(cellNormalStyle);
Cell labelCell_3_5 = labelRow.createCell(4);
labelCell_3_5.setCellValue(pdca.getKpisAppendNames());
labelCell_3_5.setCellStyle(cellNormalStyle);
Cell labelCell_3_6 = labelRow.createCell(5);
labelCell_3_6.setCellValue(pdca.getKpisAppendNames());
labelCell_3_6.setCellStyle(cellNormalStyle);
sh.addMergedRegion(new CellRangeAddress(row, row, 1, 5));
// --------------------------------------------------------------------------------------
row++;
labelRow = sh.createRow(row);
Cell labelCell_4_1 = labelRow.createCell(0);
labelCell_4_1.setCellValue("Parent PDCA");
labelCell_4_1.setCellStyle(cellLabelStyle);
Cell labelCell_4_2 = labelRow.createCell(1);
labelCell_4_2.setCellValue(pdca.getParentName());
labelCell_4_2.setCellStyle(cellNormalStyle);
Cell labelCell_4_3 = labelRow.createCell(2);
labelCell_4_3.setCellValue(pdca.getParentName());
labelCell_4_3.setCellStyle(cellNormalStyle);
Cell labelCell_4_4 = labelRow.createCell(3);
labelCell_4_4.setCellValue(pdca.getParentName());
labelCell_4_4.setCellStyle(cellNormalStyle);
Cell labelCell_4_5 = labelRow.createCell(4);
labelCell_4_5.setCellValue(pdca.getParentName());
labelCell_4_5.setCellStyle(cellNormalStyle);
Cell labelCell_4_6 = labelRow.createCell(5);
labelCell_4_6.setCellValue(pdca.getParentName());
labelCell_4_6.setCellStyle(cellNormalStyle);
sh.addMergedRegion(new CellRangeAddress(row, row, 1, 5));
// --------------------------------------------------------------------------------------
row++;
labelRow = sh.createRow(row);
Cell labelCell_6_1 = labelRow.createCell(0);
labelCell_6_1.setCellValue("TYPE");
labelCell_6_1.setCellStyle(cellLabelStyle);
Cell labelCell_6_2 = labelRow.createCell(1);
labelCell_6_2.setCellValue("Title");
labelCell_6_2.setCellStyle(cellLabelStyle);
Cell labelCell_6_3 = labelRow.createCell(2);
labelCell_6_3.setCellValue("Responsibility");
labelCell_6_3.setCellStyle(cellLabelStyle);
Cell labelCell_6_4 = labelRow.createCell(3);
labelCell_6_4.setCellValue("Date range");
labelCell_6_4.setCellStyle(cellLabelStyle);
Cell labelCell_6_5 = labelRow.createCell(4);
labelCell_6_5.setCellValue("Audit");
labelCell_6_5.setCellStyle(cellLabelStyle);
Cell labelCell_6_6 = labelRow.createCell(5);
labelCell_6_6.setCellValue("Audit date");
labelCell_6_6.setCellStyle(cellLabelStyle);
// --------------------------------------------------------------------------------------
row++;
int nRow = row;
row = this.createPdcaItem(wb, sh, row, cellNormalStyle, pdca.getItemPlan(), pdca.getAuditPlan());
row = this.createPdcaItem(wb, sh, row, cellNormalStyle, pdca.getItemDo(), pdca.getAuditDo());
row = this.createPdcaItem(wb, sh, row, cellNormalStyle, pdca.getItemCheck(), pdca.getAuditCheck());
row = this.createPdcaItem(wb, sh, row, cellNormalStyle, pdca.getItemAction(), pdca.getAuditAction());
nRow = this.mergedRegionForItemsRow(wb, sh, nRow, pdca.getItemPlan());
nRow = this.mergedRegionForItemsRow(wb, sh, nRow, pdca.getItemDo());
nRow = this.mergedRegionForItemsRow(wb, sh, nRow, pdca.getItemCheck());
nRow = this.mergedRegionForItemsRow(wb, sh, nRow, pdca.getItemAction());
return row;
}
use of com.netsteadfast.greenstep.vo.PdcaVO in project bamboobsc by billchen198318.
the class PdcaLogicServiceImpl method startProcess.
@ServiceMethodAuthority(type = { ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<PdcaVO> startProcess(PdcaVO pdca) throws ServiceException, Exception {
if (null == pdca || super.isBlank(pdca.getOid())) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
DefaultResult<PdcaVO> result = this.pdcaService.findObjectByOid(pdca);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
pdca = result.getValue();
if (YesNo.YES.equals(pdca.getConfirmFlag())) {
throw new ServiceException("The project is confirm, cannot start audit processing!");
}
List<BusinessProcessManagementTaskVO> tasks = this.queryTaskByVariablePdcaOid(pdca.getOid());
if (tasks != null && tasks.size() > 0) {
throw new ServiceException("Audit processing has been started!");
}
String reason = "Start PDCA audit processing, " + pdca.getTitle() + "";
this.startProcess(this.getProcessFlowParam(pdca.getOid(), "*", SimpleUtils.getStrYMD(""), super.getAccountId(), YesNo.YES, reason, YesNo.NO));
result.setSystemMessage(new SystemMessage(reason));
return result;
}
Aggregations