Search in sources :

Example 1 with EmployeeVO

use of com.netsteadfast.greenstep.vo.EmployeeVO in project bamboobsc by billchen198318.

the class PersonalReportPdfCommand method createHead.

private void createHead(PdfPTable table, VisionVO vision, Context context) throws Exception {
    String bgColor = "#F2F2F2";
    String fnColor = "#000000";
    PdfPCell cell = new PdfPCell();
    cell.addElement(new Phrase("Personal Balance SourceCard", this.getFont(fnColor, true)));
    this.setCellBackgroundColor(cell, bgColor);
    cell.setColspan(MAX_COLSPAN);
    table.addCell(cell);
    cell = new PdfPCell();
    cell.addElement(new Phrase(vision.getTitle(), this.getFont(fnColor, true)));
    this.setCellBackgroundColor(cell, bgColor);
    cell.setColspan(MAX_COLSPAN);
    table.addCell(cell);
    String dateType = (String) context.get("dateType");
    String year = (String) context.get("startYearDate");
    String empId = (String) context.get("empId");
    String account = (String) context.get("account");
    String fullName = "";
    String jobTitle = "";
    String departmentName = "";
    String dateTypeName = "Year";
    if ("1".equals(dateType)) {
        dateTypeName = "In the first half";
    }
    if ("2".equals(dateType)) {
        dateTypeName = "In the second half";
    }
    EmployeeVO employee = new EmployeeVO();
    employee.setEmpId(empId);
    employee.setAccount(account);
    DefaultResult<EmployeeVO> result = this.employeeService.findByUK(employee);
    if (result.getValue() != null) {
        fullName = result.getValue().getEmpId() + " - " + result.getValue().getFullName();
        jobTitle = result.getValue().getEmpId() + " - " + result.getValue().getFullName();
        List<String> appendIds = this.organizationService.findForAppendOrganizationOids(result.getValue().getEmpId());
        List<String> appendNames = this.organizationService.findForAppendNames(appendIds);
        StringBuilder sb = new StringBuilder();
        for (int i = 0; appendNames != null && i < appendNames.size(); i++) {
            sb.append(appendNames.get(i)).append(Constants.ID_DELIMITER);
        }
        departmentName = sb.toString();
    }
    cell = new PdfPCell();
    cell.addElement(new Phrase("Job Title", this.getFont(fnColor, true)));
    this.setCellBackgroundColor(cell, bgColor);
    cell.setColspan(1);
    table.addCell(cell);
    cell = new PdfPCell();
    cell.addElement(new Phrase(jobTitle, this.getFont(fnColor, true)));
    this.setCellBackgroundColor(cell, bgColor);
    cell.setColspan(1);
    table.addCell(cell);
    cell = new PdfPCell();
    cell.addElement(new Phrase("Department", this.getFont(fnColor, true)));
    this.setCellBackgroundColor(cell, bgColor);
    cell.setColspan(1);
    table.addCell(cell);
    cell = new PdfPCell();
    cell.addElement(new Phrase(departmentName, this.getFont(fnColor, true)));
    this.setCellBackgroundColor(cell, bgColor);
    cell.setColspan(1);
    table.addCell(cell);
    cell = new PdfPCell();
    cell.addElement(new Phrase("name: " + fullName, this.getFont(fnColor, true)));
    this.setCellBackgroundColor(cell, bgColor);
    cell.setColspan(1);
    table.addCell(cell);
    cell = new PdfPCell();
    cell.addElement(new Phrase("Annual assessment: " + year, this.getFont(fnColor, true)));
    this.setCellBackgroundColor(cell, bgColor);
    cell.setColspan(1);
    table.addCell(cell);
    cell = new PdfPCell();
    cell.addElement(new Phrase(BscReportPropertyUtils.getObjectiveTitle(), this.getFont(fnColor, true)));
    this.setCellBackgroundColor(cell, bgColor);
    cell.setColspan(1);
    cell.setRowspan(2);
    table.addCell(cell);
    cell = new PdfPCell();
    cell.addElement(new Phrase(BscReportPropertyUtils.getKpiTitle(), this.getFont(fnColor, true)));
    this.setCellBackgroundColor(cell, bgColor);
    cell.setColspan(1);
    cell.setRowspan(2);
    table.addCell(cell);
    cell = new PdfPCell();
    cell.addElement(new Phrase("Maximum\nTarget\nMinimum", this.getFont(fnColor, true)));
    this.setCellBackgroundColor(cell, bgColor);
    cell.setColspan(1);
    cell.setRowspan(2);
    table.addCell(cell);
    cell = new PdfPCell();
    cell.addElement(new Phrase("Weight", this.getFont(fnColor, true)));
    this.setCellBackgroundColor(cell, bgColor);
    cell.setColspan(1);
    cell.setRowspan(2);
    table.addCell(cell);
    cell = new PdfPCell();
    cell.addElement(new Phrase("Formula", this.getFont(fnColor, true)));
    this.setCellBackgroundColor(cell, bgColor);
    cell.setColspan(1);
    cell.setRowspan(2);
    table.addCell(cell);
    cell = new PdfPCell();
    cell.addElement(new Phrase("Score", this.getFont(fnColor, true)));
    this.setCellBackgroundColor(cell, bgColor);
    cell.setColspan(1);
    cell.setRowspan(1);
    table.addCell(cell);
    cell = new PdfPCell();
    cell.addElement(new Phrase(dateTypeName, this.getFont(fnColor, true)));
    this.setCellBackgroundColor(cell, bgColor);
    cell.setColspan(1);
    cell.setRowspan(1);
    table.addCell(cell);
}
Also used : PdfPCell(com.itextpdf.text.pdf.PdfPCell) EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO) Phrase(com.itextpdf.text.Phrase)

Example 2 with EmployeeVO

use of com.netsteadfast.greenstep.vo.EmployeeVO in project bamboobsc by billchen198318.

the class CommonOrgChartAction method createOrgChartDataForEmployee2.

private void createOrgChartDataForEmployee2() throws ControllerException, AuthorityException, ServiceException, Exception {
    EmployeeVO employee = new EmployeeVO();
    employee = this.transformFields2ValueObject(employee, "oid");
    DefaultResult<Map<String, Object>> result = this.employeeLogicService.getOrgChartData(ApplicationSiteUtils.getBasePath(Constants.getMainSystem(), this.getHttpServletRequest()), employee);
    this.rootData = result.getValue();
    this.message = result.getSystemMessage().getValue();
    if (this.rootData != null && this.rootData.size() > 0) {
        this.success = IS_YES;
    }
}
Also used : EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO) HashMap(java.util.HashMap) Map(java.util.Map)

Example 3 with EmployeeVO

use of com.netsteadfast.greenstep.vo.EmployeeVO in project bamboobsc by billchen198318.

the class EmployeeSaveOrUpdateAction method save.

private void save() throws ControllerException, AuthorityException, ServiceException, Exception {
    this.checkFields();
    EmployeeVO employee = new EmployeeVO();
    this.transformFields2ValueObject(employee, new String[] { "account", "password", "empId", "fullName", "jobTitle" });
    DefaultResult<EmployeeVO> result = this.employeeLogicService.create(employee, this.transformAppendIds2List(this.getFields().get("appendId")));
    this.message = result.getSystemMessage().getValue();
    if (result.getValue() != null) {
        this.success = IS_YES;
    }
}
Also used : EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO)

Example 4 with EmployeeVO

use of com.netsteadfast.greenstep.vo.EmployeeVO in project bamboobsc by billchen198318.

the class EmployeeSaveOrUpdateAction method delete.

private void delete() throws ControllerException, AuthorityException, ServiceException, Exception {
    EmployeeVO employee = new EmployeeVO();
    this.transformFields2ValueObject(employee, new String[] { "oid" });
    DefaultResult<Boolean> result = this.employeeLogicService.delete(employee);
    this.message = result.getSystemMessage().getValue();
    if (result.getValue() != null && result.getValue()) {
        this.success = IS_YES;
    }
}
Also used : EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO)

Example 5 with EmployeeVO

use of com.netsteadfast.greenstep.vo.EmployeeVO in project bamboobsc by billchen198318.

the class KpiLogicServiceImpl method createKpiEmployee.

private void createKpiEmployee(KpiVO kpi, List<String> employeeOids) throws ServiceException, Exception {
    if (kpi == null || employeeOids == null || employeeOids.size() < 1) {
        return;
    }
    for (String oid : employeeOids) {
        EmployeeVO employee = this.findEmployeeData(oid);
        KpiEmplVO kpiEmpl = new KpiEmplVO();
        kpiEmpl.setKpiId(kpi.getId());
        kpiEmpl.setEmpId(employee.getEmpId());
        this.kpiEmplService.saveObject(kpiEmpl);
    }
}
Also used : KpiEmplVO(com.netsteadfast.greenstep.vo.KpiEmplVO) EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO)

Aggregations

EmployeeVO (com.netsteadfast.greenstep.vo.EmployeeVO)48 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)21 OrganizationVO (com.netsteadfast.greenstep.vo.OrganizationVO)15 HashMap (java.util.HashMap)13 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)7 LinkedHashMap (java.util.LinkedHashMap)5 Transactional (org.springframework.transaction.annotation.Transactional)5 Map (java.util.Map)4 BbEmployee (com.netsteadfast.greenstep.po.hbm.BbEmployee)3 AccountVO (com.netsteadfast.greenstep.vo.AccountVO)3 KpiVO (com.netsteadfast.greenstep.vo.KpiVO)3 List (java.util.List)3 Context (org.apache.commons.chain.Context)3 ContextBase (org.apache.commons.chain.impl.ContextBase)3 DefaultResult (com.netsteadfast.greenstep.base.model.DefaultResult)2 SystemMessage (com.netsteadfast.greenstep.base.model.SystemMessage)2 BbOrganization (com.netsteadfast.greenstep.po.hbm.BbOrganization)2 BbPdcaDoc (com.netsteadfast.greenstep.po.hbm.BbPdcaDoc)2 BbPdcaItem (com.netsteadfast.greenstep.po.hbm.BbPdcaItem)2 BbPdcaItemDoc (com.netsteadfast.greenstep.po.hbm.BbPdcaItemDoc)2