BudgetUserWageConfirmWritebackTask.java 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. package cn.com.lzt.budget.data.timetask;
  2. import cn.com.lzt.budget.data.util.BudgetConstant;
  3. import cn.com.lzt.budget.dimfunction.service.BudgetDimFunctionServiceI;
  4. import cn.com.lzt.budget.writeback.service.BudgetWriteBackServiceI;
  5. import cn.com.lzt.useractiviti.workflow.task.AbstractActivitiTimeTask;
  6. import cn.com.lzt.userwage.dao.UserWageMinidaoDao;
  7. import cn.com.lzt.userwage.dto.UserWageDto;
  8. import cn.com.lzt.userwage.service.UserWageServiceI;
  9. import org.jeecgframework.core.util.DateUtils;
  10. import org.quartz.JobExecutionContext;
  11. import org.springframework.stereotype.Service;
  12. import java.math.BigDecimal;
  13. import java.util.Calendar;
  14. import java.util.List;
  15. import java.util.Map;
  16. /**
  17. * 回写确认工资
  18. */
  19. @Service
  20. public class BudgetUserWageConfirmWritebackTask extends AbstractActivitiTimeTask {
  21. @Override
  22. protected void doJob(JobExecutionContext jobExecutionContext) {
  23. Calendar c = Calendar.getInstance();
  24. c.add(Calendar.MONTH,-1 );
  25. String monthly = DateUtils.formatDate(c.getTime(), "yyyy-MM");
  26. writebackByMonth(monthly);
  27. }
  28. public void writebackByMonth(String monthly){
  29. UserWageMinidaoDao dao = getBean(UserWageMinidaoDao.class);
  30. UserWageDto searchDto = new UserWageDto();
  31. searchDto.setMonthly(monthly);
  32. List<UserWageDto> list = dao.getBudgetEntityMoneySUM(searchDto);
  33. BudgetWriteBackServiceI service = getBean(BudgetWriteBackServiceI.class);
  34. service.negativeWriteBack(BudgetConstant.BusType.wages, null,null , null, null, monthly);
  35. for(UserWageDto dto : list){
  36. //1.1 基本工资及固定补贴 2c9358ad74ae69160174b3c04bf3005a
  37. // 基本工资+职务津贴+交通补贴+独生子女费+证书补贴+其他补贴+缴金补贴+补发调整
  38. // -病假扣-事假扣-缺勤扣-其他扣-代扣款
  39. BigDecimal basicWage = getDecimal(dto.getBasicWage());//基本工资 1.1
  40. BigDecimal dutiesAllowance = getDecimal(dto.getDutiesAllowance());//职务津贴1.1
  41. BigDecimal trafficSubsidy =getDecimal(dto.getTrafficSubsidy());//交通补贴1.1
  42. BigDecimal onlyChildCost = getDecimal(dto.getOnlyChildCost());//独生子女费1.1
  43. BigDecimal certificateSubsidy =getDecimal(dto.getCertificateSubsidy());//证书补贴1.1
  44. BigDecimal otherSubsidy =getDecimal(dto.getOtherSubsidy());//其他补贴1.1
  45. BigDecimal paymentSubsidy =getDecimal(dto.getPaymentSubsidy());//缴金补贴 1.1
  46. BigDecimal reissue = getDecimal(dto.getReissue());//补发调整1.1
  47. BigDecimal sickLeaveDebit =getDecimal(dto.getSickLeaveDebit());//病假扣1.1
  48. BigDecimal thingLeaveDebit =getDecimal(dto.getThingLeaveDebit());//事假扣1.1
  49. BigDecimal absenceDebit =getDecimal( dto.getAbsenceDebit());//缺勤扣1.1
  50. BigDecimal daikouDebit =getDecimal(dto.getDaikouDebit());//代扣款1.1
  51. BigDecimal otherDebit =getDecimal(dto.getOtherDebit());//其他扣除1.1
  52. BigDecimal value = new BigDecimal(0);
  53. value= value.add(basicWage).add(dutiesAllowance).add(trafficSubsidy).add(onlyChildCost).add(certificateSubsidy).add(otherSubsidy).add(paymentSubsidy)
  54. .add(reissue).subtract(sickLeaveDebit).subtract(thingLeaveDebit).subtract(absenceDebit)
  55. .subtract(daikouDebit).subtract(otherDebit);
  56. service.writeBack(BudgetConstant.BusType.wages, "基本工资及固定补贴", dto.getPjtId()
  57. , "2c9358ad74ae69160174b3c04bf3005a", null, value, monthly, null, null);
  58. //1.2 高温补贴 2c9358ad74ae69160174b3c08652005c
  59. BigDecimal megathermalSubsidy =getDecimal(dto.getMegathermalSubsidy());//高温补贴
  60. service.writeBack(BudgetConstant.BusType.wages, "高温补贴", dto.getPjtId()
  61. , "2c9358ad74ae69160174b3c08652005c", null, megathermalSubsidy, monthly, null, null);
  62. //1.3 法定及额外加值班费 2c9358ad74ae69160174b3c0c71f005e
  63. BigDecimal overtimepayTimeout = getDecimal(dto.getOvertimepayTimeout());//加班超时费1.3
  64. BigDecimal overtimepayFixed = getDecimal(dto.getOvertimepayFixed());//国定加班费1.3
  65. BigDecimal duty = getDecimal(dto.getDuty());//值班费1.3
  66. BigDecimal specialOvertime =getDecimal(dto.getSpecialOvertime());//特殊加班费1.3
  67. value=overtimepayTimeout.add(overtimepayFixed).add(duty).add(specialOvertime);
  68. service.writeBack(BudgetConstant.BusType.wages, "法定及额外加值班费", dto.getPjtId()
  69. , "2c9358ad74ae69160174b3c0c71f005e", null, value, monthly, null, null);
  70. // 1.4 工作餐补及中夜班津贴 2c9358ad74ae69160174b3c123cb0060
  71. BigDecimal mealsSubsidyDay = getDecimal(dto.getMealsSubsidyDay());//餐补白班津贴
  72. BigDecimal mealsSubsidyNight = getDecimal(dto.getMealsSubsidyNight());//餐补夜班津贴
  73. BigDecimal mealsSubsidy =getDecimal(dto.getMealsSubsidy());//餐费补助
  74. value = mealsSubsidyDay.add(mealsSubsidyNight).add(mealsSubsidy);
  75. service.writeBack(BudgetConstant.BusType.wages, "工作餐补及中夜班津贴", dto.getPjtId()
  76. , "2c9358ad74ae69160174b3c123cb0060", null, value, monthly, null, null);
  77. //1.6 奖金 2c9358ad74ae69160174b3c18a8b0064
  78. BigDecimal bonus = getDecimal(dto.getBonus());//奖金1.6
  79. BigDecimal projectPerformance =getDecimal(dto.getProjectPerformance());//项目绩效1.6
  80. value= bonus.add(projectPerformance);
  81. service.writeBack(BudgetConstant.BusType.wages, "奖金", dto.getPjtId()
  82. , "2c9358ad74ae69160174b3c18a8b0064", null, value, monthly, null, null);
  83. //1.7 企业社保 2c9358ad74ae69160174b3c1c7660066
  84. BigDecimal comSocialSecurityDebit = dto.getComSocialSecurityDebit();//公司社保扣除
  85. service.writeBack(BudgetConstant.BusType.wages, "企业社保", dto.getPjtId()
  86. , "2c9358ad74ae69160174b3c1c7660066", null, comSocialSecurityDebit, monthly, null, null);
  87. //1.8 企业公积金 2c9358ad74ae69160174b3c1f5640068
  88. BigDecimal comProvidentFundDebit = dto.getComProvidentFundDebit();//公司公积金扣除
  89. service.writeBack(BudgetConstant.BusType.wages, "企业公积金", dto.getPjtId()
  90. , "2c9358ad74ae69160174b3c1f5640068", null, comProvidentFundDebit, monthly, null, null);
  91. }
  92. }
  93. private BigDecimal getDecimal(BigDecimal v) {
  94. if(v==null) return BigDecimal.ZERO;
  95. return v;
  96. }
  97. }