Commit 1a1d630e by ilal Committed by chenzg

提交

parent 5fd15657
...@@ -87,4 +87,7 @@ public class XcglAssoJsgzzx extends Model<XcglAssoJsgzzx> { ...@@ -87,4 +87,7 @@ public class XcglAssoJsgzzx extends Model<XcglAssoJsgzzx> {
@ApiModelProperty(value="是否自定义项(0:否;1:是)",example="0") @ApiModelProperty(value="是否自定义项(0:否;1:是)",example="0")
private Integer isCustom; private Integer isCustom;
@ApiModelProperty(value="薪资档案自定义id",example="0")
private Integer xzdazdyid;
} }
\ No newline at end of file
...@@ -1264,6 +1264,13 @@ public class SalaryManagementController { ...@@ -1264,6 +1264,13 @@ public class SalaryManagementController {
zzx.setGsid(0);//公式id 0:未关联规则 zzx.setGsid(0);//公式id 0:未关联规则
zzx.setGsgs("从薪资档案-"+term[a].getOptname()+"自动提取数据");//公式格式 系统提供/自定义公式 zzx.setGsgs("从薪资档案-"+term[a].getOptname()+"自动提取数据");//公式格式 系统提供/自定义公式
zzx.setRulestate(1);//规则状态[0:系统自动提取;1:系统固定值;2:固定公式计算;3:自定义公式计算;4:每月自动导入] zzx.setRulestate(1);//规则状态[0:系统自动提取;1:系统固定值;2:固定公式计算;3:自定义公式计算;4:每月自动导入]
XcglAssoXzdazdy xzd = XcglAssoXzdazdy.builder().build().selectOne(new QueryWrapper<XcglAssoXzdazdy>().lambda().eq(XcglAssoXzdazdy::getQyid, userBean.getOrgCode())
.eq(XcglAssoXzdazdy::getZdmc, term[a].getOptname()));
int xzdazdyid = 0;
if(xzd != null) {
xzdazdyid = xzd.getId();
}
zzx.setXzdazdyid(xzdazdyid);
}else {// }else {//
String xxs = "自动提取数据"; String xxs = "自动提取数据";
String[] strxz = {"从人事花名册-","从月度汇总-","从社保账单-"}; String[] strxz = {"从人事花名册-","从月度汇总-","从社保账单-"};
...@@ -1286,6 +1293,8 @@ public class SalaryManagementController { ...@@ -1286,6 +1293,8 @@ public class SalaryManagementController {
zzx.setGsid(0);//公式id 0:未关联规则 zzx.setGsid(0);//公式id 0:未关联规则
zzx.setGsgs(describe);//公式格式 系统提供/自定义公式 zzx.setGsgs(describe);//公式格式 系统提供/自定义公式
zzx.setRulestate(rule);//规则状态[0:系统自动提取;1:系统固定值;2:固定公式计算;3:自定义公式计算;4:每月自动导入] zzx.setRulestate(rule);//规则状态[0:系统自动提取;1:系统固定值;2:固定公式计算;3:自定义公式计算;4:每月自动导入]
zzx.setXzdazdyid(0);
} }
} }
if(term[a].getOptitemid() != 0) { if(term[a].getOptitemid() != 0) {
...@@ -1312,7 +1321,7 @@ public class SalaryManagementController { ...@@ -1312,7 +1321,7 @@ public class SalaryManagementController {
} }
} }
if(gzzxlist.size() > 0) { if(gzzxlist.size() > 0) {
xcglassojsgzzxmapper.insertxcglassojsgzzxList(gzzxlist); xcglassojsgzzxmapper.insertxcglassojsgzzxListTwo(gzzxlist);
} }
return new ResponseResult().success("创建薪资组成功", gzzxlist); return new ResponseResult().success("创建薪资组成功", gzzxlist);
} }
...@@ -1935,15 +1944,15 @@ public class SalaryManagementController { ...@@ -1935,15 +1944,15 @@ public class SalaryManagementController {
String formula = xzx.getGsgs();//#基本工资#/#应出勤天数#*#事假天数# String formula = xzx.getGsgs();//#基本工资#/#应出勤天数#*#事假天数#
if(xzx.getGsid() == 3) {//事假天数 if(xzx.getGsid() == 3) {//事假天数
matter_leave = SalaryTool.formatDouble_(matter_leave/prescription);//转化天数 matter_leave = matter_leave/prescription;//转化天数
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) { if(attendance_days > 0) {
result = Double.valueOf(String.valueOf(js.eval(qaz))); result = SalaryTool.formatDouble_(Double.valueOf(String.valueOf(js.eval(qaz))));
} }
}else if(xzx.getGsid() == 4) {//事假次数 #事假次数#*200 }else if(xzx.getGsid() == 4) {//事假次数 #事假次数#*200
String qaz = formula.replace("#事假次数#", String.valueOf(matter_leave_num)); String qaz = formula.replace("#事假次数#", String.valueOf(matter_leave_num));
if(attendance_days > 0) { if(attendance_days > 0) {
result = Double.valueOf(String.valueOf(js.eval(qaz))); result = SalaryTool.formatDouble_(Double.valueOf(String.valueOf(js.eval(qaz))));
} }
} }
...@@ -1953,15 +1962,15 @@ public class SalaryManagementController { ...@@ -1953,15 +1962,15 @@ public class SalaryManagementController {
String formula = xzx.getGsgs();//#基本工资#/#应出勤天数#*#病假天数#*0.4 String formula = xzx.getGsgs();//#基本工资#/#应出勤天数#*#病假天数#*0.4
if(xzx.getGsid() == 5) {//病假天数 if(xzx.getGsid() == 5) {//病假天数
sick_leave = SalaryTool.formatDouble_(sick_leave/prescription);//转化天数 sick_leave = sick_leave/prescription;//转化天数
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) { if(attendance_days > 0) {
result = Double.valueOf(String.valueOf(js.eval(qaz))); result = SalaryTool.formatDouble_(Double.valueOf(String.valueOf(js.eval(qaz))));
} }
}else if(xzx.getGsid() == 6) {//病假次数 #病假次数#*100 }else if(xzx.getGsid() == 6) {//病假次数 #病假次数#*100
String qaz = formula.replace("#病假次数#", String.valueOf(sick_leave_num)); String qaz = formula.replace("#病假次数#", String.valueOf(sick_leave_num));
if(attendance_days > 0) { if(attendance_days > 0) {
result = Double.valueOf(String.valueOf(js.eval(qaz))); result = SalaryTool.formatDouble_(Double.valueOf(String.valueOf(js.eval(qaz))));
} }
} }
...@@ -1984,7 +1993,7 @@ public class SalaryManagementController { ...@@ -1984,7 +1993,7 @@ public class SalaryManagementController {
qaz = formula.replace("#迟到时长#", String.valueOf(late_sc)).replace("#早退时长数#", String.valueOf(leave_early_sc)); qaz = formula.replace("#迟到时长#", String.valueOf(late_sc)).replace("#早退时长数#", String.valueOf(leave_early_sc));
} }
if(!("").equals(qaz)) { if(!("").equals(qaz)) {
result = Double.valueOf(String.valueOf(js.eval(qaz))); result = SalaryTool.formatDouble_(Double.valueOf(String.valueOf(js.eval(qaz))));
} }
} }
...@@ -2035,7 +2044,7 @@ public class SalaryManagementController { ...@@ -2035,7 +2044,7 @@ public class SalaryManagementController {
} }
if(!qaz.contains("#")) { if(!qaz.contains("#")) {
result = Double.valueOf(String.valueOf(js.eval(qaz))); result = SalaryTool.formatDouble_(Double.valueOf(String.valueOf(js.eval(qaz))));
}else { }else {
System.err.println(xzx.getOptionid() + ":"+qaz+"有误!!!"); System.err.println(xzx.getOptionid() + ":"+qaz+"有误!!!");
} }
...@@ -2099,7 +2108,7 @@ public class SalaryManagementController { ...@@ -2099,7 +2108,7 @@ public class SalaryManagementController {
} }
if(!qaz.contains("#")) { if(!qaz.contains("#")) {
result = Double.valueOf(String.valueOf(js.eval(qaz))); result = SalaryTool.formatDouble_(Double.valueOf(String.valueOf(js.eval(qaz))));
}else { }else {
System.err.println(xzx.getOptionid() + ":"+qaz+"有误!!!"); System.err.println(xzx.getOptionid() + ":"+qaz+"有误!!!");
} }
...@@ -2187,23 +2196,24 @@ public class SalaryManagementController { ...@@ -2187,23 +2196,24 @@ public class SalaryManagementController {
gsmx.setCurrentSpecialDeduction(cuspde == null ? 0 : Double.valueOf(cuspde.getGrjltotal()));//本期专项扣除 【个人的社保公积金缴纳扣除】 gsmx.setCurrentSpecialDeduction(cuspde == null ? 0 : Double.valueOf(cuspde.getGrjltotal()));//本期专项扣除 【个人的社保公积金缴纳扣除】
gsmx.setCumSre(wages_payable+(sygs == null ? 0 : sygs.getCumSre()));//累计收入额 【本期收入+累计收入额(上月)】 gsmx.setCumSre(wages_payable+(sygs == null ? 0 : sygs.getCumSre()));//累计收入额 【本期收入+累计收入额(上月)】
double cumjcfy = 0; double cumjcfy = 0;
if(sygs.getCumJcfy() > 0) { if(sygs != null && sygs.getCumJcfy() > 0) {
cumjcfy = sygs.getCumJcfy() + 5000; cumjcfy = sygs.getCumJcfy() + 5000;
}else { }else {
int xcy = 0; int xcy = 0;
YgglMainEmp xzrz = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, gsus).eq(YgglMainEmp::getOrgCode, orgcode)); YgglMainEmp xzrz = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, gsus).eq(YgglMainEmp::getOrgCode, orgcode));
if(xzrz != null) { if(xzrz != null) {
String entry_date = ClockInTool.SunNovCSTYMD(xzrz.getRzTime());//yyyyMMdd // String entry_date = ClockInTool.SunNovCSTYMD(xzrz.getRzTime());//yyyyMMdd
String entry_date = ClockInTool.SunNovCSTYM(xzrz.getRzTime());//yyyyMM
if(bssz.getTaxReturnCycle().equals(1)) {//当月报税 if(bssz.getTaxReturnCycle().equals(1)) {//当月报税
if(entry_date.substring(0,4).equals(strY)) {//判断是否是本年 if(entry_date.substring(0,4).equals(strY)) {//判断是否是本年
xcy = SalaryTool.getMonthDiff(entry_date, salary_month+"-01"); xcy = SalaryTool.getMonthDiff(entry_date+"-01", salary_month+"-01");
}else { }else {
xcy = SalaryTool.getMonthDiff(strY+"-01-01", salary_month+"-01"); xcy = SalaryTool.getMonthDiff(strY+"-01-01", salary_month+"-01");
} }
cumjcfy = xcy*5000; cumjcfy = xcy*5000;
}else {//次月报税 }else {//次月报税
if(entry_date.substring(0,4).equals(strY)) {//判断是否是本年 if(entry_date.substring(0,4).equals(strY)) {//判断是否是本年
xcy = SalaryTool.getMonthDiff(entry_date, salary_month+"-01")+1; xcy = SalaryTool.getMonthDiff(entry_date+"-01", salary_month+"-01")+1;
}else { }else {
xcy = SalaryTool.getMonthDiff(strY+"-01-01", salary_month+"-01")+1; xcy = SalaryTool.getMonthDiff(strY+"-01-01", salary_month+"-01")+1;
} }
...@@ -2218,7 +2228,7 @@ public class SalaryManagementController { ...@@ -2218,7 +2228,7 @@ public class SalaryManagementController {
double cumynssde = 0; double cumynssde = 0;
cumynssde = gsmx.getCumSre() - cumjcfy - gsmx.getCumZxkc() - gsmx.getCumZxfjkc() - gsmx.getCumQtkc(); cumynssde = gsmx.getCumSre() - cumjcfy - gsmx.getCumZxkc() - gsmx.getCumZxfjkc() - gsmx.getCumQtkc();
gsmx.setCumYnssde(cumynssde);//累计应纳税所得额 【累计收入额-累计减除费用-累计专项扣除-累计专项附加扣除-累计其他扣除】 gsmx.setCumYnssde(SalaryTool.formatDouble_(cumynssde));//累计应纳税所得额 【累计收入额-累计减除费用-累计专项扣除-累计专项附加扣除-累计其他扣除】
String[] miscalculation = getPersonalincometax(cumynssde); String[] miscalculation = getPersonalincometax(cumynssde);
gsmx.setTaxRate(Double.valueOf(miscalculation[0]));//税率 gsmx.setTaxRate(Double.valueOf(miscalculation[0]));//税率
...@@ -2254,7 +2264,7 @@ public class SalaryManagementController { ...@@ -2254,7 +2264,7 @@ public class SalaryManagementController {
List<XcglAssoTaxFormula> taxratelist = XcglAssoTaxFormula.builder().build().selectList(new QueryWrapper<XcglAssoTaxFormula>().lambda().eq(XcglAssoTaxFormula::getQyid, 0)); List<XcglAssoTaxFormula> taxratelist = XcglAssoTaxFormula.builder().build().selectList(new QueryWrapper<XcglAssoTaxFormula>().lambda().eq(XcglAssoTaxFormula::getQyid, 0));
double personalIncomeTax=0;//个税 double personalIncomeTax=0;//个税
double money=36000;//应交税工资最低点 double money=36000;//应交税工资最低点
if(taxpayroll>money){//应交税 if(taxpayroll>0){//应交税
for (XcglAssoTaxFormula tax : taxratelist) {//计算个税 for (XcglAssoTaxFormula tax : taxratelist) {//计算个税
if(tax.getTaxablestart()<=taxpayroll&&taxpayroll<tax.getTaxableend()){ if(tax.getTaxablestart()<=taxpayroll&&taxpayroll<tax.getTaxableend()){
//个人所得税=计税工资*税率-速算扣除数 //个人所得税=计税工资*税率-速算扣除数
...@@ -2269,6 +2279,7 @@ public class SalaryManagementController { ...@@ -2269,6 +2279,7 @@ public class SalaryManagementController {
} }
} }
}else{ }else{
perinctax[0] = "0"; perinctax[0] = "0";
perinctax[1] = "0"; perinctax[1] = "0";
perinctax[2] = "0"; perinctax[2] = "0";
......
...@@ -31,4 +31,6 @@ public interface XcglAssoJsgzzxMapper extends BaseMapper<XcglAssoJsgzzx> { ...@@ -31,4 +31,6 @@ public interface XcglAssoJsgzzxMapper extends BaseMapper<XcglAssoJsgzzx> {
List<XcglAssoJsgzzx> selectSalarySectionList(int xzzid); List<XcglAssoJsgzzx> selectSalarySectionList(int xzzid);
List<XcglAssoJsgzzx> SalaryRuleGroupItem(int xzzid); List<XcglAssoJsgzzx> SalaryRuleGroupItem(int xzzid);
int insertxcglassojsgzzxListTwo(List<XcglAssoJsgzzx> xcglassojsgzzx);
} }
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
<result column="rulestate" property="rulestate" /> <result column="rulestate" property="rulestate" />
<result column="optionid" property="optionid" /> <result column="optionid" property="optionid" />
<result column="is_custom" property="isCustom" /> <result column="is_custom" property="isCustom" />
<result column="xzdazdyid" property="xzdazdyid" />
</resultMap> </resultMap>
...@@ -152,6 +153,62 @@ ...@@ -152,6 +153,62 @@
</foreach> </foreach>
</insert> </insert>
<insert id="insertxcglassojsgzzxListTwo" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id" >
insert into xcgl_asso_jsgzzx (salaryitem,yhmbzd,rule,type,addtime,adduserid,jxgzid,remarks,gsid,gsgs,dygk,degk,xzzid,rulestate,optionid,xzdazdyid)
<foreach collection="list" item="item" index="index" open="values " close="" separator=",">
(
<if test="item.salaryitem != null" >
#{item.salaryitem,jdbcType=VARCHAR},
</if>
<if test="item.yhmbzd != null" >
#{item.yhmbzd,jdbcType=VARCHAR},
</if>
<if test="item.rule != null" >
#{item.rule,jdbcType=VARCHAR},
</if>
<if test="item.type != null" >
#{item.type,jdbcType=INTEGER},
</if>
<if test="item.addtime != null" >
#{item.addtime,jdbcType=BIGINT},
</if>
<if test="item.adduserid != null" >
#{item.adduserid,jdbcType=INTEGER},
</if>
<if test="item.jxgzid != null" >
#{item.jxgzid,jdbcType=INTEGER},
</if>
<if test="item.remarks != null" >
#{item.remarks,jdbcType=VARCHAR},
</if>
<if test="item.gsid != null" >
#{item.gsid,jdbcType=INTEGER},
</if>
<if test="item.gsgs != null" >
#{item.gsgs,jdbcType=VARCHAR},
</if>
<if test="item.dygk != null" >
#{item.dygk,jdbcType=DOUBLE},
</if>
<if test="item.degk != null" >
#{item.degk,jdbcType=DOUBLE},
</if>
<if test="item.xzzid != null" >
#{item.xzzid,jdbcType=INTEGER},
</if>
<if test="item.rulestate != null" >
#{item.rulestate,jdbcType=INTEGER},
</if>
<if test="item.optionid != null" >
#{item.optionid,jdbcType=INTEGER},
</if>
<if test="item.xzdazdyid != null" >
#{item.xzdazdyid,jdbcType=INTEGER}
</if>
)
</foreach>
</insert>
<insert id="jsgzzxinsert" useGeneratedKeys="true" keyProperty="id" parameterType="cn.timer.api.bean.xcgl.XcglAssoJsgzzx"> <insert id="jsgzzxinsert" useGeneratedKeys="true" keyProperty="id" parameterType="cn.timer.api.bean.xcgl.XcglAssoJsgzzx">
INSERT INTO xcgl_asso_jsgzzx INSERT INTO xcgl_asso_jsgzzx
......
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