use of com.netsteadfast.greenstep.vo.PdcaItemDocVO in project bamboobsc by billchen198318.
the class PdcaManagementAction method loadPdcaItemsData.
private void loadPdcaItemsData() throws ServiceException, Exception {
Map<String, Object> paramMap = new HashMap<String, Object>();
paramMap.put("pdcaOid", pdca.getOid());
this.pdcaItems = this.pdcaItemService.findListVOByParams(paramMap);
for (PdcaItemVO item : this.pdcaItems) {
List<String> appendEmplOidsPdcaItemOwner = this.employeeService.findForAppendEmployeeOidsByPdcaItemOwner(item.getPdcaOid(), item.getOid());
List<String> appendEmplNamesPdcaItemOwner = this.employeeService.findForAppendNames(appendEmplOidsPdcaItemOwner);
item.setEmployeeAppendOids(this.joinAppend2String(appendEmplOidsPdcaItemOwner));
item.setEmployeeAppendNames(this.joinAppend2String(appendEmplNamesPdcaItemOwner));
paramMap.put("itemOid", item.getOid());
List<PdcaItemDocVO> itemDocs = this.pdcaItemDocService.findListVOByParams(paramMap);
for (int i = 0; itemDocs != null && i < itemDocs.size(); i++) {
PdcaItemDocVO itemDoc = itemDocs.get(i);
itemDoc.setShowName("unknown-" + itemDoc.getUploadOid());
DefaultResult<SysUploadVO> upResult = this.sysUploadService.findForNoByteContent(itemDoc.getUploadOid());
if (upResult.getValue() != null) {
itemDoc.setShowName(upResult.getValue().getShowName());
}
item.getDocs().add(itemDoc);
}
}
}
use of com.netsteadfast.greenstep.vo.PdcaItemDocVO 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.PdcaItemDocVO 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.PdcaItemDocVO in project bamboobsc by billchen198318.
the class PdcaLogicServiceImpl method createItemDocuments.
private void createItemDocuments(PdcaItemVO pdcaItem) throws ServiceException, Exception {
if (pdcaItem.getUploadOids() == null || pdcaItem.getUploadOids().size() < 1) {
return;
}
for (String oid : pdcaItem.getUploadOids()) {
SysUploadVO upload = this.findUploadDataForNoByteContent(oid);
if (!(upload.getSystem().equals(Constants.getSystem()) && upload.getType().equals(UploadTypes.IS_TEMP))) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.DATA_ERRORS));
}
PdcaItemDocVO itemDoc = new PdcaItemDocVO();
itemDoc.setPdcaOid(pdcaItem.getPdcaOid());
itemDoc.setItemOid(pdcaItem.getOid());
itemDoc.setUploadOid(upload.getOid());
itemDoc.setViewMode(UploadSupportUtils.getViewMode(upload.getShowName()));
DefaultResult<PdcaItemDocVO> result = this.pdcaItemDocService.saveObject(itemDoc);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
UploadSupportUtils.updateType(oid, UploadTypes.IS_PDCA_DOCUMENT);
}
}
Aggregations