Search in sources :

Example 11 with PdcaVO

use of com.netsteadfast.greenstep.vo.PdcaVO in project bamboobsc by billchen198318.

the class PdcaLogicServiceImpl method confirmTask.

@ServiceMethodAuthority(type = { ServiceMethodType.SELECT, ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public void confirmTask(String pdcaOid, String taskId, String confirm, String reason, String newChild) throws ServiceException, Exception {
    if (super.isBlank(pdcaOid) || super.isBlank(taskId) || super.isBlank(confirm)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    PdcaVO pdca = this.findPdca(pdcaOid);
    String newDate = SimpleUtils.getStrYMD("");
    String type = "E";
    List<BusinessProcessManagementTaskVO> tasks = this.queryTaskByVariablePdcaOid(pdca.getOid());
    if (tasks != null && tasks.size() > 0) {
        type = tasks.get(0).getTask().getName().substring(0, 1);
    }
    Map<String, Object> flowDataMap = this.getProcessFlowParam(pdcaOid, type, newDate, super.getAccountId(), confirm, reason, newChild);
    this.completeTask(taskId, flowDataMap);
    /*
		if (YesNo.YES.equals(confirm)) { // 只有 confirm == Y 的, 才要寫入 bb_pdca_audit , 報表顯示時要用到
			this.createAudit(pdca, flowDataMap);
		}
		*/
    // 改為都要產生 bb_pdca_audit
    this.createAudit(pdca, flowDataMap);
    // 重新查是否還有task
    tasks = this.queryTaskByVariablePdcaOid(pdca.getOid());
    if (null != tasks && tasks.size() > 0) {
        return;
    }
    if (YesNo.YES.equals(confirm)) {
        pdca.setConfirmDate(newDate);
        pdca.setConfirmEmpId(this.findEmployeeDataByAccountId(super.getAccountId()).getEmpId());
        pdca.setConfirmFlag(YesNo.YES);
        this.pdcaService.updateObject(pdca);
    }
    if (YesNo.YES.equals(confirm) && YesNo.YES.equals(newChild)) {
        this.cloneNewProject(pdca);
    }
}
Also used : BusinessProcessManagementTaskVO(com.netsteadfast.greenstep.vo.BusinessProcessManagementTaskVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) PdcaVO(com.netsteadfast.greenstep.vo.PdcaVO) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority) Transactional(org.springframework.transaction.annotation.Transactional)

Example 12 with PdcaVO

use of com.netsteadfast.greenstep.vo.PdcaVO in project bamboobsc by billchen198318.

the class PdcaLogicServiceImpl method findProjectRelated.

@ServiceMethodAuthority(type = { ServiceMethodType.SELECT })
@Override
public PdcaProjectRelatedVO findProjectRelated(String pdcaOid) throws ServiceException, Exception {
    if (super.isBlank(pdcaOid)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    PdcaVO pdca = this.findPdca(pdcaOid);
    PdcaProjectRelatedVO projectRelated = new PdcaProjectRelatedVO();
    projectRelated.setProject(pdca);
    this.findProjectRelatedParent(projectRelated, pdca);
    this.findProjectRelatedChild(projectRelated, pdca);
    return projectRelated;
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) PdcaProjectRelatedVO(com.netsteadfast.greenstep.bsc.vo.PdcaProjectRelatedVO) PdcaVO(com.netsteadfast.greenstep.vo.PdcaVO) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)

Example 13 with PdcaVO

use of com.netsteadfast.greenstep.vo.PdcaVO in project bamboobsc by billchen198318.

the class PdcaProjectRelatedVO method getOrgData.

/**
	 * 給 PDCA report orgChart 用的資料
	 * @return
	 */
@SuppressWarnings("unchecked")
public Map<String, Object> getOrgData() {
    Map<String, Object> data = new HashMap<String, Object>();
    Map<String, Object> nowNode = null;
    for (PdcaVO pdca : this.parent) {
        Map<String, Object> node = new HashMap<String, Object>();
        node.put("name", pdca.getTitle());
        node.put("title", pdca.getStartDateDisplayValue() + " - " + pdca.getEndDateDisplayValue());
        node.put("children", new ArrayList<Map<String, Object>>());
        if (data.size() == 0) {
            data.putAll(node);
        } else {
            List<Map<String, Object>> children = (List<Map<String, Object>>) nowNode.get("children");
            children.add(node);
        }
        nowNode = node;
    }
    if (nowNode == null) {
        data.put("name", "<font color='#8A0808'>" + project.getTitle() + "</font>");
        data.put("title", "<font color='#8A0808'>" + project.getStartDateDisplayValue() + " - " + project.getEndDateDisplayValue() + "</font>");
        data.put("children", new ArrayList<Map<String, Object>>());
        nowNode = data;
    } else {
        List<Map<String, Object>> children = (List<Map<String, Object>>) nowNode.get("children");
        Map<String, Object> node = new HashMap<String, Object>();
        node.put("name", "<font color='#8A0808'>" + project.getTitle() + "</font>");
        node.put("title", "<font color='#8A0808'>" + project.getStartDateDisplayValue() + " - " + project.getEndDateDisplayValue() + "</font>");
        node.put("children", new ArrayList<Map<String, Object>>());
        children.add(node);
        nowNode = node;
    }
    for (PdcaVO pdca : this.child) {
        Map<String, Object> node = new HashMap<String, Object>();
        node.put("name", pdca.getTitle());
        node.put("title", pdca.getStartDateDisplayValue() + " - " + pdca.getEndDateDisplayValue());
        node.put("children", new ArrayList<Map<String, Object>>());
        if (nowNode == null) {
            data.putAll(node);
        } else {
            List<Map<String, Object>> children = (List<Map<String, Object>>) nowNode.get("children");
            children.add(node);
        }
        nowNode = node;
    }
    return data;
}
Also used : HashMap(java.util.HashMap) PdcaVO(com.netsteadfast.greenstep.vo.PdcaVO) List(java.util.List) LinkedList(java.util.LinkedList) ArrayList(java.util.ArrayList) Map(java.util.Map) HashMap(java.util.HashMap)

Example 14 with PdcaVO

use of com.netsteadfast.greenstep.vo.PdcaVO in project bamboobsc by billchen198318.

the class PdcaSaveOrUpdateAction method delete.

private void delete() throws ControllerException, AuthorityException, ServiceException, Exception {
    PdcaVO pdca = new PdcaVO();
    this.transformFields2ValueObject(pdca, new String[] { "oid" });
    DefaultResult<Boolean> result = this.pdcaLogicService.delete(pdca);
    this.message = result.getSystemMessage().getValue();
    if (result.getValue() != null && result.getValue()) {
        this.success = IS_YES;
    }
}
Also used : PdcaVO(com.netsteadfast.greenstep.vo.PdcaVO)

Aggregations

PdcaVO (com.netsteadfast.greenstep.vo.PdcaVO)14 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)6 HashMap (java.util.HashMap)4 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)3 PdcaItemVO (com.netsteadfast.greenstep.vo.PdcaItemVO)3 BbPdcaDoc (com.netsteadfast.greenstep.po.hbm.BbPdcaDoc)2 BbPdcaItem (com.netsteadfast.greenstep.po.hbm.BbPdcaItem)2 BbPdcaItemDoc (com.netsteadfast.greenstep.po.hbm.BbPdcaItemDoc)2 BusinessProcessManagementTaskVO (com.netsteadfast.greenstep.vo.BusinessProcessManagementTaskVO)2 EmployeeVO (com.netsteadfast.greenstep.vo.EmployeeVO)2 KpiVO (com.netsteadfast.greenstep.vo.KpiVO)2 OrganizationVO (com.netsteadfast.greenstep.vo.OrganizationVO)2 PdcaDocVO (com.netsteadfast.greenstep.vo.PdcaDocVO)2 PdcaMeasureFreqVO (com.netsteadfast.greenstep.vo.PdcaMeasureFreqVO)2 ArrayList (java.util.ArrayList)2 LinkedList (java.util.LinkedList)2 Transactional (org.springframework.transaction.annotation.Transactional)2 SystemMessage (com.netsteadfast.greenstep.base.model.SystemMessage)1 PdcaProjectRelatedVO (com.netsteadfast.greenstep.bsc.vo.PdcaProjectRelatedVO)1 BbEmployee (com.netsteadfast.greenstep.po.hbm.BbEmployee)1