use of com.netsteadfast.greenstep.vo.OrganizationVO in project bamboobsc by billchen198318.
the class SwotDataProvideCommand method execute.
@Override
public boolean execute(Context context) throws Exception {
String visionOid = (String) context.get("visionOid");
String organizationOid = (String) context.get("organizationOid");
VisionVO vision = this.findVision(visionOid);
OrganizationVO organization = this.findOrganization(organizationOid);
if (StringUtils.isBlank(vision.getVisId()) || StringUtils.isBlank(organization.getOrgId())) {
this.setMessage(context, SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA));
return false;
}
Map<String, Object> params = new HashMap<String, Object>();
Map<String, String> orderParams = new HashMap<String, String>();
params.put("visId", vision.getVisId());
orderParams.put("perId", "asc");
List<BbPerspective> perspectives = this.perspectiveService.findListByParams(params, null, orderParams);
if (perspectives == null || perspectives.size() < 1) {
this.setMessage(context, SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA));
return false;
}
params.put("orgId", organization.getOrgId());
List<BbSwot> swots = this.swotService.findListByParams(params, null, orderParams);
SwotDataVO swotData = new SwotDataVO();
swotData.setVision(vision);
swotData.setOrganization(organization);
swotData.setContents(swots);
swotData.setPerspectives(perspectives);
this.initIssues(swotData, vision.getVisId(), organization.getOrgId());
this.setResult(context, swotData);
return false;
}
use of com.netsteadfast.greenstep.vo.OrganizationVO in project bamboobsc by billchen198318.
the class CommonOrgChartAction method createOrgChartDataForOrganization.
@SuppressWarnings("unused")
private void createOrgChartDataForOrganization() throws ControllerException, AuthorityException, ServiceException, Exception {
OrganizationVO organization = new OrganizationVO();
organization = this.transformFields2ValueObject(organization, "oid");
DefaultResult<String> result = this.organizationLogicService.createOrgChartData(ApplicationSiteUtils.getBasePath(Constants.getMainSystem(), this.getHttpServletRequest()), organization);
this.uploadOid = super.defaultString(result.getValue());
this.message = result.getSystemMessage().getValue();
if (!StringUtils.isBlank(this.uploadOid)) {
this.loadOrgChartData(this.uploadOid);
this.success = IS_YES;
}
}
use of com.netsteadfast.greenstep.vo.OrganizationVO in project bamboobsc by billchen198318.
the class DepartmentReportContentQueryAction method getChainContext.
@SuppressWarnings("unchecked")
private Context getChainContext() throws Exception {
Context context = new ContextBase();
context.put("visionOid", this.getFields().get("visionOid"));
context.put("frequency", this.getFields().get("frequency"));
context.put("startYearDate", this.getFields().get("year"));
context.put("endYearDate", this.getFields().get("year"));
context.put("dateType", this.getFields().get("dateType"));
context.put("dataFor", BscConstants.MEASURE_DATA_FOR_ORGANIZATION);
OrganizationVO organization = new OrganizationVO();
organization.setOid(this.getFields().get("organizationOid"));
DefaultResult<OrganizationVO> result = this.organizationService.findObjectByOid(organization);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
organization = result.getValue();
context.put("empId", BscConstants.MEASURE_DATA_EMPLOYEE_FULL);
context.put("orgId", organization.getOrgId());
context.put("uploadSignatureOid", this.getFields().get("uploadSignatureOid"));
return context;
}
use of com.netsteadfast.greenstep.vo.OrganizationVO in project bamboobsc by billchen198318.
the class BscBaseLogicServiceCommonSupport method findOrganizationDataByUK.
public static OrganizationVO findOrganizationDataByUK(IOrganizationService<OrganizationVO, BbOrganization, String> service, String orgId) throws ServiceException, Exception {
if (StringUtils.isBlank(orgId)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
OrganizationVO organization = new OrganizationVO();
organization.setOrgId(orgId);
DefaultResult<OrganizationVO> orgResult = service.findByUK(organization);
if (orgResult.getValue() == null) {
throw new ServiceException(orgResult.getSystemMessage().getValue());
}
organization = orgResult.getValue();
return organization;
}
use of com.netsteadfast.greenstep.vo.OrganizationVO in project bamboobsc by billchen198318.
the class OrganizationLogicServiceImpl method updateParent.
@ServiceMethodAuthority(type = { ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<Boolean> updateParent(OrganizationVO organization, String parentOid) throws ServiceException, Exception {
if (organization == null || super.isBlank(organization.getOid()) || super.isBlank(parentOid)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
DefaultResult<Boolean> result = new DefaultResult<Boolean>();
result.setValue(Boolean.FALSE);
result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.UPDATE_FAIL)));
organization = this.findOrganizationData(organization.getOid());
this.deleteParent(organization);
if ("root".equals(parentOid) || "r".equals(parentOid)) {
this.createParent(organization, BscConstants.ORGANIZATION_ZERO_ID);
} else {
OrganizationVO newParOrganization = this.findOrganizationData(parentOid);
// 找當前部門的子部門中的資料, 不因該存在要update的新父部門
if (this.foundChild(organization.getOrgId(), newParOrganization.getOrgId())) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.DATA_ERRORS));
}
this.createParent(organization, newParOrganization.getOrgId());
}
result.setValue(Boolean.TRUE);
result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.UPDATE_SUCCESS)));
return result;
}
Aggregations