Commit 41a0b8c9 by Administrator

Merge branch 'develop' into 'master'

Develop

See merge request 8timerv2/8timerapiv200!534
parents b30c8dc7 93ddc272
......@@ -79,5 +79,8 @@ public class SbgjjAssoDetailed extends Model<SbgjjAssoDetailed> {
@ApiModelProperty(value = "公积金基数 ", example = "公积金基数")
private String gjjjss;
@ApiModelProperty(value = "参保人员id ", example = "参保人员id")
private Integer cbryid;
}
\ No newline at end of file
......@@ -62,7 +62,7 @@ public class XcglAssoXzdadx extends Model<XcglAssoXzdadx> {
@ApiModelProperty(value="企业id",example="117")
private Integer qyid;
@ApiModelProperty(value="使用状态(0:使用中;1:历史)",example="0")
@ApiModelProperty(value="使用状态(0:使用中;1:历史, 2: 未生效)",example="0")
private Integer txzt;
......
......@@ -1702,16 +1702,28 @@ public class TimeCardController {
/**
* 考勤原始记录-根据 模糊 + 高級查詢-分页
* @throws ParseException
*/
@PostMapping(value = "/attendancecalendar")
@ApiOperation(value = "考勤原始记录-根据 模糊 + 高級查詢-分页", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 34)
public Result<Object> AttendanceCalendar(@CurrentUser UserBean userBean, @Validated @RequestBody OriginalRecordDto originalrecorddto){
public Result<Object> AttendanceCalendar(@CurrentUser UserBean userBean, @Validated @RequestBody OriginalRecordDto originalrecorddto) throws ParseException{
IPage<PunchRecord> page = new Page<PunchRecord>(
originalrecorddto.getCurrentPage() == null ? 1 : originalrecorddto.getCurrentPage(),
originalrecorddto.getTotalPage() == null ? 10 : originalrecorddto.getTotalPage());
originalrecorddto.setQyid(userBean.getOrgCode());
if(!originalrecorddto.getStart().equals("") && !originalrecorddto.getEnd().equals("") && originalrecorddto.getStart() != null && originalrecorddto.getEnd() != null) {
String sdaet = originalrecorddto.getStart() + " 00:00:00";
String staapptime = ClockInTool.dateToStamp(sdaet);
originalrecorddto.setStart(staapptime);
String edate = originalrecorddto.getEnd() + " 23:59:59";
String endapptime = ClockInTool.dateToStamp(edate);
originalrecorddto.setEnd(endapptime);
}
IPage<PunchRecord> pageAs = punchrecordmapper.QueryOriginalRecord(page, originalrecorddto);
List<PunchRecord> listAs = pageAs.getRecords();
......@@ -1719,6 +1731,28 @@ public class TimeCardController {
}
@PostMapping(value = "/exportattendancecalendar")
@ApiOperation(value = "", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 34)
public Result<Object> exportattendancecalendar(@CurrentUser UserBean userBean, @Validated @RequestBody OriginalRecordDto originalrecorddto) throws ParseException{
originalrecorddto.setQyid(userBean.getOrgCode());
if(!originalrecorddto.getStart().equals("") && !originalrecorddto.getEnd().equals("") && originalrecorddto.getStart() != null && originalrecorddto.getEnd() != null) {
String sdaet = originalrecorddto.getStart() + " 00:00:00";
String staapptime = ClockInTool.dateToStamp(sdaet);
originalrecorddto.setStart(staapptime);
String edate = originalrecorddto.getEnd() + " 23:59:59";
String endapptime = ClockInTool.dateToStamp(edate);
originalrecorddto.setEnd(endapptime);
}
List<PunchRecord> listAs = punchrecordmapper.exportQueryOriginalRecord(originalrecorddto);
return ResultUtil.data(listAs,"操作成功!");
}
/**
* 获取考勤组所需加班规则
*/
......
package cn.timer.api.controller.sbgjj;
import java.math.BigDecimal;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
......@@ -32,6 +35,7 @@ import cn.timer.api.bean.sbgjj.SbgjjAssoDetailed;
import cn.timer.api.bean.sbgjj.SbgjjAssoYjzd;
import cn.timer.api.bean.sbgjj.SbgjjTypeDetails;
import cn.timer.api.bean.sbgjj.SbgjjYjCsbh;
import cn.timer.api.bean.xcgl.XcglAssoJsgzzx;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
......@@ -640,7 +644,7 @@ public class SocialSecurityFundController {
deta.setSbjss(insuredto.getJnjs());//社保基数******************
deta.setGjjjss(insuredto.getGjjJnjs());//公积金基数************
deta.setCbryid(cbryid);//
detalis.add(deta);
Logoutput("公司-社保:"+preval);
......@@ -759,7 +763,7 @@ public class SocialSecurityFundController {
deta.setCbfns(sbgjjfa.getCbmcName());//参保方案
deta.setSbjss(insuredto.getJnjs());//社保基数
deta.setGjjjss(insuredto.getGjjJnjs());//公积金基数
deta.setCbryid(cbryid);//
deta.insert();
Logoutput("公司-公积金:"+preval);
......@@ -1031,8 +1035,10 @@ public class SocialSecurityFundController {
//社保******
//公司
SbgjjAssoDetailed.builder().build().delete(new QueryWrapper<SbgjjAssoDetailed>().lambda().eq(SbgjjAssoDetailed::getUserId, insuredto.getUsernum()).eq(SbgjjAssoDetailed::getOrgCode, userBean.getOrgCode())
.eq(SbgjjAssoDetailed::getAttributionTime, insuredto.getJnmouth()));
// SbgjjAssoDetailed.builder().build().delete(new QueryWrapper<SbgjjAssoDetailed>().lambda().eq(SbgjjAssoDetailed::getUserId, insuredto.getUsernum()).eq(SbgjjAssoDetailed::getOrgCode, userBean.getOrgCode())
// .eq(SbgjjAssoDetailed::getAttributionTime, insuredto.getJnmouth()));
SbgjjAssoDetailed.builder().build().delete(new QueryWrapper<SbgjjAssoDetailed>().lambda().eq(SbgjjAssoDetailed::getUserId, insuredto.getUsernum()).eq(SbgjjAssoDetailed::getOrgCode, userBean.getOrgCode()));
for(SbgjjAssoCbfzmx sbjs:shebaolist) {
double jishuxx = 0;
......@@ -1076,7 +1082,7 @@ public class SocialSecurityFundController {
deta.setCbfns(sbgjjfa.getCbmcName());//参保方案
deta.setSbjss(insuredto.getJnjs());//社保基数
deta.setGjjjss(insuredto.getGjjJnjs());//公积金基数
deta.setCbryid(insuredto.getId());//
detalis.add(deta);
gssocial += preval;
......@@ -1199,7 +1205,7 @@ public class SocialSecurityFundController {
deta.setCbfns(sbgjjfa.getCbmcName());//参保方案
deta.setSbjss(insuredto.getJnjs());//社保基数
deta.setGjjjss(insuredto.getGjjJnjs());//公积金基数
deta.setCbryid(insuredto.getId());//
deta.insert();
gsfund += preval;
......@@ -1385,6 +1391,129 @@ public class SocialSecurityFundController {
return new ResponseResult().success("成功", yjzdmxlist);
}
@GetMapping(value = "/generatemonthlybill/{time}")
@ApiOperation(value = "生成当月账单", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> GenerateMonthlyBill(@CurrentUser UserBean userBean,@PathVariable String time) throws ParseException {
DateFormat sdf = new SimpleDateFormat("yyyy-MM");
List<SbgjjAdminCbry> cbrys = SbgjjAdminCbry.builder().build().selectList(new QueryWrapper<SbgjjAdminCbry>().lambda().eq(SbgjjAdminCbry::getQyid, userBean.getOrgCode())
.eq(SbgjjAdminCbry::getState, 1).eq(SbgjjAdminCbry::getIsUse, 1).eq(SbgjjAdminCbry::getSbcbState, 1).eq(SbgjjAdminCbry::getGjjcbState, 1));
for(SbgjjAdminCbry sbgjj : cbrys) {
//社保
if(sbgjj.getSbjlStatime() != null && !sbgjj.getSbjlStatime().equals("")) {
if (sdf.parse(sbgjj.getSbjlStatime()).getTime() <= sdf.parse(time).getTime()) {
List<SbgjjAssoDetailed> sbv = SbgjjAssoDetailed.builder().build().selectList(new QueryWrapper<SbgjjAssoDetailed>().lambda().eq(SbgjjAssoDetailed::getUserId, sbgjj.getUserNum())
.eq(SbgjjAssoDetailed::getAttributionTime, time).eq(SbgjjAssoDetailed::getCbryid, sbgjj.getId()).eq(SbgjjAssoDetailed::getOrgCode, userBean.getOrgCode()));
if(sbv.size() == 0) {
List<SbgjjAssoDetailed> yjmxs = SbgjjAssoDetailed.builder().build().selectList(new QueryWrapper<SbgjjAssoDetailed>().lambda().eq(SbgjjAssoDetailed::getCbryid, sbgjj.getId())
.eq(SbgjjAssoDetailed::getAttributionTime, sbgjj.getSbjlStatime()));
List<SbgjjAssoDetailed> detailedlist = new ArrayList<SbgjjAssoDetailed>();
for(SbgjjAssoDetailed yj : yjmxs) {
SbgjjAssoDetailed deta = SbgjjAssoDetailed.builder().build();
deta.setUserId(yj.getUserId());
deta.setAttributionTime(time);//生成年月
deta.setCbfzmxId(yj.getCbfzmxId());
deta.setCoverageName(yj.getCoverageName());
deta.setPersonalAmount(yj.getPersonalAmount());
deta.setPersonalProportion(yj.getPersonalProportion());//个人比例
deta.setCompanyAmount(yj.getCompanyAmount());//公司金额
deta.setCompanyProportion(yj.getCompanyProportion());
deta.setXzType(yj.getXzType());//险种类型 1:社保;2:公积金
deta.setOrgCode(userBean.getOrgCode());
deta.setAddtime(new Date().getTime());
deta.setCbfns(yj.getCbfns());//参保方案
deta.setSbjss(yj.getSbjss());//社保基数******************
deta.setGjjjss(yj.getGjjjss());//公积金基数************
deta.setCbryid(yj.getCbryid());//
detailedlist.add(deta);
}
if(detailedlist.size()>0){
sbgjjassodetailedmapper.insertsbgjjassodetailedList(detailedlist);
}
//
if(!sbgjj.getSbjlStatime().equals(sbgjj.getGjjjlStatime())) {
List<SbgjjAssoDetailed> gjjy = SbgjjAssoDetailed.builder().build().selectList(new QueryWrapper<SbgjjAssoDetailed>().lambda().eq(SbgjjAssoDetailed::getCbryid, sbgjj.getId())
.eq(SbgjjAssoDetailed::getAttributionTime, sbgjj.getGjjjlStatime()));
List<SbgjjAssoDetailed> gjjylist = new ArrayList<SbgjjAssoDetailed>();
for(SbgjjAssoDetailed yj : gjjy) {
SbgjjAssoDetailed deta = SbgjjAssoDetailed.builder().build();
deta.setUserId(yj.getUserId());
deta.setAttributionTime(time);//生成年月
deta.setCbfzmxId(yj.getCbfzmxId());
deta.setCoverageName(yj.getCoverageName());
deta.setPersonalAmount(yj.getPersonalAmount());
deta.setPersonalProportion(yj.getPersonalProportion());//个人比例
deta.setCompanyAmount(yj.getCompanyAmount());//公司金额
deta.setCompanyProportion(yj.getCompanyProportion());
deta.setXzType(yj.getXzType());//险种类型 1:社保;2:公积金
deta.setOrgCode(userBean.getOrgCode());
deta.setAddtime(new Date().getTime());
deta.setCbfns(yj.getCbfns());//参保方案
deta.setSbjss(yj.getSbjss());//社保基数******************
deta.setGjjjss(yj.getGjjjss());//公积金基数************
deta.setCbryid(yj.getCbryid());//
gjjylist.add(deta);
}
if(gjjylist.size()>0){
sbgjjassodetailedmapper.insertsbgjjassodetailedList(gjjylist);
}
}
SbgjjAssoYjzd yjz = SbgjjAssoYjzd.builder().build().selectOne(new QueryWrapper<SbgjjAssoYjzd>().lambda().eq(SbgjjAssoYjzd::getCbryid, sbgjj.getId()).eq(SbgjjAssoYjzd::getZymonth, sbgjj.getSbjlStatime()));
if(yjz != null) {
SbgjjAssoYjzd yjzd = SbgjjAssoYjzd.builder().build();
yjzd.setUserNum(yjz.getUserNum());//用户工号
yjzd.setTotalmoney(yjz.getTotalmoney());//合计金额
yjzd.setGsjltotal(yjz.getGsjltotal());//公司缴纳合计
yjzd.setGrjltotal(yjz.getGrjltotal());//个人缴纳合计
yjzd.setZdtype(1);//账单类型 1:公司自缴
yjzd.setZymonth(time);//账单月份
yjzd.setSbfaid(yjz.getSbfaid());//社保参保方案id
yjzd.setGjjfaid(yjz.getGjjfaid());//公积金参保方案id
yjzd.setQyid(userBean.getOrgCode());
yjzd.setSbgshj(yjz.getSbgshj());//社保公司合计
yjzd.setSbgrhj(yjz.getSbgrhj());//社保个人合计
yjzd.setSbhj(yjz.getSbhj());//社保合计
yjzd.setGjjgshj("0.0");//公积金公司合计
yjzd.setGjjgrhj("0.0");//公积金个人合计
yjzd.setGjjhj("0.0");//公积金合计
yjzd.setCbryid(yjz.getCbryid());
sbgjjassoyjzdmapper.insertsbgjjassoyjzd(yjzd);
}
}
}
}
//社保公积金
if(sbgjj.getGjjjlStatime() != null && !sbgjj.getGjjjlStatime().equals("")) {
if (sdf.parse(sbgjj.getGjjjlStatime()).getTime() <= sdf.parse(time).getTime()) {
SbgjjAssoYjzd yjz = SbgjjAssoYjzd.builder().build().selectOne(new QueryWrapper<SbgjjAssoYjzd>().lambda().eq(SbgjjAssoYjzd::getUserNum, sbgjj.getUserNum())
.eq(SbgjjAssoYjzd::getZymonth, time).eq(SbgjjAssoYjzd::getQyid, userBean.getOrgCode()).eq(SbgjjAssoYjzd::getCbryid, sbgjj.getId()));
if(yjz != null) {
SbgjjAssoYjzd gjyz = SbgjjAssoYjzd.builder().build().selectOne(new QueryWrapper<SbgjjAssoYjzd>().lambda().eq(SbgjjAssoYjzd::getCbryid, sbgjj.getId()).eq(SbgjjAssoYjzd::getZymonth, sbgjj.getGjjjlStatime()));
if(gjyz != null) {
SbgjjAssoYjzd.builder().id(yjz.getId()).gjjgshj(gjyz.getGjjgshj()).gjjgrhj(gjyz.getGjjgrhj()).gjjhj(gjyz.getGjjhj()).build().updateById();
}
}
}
}
}
MonthlyStatementDto monthly = new MonthlyStatementDto();
monthly.setOrgcode(userBean.getOrgCode());
monthly.setMon(time);
List<MonthlyCheckoutSheetDto> yjzlist = sbgjjassoyjzdmapper.MonthlycheckoutsheetList(monthly);
return ResultUtil.data(yjzlist, "成功");
}
@Value("${config-8timer.environmental-science}")
public String environmental_science;
......
......@@ -3,20 +3,16 @@ package cn.timer.api.controller.xcgl;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
import javax.annotation.Resource;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import cn.timer.api.bean.sbgjj.SbgjjAssoCbfa;
import cn.timer.api.dto.xcgl.*;
import lombok.SneakyThrows;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated;
......@@ -841,8 +837,10 @@ public class SalaryManagementController {
search.getCurrentPage() == null ? 1 : search.getCurrentPage(),
search.getTotalPage() == null ? 10 : search.getTotalPage());
IPage<FixedSalaryStaffDto> dxrypage = xcglassoxzdazdymapper.selectFixedSalaryStaff(page, search);//
return ResultUtil.data(dxrypage, dxrypage.getRecords(), "获取自定义薪资组表头信息");
long total = xcglassoxzdazdymapper.selectFixedSalaryStaffCount(search);
List<FixedSalaryStaffDto> dxrylist = xcglassoxzdazdymapper.selectFixedSalaryStaff(search);
page.setTotal(total);
return ResultUtil.data(page, dxrylist, "获取自定义薪资组表头信息");
}
/**
......@@ -871,7 +869,7 @@ public class SalaryManagementController {
if (paycus.length > 0) {
int z = xzdazdy.size() + 1;
for (int p = 0; p < paycus.length; p++) {
if (paycus[p].getId() != 0) {// 修改
if (paycus[p].getId() != null) {// 修改
XcglAssoXzdazdy zdy = new XcglAssoXzdazdy();
zdy.setId(paycus[p].getId());
zdy.setZdmc(paycus[p].getTitle());// 字段名
......@@ -958,18 +956,29 @@ public class SalaryManagementController {
@ApiOperation(value = "定薪", httpMethod = "POST", notes = "接口发布说明")
public ResponseResult fixedsalary(@CurrentUser UserBean userBean,@RequestBody FixedsalaryDto fixedsalarydto) {
XcglAssoXzdadx xzdadx = XcglAssoXzdadx.builder().build();
xzdadx.setUserid(Integer.valueOf(fixedsalarydto.getId()));//用户id
xzdadx.setUserid(Integer.valueOf(fixedsalarydto.getUserid()));//用户id
xzdadx.setSxrq(fixedsalarydto.getSxrq());//生效日期
xzdadx.setAddtime(new Date().getTime());
xzdadx.setRemarks(fixedsalarydto.getRemarks());
xzdadx.setQyid(userBean.getOrgCode());
xzdadx.setTxzt(0);//0:使用中;1:最近使用;2:历史
xzdadx.setTxzt(0);//0:使用中;1:历史, 2: 未生效
xcglassoxzdadxmapper.xzdadxinsert(xzdadx);
int zdyid = xzdadx.getId();
List<XcglAssoXzdaz> xzdazlist=new ArrayList<XcglAssoXzdaz>();
CustomDto[] cus = fixedsalarydto.getCus();
List<XcglAssoXzdazdy> xzs = XcglAssoXzdazdy.builder().build().selectList(new QueryWrapper<XcglAssoXzdazdy>().lambda().eq(XcglAssoXzdazdy::getQyid, userBean.getOrgCode()));
for(XcglAssoXzdazdy xz : xzs) {
XcglAssoXzdaz xzdaz = XcglAssoXzdaz.builder().build();
xzdaz.setXzdazdyid(xz.getId());//薪资档案自定义id
xzdaz.setRsz("0");//输入值
xzdaz.setXzdadxid(zdyid);//薪资档案-定薪id
xzdaz.insert();
}
if(cus.length>0){
for(int p=0;p<cus.length;p++){
XcglAssoXzdaz.builder().build().delete(new QueryWrapper<XcglAssoXzdaz>().lambda().eq(XcglAssoXzdaz::getXzdazdyid, cus[p].getId()).eq(XcglAssoXzdaz::getXzdadxid, zdyid));
XcglAssoXzdaz xzdaz = new XcglAssoXzdaz();
xzdaz.setXzdazdyid(cus[p].getId());//薪资档案自定义id
xzdaz.setRsz(cus[p].getVal());//输入值
......@@ -996,42 +1005,61 @@ public class SalaryManagementController {
/**
* 调薪
*/
@SneakyThrows(Exception.class)
@PostMapping(value = "/payensaad")
@ApiOperation(value = "调薪", httpMethod = "POST", notes = "接口发布说明")
public ResponseResult EnterSalaryAdjustment(@CurrentUser UserBean userBean,@RequestBody FixedsalaryDto fixedsalarydto) {
XcglAssoXzdadx xzds = new LambdaQueryChainWrapper<XcglAssoXzdadx>(xcglassoxzdadxmapper).eq(XcglAssoXzdadx::getUserid, Integer.valueOf(fixedsalarydto.getId())).eq(XcglAssoXzdadx::getTxzt, 0).one();
// 当前日期
String curDate = DateUtil.getStringFormat(new Date().getTime());
// 未生效的调薪记录同一天只能有一条
XcglAssoXzdadx tmp = new LambdaQueryChainWrapper<XcglAssoXzdadx>(xcglassoxzdadxmapper)
.eq(XcglAssoXzdadx::getUserid, Integer.valueOf(fixedsalarydto.getUserid()))
.eq(XcglAssoXzdadx::getTxzt, 2)
.eq(XcglAssoXzdadx::getSxrq, fixedsalarydto.getSxrq())
.one();
if (!Objects.isNull(tmp)) {
return new ResponseResult().fail("调薪成功失败, 已存在生效日期" + fixedsalarydto.getSxrq() + "的待生效记录, 请到调薪记录页面查看!");
}
int txzt = 2;
if (DateUtil.getFormat(fixedsalarydto.getSxrq()) <= DateUtil.getFormat(curDate)) {
// 生效日期在当天或之前的, 立即生效, 原使用中的记录变成历史记录
XcglAssoXzdadx xzds = new LambdaQueryChainWrapper<XcglAssoXzdadx>(xcglassoxzdadxmapper)
.eq(XcglAssoXzdadx::getUserid, Integer.valueOf(fixedsalarydto.getUserid()))
.eq(XcglAssoXzdadx::getTxzt, 0)
.one();
if(xzds != null) {
XcglAssoXzdadx txrz = XcglAssoXzdadx.builder().build();
txrz.setTxzt(1);//使用状态(0:使用中;1:历史
txrz.setTxzt(1);//0:使用中;1:历史, 2: 未生效
txrz.setId(xzds.getId());
txrz.updateById();
XcglAssoXzdadx xzdadx = XcglAssoXzdadx.builder().build();
xzdadx.setUserid(Integer.valueOf(fixedsalarydto.getId()));//用户id
xzdadx.setSxrq(fixedsalarydto.getSxrq());//生效日期
xzdadx.setAddtime(new Date().getTime());
xzdadx.setXgyhid(userBean.getEmpNum());//修改用户id
xzdadx.setRemarks(fixedsalarydto.getRemarks());
xzdadx.setQyid(userBean.getOrgCode());
xzdadx.setTxzt(0);//0:使用中;1:历史
xcglassoxzdadxmapper.xzdadxinsert(xzdadx);
int zdyid = xzdadx.getId();
List<XcglAssoXzdaz> xzdazlist=new ArrayList<XcglAssoXzdaz>();
CustomDto[] cus = fixedsalarydto.getCus();
if(cus.length>0){
for(int p=0;p<cus.length;p++){
XcglAssoXzdaz xzdaz = new XcglAssoXzdaz();
xzdaz.setXzdazdyid(cus[p].getId());//薪资档案自定义id
xzdaz.setRsz(cus[p].getVal());//输入值
xzdaz.setXzdadxid(zdyid);//薪资档案-定薪id
xzdazlist.add(xzdaz);
}
}
if(xzdazlist.size()>0){
xcglassoxzdazmapper.insertxcglassoxzdazList(xzdazlist);
}
return new ResponseResult().success("调薪成功", xzdadx);
}
return new ResponseResult().error("调薪失败");
txzt = 0;
}
XcglAssoXzdadx xzdadx = XcglAssoXzdadx.builder().build();
xzdadx.setUserid(Integer.valueOf(fixedsalarydto.getUserid()));//用户id
xzdadx.setSxrq(fixedsalarydto.getSxrq());//生效日期
xzdadx.setAddtime(new Date().getTime());
xzdadx.setXgyhid(userBean.getEmpNum());//修改用户id
xzdadx.setRemarks(fixedsalarydto.getRemarks());
xzdadx.setQyid(userBean.getOrgCode());
xzdadx.setTxzt(txzt);
xcglassoxzdadxmapper.xzdadxinsert(xzdadx);
int zdyid = xzdadx.getId();
List<XcglAssoXzdaz> xzdazlist=new ArrayList<XcglAssoXzdaz>();
CustomDto[] cus = fixedsalarydto.getCus();
if(cus.length>0){
for(int p=0;p<cus.length;p++){
XcglAssoXzdaz xzdaz = new XcglAssoXzdaz();
xzdaz.setXzdazdyid(cus[p].getId());//薪资档案自定义id
xzdaz.setRsz(cus[p].getVal());//输入值
xzdaz.setXzdadxid(zdyid);//薪资档案-定薪id
xzdazlist.add(xzdaz);
}
}
if(xzdazlist.size()>0){
xcglassoxzdazmapper.insertxcglassoxzdazList(xzdazlist);
}
return new ResponseResult().success("调薪成功", xzdadx);
}
/**
......@@ -1043,6 +1071,61 @@ public class SalaryManagementController {
List<FixedSalaryStaffDto> txjllist = xcglassoxzdazdymapper.SalaryAdjustmentRecord(userBean.getOrgCode(),id);
return new ResponseResult().success("获取调薪记录信息", txjllist);
}
/**
* 调薪记录编辑保存
*/
@SneakyThrows(Exception.class)
@PostMapping(value = "/saveTXjlEdit")
@ApiOperation(value = "调薪", httpMethod = "POST", notes = "接口发布说明")
public ResponseResult saveTXjlEdit(@CurrentUser UserBean userBean,@RequestBody FixedsalaryDto fixedsalarydto) {
// 当前日期
String curDate = DateUtil.getStringFormat(new Date().getTime());
// 未生效的调薪记录同一天只能有一条
XcglAssoXzdadx tmp = new LambdaQueryChainWrapper<XcglAssoXzdadx>(xcglassoxzdadxmapper)
.eq(XcglAssoXzdadx::getUserid, Integer.valueOf(fixedsalarydto.getUserid()))
.eq(XcglAssoXzdadx::getTxzt, 2)
.eq(XcglAssoXzdadx::getSxrq, fixedsalarydto.getSxrq())
.one();
if (!Objects.isNull(tmp) && !tmp.getId().equals(fixedsalarydto.getId())) {
return new ResponseResult().fail("调薪成功失败, 已存在生效日期" + fixedsalarydto.getSxrq() + "的待生效记录, 请到调薪记录页面查看!");
}
int txzt = 2;
if (DateUtil.getFormat(fixedsalarydto.getSxrq()) <= DateUtil.getFormat(curDate)) {
// 生效日期在当天或之前的, 立即生效, 原使用中的记录变成历史记录
XcglAssoXzdadx xzds = new LambdaQueryChainWrapper<XcglAssoXzdadx>(xcglassoxzdadxmapper)
.eq(XcglAssoXzdadx::getUserid, Integer.valueOf(fixedsalarydto.getUserid()))
.eq(XcglAssoXzdadx::getTxzt, 0)
.one();
if(xzds != null) {
XcglAssoXzdadx txrz = XcglAssoXzdadx.builder().build();
txrz.setTxzt(1);//0:使用中;1:历史, 2: 未生效
txrz.setId(xzds.getId());
txrz.updateById();
}
txzt = 0;
}
XcglAssoXzdadx xzdadx = new XcglAssoXzdadx();
xzdadx.setId(fixedsalarydto.getId());
xzdadx.setSxrq(fixedsalarydto.getSxrq());//生效日期
xzdadx.setAddtime(new Date().getTime());
xzdadx.setXgyhid(userBean.getEmpNum());//修改用户id
xzdadx.setRemarks(fixedsalarydto.getRemarks());
xzdadx.setTxzt(txzt);
xcglassoxzdadxmapper.updateById(xzdadx);
CustomDto[] cus = fixedsalarydto.getCus();
if(cus.length > 0){
for(int p = 0; p < cus.length; p++){
XcglAssoXzdaz xzdaz = new XcglAssoXzdaz();
xzdaz.setId(cus[p].getId());
xzdaz.setRsz(cus[p].getVal());//输入值
xcglassoxzdazmapper.updateById(xzdaz);
}
}
return new ResponseResult().success("保存成功");
}
/**
* 删除调薪记录
......@@ -1372,7 +1455,7 @@ public class SalaryManagementController {
xzb.setUserid(xzuryone.getUserid());//
xzb.setXzyf(impor.getSxrq());//
xzb.setXzxid(ims[p].getJsgzzx());//
xzb.setXzxjg(Double.valueOf(ims[p].getSrz()));//
xzb.setXzxjg(ims[p].getSrz());//
xzb.setQyid(userBean.getOrgCode());
xcglassoxzbmapper.ModifyImportedSalary(xzb);
k++;
......@@ -1499,7 +1582,7 @@ public class SalaryManagementController {
xzb.setUserid(znr.getUserid());//用户id
xzb.setXzyf(xzyf);//薪资月
xzb.setXzxid(cal.getId());//薪资项id
xzb.setXzxjg(Double.valueOf(cal.getRsz()));//薪资项结果
xzb.setXzxjg(StringUtils.isBlank(cal.getRsz()) ? 0 : Double.valueOf(cal.getRsz()));//薪资项结果
xzb.setQyid(userBean.getOrgCode());
xcglassoxzbmapper.xzbinsert(xzb);
}
......@@ -2108,24 +2191,28 @@ public class SalaryManagementController {
gsmx.setCurrentSpecialDeduction(cuspde == null ? 0 : Double.valueOf(cuspde.getGrjltotal()));//本期专项扣除 【个人的社保公积金缴纳扣除】
gsmx.setCumSre(wages_payable+(sygs == null ? 0 : sygs.getCumSre()));//累计收入额 【本期收入+累计收入额(上月)】
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;
if(sygs.getCumJcfy() > 0) {
cumjcfy = sygs.getCumJcfy() + 5000;
}else {
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;
}
cumjcfy = xcy*5000;
}
}
gsmx.setCumJcfy(cumjcfy);//累计减除费用 【5000*在职月份数】
......@@ -2140,7 +2227,7 @@ public class SalaryManagementController {
String[] miscalculation = getPersonalincometax(cumynssde);
gsmx.setTaxRate(Double.valueOf(miscalculation[0]));//税率
gsmx.setQuickCalculationDeduction(Double.valueOf(miscalculation[1]));//速算扣除数
gsmx.setCumYnse(Double.valueOf(miscalculation[2]));//累计应纳税额 【累计应纳税所得额*税率-速算扣除数】
gsmx.setCumYnse(SalaryTool.formatDouble_(Double.valueOf(miscalculation[2])));//累计应纳税额 【累计应纳税所得额*税率-速算扣除数】
double cumyyjse = 0;
cumyyjse = (sygs == null ? 0 : sygs.getCumYyjse()) + (sygs == null ? 0 : sygs.getCumYbtse());
......@@ -2148,8 +2235,8 @@ public class SalaryManagementController {
double cumybtse = 0;
cumybtse = gsmx.getCumYnse() - gsmx.getCumYyjse();
gsmx.setCumYbtse(cumybtse);//累计应补(退)税额(本月个税) 【累计应纳税额-累计已预缴纳税额】
gsmx.setThmonthPersonal(cumybtse);//本月个税
gsmx.setCumYbtse(SalaryTool.formatDouble_(cumybtse));//累计应补(退)税额(本月个税) 【累计应纳税额-累计已预缴纳税额】
gsmx.setThmonthPersonal(SalaryTool.formatDouble_(cumybtse));//本月个税
gsmx.setQyid(orgcode);//企业id
gsmx.insert();
......@@ -2180,7 +2267,7 @@ public class SalaryManagementController {
double taxrate = aa.divide(bb,2,BigDecimal.ROUND_HALF_UP).doubleValue();
personalIncomeTax = taxpayroll*taxrate-tax.getDeductions();
perinctax[0] = String.valueOf(taxrate);//税率
perinctax[0] = String.valueOf(tax.getTaxrate());//税率
perinctax[1] = String.valueOf(tax.getDeductions());//速算扣除数
perinctax[2] = String.valueOf(SalaryTool.formatDouble(personalIncomeTax));//累计应纳税额
}
......
package cn.timer.api.controller.xcgl.atttimer;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import cn.hutool.core.collection.CollectionUtil;
import cn.timer.api.bean.xcgl.XcglAssoXzdadx;
import cn.timer.api.bean.xcgl.XcglAssoXzdaz;
import cn.timer.api.dao.xcgl.XcglAssoXzdadxMapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.timer.api.bean.kqgl.AttendanceWeeklySch;
import cn.timer.api.bean.kqgl.PunchCardDetails;
import cn.timer.api.bean.kqgl.PunchRecord;
import cn.timer.api.bean.kqgl.Schedule;
import cn.timer.api.bean.kqmk.KqglAssoBcsz;
import cn.timer.api.bean.kqmk.KqglAssoDkmx;
import cn.timer.api.bean.kqmk.KqglAssoLeaveRules;
import cn.timer.api.bean.kqmk.KqglAssoMonthPunchSummary;
import cn.timer.api.bean.kqmk.KqglAssoOvertimeBasics;
import cn.timer.api.bean.kqmk.KqglAssoPbmx;
import cn.timer.api.bean.kqmk.KqglAssoRelationSummary;
import cn.timer.api.bean.kqmk.KqglAssoTeshu;
import cn.timer.api.bean.kqmk.KqglAssoZhoupaiban;
import cn.timer.api.bean.kqmk.KqglMainKqz;
import cn.timer.api.bean.kqmk.KqmkRedletterDay;
import cn.timer.api.bean.qyzx.QyzxEntInfoM;
import cn.timer.api.bean.yggl.YgglMainLzb;
import cn.timer.api.controller.kqgl.ClockInController;
import cn.timer.api.controller.kqgl.ClockInTool;
import cn.timer.api.controller.kqgl.EmptyUtil;
import cn.timer.api.dao.kqgl.AttendanceWeeklySchMapper;
import cn.timer.api.dao.kqgl.PunchCardDetailsMapper;
import cn.timer.api.dao.kqgl.PunchRecordMapper;
import cn.timer.api.dao.kqgl.ScheduleMapper;
import cn.timer.api.dao.kqmk.KqglAssoDkmxMapper;
import cn.timer.api.dao.kqmk.KqglAssoLeaveBalanceMapper;
import cn.timer.api.dao.kqmk.KqglAssoRelationSummaryMapper;
import cn.timer.api.dao.kqmk.KqglAssoTeshuMapper;
import cn.timer.api.dao.kqmk.KqglMainKqzMapper;
import cn.timer.api.dao.qyzx.QyzxEntInfoMMapper;
import cn.timer.api.dto.kqmk.AdditionalDto;
import cn.timer.api.dto.kqmk.AttSchedule;
import cn.timer.api.dto.kqmk.AttSubsidiaryDto;
import cn.timer.api.dto.kqmk.AttendanceCardListDto;
import cn.timer.api.utils.DateUtil;
import javax.annotation.Resource;
/**
* 调薪记录生效定时任务
*/
//@Component
//@Lazy
@Configuration //1.主要用于标记配置类,兼备Component的效果。
@EnableScheduling // 2.开启定时任务
public class SalaryTaskTiming{
// 薪酬管理-定薪
@Resource
private XcglAssoXzdadxMapper xcglassoxzdadxmapper;
//3.添加定时任务 每天凌晨1点执行一次
@Scheduled(cron = "0 0 1 * * ?")
public void AttendanceTask() throws ParseException {
// 使用状态(0:使用中;1:历史, 2: 未生效)
// 当前日期
String curDate = DateUtil.getStringFormat(new Date().getTime());
// 获取小于等于当前日期的未生效数据
List<XcglAssoXzdadx> xzdxlist = xcglassoxzdadxmapper.listIneffective(curDate);
if (CollectionUtil.isNotEmpty(xzdxlist)) {
xzdxlist.forEach(o -> {
// 将使用中的薪资数据置为历史
XcglAssoXzdadx dadxUsed = new LambdaQueryChainWrapper<XcglAssoXzdadx>(xcglassoxzdadxmapper)
.eq(XcglAssoXzdadx::getUserid, o.getUserid())
.eq(XcglAssoXzdadx::getTxzt, 0).one();
dadxUsed.setTxzt(1);
xcglassoxzdadxmapper.updateById(dadxUsed);
// 将未生效的薪资数据置为使用中
o.setTxzt(0);
xcglassoxzdadxmapper.updateById(o);
});
}
// 处理出现多个使用中的错误数据, list 按工号、生效日期升序
List<XcglAssoXzdadx> listRepeat = xcglassoxzdadxmapper.listRepeatUsed();
if (CollectionUtil.isNotEmpty(listRepeat)) {
for (int i = 0; i < listRepeat.size(); i++) {
XcglAssoXzdadx xzdadx = listRepeat.get(i);
while ((i +1) <listRepeat.size()
&& xzdadx.getUserid().equals(listRepeat.get(i +1).getUserid())) {
xzdadx.setTxzt(1);
xcglassoxzdadxmapper.updateById(xzdadx);
xzdadx = listRepeat.get(i +1);
i = i + 1;
}
}
}
}
}
......@@ -41,5 +41,7 @@ public interface PunchRecordMapper {
IPage<PunchRecord> QueryOriginalRecord(IPage<PunchRecord> page,@Param("param") OriginalRecordDto originalrecorddto);
List<PunchRecord> exportQueryOriginalRecord(@Param("param") OriginalRecordDto originalrecorddto);
PunchRecord organizationalStructure(int id);
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package cn.timer.api.dao.xcgl;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......@@ -16,4 +17,14 @@ public interface XcglAssoXzdadxMapper extends BaseMapper<XcglAssoXzdadx> {
int xzdadxinsert(XcglAssoXzdadx xcglassoxzdadx);
int insertxcglassoxzdadxList(List<XcglAssoXzdadx> xcglassoxzdadx);
/**
* 获取小于等于当前日期的未生效数据 yyyy-mm-dd
*/
List<XcglAssoXzdadx> listIneffective(@Param("curDate") String curDate);
/**
* 获取使用中多于1条数据的记录
*/
List<XcglAssoXzdadx> listRepeatUsed();
}
......@@ -25,8 +25,9 @@ public interface XcglAssoXzdazdyMapper extends BaseMapper<XcglAssoXzdazdy> {
int dazdyupdate(XcglAssoXzdazdy xcglassoxzdazdy);
IPage<FixedSalaryStaffDto> selectFixedSalaryStaff(IPage<FixedSalaryStaffDto> page, @Param("param")SearchSalariedPeopleDto search);
long selectFixedSalaryStaffCount(@Param("param")SearchSalariedPeopleDto search);
List<FixedSalaryStaffDto> selectFixedSalaryStaff(@Param("param")SearchSalariedPeopleDto search);
List<ChangeSalaryDto> AchieveSalaryAdjustment(Integer orgcode,Integer empnum);
List<FixedSalaryStaffDto> SalaryAdjustmentRecord(Integer orgcode,Integer empnum);
......
......@@ -15,6 +15,6 @@ public class CustomDto implements Serializable {
*/
private static final long serialVersionUID = -7594521197951361545L;
Integer id;// 薪资档案自定义id
Integer id;// 记录id
String val;// 输入值
}
......@@ -27,7 +27,9 @@ public class FixedSalaryStaffDto implements Serializable {
String empzztime;// 转正日期
int sfdx;//是否定薪 0:无;1:有
String tratime;//调薪日期
Integer txzt; //使用状态 0:使用中;1:历史, 2 未生效
int id;
String remarks; //备注
List<DefinedItemsDto> defdto = new ArrayList<DefinedItemsDto>();
}
......@@ -15,7 +15,8 @@ public class FixedsalaryDto implements Serializable {
*/
private static final long serialVersionUID = 2239288307511437403L;
CustomDto[] cus;// 自定义输入值
String id;// 用户工号
String userid;// 用户工号
String remarks;// 备注
String sxrq;// 生效日期
Integer id;// 记录ID
}
......@@ -17,6 +17,6 @@ public class ImportSalaryDto implements Serializable {
String usernum;// 用户工号
String username;// 用户名称
int jsgzzx;// 计薪规则组项
int srz;// 输入值
double srz;// 输入值
}
......@@ -479,49 +479,4 @@ public class DateUtil {
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMinimum(Calendar.DAY_OF_MONTH));
return dft.format(calendar.getTime());
}
public static void main(String[] args) throws ParseException {
// System.out.println(getStartTime(0).getTime());
// System.out.println(getnowEndTime(23).getTime());
// long ts=getStartTime(0).getTime();
// System.out.println(getnowEndTime(23).getTime());
// System.out.println(getStringFormat(ts));
// String time=getStringFormat(ts);
// time +="9:00";
// System.out.println(getStringTime(time,"yyyy-MM-ddHH:mm"));
// System.out.println(System.currentTimeMillis());
// System.out.println(getStringTime("23:00","HH:mm"));
// System.out.println(getStringTime("00:00","HH:mm"));
// System.out.println(getStringDate(System.currentTimeMillis()));
//
//
// SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("dd");
// Date date = new Date(1516291200000L);
// System.out.println(simpleDateFormat1.format(date));
// System.out.println("--------------根据特定的日期‘2014-8-1’获取特定日期所在一个月的每一天--------------");
// SimpleDateFormat dateFm = new SimpleDateFormat("EEEE",Locale.CHINA);
// Date d2=paraseStringToDate("2018-7-3");
// List<String> lst4=getAllDaysMonthByDate(d2);
// for(String s3:lst4){
// System.out.print(s3+" ");
// System.out.print(dateFm.format(paraseStringToDate(s3))+" ");
// System.out.println(s3.substring(s3.length()-2, s3.length()));
// }
// System.out.println(Math.abs((1514854800000L-1514865600000L)/60000));
// System.out.println(getFirstDayOfMonth("2018-1-1"));
// System.out.println(getLastDayOfMonth("2018-1-1"));
// System.out.println(getStringFormat(1520179200000L));
// Calendar todayStart = Calendar.getInstance();
// todayStart.setTimeInMillis(1515164400000L);
// todayStart.set(Calendar.HOUR_OF_DAY, 0);
// todayStart.set(Calendar.MINUTE, 0);
// todayStart.set(Calendar.SECOND, 0);
// todayStart.set(Calendar.MILLISECOND, 0);
// System.out.println(todayStart.getTime().getTime());
Date da=new Date();
System.out.println(da);
System.out.println(da.getTime());
}
}
......@@ -19,6 +19,11 @@ public class Page {
*/
private Integer totalPage;
/**
* 偏移
*/
private Integer offset;
public Integer getCurrentPage() {
return currentPage == null || currentPage <= 0 ? 1 : currentPage;
}
......@@ -29,13 +34,17 @@ public class Page {
}
public Integer getTotalPage() {
return totalPage == null || totalPage <= 0 ? 10 : totalPage;
}
public void setTotalPage(Integer totalPage) {
this.totalPage = totalPage;
}
public Integer getOffset() {
return this.currentPage > 0 ? (this.currentPage - 1) * this.totalPage : 0;
}
public void setOffset(Integer offset) {
this.offset = offset;
}
}
......@@ -65,6 +65,30 @@
ORDER BY dkjl.id DESC
</select>
<select id="exportQueryOriginalRecord" resultMap="BaseResultMap">
select dkjl.*,
bmgw.dept,
bmgw.post,
info.`name` username
from kqgl_asso_dkjl dkjl
LEFT JOIN yggl_main_emp as info on info.emp_num = dkjl.user_id and info.org_code = #{param.qyid}
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 = info.bmgw_id
where dkjl.qyid = #{param.qyid}
<if test="param.start != ''" >
and dkjl.attime &gt;= #{param.start}
</if>
<if test="param.end != ''" >
and dkjl.attime &lt;= #{param.end}
</if>
<if test="param.text != null and param.text != ''" >
and (info.`name` like CONCAT('%',#{param.text},'%') or info.emp_num = #{param.text})
</if>
ORDER BY dkjl.id DESC
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
......
......@@ -21,10 +21,11 @@
<result column="cbfns" property="cbfns" />
<result column="sbjss" property="sbjss" />
<result column="gjjjss" property="gjjjss" />
<result column="cbryid" property="cbryid" />
</resultMap>
<insert id="insertsbgjjassodetailedList" parameterType="java.util.List" >
insert into sbgjj_asso_detailed (user_id,attribution_time,cbfzmx_id,coverage_name,personal_amount,personal_proportion,company_amount,company_proportion,xz_type,org_code,addtime,cbfns,sbjss,gjjjss)
insert into sbgjj_asso_detailed (user_id,attribution_time,cbfzmx_id,coverage_name,personal_amount,personal_proportion,company_amount,company_proportion,xz_type,org_code,addtime,cbfns,sbjss,gjjjss,cbryid)
<foreach collection="list" item="item" index="index" open="values " close="" separator=",">
(
<if test="item.userId != null" >
......@@ -67,7 +68,10 @@
#{item.sbjss},
</if>
<if test="item.gjjjss != null" >
#{item.gjjjss}
#{item.gjjjss},
</if>
<if test="item.cbryid != null" >
#{item.cbryid}
</if>
)
</foreach>
......
......@@ -79,13 +79,13 @@
left join zzgl_bmgw_m um on um.id = m.up_id
) as bmgw on bmgw.mid = emp.bmgw_id
<if test="xzzid != null">
LEFT JOIN xcgl_asso_xzury xzury ON xzury.userid = emp.id and xzury.xzzid = #{xzzid}
LEFT JOIN xcgl_asso_xzury xzury ON xzury.userid = emp.emp_num and xzury.xzzid = #{xzzid}
</if>
where gztzt.qyid = #{orgcode}
<if test="gztszid != null"> and gztzt.gztszid = #{gztszid} </if>
<if test="fsType != null"> and gztzt.fs_type = #{fsType} </if>
<if test="qrType != null"> and gztzt.qr_type = #{qrType} </if>
<if test="xzzid != null"> and xzury.xzzid = #{xzzid} </if>
<if test="xzzid != null"> and gztzt.xzzid = #{xzzid} </if>
<if test="text != null and text != ''" >
and (emp.`name` like CONCAT('%',#{text},'%') or emp.emp_num = #{text})
</if>
......
......@@ -116,42 +116,18 @@
</trim>
</insert>
<!-- <delete id="delete" >
DELETE FROM xcgl_asso_xzdadx
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.xcgl.XcglAssoXzdadx">
UPDATE xcgl_asso_xzdadx
<set>
<if test ='null != userid'>userid = #{userid},</if>
<if test ='null != sxrq'>sxrq = #{sxrq},</if>
<if test ='null != addtime'>addtime = #{addtime},</if>
<if test ='null != xgyhid'>xgyhid = #{xgyhid},</if>
<if test ='null != remarks'>remarks = #{remarks},</if>
<if test ='null != qyid'>qyid = #{qyid},</if>
<if test ='null != txzt'>txzt = #{txzt}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
<!-- 获取小于等于当前日期的未生效记录 -->
<select id="listIneffective" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM xcgl_asso_xzdadx
WHERE id = #{id}
WHERE txzt = 2 AND sxrq &lt;= #{curDate}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
<!-- 获取使用中多于1条数据的记录 -->
<select id="listRepeatUsed" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM xcgl_asso_xzdadx
LIMIT #{offset}, #{pageSize}
WHERE txzt = 0 AND exists (SELECT * from (select userid, count(*) as cnt from xcgl_asso_xzdadx where txzt = 0 group by userid) as tmp where cnt > 1)
ORDER BY userid, sxrq asc
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM xcgl_asso_xzdadx
</select>
-->
</mapper>
\ No newline at end of file
......@@ -22,6 +22,9 @@
<result column="empzztime" property="empzztime" />
<result column="sfdx" property="sfdx" />
<result column="tratime" property="tratime" />
<result column="txzt" property="txzt" />
<result column="remarks" property="remarks" />
<collection property="defdto" ofType="cn.timer.api.dto.xcgl.DefinedItemsDto">
<result column="dazid" property="dazid"/>
......@@ -169,6 +172,16 @@
FROM xcgl_asso_xzdazdy
</select> -->
<select id="selectFixedSalaryStaffCount" resultType="java.lang.Long">
select COUNT(*) from yggl_main_emp emp
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="selectFixedSalaryStaff" resultMap="FixedSalaryStaffMap">
select emp.emp_num empnum,
emp.`name` empname,
......@@ -194,16 +207,18 @@
xzdaz.xzdazdyid as xzdazdyid,
xzdaz.rsz as dazrsz,
xzdaz.xzdadxid as xzdadxid
from yggl_main_emp emp
from (select * from yggl_main_emp emp
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>
LIMIT #{param.offset}, #{param.totalPage}
) emp
LEFT JOIN xcgl_asso_xzdadx as dadx on dadx.userid = emp.emp_num and dadx.txzt = 0
LEFT JOIN xcgl_asso_xzdaz as xzdaz on xzdaz.xzdadxid = dadx.id
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>
......@@ -283,6 +298,8 @@
SUBSTR(emp.zz_time,1,10) empzztime,
IF(dadx.userid IS NOT NULL,1,0) AS sfdx,
dadx.sxrq as tratime,
dadx.txzt as txzt,
dadx.remarks as remarks,
xzdaz.id as dazid,
xzdaz.xzdazdyid as xzdazdyid,
xzdaz.rsz as dazrsz,
......@@ -291,8 +308,8 @@
LEFT JOIN yggl_main_emp emp on dadx.userid = emp.emp_num
LEFT JOIN xcgl_asso_xzdaz as xzdaz on xzdaz.xzdadxid = dadx.id
where emp.org_code = #{orgcode}
and emp.emp_num = #{empnum}
and dadx.txzt = 1
and emp.emp_num = #{empnum}
ORDER BY dadx.txzt, dadx.sxrq DESC
</select>
</mapper>
\ No newline at end of file
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