Search in sources :

Example 1 with PdcaItemDocVO

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);
        }
    }
}
Also used : PdcaItemDocVO(com.netsteadfast.greenstep.vo.PdcaItemDocVO) HashMap(java.util.HashMap) SysUploadVO(com.netsteadfast.greenstep.vo.SysUploadVO) PdcaItemVO(com.netsteadfast.greenstep.vo.PdcaItemVO)

Example 2 with PdcaItemDocVO

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);
        }
    }
}
Also used : PdcaItemDocVO(com.netsteadfast.greenstep.vo.PdcaItemDocVO) HashMap(java.util.HashMap) PdcaItemVO(com.netsteadfast.greenstep.vo.PdcaItemVO) BbPdcaItem(com.netsteadfast.greenstep.po.hbm.BbPdcaItem)

Example 3 with PdcaItemDocVO

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;
}
Also used : PdcaItemDocVO(com.netsteadfast.greenstep.vo.PdcaItemDocVO) PdcaDocVO(com.netsteadfast.greenstep.vo.PdcaDocVO) BbPdcaItemDoc(com.netsteadfast.greenstep.po.hbm.BbPdcaItemDoc) KpiVO(com.netsteadfast.greenstep.vo.KpiVO) BbPdcaDoc(com.netsteadfast.greenstep.po.hbm.BbPdcaDoc) OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO) BbKpi(com.netsteadfast.greenstep.po.hbm.BbKpi) BbPdcaAudit(com.netsteadfast.greenstep.po.hbm.BbPdcaAudit) BbEmployee(com.netsteadfast.greenstep.po.hbm.BbEmployee) EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO) BbOrganization(com.netsteadfast.greenstep.po.hbm.BbOrganization) PdcaVO(com.netsteadfast.greenstep.vo.PdcaVO) BbPdca(com.netsteadfast.greenstep.po.hbm.BbPdca) PdcaItemVO(com.netsteadfast.greenstep.vo.PdcaItemVO) BbPdcaItem(com.netsteadfast.greenstep.po.hbm.BbPdcaItem) PdcaAuditVO(com.netsteadfast.greenstep.vo.PdcaAuditVO)

Example 4 with PdcaItemDocVO

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);
    }
}
Also used : PdcaItemDocVO(com.netsteadfast.greenstep.vo.PdcaItemDocVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysUploadVO(com.netsteadfast.greenstep.vo.SysUploadVO)

Aggregations

PdcaItemDocVO (com.netsteadfast.greenstep.vo.PdcaItemDocVO)4 PdcaItemVO (com.netsteadfast.greenstep.vo.PdcaItemVO)3 BbPdcaItem (com.netsteadfast.greenstep.po.hbm.BbPdcaItem)2 SysUploadVO (com.netsteadfast.greenstep.vo.SysUploadVO)2 HashMap (java.util.HashMap)2 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)1 BbEmployee (com.netsteadfast.greenstep.po.hbm.BbEmployee)1 BbKpi (com.netsteadfast.greenstep.po.hbm.BbKpi)1 BbOrganization (com.netsteadfast.greenstep.po.hbm.BbOrganization)1 BbPdca (com.netsteadfast.greenstep.po.hbm.BbPdca)1 BbPdcaAudit (com.netsteadfast.greenstep.po.hbm.BbPdcaAudit)1 BbPdcaDoc (com.netsteadfast.greenstep.po.hbm.BbPdcaDoc)1 BbPdcaItemDoc (com.netsteadfast.greenstep.po.hbm.BbPdcaItemDoc)1 EmployeeVO (com.netsteadfast.greenstep.vo.EmployeeVO)1 KpiVO (com.netsteadfast.greenstep.vo.KpiVO)1 OrganizationVO (com.netsteadfast.greenstep.vo.OrganizationVO)1 PdcaAuditVO (com.netsteadfast.greenstep.vo.PdcaAuditVO)1 PdcaDocVO (com.netsteadfast.greenstep.vo.PdcaDocVO)1 PdcaVO (com.netsteadfast.greenstep.vo.PdcaVO)1