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);
}
}
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;
}
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;
}
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;
}
}
Aggregations