Commit cb3f159a by ilal

提交

parent b8faed05
...@@ -63,5 +63,8 @@ public class XcglAssoGztzt extends Model<XcglAssoGztzt> { ...@@ -63,5 +63,8 @@ public class XcglAssoGztzt extends Model<XcglAssoGztzt> {
@ApiModelProperty(value="工资条组id",example="101") @ApiModelProperty(value="工资条组id",example="101")
private Integer gztszid; private Integer gztszid;
@ApiModelProperty(value="实发工资",example="101")
private Double sfgz;
} }
\ No newline at end of file
...@@ -1130,7 +1130,7 @@ public class SalaryManagementController { ...@@ -1130,7 +1130,7 @@ public class SalaryManagementController {
zzx.setRulestate(1);//规则状态[0:系统自动提取;1:系统固定值;2:固定公式计算;3:自定义公式计算;4:每月自动导入] zzx.setRulestate(1);//规则状态[0:系统自动提取;1:系统固定值;2:固定公式计算;3:自定义公式计算;4:每月自动导入]
}else {// }else {//
String xxs = "自动提取数据"; String xxs = "自动提取数据";
String[] strxz = {"从人事花名册-","从考勤报表-","从社保账单-"}; String[] strxz = {"从人事花名册-","从月度汇总-","从社保账单-"};
String describe = ""; String describe = "";
int rule = 0;//规则状态[0:系统自动提取;1:系统固定值;2:固定公式计算;3:自定义公式计算;4:每月手动导入] int rule = 0;//规则状态[0:系统自动提取;1:系统固定值;2:固定公式计算;3:自定义公式计算;4:每月手动导入]
if(term[a].getOptitemid() == 1) {//人事信息 if(term[a].getOptitemid() == 1) {//人事信息
...@@ -1661,6 +1661,7 @@ public class SalaryManagementController { ...@@ -1661,6 +1661,7 @@ public class SalaryManagementController {
double secretary_ling = 0;//司龄 double secretary_ling = 0;//司龄
double grsb = 0;//个人社保 double grsb = 0;//个人社保
double grgjj = 0;//个人公积金 double grgjj = 0;//个人公积金
double net_salary = 0;//实发工资
//薪资组内成员 //薪资组内成员
for(XcglAssoXzury pag : paygrlist) { for(XcglAssoXzury pag : paygrlist) {
...@@ -1699,9 +1700,9 @@ public class SalaryManagementController { ...@@ -1699,9 +1700,9 @@ public class SalaryManagementController {
XcglAssoXzb.builder().xzxjg(secretary_ling).build().update(new QueryWrapper<XcglAssoXzb>().lambda().eq(XcglAssoXzb::getXzxid, xzx.getId()).eq(XcglAssoXzb::getUserid, pag.getUserid())); XcglAssoXzb.builder().xzxjg(secretary_ling).build().update(new QueryWrapper<XcglAssoXzb>().lambda().eq(XcglAssoXzb::getXzxid, xzx.getId()).eq(XcglAssoXzb::getUserid, pag.getUserid()));
} }
//公式计算 个税 //公式计算
//(固定公式计算):迟到早退扣款、事假扣款、病假扣款、旷工扣款、司龄工资、应发工资、实发工资 //(固定公式计算):迟到早退扣款、事假扣款、病假扣款、旷工扣款、司龄工资、应发工资、实发工资
if(xzx.getRulestate().equals(2) || (xzx.getIsCustom() == 0 && xzx.getOptionid() == 69)) { if(xzx.getRulestate().equals(2)) {
double result = 0; double result = 0;
if(xzx.getIsCustom() == 0 && xzx.getOptionid() == 31) {//司龄工资 if(xzx.getIsCustom() == 0 && xzx.getOptionid() == 31) {//司龄工资
String formula = xzx.getGsgs();//#司龄#*100 String formula = xzx.getGsgs();//#司龄#*100
...@@ -1711,20 +1712,26 @@ public class SalaryManagementController { ...@@ -1711,20 +1712,26 @@ public class SalaryManagementController {
if(xzx.getIsCustom() == 0 && xzx.getOptionid() == 27) {//事假扣款 if(xzx.getIsCustom() == 0 && xzx.getOptionid() == 27) {//事假扣款
String formula = xzx.getGsgs();//#基本工资#/#应出勤天数#*#事假# #事假#*200 String formula = xzx.getGsgs();//#基本工资#/#应出勤天数#*#事假# #事假#*200
String qaz = formula.replace("#基本工资#", String.valueOf(base_pay)).replace("#应出勤天数#", String.valueOf(attendance_days)).replace("#事假#", String.valueOf(matter_leave)); String qaz = formula.replace("#基本工资#", String.valueOf(base_pay)).replace("#应出勤天数#", String.valueOf(attendance_days)).replace("#事假#", String.valueOf(matter_leave));
if(attendance_days > 0) {
result = Double.valueOf(String.valueOf(js.eval(qaz))); result = Double.valueOf(String.valueOf(js.eval(qaz)));
}
matter_leave_deduction = result; matter_leave_deduction = result;
} }
if(xzx.getIsCustom() == 0 && xzx.getOptionid() == 28) {//病假扣款 if(xzx.getIsCustom() == 0 && xzx.getOptionid() == 28) {//病假扣款
String formula = xzx.getGsgs();//#基本工资#/#应出勤天数#*#病假#*0.4 #病假#*100 String formula = xzx.getGsgs();//#基本工资#/#应出勤天数#*#病假#*0.4 #病假#*100
String qaz = formula.replace("#基本工资#", String.valueOf(base_pay)).replace("#应出勤天数#", String.valueOf(attendance_days)).replace("#病假#", String.valueOf(sick_leave)); String qaz = formula.replace("#基本工资#", String.valueOf(base_pay)).replace("#应出勤天数#", String.valueOf(attendance_days)).replace("#病假#", String.valueOf(sick_leave));
if(attendance_days > 0) {
result = Double.valueOf(String.valueOf(js.eval(qaz))); result = Double.valueOf(String.valueOf(js.eval(qaz)));
}
sick_leave_deduction = result; sick_leave_deduction = result;
} }
if(xzx.getIsCustom() == 0 && xzx.getOptionid() == 29) {//旷工扣款 if(xzx.getIsCustom() == 0 && xzx.getOptionid() == 29) {//旷工扣款
String formula = xzx.getGsgs();//#基本工资#/#应出勤天数#*#旷工天数#*3 #旷工天数#*100 String formula = xzx.getGsgs();//#基本工资#/#应出勤天数#*#旷工天数#*3 #旷工天数#*100
String qaz = formula.replace("#基本工资#", String.valueOf(base_pay)).replace("#应出勤天数#", String.valueOf(attendance_days)).replace("#旷工天数#", String.valueOf(absenteeism_days)); String qaz = formula.replace("#基本工资#", String.valueOf(base_pay)).replace("#应出勤天数#", String.valueOf(attendance_days)).replace("#旷工天数#", String.valueOf(absenteeism_days));
if(attendance_days > 0) {
result = SalaryTool.formatDouble(Double.valueOf(String.valueOf(js.eval(qaz)))); result = SalaryTool.formatDouble(Double.valueOf(String.valueOf(js.eval(qaz))));
} }
}
if(xzx.getIsCustom() == 0 && xzx.getOptionid() == 30) {//迟到早退扣款 if(xzx.getIsCustom() == 0 && xzx.getOptionid() == 30) {//迟到早退扣款
String qaz = ""; String qaz = "";
if(xzx.getGsid().equals(1)) { if(xzx.getGsid().equals(1)) {
...@@ -1739,14 +1746,63 @@ public class SalaryManagementController { ...@@ -1739,14 +1746,63 @@ public class SalaryManagementController {
} }
} }
if(xzx.getIsCustom() == 0 && xzx.getOptionid() == 48) {//应发工资 XcglAssoXzb.builder().xzxjg(result).build().update(new QueryWrapper<XcglAssoXzb>().lambda().eq(XcglAssoXzb::getXzxid, xzx.getId()).eq(XcglAssoXzb::getUserid, pag.getUserid()));
}
//应发工资
if(xzx.getRulestate().equals(2) && xzx.getIsCustom() == 0 && xzx.getOptionid() == 48) {
String formula = xzx.getGsgs();//#基本工资#+#岗位津贴#+#绩效奖金#+#业绩提成#+#税前补差#-#事假扣款#-#病假扣款# String formula = xzx.getGsgs();//#基本工资#+#岗位津贴#+#绩效奖金#+#业绩提成#+#税前补差#-#事假扣款#-#病假扣款#
String qaz = formula.replace("#基本工资#", String.valueOf(base_pay)).replace("#岗位津贴#", String.valueOf(post_allowance)).replace("#绩效奖金#", String.valueOf(achievement_bonus)) String qaz = formula.replace("#基本工资#", String.valueOf(base_pay)).replace("#岗位津贴#", String.valueOf(post_allowance)).replace("#绩效奖金#", String.valueOf(achievement_bonus))
.replace("#业绩提成#", String.valueOf(performance_commission)).replace("#税前补差#", String.valueOf(pre_taxmakediff)) .replace("#业绩提成#", String.valueOf(performance_commission)).replace("#税前补差#", String.valueOf(pre_taxmakediff))
.replace("#事假扣款#", String.valueOf(matter_leave_deduction)).replace("#病假扣款#", String.valueOf(sick_leave_deduction)); .replace("#事假扣款#", String.valueOf(matter_leave_deduction)).replace("#病假扣款#", String.valueOf(sick_leave_deduction));
result = SalaryTool.formatDouble(Double.valueOf(String.valueOf(js.eval(qaz)))); double result = SalaryTool.formatDouble(Double.valueOf(String.valueOf(js.eval(qaz))));
wages_payable = result; wages_payable = result;
XcglAssoXzb.builder().xzxjg(result).build().update(new QueryWrapper<XcglAssoXzb>().lambda().eq(XcglAssoXzb::getXzxid, xzx.getId()).eq(XcglAssoXzb::getUserid, pag.getUserid()));
}else if(xzx.getRulestate() == 3 && xzx.getIsCustom() == 0 && xzx.getOptionid() == 48) {//(自定义公式计算): 应发工资
double result = 0;
//计薪规则组项中自定义项
List<XcglAssoJsgzzx> zdyx = XcglAssoJsgzzx.builder().build().selectList(new QueryWrapper<XcglAssoJsgzzx>().lambda().eq(XcglAssoJsgzzx::getXzzid, calcomtiondto.getPay_group_id()).eq(XcglAssoJsgzzx::getIsCustom, 1));
String formula = xzx.getGsgs();//#基本工资#+#岗位津贴#+#绩效奖金#+#业绩提成#+#税前补差#-#事假扣款#-#病假扣款#?
String qaz = formula.replace("#基本工资#", String.valueOf(base_pay)).replace("#岗位津贴#", String.valueOf(post_allowance)).replace("#绩效奖金#", String.valueOf(achievement_bonus))
.replace("#业绩提成#", String.valueOf(performance_commission)).replace("#税前补差#", String.valueOf(pre_taxmakediff))
.replace("#事假扣款#", String.valueOf(matter_leave_deduction)).replace("#病假扣款#", String.valueOf(sick_leave_deduction));
for(XcglAssoJsgzzx zdy : zdyx) {
double custom_ = 0;//自定义
boolean status = qaz.contains("#"+zdy.getSalaryitem()+"#");//公式中是否存在自定义
if(status) {//存在
XcglAssoJsgzzx zdygsx = XcglAssoJsgzzx.builder().build().selectOne(new QueryWrapper<XcglAssoJsgzzx>().lambda().eq(XcglAssoJsgzzx::getRulestate, 4).eq(XcglAssoJsgzzx::getIsCustom, 1)
.eq(XcglAssoJsgzzx::getOptionid, 0).eq(XcglAssoJsgzzx::getSalaryitem, zdy.getSalaryitem()));
XcglAssoXzb xzb_custom = XcglAssoXzb.builder().build().selectOne(new QueryWrapper<XcglAssoXzb>().lambda().eq(XcglAssoXzb::getXzxid, zdygsx.getId()).eq(XcglAssoXzb::getUserid, pag.getUserid()));
custom_ = xzb_custom.getXzxjg();
qaz = qaz.replace("#"+zdy.getSalaryitem()+"#", String.valueOf(custom_));
} }
}
boolean status = qaz.contains("#");//再次确认公式中是否存在系统数据项
if(status) {
List<XcglAssoJsgzzx> system_zdyx = XcglAssoJsgzzx.builder().build().selectList(new QueryWrapper<XcglAssoJsgzzx>().lambda().eq(XcglAssoJsgzzx::getXzzid, calcomtiondto.getPay_group_id())
.eq(XcglAssoJsgzzx::getIsCustom, 0).ne(XcglAssoJsgzzx::getType, 1));
for(XcglAssoJsgzzx sys : system_zdyx) {
if(qaz.contains("#"+sys.getSalaryitem()+"#")) {
XcglAssoXzb xzb_custom = XcglAssoXzb.builder().build().selectOne(new QueryWrapper<XcglAssoXzb>().lambda().eq(XcglAssoXzb::getXzxid, sys.getId()).eq(XcglAssoXzb::getUserid, pag.getUserid()));
double custom_two = xzb_custom.getXzxjg();
qaz = qaz.replace("#"+sys.getSalaryitem()+"#", String.valueOf(custom_two));
}
}
}
if(!qaz.contains("#")) {
result = Double.valueOf(String.valueOf(js.eval(qaz)));
}else {
System.err.println(xzx.getOptionid() + ":"+qaz+"有误!!!");
}
wages_payable = result;
XcglAssoXzb.builder().xzxjg(result).build().update(new QueryWrapper<XcglAssoXzb>().lambda().eq(XcglAssoXzb::getXzxid, xzx.getId()).eq(XcglAssoXzb::getUserid, pag.getUserid()));
}
if(xzx.getIsCustom() == 0 && xzx.getOptionid() == 69) {//个税 if(xzx.getIsCustom() == 0 && xzx.getOptionid() == 69) {//个税
//个税计算 //个税计算
...@@ -1756,38 +1812,25 @@ public class SalaryManagementController { ...@@ -1756,38 +1812,25 @@ public class SalaryManagementController {
e.printStackTrace(); e.printStackTrace();
System.out.println("个税计算错误"); System.out.println("个税计算错误");
} }
result = personal_income_tax < 0 ? 0.0 : personal_income_tax; double result = personal_income_tax < 0 ? 0.0 : personal_income_tax;
XcglAssoXzb.builder().xzxjg(result).build().update(new QueryWrapper<XcglAssoXzb>().lambda().eq(XcglAssoXzb::getXzxid, xzx.getId()).eq(XcglAssoXzb::getUserid, pag.getUserid()));
} }
if(xzx.getIsCustom() == 0 && xzx.getOptionid() == 70) {//实发工资
//实发工资
if(xzx.getRulestate().equals(2) && xzx.getIsCustom() == 0 && xzx.getOptionid() == 70) {
String formula = xzx.getGsgs();//#应发工资#-#个人社保#-#个人公积金#-#个税# String formula = xzx.getGsgs();//#应发工资#-#个人社保#-#个人公积金#-#个税#
String qaz = formula.replace("#应发工资#", String.valueOf(wages_payable)).replace("#个人社保#", String.valueOf(grsb)).replace("#个人公积金#", String.valueOf(grgjj)).replace("#个税#", String.valueOf(personal_income_tax < 0 ? 0.0 : personal_income_tax)); String qaz = formula.replace("#应发工资#", String.valueOf(wages_payable)).replace("#个人社保#", String.valueOf(grsb)).replace("#个人公积金#", String.valueOf(grgjj)).replace("#个税#", String.valueOf(personal_income_tax < 0 ? 0.0 : personal_income_tax));
result = SalaryTool.formatDouble(Double.valueOf(String.valueOf(js.eval(qaz)))); double result = SalaryTool.formatDouble(Double.valueOf(String.valueOf(js.eval(qaz))));
} net_salary = result;
XcglAssoXzb.builder().xzxjg(result).build().update(new QueryWrapper<XcglAssoXzb>().lambda().eq(XcglAssoXzb::getXzxid, xzx.getId()).eq(XcglAssoXzb::getUserid, pag.getUserid())); XcglAssoXzb.builder().xzxjg(result).build().update(new QueryWrapper<XcglAssoXzb>().lambda().eq(XcglAssoXzb::getXzxid, xzx.getId()).eq(XcglAssoXzb::getUserid, pag.getUserid()));
} }else if(xzx.getRulestate().equals(3) && xzx.getIsCustom() == 0 && xzx.getOptionid() == 70) {
//(自定义公式计算): 应发工资、实发工资
if(xzx.getRulestate() == 3) {
double result = 0; double result = 0;
String qaz = "";
String formula = "";
//计薪规则组项中自定义项 //计薪规则组项中自定义项
List<XcglAssoJsgzzx> zdyx = XcglAssoJsgzzx.builder().build().selectList(new QueryWrapper<XcglAssoJsgzzx>().lambda().eq(XcglAssoJsgzzx::getXzzid, calcomtiondto.getPay_group_id()).eq(XcglAssoJsgzzx::getIsCustom, 1)); List<XcglAssoJsgzzx> zdyx = XcglAssoJsgzzx.builder().build().selectList(new QueryWrapper<XcglAssoJsgzzx>().lambda().eq(XcglAssoJsgzzx::getXzzid, calcomtiondto.getPay_group_id()).eq(XcglAssoJsgzzx::getIsCustom, 1));
if(xzx.getIsCustom() == 0 && xzx.getOptionid() == 48) {//应发工资 String formula = xzx.getGsgs();//#应发工资#-#个人社保#-#个人公积金#-#个税#
formula = xzx.getGsgs();//#基本工资#+#岗位津贴#+#绩效奖金#+#业绩提成#+#税前补差#-#事假扣款#-#病假扣款#? String qaz = formula.replace("#应发工资#", String.valueOf(wages_payable)).replace("#个人社保#", String.valueOf(grsb)).replace("#个人公积金#", String.valueOf(grgjj)).replace("#个税#", String.valueOf(personal_income_tax));
qaz = formula.replace("#基本工资#", String.valueOf(base_pay)).replace("#岗位津贴#", String.valueOf(post_allowance)).replace("#绩效奖金#", String.valueOf(achievement_bonus))
.replace("#业绩提成#", String.valueOf(performance_commission)).replace("#税前补差#", String.valueOf(pre_taxmakediff))
.replace("#事假扣款#", String.valueOf(matter_leave_deduction)).replace("#病假扣款#", String.valueOf(sick_leave_deduction));
}
if(xzx.getIsCustom() == 0 && xzx.getOptionid() == 70) {//实发工资
formula = xzx.getGsgs();//#应发工资#-#个人社保#-#个人公积金#-#个税#
qaz = formula.replace("#应发工资#", String.valueOf(wages_payable)).replace("#个人社保#", String.valueOf(grsb)).replace("#个人公积金#", String.valueOf(grgjj)).replace("#个税#", String.valueOf(personal_income_tax));
}
for(XcglAssoJsgzzx zdy : zdyx) { for(XcglAssoJsgzzx zdy : zdyx) {
double custom_ = 0;//自定义 double custom_ = 0;//自定义
...@@ -1797,7 +1840,7 @@ public class SalaryManagementController { ...@@ -1797,7 +1840,7 @@ public class SalaryManagementController {
.eq(XcglAssoJsgzzx::getOptionid, 0).eq(XcglAssoJsgzzx::getSalaryitem, zdy.getSalaryitem())); .eq(XcglAssoJsgzzx::getOptionid, 0).eq(XcglAssoJsgzzx::getSalaryitem, zdy.getSalaryitem()));
XcglAssoXzb xzb_custom = XcglAssoXzb.builder().build().selectOne(new QueryWrapper<XcglAssoXzb>().lambda().eq(XcglAssoXzb::getXzxid, zdygsx.getId()).eq(XcglAssoXzb::getUserid, pag.getUserid())); XcglAssoXzb xzb_custom = XcglAssoXzb.builder().build().selectOne(new QueryWrapper<XcglAssoXzb>().lambda().eq(XcglAssoXzb::getXzxid, zdygsx.getId()).eq(XcglAssoXzb::getUserid, pag.getUserid()));
custom_ = xzb_custom.getXzxjg(); custom_ = xzb_custom.getXzxjg();
qaz = formula.replace("#"+zdy.getSalaryitem()+"#", String.valueOf(custom_)); qaz = qaz.replace("#"+zdy.getSalaryitem()+"#", String.valueOf(custom_));
} }
} }
boolean status = qaz.contains("#");//再次确认公式中是否存在系统数据项 boolean status = qaz.contains("#");//再次确认公式中是否存在系统数据项
...@@ -1808,7 +1851,7 @@ public class SalaryManagementController { ...@@ -1808,7 +1851,7 @@ public class SalaryManagementController {
if(qaz.contains("#"+sys.getSalaryitem()+"#")) { if(qaz.contains("#"+sys.getSalaryitem()+"#")) {
XcglAssoXzb xzb_custom = XcglAssoXzb.builder().build().selectOne(new QueryWrapper<XcglAssoXzb>().lambda().eq(XcglAssoXzb::getXzxid, sys.getId()).eq(XcglAssoXzb::getUserid, pag.getUserid())); XcglAssoXzb xzb_custom = XcglAssoXzb.builder().build().selectOne(new QueryWrapper<XcglAssoXzb>().lambda().eq(XcglAssoXzb::getXzxid, sys.getId()).eq(XcglAssoXzb::getUserid, pag.getUserid()));
double custom_two = xzb_custom.getXzxjg(); double custom_two = xzb_custom.getXzxjg();
qaz = formula.replace("#"+sys.getSalaryitem()+"#", String.valueOf(custom_two)); qaz = qaz.replace("#"+sys.getSalaryitem()+"#", String.valueOf(custom_two));
} }
} }
} }
...@@ -1818,12 +1861,28 @@ public class SalaryManagementController { ...@@ -1818,12 +1861,28 @@ public class SalaryManagementController {
}else { }else {
System.err.println(xzx.getOptionid() + ":"+qaz+"有误!!!"); System.err.println(xzx.getOptionid() + ":"+qaz+"有误!!!");
} }
net_salary = result;
XcglAssoXzb.builder().xzxjg(result).build().update(new QueryWrapper<XcglAssoXzb>().lambda().eq(XcglAssoXzb::getXzxid, xzx.getId()).eq(XcglAssoXzb::getUserid, pag.getUserid())); XcglAssoXzb.builder().xzxjg(result).build().update(new QueryWrapper<XcglAssoXzb>().lambda().eq(XcglAssoXzb::getXzxid, xzx.getId()).eq(XcglAssoXzb::getUserid, pag.getUserid()));
} }
}//存在的计薪规则组项数据对应 写入薪资表 --结束 }//存在的计薪规则组项数据对应 写入薪资表 --结束
XcglAssoGztzt.builder().build().delete(new QueryWrapper<XcglAssoGztzt>().lambda().eq(XcglAssoGztzt::getUserid, pag.getUserid()).eq(XcglAssoGztzt::getXzyf, salary_month)
.eq(XcglAssoGztzt::getQyid, orgcode));
//xcgl_asso_gztzt
XcglAssoGztzt gzt = XcglAssoGztzt.builder().build();
gzt.setUserid(pag.getUserid());
gzt.setXzyf(salary_month);//薪资月
gzt.setFsType(0);
gzt.setCkType(0);
gzt.setQrType(0);
gzt.setFkyj(null);
gzt.setYhqm(null);
gzt.setSfgz(net_salary);
gzt.setQyid(orgcode);
gzt.insert();
}//薪资组内成员--结束 }//薪资组内成员--结束
return ResultUtil.data(null, "计算完成"); return ResultUtil.data(null, "计算完成");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment