Search in sources :

Example 1 with BusinessProcessManagementTaskVO

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

the class BusinessProcessManagementBaseLogicService method queryTaskPlus.

/**
	 * 提供直接查出這個Task 與 Task變數, 與是否有權限 assigne 這個Task
	 */
public List<BusinessProcessManagementTaskVO> queryTaskPlus(String variableKeyName, String variableKeyValue) throws ServiceException, Exception {
    List<Task> queryTask = null;
    if (!super.isBlank(variableKeyValue) && !super.isBlank(variableKeyValue)) {
        queryTask = this.queryTaskByVariable(variableKeyName, variableKeyValue);
    } else {
        queryTask = this.queryTask();
    }
    List<BusinessProcessManagementTaskVO> tasks = new LinkedList<BusinessProcessManagementTaskVO>();
    for (int i = 0; queryTask != null && i < queryTask.size(); i++) {
        Task task = queryTask.get(i);
        BusinessProcessManagementTaskVO bpmTaskObj = new BusinessProcessManagementTaskVO(task, (isRoleAllowApproval(task.getName()) ? YesNo.YES : YesNo.NO), BusinessProcessManagementUtils.getTaskVariables(task));
        tasks.add(bpmTaskObj);
    }
    return tasks;
}
Also used : BusinessProcessManagementTaskVO(com.netsteadfast.greenstep.vo.BusinessProcessManagementTaskVO) Task(org.activiti.engine.task.Task) LinkedList(java.util.LinkedList)

Example 2 with BusinessProcessManagementTaskVO

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

the class DegreeFeedbackLogicServiceImpl 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 projectOid, String taskId, String reason, String confirm) throws ServiceException, Exception {
    if (super.isBlank(projectOid) || super.isBlank(taskId) || super.isBlank(confirm)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    DegreeFeedbackProjectVO project = new DegreeFeedbackProjectVO();
    project.setOid(projectOid);
    DefaultResult<DegreeFeedbackProjectVO> result = this.degreeFeedbackProjectService.findObjectByOid(project);
    if (result.getValue() == null) {
        throw new ServiceException(result.getSystemMessage().toString());
    }
    project = result.getValue();
    this.completeTask(taskId, this.getProcessFlowParam(projectOid, confirm, reason));
    List<BusinessProcessManagementTaskVO> tasks = this.queryTaskByVariableProjectOid(projectOid);
    if (null != tasks && tasks.size() > 0) {
        return;
    }
    // 流程跑完了, 更新專案flag , 讓專案發佈
    if (YesNo.YES.equals(confirm)) {
        project.setPublishFlag(YesNo.YES);
        this.degreeFeedbackProjectService.updateObject(project);
    }
}
Also used : BusinessProcessManagementTaskVO(com.netsteadfast.greenstep.vo.BusinessProcessManagementTaskVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) DegreeFeedbackProjectVO(com.netsteadfast.greenstep.vo.DegreeFeedbackProjectVO) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority) Transactional(org.springframework.transaction.annotation.Transactional)

Example 3 with BusinessProcessManagementTaskVO

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

the class DegreeFeedbackLogicServiceImpl method startProcess.

@ServiceMethodAuthority(type = { ServiceMethodType.SELECT, ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<DegreeFeedbackProjectVO> startProcess(DegreeFeedbackProjectVO project) throws ServiceException, Exception {
    if (null == project || super.isBlank(project.getOid())) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    DefaultResult<DegreeFeedbackProjectVO> result = this.degreeFeedbackProjectService.findObjectByOid(project);
    if (result.getValue() == null) {
        throw new ServiceException(result.getSystemMessage().getValue());
    }
    project = result.getValue();
    if (YesNo.YES.equals(project.getPublishFlag())) {
        throw new ServiceException("The project is published, cannot start audit processing!");
    }
    List<BusinessProcessManagementTaskVO> tasks = this.queryTaskByVariableProjectOid(project.getOid());
    if (null != tasks && tasks.size() > 0) {
        throw new ServiceException("Audit processing has been started!");
    }
    this.startProcess(this.getProcessFlowParam(project.getOid(), YesNo.YES, "start apply." + project.getName()));
    result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.UPDATE_SUCCESS)));
    return result;
}
Also used : BusinessProcessManagementTaskVO(com.netsteadfast.greenstep.vo.BusinessProcessManagementTaskVO) SystemMessage(com.netsteadfast.greenstep.base.model.SystemMessage) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) DegreeFeedbackProjectVO(com.netsteadfast.greenstep.vo.DegreeFeedbackProjectVO) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority) Transactional(org.springframework.transaction.annotation.Transactional)

Example 4 with BusinessProcessManagementTaskVO

use of com.netsteadfast.greenstep.vo.BusinessProcessManagementTaskVO 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;
}
Also used : BusinessProcessManagementTaskVO(com.netsteadfast.greenstep.vo.BusinessProcessManagementTaskVO) SystemMessage(com.netsteadfast.greenstep.base.model.SystemMessage) 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 5 with BusinessProcessManagementTaskVO

use of com.netsteadfast.greenstep.vo.BusinessProcessManagementTaskVO 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)

Aggregations

BusinessProcessManagementTaskVO (com.netsteadfast.greenstep.vo.BusinessProcessManagementTaskVO)5 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)4 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)4 Transactional (org.springframework.transaction.annotation.Transactional)4 SystemMessage (com.netsteadfast.greenstep.base.model.SystemMessage)2 DegreeFeedbackProjectVO (com.netsteadfast.greenstep.vo.DegreeFeedbackProjectVO)2 PdcaVO (com.netsteadfast.greenstep.vo.PdcaVO)2 LinkedList (java.util.LinkedList)1 Task (org.activiti.engine.task.Task)1