Commit 2a5d4cca by ilal Committed by chenzg

临时提交

parent 493cda44
...@@ -15,10 +15,16 @@ import javax.script.ScriptEngine; ...@@ -15,10 +15,16 @@ import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager; import javax.script.ScriptEngineManager;
import javax.script.ScriptException; import javax.script.ScriptException;
import cn.timer.api.dto.xcgl.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -34,6 +40,7 @@ import cn.timer.api.bean.kqgl.PunchRecord; ...@@ -34,6 +40,7 @@ import cn.timer.api.bean.kqgl.PunchRecord;
import cn.timer.api.bean.kqgl.Schedule; import cn.timer.api.bean.kqgl.Schedule;
import cn.timer.api.bean.kqgl.SpecialDate; import cn.timer.api.bean.kqgl.SpecialDate;
import cn.timer.api.bean.kqmk.KqglAssoMonthPunchSummary; import cn.timer.api.bean.kqmk.KqglAssoMonthPunchSummary;
import cn.timer.api.bean.kqmk.KqglAssoRelationSummary;
import cn.timer.api.bean.sbgjj.SbgjjAssoDetailed; import cn.timer.api.bean.sbgjj.SbgjjAssoDetailed;
import cn.timer.api.bean.sbgjj.SbgjjAssoYjzd; import cn.timer.api.bean.sbgjj.SbgjjAssoYjzd;
import cn.timer.api.bean.xcgl.XcglAdminXzz; import cn.timer.api.bean.xcgl.XcglAdminXzz;
...@@ -64,6 +71,7 @@ import cn.timer.api.dao.kqgl.PunchRecordMapper; ...@@ -64,6 +71,7 @@ import cn.timer.api.dao.kqgl.PunchRecordMapper;
import cn.timer.api.dao.kqgl.ScheduleMapper; import cn.timer.api.dao.kqgl.ScheduleMapper;
import cn.timer.api.dao.kqgl.SpecialDateMapper; import cn.timer.api.dao.kqgl.SpecialDateMapper;
import cn.timer.api.dao.kqmk.KqglAssoMonthPunchSummaryMapper; import cn.timer.api.dao.kqmk.KqglAssoMonthPunchSummaryMapper;
import cn.timer.api.dao.kqmk.KqglAssoRelationSummaryMapper;
import cn.timer.api.dao.sbgjj.SbgjjAssoDetailedMapper; import cn.timer.api.dao.sbgjj.SbgjjAssoDetailedMapper;
import cn.timer.api.dao.sbgjj.SbgjjAssoYjzdMapper; import cn.timer.api.dao.sbgjj.SbgjjAssoYjzdMapper;
import cn.timer.api.dao.xcgl.XcglAdminXzzMapper; import cn.timer.api.dao.xcgl.XcglAdminXzzMapper;
...@@ -84,6 +92,51 @@ import cn.timer.api.dao.xcgl.XcglSalaryItemMapper; ...@@ -84,6 +92,51 @@ import cn.timer.api.dao.xcgl.XcglSalaryItemMapper;
import cn.timer.api.dao.yggl.YgglMainEmpMapper; import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dto.kqmk.CalculatingCompensationDto; import cn.timer.api.dto.kqmk.CalculatingCompensationDto;
import cn.timer.api.dto.sbgjj.InspersonnelDto; import cn.timer.api.dto.sbgjj.InspersonnelDto;
import cn.timer.api.dto.xcgl.AdditionalDeductionDto;
import cn.timer.api.dto.xcgl.AppPaysSalaryOneDto;
import cn.timer.api.dto.xcgl.AppPaysSalaryTwoDto;
import cn.timer.api.dto.xcgl.AppPayslipDetailsDto;
import cn.timer.api.dto.xcgl.BuildPayGroupDto;
import cn.timer.api.dto.xcgl.CalculatedFieldDto;
import cn.timer.api.dto.xcgl.CalculationDto;
import cn.timer.api.dto.xcgl.CalculationOptionsDto;
import cn.timer.api.dto.xcgl.ChangeSalaryDto;
import cn.timer.api.dto.xcgl.CheckSalaryStaffDto;
import cn.timer.api.dto.xcgl.CjPayrollGroupDto;
import cn.timer.api.dto.xcgl.CustomDto;
import cn.timer.api.dto.xcgl.FixedSalaryStaffDto;
import cn.timer.api.dto.xcgl.FixedsalaryDto;
import cn.timer.api.dto.xcgl.FloatingDataDto;
import cn.timer.api.dto.xcgl.HolidayInquiryDto;
import cn.timer.api.dto.xcgl.ImportDescriptionDto;
import cn.timer.api.dto.xcgl.ImportSalaryDto;
import cn.timer.api.dto.xcgl.ImportSalarySetDto;
import cn.timer.api.dto.xcgl.IndividualTaxDetailsDto;
import cn.timer.api.dto.xcgl.ModifyPayslipDto;
import cn.timer.api.dto.xcgl.ModifysalaryruleDto;
import cn.timer.api.dto.xcgl.PayCustomDto;
import cn.timer.api.dto.xcgl.PayCustomZDYDto;
import cn.timer.api.dto.xcgl.PayGroupedDataDto;
import cn.timer.api.dto.xcgl.PayTermDto;
import cn.timer.api.dto.xcgl.PayrollExceptionDto;
import cn.timer.api.dto.xcgl.PayrollGroupDto;
import cn.timer.api.dto.xcgl.PayslipDetailsDto;
import cn.timer.api.dto.xcgl.PayslipListDto;
import cn.timer.api.dto.xcgl.PayslipSearchDto;
import cn.timer.api.dto.xcgl.PushPayslipDto;
import cn.timer.api.dto.xcgl.SalaryCustomizationDto;
import cn.timer.api.dto.xcgl.SalaryFieldDto;
import cn.timer.api.dto.xcgl.SalaryGroupGroupingDto;
import cn.timer.api.dto.xcgl.SalaryItemRulesDto;
import cn.timer.api.dto.xcgl.SalaryRulesDto;
import cn.timer.api.dto.xcgl.SalaryoptionsDto;
import cn.timer.api.dto.xcgl.SearchSalariedPeopleDto;
import cn.timer.api.dto.xcgl.SpecialDeductionDto;
import cn.timer.api.dto.xcgl.TjSalaryItemDot;
import cn.timer.api.dto.xcgl.UserPersonnelDto;
import cn.timer.api.dto.xcgl.XcglAssoGsjsmxDto;
import cn.timer.api.dto.xcgl.XcglAssoOptionDto;
import cn.timer.api.dto.xcgl.YdMobilePacketDto;
import cn.timer.api.utils.DateUtil; import cn.timer.api.utils.DateUtil;
import cn.timer.api.utils.ResponseResult; import cn.timer.api.utils.ResponseResult;
import cn.timer.api.utils.Result; import cn.timer.api.utils.Result;
...@@ -2025,7 +2078,17 @@ public class SalaryManagementController { ...@@ -2025,7 +2078,17 @@ public class SalaryManagementController {
} }
@GetMapping(value = "/cycle")
@ApiOperation(value = "查询报税周期信息", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> cycle(@CurrentUser UserBean userBean) {
XcglAssoBszqsz bszq = XcglAssoBszqsz.builder().build().selectOne(new QueryWrapper<XcglAssoBszqsz>().lambda().eq(XcglAssoBszqsz::getQyid, userBean.getOrgCode()));
if(bszq == null) {
XcglAssoBszqsz.builder().taxReturnCycle(1).qyid(userBean.getOrgCode()).build().insert();
}
bszq = XcglAssoBszqsz.builder().build().selectOne(new QueryWrapper<XcglAssoBszqsz>().lambda().eq(XcglAssoBszqsz::getQyid, userBean.getOrgCode()));
return ResultUtil.data(bszq, "完成");
}
...@@ -3155,9 +3218,6 @@ public class SalaryManagementController { ...@@ -3155,9 +3218,6 @@ public class SalaryManagementController {
return ResultUtil.data(xcglassogsjsmx,"操作成功!"); return ResultUtil.data(xcglassogsjsmx,"操作成功!");
} }
/****************************************************************************/
/****************************************************************************/
/** /**
* 新增或编辑 * 新增或编辑
*/ */
...@@ -3193,4 +3253,158 @@ public class SalaryManagementController { ...@@ -3193,4 +3253,158 @@ public class SalaryManagementController {
xcglassogztztmapper.payslipSend(id, fsType); xcglassogztztmapper.payslipSend(id, fsType);
return new ResponseResult().success("成功"); return new ResponseResult().success("成功");
} }
/***************************APP*************************************************/
@GetMapping(value="/wageconfirmation/{id}")
@ApiOperation(value = "工资确认", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> WageConfirmation(@CurrentUser UserBean userBean,@PathVariable("id") Integer id) {
XcglAssoGztzt.builder().qrType(1).id(id).build().updateById();
return ResultUtil.success("成功");
}
@Autowired
private KqglAssoRelationSummaryMapper kqglassorelationsummarymapper;
@PostMapping(value = "/pushpayslip")
@ApiOperation(value = "发送工资条", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> PushPayslip(@CurrentUser UserBean userBean,@RequestBody PushPayslipDto pays) {
double prescription = 8;
//顶层
AppPayslipDetailsDto top = new AppPayslipDetailsDto();
//工资条数据
XcglAssoGztzt gzt = XcglAssoGztzt.builder().id(pays.getGztid()).build().selectById();
if(gzt != null) {
top.setId(gzt.getId());
top.setNetsalary(gzt.getSfgz());//实发工资
top.setWagetime(gzt.getXzyf());//工资时间
top.setUserid(gzt.getUserid());
top.setSfyqrgz(gzt.getQrType());
//薪资组里项
List<XcglAssoJsgzzx> jsgs = XcglAssoJsgzzx.builder().build().selectList(new QueryWrapper<XcglAssoJsgzzx>().lambda().eq(XcglAssoJsgzzx::getXzzid, pays.getXzzid()).eq(XcglAssoJsgzzx::getType, 2)
.orderByAsc(XcglAssoJsgzzx::getId));
//第一层集合
List<AppPaysSalaryOneDto> specific = new ArrayList<AppPaysSalaryOneDto>();
for(XcglAssoJsgzzx xzx : jsgs) {
//第二层集合
List<AppPaysSalaryTwoDto> detailed = new ArrayList<AppPaysSalaryTwoDto>();
//第一层
AppPaysSalaryOneDto spe = new AppPaysSalaryOneDto();
XcglAssoXzb xzb = XcglAssoXzb.builder().build().selectOne(new QueryWrapper<XcglAssoXzb>().lambda().eq(XcglAssoXzb::getUserid, pays.getUserid()).eq(XcglAssoXzb::getXzyf, pays.getXzyf())
.eq(XcglAssoXzb::getXzxid, xzx.getId()));
//事假扣款、病假扣款、旷工扣款、迟到早退扣款、司龄工资、个税
if(xzx.getOptionid() != 27 && xzx.getOptionid() != 28 && xzx.getOptionid() != 29 && xzx.getOptionid() != 30 && xzx.getOptionid() != 31 && xzx.getOptionid() != 69) {
spe.setItemname(xzx.getSalaryitem());//
spe.setDeduction(xzb == null ? 0 : xzb.getXzxjg());//
spe.setFieldone("");
spe.setFieldtwo("");
spe.setDetailed(detailed);
specific.add(spe);
}else {
//事假扣款
if(xzx.getOptionid() == 27) {
spe.setItemname(xzx.getSalaryitem());//
spe.setDeduction(xzb == null ? 0 : xzb.getXzxjg());//
HolidayInquiryDto balance = xcglassoxzbmapper.Holidayamount(userBean.getOrgCode(), pays.getXzyf(), 1, pays.getUserid());
double ts = 0;
if(balance.getBalance() > 0) {
ts = balance.getBalance()/prescription;
}
spe.setFieldone("共"+balance.getBalance()+"小时="+SalaryTool.formatDouble_(ts)+"天");
spe.setFieldtwo("");
//事假详细
List<KqglAssoRelationSummary> holdet = kqglassorelationsummarymapper.HolidayDetails(userBean.getOrgCode(), pays.getXzyf(), 1, pays.getUserid());
for(KqglAssoRelationSummary sjxx : holdet) {
AppPaysSalaryTwoDto two = new AppPaysSalaryTwoDto();
two.setTerm("事假日期");
two.setSpecifictime(sjxx.getStartTime().substring(5, 16)+"至"+sjxx.getEndTime().substring(5, 16));
two.setField(sjxx.getDuration());
detailed.add(two);
}
spe.setDetailed(detailed);
}
//病假扣款
if(xzx.getOptionid() == 28) {
spe.setItemname(xzx.getSalaryitem());//
spe.setDeduction(xzb == null ? 0 : xzb.getXzxjg());//
HolidayInquiryDto balance = xcglassoxzbmapper.Holidayamount(userBean.getOrgCode(), pays.getXzyf(), 3, pays.getUserid());
double ts = 0;
if(balance.getBalance() > 0) {
ts = balance.getBalance()/prescription;
}
spe.setFieldone("共"+balance.getBalance()+"小时="+SalaryTool.formatDouble_(ts)+"天");
spe.setFieldtwo("");
//病假详细
List<KqglAssoRelationSummary> holdet = kqglassorelationsummarymapper.HolidayDetails(userBean.getOrgCode(), pays.getXzyf(), 3, pays.getUserid());
for(KqglAssoRelationSummary sjxx : holdet) {
AppPaysSalaryTwoDto two = new AppPaysSalaryTwoDto();
two.setTerm("病假日期");
two.setSpecifictime(sjxx.getStartTime().substring(5, 16)+"至"+sjxx.getEndTime().substring(5, 16));
two.setField(sjxx.getDuration());
detailed.add(two);
}
spe.setDetailed(detailed);
}
//旷工扣款
if(xzx.getOptionid() == 29) {
spe.setItemname(xzx.getSalaryitem());//
spe.setDeduction(xzb == null ? 0 : xzb.getXzxjg());//
}
specific.add(spe);
}
top.setSpecific(specific);
}
}
return ResultUtil.data(top,"操作成功!");
}
} }
package cn.timer.api.controller.xcgl; package cn.timer.api.controller.xcgl;
import java.text.DecimalFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.ParsePosition; import java.text.ParsePosition;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
...@@ -18,6 +19,13 @@ public class SalaryTool { ...@@ -18,6 +19,13 @@ public class SalaryTool {
public static double formatDouble(double d) { public static double formatDouble(double d) {
return (double)Math.round(d*10000)/10000; return (double)Math.round(d*10000)/10000;
} }
public static double formatDouble_(double d) {
double zhi = 0;
DecimalFormat df = new DecimalFormat("0.00");
zhi = Double.valueOf(df.format(d));
return zhi;
}
/** /**
* 获取两个日期相差的月数 * 获取两个日期相差的月数
......
...@@ -28,4 +28,6 @@ public interface KqglAssoRelationSummaryMapper extends BaseMapper<KqglAssoRelati ...@@ -28,4 +28,6 @@ public interface KqglAssoRelationSummaryMapper extends BaseMapper<KqglAssoRelati
KqglAssoRelationSummary Businessdayclockin(int userid,int approvaltype,String apptime,int orgcode); KqglAssoRelationSummary Businessdayclockin(int userid,int approvaltype,String apptime,int orgcode);
List<KqglAssoRelationSummary> HolidayDetails(int orgcode,String apptime,int rules_type,int userid);
} }
package cn.timer.api.dto.xcgl;
import java.io.Serializable;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AppPaysSalaryOneDto implements Serializable{/**
*
*/
private static final long serialVersionUID = 193839030071552299L;
private String itemname;//基本工资、岗位津贴、事假、事假扣款......
private Double deduction;//扣款额
private String fieldone;//字段1(共2次、共11.5小时=1.44天)
private String fieldtwo;//字段2(共迟到8/分钟,早退20/分钟)
List<AppPaysSalaryTwoDto> detailed;
}
package cn.timer.api.dto.xcgl;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AppPaysSalaryTwoDto implements Serializable{/**
*
*/
private static final long serialVersionUID = 5773269251839518331L;
private String term;//早退时间、迟到时间....
private String specifictime;//时间 08:25
private Double field;//字段 8、3.5....
}
package cn.timer.api.dto.xcgl;
import java.io.Serializable;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AppPayslipDetailsDto implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1672310141723169753L;
private Integer id;// 工资条id
private Double netsalary;// 实发工资
private String wagetime;// 工资时间
private Integer userid;// 用户id
private Integer sfyqrgz;// 是否已确认工资
List<AppPaysSalaryOneDto> specific = null;
}
package cn.timer.api.dto.xcgl;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PushPayslipDto implements Serializable {
/**
*
*/
private static final long serialVersionUID = 6984424343409821996L;
private Integer gztid;//工资条id
private Integer xzzid;//薪资组id
private Integer userid;// 用户id
private String xzyf;// 薪资月份
}
...@@ -36,7 +36,17 @@ ...@@ -36,7 +36,17 @@
ordernum, ordernum,
totals totals
</sql> </sql>
<select id="HolidayDetails" resultMap="BaseResultMap">
select su.*
from kqgl_asso_relation_summary su
where su.approval_type = 2
and su.org_code = #{orgcode}
and su.ordernum = 1
and SUBSTR(su.app_time,1,7) = #{apptime}
and su.leave_type_id = (select ru.id from kqgl_asso_leave_rules ru where ru.org_code = #{orgcode} and ru.rules_type = #{rules_type})
and su.user_id = #{userid}
</select>
<select id="SecondaryValue" resultMap="BaseResultMap"> <select id="SecondaryValue" resultMap="BaseResultMap">
select a.user_id, select a.user_id,
......
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