| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- package cn.com.lzt.budget.data.timetask;
- import cn.com.lzt.budget.data.util.BudgetConstant;
- import cn.com.lzt.budget.dimfunction.service.BudgetDimFunctionServiceI;
- import cn.com.lzt.budget.writeback.service.BudgetWriteBackServiceI;
- import cn.com.lzt.useractiviti.workflow.task.AbstractActivitiTimeTask;
- import cn.com.lzt.userwage.dao.UserWageMinidaoDao;
- import cn.com.lzt.userwage.dto.UserWageDto;
- import cn.com.lzt.userwage.service.UserWageServiceI;
- import org.jeecgframework.core.util.DateUtils;
- import org.quartz.JobExecutionContext;
- import org.springframework.stereotype.Service;
- import java.math.BigDecimal;
- import java.util.Calendar;
- import java.util.List;
- import java.util.Map;
- /**
- * 回写确认工资
- */
- @Service
- public class BudgetUserWageConfirmWritebackTask extends AbstractActivitiTimeTask {
- @Override
- protected void doJob(JobExecutionContext jobExecutionContext) {
- Calendar c = Calendar.getInstance();
- c.add(Calendar.MONTH,-1 );
- String monthly = DateUtils.formatDate(c.getTime(), "yyyy-MM");
- writebackByMonth(monthly);
- }
- public void writebackByMonth(String monthly){
- UserWageMinidaoDao dao = getBean(UserWageMinidaoDao.class);
- UserWageDto searchDto = new UserWageDto();
- searchDto.setMonthly(monthly);
- List<UserWageDto> list = dao.getBudgetEntityMoneySUM(searchDto);
- BudgetWriteBackServiceI service = getBean(BudgetWriteBackServiceI.class);
- service.negativeWriteBack(BudgetConstant.BusType.wages, null,null , null, null, monthly);
- for(UserWageDto dto : list){
- //1.1 基本工资及固定补贴 2c9358ad74ae69160174b3c04bf3005a
- // 基本工资+职务津贴+交通补贴+独生子女费+证书补贴+其他补贴+缴金补贴+补发调整
- // -病假扣-事假扣-缺勤扣-其他扣-代扣款
- BigDecimal basicWage = getDecimal(dto.getBasicWage());//基本工资 1.1
- BigDecimal dutiesAllowance = getDecimal(dto.getDutiesAllowance());//职务津贴1.1
- BigDecimal trafficSubsidy =getDecimal(dto.getTrafficSubsidy());//交通补贴1.1
- BigDecimal onlyChildCost = getDecimal(dto.getOnlyChildCost());//独生子女费1.1
- BigDecimal certificateSubsidy =getDecimal(dto.getCertificateSubsidy());//证书补贴1.1
- BigDecimal otherSubsidy =getDecimal(dto.getOtherSubsidy());//其他补贴1.1
- BigDecimal paymentSubsidy =getDecimal(dto.getPaymentSubsidy());//缴金补贴 1.1
- BigDecimal reissue = getDecimal(dto.getReissue());//补发调整1.1
- BigDecimal sickLeaveDebit =getDecimal(dto.getSickLeaveDebit());//病假扣1.1
- BigDecimal thingLeaveDebit =getDecimal(dto.getThingLeaveDebit());//事假扣1.1
- BigDecimal absenceDebit =getDecimal( dto.getAbsenceDebit());//缺勤扣1.1
- BigDecimal daikouDebit =getDecimal(dto.getDaikouDebit());//代扣款1.1
- BigDecimal otherDebit =getDecimal(dto.getOtherDebit());//其他扣除1.1
- BigDecimal value = new BigDecimal(0);
- value= value.add(basicWage).add(dutiesAllowance).add(trafficSubsidy).add(onlyChildCost).add(certificateSubsidy).add(otherSubsidy).add(paymentSubsidy)
- .add(reissue).subtract(sickLeaveDebit).subtract(thingLeaveDebit).subtract(absenceDebit)
- .subtract(daikouDebit).subtract(otherDebit);
- service.writeBack(BudgetConstant.BusType.wages, "基本工资及固定补贴", dto.getPjtId()
- , "2c9358ad74ae69160174b3c04bf3005a", null, value, monthly, null, null);
- //1.2 高温补贴 2c9358ad74ae69160174b3c08652005c
- BigDecimal megathermalSubsidy =getDecimal(dto.getMegathermalSubsidy());//高温补贴
- service.writeBack(BudgetConstant.BusType.wages, "高温补贴", dto.getPjtId()
- , "2c9358ad74ae69160174b3c08652005c", null, megathermalSubsidy, monthly, null, null);
- //1.3 法定及额外加值班费 2c9358ad74ae69160174b3c0c71f005e
- BigDecimal overtimepayTimeout = getDecimal(dto.getOvertimepayTimeout());//加班超时费1.3
- BigDecimal overtimepayFixed = getDecimal(dto.getOvertimepayFixed());//国定加班费1.3
- BigDecimal duty = getDecimal(dto.getDuty());//值班费1.3
- BigDecimal specialOvertime =getDecimal(dto.getSpecialOvertime());//特殊加班费1.3
- value=overtimepayTimeout.add(overtimepayFixed).add(duty).add(specialOvertime);
- service.writeBack(BudgetConstant.BusType.wages, "法定及额外加值班费", dto.getPjtId()
- , "2c9358ad74ae69160174b3c0c71f005e", null, value, monthly, null, null);
- // 1.4 工作餐补及中夜班津贴 2c9358ad74ae69160174b3c123cb0060
- BigDecimal mealsSubsidyDay = getDecimal(dto.getMealsSubsidyDay());//餐补白班津贴
- BigDecimal mealsSubsidyNight = getDecimal(dto.getMealsSubsidyNight());//餐补夜班津贴
- BigDecimal mealsSubsidy =getDecimal(dto.getMealsSubsidy());//餐费补助
- value = mealsSubsidyDay.add(mealsSubsidyNight).add(mealsSubsidy);
- service.writeBack(BudgetConstant.BusType.wages, "工作餐补及中夜班津贴", dto.getPjtId()
- , "2c9358ad74ae69160174b3c123cb0060", null, value, monthly, null, null);
- //1.6 奖金 2c9358ad74ae69160174b3c18a8b0064
- BigDecimal bonus = getDecimal(dto.getBonus());//奖金1.6
- BigDecimal projectPerformance =getDecimal(dto.getProjectPerformance());//项目绩效1.6
- value= bonus.add(projectPerformance);
- service.writeBack(BudgetConstant.BusType.wages, "奖金", dto.getPjtId()
- , "2c9358ad74ae69160174b3c18a8b0064", null, value, monthly, null, null);
- //1.7 企业社保 2c9358ad74ae69160174b3c1c7660066
- BigDecimal comSocialSecurityDebit = dto.getComSocialSecurityDebit();//公司社保扣除
- service.writeBack(BudgetConstant.BusType.wages, "企业社保", dto.getPjtId()
- , "2c9358ad74ae69160174b3c1c7660066", null, comSocialSecurityDebit, monthly, null, null);
- //1.8 企业公积金 2c9358ad74ae69160174b3c1f5640068
- BigDecimal comProvidentFundDebit = dto.getComProvidentFundDebit();//公司公积金扣除
- service.writeBack(BudgetConstant.BusType.wages, "企业公积金", dto.getPjtId()
- , "2c9358ad74ae69160174b3c1f5640068", null, comProvidentFundDebit, monthly, null, null);
- }
- }
- private BigDecimal getDecimal(BigDecimal v) {
- if(v==null) return BigDecimal.ZERO;
- return v;
- }
- }
|