Example usage for org.springframework.transaction.annotation Isolation READ_COMMITTED

List of usage examples for org.springframework.transaction.annotation Isolation READ_COMMITTED

Introduction

In this page you can find the example usage for org.springframework.transaction.annotation Isolation READ_COMMITTED.

Prototype

Isolation READ_COMMITTED

To view the source code for org.springframework.transaction.annotation Isolation READ_COMMITTED.

Click Source Link

Document

A constant indicating that dirty reads are prevented; non-repeatable reads and phantom reads can occur.

Usage

From source file:com.inkubator.hrm.service.impl.PayTempKalkulasiServiceImpl.java

@Override
@Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED, propagation = Propagation.SUPPORTS, timeout = 30)
public PayTempKalkulasi getEntityByPkWithDetail(Long id) throws Exception {
    return payTempKalkulasiDao.getEntityByPkWithDetail(id);
}

From source file:com.inkubator.hrm.service.impl.TempAttendanceRealizationServiceImpl.java

@Override
@Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED, propagation = Propagation.SUPPORTS, timeout = 50)
public DetilRealizationAttendanceModel getStatisticEmpAttendaceDetil(long empId) throws Exception {
    WtPeriode wtPeriode = this.wtPeriodeDao.getEntityByAbsentTypeActive();
    DetilRealizationAttendanceModel attendanceModel = new DetilRealizationAttendanceModel();

    //        Perhatia dua data yang di perbandingkan harus sama soring ascrnding atau descending 
    List<TempJadwalKaryawan> dataToCalculate = tempJadwalKaryawanDao
            .getAllByEmpIdWithDetailWithFromAndUntilPeriod(empId, wtPeriode.getFromPeriode(),
                    wtPeriode.getUntilPeriode());
    //        List<TempProcessReadFinger> presentAteendace = tempProcessReadFingerDao.getAllDataByEmpDataIdAndScheduleDate(empId, wtPeriode.getFromPeriode(), wtPeriode.getUntilPeriode());
    List<DetilAttendateRelaization> dataToShow = new ArrayList<>();
    for (TempJadwalKaryawan tempJadwal : dataToCalculate) {

        TempProcessReadFinger finger = tempProcessReadFingerDao.getEntityByEmpDataIdAndScheduleDate(empId,
                tempJadwal.getTanggalWaktuKerja());
        DetilAttendateRelaization attendateRelaization = new DetilAttendateRelaization();

        LeaveImplementation leaveImplementation = leaveImplementationDao.getByEmpStardDateEndDate(empId,
                tempJadwal.getTanggalWaktuKerja());
        BusinessTravel businessTravel = businessTravelDao.getByEmpIdAndDate(empId,
                tempJadwal.getTanggalWaktuKerja());
        MedicalCare medicalCare = medicalCareDao.getByEmpIdAndDate(empId, tempJadwal.getTanggalWaktuKerja());
        PermitImplementation permitImplementation = permitImplementationDao.getByEmpStardDateEndDate(empId,
                tempJadwal.getTanggalWaktuKerja());

        if (finger != null) {

            attendateRelaization.setAsentDate(finger.getScheduleDate());
            attendateRelaization.setRealisasiStatus(finger.getWorkingHourName());
            attendateRelaization.setRealisasiAttendace(
                    tempJadwal.getWtWorkingHour().getAttendanceStatus().getStatusKehadrian());
            attendateRelaization.setIsAttendaceKnowing(true);
        } else {/* w w  w .j  ava 2  s.c om*/
            if (leaveImplementation != null) {
                long leavId = leaveImplementation.getId();
                LeaveImplementationDate leaveImplementationDate = leaveImplementationDateDao
                        .getByLeavIdDateAndIsTrue(leavId, tempJadwal.getTanggalWaktuKerja(), false);
                attendateRelaization.setAsentDate(leaveImplementationDate.getActualDate());
                attendateRelaization.setRealisasiStatus(
                        leaveImplementationDate.getLeaveImplementation().getLeave().getName() + " no."
                                + leaveImplementationDate.getLeaveImplementation().getNumberFilling());
                attendateRelaization.setRealisasiAttendace(leaveImplementationDate.getLeaveImplementation()
                        .getLeave().getAttendanceStatus().getStatusKehadrian());
                attendateRelaization.setIsAttendaceKnowing(true);
            } else if (businessTravel != null) {
                attendateRelaization.setAsentDate(tempJadwal.getTanggalWaktuKerja());
                attendateRelaization.setRealisasiStatus(ResourceBundleUtil.getAsString("global.travel_to") + " "
                        + businessTravel.getDestination());
                attendateRelaization.setRealisasiAttendace(
                        businessTravel.getTravelType().getAttendanceStatus().getStatusKehadrian());
                attendateRelaization.setIsAttendaceKnowing(true);
            } else if (medicalCare != null) {
                attendateRelaization.setAsentDate(tempJadwal.getTanggalWaktuKerja());
                attendateRelaization.setRealisasiStatus(medicalCare.getDisease().getName());
                attendateRelaization.setRealisasiAttendace(ResourceBundleUtil.getAsString("global.sick"));
                attendateRelaization.setIsAttendaceKnowing(true);
            } else if (permitImplementation != null) {
                attendateRelaization.setAsentDate(tempJadwal.getTanggalWaktuKerja());
                attendateRelaization
                        .setRealisasiStatus(permitImplementation.getPermitClassification().getName());
                attendateRelaization.setRealisasiAttendace(permitImplementation.getPermitClassification()
                        .getAttendanceStatus().getStatusKehadrian());
                attendateRelaization.setIsAttendaceKnowing(true);
            } else {
                if (tempJadwal.getWtWorkingHour().getCode().equals("OFF")) {
                    attendateRelaization.setAsentDate(tempJadwal.getTanggalWaktuKerja());
                    attendateRelaization.setRealisasiStatus(tempJadwal.getWtWorkingHour().getName());
                    attendateRelaization.setRealisasiAttendace(ResourceBundleUtil.getAsString("menu.holiday"));
                    attendateRelaization.setIsAttendaceKnowing(true);
                } else {
                    attendateRelaization.setAsentDate(tempJadwal.getTanggalWaktuKerja());
                    attendateRelaization.setRealisasiStatus(ResourceBundleUtil.getAsString("global.unknow"));
                    attendateRelaization.setRealisasiAttendace(ResourceBundleUtil.getAsString("global.unknow"));
                    attendateRelaization.setIsAttendaceKnowing(false);
                }

            }
        }

        dataToShow.add(attendateRelaization);
        attendanceModel.setDataToShow(dataToShow);
        //            Date temp1 = tempJadwal.getTanggalWaktuKerja();
        //            Date temp2;
        //          
        //
        //            if (i <= sizePresentDay) {
        //                temp2 = presentAteendace.get(i).getScheduleDate();
        //               
        //                if (temp1.equals(temp2)) {
        //                 
        //                }
        //            }
        //            i++;

        if (tempJadwal.getTanggalWaktuKerja().equals(new Date())) {
            break;
        }

    }

    attendanceModel.setStardDate(wtPeriode.getFromPeriode());
    attendanceModel.setEndDate(wtPeriode.getUntilPeriode());
    attendanceModel.setTotalCuti(tempAttendanceRealizationDao.getTotalEmpLeav(empId));
    attendanceModel.setTotalIzin(tempAttendanceRealizationDao.getTotalEmpPermit(empId));
    attendanceModel.setTotalOnDuty(tempAttendanceRealizationDao.gettotalEmpOnDuty(empId));
    attendanceModel.setTotalSick(tempAttendanceRealizationDao.gettotalEmpOnSick(empId));
    //        attendanceModel.setDataToShow(tempProcessReadFingerDao.getAllDataByEmpDataIdAndScheduleDate(empId, attendanceModel.getStardDate(), attendanceModel.getEndDate()));
    return attendanceModel;
}

From source file:com.netsteadfast.greenstep.base.service.BaseService.java

@SuppressWarnings("unchecked")
@ServiceMethodAuthority(type = { ServiceMethodType.SELECT })
@Transactional(isolation = Isolation.READ_COMMITTED, timeout = 25, readOnly = true)
public E findByOid(E entityObject) throws ServiceException, Exception {
    if (entityObject == null || !(entityObject instanceof BaseEntity)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.OBJ_NULL));
    }//  w ww.  j  ava 2s  . c o m
    if (StringUtils.isBlank(((BaseEntity<String>) entityObject).getOid())) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.DATA_NO_EXIST));
    }
    return this.getBaseDataAccessObject().findByOid(entityObject);
}

From source file:com.inkubator.hrm.service.impl.PayTempKalkulasiServiceImpl.java

@Override
@Transactional(readOnly = false, isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public List<PayTempKalkulasi> getAllDataCalculatedPayment(Date startPeriodDate, Date endPeriodDate,
        Date createdOn, String createdBy) throws Exception {

    //initial//from  w  ww. ja  v  a2s  . c  o  m
    PaySalaryComponent totalIncomeComponent = paySalaryComponentDao
            .getEntityBySpecificModelComponent(HRMConstant.MODEL_COMP_TAKE_HOME_PAY);
    PaySalaryComponent taxComponent = paySalaryComponentDao
            .getEntityBySpecificModelComponent(HRMConstant.MODEL_COMP_TAX);
    PaySalaryComponent ceilComponent = paySalaryComponentDao
            .getEntityBySpecificModelComponent(HRMConstant.MODEL_COMP_CEIL);
    List<PayTempKalkulasi> datas = new ArrayList<PayTempKalkulasi>();
    ScriptEngineManager mgr = new ScriptEngineManager();
    ScriptEngine jsEngine = mgr.getEngineByName("JavaScript");
    Double basicSalary = null;
    Double workingDay = null;
    Double lessTime = null;
    Double moreTime = null;
    Double overTIme = null;
    Double totalDay = this.getDefaultWorkingDay(startPeriodDate, endPeriodDate); //total working day dari kelompok kerja DEFAULT(reguler)
    Double outPut = null;

    //Start calculation
    List<EmpData> totalEmployee = empDataDao.getAllDataNotTerminateAndJoinDateLowerThan(endPeriodDate);
    /*List<EmpData> totalEmployee = new ArrayList<EmpData>();
     EmpData emp = empDataDao.getEntiyByPK((long)130);
     totalEmployee.add(emp);*/

    for (EmpData empData : totalEmployee) {
        LOGGER.info(
                " ============= EMPLOYEE : " + empData.getBioData().getFirstName() + " =====================");

        /**
         * Set initial variabel untuk masing2 karyawan, 
         * yang akan dibutuhkan untuk perhitungan model komponen FORMULA (if any) 
         * */
        basicSalary = Double.parseDouble(empData.getBasicSalaryDecrypted());
        PayTempOvertime payTempOvertime = payTempOvertimeDao.getEntityByEmpDataId(empData.getId());
        overTIme = payTempOvertime != null ? payTempOvertime.getOvertime() : 0.0;
        PayTempAttendanceStatus payTempAttendanceStatus = payTempAttendanceStatusDao
                .getEntityByEmpDataId(empData.getId());
        workingDay = payTempAttendanceStatus != null ? (double) payTempAttendanceStatus.getTotalAttendance()
                : 0.0;
        lessTime = ((workingDay > 0) && (workingDay < totalDay)) ? totalDay - workingDay : 0.0;
        moreTime = (workingDay > totalDay) ? workingDay - totalDay : 0.0;

        /**
         * Saat ini totalIncome masih temporary, karena belum dikurangi
         * pajak dan pembulatan CSR Sedangkan untuk final totalIncome (take
         * home pay) ada di proses(step) selanjutnya di batch proses,
         * silahkan lihat batch-config.xml
         */
        BigDecimal totalIncome = new BigDecimal(0);

        List<PayComponentDataException> payComponentExceptions = payComponentDataExceptionDao
                .getAllByEmpId(empData.getId());
        for (PayComponentDataException dataException : payComponentExceptions) {
            PayTempKalkulasi kalkulasi = new PayTempKalkulasi();
            kalkulasi.setId(Long.parseLong(RandomNumberUtil.getRandomNumber(12)));
            kalkulasi.setEmpData(empData);
            kalkulasi.setPaySalaryComponent(dataException.getPaySalaryComponent());
            kalkulasi.setFactor(
                    this.getFactorBasedCategory(dataException.getPaySalaryComponent().getComponentCategory()));
            kalkulasi.setNominal(dataException.getNominal());

            kalkulasi.setCreatedBy(createdBy);
            kalkulasi.setCreatedOn(createdOn);
            datas.add(kalkulasi);

            totalIncome = this.calculateTotalIncome(totalIncome, kalkulasi); //calculate totalIncome temporary
            LOGGER.info("Save By ComponentDataException - " + dataException.getPaySalaryComponent().getName()
                    + ", nominal : " + dataException.getNominal());
        }

        int timeTmb = DateTimeUtil.getTotalDay(empData.getJoinDate(), createdOn);
        List<Long> componentIds = Lambda.extract(payComponentExceptions,
                Lambda.on(PayComponentDataException.class).getPaySalaryComponent().getId());
        List<PaySalaryComponent> listPayComponetNotExcp = paySalaryComponentDao
                .getAllDataByEmpTypeIdAndActiveFromTmAndIdNotIn(empData.getEmployeeType().getId(), timeTmb,
                        componentIds);
        if (null == Lambda.selectFirst(listPayComponetNotExcp,
                Lambda.having(Lambda.on(PaySalaryComponent.class).getModelComponent().getSpesific(),
                        Matchers.equalTo(HRMConstant.MODEL_COMP_BASIC_SALARY)))
                && null == Lambda.selectFirst(payComponentExceptions,
                        Lambda.having(
                                Lambda.on(PayComponentDataException.class).getPaySalaryComponent()
                                        .getModelComponent().getSpesific(),
                                Matchers.equalTo(HRMConstant.MODEL_COMP_BASIC_SALARY)))) {
            throw new BussinessException("global.error_user_does_not_have_basic_salary",
                    empData.getNikWithFullName());
        }
        for (PaySalaryComponent paySalaryComponent : listPayComponetNotExcp) {
            if (paySalaryComponent.getModelComponent().getSpesific().equals(HRMConstant.MODEL_COMP_UPLOAD)) {
                PayTempUploadData payUpload = this.payTempUploadDataDao
                        .getEntityByEmpIdAndComponentId(empData.getId(), paySalaryComponent.getId());
                if (payUpload != null) {
                    PayTempKalkulasi kalkulasi = new PayTempKalkulasi();
                    kalkulasi.setId(Long.parseLong(RandomNumberUtil.getRandomNumber(12)));
                    kalkulasi.setEmpData(empData);
                    kalkulasi.setPaySalaryComponent(payUpload.getPaySalaryComponent());
                    kalkulasi.setFactor(this
                            .getFactorBasedCategory(payUpload.getPaySalaryComponent().getComponentCategory()));
                    BigDecimal nominal = new BigDecimal(payUpload.getNominalValue());
                    kalkulasi.setNominal(nominal);

                    kalkulasi.setCreatedBy(createdBy);
                    kalkulasi.setCreatedOn(createdOn);
                    datas.add(kalkulasi);

                    totalIncome = this.calculateTotalIncome(totalIncome, kalkulasi); //calculate totalIncome temporary
                    LOGGER.info("Save By Upload - " + payUpload.getPaySalaryComponent().getName()
                            + ", nominal : " + nominal);
                }

            } else if (paySalaryComponent.getModelComponent().getSpesific()
                    .equals(HRMConstant.MODEL_COMP_BASIC_SALARY)) {
                PayTempKalkulasi kalkulasi = new PayTempKalkulasi();
                kalkulasi.setId(Long.parseLong(RandomNumberUtil.getRandomNumber(12)));
                kalkulasi.setEmpData(empData);
                kalkulasi.setPaySalaryComponent(paySalaryComponent);
                kalkulasi.setFactor(this.getFactorBasedCategory(paySalaryComponent.getComponentCategory()));
                BigDecimal nominal = new BigDecimal(empData.getBasicSalaryDecrypted());
                if ((timeTmb / 30) < 1) {
                    //jika TMB belum memenuhi satu bulan, jadi basic salary dibagi pro-rate
                    nominal = nominal.divide(new BigDecimal(timeTmb), RoundingMode.UP);
                }
                kalkulasi.setNominal(nominal);

                kalkulasi.setCreatedBy(createdBy);
                kalkulasi.setCreatedOn(createdOn);
                datas.add(kalkulasi);

                totalIncome = this.calculateTotalIncome(totalIncome, kalkulasi); //calculate totalIncome temporary
                LOGGER.info("Save By Basic Salary " + (((timeTmb / 30) < 1) ? "Not Full" : "Full")
                        + ", nominal : " + nominal);

            } else if (paySalaryComponent.getModelComponent().getSpesific()
                    .equals(HRMConstant.MODEL_COMP_LOAN)) {
                //cek apakah modelReferensi di paySalaryComponent valid atau tidak
                LoanNewType loanType = loanNewTypeDao
                        .getEntiyByPK((long) paySalaryComponent.getModelReffernsil());
                if (loanType == null) {
                    throw new BussinessException("salaryCalculation.error_salary_component_reference",
                            paySalaryComponent.getName());
                }

                List<LoanNewApplicationInstallment> installments = loanNewApplicationInstallmentDao
                        .getAllDataDisbursedByEmpDataIdAndLoanTypeIdAndPeriodDate(empData.getId(),
                                loanType.getId(), startPeriodDate, endPeriodDate);
                for (LoanNewApplicationInstallment installment : installments) {
                    PayTempKalkulasi kalkulasi = new PayTempKalkulasi();
                    kalkulasi.setId(Long.parseLong(RandomNumberUtil.getRandomNumber(12)));
                    kalkulasi.setEmpData(empData);
                    kalkulasi.setPaySalaryComponent(paySalaryComponent);
                    kalkulasi.setFactor(this.getFactorBasedCategory(paySalaryComponent.getComponentCategory()));
                    BigDecimal nominal = new BigDecimal(installment.getTotalPayment());
                    nominal = nominal.setScale(0, RoundingMode.UP);
                    kalkulasi.setNominal(nominal);

                    //set detail loan
                    int termin = installment.getLoanNewApplication().getTermin();
                    long cicilanKe = termin - installment.getNumOfInstallment();
                    kalkulasi.setDetail(cicilanKe + "/" + termin);

                    kalkulasi.setCreatedBy(createdBy);
                    kalkulasi.setCreatedOn(createdOn);
                    datas.add(kalkulasi);

                    totalIncome = this.calculateTotalIncome(totalIncome, kalkulasi); //calculate totalIncome temporary
                    LOGGER.info("Save By Loan - " + paySalaryComponent.getName() + ", nominal : " + nominal);
                }

            } else if (paySalaryComponent.getModelComponent().getSpesific()
                    .equals(HRMConstant.MODEL_COMP_REIMBURSEMENT)) {
                //cek apakah modelReferensi di paySalaryComponent valid atau tidak
                RmbsType rmbsType = rmbsTypeDao.getEntiyByPK((long) paySalaryComponent.getModelReffernsil());
                if (rmbsType == null) {
                    throw new BussinessException("salaryCalculation.error_salary_component_reference",
                            paySalaryComponent.getName());
                }

                List<RmbsApplication> reimbursments = rmbsApplicationDao
                        .getAllDataDisbursedByEmpDataIdAndRmbsTypeIdAndPeriodDate(empData.getId(),
                                rmbsType.getId(), startPeriodDate, endPeriodDate);
                for (RmbsApplication reimbursment : reimbursments) {
                    PayTempKalkulasi kalkulasi = new PayTempKalkulasi();
                    kalkulasi.setId(Long.parseLong(RandomNumberUtil.getRandomNumber(12)));
                    kalkulasi.setEmpData(empData);
                    kalkulasi.setPaySalaryComponent(paySalaryComponent);
                    kalkulasi.setFactor(this.getFactorBasedCategory(paySalaryComponent.getComponentCategory()));
                    kalkulasi.setNominal(reimbursment.getNominal());

                    //set detail reimbursement
                    kalkulasi.setDetail(reimbursment.getCode());

                    kalkulasi.setCreatedBy(createdBy);
                    kalkulasi.setCreatedOn(createdOn);
                    datas.add(kalkulasi);

                    totalIncome = this.calculateTotalIncome(totalIncome, kalkulasi); //calculate totalIncome temporary
                    LOGGER.info("Save By Reimbursment, nominal : " + reimbursment.getNominal());
                }

            } else if (paySalaryComponent.getModelComponent().getSpesific()
                    .equals(HRMConstant.MODEL_COMP_FORMULA)) {
                String formulaOne = paySalaryComponent.getFormula();
                if (formulaOne != null) {
                    jsEngine.put("bS", basicSalary);
                    jsEngine.put("wD", workingDay);
                    jsEngine.put("lT", lessTime);
                    jsEngine.put("mT", moreTime);
                    jsEngine.put("oT", overTIme);
                    jsEngine.put("tD", totalDay);
                    outPut = (Double) jsEngine.eval(formulaOne);

                    PayTempKalkulasi kalkulasi = new PayTempKalkulasi();
                    kalkulasi.setId(Long.parseLong(RandomNumberUtil.getRandomNumber(12)));
                    kalkulasi.setEmpData(empData);
                    kalkulasi.setPaySalaryComponent(paySalaryComponent);
                    kalkulasi.setFactor(this.getFactorBasedCategory(paySalaryComponent.getComponentCategory()));
                    BigDecimal nominal = new BigDecimal(outPut);
                    kalkulasi.setNominal(nominal);

                    kalkulasi.setCreatedBy(createdBy);
                    kalkulasi.setCreatedOn(createdOn);
                    datas.add(kalkulasi);

                    totalIncome = this.calculateTotalIncome(totalIncome, kalkulasi); //calculate totalIncome temporary
                    LOGGER.info("Save By Formula, nominal : " + nominal);
                }

            } else if (paySalaryComponent.getModelComponent().getSpesific()
                    .equals(HRMConstant.MODEL_COMP_BENEFIT_TABLE)) {
                //cek apakah modelReferensi di paySalaryComponent valid atau tidak
                BenefitGroup benefitGroup = benefitGroupDao
                        .getEntiyByPK((long) paySalaryComponent.getModelReffernsil());
                if (benefitGroup == null) {
                    throw new BussinessException("salaryCalculation.error_salary_component_reference",
                            paySalaryComponent.getName());
                }

                //cek apakah tunjangan yg didapatkan sesuai dengan hak dari golonganJabatan karyawan
                BenefitGroupRate benefitGroupRate = benefitGroupRateDao
                        .getEntityByBenefitGroupIdAndGolJabatanId(benefitGroup.getId(),
                                empData.getGolonganJabatan().getId());
                if (benefitGroupRate != null) {
                    PayTempKalkulasi kalkulasi = new PayTempKalkulasi();
                    kalkulasi.setId(Long.parseLong(RandomNumberUtil.getRandomNumber(12)));
                    kalkulasi.setEmpData(empData);
                    kalkulasi.setPaySalaryComponent(paySalaryComponent);
                    kalkulasi.setFactor(this.getFactorBasedCategory(paySalaryComponent.getComponentCategory()));
                    //nominal untuk benefit dikali nilai dari measurement                        
                    BigDecimal nominal = new BigDecimal(benefitGroupRate.getNominal()).multiply(this
                            .getMultiplierFromMeasurement(benefitGroupRate.getBenefitGroup().getMeasurement()));
                    kalkulasi.setNominal(nominal);

                    //set detail benefit
                    kalkulasi.setDetail(benefitGroupRate.getGolonganJabatan().getCode());

                    kalkulasi.setCreatedBy(createdBy);
                    kalkulasi.setCreatedOn(createdOn);
                    datas.add(kalkulasi);

                    totalIncome = this.calculateTotalIncome(totalIncome, kalkulasi); //calculate totalIncome temporary
                    LOGGER.info("Save By Benefit - " + paySalaryComponent.getName() + ", nominal : " + nominal);
                }
            }
        }

        //create totalIncome Kalkulasi, hasil penjumlahan nominal dari semua component di atas
        PayTempKalkulasi totalIncomeKalkulasi = new PayTempKalkulasi();
        totalIncomeKalkulasi.setId(Long.parseLong(RandomNumberUtil.getRandomNumber(12)));
        totalIncomeKalkulasi.setEmpData(empData);
        totalIncomeKalkulasi.setPaySalaryComponent(totalIncomeComponent);
        totalIncomeKalkulasi
                .setFactor(this.getFactorBasedCategory(totalIncomeComponent.getComponentCategory()));
        totalIncomeKalkulasi.setNominal(totalIncome);
        totalIncomeKalkulasi.setCreatedBy(createdBy);
        totalIncomeKalkulasi.setCreatedOn(createdOn);
        datas.add(totalIncomeKalkulasi);

        //create initial tax Kalkulasi, set nominal 0. Akan dibutuhkan di batch proses step selanjutnya
        PayTempKalkulasi taxKalkulasi = new PayTempKalkulasi();
        taxKalkulasi.setId(Long.parseLong(RandomNumberUtil.getRandomNumber(12)));
        taxKalkulasi.setEmpData(empData);
        taxKalkulasi.setPaySalaryComponent(taxComponent);
        taxKalkulasi.setFactor(this.getFactorBasedCategory(taxComponent.getComponentCategory()));
        taxKalkulasi.setNominal(new BigDecimal(0));
        taxKalkulasi.setCreatedBy(createdBy);
        taxKalkulasi.setCreatedOn(createdOn);
        datas.add(taxKalkulasi);

        //create initial ceil Kalkulasi, set nominal 0. Akan dibutuhkan di batch proses step selanjutnya 
        PayTempKalkulasi ceilKalkulasi = new PayTempKalkulasi();
        ceilKalkulasi.setId(Long.parseLong(RandomNumberUtil.getRandomNumber(12)));
        ceilKalkulasi.setEmpData(empData);
        ceilKalkulasi.setPaySalaryComponent(ceilComponent);
        ceilKalkulasi.setFactor(this.getFactorBasedCategory(ceilComponent.getComponentCategory()));
        ceilKalkulasi.setNominal(new BigDecimal(0));
        ceilKalkulasi.setCreatedBy(createdBy);
        ceilKalkulasi.setCreatedOn(createdOn);
        datas.add(ceilKalkulasi);
    }

    return datas;
}

From source file:com.inkubator.hrm.service.impl.EmpCareerHistoryServiceImpl.java

@Override
@Transactional(readOnly = false, isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public void rejected(long approvalActivityId, String comment) throws Exception {
    Map<String, Object> result = super.rejectedAndCheckNextApproval(approvalActivityId, comment);
    ApprovalActivity appActivity = (ApprovalActivity) result.get("approvalActivity");
    if (StringUtils.equals((String) result.get("isEndOfApprovalProcess"), "true")) {

    }/*from ww  w .j  av  a  2 s.  co  m*/

    //if there is no error, then sending the email notification
    sendingApprovalNotification(appActivity);

}

From source file:com.netsteadfast.greenstep.base.service.BaseService.java

@SuppressWarnings("unchecked")
@ServiceMethodAuthority(type = { ServiceMethodType.SELECT })
@Transactional(isolation = Isolation.READ_COMMITTED, timeout = 25, readOnly = true)
public int countByOid(E entityObject) throws ServiceException, Exception {
    if (entityObject == null || !(entityObject instanceof BaseEntity)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.OBJ_NULL));
    }//from w ww. j a va2s  . c om
    if (StringUtils.isBlank(((BaseEntity<String>) entityObject).getOid())) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.DATA_NO_EXIST));
    }
    return this.getBaseDataAccessObject().countByOid(entityObject);
}

From source file:com.inkubator.hrm.service.impl.TempJadwalKaryawanServiceImpl.java

@Override
@Transactional(readOnly = false, isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public void rejected(long approvalActivityId, String comment) throws Exception {
    Map<String, Object> result = super.rejectedAndCheckNextApproval(approvalActivityId, comment);
    ApprovalActivity appActivity = (ApprovalActivity) result.get("approvalActivity");

    //if there is no error, then sending the email notification
    sendingApprovalNotification(appActivity);
}

From source file:com.inkubator.hrm.service.impl.LoanNewApplicationServiceImpl.java

@Override
@Transactional(readOnly = false, isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public void approved(long approvalActivityId, String pendingDataUpdate, String comment) throws Exception {
    Map<String, Object> result = super.approvedAndCheckNextApproval(approvalActivityId, pendingDataUpdate,
            comment);/*from  ww w. j a v  a  2s .  c  o m*/
    ApprovalActivity appActivity = (ApprovalActivity) result.get("approvalActivity");

    if (StringUtils.equals((String) result.get("isEndOfApprovalProcess"), "true")) {
        /**
         * kalau status akhir sudah di approved dan tidak ada next approval,
         * berarti langsung insert ke database
         */
        LoanNewApplication entity = this.convertJsonToEntity(appActivity.getPendingData());
        entity.setLoanStatus(HRMConstant.LOAN_UNDISBURSED); // set default loan application status
        entity.setApprovalActivityNumber(appActivity.getActivityNumber()); //set approval activity number, for history approval purpose

        /**
         * saving to DB
         */
        this.save(entity, Boolean.TRUE, null);
    }

    //if there is no error, then sending the email notification
    sendingApprovalNotification(appActivity);
}

From source file:com.inkubator.hrm.service.impl.EmpCareerHistoryServiceImpl.java

@Override
@Transactional(readOnly = false, isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public void diverted(long approvalActivityId) throws Exception {
    Map<String, Object> result = super.divertedAndCheckNextApproval(approvalActivityId);
    ApprovalActivity appActivity = (ApprovalActivity) result.get("approvalActivity");
    if (StringUtils.equals((String) result.get("isEndOfApprovalProcess"), "true")) {
        /**//from ww w .ja v  a  2  s.  com
         * kalau status akhir sudah di approved dan tidak ada next approval,
         * berarti langsung insert ke database
         */
        EmpCareerHistoryModel model = this.convertJsonToModel(appActivity.getPendingData());
        model.setApprovalActivityNumber(appActivity.getActivityNumber()); //set approval activity number, for history approval purpose

        /** saving to DB */
        this.saveTransition(model, Boolean.TRUE);
    }

    //if there is no error, then sending the email notification
    sendingApprovalNotification(appActivity);

}

From source file:de.thm.arsnova.dao.CouchDBDao.java

@Override
@Transactional(isolation = Isolation.READ_COMMITTED)
public boolean sessionKeyAvailable(final String keyword) {
    final View view = new View("session/by_keyword");
    final ViewResults results = getDatabase().view(view);

    return !results.containsKey(keyword);
}