use of com.netsteadfast.greenstep.vo.EmployeeVO in project bamboobsc by billchen198318.
the class EmployeeLogicServiceImpl method create.
@ServiceMethodAuthority(type = { ServiceMethodType.INSERT })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<EmployeeVO> create(EmployeeVO employee, List<String> organizationOid) throws ServiceException, Exception {
if (employee == null || super.isBlank(employee.getEmpId())) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
Map<String, Object> params = new HashMap<String, Object>();
params.put("empId", employee.getEmpId());
if (this.getEmployeeService().countByParams(params) > 0) {
throw new ServiceException("Please change another Id!");
}
AccountVO account = this.tranAccount(employee);
if (this.isAdministrator(account.getAccount())) {
throw new ServiceException("Please change another Account!");
}
DefaultResult<AccountVO> mResult = this.getAccountService().saveObject(account);
if (mResult.getValue() == null) {
throw new ServiceException(mResult.getSystemMessage().getValue());
}
DefaultResult<EmployeeVO> result = this.getEmployeeService().saveObject(employee);
employee = result.getValue();
this.createEmployeeOrganization(employee, organizationOid);
// create default role
UserRoleVO userRole = new UserRoleVO();
userRole.setAccount(employee.getAccount());
userRole.setRole(this.roleLogicService.getDefaultUserRole());
userRole.setDescription(employee.getAccount() + " `s role!");
this.getUserRoleService().saveObject(userRole);
this.createHierarchy(employee, BscConstants.EMPLOYEE_HIER_ZERO_OID);
return result;
}
use of com.netsteadfast.greenstep.vo.EmployeeVO in project bamboobsc by billchen198318.
the class DegreeFeedbackLogicServiceImpl method fetchEmployee.
private EmployeeVO fetchEmployee(String oid, Map<String, EmployeeVO> tmpBag) throws ServiceException, Exception {
if (tmpBag.get(oid) != null) {
return tmpBag.get(oid);
}
EmployeeVO employee = this.findEmployeeData(oid);
tmpBag.put(oid, employee);
return employee;
}
use of com.netsteadfast.greenstep.vo.EmployeeVO in project bamboobsc by billchen198318.
the class PdcaLogicServiceImpl method createOwner.
private void createOwner(PdcaVO pdca, List<String> emplOids) throws ServiceException, Exception {
for (String oid : emplOids) {
EmployeeVO employee = this.findEmployeeData(oid);
PdcaOwnerVO pdcaOwner = new PdcaOwnerVO();
pdcaOwner.setPdcaOid(pdca.getOid());
pdcaOwner.setEmpId(employee.getEmpId());
this.pdcaOwnerService.saveObject(pdcaOwner);
}
}
use of com.netsteadfast.greenstep.vo.EmployeeVO 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.EmployeeVO in project bamboobsc by billchen198318.
the class BscReportSupportUtils method fillKpiEmployees.
/**
* 為KPI報表顯示要用的 , 取出KPI所屬的員工
*
* @param kpi
* @throws ServiceException
* @throws Exception
*/
public static void fillKpiEmployees(KpiVO kpi) throws ServiceException, Exception {
List<String> appendEmplOids = employeeService.findForAppendEmployeeOidsByKpiEmpl(kpi.getId());
for (int i = 0; appendEmplOids != null && i < appendEmplOids.size(); i++) {
EmployeeVO employee = new EmployeeVO();
employee.setOid(appendEmplOids.get(i));
DefaultResult<EmployeeVO> result = employeeService.findObjectByOid(employee);
if (result.getValue() != null) {
employee = result.getValue();
kpi.getEmployees().add(employee);
}
}
}
Aggregations