use of com.netsteadfast.greenstep.vo.PdcaItemVO in project bamboobsc by billchen198318.
the class PdcaSaveOrUpdateAction method checkPdcaItemsType.
private boolean checkPdcaItemsType(List<PdcaItemVO> items) throws Exception {
boolean pType = false;
boolean dType = false;
boolean cType = false;
boolean aType = false;
for (PdcaItemVO item : items) {
if (PdcaType.PLAN.equals(item.getType())) {
pType = true;
}
if (PdcaType.DO.equals(item.getType())) {
dType = true;
}
if (PdcaType.CHECK.equals(item.getType())) {
cType = true;
}
if (PdcaType.ACTION.equals(item.getType())) {
aType = true;
}
}
return (pType && dType && cType && aType);
}
use of com.netsteadfast.greenstep.vo.PdcaItemVO in project bamboobsc by billchen198318.
the class PdcaSaveOrUpdateAction method saveOrUpdate.
private void saveOrUpdate(String type) throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
List<PdcaItemVO> pdcaItems = this.getItemsData();
this.checkItems(pdcaItems);
PdcaVO pdca = new PdcaVO();
this.transformFields2ValueObject(pdca, new String[] { "title", "startDate", "endDate", "description" });
this.getFields().remove("measureFreq_date1");
this.getFields().remove("measureFreq_date2");
this.getFields().remove("measureFreq_dateType");
String frequency = this.getFields().get("measureFreq_frequency");
if (BscMeasureDataFrequency.FREQUENCY_DAY.equals(frequency) || BscMeasureDataFrequency.FREQUENCY_WEEK.equals(frequency) || BscMeasureDataFrequency.FREQUENCY_MONTH.equals(frequency)) {
this.getFields().put("measureFreq_date1", this.getFields().get("measureFreq_startDate"));
this.getFields().put("measureFreq_date2", this.getFields().get("measureFreq_endDate"));
} else {
this.getFields().put("measureFreq_date1", this.getFields().get("measureFreq_startYearDate"));
this.getFields().put("measureFreq_date2", this.getFields().get("measureFreq_endYearDate"));
}
String dataFor = this.getFields().get("measureFreq_dataFor");
this.getFields().put("measureFreq_dateType", "3");
if ("organization".equals(dataFor)) {
this.getFields().put("measureFreq_dateType", "1");
}
if ("employee".equals(dataFor)) {
this.getFields().put("measureFreq_dateType", "2");
}
PdcaMeasureFreqVO measureFreq = new PdcaMeasureFreqVO();
this.transformFields2ValueObject(measureFreq, new String[] { "freq", "dataType", "organizationOid", "employeeOid", "startDate", "endDate" }, new String[] { "measureFreq_frequency", "measureFreq_dateType", "measureFreq_measureDataOrganizationOid", "measureFreq_measureDataEmployeeOid", "measureFreq_date1", "measureFreq_date2" });
DefaultResult<PdcaVO> result = null;
if ("save".equals(type)) {
result = this.pdcaLogicService.create(pdca, measureFreq, this.transformAppendIds2List(this.getFields().get("orgaOids")), this.transformAppendIds2List(this.getFields().get("emplOids")), this.transformAppendIds2List(this.getFields().get("kpiOids")), this.getUploadOids(), pdcaItems);
} else {
pdca.setOid(this.getFields().get("oid"));
result = this.pdcaLogicService.update(pdca, measureFreq, this.transformAppendIds2List(this.getFields().get("orgaOids")), this.transformAppendIds2List(this.getFields().get("emplOids")), this.transformAppendIds2List(this.getFields().get("kpiOids")), this.getUploadOids(), pdcaItems);
}
this.message = result.getSystemMessage().getValue();
if (result.getValue() != null) {
this.success = IS_YES;
}
}
use of com.netsteadfast.greenstep.vo.PdcaItemVO in project bamboobsc by billchen198318.
the class PdcaReportExcelCommand method createPdcaItem.
private int createPdcaItem(XSSFWorkbook wb, XSSFSheet sh, int row, XSSFCellStyle cellNormalStyle, List<PdcaItemVO> items, PdcaAuditVO audit) throws Exception {
XSSFColor fnColor = new XSSFColor(SimpleUtils.getColorRGB4POIColor("#000000"));
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.CENTER);
cellLabelStyle.setWrapText(true);
Map<String, String> pdcaTypeMap = PdcaType.getDataMap(false);
for (PdcaItemVO item : items) {
Row labelRow = sh.createRow(row);
Cell labelCell_6_1 = labelRow.createCell(0);
labelCell_6_1.setCellValue(pdcaTypeMap.get(item.getType()));
labelCell_6_1.setCellStyle(cellLabelStyle);
Cell labelCell_6_2 = labelRow.createCell(1);
labelCell_6_2.setCellValue(item.getTitle() + (!StringUtils.isBlank(item.getDescription()) ? "\n\n" + item.getDescription() : ""));
labelCell_6_2.setCellStyle(cellNormalStyle);
Cell labelCell_6_3 = labelRow.createCell(2);
labelCell_6_3.setCellValue(item.getEmployeeAppendNames());
labelCell_6_3.setCellStyle(cellNormalStyle);
Cell labelCell_6_4 = labelRow.createCell(3);
labelCell_6_4.setCellValue(item.getStartDateDisplayValue() + " ~ " + item.getEndDateDisplayValue());
labelCell_6_4.setCellStyle(cellNormalStyle);
Cell labelCell_6_5 = labelRow.createCell(4);
labelCell_6_5.setCellValue((audit != null ? audit.getEmpId() : " "));
labelCell_6_5.setCellStyle(cellNormalStyle);
Cell labelCell_6_6 = labelRow.createCell(5);
labelCell_6_6.setCellValue((audit != null ? audit.getConfirmDateDisplayValue() : " "));
labelCell_6_6.setCellStyle(cellNormalStyle);
row++;
}
return row;
}
use of com.netsteadfast.greenstep.vo.PdcaItemVO in project bamboobsc by billchen198318.
the class LoadPdcaDataCommand method loadPdcaItems.
// 7. item detail
private void loadPdcaItems(PdcaVO pdca) throws ServiceException, Exception {
pdca.setItemPlan(new ArrayList<PdcaItemVO>());
pdca.setItemDo(new ArrayList<PdcaItemVO>());
pdca.setItemCheck(new ArrayList<PdcaItemVO>());
pdca.setItemAction(new ArrayList<PdcaItemVO>());
Map<String, Object> paramMap = new HashMap<String, Object>();
paramMap.put("pdcaOid", pdca.getOid());
List<BbPdcaItem> pdcaItems = this.pdcaItemService.findListByParams(paramMap);
for (BbPdcaItem pdcaItem : pdcaItems) {
PdcaItemVO item = new PdcaItemVO();
this.pdcaItemService.doMapper(pdcaItem, item, IPdcaItemService.MAPPER_ID_PO2VO);
// item owner
List<String> ownerNames = this.employeeService.findForAppendNames(this.employeeService.findForAppendEmployeeOidsByPdcaItemOwner(item.getPdcaOid(), item.getOid()));
item.setEmployeeAppendNames(StringUtils.join(ownerNames.toArray(), Constants.ID_DELIMITER) + Constants.ID_DELIMITER);
// item documents file
paramMap.put("itemOid", item.getOid());
List<PdcaItemDocVO> itemDocs = this.pdcaItemDocService.findListVOByParams(paramMap);
if (itemDocs != null && itemDocs.size() > 0) {
item.getDocs().addAll(itemDocs);
}
for (int i = 0; item.getDocs() != null && i < item.getDocs().size(); i++) {
PdcaItemDocVO doc = item.getDocs().get(i);
doc.setShowName(UploadSupportUtils.findUploadNoByteContent(doc.getUploadOid()).getShowName());
}
if (PdcaType.PLAN.equals(item.getType())) {
pdca.getItemPlan().add(item);
} else if (PdcaType.DO.equals(item.getType())) {
pdca.getItemDo().add(item);
} else if (PdcaType.CHECK.equals(item.getType())) {
pdca.getItemCheck().add(item);
} else {
pdca.getItemAction().add(item);
}
}
}
use of com.netsteadfast.greenstep.vo.PdcaItemVO 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;
}
Aggregations