Commit 98386efe by ilal

提交

parent 26e84cc0
...@@ -13,6 +13,7 @@ import java.util.Map; ...@@ -13,6 +13,7 @@ import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
...@@ -23,8 +24,12 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -23,8 +24,12 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; 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.extension.conditions.query.LambdaQueryChainWrapper; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import cn.timer.api.bean.kqgl.AttendanceGroup; import cn.timer.api.bean.kqgl.AttendanceGroup;
import cn.timer.api.bean.kqgl.AttendanceReport; import cn.timer.api.bean.kqgl.AttendanceReport;
import cn.timer.api.bean.kqgl.AttendanceWeeklySch; import cn.timer.api.bean.kqgl.AttendanceWeeklySch;
...@@ -48,6 +53,7 @@ import cn.timer.api.bean.xcgl.XcglAssoZxfjkc; ...@@ -48,6 +53,7 @@ import cn.timer.api.bean.xcgl.XcglAssoZxfjkc;
import cn.timer.api.bean.yggl.YgglMainEmp; import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.annotation.CurrentUser; import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean; import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.validation.ValidList;
import cn.timer.api.dao.kqgl.AttendanceGroupMapper; import cn.timer.api.dao.kqgl.AttendanceGroupMapper;
import cn.timer.api.dao.kqgl.AttendanceWeeklySchMapper; import cn.timer.api.dao.kqgl.AttendanceWeeklySchMapper;
import cn.timer.api.dao.kqgl.PunchCardDetailsMapper; import cn.timer.api.dao.kqgl.PunchCardDetailsMapper;
...@@ -97,10 +103,12 @@ import cn.timer.api.dto.xcgl.SalaryGroupGroupingDto; ...@@ -97,10 +103,12 @@ import cn.timer.api.dto.xcgl.SalaryGroupGroupingDto;
import cn.timer.api.dto.xcgl.SalaryItemRulesDto; import cn.timer.api.dto.xcgl.SalaryItemRulesDto;
import cn.timer.api.dto.xcgl.SalaryPersonFieldDto; import cn.timer.api.dto.xcgl.SalaryPersonFieldDto;
import cn.timer.api.dto.xcgl.SearchSalariedPeopleDto; import cn.timer.api.dto.xcgl.SearchSalariedPeopleDto;
import cn.timer.api.dto.xcgl.SpecialDeductionDto;
import cn.timer.api.dto.xcgl.SwitchSalaryDateDto; import cn.timer.api.dto.xcgl.SwitchSalaryDateDto;
import cn.timer.api.dto.xcgl.TjSalaryItemDot; import cn.timer.api.dto.xcgl.TjSalaryItemDot;
import cn.timer.api.dto.xcgl.XcglAssoOptionDto; import cn.timer.api.dto.xcgl.XcglAssoOptionDto;
import cn.timer.api.dto.xcgl.YdMobilePacketDto; import cn.timer.api.dto.xcgl.YdMobilePacketDto;
import cn.timer.api.dto.yggl.AddygdaDto;
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;
...@@ -1920,8 +1928,6 @@ public class SalaryManagementController { ...@@ -1920,8 +1928,6 @@ public class SalaryManagementController {
/** /**
* 获取附加扣除数据 * 获取附加扣除数据
*/ */
// @GetMapping(value = "/obtainidedu")
// @ApiOperation(value = "获取附加扣除数据", httpMethod = "GET", notes = "接口发布说明")
@PostMapping(value = "/obtainidedu") @PostMapping(value = "/obtainidedu")
@ApiOperation(value = "获取附加扣除数据", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "获取附加扣除数据", httpMethod = "POST", notes = "接口发布说明")
public ResponseResult ObtainAdditionalDeduction(@CurrentUser UserBean userBean,@RequestBody SearchSalariedPeopleDto search) { public ResponseResult ObtainAdditionalDeduction(@CurrentUser UserBean userBean,@RequestBody SearchSalariedPeopleDto search) {
...@@ -1935,55 +1941,35 @@ public class SalaryManagementController { ...@@ -1935,55 +1941,35 @@ public class SalaryManagementController {
search.setStatus("3"); search.setStatus("3");
} }
List<AdditionalDeductionDto> fjkclist = xcglassozxfjkcmapper.selectAdditionalDeduction(search); List<AdditionalDeductionDto> fjkclist = xcglassozxfjkcmapper.selectAdditionalDeductiontwo(search);
return new ResponseResult().success("获取附加扣除数据成功", fjkclist); return new ResponseResult().success("获取附加扣除数据成功", fjkclist);
} }
/**
* 查询列表-获取附加扣除数据-分页
*/
@PostMapping(value = "/select_leave_rules")
@ApiOperation(value = "获取附加扣除数据-分页", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> selectleaverules(@CurrentUser UserBean userBean, @RequestBody SearchSalariedPeopleDto search) {
IPage<AdditionalDeductionDto> page = new Page<AdditionalDeductionDto>(
search.getCurrentPage() == null ? 1 : search.getCurrentPage(),
search.getTotalPage() == null ? 10 : search.getTotalPage());
search.setOrgcode(userBean.getOrgCode());
if(("0").equals(search.getStatus())) {//全部
search.setStatus("");
}else if(("1").equals(search.getStatus())) {//在职
search.setStatus("0");
}else {
search.setStatus("3");
}
IPage<AdditionalDeductionDto> pageAs = xcglassozxfjkcmapper.selectAdditionalDeduction(page, search);
List<AdditionalDeductionDto> listAs = pageAs.getRecords();
return ResultUtil.data(pageAs, listAs, "操作成功!");
}
// @PostMapping(value = "/programme")
// @ApiOperation(value = "获取附加扣除数据搜索/分页", httpMethod = "POST", notes = "接口发布说明")
// public Result<Object> programme(@CurrentUser UserBean userBean,@RequestBody AdditionalkcDto kcdto) {
//
// String n = kcdto.getName();
// int s = kcdto.getState();
// String d = kcdto.getDate();
//
//
// /*
// * Page<AdditionalDeductionDto> page = new Page<AdditionalDeductionDto>(
// * kcdto.getCurrentPage() == null ? 1 : kcdto.getCurrentPage(),
// * kcdto.getTotalPage() == null ? 10 : kcdto.getTotalPage());
// */
//
// PageHelper.startPage(kcdto.getCurrentPage() == null ? 1 : kcdto.getCurrentPage(), kcdto.getTotalPage() == null ? 10 : kcdto.getTotalPage());
//
//
// //List<AdditionalDeductionDto> fjkclist = xcglassozxfjkcmapper.selectAdditionalDeduction(userBean.getOrgCode());
//
// Page<AdditionalDeductionDto> fjkcpage = xcglassozxfjkcmapper.selectAdditionalDeduction(userBean.getOrgCode());
//
// List<AdditionalDeductionDto> fjkclist = fjkcpage.getRecords();
//
// fjkcpage.getCurrent();
// fjkcpage.getPages();
// fjkcpage.getTotal();
// fjkcpage.getSize();
//
//
//// QueryWrapper<SbgjjAssoCbfa> queryWrapper = new QueryWrapper<>();
//// queryWrapper.eq("qyid",userBean.getOrgCode()).and(!StrUtil.hasBlank(c), wq -> wq.likeRight("cbcs", c));
////
//// IPage<SbgjjAssoCbfa> sbgjjassocbfaPage = SbgjjAssoCbfa.builder().build().selectPage(page, queryWrapper);
////
//// IPage<AdditionalDeductionDto> sbgjjassocbfaPage =
//// List<SbgjjAssoCbfa> sbgjjassocbfaEmps = sbgjjassocbfaPage.getRecords();
//// sbgjjassocbfaPage.getCurrent();
//// sbgjjassocbfaPage.getPages();
//// sbgjjassocbfaPage.getTotal();
//// sbgjjassocbfaPage.getSize();
//
// return ResultUtil.data2(fjkcpage, fjkclist, "方案搜索成功");
// }
/** /**
...@@ -2197,6 +2183,91 @@ public class SalaryManagementController { ...@@ -2197,6 +2183,91 @@ public class SalaryManagementController {
return new ResponseResult().success("成功", gztz); return new ResponseResult().success("成功", gztz);
} }
/**
* 导入专项附加扣除
*/
@PostMapping(value = "/import_special_additional_deduction")
@ApiOperation(value = "导入专项附加扣除", httpMethod = "POST", notes = "接口发布说明")
public Result<JSONObject> importSpecialAdditionalDeduction(@CurrentUser UserBean userBean,
@Validated @RequestBody ValidList<SpecialDeductionDto> specialdeductiondto) throws Exception {
Integer orgCode = userBean.getOrgCode();
for (SpecialDeductionDto spec : specialdeductiondto) {
String name = spec.getName();
String phone = spec.getPhone();
String date = spec.getDate();
YgglMainEmp ygl = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getName, name)
.eq(YgglMainEmp::getPhone, phone).eq(YgglMainEmp::getOrgCode, orgCode));
XcglAssoZxfjkc xcg = XcglAssoZxfjkc.builder().build().selectOne(new QueryWrapper<XcglAssoZxfjkc>().lambda().eq(XcglAssoZxfjkc::getTaxmonth, date)
.eq(XcglAssoZxfjkc::getQyid, userBean.getOrgCode()).eq(XcglAssoZxfjkc::getUserid, ygl.getEmpNum()));
if(xcg == null) {
XcglAssoZxfjkc xcglas = XcglAssoZxfjkc.builder().build();
xcglas.setUserid(ygl.getEmpNum());
xcglas.setTaxmonth(date);
xcglas.setChildrenedu(Double.valueOf(spec.getZljy()));//子女教育
xcglas.setHouseloans(Double.valueOf(spec.getZfdk()));//住房贷款利息
xcglas.setHouserents(Double.valueOf(spec.getZfzj()));//住房租金
xcglas.setSupportolder(Double.valueOf(spec.getSylr()));//赡养老人
xcglas.setContinueedu(Double.valueOf(spec.getJxjy()));//继续教育
BigDecimal num1 = new BigDecimal(spec.getZljy());
BigDecimal num2 = new BigDecimal(spec.getZfdk());
double result1 = num1.add(num2).doubleValue();
BigDecimal num3 = new BigDecimal(result1);
BigDecimal num4 = new BigDecimal(spec.getZfzj());
double result2 = num3.add(num4).doubleValue();
BigDecimal num5 = new BigDecimal(result2);
BigDecimal num6 = new BigDecimal(spec.getSylr());
double result3 = num5.add(num6).doubleValue();
BigDecimal num7 = new BigDecimal(result3);
BigDecimal num8 = new BigDecimal(spec.getJxjy());
double result = num7.add(num8).doubleValue();
xcglas.setTotalmoney(result);//累计专项附加扣除
xcglas.setQyid(userBean.getOrgCode());
xcglas.setAddtime(new Date().getTime());
xcglassozxfjkcmapper.insertXcglAssoZxfjkc(xcglas);
}else {
XcglAssoZxfjkc fjkc = XcglAssoZxfjkc.builder().build();
fjkc.setId(xcg.getId());
fjkc.setChildrenedu(Double.valueOf(spec.getZljy()));//子女教育
fjkc.setHouseloans(Double.valueOf(spec.getZfdk()));//住房贷款利息
fjkc.setHouserents(Double.valueOf(spec.getZfzj()));//住房租金
fjkc.setSupportolder(Double.valueOf(spec.getSylr()));//赡养老人
fjkc.setContinueedu(Double.valueOf(spec.getJxjy()));//继续教育
BigDecimal num1 = new BigDecimal(spec.getZljy());
BigDecimal num2 = new BigDecimal(spec.getZfdk());
double result1 = num1.add(num2).doubleValue();
BigDecimal num3 = new BigDecimal(result1);
BigDecimal num4 = new BigDecimal(spec.getZfzj());
double result2 = num3.add(num4).doubleValue();
BigDecimal num5 = new BigDecimal(result2);
BigDecimal num6 = new BigDecimal(spec.getSylr());
double result3 = num5.add(num6).doubleValue();
BigDecimal num7 = new BigDecimal(result3);
BigDecimal num8 = new BigDecimal(spec.getJxjy());
double result = num7.add(num8).doubleValue();
fjkc.setTotalmoney(Double.valueOf(result));//累计专项附加扣除
xcglassozxfjkcmapper.updateXcglAssoZxfjkc(fjkc);
}
}
return ResultUtil.success("成功");
}
/****************************************************************************/ /****************************************************************************/
/****************************************************************************/ /****************************************************************************/
......
package cn.timer.api.dao.xcgl; package cn.timer.api.dao.xcgl;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import cn.timer.api.bean.xcgl.XcglAssoZxfjkc; import cn.timer.api.bean.xcgl.XcglAssoZxfjkc;
import cn.timer.api.dto.kqmk.AttqueryCriteriaDto;
import cn.timer.api.dto.kqmk.KqglMainKqzDto;
import cn.timer.api.dto.xcgl.AdditionalDeductionDto; import cn.timer.api.dto.xcgl.AdditionalDeductionDto;
import cn.timer.api.dto.xcgl.SearchSalariedPeopleDto; import cn.timer.api.dto.xcgl.SearchSalariedPeopleDto;
...@@ -19,7 +23,11 @@ public interface XcglAssoZxfjkcMapper extends BaseMapper<XcglAssoZxfjkc> { ...@@ -19,7 +23,11 @@ public interface XcglAssoZxfjkcMapper extends BaseMapper<XcglAssoZxfjkc> {
int insertXcglAssoZxfjkc(XcglAssoZxfjkc xcglassozxfjkc); int insertXcglAssoZxfjkc(XcglAssoZxfjkc xcglassozxfjkc);
List<AdditionalDeductionDto> selectAdditionalDeduction(SearchSalariedPeopleDto searchsalariedpeopledto); List<AdditionalDeductionDto> selectAdditionalDeductiontwo(SearchSalariedPeopleDto searchsalariedpeopledto);
int updateXcglAssoZxfjkc(XcglAssoZxfjkc xcglassozxfjkc); int updateXcglAssoZxfjkc(XcglAssoZxfjkc xcglassozxfjkc);
IPage<AdditionalDeductionDto> selectAdditionalDeduction(IPage<AdditionalDeductionDto> page,@Param("param") SearchSalariedPeopleDto searchsalariedpeopledto);
} }
...@@ -15,7 +15,9 @@ public class AdditionalDeductionDto implements Serializable { ...@@ -15,7 +15,9 @@ public class AdditionalDeductionDto implements Serializable {
*/ */
private static final long serialVersionUID = -3829908201010471272L; private static final long serialVersionUID = -3829908201010471272L;
int zxfjid; int zxfjid;
String date;
String name; String name;
String phone;
String empNum; String empNum;
int zljy; int zljy;
int zfdk; int zfdk;
......
...@@ -2,6 +2,7 @@ package cn.timer.api.dto.xcgl; ...@@ -2,6 +2,7 @@ package cn.timer.api.dto.xcgl;
import java.io.Serializable; import java.io.Serializable;
import cn.timer.api.utils.Page;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
...@@ -15,7 +16,7 @@ import lombok.NoArgsConstructor; ...@@ -15,7 +16,7 @@ import lombok.NoArgsConstructor;
@Builder @Builder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class SearchSalariedPeopleDto implements Serializable { public class SearchSalariedPeopleDto extends Page {
private static final long serialVersionUID = 6251994337286870380L; private static final long serialVersionUID = 6251994337286870380L;
......
package cn.timer.api.dto.xcgl;
import java.io.Serializable;
import java.util.Date;
import com.alibaba.fastjson.annotation.JSONField;
import cn.timer.api.utils.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SpecialDeductionDto extends Page implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "时间", example = "1")
private String date;
// @JSONField(format="yyyy-MM")
// @ApiModelProperty(value="时间 ",example="时间")
// private Date date;
@ApiModelProperty(value = "姓名", example = "1")
private String name;
@ApiModelProperty(value = "电话号码", example = "1")
private String phone;
@ApiModelProperty(value = "子女教育", example = "1")
private String zljy;
@ApiModelProperty(value = "住房贷款利息", example = "1")
private String zfdk;
@ApiModelProperty(value = "住房租金", example = "86")
private String zfzj;
@ApiModelProperty(value = "赡养老人", example = "赡养老人")
private String sylr;
@ApiModelProperty(value = "继续教育", example = "A")
private String jxjy;
@ApiModelProperty(value = "累计专项附加扣除", example = "A")
private String lj;
}
...@@ -19,7 +19,9 @@ ...@@ -19,7 +19,9 @@
<resultMap id="AdditionalDeductionMap" type="cn.timer.api.dto.xcgl.AdditionalDeductionDto" > <resultMap id="AdditionalDeductionMap" type="cn.timer.api.dto.xcgl.AdditionalDeductionDto" >
<result column="zxfjid" property="zxfjid" /> <result column="zxfjid" property="zxfjid" />
<result column="date" property="date" />
<result column="name" property="name" /> <result column="name" property="name" />
<result column="phone" property="phone" />
<result column="empNum" property="empNum" /> <result column="empNum" property="empNum" />
<result column="zljy" property="zljy" /> <result column="zljy" property="zljy" />
<result column="zfdk" property="zfdk" /> <result column="zfdk" property="zfdk" />
...@@ -60,7 +62,36 @@ ...@@ -60,7 +62,36 @@
<select id="selectAdditionalDeduction" resultMap="AdditionalDeductionMap"> <select id="selectAdditionalDeduction" resultMap="AdditionalDeductionMap">
select emp.`name` as name, select emp.`name` as name,
emp.emp_num as empNum, emp.emp_num as empNum,
emp.phone,
zxfj.id as zxfjid, zxfj.id as zxfjid,
zxfj.taxmonth as date,
zxfj.childrenedu as zljy,
zxfj.houseloans as zfdk,
zxfj.houserents as zfzj,
zxfj.supportolder as sylr,
zxfj.continueedu as jxjy,
zxfj.totalmoney as lj
from yggl_main_emp emp
LEFT JOIN xcgl_asso_zxfjkc as zxfj on zxfj.userid = emp.emp_num
<if test="param.datetime != ''" >
and zxfj.taxmonth = #{param.datetime}
</if>
where emp.org_code = #{param.orgcode}
<if test="param.status != ''" >
and emp.job_status = #{param.status}
</if>
<if test="param.text != ''" >
and (emp.`name` like CONCAT('%',#{param.text},'%') or emp.emp_num = #{param.text})
</if>
</select>
<select id="selectAdditionalDeductiontwo" resultMap="AdditionalDeductionMap">
select emp.`name` as name,
emp.emp_num as empNum,
emp.phone,
zxfj.id as zxfjid,
zxfj.taxmonth as date,
zxfj.childrenedu as zljy, zxfj.childrenedu as zljy,
zxfj.houseloans as zfdk, zxfj.houseloans as zfdk,
zxfj.houserents as zfzj, zxfj.houserents as zfzj,
......
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