Commit 3082346b by lal Committed by chenzg

提交

parent 2e58ce50
package cn.timer.api.bean.kqmk;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
/**
* @author lal 2020-06-22
*/
@Data
@Builder
@Table(name = "kqgl_asso_leave_employee_balance")
@ApiModel("员工假期余额表")
public class KqglAssoLeaveEmployeeBalance extends Model<KqglAssoLeaveEmployeeBalance> {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "id id", example = "101")
private Integer id;
@ApiModelProperty(value = "假期规则id 假期规则id", example = "101")
private Integer leaveRulesId;
@ApiModelProperty(value = "员工id 员工id", example = "101")
private Integer userid;
@ApiModelProperty(value = "余额天数 ", example = "余额天数")
private double balanceDays;
@ApiModelProperty(value = "最后修改人 最后修改人", example = "101")
private Integer modifyUserid;
@ApiModelProperty(value = "最后修改时间 ", example = "最后修改时间")
private String modifyTimer;
@ApiModelProperty(value = "企业组织代码 企业组织代码", example = "101")
private Integer orgCode;
}
\ No newline at end of file
...@@ -15,14 +15,17 @@ import cn.timer.api.bean.kqmk.KqglAssoBcsz; ...@@ -15,14 +15,17 @@ import cn.timer.api.bean.kqmk.KqglAssoBcsz;
import cn.timer.api.bean.kqmk.KqglAssoDkjl; import cn.timer.api.bean.kqmk.KqglAssoDkjl;
import cn.timer.api.bean.kqmk.KqglAssoDkmx; import cn.timer.api.bean.kqmk.KqglAssoDkmx;
import cn.timer.api.bean.kqmk.KqglAssoLeaveBalance; import cn.timer.api.bean.kqmk.KqglAssoLeaveBalance;
import cn.timer.api.bean.kqmk.KqglAssoLeaveEmployeeBalance;
import cn.timer.api.bean.kqmk.KqglAssoLeaveRules; import cn.timer.api.bean.kqmk.KqglAssoLeaveRules;
import cn.timer.api.bean.kqmk.KqglAssoOvertimeRange;
import cn.timer.api.bean.kqmk.KqglAssoOvertimeRules;
import cn.timer.api.bean.kqmk.KqglAssoRelationSummary; import cn.timer.api.bean.kqmk.KqglAssoRelationSummary;
import cn.timer.api.bean.kqmk.KqglAssoTeshu; import cn.timer.api.bean.kqmk.KqglAssoTeshu;
import cn.timer.api.bean.kqmk.KqglAssoYhkqz;
import cn.timer.api.bean.kqmk.KqglAssoZhoupaiban; import cn.timer.api.bean.kqmk.KqglAssoZhoupaiban;
import cn.timer.api.bean.kqmk.KqglMainKqz; import cn.timer.api.bean.kqmk.KqglMainKqz;
import cn.timer.api.bean.yggl.YgglMainEmp; import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.exception.CustomException; import cn.timer.api.config.exception.CustomException;
import cn.timer.api.controller.kqgl.ClockInController;
import cn.timer.api.controller.kqgl.ClockInTool; import cn.timer.api.controller.kqgl.ClockInTool;
import cn.timer.api.controller.kqgl.EmptyUtil; import cn.timer.api.controller.kqgl.EmptyUtil;
import cn.timer.api.dao.kqmk.KqglAssoLeaveBalanceMapper; import cn.timer.api.dao.kqmk.KqglAssoLeaveBalanceMapper;
...@@ -62,7 +65,7 @@ public class KqglServiceImpl implements KqglService { ...@@ -62,7 +65,7 @@ public class KqglServiceImpl implements KqglService {
.leaveTypeId(leaveappr.getLeavetype()).startTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(leaveappr.getStarttime())) .leaveTypeId(leaveappr.getLeavetype()).startTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(leaveappr.getStarttime()))
.endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(leaveappr.getEndtime())).orgCode(leaveappr.getOrgcode()).build().insert(); .endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(leaveappr.getEndtime())).orgCode(leaveappr.getOrgcode()).build().insert();
} }
YgglMainEmp emp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, leaveappr.getUserid())); YgglMainEmp emp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, leaveappr.getUserid()).eq(YgglMainEmp::getOrgCode, leaveappr.getOrgcode()));
int modifynumber = 1; int modifynumber = 1;
KqglAssoLeaveBalance balan = kqglassoleavebalancemapper.selectOne(new QueryWrapper<KqglAssoLeaveBalance>().lambda().eq(KqglAssoLeaveBalance::getUserid, leaveappr.getUserid()).eq(KqglAssoLeaveBalance::getOrgCode, leaveappr.getOrgcode()) KqglAssoLeaveBalance balan = kqglassoleavebalancemapper.selectOne(new QueryWrapper<KqglAssoLeaveBalance>().lambda().eq(KqglAssoLeaveBalance::getUserid, leaveappr.getUserid()).eq(KqglAssoLeaveBalance::getOrgCode, leaveappr.getOrgcode())
...@@ -72,6 +75,21 @@ public class KqglServiceImpl implements KqglService { ...@@ -72,6 +75,21 @@ public class KqglServiceImpl implements KqglService {
} }
KqglAssoLeaveBalance.builder().leaveRulesId(leaveappr.getLeavetype()).userid(leaveappr.getUserid()).modifyAction(2).balanceDays("-"+leaveappr.getDuration()) KqglAssoLeaveBalance.builder().leaveRulesId(leaveappr.getLeavetype()).userid(leaveappr.getUserid()).modifyAction(2).balanceDays("-"+leaveappr.getDuration())
.reason("系统按照规则自动").modifyUserid(emp.getEmpNum()).modifyTimer(new Date().getTime()).orgCode(emp.getOrgCode()).isAutomatic(1).modifyNumber(modifynumber).build().insert();//员工假期余额 .reason("系统按照规则自动").modifyUserid(emp.getEmpNum()).modifyTimer(new Date().getTime()).orgCode(emp.getOrgCode()).isAutomatic(1).modifyNumber(modifynumber).build().insert();//员工假期余额
//查询员工假期余额表中所对应的假期id
KqglAssoLeaveEmployeeBalance emba = KqglAssoLeaveEmployeeBalance.builder().build().selectOne(new QueryWrapper<KqglAssoLeaveEmployeeBalance>().lambda().eq(KqglAssoLeaveEmployeeBalance::getLeaveRulesId, leaveappr.getLeavetype())
.eq(KqglAssoLeaveEmployeeBalance::getUserid, leaveappr.getUserid()).eq(KqglAssoLeaveEmployeeBalance::getOrgCode, leaveappr.getOrgcode()));
//获取最后得到的最终余额
double balance_days = kqglassoleavebalancemapper.Sumbalancedays(leaveappr.getUserid(), leaveappr.getOrgcode(),leaveappr.getLeavetype());
if(emba != null && balance_days > 0) {
if(emba.getBalanceDays() != -1) {//确认为限制余额的
//修改最终的余额数
KqglAssoLeaveEmployeeBalance.builder().id(emba.getId()).balanceDays(balance_days).build().updateById();
}
}
return true; return true;
} }
...@@ -98,6 +116,8 @@ public class KqglServiceImpl implements KqglService { ...@@ -98,6 +116,8 @@ public class KqglServiceImpl implements KqglService {
if(overappr.getCompensate() == 1) { if(overappr.getCompensate() == 1) {
double duration = 0l;//
int modifynumber = 1; int modifynumber = 1;
KqglAssoLeaveBalance balan = kqglassoleavebalancemapper.selectOne(new QueryWrapper<KqglAssoLeaveBalance>().lambda().eq(KqglAssoLeaveBalance::getUserid, overappr.getUserid()).eq(KqglAssoLeaveBalance::getOrgCode, overappr.getOrgcode()) KqglAssoLeaveBalance balan = kqglassoleavebalancemapper.selectOne(new QueryWrapper<KqglAssoLeaveBalance>().lambda().eq(KqglAssoLeaveBalance::getUserid, overappr.getUserid()).eq(KqglAssoLeaveBalance::getOrgCode, overappr.getOrgcode())
.orderByDesc(KqglAssoLeaveBalance :: getModifyNumber).last("LIMIT 1")); .orderByDesc(KqglAssoLeaveBalance :: getModifyNumber).last("LIMIT 1"));
...@@ -105,8 +125,59 @@ public class KqglServiceImpl implements KqglService { ...@@ -105,8 +125,59 @@ public class KqglServiceImpl implements KqglService {
modifynumber = balan.getModifyNumber()+1; modifynumber = balan.getModifyNumber()+1;
} }
KqglAssoLeaveBalance.builder().leaveRulesId(learul.getId()).userid(overappr.getUserid()).modifyAction(2).balanceDays("+"+overappr.getDuration()) KqglAssoYhkqz yhd = KqglAssoYhkqz.builder().build().selectOne(new QueryWrapper<KqglAssoYhkqz>().lambda().eq(KqglAssoYhkqz::getUserid, overappr.getUserid()).eq(KqglAssoYhkqz::getQyid, overappr.getOrgcode()));
.reason("系统按照规则自动(加班)").modifyUserid(emp.getEmpNum()).modifyTimer(new Date().getTime()).orgCode(emp.getOrgCode()).isAutomatic(1).modifyNumber(modifynumber).build().insert();//员工假期余额 if(yhd != null) {
KqglAssoOvertimeRange timeran = KqglAssoOvertimeRange.builder().build().selectOne(new QueryWrapper<KqglAssoOvertimeRange>().lambda().eq(KqglAssoOvertimeRange::getAttgroupId, yhd.getKqzid()));
if(timeran != null) {
KqglAssoOvertimeRules rul = KqglAssoOvertimeRules.builder().build().selectOne(new QueryWrapper<KqglAssoOvertimeRules>().lambda().eq(KqglAssoOvertimeRules::getId, timeran.getOvertimeRulesId()));
if(rul != null) {
//1:工作日加班;2:休息日加班;3:节假日加班
if(overappr.getOvertimetype() == 1) {
if(rul.getIsWorkovertime() == 1) {
if(rul.getWork() == 1) {
duration = Double.valueOf(rul.getWorkOne()) * overappr.getDuration();
}else if(rul.getWork() == 3) {
duration = Double.valueOf(rul.getWorkThree()) * overappr.getDuration();
}
}
}else if(overappr.getOvertimetype() == 2) {
if(rul.getIsRestovertime() == 1) {
if(rul.getRest() == 1) {
duration = Double.valueOf(rul.getRestOne()) * overappr.getDuration();
}else if(rul.getRest() == 3) {
duration = Double.valueOf(rul.getRestThree()) * overappr.getDuration();
}
}
}else {
if(rul.getIsHolidays() == 1) {
if(rul.getHolidays() == 1) {
duration = Double.valueOf(rul.getHolidaysOne()) * overappr.getDuration();
}else if(rul.getHolidays() == 3) {
duration = Double.valueOf(rul.getHolidaysThree()) * overappr.getDuration();
}
}
}
}
}
}
KqglAssoLeaveBalance.builder().leaveRulesId(learul.getId()).userid(overappr.getUserid()).modifyAction(2).balanceDays("+"+duration)
.reason("系统按照审批自动(加班)").modifyUserid(emp.getEmpNum()).modifyTimer(overappr.getStarttime()).orgCode(emp.getOrgCode()).isAutomatic(1).modifyNumber(modifynumber).build().insert();//员工假期余额
//查询员工假期余额表中所对应的假期id
KqglAssoLeaveEmployeeBalance emba = KqglAssoLeaveEmployeeBalance.builder().build().selectOne(new QueryWrapper<KqglAssoLeaveEmployeeBalance>().lambda().eq(KqglAssoLeaveEmployeeBalance::getLeaveRulesId, learul.getId())
.eq(KqglAssoLeaveEmployeeBalance::getUserid, overappr.getUserid()).eq(KqglAssoLeaveEmployeeBalance::getOrgCode, overappr.getOrgcode()));
//获取最后得到的最终余额
double balance_days = kqglassoleavebalancemapper.Sumbalancedays(overappr.getUserid(), overappr.getOrgcode(),learul.getId());
if(emba != null && balance_days > 0) {
if(emba.getBalanceDays() != -1) {//确认为限制余额的
//修改最终的余额数
KqglAssoLeaveEmployeeBalance.builder().id(emba.getId()).balanceDays(balance_days).build().updateById();
}
}
} }
return true; return true;
...@@ -123,7 +194,7 @@ public class KqglServiceImpl implements KqglService { ...@@ -123,7 +194,7 @@ public class KqglServiceImpl implements KqglService {
String[] days=ClockInTool.listToString(ClockInTool.getDays(startdate,enddate)).split(","); String[] days=ClockInTool.listToString(ClockInTool.getDays(startdate,enddate)).split(",");
for(String num : days) { for(String num : days) {
//记入打卡月汇总关联表 //记入打卡月汇总关联表
KqglAssoRelationSummary.builder().userId(evecappr.getUserid()).appTime(num).approvalId(evecappr.getEvectionid()).approvalType(3) KqglAssoRelationSummary.builder().userId(evecappr.getUserid()).appTime(num).approvalId(evecappr.getEvectionid()).approvalType(3).duration(evecappr.getDuration())
.startTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(evecappr.getStarttime())).endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(evecappr.getEndtime())) .startTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(evecappr.getStarttime())).endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(evecappr.getEndtime()))
.orgCode(evecappr.getOrgcode()).build().insert(); .orgCode(evecappr.getOrgcode()).build().insert();
} }
...@@ -133,7 +204,7 @@ public class KqglServiceImpl implements KqglService { ...@@ -133,7 +204,7 @@ public class KqglServiceImpl implements KqglService {
String[] days=ClockInTool.listToString(ClockInTool.getDays(startdate,enddate)).split(","); String[] days=ClockInTool.listToString(ClockInTool.getDays(startdate,enddate)).split(",");
for(String num : days) { for(String num : days) {
//记入打卡月汇总关联表 //记入打卡月汇总关联表
KqglAssoRelationSummary.builder().userId(evecappr.getUserid()).appTime(num).approvalId(evecappr.getEvectionid()).approvalType(4) KqglAssoRelationSummary.builder().userId(evecappr.getUserid()).appTime(num).approvalId(evecappr.getEvectionid()).approvalType(4).duration(evecappr.getDuration())
.startTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(evecappr.getStarttime())).endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(evecappr.getEndtime())) .startTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(evecappr.getStarttime())).endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(evecappr.getEndtime()))
.orgCode(evecappr.getOrgcode()).build().insert(); .orgCode(evecappr.getOrgcode()).build().insert();
} }
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
package cn.timer.api.controller.yggl; package cn.timer.api.controller.yggl;
import java.io.IOException; import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Date; import java.util.Date;
...@@ -60,6 +61,7 @@ import cn.hutool.poi.excel.ExcelWriter; ...@@ -60,6 +61,7 @@ import cn.hutool.poi.excel.ExcelWriter;
import cn.timer.api.bean.clazz.CommonArea; import cn.timer.api.bean.clazz.CommonArea;
import cn.timer.api.bean.clazz.SysRegion; import cn.timer.api.bean.clazz.SysRegion;
import cn.timer.api.bean.kqmk.KqglAssoLeaveBalance; import cn.timer.api.bean.kqmk.KqglAssoLeaveBalance;
import cn.timer.api.bean.kqmk.KqglAssoLeaveEmployeeBalance;
import cn.timer.api.bean.kqmk.KqglAssoLeaveRules; import cn.timer.api.bean.kqmk.KqglAssoLeaveRules;
import cn.timer.api.bean.qyzx.QyzxEmpEntAsso; import cn.timer.api.bean.qyzx.QyzxEmpEntAsso;
import cn.timer.api.bean.qyzx.QyzxEmpLogin; import cn.timer.api.bean.qyzx.QyzxEmpLogin;
...@@ -289,25 +291,19 @@ public class YgglController { ...@@ -289,25 +291,19 @@ public class YgglController {
.empNum(login.getId()).orgCode(orgCode).bmgwId(bmgwId).build(); .empNum(login.getId()).orgCode(orgCode).bmgwId(bmgwId).build();
ygglMainEmp.insert(); ygglMainEmp.insert();
//假期规则初始化 //假期规则初始化
String current_time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
List<KqglAssoLeaveRules> rul = KqglAssoLeaveRules.builder().build().selectList(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getOrgCode, orgCode)); List<KqglAssoLeaveRules> rul = KqglAssoLeaveRules.builder().build().selectList(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getOrgCode, orgCode));
for(KqglAssoLeaveRules r : rul) { for(KqglAssoLeaveRules r : rul) {
if(r.getLeaveBalance() == 0) { if(r.getLeaveBalance() == 0) {
KqglAssoLeaveBalance.builder().leaveRulesId(r.getId()).userid(ygglMainEmp.getEmpNum()).modifyAction(2).balanceDays("-1") KqglAssoLeaveEmployeeBalance.builder().leaveRulesId(r.getId()).userid(ygglMainEmp.getEmpNum()).balanceDays(-1).modifyUserid(userBean.getEmpNum()).modifyTimer(current_time).orgCode(userBean.getOrgCode()).build().insert();
.reason("不限制余额").modifyUserid(ygglMainEmp.getEmpNum()).modifyTimer(new Date().getTime()).orgCode(userBean.getOrgCode()).isAutomatic(1).modifyNumber(1).build().insert();//员工假期余额
}else { }else {
KqglAssoLeaveBalance.builder().leaveRulesId(r.getId()).userid(ygglMainEmp.getEmpNum()).modifyAction(1).balanceDays("+0") KqglAssoLeaveEmployeeBalance.builder().leaveRulesId(r.getId()).userid(ygglMainEmp.getEmpNum()).balanceDays(0.0).modifyUserid(userBean.getEmpNum()).modifyTimer(current_time).orgCode(userBean.getOrgCode()).build().insert();
.reason("系统按照规则自动").modifyUserid(ygglMainEmp.getEmpNum()).modifyTimer(new Date().getTime()).orgCode(userBean.getOrgCode()).isAutomatic(1).modifyNumber(1).build().insert();//员工假期余额
} }
} }
return ResultUtil.data(ygglMainEmp, "添加员工成功!"); return ResultUtil.data(ygglMainEmp, "添加员工成功!");
} else { } else {
return ResultUtil.error("该手机号已被使用,请输入正确手机号"); return ResultUtil.error("该手机号已被使用,请输入正确手机号");
......
...@@ -28,5 +28,7 @@ public interface KqglAssoLeaveBalanceMapper extends BaseMapper<KqglAssoLeaveBala ...@@ -28,5 +28,7 @@ public interface KqglAssoLeaveBalanceMapper extends BaseMapper<KqglAssoLeaveBala
List<AdditionalDto> selectAdditionalList(int orgcode); List<AdditionalDto> selectAdditionalList(int orgcode);
JiaqibalanceDto selectleavebalanceList(int leaverulesid,int userid); // JiaqibalanceDto selectleavebalanceList(int leaverulesid,int userid);
Double Sumbalancedays(int userid,int orgcode,int leaverulesid);
} }
package cn.timer.api.dao.kqmk;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.kqmk.KqglAssoLeaveEmployeeBalance;
/**
* 员工假期余额表
*
* @author lal 2020-06-22
*/
@Repository
public interface KqglAssoLeaveEmployeeBalanceMapper extends BaseMapper<KqglAssoLeaveEmployeeBalance> {
}
package cn.timer.api.dto.kqmk; package cn.timer.api.dto.kqmk;
import java.io.Serializable;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
...@@ -10,11 +12,23 @@ import lombok.NoArgsConstructor; ...@@ -10,11 +12,23 @@ import lombok.NoArgsConstructor;
@Builder @Builder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class BalanceSheetDataDto { public class BalanceSheetDataDto implements Serializable{
/**
*
*/
private static final long serialVersionUID = -6994914131126332691L;
/**
*
*/
@ApiModelProperty(value = "id id", example = "101")
private Integer yzid;
@ApiModelProperty(value = "假期规则id", example = "字段说明") @ApiModelProperty(value = "假期规则id", example = "字段说明")
private Integer leaverulesid; private Integer leaverulesid;
@ApiModelProperty(value = "余额天数 ", example = "字段说明") @ApiModelProperty(value = "余额天数 ", example = "字段说明")
private Integer balancedays; private double balancedays;
} }
...@@ -18,6 +18,7 @@ public class DailyDetailsDto { ...@@ -18,6 +18,7 @@ public class DailyDetailsDto {
private Integer num;// 工号 private Integer num;// 工号
private String dept;// 部门 private String dept;// 部门
private String post;// 岗位 private String post;// 岗位
private Integer orgcode;// 岗位
private String attname;// 考勤组名称 private String attname;// 考勤组名称
private Integer attpbfs;// 排班方式(1:固定排班;2:自由排班;3:自由工时) private Integer attpbfs;// 排班方式(1:固定排班;2:自由排班;3:自由工时)
private String attdate;// 考勤日期 private String attdate;// 考勤日期
......
package cn.timer.api.dto.kqmk; package cn.timer.api.dto.kqmk;
import java.io.Serializable;
import java.util.List; import java.util.List;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
...@@ -21,7 +22,16 @@ import lombok.NoArgsConstructor; ...@@ -21,7 +22,16 @@ import lombok.NoArgsConstructor;
@Builder @Builder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class KqglAssoMonthPunchSummaryDto { public class KqglAssoMonthPunchSummaryDto implements Serializable{
/**
*
*/
private static final long serialVersionUID = -6391675154319774211L;
/**
*
*/
@Id @Id
@GeneratedValue @GeneratedValue
......
...@@ -18,4 +18,7 @@ public class LeaveTypeDto { ...@@ -18,4 +18,7 @@ public class LeaveTypeDto {
@ApiModelProperty(value = "假期名称", example = "事假、调休...") @ApiModelProperty(value = "假期名称", example = "事假、调休...")
private String value; private String value;
@ApiModelProperty(value = "假期单位", example = "1:按天请假;2:按半天;3:按小时")
private String company;
} }
package cn.timer.api.dto.kqmk;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SummaryDisplayDto {
private List<DailyDetailsDto> sumlist;
}
package cn.timer.api.dto.kqmk;
import org.apache.poi.ss.formula.functions.T;
import cn.timer.api.utils.Result;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SuperfluousDto<T> extends Result<T>{
/**
*
*/
private static final long serialVersionUID = -4971179863446442731L;
private int num;
private int nums;
}
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
</sql> </sql>
<select id="selectPageByQueryLeaveBalance" resultMap="LeaveBalanceMap"> <select id="selectPageByQueryLeaveBalance" resultMap="LeaveBalanceMap">
SELECT emp.emp_num as empnum, <!-- SELECT emp.emp_num as empnum,
emp.`name` as empname, emp.`name` as empname,
IFNULL(c.name,'') as department, IFNULL(c.name,'') as department,
IFNULL(emp.rz_time,'') as rztime, IFNULL(emp.rz_time,'') as rztime,
...@@ -82,6 +82,18 @@ ...@@ -82,6 +82,18 @@
from kqgl_asso_leave_balance bal from kqgl_asso_leave_balance bal
where bal.org_code = #{param.orgCode} where bal.org_code = #{param.orgCode}
GROUP BY bal.userid,bal.leave_rules_id) as yz on yz.userid = emp.emp_num GROUP BY bal.userid,bal.leave_rules_id) as yz on yz.userid = emp.emp_num
where emp.org_code = #{param.orgCode} -->
SELECT emp.emp_num as empnum,
emp.`name` as empname,
IFNULL(c.name,'') as department,
IFNULL(emp.rz_time,'') as rztime,
yz.leave_rules_id as leaverulesid,
yz.balance_days as balancedays
from yggl_main_emp emp
LEFT JOIN zzgl_bmgw_m as gw on gw.id = emp.bmgw_id
LEFT JOIN zzgl_bmgw_m as c ON c.id = gw.up_id
LEFT JOIN kqgl_asso_leave_employee_balance as yz on yz.userid = emp.emp_num
where emp.org_code = #{param.orgCode} where emp.org_code = #{param.orgCode}
<if test="param.query != null and param.query != ''"> <if test="param.query != null and param.query != ''">
and ( emp.`name` like CONCAT('%',#{param.query},'%') or and ( emp.`name` like CONCAT('%',#{param.query},'%') or
...@@ -120,11 +132,15 @@ ...@@ -120,11 +132,15 @@
</select> </select>
<select id="selectleavebalanceList" resultMap="JiaqibalanceMap"> <!-- <select id="selectleavebalanceList" resultMap="JiaqibalanceMap">
select bal.userid,SUM(bal.balance_days) as balancedays select bal.userid,SUM(bal.balance_days) as balancedays
from kqgl_asso_leave_balance bal from kqgl_asso_leave_balance bal
where bal.leave_rules_id = #{leaverulesid} and bal.userid = #{userid} where bal.leave_rules_id = #{leaverulesid} and bal.userid = #{userid}
GROUP BY bal.userid GROUP BY bal.userid
</select> -->
<select id="Sumbalancedays" resultType="java.lang.Double">
select SUM(ba.balance_days) from kqgl_asso_leave_balance ba where ba.userid = #{userid} and ba.org_code = #{orgcode} and ba.leave_rules_id = #{leaverulesid}
</select> </select>
<!-- <!--
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.timer.api.dao.kqmk.KqglAssoLeaveEmployeeBalanceMapper">
<resultMap id="BaseResultMap" type="cn.timer.api.bean.kqmk.KqglAssoLeaveEmployeeBalance" >
<id column="id" property="id" />
<result column="leave_rules_id" property="leaveRulesId" />
<result column="userid" property="userid" />
<result column="balance_days" property="balanceDays" />
<result column="modify_userid" property="modifyUserid" />
<result column="modify_timer" property="modifyTimer" />
<result column="org_code" property="orgCode" />
</resultMap>
<sql id="Base_Column_List">
id,
leave_rules_id,
userid,
balance_days,
modify_userid,
modify_timer,
org_code
</sql>
<sql id="Base_Column_List_Alias">
id KqglAssoLeaveEmployeeBalance_id,
leave_rules_id KqglAssoLeaveEmployeeBalance_leave_rules_id,
userid KqglAssoLeaveEmployeeBalance_userid,
balance_days KqglAssoLeaveEmployeeBalance_balance_days,
modify_userid KqglAssoLeaveEmployeeBalance_modify_userid,
modify_timer KqglAssoLeaveEmployeeBalance_modify_timer,
org_code KqglAssoLeaveEmployeeBalance_org_code
</sql>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoLeaveEmployeeBalance">
INSERT INTO kqgl_asso_leave_employee_balance
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != leaveRulesId'>
leave_rules_id,
</if>
<if test ='null != userid'>
userid,
</if>
<if test ='null != balanceDays'>
balance_days,
</if>
<if test ='null != modifyUserid'>
modify_userid,
</if>
<if test ='null != modifyTimer'>
modify_timer,
</if>
<if test ='null != orgCode'>
org_code
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != leaveRulesId'>
#{leaveRulesId},
</if>
<if test ='null != userid'>
#{userid},
</if>
<if test ='null != balanceDays'>
#{balanceDays},
</if>
<if test ='null != modifyUserid'>
#{modifyUserid},
</if>
<if test ='null != modifyTimer'>
#{modifyTimer},
</if>
<if test ='null != orgCode'>
#{orgCode}
</if>
</trim>
</insert>
<delete id="delete" >
DELETE FROM kqgl_asso_leave_employee_balance
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.kqmk.KqglAssoLeaveEmployeeBalance">
UPDATE kqgl_asso_leave_employee_balance
<set>
<if test ='null != leaveRulesId'>leave_rules_id = #{leaveRulesId},</if>
<if test ='null != userid'>userid = #{userid},</if>
<if test ='null != balanceDays'>balance_days = #{balanceDays},</if>
<if test ='null != modifyUserid'>modify_userid = #{modifyUserid},</if>
<if test ='null != modifyTimer'>modify_timer = #{modifyTimer},</if>
<if test ='null != orgCode'>org_code = #{orgCode}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_leave_employee_balance
WHERE id = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_leave_employee_balance
LIMIT #{offset}, #{pageSize}
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM kqgl_asso_leave_employee_balance
</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