Commit fc4b1b5e by ilal Committed by chenzg

提交

parent 045629c3
......@@ -752,5 +752,15 @@ public class ClockInTool {
cst = simpleDateFormat.format(date2);
return cst;
}
/**
* Sun Nov 01 00:00:00 CST 2020
*/
public static String SunNovCSTYMD(Date date2){
String cst;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
cst = simpleDateFormat.format(date2);
return cst;
}
}
......@@ -1242,12 +1242,16 @@ public class SalaryManagementController {
@ApiOperation(value = "每月手动导入所需导出的表头数据", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> MonthlyManualImport(@CurrentUser UserBean userBean,@PathVariable Integer id) {
FloatingDataDto data = new FloatingDataDto();
//rulestate:规则状态[0:系统自动提取;1:系统固定值;2:固定公式计算;3:自定义公式计算;4:每月自动导入]
List<XcglAssoJsgzzx> jsgzzx = XcglAssoJsgzzx.builder().build().selectList(new QueryWrapper<XcglAssoJsgzzx>().lambda().eq(XcglAssoJsgzzx::getXzzid, id)
.eq(XcglAssoJsgzzx::getRulestate, 4));
data.setJsgzzx(jsgzzx);
List<UserPersonnelDto> sonn = xcglassoxzbmapper.UserPersonnel(id, userBean.getOrgCode());
data.setUsers(sonn);
return ResultUtil.data(jsgzzx);
return ResultUtil.data(data);
}
/**
......@@ -1693,8 +1697,9 @@ public class SalaryManagementController {
* @param wages_payable 应发工资
* @return
*/
public double CalculationOfIndividualIncomeTax(String gsus,String salary_month,int orgcode,int wages_payable) {
public double CalculationOfIndividualIncomeTax(String gsus,String salary_month,int orgcode,double wages_payable) {
double personalincome = 0;
String strY = new SimpleDateFormat("yyyy").format(new Date());
//当月个税存在则直接获取 无则根据计算薪资月的上月个税为基准计算
XcglAssoGsjsmx dyxzgs = XcglAssoGsjsmx.builder().build().selectOne(new QueryWrapper<XcglAssoGsjsmx>().lambda().eq(XcglAssoGsjsmx::getUserNum, gsus).eq(XcglAssoGsjsmx::getQyid, orgcode)
.eq(XcglAssoGsjsmx::getSalaryMonth, salary_month));
......@@ -1729,9 +1734,6 @@ public class SalaryManagementController {
}
//asdasds
gsmx.setTaxMonth(taxmonth);//税款所属月份
// gsmx.setThmonthPersonal(thmonthPersonal);//本月个税
// gsmx.setCumZljy(zxf == null ? 0 : zxf.getChildrenedu());//累计子女教育
......@@ -1741,10 +1743,33 @@ public class SalaryManagementController {
// gsmx.setCumJxjy(zxf == null ? 0 : zxf.getContinueedu());//累计继续教育
// gsmx.setCumZxfjkc(zxf == null ? 0 : zxf.getTotalmoney());//累计专项附加扣除
// gsmx.setTaxType("工资薪金所得");//计税类型
// gsmx.setCurrentIncome(currentIncome);//本期收入 【应发工资】
// gsmx.setCurrentIncome(wages_payable);//本期收入 【应发工资】
// gsmx.setCurrentSpecialDeduction(currentSpecialDeduction);//本期专项扣除 【个人的社保公积金缴纳扣除】
// gsmx.setCumSre(cumSre);//累计收入额 【本期收入+累计收入额(上月)】
// gsmx.setCumJcfy(cumJcfy);//累计减除费用 【5000*在职月份数】
//
// double cumjcfy = 0;
// int xcy = 0;
// YgglMainEmp xzrz = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, gsus).eq(YgglMainEmp::getOrgCode, orgcode));
// if(xzrz != null) {
// String entry_date = ClockInTool.SunNovCSTYMD(xzrz.getRzTime());//yyyyMMdd
// if(bssz.getTaxReturnCycle().equals(1)) {//当月报税
// if(entry_date.substring(0,4).equals(strY)) {//判断是否是本年
// xcy = SalaryTool.getMonthDiff(entry_date, salary_month+"-01");
// }else {
// xcy = SalaryTool.getMonthDiff(strY+"-01-01", salary_month+"-01");
// }
// cumjcfy = xcy*5000;
// }else {//次月报税
// if(entry_date.substring(0,4).equals(strY)) {//判断是否是本年
// xcy = SalaryTool.getMonthDiff(entry_date, salary_month+"-01")+1;
// }else {
// xcy = SalaryTool.getMonthDiff(strY+"-01-01", salary_month+"-01")+1;
// }
// cumjcfy = xcy*5000;
// }
// }
// gsmx.setCumJcfy(cumjcfy);//累计减除费用 【5000*在职月份数】
//
// gsmx.setCumZxkc(cumZxkc);//累计专项扣除 【本期专项扣除+累计专项扣除(上月)】
// gsmx.setCumQtkc(cumQtkc);//累计其他扣除 【本期其他扣除+累计其他扣除(上月)】
// gsmx.setCumYnssde(cumYnssde);//累计应纳税所得额 【累计收入额-累计减除费用-累计专项扣除-累计专项附加扣除-累计其他扣除】
......@@ -1753,7 +1778,7 @@ public class SalaryManagementController {
// gsmx.setCumYnse(cumYnse);//累计应纳税额 【累计应纳税所得额*税率-速算扣除数】
// gsmx.setCumYyjse(cumYyjse);//累计已预缴纳税额 【累计已预缴税额(上月)+累计应补(退)税额(上月)】
// gsmx.setCumYbtse(cumYbtse);//累计应补(退)税额(本月个税) 【累计应纳税额-累计已预缴纳税额】
// gsmx.setQyid(userBean.getOrgCode());//企业id
gsmx.setQyid(orgcode);//企业id
gsmx.insert();
}
......
......@@ -10,6 +10,42 @@ public class SalaryTool {
static SimpleDateFormat mat = new SimpleDateFormat("yyyy-MM-dd");
static SimpleDateFormat matM = new SimpleDateFormat("yyyy-MM");
/**
* 获取两个日期相差的月数
* @param d2 较大的日期
* @param d1 较小的日期
* @return 如果d1>d2返回 月数差 否则返回0
*/
public static int getMonthDiff(String d1, String d2)throws ParseException {
Calendar c1 = Calendar.getInstance();
Calendar c2 = Calendar.getInstance();
//将String日期转换成date
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
java.util.Date date1=sdf.parse(d1);
java.util.Date date2=sdf.parse(d2);
c1.setTime(date1);
c2.setTime(date2);
//判断两个日期的大小
if(c2.getTimeInMillis() < c1.getTimeInMillis()) return 0;
int year1 = c1.get(Calendar.YEAR);
int year2 = c2.get(Calendar.YEAR);
int month1 = c1.get(Calendar.MONTH);
int month2 = c2.get(Calendar.MONTH);
int day1 = c1.get(Calendar.DAY_OF_MONTH);
int day2 = c2.get(Calendar.DAY_OF_MONTH);
// 获取年的差值 假设 d1 = 2015-9-30 d2 = 2015-12-16
int yearInterval = year2 - year1;
// 如果 d1的 月-日 小于 d2的 月-日 那么 yearInterval-- 这样就得到了相差的年数
if(month2 < month1 || month1 == month2 && day2 < day1) yearInterval --;
// 获取月数差值
int monthInterval = (month2 + 12) - month1 ;
if(day2 > day1) monthInterval ++;
monthInterval %= 12;
return yearInterval * 12 + monthInterval + 1;
}
public static Date strToDateLong(String strDate) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
ParsePosition pos = new ParsePosition(0);
......
package cn.timer.api.dao.xcgl;
import java.util.List;
import cn.timer.api.dto.xcgl.CheckSalaryStaffDto;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......@@ -9,6 +8,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.xcgl.XcglAssoXzb;
import cn.timer.api.dto.xcgl.CalculationDto;
import cn.timer.api.dto.xcgl.CalculationValueDto;
import cn.timer.api.dto.xcgl.CheckSalaryStaffDto;
import cn.timer.api.dto.xcgl.UserPersonnelDto;
/**
* 薪资表
......@@ -40,4 +41,6 @@ public interface XcglAssoXzbMapper extends BaseMapper<XcglAssoXzb> {
int NumberOvertime(int orgcode,String apptime,int userid);
int PeriodsOvertime(int orgcode,String apptime,int overtimetypeid,int userid);
List<UserPersonnelDto> UserPersonnel(int xzzid,int orgcode);
}
package cn.timer.api.dto.xcgl;
import java.util.List;
import cn.timer.api.bean.xcgl.XcglAssoJsgzzx;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class FloatingDataDto {
List<UserPersonnelDto> users;
List<XcglAssoJsgzzx> jsgzzx;
}
package cn.timer.api.dto.xcgl;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserPersonnelDto {
String orgcode;
int empnum;
String empname;
String dept;//部门
String post;//职位
}
......@@ -34,6 +34,14 @@
<result column="xzxid" property="xzxid"/>
<result column="xzxjg" property="xzxjg"/>
</resultMap>
<resultMap id="UserPersonnelDtoMap" type="cn.timer.api.dto.xcgl.UserPersonnelDto" >
<result column="orgcode" property="orgcode" />
<result column="empnum" property="empnum" />
<result column="empname" property="empname" />
<result column="dept" property="dept" />
<result column="post" property="post" />
</resultMap>
<sql id="Base_Column_List">
id,
......@@ -53,6 +61,23 @@
qyid XcglAssoXzb_qyid
</sql>
<select id="UserPersonnel" resultMap="UserPersonnelDtoMap">
select aa.orgcode,aa.empnum,aa.empname,aa.dept,aa.post
from (select emp.org_code as orgcode,
emp.emp_num as empnum,
emp.`name` as empname,
bmgw.dept,
bmgw.post
from yggl_main_emp emp
LEFT JOIN (select m.name as post,um.name as dept,m.id as mid
from zzgl_bmgw_m m
left join zzgl_bmgw_m um on um.id = m.up_id
) as bmgw on bmgw.mid = emp.bmgw_id
where emp.emp_num in (select xzury.userid from xcgl_asso_xzury xzury where xzury.xzzid = #{xzzid})
) as aa
where aa.orgcode = #{orgcode}
</select>
<select id="Holidayamount">
select IFNULL(SUM(su.duration),0)
from kqgl_asso_relation_summary su
......
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