use of com.netsteadfast.greenstep.vo.VisionVO in project bamboobsc by billchen198318.
the class VisionServiceImpl method findForSimpleByVisId.
@Override
public DefaultResult<VisionVO> findForSimpleByVisId(String visId) throws ServiceException, Exception {
if (StringUtils.isBlank(visId)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
DefaultResult<VisionVO> result = new DefaultResult<VisionVO>();
VisionVO vision = this.visionDAO.findForSimpleByVisId(visId);
if (vision != null) {
result.setValue(vision);
} else {
result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA)));
}
return result;
}
use of com.netsteadfast.greenstep.vo.VisionVO 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.VisionVO in project bamboobsc by billchen198318.
the class HistoryItemScoreReportContentQueryUtils method getLineChartData.
public static List<Map<String, Object>> getLineChartData(String itemType, String frequency, String dateVal, String orgId, String empId) throws ServiceException, Exception {
List<Map<String, Object>> dataList = new ArrayList<Map<String, Object>>();
Map<String, List<MonitorItemScoreVO>> itemScoreDataMap = monitorItemScoreService.getHistoryDataList(itemType, frequency, dateVal, orgId, empId);
if (itemScoreDataMap == null || itemScoreDataMap.size() < 1) {
return dataList;
}
List<VisionVO> basicDataList = getBasicDataList();
for (Map.Entry<String, List<MonitorItemScoreVO>> entry : itemScoreDataMap.entrySet()) {
String name = "";
String id = entry.getKey();
List<MonitorItemScoreVO> scoreList = entry.getValue();
if (scoreList == null || scoreList.size() < 1) {
continue;
}
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);
}
if (StringUtils.isBlank(name)) {
throw new ServiceException("Name not found!");
}
Map<String, Object> chartDataMap = new HashMap<String, Object>();
chartDataMap.put("name", name);
chartDataMap.put("data", new LinkedList<Float>());
for (MonitorItemScoreVO itemScore : scoreList) {
((List<Float>) chartDataMap.get("data")).add(Float.valueOf(itemScore.getScore()));
}
dataList.add(chartDataMap);
}
return dataList;
}
use of com.netsteadfast.greenstep.vo.VisionVO 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.VisionVO in project bamboobsc by billchen198318.
the class PerspectiveLogicServiceImpl method create.
@ServiceMethodAuthority(type = { ServiceMethodType.INSERT })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<PerspectiveVO> create(PerspectiveVO perspective, String visionOid) throws ServiceException, Exception {
if (null == perspective || super.isBlank(visionOid)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
DefaultResult<VisionVO> vResult = this.visionService.findForSimple(visionOid);
if (vResult.getValue() == null) {
throw new ServiceException(vResult.getSystemMessage().getValue());
}
VisionVO vision = vResult.getValue();
perspective.setVisId(vision.getVisId());
if (!SimpleUtils.checkBeTrueOf_azAZ09(4, 14, perspective.getPerId())) {
// for import-mode from csv file PER_ID is old(before id).
perspective.setPerId(this.findForMaxPerId(SimpleUtils.getStrYMD("")));
}
this.setStringValueMaxLength(perspective, "description", MAX_DESCRIPTION_LENGTH);
return this.perspectiveService.saveObject(perspective);
}
Aggregations