Commit eb7ce0c7 by ilal

考勤机打卡

parent d0a165c8
package cn.timer.api.bean.kqmk;
import javax.persistence.Entity;
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.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author LAL 2020-05-11
*/
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "kqgl_asso_dkjl")
@ApiModel("打卡记录表")
public class KqglAssoDkjl extends Model<KqglAssoDkjl> {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "id id", example = "101")
private Integer id;
@ApiModelProperty(value = "打卡时间 打卡时间", example = "101")
private Long dktime;
@ApiModelProperty(value = "经度 ", example = "经度")
private Double lon;
@ApiModelProperty(value = "纬度 ", example = "纬度")
private Double lat;
@ApiModelProperty(value = "定位地址 ", example = "定位地址")
private String address;
@ApiModelProperty(value = "打卡结果 打卡结果", example = "101")
private Integer results;
@ApiModelProperty(value = "用户id 用户id", example = "101")
private Integer userId;
@ApiModelProperty(value = "类型(0:无排班打卡 1:上班 2:下班)", example = "101")
private Integer type;
@ApiModelProperty(value = "(0:打卡无效:此记录已被更新 1:正常 2:异常 3:迟到 4:早退 5:补卡 6:请假 7:加班 8:调休)", example = "101")
private Integer status;
@ApiModelProperty(value = "序号(0:打卡无效:此记录已被更新) 序号(0:打卡无效:此记录已被更新)", example = "101")
private Integer sort;
@ApiModelProperty(value = "打卡类型(1:GPS 2:WIFI 3:考勤机)", example = "101")
private Integer cardType;
@ApiModelProperty(value = "mac地址 ", example = "mac地址")
private String mac;
@ApiModelProperty(value = "wifi名称 ", example = "wifi名称")
private String macname;
@ApiModelProperty(value = "企业id 企业id", example = "101")
private Integer qyid;
@ApiModelProperty(value = "考勤日期 ", example = "考勤日期")
private String attdate;
@ApiModelProperty(value = "考勤时间 ", example = "考勤时间")
private Long attime;
@ApiModelProperty(value = "打卡明细id 打卡明细id", example = "101")
private Integer dkmxid;
@ApiModelProperty(value = "班次id 班次id", example = "101")
private Integer bcid;
@ApiModelProperty(value = "考勤备注 ", example = "考勤备注")
private String remarks;
@ApiModelProperty(value = "考勤机打卡方式==>1:指紋;2:人脸;3:密码;4:ID卡 考勤机打卡方式==>1:指紋;2:人脸;3:密码;4:ID卡", example = "101")
private Integer punchmode;
@ApiModelProperty(value = "打卡设备 ", example = "打卡设备")
private String punchequipment;
}
\ No newline at end of file
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.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author LAL 2020-05-11
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "kqgl_asso_dkmx")
@ApiModel("打卡明细表")
public class KqglAssoDkmx extends Model<KqglAssoDkmx> {
/**
*
*/
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 userid;
@ApiModelProperty(value = "日期 ", example = "日期")
private String data;
@ApiModelProperty(value = "上班1打卡时间 上班1打卡时间", example = "101")
private Long sbdk1;
@ApiModelProperty(value = "上班1打卡结果 上班1打卡结果", example = "101")
private Integer sbdk1jg;
@ApiModelProperty(value = "下班1打卡时间 下班1打卡时间", example = "101")
private Long xbdk1;
@ApiModelProperty(value = "下班1打卡结果 下班1打卡结果", example = "101")
private Integer xbdk1jg;
@ApiModelProperty(value = "上班2打卡时间 上班2打卡时间", example = "101")
private Long sbdk2;
@ApiModelProperty(value = "上班2打卡结果 上班2打卡结果", example = "101")
private Integer sbdk2jg;
@ApiModelProperty(value = "下班2打卡时间 下班2打卡时间", example = "101")
private Long xbdk2;
@ApiModelProperty(value = "下班2打卡结果 下班2打卡结果", example = "101")
private Integer xbdk2jg;
@ApiModelProperty(value = "上班3打卡时间 上班3打卡时间", example = "101")
private Long sbdk3;
@ApiModelProperty(value = "上班3打卡结果 上班3打卡结果", example = "101")
private Integer sbdk3jg;
@ApiModelProperty(value = "下班3打卡时间 下班3打卡时间", example = "101")
private Long xbdk3;
@ApiModelProperty(value = "下班3打卡结果 下班3打卡结果", example = "101")
private Integer xbdk3jg;
@ApiModelProperty(value = "应打卡次数 应打卡次数", example = "101")
private Integer ydkcs;
@ApiModelProperty(value = "工作时长 ", example = "工作时长")
private Double gzsc;
@ApiModelProperty(value = "企业id 企业id", example = "101")
private Integer qyid;
@ApiModelProperty(value = "打卡时间 打卡时间", example = "101")
private Long dksj;
}
\ No newline at end of file
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.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author LAL 2020-05-11
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "kqgl_asso_pbmx")
@ApiModel("排班明细表")
public class KqglAssoPbmx extends Model<KqglAssoPbmx> {
/**
*
*/
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 userid;
@ApiModelProperty(value = "日期 ", example = "日期")
private String data;
@ApiModelProperty(value = "班次id 班次id", example = "101")
private Integer bcid;
@ApiModelProperty(value = "考勤组id 考勤组id", example = "101")
private Integer kqzid;
}
\ No newline at end of file
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.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author LAL 2020-05-11
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "kqgl_asso_teshu")
@ApiModel("特殊日期表")
public class KqglAssoTeshu extends Model<KqglAssoTeshu> {
/**
*
*/
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 kqzid;
@ApiModelProperty(value = "日期 ", example = "日期")
private String tsrq;
@ApiModelProperty(value = "班次id 班次id", example = "101")
private Integer bcid;
@ApiModelProperty(value = "录入时间 录入时间", example = "101")
private Integer lusjTime;
@ApiModelProperty(value = "录入人员 录入人员", example = "101")
private Integer luryid;
@ApiModelProperty(value = "类型(1:必须打卡日期;2:不用打卡日期(扩展字段)) 类型(1:必须打卡日期;2:不用打卡日期(扩展字段))", example = "101")
private Integer type;
}
\ No newline at end of file
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.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author LAL 2020-05-11
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "kqgl_asso_zhoupaiban")
@ApiModel("考勤周排班")
public class KqglAssoZhoupaiban extends Model<KqglAssoZhoupaiban> {
/**
*
*/
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 kqzid;
@ApiModelProperty(value = "类型(1:周一、2:周二、3:周三。。。。、8:周一到周日统一班次、9:排班制) 类型(1:周一、2:周二、3:周三。。。。、8:周一到周日统一班次、9:排班制)", example = "101")
private Integer type;
@ApiModelProperty(value = "班次id(0:自由工时 班次id【大于0为:固定排班和排班制】)", example = "101")
private Integer bcid;
}
\ No newline at end of file
......@@ -45,7 +45,7 @@ public class WebSecurityConfig implements WebMvcConfigurer {
.excludePathPatterns("/v2/**")
.excludePathPatterns("/**/*.js")
.excludePathPatterns("/8timer/**")
.excludePathPatterns("/kqz/punchclock/**")
.excludePathPatterns("/kqdk/punchclock/**")
.excludePathPatterns("/kqz/sauserregdata/**")
.excludePathPatterns("/login/*")
.excludePathPatterns("/swagger*/**")
......
package cn.timer.api.controller.kqgl;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.hutool.json.JSONObject;
import cn.timer.api.bean.kqmk.KqglAssoBcsz;
import cn.timer.api.bean.kqmk.KqglAssoDkjl;
import cn.timer.api.bean.kqmk.KqglAssoDkmx;
import cn.timer.api.bean.kqmk.KqglAssoKqj;
import cn.timer.api.bean.kqmk.KqglAssoKqzdkfs;
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.yggl.YgglMainEmp;
import cn.timer.api.config.exception.CustomException;
import cn.timer.api.dao.kqmk.KqglAssoPbmxMapper;
import cn.timer.api.dao.kqmk.KqglMainKqzMapper;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dto.kqmk.AttLateLate;
import cn.timer.api.dto.kqmk.AttSchedule;
import cn.timer.api.dto.kqmk.AttendanceCardListDto;
import cn.timer.api.dto.kqmk.ClockCollectData;
import cn.timer.api.dto.kqmk.KqglAssoPbmxDto;
import cn.timer.api.utils.DateUtil;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@Api(tags = "3.0考勤打卡")
@RestController
@Transactional
@RequestMapping(value = "/kqdk", produces = { "application/json", "multipart/form-data" })
public class ClockInController {
@Autowired
private KqglMainKqzMapper kqglmainkqzmapper;
/**
* 考勤打卡
*
* @param json dev_id : 考勤机id user_id : 打卡用户id verify_mode : 打卡方式(1:指纹、20:人脸)
* io_time : 打卡时间
* @return
*/
@PostMapping(value = "/punchclock")
@ApiOperation(value = "1:考勤机打卡", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 1)
public Result<Object> punchclock(@RequestParam String json) throws Exception {
JSONObject jsonArray = new JSONObject(json);
String asDevId = jsonArray.get("dev_id").toString();
String asUserId = jsonArray.get("user_id").toString();
String asVerifyMode = jsonArray.get("verify_mode").toString();
String asIOMode = "0";
String sStdIoTime = jsonArray.get("io_time").toString();
KqglAssoKqj kqjdev = KqglAssoKqj.builder().build().selectOne(new QueryWrapper<KqglAssoKqj>().lambda().eq(KqglAssoKqj::getCode, asDevId));
if (kqjdev == null)
return ResultUtil.error("考勤机不存在!");
// YgglMainEmp user = new LambdaQueryChainWrapper<YgglMainEmp>(ygglmainempmapper).eq(YgglMainEmp::getEmpNum, asUserId).eq(YgglMainEmp::getOrgCode, kqjdev.getQyid()).one();
YgglMainEmp user = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, asUserId).eq(YgglMainEmp::getOrgCode, kqjdev.getQyid()));
if(user != null) {
int qyid = user.getOrgCode();//坏小孩【企业id】
int userid = user.getEmpNum();//用户id
KqglMainKqz attgro = kqglmainkqzmapper.getAttendanceGroupInformationByUserid(userid,qyid); //考勤组信息
//pbfs;// 排班方式 1:固定排班;2:自由排班;3:自由工时
if(attgro != null) {
List<KqglAssoKqzdkfs> kqjs = KqglAssoKqzdkfs.builder().build().selectList(new QueryWrapper<KqglAssoKqzdkfs>().lambda().eq(KqglAssoKqzdkfs::getKqzId, attgro.getId()));
if(kqjs.size() > 0) {
long time_ = DateUtil.getStringTime(sStdIoTime, "yyyy-MM-dd HH:mm:ss");
String putime = new SimpleDateFormat("yyyy-MM-dd").format(time_);//转换打卡时间格式
//打卡当天开始时间,打卡当天结束时间
Long startDate = DateUtil.getStartTime(0,DateUtil.getStringTime(putime,"yyyy-MM-dd")).getTime();
Long endDate = DateUtil.getnowEndTime(23,DateUtil.getStringTime(putime,"yyyy-MM-dd")).getTime();
int dkmx = 0;
//查询打卡当天是否有记录
KqglAssoDkmx dkmc = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userid)
.gt(KqglAssoDkmx::getDksj, startDate).lt(KqglAssoDkmx::getDksj, endDate));
AttendanceCardListDto attdate = MethodCall(qyid,userid,putime);
ClockCollectData clockt = new ClockCollectData();
long starttime1 = 0,starttime1ks = 0,starttime1js = 0,endtime1 = 0,endtime1ks = 0,endtime1js = 0,starttime2 = 0,starttime2ks = 0,starttime2js = 0,endtime2 = 0,endtime2ks = 0,endtime2js = 0,starttime3 = 0,starttime3ks = 0,starttime3js = 0,
endtime3 = 0,endtime3ks = 0,endtime3js = 0;
if(attdate.getAttsch().size() > 0) {
List<AttSchedule> ash = attdate.getAttsch();
int y = 0;
clockt.setShifid(ash.get(y).getId());
if(attdate.getAttsch().size() == 2 || attdate.getAttsch().size() == 4 || attdate.getAttsch().size() == 6) {
starttime1 = ash.get(0).getTime();starttime1ks = ash.get(0).getStarttime();starttime1js = ash.get(0).getEndtime();
endtime1 = ash.get(1).getTime();endtime1ks = ash.get(1).getStarttime();endtime1js = ash.get(1).getEndtime();
}
if(attdate.getAttsch().size() == 4 || attdate.getAttsch().size() == 6) {
starttime2 = ash.get(2).getTime();starttime2ks = ash.get(2).getStarttime();starttime2js = ash.get(2).getEndtime();
endtime2 = ash.get(3).getTime();endtime2ks = ash.get(3).getStarttime();endtime2js = ash.get(3).getEndtime();
}
if(attdate.getAttsch().size() == 6) {
starttime3 = ash.get(4).getTime();starttime3ks = ash.get(4).getStarttime();starttime3js = ash.get(4).getEndtime();
endtime3 = ash.get(5).getTime();endtime3ks = ash.get(5).getStarttime();endtime3js = ash.get(5).getEndtime();
}
}
long punchcardtime,punchstart,punchend = 0;//应打卡时间,应打卡开始时间,应打卡结束时间
int atttype = 0;
if(dkmc == null) {//上班1 ****新增
punchcardtime = starttime1;
punchstart = starttime1ks;
punchend = starttime1js;
atttype = 1;
}else {
if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() == null)){ //下班1
punchcardtime = endtime1;punchstart = endtime1ks;punchend = endtime1js;atttype = 2;
}else if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (!("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() != null)
&& (("").equals(dkmc.getSbdk2()) || dkmc.getSbdk2() == null)){ //上班2
punchcardtime = starttime2;punchstart = starttime2ks;punchend = starttime2js;atttype = 3;
}else if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (!("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() != null)
&& (!("").equals(dkmc.getSbdk2()) || dkmc.getSbdk2() != null) && (("").equals(dkmc.getXbdk2()) || dkmc.getXbdk2() == null)){ //下班2
punchcardtime = endtime2;punchstart = endtime2ks;punchend = endtime2js;atttype = 4;
}else if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (!("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() != null)
&& (!("").equals(dkmc.getSbdk2()) || dkmc.getSbdk2() != null) && (!("").equals(dkmc.getXbdk2()) || dkmc.getXbdk2() != null)
&& (("").equals(dkmc.getSbdk3()) || dkmc.getSbdk3() == null)){ //上班3
punchcardtime = starttime3;punchstart = starttime3ks;punchend = starttime3js;atttype = 5;
}else if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (!("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() != null)
&& (!("").equals(dkmc.getSbdk2()) || dkmc.getSbdk2() != null) && (!("").equals(dkmc.getXbdk2()) || dkmc.getXbdk2() != null)
&& (!("").equals(dkmc.getSbdk3()) || dkmc.getSbdk3() != null) && (("").equals(dkmc.getXbdk3()) || dkmc.getXbdk3() == null)){ //下班3
punchcardtime = endtime3;punchstart = endtime3ks;punchend = endtime3js;atttype = 6;
}else {
punchcardtime = 0;punchstart = 0;punchend = 0;atttype = 7;
}
}
KqglAssoBcsz shif = KqglAssoBcsz.builder().build();
if(attdate.getAttsch().size() > 0 && clockt.getShifid() > 0){//有无班次
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, clockt.getShifid()));
}
//打卡记录录入 -- 打卡是否有时间范围限制
boolean isRange = true;
if(punchstart>0 && punchend>0) {
String staputime = new SimpleDateFormat("HH:mm").format(punchstart);//应打卡开始时间
String entputime = new SimpleDateFormat("HH:mm").format(punchend);//应打卡结束时间
String DKputime = new SimpleDateFormat("HH:mm").format(time_);//打卡时间
boolean effectiveDate = ClockInTool.hourMinuteBetween(DKputime, staputime, entputime);
if (!effectiveDate) {
System.out.println("当前打卡时间不在范围内");
// 手动抛出异常
isRange = false;
// throw new Exception();
}
}
if(isRange) {
if(dkmc == null) {//上班1 ****新增
int sbdk1jg = 0;
if(punchcardtime != 0){//有应打卡时间时
Long time = (time_ - punchcardtime)/1000/60;
if(time > 0){sbdk1jg = Math.abs(Integer.valueOf(time.toString()));}//上班1打卡结果
}
int ydkcs = 0;
if(shif != null){ydkcs = shif.getSxbcs()*2;}//应打卡次数
KqglAssoDkmx pcd = KqglAssoDkmx.builder().userid(userid).data(putime).sbdk1(time_).sbdk1jg(sbdk1jg).ydkcs(ydkcs).qyid(qyid).dksj(startDate).build();
if (!pcd.insert()) {
throw new CustomException("打卡明细-新增异常-1");
}
dkmx = pcd.getId();
}else { //*****修改
dkmx = dkmc.getId();
if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() == null)){//下班1
int xbdk1jg = 0;
if(punchcardtime != 0){//有应打卡时间时
Long time = (time_ - punchcardtime)/1000/60;
if(time > 0){}else{xbdk1jg = Math.abs(Integer.valueOf(time.toString()));}//上班1打卡结果
}
double gzsc = 0;
if(dkmc.getSbdk1() != null){
Long time = (time_ - dkmc.getSbdk1())/1000/60;
gzsc = Math.abs(Double.valueOf(time.toString()));//只打一次卡时计算工作时长
}
KqglAssoDkmx.builder().id(dkmc.getId()).xbdk1(time_).xbdk1jg(xbdk1jg).gzsc(gzsc).build().updateById();
}else if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (!("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() != null)
&& (("").equals(dkmc.getSbdk2()) || dkmc.getSbdk2() == null)){//上班2
int sbdk2jg = 0;
if(punchcardtime != 0){//有应打卡时间时
Long time = (time_ - punchcardtime)/1000/60;
if(time > 0){sbdk2jg = Math.abs(Integer.valueOf(time.toString()));}
}
KqglAssoDkmx.builder().id(dkmc.getId()).sbdk2(time_).sbdk2jg(sbdk2jg).build().updateById();
}else if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (!("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() != null)
&& (!("").equals(dkmc.getSbdk2()) || dkmc.getSbdk2() != null) && (("").equals(dkmc.getXbdk2()) || dkmc.getXbdk2() == null)){//下班2
int xbdk2jg = 0;
if(punchcardtime != 0){//有应打卡时间时
Long time = (time_ - punchcardtime)/1000/60;
if(time > 0){}else{xbdk2jg = Math.abs(Integer.valueOf(time.toString()));}
}
//班次为4次时,计算工作时长
double worktime = 0;
if(dkmc.getSbdk2() != null){
Long time = (time_ - dkmc.getSbdk2())/1000/60;
BigDecimal om = new BigDecimal(dkmc.getGzsc());
BigDecimal on = new BigDecimal(time);
worktime = Math.abs(om.add(on).doubleValue());
}
KqglAssoDkmx.builder().id(dkmc.getId()).xbdk2(time_).xbdk2jg(xbdk2jg).gzsc(worktime).build().updateById();
}else if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (!("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() != null)
&& (!("").equals(dkmc.getSbdk2()) || dkmc.getSbdk2() != null) && (!("").equals(dkmc.getXbdk2()) || dkmc.getXbdk2() != null)
&& (("").equals(dkmc.getSbdk3()) || dkmc.getSbdk3() == null)){//上班3
int sbdk3jg = 0;
if(punchcardtime != 0){//有应打卡时间时
Long time = (time_ - punchcardtime)/1000/60;
if(time > 0){sbdk3jg = Math.abs(Integer.valueOf(time.toString()));}
}
KqglAssoDkmx.builder().id(dkmc.getId()).sbdk3(time_).sbdk3jg(sbdk3jg).build().updateById();
}else if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (!("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() != null)
&& (!("").equals(dkmc.getSbdk2()) || dkmc.getSbdk2() != null) && (!("").equals(dkmc.getXbdk2()) || dkmc.getXbdk2() != null)
&& (!("").equals(dkmc.getSbdk3()) || dkmc.getSbdk3() != null) && (("").equals(dkmc.getXbdk3()) || dkmc.getXbdk3() == null)){//下班3
int xbdk3jg = 0;
if(punchcardtime != 0){//有应打卡时间时
Long time = (time_ - punchcardtime)/1000/60;
if(time > 0){}else{xbdk3jg = Math.abs(Integer.valueOf(time.toString()));}
}
//班次为6次时,计算工作时长
double worktime = 0;
if(dkmc.getSbdk3() != null){
Long time = (time_ - dkmc.getSbdk3())/1000/60;
BigDecimal om = new BigDecimal(dkmc.getGzsc());//第二次
BigDecimal on = new BigDecimal(time);
worktime = Math.abs(om.add(on).doubleValue());
}
KqglAssoDkmx.builder().id(dkmc.getId()).xbdk3(time_).xbdk3jg(xbdk3jg).gzsc(worktime).build().updateById();
}
if(atttype <= 6){
KqglAssoDkmx.builder().id(dkmc.getId()).build().updateById();
}
}
}
//原始打卡记录数据录入**************************************************************************************************************************************
int results = 0;
Long time = (time_ - punchcardtime)/1000/60;
if(punchcardtime != 0){
if(isRange) {
if((atttype)%2 > 0){//上班
if(time > 0){results = Integer.valueOf(time.toString());}// 打卡结果
}else{//下班
if(time > 0){}else{results = Math.abs(Integer.valueOf(time.toString()));}// 打卡结果
}
}
}
int type,status = 0;
if((atttype)%2 > 0){
type = 1;// 类型(类型 0:无排班打卡 1:上班 2:下班) punchcardtime == 0:无班次打卡
if(punchcardtime == 0){status = 1;}else{
if(isRange) {// 状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:迟到 4:早退 5:补卡 6:请假 7:加班 8:调休)
if(time > 0){status = 3;}else if(results == 0){status = 1;}
}else {status = 2;}
}
}else{
type = 2;// 类型(类型 0:无排班打卡 1:上班 2:下班)
if(punchcardtime == 0){status = 1;}else{
if(isRange) {
if(time < 0){status = 4;}else if(results == 0){status = 1;}
}else {status = 2;}
}
}
String attdate_ = new SimpleDateFormat("yy-MM-dd").format(Double.valueOf(startDate));//转换打卡时间格式
long attime;
if(punchcardtime == 0 && !isRange){attime = new Date().getTime();}else{attime = punchcardtime;}// 考勤时间(应打卡时间)
String remarks = "";
if(("1").equals(asVerifyMode)) {remarks = "考勤机指纹打卡";}else if(("20").equals(asVerifyMode)) {remarks = "考勤机人脸打卡";}
//cardtype--1:GPS,2:WIFI,3:考勤机
KqglAssoDkjl pre = KqglAssoDkjl.builder().dktime(time_).results(results).userId(userid).type(type).status(status).sort(atttype)
.cardType(3).qyid(qyid).attdate(attdate_+" "+ClockInTool.dateToWeek2(putime)).attime(attime).dkmxid(dkmx).bcid(clockt.getShifid()).remarks(remarks).punchmode(Integer.valueOf(asVerifyMode))
.punchequipment(asDevId).build();
if (!pre.insert()) {
throw new CustomException("打卡记录-新增异常-2");
}
}
}else {
return ResultUtil.error("打卡失败!,未加入考勤组!");
}
}else {
return ResultUtil.error("打卡失败!,用户不存在!");
}
return ResultUtil.data(null, "打卡成功");
}
@Autowired
private KqglAssoPbmxMapper kqglassopbmxmapper;
public AttendanceCardListDto MethodCall(int qyid,int userid,String date) throws ParseException {
AttendanceCardListDto attcar = new AttendanceCardListDto();
String str = null;
if(!("").equals(date)){
str = date;
}else{
Date d = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
str = sdf.format(d);
}
// Long startDate = DateUtil.getStartTime(0,DateUtil.getStringTime(str,"yyyy-MM-dd")).getTime();
// Long endDate = DateUtil.getnowEndTime(23,DateUtil.getStringTime(str,"yyyy-MM-dd")).getTime();
KqglMainKqz attgro = kqglmainkqzmapper.getAttendanceGroupInformationByUserid(userid,qyid); //考勤组信息
//pbfs:排班方式 1:固定排班;2:自由排班;3:自由工时
if(attgro != null){//判断当前用户是否加入到考勤组
//排班制
KqglAssoPbmxDto jrpb = kqglassopbmxmapper.getScheduleSpecificAttendance(attgro.getId(),userid,str);
//固定排班
int week = Integer.valueOf(ClockInTool.dateToWeek(str));//4
KqglAssoZhoupaiban atwek = KqglAssoZhoupaiban.builder().build().selectOne(new QueryWrapper<KqglAssoZhoupaiban>().lambda().eq(KqglAssoZhoupaiban::getKqzid, attgro.getId())
.eq(KqglAssoZhoupaiban::getType, week).ne(KqglAssoZhoupaiban::getBcid, 0));
if(attgro.getPbfs() == 1){//固定排班
if(atwek != null){//有固定周排班
KqglAssoTeshu rest = KqglAssoTeshu.builder().build().selectOne(new QueryWrapper<KqglAssoTeshu>().lambda().eq(KqglAssoTeshu::getKqzid, attgro.getId())
.eq(KqglAssoTeshu::getTsrq, str).eq(KqglAssoTeshu::getBcid, 0));
if(rest != null){//今天休息 Sort返回0【特殊日期--休息】
List<AttSchedule> atts = new ArrayList<AttSchedule>();
AttSchedule as = AttSchedule.builder().id(0).sort(0).time(0l).starttime(0l).endtime(0l).build();
atts.add(as);
attcar.setAttsch(atts);
}else{//今天上班
KqglAssoBcsz bcz = KqglAssoBcsz.builder().build().selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, atwek.getBcid()));
if(bcz != null){
Getshiftinformationbatch(bcz,attcar,str);
}
}
}else{//必须打卡
KqglAssoTeshu tsri = KqglAssoTeshu.builder().build().selectOne(new QueryWrapper<KqglAssoTeshu>().lambda().eq(KqglAssoTeshu::getKqzid, attgro.getId())
.eq(KqglAssoTeshu::getTsrq, str).ne(KqglAssoTeshu::getBcid, 0));
if(tsri != null){
KqglAssoBcsz tsrq = KqglAssoBcsz.builder().build().selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, tsri.getBcid()));
if(tsrq!=null){
Getshiftinformationbatch(tsrq,attcar,str);
}
}else{//休息
List<AttSchedule> atts = new ArrayList<AttSchedule>();
AttSchedule as = AttSchedule.builder().id(0).sort(0).time(0l).starttime(0l).endtime(0l).build();
atts.add(as);
attcar.setAttsch(atts);
}
}
}else if(attgro.getPbfs() == 2){//自由排班
//未排班时,员工可选择班次打卡
if(attgro.getIsXzbcdk() == 1){
attcar.setOptscheduling(true);
}else{
attcar.setOptscheduling(false);
}
if(jrpb != null){
if(jrpb.getBcid() != 0){//有班次时("Bcid"不为0时)
KqglAssoBcsz tsrq = KqglAssoBcsz.builder().build().selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, jrpb.getBcid()));
/**已简化**/
Getshiftinformationbatch(tsrq,attcar,str);
}else{//当天排班为休息
List<AttSchedule> atts1 = new ArrayList<AttSchedule>();
AttSchedule as = AttSchedule.builder().id(0).sort(0).time(0l).starttime(0l).endtime(0l).build();
atts1.add(as);
attcar.setAttsch(atts1);
}
}
}else{//自由工时
KqglAssoZhoupaiban wekz = KqglAssoZhoupaiban.builder().build().selectOne(new QueryWrapper<KqglAssoZhoupaiban>().lambda().eq(KqglAssoZhoupaiban::getKqzid, attgro.getId())
.eq(KqglAssoZhoupaiban::getBcid, 0).eq(KqglAssoZhoupaiban::getType, week));
if(wekz != null){//
String dada = str+" "+attgro.getKqkssjTime()+":00";
attcar.setStapclotime(Long.valueOf(ClockInTool.dateToStamp(dada)));
}
if(!("").equals(attgro.getJbzdsc())){
attcar.setCanpunchworkdate(Double.valueOf(attgro.getJbzdsc()));//上班打卡后多久大下班卡
}
}
if(jrpb != null || atwek != null){
KqglAssoBcsz shif = KqglAssoBcsz.builder().build();
if(attgro.getPbfs() == 1){
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, atwek.getBcid()));
}else if(attgro.getPbfs() == 2){
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, jrpb.getBcid()));
}
if(shif != null){
if(shif.getIsXbdk() == 1){
attcar.setNoclockout(true);// 下班不用打卡
}else{
attcar.setNoclockout(false);// 下班不用打卡
}
attcar.setAllowlate(shif.getYxcdfzs());// 允许迟到分钟数
attcar.setSeriouslate(shif.getYzcdfzs());// 严重迟到分钟数
attcar.setAbsenteeismlate(shif.getKgcdfzs());// 旷工迟到分钟数
if(shif.getIsWzwd() == 1){
attcar.setIslatelate(true);// 晚走晚到
List<AttLateLate> atwzwd = new ArrayList<AttLateLate>();
int p = 0;
if(!("").equals(shif.getXbwz1()) && !("").equals(shif.getSbwd1())){p = 2;}
if(!("").equals(shif.getXbwz1()) && !("").equals(shif.getSbwd1()) && !("").equals(shif.getXbwz2()) && !("").equals(shif.getSbwd2())){p = 4;}
if(!("").equals(shif.getXbwz1()) && !("").equals(shif.getSbwd1()) && !("").equals(shif.getXbwz2()) && !("").equals(shif.getSbwd2()) && !("").equals(shif.getXbwz3()) && !("").equals(shif.getSbwd3())){p = 6;}
AttLateLate ala = AttLateLate.builder().build();
ala.setLatewalk(shif.getXbwz1());
ala.setArrivelate(shif.getSbwd1());
atwzwd.add(ala);
if(p == 4 || p == 6){
AttLateLate alat = AttLateLate.builder().build();
alat.setLatewalk(shif.getXbwz2());
alat.setArrivelate(shif.getSbwd2());
atwzwd.add(alat);
}
if(p == 6){
AttLateLate alas = AttLateLate.builder().build();
alas.setLatewalk(shif.getXbwz3());
alas.setArrivelate(shif.getSbwd3());
atwzwd.add(alas);
}
attcar.setAttlat(atwzwd);
}else{
attcar.setIslatelate(false);// 晚走晚到
}
}
}
attcar.setAttgrouptype(attgro.getPbfs());//1:固定排班;2:自由排班;3:自由工时
}else{
attcar.setAttgrouptype(0);//1:固定排班;2:自由排班;3:自由工时
}
return attcar;
}
//
public void Getshiftinformationbatch(KqglAssoBcsz shiftm,AttendanceCardListDto attcar,String str){
List<AttSchedule> atts = new ArrayList<AttSchedule>();
if(shiftm.getSxbcs() == 1 || shiftm.getSxbcs() == 2 || shiftm.getSxbcs() == 3){//1次上下班
for(int o=0;o<2;o++){
if(o==0){
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(1).time(Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getSbdk1(),2)+":00")))
.starttime(("").equals(shiftm.getSbqjks1()) ? 0 : Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getSbqjks1(),2)+":00")))
.endtime(("").equals(shiftm.getSbqjjs1()) ? 0 : Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getSbqjjs1(),2)+":00"))).build();
atts.add(as);
}else{
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(2).time(Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getXbdk1(),2)+":00")))
.starttime(("").equals(shiftm.getXbqjks1()) ? 0 : Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getXbqjks1(),2)+":00")))
.endtime(("").equals(shiftm.getXbqjjs1()) ? 0 : Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getXbqjjs1(),2)+":00"))).build();
atts.add(as);
}
}
attcar.setAttsch(atts);
}
if(shiftm.getSxbcs() == 2 || shiftm.getSxbcs() == 3){//2次上下班
for(int o=0;o<2;o++){
if(o==0){
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(3).time(Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getSbdk2(),2)+":00")))
.starttime(("").equals(shiftm.getSbqjks2()) ? 0 : Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getSbqjks2(),2)+":00")))
.endtime(("").equals(shiftm.getSbqjjs2()) ? 0 : Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getSbqjjs2(),2)+":00"))).build();
atts.add(as);
}else{
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(4).time(Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getXbdk2(),2)+":00")))
.starttime(("").equals(shiftm.getXbqjks2()) ? 0 : Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getXbqjks2(),2)+":00")))
.endtime(("").equals(shiftm.getXbqjjs2()) ? 0 : Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getXbqjjs2(),2)+":00"))).build();
atts.add(as);
}
}
attcar.setAttsch(atts);
}
if(shiftm.getSxbcs() == 3){//3次上下班
for(int o=0;o<2;o++){
if(o==0){
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(5).time(Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getSbdk3(),2)+":00")))
.starttime(("").equals(shiftm.getSbqjks3()) ? 0 : Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getSbqjks3(),2)+":00")))
.endtime(("").equals(shiftm.getSbqjjs3()) ? 0 : Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getSbqjjs3(),2)+":00"))).build();
atts.add(as);
}else{
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(6).time(Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getXbdk3(),2)+":00")))
.starttime(("").equals(shiftm.getXbqjks3()) ? 0 : Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getXbqjks3(),2)+":00")))
.endtime(("").equals(shiftm.getXbqjjs3()) ? 0 : Long.valueOf(ClockInTool.dateToStamp(str+" "+ClockInTool.dealDateFormat(shiftm.getXbqjjs3(),2)+":00"))).build();
atts.add(as);
}
}
attcar.setAttsch(atts);
}
}
}
package cn.timer.api.controller.kqgl;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
/**
* @author Yl123 2020-05-11
*
*/
public class ClockInTool {
public static String dateToWeek2(String datetime) {
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd");
String[] weekDays = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };
// String[] weekDays = {"7", "1", "2", "3", "4", "5", "6"};
Calendar cal = Calendar.getInstance();
Date date;
try {
date = f.parse(datetime);
cal.setTime(date);
} catch (ParseException e) {
e.printStackTrace();
}
// 一周的第几天
int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
if (w < 0)
w = 0;
return weekDays[w];
}
/**
*
* @param nowDate 要比较的时间
* @param startDate 开始时间
* @param endDate 结束时间
* @return true在时间段内,false不在时间段内
* @throws Exception
*/
public static boolean hourMinuteBetween(String nowDate, String startDate, String endDate) throws Exception {
SimpleDateFormat format = new SimpleDateFormat("HH:mm");
Date now = format.parse(nowDate);
Date start = format.parse(startDate);
Date end = format.parse(endDate);
long nowTime = now.getTime();
long startTime = start.getTime();
long endTime = end.getTime();
return nowTime >= startTime && nowTime <= endTime;
}
/**
* 根据日期获取 星期 (2019-05-06 ——> 星期一)
*
* @param datetime
* @return
*/
public static String dateToWeek(String datetime) {
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd");
// String[] weekDays = {"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"};
String[] weekDays = { "7", "1", "2", "3", "4", "5", "6" };
Calendar cal = Calendar.getInstance();
Date date;
try {
date = f.parse(datetime);
cal.setTime(date);
} catch (ParseException e) {
e.printStackTrace();
}
// 一周的第几天
int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
if (w < 0)
w = 0;
return weekDays[w];
}
/**
* 2019-10-24T00:30:23.000Z 转化时间
*/
public static String dealDateFormat(String oldDateStr, int num) {
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX"); // yyyy-MM-dd'T'HH:mm:ss.SSSZ
Date date = null;
try {
date = df.parse(oldDateStr);
} catch (ParseException e) {
e.printStackTrace();
}
SimpleDateFormat df1 = new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy", Locale.UK);
Date date1 = null;
try {
date1 = df1.parse(date.toString());
} catch (ParseException e) {
e.printStackTrace();
}
DateFormat df2 = null;
if (num == 1) {
df2 = new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss");
} else if (num == 2) {
df2 = new SimpleDateFormat("HH:mm");
}
return df2.format(date1);
}
/**
* 时间转换时间戳
*/
public static String dateToStamp(String s) {
String res;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = null;
try {
date = simpleDateFormat.parse(s);
} catch (ParseException e) {
e.printStackTrace();
}
long ts = date.getTime();
res = String.valueOf(ts);
return res;
}
}
......@@ -13,6 +13,7 @@ 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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -23,6 +24,9 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.lang.Console;
import cn.hutool.json.JSONObject;
import cn.timer.api.bean.kqgl.AttConditions;
import cn.timer.api.bean.kqgl.AttendanceCardList;
import cn.timer.api.bean.kqmk.KqglAssOvertimeVice;
import cn.timer.api.bean.kqmk.KqglAssoBcsz;
import cn.timer.api.bean.kqmk.KqglAssoDkdz;
......@@ -591,7 +595,7 @@ public class TimeCardController {
}
/**
* 查询列表-假期规则
* 查询列表-假期规则*******************************************
*/
@GetMapping(value = "/list_leave_rules")
@ApiOperation(value = "111: 查询列表-假期规则", httpMethod = "GET", notes = " 查询列表-假期规则")
......@@ -611,7 +615,6 @@ public class TimeCardController {
return ResultUtil.data(leas, "操作成功!");
}
/**
* 查询列表-加班补偿方式
*/
......
package cn.timer.api.controller.kqgl;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import cn.timer.api.dto.kqmk.AttSchedule;
import cn.timer.api.dto.kqmk.AttendanceCardListDto;
import cn.timer.api.utils.DateUtil;
public class test {
public static void main(String[] args) throws Exception {
long starttime1,endtime1 = 0;
if(1==1) {
starttime1 = 12l;
}else {
endtime1 = 22l;
}
System.out.println(starttime1);
System.out.println(endtime1);
}
}
package cn.timer.api.dao.kqmk;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import cn.timer.api.bean.kqmk.KqglAssoDkjl;
/**
* 打卡记录表
*
* @author LAL 2020-05-11
*/
@Repository
public interface KqglAssoDkjlMapper extends BaseMapper<KqglAssoDkjl> {
}
package cn.timer.api.dao.kqmk;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import cn.timer.api.bean.kqmk.KqglAssoDkmx;
/**
* 打卡明细表
*
* @author LAL 2020-05-11
*/
@Repository
public interface KqglAssoDkmxMapper extends BaseMapper<KqglAssoDkmx> {
}
package cn.timer.api.dao.kqmk;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.kqmk.KqglAssoPbmx;
import cn.timer.api.dto.kqmk.KqglAssoPbmxDto;
/**
* 排班明细表
*
* @author LAL 2020-05-11
*/
@Repository
public interface KqglAssoPbmxMapper extends BaseMapper<KqglAssoPbmx> {
KqglAssoPbmxDto getScheduleSpecificAttendance(Integer kqzid, Integer userid, String date);
}
package cn.timer.api.dao.kqmk;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import cn.timer.api.bean.kqmk.KqglAssoTeshu;
/**
* 特殊日期表
*
* @author LAL 2020-05-11
*/
@Repository
public interface KqglAssoTeshuMapper extends BaseMapper<KqglAssoTeshu> {
}
package cn.timer.api.dao.kqmk;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import cn.timer.api.bean.kqmk.KqglAssoZhoupaiban;
/**
* 考勤周排班
*
* @author LAL 2020-05-11
*/
@Repository
public interface KqglAssoZhoupaibanMapper extends BaseMapper<KqglAssoZhoupaiban> {
}
......@@ -18,4 +18,6 @@ import cn.timer.api.dto.kqmk.KqglMainKqzDto;
public interface KqglMainKqzMapper extends BaseMapper<KqglMainKqz> {
List<KqglMainKqzDto> selectAttGroupMachineByQyid(int qyid);
KqglMainKqz getAttendanceGroupInformationByUserid(int userid,int qyid);
}
package cn.timer.api.dto.kqmk;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author lalqq 打卡方式
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("打卡方式")
public class AttClockMethod implements Serializable{
private static final long serialVersionUID = 1495564336178422116L;
private String name;// 打卡名称
private String mac;// wifi【wifi】
private Integer attrange;// 范围【地址】
private Integer type;// 类型(1:考勤机;2:地址;3:WIFI)
private double longitude;// 经度【地址】
private double latitude;// 纬度【地址】
}
package cn.timer.api.dto.kqmk;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author lalqq 晚走晚到
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AttLateLate implements Serializable{
private static final long serialVersionUID = 5733260865781069938L;
private String latewalk;// 晚走
private String arrivelate;// 晚到
}
package cn.timer.api.dto.kqmk;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author lalqq 考勤班次
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AttSchedule implements Serializable{
private static final long serialVersionUID = 2301555360668389960L;
private Integer id;
private Integer sort;// 1:上班;2:下班; 3:上班;4:下班;5:上班;6:下班
private Long time;
private Long starttime;
private Long endtime;
}
package cn.timer.api.dto.kqmk;
import java.io.Serializable;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AttendanceCardListDto implements Serializable {
private static final long serialVersionUID = -5736914818628419342L;
private List<AttSchedule> attsch;// 考勤班次
private boolean attmachine;// 考勤机
private boolean attaddress;// 考勤地址
private boolean attwifi;// 考勤WIFI
private List<AttClockMethod> machine;// 详细打卡方式
private List<PunchRecord> attpr;// 打卡记录
private boolean optscheduling;// 未排班时,员工可选择班次打卡
private boolean fieldpersonnel;// 外勤 true:开 false:关
private Long stapclotime;// 自由排班开始时间
private double canpunchworkdate;// 上班打卡后多久大下班卡
private boolean noclockout;// 下班不用打卡
private Integer allowlate;// 允许迟到分钟数
private Integer seriouslate;// 严重迟到分钟数
private Integer absenteeismlate;// 旷工迟到分钟数
private boolean islatelate;// 晚走晚到
private List<AttLateLate> attlat;// 晚走晚到时间
private String latetime;// 前一天晚走小时****
private List<SystemShift> ssfh;// 无排班时获取的系统班次
private Integer attgrouptype;// 1:固定排班;2:自由排班;3:自由工时
}
package cn.timer.api.dto.kqmk;
import java.io.Serializable;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author lalqq APP 打卡数据
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ClockCollectData implements Serializable {
private static final long serialVersionUID = -7658009549305902379L;
@ApiModelProperty(value = "用户id", example = "字段说明")
private Integer userid;
@ApiModelProperty(value = "打卡类型", example = "1:上班1 2:下班1 3:上班2 4:下班2 5:上班3 6:下班3......")
private Integer type;
@ApiModelProperty(value = "打卡时间", example = "字段说明")
private String punchtime;
@ApiModelProperty(value = "应打卡时间 \"\"", example = "字段说明")
private String punchcardtime;
@ApiModelProperty(value = "打卡类型", example = "1:GPS,2:WIFI,3:考勤机,4:外勤")
private Integer punchcardtype;
@ApiModelProperty(value = "纬度", example = "字段说明")
private String lat;
@ApiModelProperty(value = "经度", example = "字段说明")
private String lon;
@ApiModelProperty(value = "地址", example = "字段说明")
private String address;
@ApiModelProperty(value = "WIFI mac地址", example = "字段说明")
private String mac;
@ApiModelProperty(value = "WIFI名称", example = "字段说明")
private String macname;
@ApiModelProperty(value = "班次id", example = "无排班时 为“0”")
private Integer shifid;
@ApiModelProperty(value = "打卡状态", example = "状态,1:正常 2:异常 3:补卡 4:请假")
private Integer status;
@ApiModelProperty(value = "手机唯一ID", example = "字段说明")
private String registrationid;
@ApiModelProperty(value = "打卡类型", example = "1:打卡 2:更新打卡")
private Integer differ;
}
package cn.timer.api.dto.kqmk;
import java.util.Date;
import java.util.List;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class KqglAssoPbmxDto {
@ApiModelProperty(value = "id id", example = "101")
private Integer id;
@ApiModelProperty(value = "用户id 用户id", example = "101")
private Integer userid;
@ApiModelProperty(value = "日期 ", example = "日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date data;
@ApiModelProperty(value = "班次id 班次id", example = "101")
private Integer bcid;
@ApiModelProperty(value = "考勤组id 考勤组id", example = "101")
private Integer kqzid;
private String username;
private String bcname;
private String yemo;
private String xsrq;
private String sbdk1;
private String sbqjks1;
private String sbqjjs1;
private String xbdk1;
private String xbqjks1;
private String xbqjjs1;
private String sbdk2;
private String sbqjks2;
private String sbqjjs2;
private String xbdk2;
private String xbqjks2;
private String xbqjjs2;
private String sbdk3;
private String sbqjks3;
private String sbqjjs3;
private String xbdk3;
private String xbqjks3;
private String xbqjjs3;
private Integer isxbdk;
private Integer sxbcs;
private List<PunchRecord> attpr;// 打卡记录
}
package cn.timer.api.dto.kqmk;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class KqglAssoZhoupaibanDto {
@ApiModelProperty(value = "id id", example = "101")
private Integer id;
@ApiModelProperty(value = "考勤组id 考勤组id", example = "101")
private Integer kqzid;
@ApiModelProperty(value = "类型(1:周一、2:周二、3:周三。。。。、8:周一到周日统一班次、9:排班制) 类型(1:周一、2:周二、3:周三。。。。、8:周一到周日统一班次、9:排班制)", example = "101")
private Integer type;
@ApiModelProperty(value = "班次id(0:自由工时 班次id【大于0为:固定排班和排班制】)", example = "101")
private Integer bcid;
private String bcname;
private String sbdk1;
private String xbdk1;
private String sbdk2;
private String xbdk2;
private String sbdk3;
private String xbdk3;
private String weektime;
private String wekmc;
}
package cn.timer.api.dto.kqmk;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
/**
* @author lalqq 打卡记录
*/
@AllArgsConstructor
@NoArgsConstructor
public class PunchRecord implements Serializable {
private static final long serialVersionUID = -1674107232385310352L;
private Integer id;
private Long dktime;// 打卡时间
private String Strdktime = "";//
private Double lon;// 经度
private Double lat;// 纬度
private String address;// 定位地址
private Integer results;// 打卡结果
private Integer userId;// 用户id
private Integer type;// 类型(类型 0:无排班打卡 1:上班 2:下班)
private Integer status;// 状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:迟到 4:早退 5:补卡 6:请假 7:加班 8:请假迟到 9:请假早退 10:调休)',
private Integer sort;// 序号
private Integer cardType;// 打卡类型(1:GPS,2:WIFI,3:考勤机)
private String mac;// mac地址
private String macname;// WIFI名称
private Integer qyid;// 企业id
private String attdate;// 考勤日期
private Long attime;// 考勤时间
private String Strattime = "";//
private Integer dkmxid;// 打卡明细id
private Integer bcid;// 班次id
private String remarks;// 考勤备注
private Integer punchmode;// 考勤机打卡方式==>1:指紋;2:人脸;3:密码;4:ID卡
private String punchequipment;// 打卡设备
private String username = "";
private String dept = "";
private String post = "";
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Long getDktime() {
return dktime;
}
@SuppressWarnings("unlikely-arg-type")
public void setDktime(Long dktime) {
this.dktime = dktime;
if (dktime != null && !dktime.equals("")) {
this.Strdktime = format.format(dktime);
}
}
public String getStrdktime() {
return Strdktime;
}
public void setStrdktime(String strdktime) {
Strdktime = strdktime;
}
public Double getLon() {
return lon;
}
public void setLon(Double lon) {
this.lon = lon;
}
public Double getLat() {
return lat;
}
public void setLat(Double lat) {
this.lat = lat;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address == null ? "" : address.trim();
}
public Integer getResults() {
return results;
}
public void setResults(Integer results) {
this.results = results;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public Integer getCardType() {
return cardType;
}
public void setCardType(Integer cardType) {
this.cardType = cardType;
}
public String getMacname() {
return macname;
}
public void setMacname(String macname) {
this.macname = macname == null ? "" : macname.trim();
}
public String getMac() {
return mac;
}
public void setMac(String mac) {
this.mac = mac == null ? "" : mac.trim();
}
public Integer getQyid() {
return qyid;
}
public void setQyid(Integer qyid) {
this.qyid = qyid;
}
public String getAttdate() {
return attdate;
}
public void setAttdate(String attdate) {
this.attdate = attdate == null ? "" : attdate.trim();
}
public Long getAttime() {
return attime;
}
@SuppressWarnings("unlikely-arg-type")
public void setAttime(Long attime) {
this.attime = attime;
if (attime != null && !attime.equals("")) {
this.Strattime = format.format(attime);
}
}
public String getStrattime() {
return Strattime;
}
public void setStrattime(String strattime) {
Strattime = strattime;
}
public Integer getDkmxid() {
return dkmxid;
}
public void setDkmxid(Integer dkmxid) {
this.dkmxid = dkmxid;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public Integer getBcid() {
return bcid;
}
public void setBcid(Integer bcid) {
this.bcid = bcid;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public Integer getPunchmode() {
return punchmode;
}
public void setPunchmode(Integer punchmode) {
this.punchmode = punchmode;
}
public String getPunchequipment() {
return punchequipment;
}
public void setPunchequipment(String punchequipment) {
this.punchequipment = punchequipment;
}
public String getDept() {
return dept;
}
public void setDept(String dept) {
this.dept = dept;
}
public String getPost() {
return post;
}
public void setPost(String post) {
this.post = post;
}
}
\ No newline at end of file
package cn.timer.api.dto.kqmk;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author lalqq 无排班时 返回班次
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SystemShift implements Serializable{
private static final long serialVersionUID = -1558779986672010849L;
private Integer id;
private String context;
}
<?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.KqglAssoDkjlMapper">
<resultMap id="BaseResultMap" type="cn.timer.api.bean.kqmk.KqglAssoDkjl" >
<id column="id" property="id" />
<result column="dktime" property="dktime" />
<result column="lon" property="lon" />
<result column="lat" property="lat" />
<result column="address" property="address" />
<result column="results" property="results" />
<result column="user_id" property="userId" />
<result column="type" property="type" />
<result column="status" property="status" />
<result column="sort" property="sort" />
<result column="card_type" property="cardType" />
<result column="mac" property="mac" />
<result column="macname" property="macname" />
<result column="qyid" property="qyid" />
<result column="attdate" property="attdate" />
<result column="attime" property="attime" />
<result column="dkmxid" property="dkmxid" />
<result column="bcid" property="bcid" />
<result column="remarks" property="remarks" />
<result column="punchmode" property="punchmode" />
<result column="punchequipment" property="punchequipment" />
</resultMap>
<sql id="Base_Column_List">
id,
dktime,
lon,
lat,
address,
results,
user_id,
type,
status,
sort,
card_type,
mac,
macname,
qyid,
attdate,
attime,
dkmxid,
bcid,
remarks,
punchmode,
punchequipment
</sql>
<sql id="Base_Column_List_Alias">
id KqglAssoDkjl_id,
dktime KqglAssoDkjl_dktime,
lon KqglAssoDkjl_lon,
lat KqglAssoDkjl_lat,
address KqglAssoDkjl_address,
results KqglAssoDkjl_results,
user_id KqglAssoDkjl_user_id,
type KqglAssoDkjl_type,
status KqglAssoDkjl_status,
sort KqglAssoDkjl_sort,
card_type KqglAssoDkjl_card_type,
mac KqglAssoDkjl_mac,
macname KqglAssoDkjl_macname,
qyid KqglAssoDkjl_qyid,
attdate KqglAssoDkjl_attdate,
attime KqglAssoDkjl_attime,
dkmxid KqglAssoDkjl_dkmxid,
bcid KqglAssoDkjl_bcid,
remarks KqglAssoDkjl_remarks,
punchmode KqglAssoDkjl_punchmode,
punchequipment KqglAssoDkjl_punchequipment
</sql>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoDkjl">
INSERT INTO kqgl_asso_dkjl
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != dktime'>
dktime,
</if>
<if test ='null != lon'>
lon,
</if>
<if test ='null != lat'>
lat,
</if>
<if test ='null != address'>
address,
</if>
<if test ='null != results'>
results,
</if>
<if test ='null != userId'>
user_id,
</if>
<if test ='null != type'>
type,
</if>
<if test ='null != status'>
status,
</if>
<if test ='null != sort'>
sort,
</if>
<if test ='null != cardType'>
card_type,
</if>
<if test ='null != mac'>
mac,
</if>
<if test ='null != macname'>
macname,
</if>
<if test ='null != qyid'>
qyid,
</if>
<if test ='null != attdate'>
attdate,
</if>
<if test ='null != attime'>
attime,
</if>
<if test ='null != dkmxid'>
dkmxid,
</if>
<if test ='null != bcid'>
bcid,
</if>
<if test ='null != remarks'>
remarks,
</if>
<if test ='null != punchmode'>
punchmode,
</if>
<if test ='null != punchequipment'>
punchequipment
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != dktime'>
#{dktime},
</if>
<if test ='null != lon'>
#{lon},
</if>
<if test ='null != lat'>
#{lat},
</if>
<if test ='null != address'>
#{address},
</if>
<if test ='null != results'>
#{results},
</if>
<if test ='null != userId'>
#{userId},
</if>
<if test ='null != type'>
#{type},
</if>
<if test ='null != status'>
#{status},
</if>
<if test ='null != sort'>
#{sort},
</if>
<if test ='null != cardType'>
#{cardType},
</if>
<if test ='null != mac'>
#{mac},
</if>
<if test ='null != macname'>
#{macname},
</if>
<if test ='null != qyid'>
#{qyid},
</if>
<if test ='null != attdate'>
#{attdate},
</if>
<if test ='null != attime'>
#{attime},
</if>
<if test ='null != dkmxid'>
#{dkmxid},
</if>
<if test ='null != bcid'>
#{bcid},
</if>
<if test ='null != remarks'>
#{remarks},
</if>
<if test ='null != punchmode'>
#{punchmode},
</if>
<if test ='null != punchequipment'>
#{punchequipment}
</if>
</trim>
</insert>
<delete id="delete" >
DELETE FROM kqgl_asso_dkjl
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.kqmk.KqglAssoDkjl">
UPDATE kqgl_asso_dkjl
<set>
<if test ='null != dktime'>dktime = #{dktime},</if>
<if test ='null != lon'>lon = #{lon},</if>
<if test ='null != lat'>lat = #{lat},</if>
<if test ='null != address'>address = #{address},</if>
<if test ='null != results'>results = #{results},</if>
<if test ='null != userId'>user_id = #{userId},</if>
<if test ='null != type'>type = #{type},</if>
<if test ='null != status'>status = #{status},</if>
<if test ='null != sort'>sort = #{sort},</if>
<if test ='null != cardType'>card_type = #{cardType},</if>
<if test ='null != mac'>mac = #{mac},</if>
<if test ='null != macname'>macname = #{macname},</if>
<if test ='null != qyid'>qyid = #{qyid},</if>
<if test ='null != attdate'>attdate = #{attdate},</if>
<if test ='null != attime'>attime = #{attime},</if>
<if test ='null != dkmxid'>dkmxid = #{dkmxid},</if>
<if test ='null != bcid'>bcid = #{bcid},</if>
<if test ='null != remarks'>remarks = #{remarks},</if>
<if test ='null != punchmode'>punchmode = #{punchmode},</if>
<if test ='null != punchequipment'>punchequipment = #{punchequipment}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_dkjl
WHERE id = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_dkjl
LIMIT #{offset}, #{pageSize}
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM kqgl_asso_dkjl
</select>
-->
</mapper>
\ No newline at end of file
<?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.KqglAssoDkmxMapper">
<resultMap id="BaseResultMap" type="cn.timer.api.bean.kqmk.KqglAssoDkmx" >
<id column="id" property="id" />
<result column="userid" property="userid" />
<result column="data" property="data" />
<result column="sbdk1" property="sbdk1" />
<result column="sbdk1jg" property="sbdk1jg" />
<result column="xbdk1" property="xbdk1" />
<result column="xbdk1jg" property="xbdk1jg" />
<result column="sbdk2" property="sbdk2" />
<result column="sbdk2jg" property="sbdk2jg" />
<result column="xbdk2" property="xbdk2" />
<result column="xbdk2jg" property="xbdk2jg" />
<result column="sbdk3" property="sbdk3" />
<result column="sbdk3jg" property="sbdk3jg" />
<result column="xbdk3" property="xbdk3" />
<result column="xbdk3jg" property="xbdk3jg" />
<result column="ydkcs" property="ydkcs" />
<result column="gzsc" property="gzsc" />
<result column="qyid" property="qyid" />
<result column="dksj" property="dksj" />
</resultMap>
<sql id="Base_Column_List">
id,
userid,
data,
sbdk1,
sbdk1jg,
xbdk1,
xbdk1jg,
sbdk2,
sbdk2jg,
xbdk2,
xbdk2jg,
sbdk3,
sbdk3jg,
xbdk3,
xbdk3jg,
ydkcs,
gzsc,
qyid,
dksj
</sql>
<sql id="Base_Column_List_Alias">
id KqglAssoDkmx_id,
userid KqglAssoDkmx_userid,
data KqglAssoDkmx_data,
sbdk1 KqglAssoDkmx_sbdk1,
sbdk1jg KqglAssoDkmx_sbdk1jg,
xbdk1 KqglAssoDkmx_xbdk1,
xbdk1jg KqglAssoDkmx_xbdk1jg,
sbdk2 KqglAssoDkmx_sbdk2,
sbdk2jg KqglAssoDkmx_sbdk2jg,
xbdk2 KqglAssoDkmx_xbdk2,
xbdk2jg KqglAssoDkmx_xbdk2jg,
sbdk3 KqglAssoDkmx_sbdk3,
sbdk3jg KqglAssoDkmx_sbdk3jg,
xbdk3 KqglAssoDkmx_xbdk3,
xbdk3jg KqglAssoDkmx_xbdk3jg,
ydkcs KqglAssoDkmx_ydkcs,
gzsc KqglAssoDkmx_gzsc,
qyid KqglAssoDkmx_qyid,
dksj KqglAssoDkmx_dksj
</sql>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoDkmx">
INSERT INTO kqgl_asso_dkmx
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != userid'>
userid,
</if>
<if test ='null != data'>
data,
</if>
<if test ='null != sbdk1'>
sbdk1,
</if>
<if test ='null != sbdk1jg'>
sbdk1jg,
</if>
<if test ='null != xbdk1'>
xbdk1,
</if>
<if test ='null != xbdk1jg'>
xbdk1jg,
</if>
<if test ='null != sbdk2'>
sbdk2,
</if>
<if test ='null != sbdk2jg'>
sbdk2jg,
</if>
<if test ='null != xbdk2'>
xbdk2,
</if>
<if test ='null != xbdk2jg'>
xbdk2jg,
</if>
<if test ='null != sbdk3'>
sbdk3,
</if>
<if test ='null != sbdk3jg'>
sbdk3jg,
</if>
<if test ='null != xbdk3'>
xbdk3,
</if>
<if test ='null != xbdk3jg'>
xbdk3jg,
</if>
<if test ='null != ydkcs'>
ydkcs,
</if>
<if test ='null != gzsc'>
gzsc,
</if>
<if test ='null != qyid'>
qyid,
</if>
<if test ='null != dksj'>
dksj
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != userid'>
#{userid},
</if>
<if test ='null != data'>
#{data},
</if>
<if test ='null != sbdk1'>
#{sbdk1},
</if>
<if test ='null != sbdk1jg'>
#{sbdk1jg},
</if>
<if test ='null != xbdk1'>
#{xbdk1},
</if>
<if test ='null != xbdk1jg'>
#{xbdk1jg},
</if>
<if test ='null != sbdk2'>
#{sbdk2},
</if>
<if test ='null != sbdk2jg'>
#{sbdk2jg},
</if>
<if test ='null != xbdk2'>
#{xbdk2},
</if>
<if test ='null != xbdk2jg'>
#{xbdk2jg},
</if>
<if test ='null != sbdk3'>
#{sbdk3},
</if>
<if test ='null != sbdk3jg'>
#{sbdk3jg},
</if>
<if test ='null != xbdk3'>
#{xbdk3},
</if>
<if test ='null != xbdk3jg'>
#{xbdk3jg},
</if>
<if test ='null != ydkcs'>
#{ydkcs},
</if>
<if test ='null != gzsc'>
#{gzsc},
</if>
<if test ='null != qyid'>
#{qyid},
</if>
<if test ='null != dksj'>
#{dksj}
</if>
</trim>
</insert>
<delete id="delete" >
DELETE FROM kqgl_asso_dkmx
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.kqmk.KqglAssoDkmx">
UPDATE kqgl_asso_dkmx
<set>
<if test ='null != userid'>userid = #{userid},</if>
<if test ='null != data'>data = #{data},</if>
<if test ='null != sbdk1'>sbdk1 = #{sbdk1},</if>
<if test ='null != sbdk1jg'>sbdk1jg = #{sbdk1jg},</if>
<if test ='null != xbdk1'>xbdk1 = #{xbdk1},</if>
<if test ='null != xbdk1jg'>xbdk1jg = #{xbdk1jg},</if>
<if test ='null != sbdk2'>sbdk2 = #{sbdk2},</if>
<if test ='null != sbdk2jg'>sbdk2jg = #{sbdk2jg},</if>
<if test ='null != xbdk2'>xbdk2 = #{xbdk2},</if>
<if test ='null != xbdk2jg'>xbdk2jg = #{xbdk2jg},</if>
<if test ='null != sbdk3'>sbdk3 = #{sbdk3},</if>
<if test ='null != sbdk3jg'>sbdk3jg = #{sbdk3jg},</if>
<if test ='null != xbdk3'>xbdk3 = #{xbdk3},</if>
<if test ='null != xbdk3jg'>xbdk3jg = #{xbdk3jg},</if>
<if test ='null != ydkcs'>ydkcs = #{ydkcs},</if>
<if test ='null != gzsc'>gzsc = #{gzsc},</if>
<if test ='null != qyid'>qyid = #{qyid},</if>
<if test ='null != dksj'>dksj = #{dksj}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_dkmx
WHERE id = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_dkmx
LIMIT #{offset}, #{pageSize}
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM kqgl_asso_dkmx
</select>
-->
</mapper>
\ No newline at end of file
<?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.KqglAssoPbmxMapper">
<resultMap id="BaseResultMap" type="cn.timer.api.bean.kqmk.KqglAssoPbmx" >
<id column="id" property="id" />
<result column="userid" property="userid" />
<result column="data" property="data" />
<result column="bcid" property="bcid" />
<result column="kqzid" property="kqzid" />
</resultMap>
<resultMap id="AssoPbmxMap" type="cn.timer.api.dto.kqmk.KqglAssoPbmxDto" >
<id column="id" property="id" />
<result column="userid" property="userid" />
<result column="data" property="data" />
<result column="bcid" property="bcid" />
<result column="kqzid" property="kqzid" />
<result column="bcname" property="bcname" />
<result column="sbdk1" property="sbdk1" />
<result column="sbqjks1" property="sbqjks1" />
<result column="sbqjjs1" property="sbqjjs1" />
<result column="xbdk1" property="xbdk1" />
<result column="xbqjks1" property="xbqjks1" />
<result column="xbqjjs1" property="xbqjjs1" />
<result column="sbdk2" property="sbdk2" />
<result column="sbqjks2" property="sbqjks2" />
<result column="sbqjjs2" property="sbqjjs2" />
<result column="xbdk2" property="xbdk2" />
<result column="xbqjks2" property="xbqjks2" />
<result column="xbqjjs2" property="xbqjjs2" />
<result column="sbdk3" property="sbdk3" />
<result column="sbqjks3" property="sbqjks3" />
<result column="sbqjjs3" property="sbqjjs3" />
<result column="xbdk3" property="xbdk3" />
<result column="xbqjks3" property="xbqjks3" />
<result column="xbqjjs3" property="xbqjjs3" />
<result column="isxbdk" property="isxbdk" />
<result column="sxbcs" property="sxbcs" />
</resultMap>
<sql id="Base_Column_List">
id,
userid,
data,
bcid,
kqzid
</sql>
<sql id="Base_Column_List_Alias">
id KqglAssoPbmx_id,
userid KqglAssoPbmx_userid,
data KqglAssoPbmx_data,
bcid KqglAssoPbmx_bcid,
kqzid KqglAssoPbmx_kqzid
</sql>
<select id="getScheduleSpecificAttendance" resultMap="AssoPbmxMap">
select pbmx.*,
bcsz.`name` bcname,
bcsz.sbdk1,
bcsz.sbqjks1,
bcsz.sbqjjs1,
bcsz.xbdk1,
bcsz.xbqjks1,
bcsz.xbqjjs1,
bcsz.sbdk2,
bcsz.sbqjks2,
bcsz.sbqjjs2,
bcsz.xbdk2,
bcsz.xbqjks2,
bcsz.xbqjjs2,
bcsz.sbdk3,
bcsz.sbqjks3,
bcsz.sbqjjs3,
bcsz.xbdk3,
bcsz.xbqjks3,
bcsz.xbqjjs3,
bcsz.sxbcs,
bcsz.is_xbdk as isxbdk
from kqgl_asso_pbmx pbmx
LEFT JOIN kqgl_asso_bcsz as bcsz on bcsz.id = pbmx.bcid
where pbmx.kqzid = #{kqzid}
and pbmx.userid = #{userid}
and pbmx.`data` = #{date}
</select>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoPbmx">
INSERT INTO kqgl_asso_pbmx
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != userid'>
userid,
</if>
<if test ='null != data'>
data,
</if>
<if test ='null != bcid'>
bcid,
</if>
<if test ='null != kqzid'>
kqzid
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != userid'>
#{userid},
</if>
<if test ='null != data'>
#{data},
</if>
<if test ='null != bcid'>
#{bcid},
</if>
<if test ='null != kqzid'>
#{kqzid}
</if>
</trim>
</insert>
<delete id="delete" >
DELETE FROM kqgl_asso_pbmx
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.kqmk.KqglAssoPbmx">
UPDATE kqgl_asso_pbmx
<set>
<if test ='null != userid'>userid = #{userid},</if>
<if test ='null != data'>data = #{data},</if>
<if test ='null != bcid'>bcid = #{bcid},</if>
<if test ='null != kqzid'>kqzid = #{kqzid}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_pbmx
WHERE id = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_pbmx
LIMIT #{offset}, #{pageSize}
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM kqgl_asso_pbmx
</select>
-->
</mapper>
\ No newline at end of file
<?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.KqglAssoTeshuMapper">
<resultMap id="BaseResultMap" type="cn.timer.api.bean.kqmk.KqglAssoTeshu" >
<id column="id" property="id" />
<result column="kqzid" property="kqzid" />
<result column="tsrq" property="tsrq" />
<result column="bcid" property="bcid" />
<result column="lusj_time" property="lusjTime" />
<result column="luryid" property="luryid" />
<result column="type" property="type" />
</resultMap>
<sql id="Base_Column_List">
id,
kqzid,
tsrq,
bcid,
lusj_time,
luryid,
type
</sql>
<sql id="Base_Column_List_Alias">
id KqglAssoTeshu_id,
kqzid KqglAssoTeshu_kqzid,
tsrq KqglAssoTeshu_tsrq,
bcid KqglAssoTeshu_bcid,
lusj_time KqglAssoTeshu_lusj_time,
luryid KqglAssoTeshu_luryid,
type KqglAssoTeshu_type
</sql>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoTeshu">
INSERT INTO kqgl_asso_teshu
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != kqzid'>
kqzid,
</if>
<if test ='null != tsrq'>
tsrq,
</if>
<if test ='null != bcid'>
bcid,
</if>
<if test ='null != lusjTime'>
lusj_time,
</if>
<if test ='null != luryid'>
luryid,
</if>
<if test ='null != type'>
type
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != kqzid'>
#{kqzid},
</if>
<if test ='null != tsrq'>
#{tsrq},
</if>
<if test ='null != bcid'>
#{bcid},
</if>
<if test ='null != lusjTime'>
#{lusjTime},
</if>
<if test ='null != luryid'>
#{luryid},
</if>
<if test ='null != type'>
#{type}
</if>
</trim>
</insert>
<delete id="delete" >
DELETE FROM kqgl_asso_teshu
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.kqmk.KqglAssoTeshu">
UPDATE kqgl_asso_teshu
<set>
<if test ='null != kqzid'>kqzid = #{kqzid},</if>
<if test ='null != tsrq'>tsrq = #{tsrq},</if>
<if test ='null != bcid'>bcid = #{bcid},</if>
<if test ='null != lusjTime'>lusj_time = #{lusjTime},</if>
<if test ='null != luryid'>luryid = #{luryid},</if>
<if test ='null != type'>type = #{type}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_teshu
WHERE id = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_teshu
LIMIT #{offset}, #{pageSize}
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM kqgl_asso_teshu
</select>
-->
</mapper>
\ No newline at end of file
<?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.KqglAssoZhoupaibanMapper">
<resultMap id="BaseResultMap" type="cn.timer.api.bean.kqmk.KqglAssoZhoupaiban" >
<id column="id" property="id" />
<result column="kqzid" property="kqzid" />
<result column="type" property="type" />
<result column="bcid" property="bcid" />
</resultMap>
<sql id="Base_Column_List">
id,
kqzid,
type,
bcid
</sql>
<sql id="Base_Column_List_Alias">
id KqglAssoZhoupaiban_id,
kqzid KqglAssoZhoupaiban_kqzid,
type KqglAssoZhoupaiban_type,
bcid KqglAssoZhoupaiban_bcid
</sql>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoZhoupaiban">
INSERT INTO kqgl_asso_zhoupaiban
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != kqzid'>
kqzid,
</if>
<if test ='null != type'>
type,
</if>
<if test ='null != bcid'>
bcid
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != kqzid'>
#{kqzid},
</if>
<if test ='null != type'>
#{type},
</if>
<if test ='null != bcid'>
#{bcid}
</if>
</trim>
</insert>
<delete id="delete" >
DELETE FROM kqgl_asso_zhoupaiban
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.kqmk.KqglAssoZhoupaiban">
UPDATE kqgl_asso_zhoupaiban
<set>
<if test ='null != kqzid'>kqzid = #{kqzid},</if>
<if test ='null != type'>type = #{type},</if>
<if test ='null != bcid'>bcid = #{bcid}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_zhoupaiban
WHERE id = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_zhoupaiban
LIMIT #{offset}, #{pageSize}
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM kqgl_asso_zhoupaiban
</select>
-->
</mapper>
\ No newline at end of file
......@@ -131,6 +131,12 @@
LEFT JOIN kqgl_asso_kqzdkfs as kqzdkfs on kqzdkfs.kqz_id = a.id and kqzdkfs.type = 1 and kqzdkfs.state = 1
where a.qyid = #{qyid,jdbcType=INTEGER}
</select>
<select id="getAttendanceGroupInformationByUserid" resultMap="BaseResultMap">
select * from kqgl_main_kqz kqz
where kqz.id = (select yhkqz.kqzid from kqgl_asso_yhkqz yhkqz
where yhkqz.userid = #{userid,jdbcType=INTEGER} and yhkqz.qyid = #{qyid,jdbcType=INTEGER})
</select>
<!--
......
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