use of com.netsteadfast.greenstep.vo.OrganizationVO in project bamboobsc by billchen198318.
the class HistoryItemScoreReportContentQueryUtils method fill2ValueObjectList.
public static List<MonitorItemScoreVO> fill2ValueObjectList(List<BbMonitorItemScore> monitorItemScores) throws ServiceException, Exception {
List<MonitorItemScoreVO> results = new ArrayList<MonitorItemScoreVO>();
if (null == monitorItemScores) {
return results;
}
List<VisionVO> basicDataList = getBasicDataList();
for (BbMonitorItemScore monitorScoreSrc : monitorItemScores) {
MonitorItemScoreVO monitorScoreDest = new MonitorItemScoreVO();
monitorItemScoreService.doMapper(monitorScoreSrc, monitorScoreDest, IMonitorItemScoreService.MAPPER_ID_PO2VO);
String id = monitorScoreSrc.getItemId();
String name = "";
String itemType = monitorScoreSrc.getItemType();
if (MonitorItemType.VISION.equals(itemType)) {
DefaultResult<VisionVO> visionResult = visionService.findForSimpleByVisId(id);
if (visionResult.getValue() == null) {
throw new ServiceException(visionResult.getSystemMessage().getValue());
}
VisionVO vision = visionResult.getValue();
name = getItemNameWithVisionGroup(MonitorItemType.VISION, vision.getVisId(), vision.getTitle(), basicDataList);
}
if (MonitorItemType.PERSPECTIVES.equals(itemType)) {
PerspectiveVO perspective = new PerspectiveVO();
perspective.setPerId(id);
DefaultResult<PerspectiveVO> perspectiveResult = perspectiveService.findByUK(perspective);
if (perspectiveResult.getValue() == null) {
throw new ServiceException(perspectiveResult.getSystemMessage().getValue());
}
perspective = perspectiveResult.getValue();
name = getItemNameWithVisionGroup(MonitorItemType.PERSPECTIVES, perspective.getPerId(), perspective.getName(), basicDataList);
}
if (MonitorItemType.STRATEGY_OF_OBJECTIVES.equals(itemType)) {
ObjectiveVO objective = new ObjectiveVO();
objective.setObjId(id);
DefaultResult<ObjectiveVO> objectiveResult = objectiveService.findByUK(objective);
if (objectiveResult.getValue() == null) {
throw new ServiceException(objectiveResult.getSystemMessage().getValue());
}
objective = objectiveResult.getValue();
name = getItemNameWithVisionGroup(MonitorItemType.STRATEGY_OF_OBJECTIVES, objective.getObjId(), objective.getName(), basicDataList);
}
if (MonitorItemType.KPI.equals(itemType)) {
KpiVO kpi = new KpiVO();
kpi.setId(id);
DefaultResult<KpiVO> kpiResult = kpiService.findByUK(kpi);
if (kpiResult.getValue() == null) {
throw new ServiceException(kpiResult.getSystemMessage().getValue());
}
kpi = kpiResult.getValue();
name = getItemNameWithVisionGroup(MonitorItemType.KPI, kpi.getId(), kpi.getName(), basicDataList);
}
monitorScoreDest.setName(name);
monitorScoreDest.setOrganizationName(monitorScoreSrc.getOrgId());
monitorScoreDest.setEmployeeName(monitorScoreSrc.getEmpId());
if (!BscConstants.MEASURE_DATA_ORGANIZATION_FULL.equals(monitorScoreSrc.getOrgId())) {
OrganizationVO organization = BscBaseLogicServiceCommonSupport.findOrganizationDataByUK(organizationService, monitorScoreSrc.getOrgId());
monitorScoreDest.setOrganizationName(monitorScoreSrc.getOrgId() + " - " + organization.getName());
}
if (!BscConstants.MEASURE_DATA_EMPLOYEE_FULL.equals(monitorScoreSrc.getEmpId())) {
EmployeeVO employee = BscBaseLogicServiceCommonSupport.findEmployeeDataByEmpId(employeeService, monitorScoreSrc.getEmpId());
monitorScoreDest.setEmployeeName(monitorScoreSrc.getEmpId() + " - " + employee.getFullName());
}
results.add(monitorScoreDest);
}
return results;
}
use of com.netsteadfast.greenstep.vo.OrganizationVO in project bamboobsc by billchen198318.
the class SwotLogicServiceImpl method create.
@ServiceMethodAuthority(type = { ServiceMethodType.INSERT, ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<Boolean> create(String visionOid, String organizationOid, List<SwotVO> datas) throws ServiceException, Exception {
if (super.isBlank(visionOid) || super.isBlank(organizationOid)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
VisionVO vision = new VisionVO();
vision.setOid(visionOid);
DefaultResult<VisionVO> vResult = this.visionService.findObjectByOid(vision);
if (vResult.getValue() == null) {
throw new ServiceException(vResult.getSystemMessage().getValue());
}
vision = vResult.getValue();
OrganizationVO organization = this.findOrganizationData(organizationOid);
//因為 dojo 的 dijit.InlineEditBox 元件特性是, 沒有修改過, 就不會產生editor , 所以修改模式下用全部刪除後->再全部新增會有問題
//this.delete(vision.getVisId());
DefaultResult<Boolean> result = new DefaultResult<Boolean>();
result.setValue(Boolean.TRUE);
result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.UPDATE_SUCCESS)));
Map<String, Object> params = new HashMap<String, Object>();
for (SwotVO swot : datas) {
if (!vision.getVisId().equals(swot.getVisId()) || !organization.getOrgId().equals(swot.getOrgId())) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.DATA_ERRORS));
}
this.setStringValueMaxLength(swot, "issues", MAX_ISSUES_LENGTH);
params.clear();
params.put("perId", swot.getPerId());
if (this.perspectiveService.countByParams(params) < 1) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.DATA_ERRORS));
}
if (this.swotService.countByUK(swot) > 0) {
// 修改 ISSUES
this.updateIssues(swot);
} else {
// 新增
this.swotService.saveObject(swot);
}
}
return result;
}
use of com.netsteadfast.greenstep.vo.OrganizationVO in project bamboobsc by billchen198318.
the class PdcaLogicServiceImpl method createOrganization.
private void createOrganization(PdcaVO pdca, List<String> orgaOids) throws ServiceException, Exception {
for (String oid : orgaOids) {
OrganizationVO organization = this.findOrganizationData(oid);
PdcaOrgaVO pdcaOrga = new PdcaOrgaVO();
pdcaOrga.setPdcaOid(pdca.getOid());
pdcaOrga.setOrgId(organization.getOrgId());
this.pdcaOrgaService.saveObject(pdcaOrga);
}
}
use of com.netsteadfast.greenstep.vo.OrganizationVO in project bamboobsc by billchen198318.
the class ApiWebServiceImpl method getScorecard2.
@WebMethod
@GET
@Path("/scorecard2/")
@Override
public BscApiServiceResponse getScorecard2(@WebParam(name = "visionId") @QueryParam("visionId") String visionId, @WebParam(name = "startDate") @QueryParam("startDate") String startDate, @WebParam(name = "endDate") @QueryParam("endDate") String endDate, @WebParam(name = "startYearDate") @QueryParam("startYearDate") String startYearDate, @WebParam(name = "endYearDate") @QueryParam("endYearDate") String endYearDate, @WebParam(name = "frequency") @QueryParam("frequency") String frequency, @WebParam(name = "dataFor") @QueryParam("dataFor") String dataFor, @WebParam(name = "measureDataOrganizationId") @QueryParam("measureDataOrganizationId") String measureDataOrganizationId, @WebParam(name = "measureDataEmployeeId") @QueryParam("measureDataEmployeeId") String measureDataEmployeeId, @WebParam(name = "contentFlag") @QueryParam("contentFlag") String contentFlag) throws Exception {
HttpServletRequest request = null;
if (this.getWebServiceContext() != null && this.getWebServiceContext().getMessageContext() != null) {
request = (HttpServletRequest) this.getWebServiceContext().getMessageContext().get(MessageContext.SERVLET_REQUEST);
}
Subject subject = null;
BscApiServiceResponse responseObj = new BscApiServiceResponse();
responseObj.setSuccess(YesNo.NO);
try {
subject = WsAuthenticateUtils.login();
@SuppressWarnings("unchecked") IVisionService<VisionVO, BbVision, String> visionService = (IVisionService<VisionVO, BbVision, String>) AppContext.getBean("bsc.service.VisionService");
@SuppressWarnings("unchecked") IEmployeeService<EmployeeVO, BbEmployee, String> employeeService = (IEmployeeService<EmployeeVO, BbEmployee, String>) AppContext.getBean("bsc.service.EmployeeService");
@SuppressWarnings("unchecked") IOrganizationService<OrganizationVO, BbOrganization, String> organizationService = (IOrganizationService<OrganizationVO, BbOrganization, String>) AppContext.getBean("bsc.service.OrganizationService");
String visionOid = "";
String measureDataOrganizationOid = "";
String measureDataEmployeeOid = "";
DefaultResult<VisionVO> visionResult = visionService.findForSimpleByVisId(visionId);
if (visionResult.getValue() == null) {
throw new Exception(visionResult.getSystemMessage().getValue());
}
visionOid = visionResult.getValue().getOid();
if (StringUtils.isBlank(measureDataOrganizationId)) {
measureDataOrganizationOid = BscBaseLogicServiceCommonSupport.findEmployeeDataByEmpId(employeeService, measureDataOrganizationId).getOid();
}
if (StringUtils.isBlank(measureDataEmployeeId)) {
measureDataEmployeeOid = BscBaseLogicServiceCommonSupport.findOrganizationDataByUK(organizationService, measureDataEmployeeId).getOid();
}
this.processForScorecard(responseObj, request, visionOid, startDate, endDate, startYearDate, endYearDate, frequency, dataFor, measureDataOrganizationOid, measureDataEmployeeOid, contentFlag);
} catch (Exception e) {
responseObj.setMessage(e.getMessage());
} finally {
if (!YesNo.YES.equals(responseObj.getSuccess())) {
responseObj.setMessage(SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA));
}
WsAuthenticateUtils.logout(subject);
}
subject = null;
return responseObj;
}
use of com.netsteadfast.greenstep.vo.OrganizationVO in project bamboobsc by billchen198318.
the class HistoryItemScoreReportContentQueryAction method getContent.
@SuppressWarnings("unchecked")
private void getContent() throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
this.newDateVal = this.getChangeDateVal();
String frequency = this.getFields().get("frequency");
String measureDataTypeName = BscConstants.MEASURE_DATA_FOR_ALL;
String empId = BscConstants.MEASURE_DATA_EMPLOYEE_FULL;
String orgId = BscConstants.MEASURE_DATA_ORGANIZATION_FULL;
String measureDataOrganizationOid = this.getFields().get("measureDataOrganizationOid");
String measureDataEmployeeOid = this.getFields().get("measureDataEmployeeOid");
String dataFor = this.getFields().get("dataFor");
if ("organization".equals(dataFor) && !super.isNoSelectId(measureDataOrganizationOid)) {
OrganizationVO organization = new OrganizationVO();
organization.setOid(measureDataOrganizationOid);
DefaultResult<OrganizationVO> result = this.organizationService.findObjectByOid(organization);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
organization = result.getValue();
orgId = organization.getOrgId();
measureDataTypeName = organization.getOrgId() + " - " + organization.getName();
}
if ("employee".equals(dataFor) && !super.isNoSelectId(measureDataEmployeeOid)) {
EmployeeVO employee = new EmployeeVO();
employee.setOid(measureDataEmployeeOid);
DefaultResult<EmployeeVO> result = this.employeeService.findObjectByOid(employee);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
employee = result.getValue();
empId = employee.getEmpId();
measureDataTypeName = employee.getEmpId() + " - " + employee.getFullName();
}
if ("line".equals(this.getFields().get("chartType"))) {
// Line chart
this.chartData = HistoryItemScoreReportContentQueryUtils.getLineChartData(this.getFields().get("itemType"), frequency, this.newDateVal, orgId, empId);
if (this.chartData == null || this.chartData.size() < 1) {
super.throwMessage("itemType", SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA));
}
this.chartCategories = HistoryItemScoreReportContentQueryUtils.getLineChartCategoriesFromData(this.newDateVal, this.chartData);
this.subtitle = "Frequency: " + BscMeasureDataFrequency.getFrequencyMap(false).get(frequency) + ", " + "Date range: " + this.chartCategories.get(0) + " ~ " + this.getChartCategories().get(this.getChartCategories().size() - 1) + ", " + "Measure-data for: " + measureDataTypeName;
this.startDate = this.chartCategories.get(0);
this.endDate = this.getChartCategories().get(this.getChartCategories().size() - 1);
this.success = IS_YES;
} else {
// Heat map chart
Map<String, Object> chartDataMap = HistoryItemScoreReportContentQueryUtils.getHartMapChartData(this.getFields().get("itemType"), frequency, this.newDateVal, orgId, empId);
if (chartDataMap == null || chartDataMap.size() != 3) {
super.throwMessage("itemType", SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA));
}
this.heatMapChartData = (List<List<Object>>) chartDataMap.get("seriesData");
this.xAxisCategories = (List<String>) chartDataMap.get("xAxisCategories");
this.yAxisCategories = (List<String>) chartDataMap.get("yAxisCategories");
this.subtitle = "Frequency: " + BscMeasureDataFrequency.getFrequencyMap(false).get(frequency) + ", " + "Date range: " + this.yAxisCategories.get(0) + " ~ " + this.yAxisCategories.get(this.yAxisCategories.size() - 1) + ", " + "Measure-data for: " + measureDataTypeName;
this.startDate = this.yAxisCategories.get(0);
this.endDate = this.yAxisCategories.get(this.yAxisCategories.size() - 1);
this.success = IS_YES;
}
}
Aggregations