Commit af1eff68 by ilal

提交

parent 7e8aa443
...@@ -2,6 +2,7 @@ package cn.timer.api.bean.kqgl; ...@@ -2,6 +2,7 @@ package cn.timer.api.bean.kqgl;
import java.io.Serializable; import java.io.Serializable;
import cn.timer.api.dto.kqmk.ResttryfixdayDto;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
...@@ -27,7 +28,9 @@ public class AttendanceAssistant implements Serializable{ ...@@ -27,7 +28,9 @@ public class AttendanceAssistant implements Serializable{
String[] attWeekdaysShifts;// 周工作日班次【固定排班】 String[] attWeekdaysShifts;// 周工作日班次【固定排班】
String[] attMustPunchData;// 必须打卡的日期【固定排班】 String[] attMustPunchData;// 必须打卡的日期【固定排班】
String[] attMustPunchShifid;// 必须打卡的班次id【固定排班】 String[] attMustPunchShifid;// 必须打卡的班次id【固定排班】
String[] attNonPunchData;// 不用打卡的日期【固定排班】
// String[] attNonPunchData;// 不用打卡的日期【固定排班】
ResttryfixdayDto[] attNonPunchData;
String[] attShifts;// 排班制 选择的班次【排班制】 String[] attShifts;// 排班制 选择的班次【排班制】
int attRemind;// 是否开启提醒:0-否、1-是【排班制】 int attRemind;// 是否开启提醒:0-否、1-是【排班制】
......
...@@ -22,7 +22,8 @@ public class SpecialDate implements Serializable{ ...@@ -22,7 +22,8 @@ public class SpecialDate implements Serializable{
private Long lusjTime;// 录入时间 private Long lusjTime;// 录入时间
private Integer luryid;// 录入人员 private Integer luryid;// 录入人员
private Integer type;// 类型 1:必须打卡日期;2:不用打卡日期(扩展字段) private Integer type;// 类型 1:必须打卡日期;2:不用打卡日期(扩展字段)
private Integer legalday;
private String bcname; private String bcname;
private String sbdk1; private String sbdk1;
private String xbdk1; private String xbdk1;
...@@ -30,7 +31,9 @@ public class SpecialDate implements Serializable{ ...@@ -30,7 +31,9 @@ public class SpecialDate implements Serializable{
private String xbdk2; private String xbdk2;
private String sbdk3; private String sbdk3;
private String xbdk3; private String xbdk3;
public Integer getId() { public Integer getId() {
return id; return id;
} }
...@@ -143,4 +146,12 @@ public class SpecialDate implements Serializable{ ...@@ -143,4 +146,12 @@ public class SpecialDate implements Serializable{
this.xbdk3 = xbdk3; this.xbdk3 = xbdk3;
} }
public Integer getLegalday() {
return legalday;
}
public void setLegalday(Integer legalday) {
this.legalday = legalday;
}
} }
\ No newline at end of file
...@@ -54,5 +54,8 @@ public class KqglAssoTeshu extends Model<KqglAssoTeshu> { ...@@ -54,5 +54,8 @@ public class KqglAssoTeshu extends Model<KqglAssoTeshu> {
@ApiModelProperty(value = "类型(1:必须打卡日期;2:不用打卡日期(扩展字段)) 类型(1:必须打卡日期;2:不用打卡日期(扩展字段))", example = "101") @ApiModelProperty(value = "类型(1:必须打卡日期;2:不用打卡日期(扩展字段)) 类型(1:必须打卡日期;2:不用打卡日期(扩展字段))", example = "101")
private Integer type; private Integer type;
@ApiModelProperty(value = "是否是法定节假日(0:否;1:是)", example = "0")
private Integer legalday;
} }
\ No newline at end of file
...@@ -101,6 +101,7 @@ import cn.timer.api.dao.yggl.YgglMainEmpMapper; ...@@ -101,6 +101,7 @@ import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dto.kqmk.AttqueryCriteriaDto; import cn.timer.api.dto.kqmk.AttqueryCriteriaDto;
import cn.timer.api.dto.kqmk.KqglAssoPbmxDto; import cn.timer.api.dto.kqmk.KqglAssoPbmxDto;
import cn.timer.api.dto.kqmk.KqglMainKqzDto; import cn.timer.api.dto.kqmk.KqglMainKqzDto;
import cn.timer.api.dto.kqmk.ResttryfixdayDto;
import cn.timer.api.utils.DateUtil; import cn.timer.api.utils.DateUtil;
import cn.timer.api.utils.Result; import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil; import cn.timer.api.utils.ResultUtil;
...@@ -1563,7 +1564,10 @@ public class AttController { ...@@ -1563,7 +1564,10 @@ public class AttController {
List<SpecialDate> speclist=new ArrayList<SpecialDate>(); List<SpecialDate> speclist=new ArrayList<SpecialDate>();
String[] attmuspudata = attass.getAttMustPunchData();// 必须打卡的日期【固定排班】 String[] attmuspudata = attass.getAttMustPunchData();// 必须打卡的日期【固定排班】
String[] attmuspushifid = attass.getAttMustPunchShifid();// 必须打卡的班次id【固定排班】 String[] attmuspushifid = attass.getAttMustPunchShifid();// 必须打卡的班次id【固定排班】
String[] attnonpudata = attass.getAttNonPunchData();// 不用打卡的日期【固定排班】 // String[] attnonpudata = attass.getAttNonPunchData();// 不用打卡的日期【固定排班】
ResttryfixdayDto[] attnonpudata = attass.getAttNonPunchData();// 不用打卡的日期【固定排班】
if(attmuspudata.length>0 && attmuspushifid.length>0 && attass.getAtttype() == 1){ if(attmuspudata.length>0 && attmuspushifid.length>0 && attass.getAtttype() == 1){
for(int m=0;m<attmuspudata.length;m++){ for(int m=0;m<attmuspudata.length;m++){
SpecialDate mut = new SpecialDate(); SpecialDate mut = new SpecialDate();
...@@ -1581,12 +1585,13 @@ public class AttController { ...@@ -1581,12 +1585,13 @@ public class AttController {
for(int n=0;n<attnonpudata.length;n++){ for(int n=0;n<attnonpudata.length;n++){
SpecialDate non = new SpecialDate(); SpecialDate non = new SpecialDate();
non.setKqzid(attgrpid);//考勤组id non.setKqzid(attgrpid);//考勤组id
non.setTsrq(attnonpudata[n]);//日期 non.setTsrq(attnonpudata[n].getDate());//日期
non.setBcid(0);//班次id non.setBcid(0);//班次id
long date = new Date().getTime(); long date = new Date().getTime();
non.setLusjTime(date);//录入时间 non.setLusjTime(date);//录入时间
non.setLuryid(180658);// 录入人员*********** non.setLuryid(180658);// 录入人员***********
non.setType(2);// 类型 1:必须打卡日期;2:不用打卡日期(扩展字段) non.setType(2);// 类型 1:必须打卡日期;2:不用打卡日期(扩展字段)
non.setLegalday(attnonpudata[n].getWhether());
speclist.add(non); speclist.add(non);
} }
} }
......
...@@ -396,6 +396,9 @@ public class ClockInTool { ...@@ -396,6 +396,9 @@ public class ClockInTool {
* @return * @return
*/ */
public static String[] doChinFilters(String[] filters, String target) { public static String[] doChinFilters(String[] filters, String target) {
target = ClockInTool.Str_Time_formatting(target,"yyyy-MM-dd");
String[] res = null; String[] res = null;
if (filters.length > 0) { if (filters.length > 0) {
List<String> tempList = Arrays.asList(filters); List<String> tempList = Arrays.asList(filters);
......
...@@ -65,7 +65,6 @@ import cn.timer.api.bean.kqmk.KqglAssoYhkqz; ...@@ -65,7 +65,6 @@ import cn.timer.api.bean.kqmk.KqglAssoYhkqz;
import cn.timer.api.bean.kqmk.KqglAssoYhsb; import cn.timer.api.bean.kqmk.KqglAssoYhsb;
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.qyxx.CmsContent;
import cn.timer.api.bean.yggl.YgglMainEmp; import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.annotation.CurrentUser; import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean; import cn.timer.api.config.annotation.UserBean;
...@@ -127,6 +126,7 @@ import cn.timer.api.dto.kqmk.LeaveTypeDto; ...@@ -127,6 +126,7 @@ import cn.timer.api.dto.kqmk.LeaveTypeDto;
import cn.timer.api.dto.kqmk.MachinememberDto; import cn.timer.api.dto.kqmk.MachinememberDto;
import cn.timer.api.dto.kqmk.ModifyEmployeeBalanceDto; import cn.timer.api.dto.kqmk.ModifyEmployeeBalanceDto;
import cn.timer.api.dto.kqmk.OriginalRecordDto; import cn.timer.api.dto.kqmk.OriginalRecordDto;
import cn.timer.api.dto.kqmk.ResttryfixdayDto;
import cn.timer.api.dto.kqmk.SetConditionsDto; import cn.timer.api.dto.kqmk.SetConditionsDto;
import cn.timer.api.dto.kqmk.StartTimeRestDto; import cn.timer.api.dto.kqmk.StartTimeRestDto;
import cn.timer.api.dto.kqmk.UserAttendanceRelDto; import cn.timer.api.dto.kqmk.UserAttendanceRelDto;
...@@ -1428,16 +1428,19 @@ public class TimeCardController { ...@@ -1428,16 +1428,19 @@ public class TimeCardController {
List<KqglAssoTeshu> speclist = new ArrayList<KqglAssoTeshu>(); List<KqglAssoTeshu> speclist = new ArrayList<KqglAssoTeshu>();
String[] attmuspudata = attass.getAttMustPunchData();// 必须打卡的日期【固定排班】 String[] attmuspudata = attass.getAttMustPunchData();// 必须打卡的日期【固定排班】
String[] attmuspushifid = attass.getAttMustPunchShifid();// 必须打卡的班次id【固定排班】 String[] attmuspushifid = attass.getAttMustPunchShifid();// 必须打卡的班次id【固定排班】
String[] attnonpudata = attass.getAttNonPunchData();// 不用打卡的日期【固定排班】 // String[] attnonpudata = attass.getAttNonPunchData();// 不用打卡的日期【固定排班】
ResttryfixdayDto[] attnonpudata = attass.getAttNonPunchData();// 不用打卡的日期【固定排班】
if(attmuspudata.length>0 && attmuspushifid.length>0 && attass.getAtttype() == 1){ if(attmuspudata.length>0 && attmuspushifid.length>0 && attass.getAtttype() == 1){
for(int m=0;m<attmuspudata.length;m++){ for(int m=0;m<attmuspudata.length;m++){
KqglAssoTeshu mut = KqglAssoTeshu.builder().kqzid(attid).tsrq(attmuspudata[m]).bcid(Integer.valueOf(attmuspushifid[m])).lusjTime(new Date().getTime()).luryid(userBean.getEmpNum()).type(1).build(); KqglAssoTeshu mut = KqglAssoTeshu.builder().kqzid(attid).tsrq(attmuspudata[m]).bcid(Integer.valueOf(attmuspushifid[m])).lusjTime(new Date().getTime()).luryid(userBean.getEmpNum()).type(1).build();
speclist.add(mut); speclist.add(mut);
} }
} }
if(attnonpudata.length>0 && attass.getAtttype() == 1){ if(attnonpudata.length>0 && attass.getAtttype() == 1){
for(int n=0;n<attnonpudata.length;n++){ for(int n=0;n<attnonpudata.length;n++){
KqglAssoTeshu non = KqglAssoTeshu.builder().kqzid(attid).tsrq(attnonpudata[n]).bcid(0).lusjTime(new Date().getTime()).luryid(userBean.getEmpNum()).type(2).build(); KqglAssoTeshu non = KqglAssoTeshu.builder().kqzid(attid).tsrq(attnonpudata[n].getDate()).legalday(attnonpudata[n].getWhether()).bcid(0).lusjTime(new Date().getTime()).luryid(userBean.getEmpNum()).type(2).build();
speclist.add(non); speclist.add(non);
} }
} }
...@@ -1445,6 +1448,7 @@ public class TimeCardController { ...@@ -1445,6 +1448,7 @@ public class TimeCardController {
kqglassoteshumapper.insertKqglAssoTeshuList(speclist); kqglassoteshumapper.insertKqglAssoTeshuList(speclist);
} }
//记录排班(排班制) //记录排班(排班制)
List<KqglAssoPbmxDto> schlist=new ArrayList<KqglAssoPbmxDto>(); List<KqglAssoPbmxDto> schlist=new ArrayList<KqglAssoPbmxDto>();
KqglAssoPbmxDto[] schedules = attass.getSchedules();// 排班日期【排班制】--班次id、日期 KqglAssoPbmxDto[] schedules = attass.getSchedules();// 排班日期【排班制】--班次id、日期
......
...@@ -101,7 +101,7 @@ public class AttendanceTaskTiming{ ...@@ -101,7 +101,7 @@ public class AttendanceTaskTiming{
//typeid:1-员工 2-考勤组 //typeid:1-员工 2-考勤组
// @Scheduled(cron = "0 */5 * * * ?") // @Scheduled(cron = "0 */5 * * * ?")
// @Scheduled(cron = "0 6 17 * * ?") // @Scheduled(cron = "0 8 11 * * ?")
@Scheduled(cron = "0 0 8,12,16,20 * * ?")//每天上午8、12点,下午16点,20点 执行 @Scheduled(cron = "0 0 8,12,16,20 * * ?")//每天上午8、12点,下午16点,20点 执行
public void AttendanceTask() throws ParseException { public void AttendanceTask() throws ParseException {
...@@ -170,6 +170,10 @@ public class AttendanceTaskTiming{ ...@@ -170,6 +170,10 @@ public class AttendanceTaskTiming{
KqglMainKqz attgro = kqglmainkqzmapper.getAttendanceGroupInformationByUserid(user.getEmpnum(),org_code); KqglMainKqz attgro = kqglmainkqzmapper.getAttendanceGroupInformationByUserid(user.getEmpnum(),org_code);
//目前为止打卡记录 //目前为止打卡记录
List<PunchCardDetails> attendance = punchcarddetailsmapper.selectAttendanceDays(user.getEmpnum(), startDate, endDate); List<PunchCardDetails> attendance = punchcarddetailsmapper.selectAttendanceDays(user.getEmpnum(), startDate, endDate);
//特殊日期中 为法定带薪休假的
List<KqglAssoTeshu> fdjjr = KqglAssoTeshu.builder().build().selectList(new QueryWrapper<KqglAssoTeshu>().lambda().eq(KqglAssoTeshu::getKqzid, attgro.getId()).eq(KqglAssoTeshu::getLegalday, 1).eq(KqglAssoTeshu::getType, 2));
int dkjl = 0;//目前为止打卡次数 int dkjl = 0;//目前为止打卡次数
int sbqkcs = 0,xbqkcs = 0,dk=0; int sbqkcs = 0,xbqkcs = 0,dk=0;
String[] sblacks = new String[31];//上班缺卡天数 String[] sblacks = new String[31];//上班缺卡天数
...@@ -177,7 +181,7 @@ public class AttendanceTaskTiming{ ...@@ -177,7 +181,7 @@ public class AttendanceTaskTiming{
String[] dkjtts = new String[attendance.size()];//目前打卡日期明细 String[] dkjtts = new String[attendance.size()];//目前打卡日期明细
int bccs = 0; int bccs = 0;
if(attendance.size() > 0) { if(attendance.size() > 0) {
dkjl = attendance.size(); dkjl = attendance.size() + fdjjr.size();
for(PunchCardDetails pcd:attendance){ for(PunchCardDetails pcd:attendance){
AttendanceCardListDto attdate = MethodCall(org_code, user.getEmpnum(), pcd.getData()); AttendanceCardListDto attdate = MethodCall(org_code, user.getEmpnum(), pcd.getData());
List<AttSchedule> ashss = attdate.getAttsch();//获取今天应打卡时间 List<AttSchedule> ashss = attdate.getAttsch();//获取今天应打卡时间
......
...@@ -160,6 +160,10 @@ public class LastMonthtimingExport { ...@@ -160,6 +160,10 @@ public class LastMonthtimingExport {
KqglMainKqz attgro = kqglmainkqzmapper.getAttendanceGroupInformationByUserid(user.getEmpnum(),org_code); KqglMainKqz attgro = kqglmainkqzmapper.getAttendanceGroupInformationByUserid(user.getEmpnum(),org_code);
//目前为止打卡记录 //目前为止打卡记录
List<PunchCardDetails> attendance = punchcarddetailsmapper.selectAttendanceDays(user.getEmpnum(), startDate, endDate); List<PunchCardDetails> attendance = punchcarddetailsmapper.selectAttendanceDays(user.getEmpnum(), startDate, endDate);
//特殊日期中 为法定带薪休假的
List<KqglAssoTeshu> fdjjr = KqglAssoTeshu.builder().build().selectList(new QueryWrapper<KqglAssoTeshu>().lambda().eq(KqglAssoTeshu::getKqzid, attgro.getId()).eq(KqglAssoTeshu::getLegalday, 1).eq(KqglAssoTeshu::getType, 2));
int dkjl = 0;//目前为止打卡次数 int dkjl = 0;//目前为止打卡次数
int sbqkcs = 0,xbqkcs = 0,dk=0; int sbqkcs = 0,xbqkcs = 0,dk=0;
String[] sblacks = new String[31];//上班缺卡天数 String[] sblacks = new String[31];//上班缺卡天数
...@@ -167,7 +171,7 @@ public class LastMonthtimingExport { ...@@ -167,7 +171,7 @@ public class LastMonthtimingExport {
String[] dkjtts = new String[attendance.size()];//目前打卡日期明细 String[] dkjtts = new String[attendance.size()];//目前打卡日期明细
int bccs = 0; int bccs = 0;
if(attendance.size() > 0) { if(attendance.size() > 0) {
dkjl = attendance.size(); dkjl = attendance.size() + fdjjr.size();
for(PunchCardDetails pcd:attendance){ for(PunchCardDetails pcd:attendance){
AttendanceCardListDto attdate = MethodCall(org_code, user.getEmpnum(), pcd.getData()); AttendanceCardListDto attdate = MethodCall(org_code, user.getEmpnum(), pcd.getData());
List<AttSchedule> ashss = attdate.getAttsch();//获取今天应打卡时间 List<AttSchedule> ashss = attdate.getAttsch();//获取今天应打卡时间
......
...@@ -40,14 +40,17 @@ import cn.timer.api.dao.kqgl.PunchRecordMapper; ...@@ -40,14 +40,17 @@ import cn.timer.api.dao.kqgl.PunchRecordMapper;
import cn.timer.api.dao.kqgl.ScheduleMapper; import cn.timer.api.dao.kqgl.ScheduleMapper;
import cn.timer.api.dao.kqmk.KqglAssoDkmxMapper; import cn.timer.api.dao.kqmk.KqglAssoDkmxMapper;
import cn.timer.api.dao.kqmk.KqglAssoLeaveBalanceMapper; import cn.timer.api.dao.kqmk.KqglAssoLeaveBalanceMapper;
import cn.timer.api.dao.kqmk.KqglAssoPbmxMapper;
import cn.timer.api.dao.kqmk.KqglAssoRelationSummaryMapper; import cn.timer.api.dao.kqmk.KqglAssoRelationSummaryMapper;
import cn.timer.api.dao.kqmk.KqglAssoTeshuMapper; import cn.timer.api.dao.kqmk.KqglAssoTeshuMapper;
import cn.timer.api.dao.kqmk.KqglMainKqzMapper; import cn.timer.api.dao.kqmk.KqglMainKqzMapper;
import cn.timer.api.dao.qyzx.QyzxEntInfoMMapper; import cn.timer.api.dao.qyzx.QyzxEntInfoMMapper;
import cn.timer.api.dto.kqmk.AdditionalDto; import cn.timer.api.dto.kqmk.AdditionalDto;
import cn.timer.api.dto.kqmk.AttLateLate;
import cn.timer.api.dto.kqmk.AttSchedule; import cn.timer.api.dto.kqmk.AttSchedule;
import cn.timer.api.dto.kqmk.AttSubsidiaryDto; import cn.timer.api.dto.kqmk.AttSubsidiaryDto;
import cn.timer.api.dto.kqmk.AttendanceCardListDto; import cn.timer.api.dto.kqmk.AttendanceCardListDto;
import cn.timer.api.dto.kqmk.KqglAssoPbmxDto;
import cn.timer.api.utils.DateUtil; import cn.timer.api.utils.DateUtil;
/** /**
...@@ -148,6 +151,10 @@ public class RealTimeUpdate{ ...@@ -148,6 +151,10 @@ public class RealTimeUpdate{
KqglMainKqz attgro = kqglmainkqzmapper.getAttendanceGroupInformationByUserid(user.getEmpnum(),org_code); KqglMainKqz attgro = kqglmainkqzmapper.getAttendanceGroupInformationByUserid(user.getEmpnum(),org_code);
//目前为止打卡记录 //目前为止打卡记录
List<PunchCardDetails> attendance = punchcarddetailsmapper.selectAttendanceDays(user.getEmpnum(), startDate, endDateyesterday); List<PunchCardDetails> attendance = punchcarddetailsmapper.selectAttendanceDays(user.getEmpnum(), startDate, endDateyesterday);
//特殊日期中 为法定带薪休假的
List<KqglAssoTeshu> fdjjr = KqglAssoTeshu.builder().build().selectList(new QueryWrapper<KqglAssoTeshu>().lambda().eq(KqglAssoTeshu::getKqzid, attgro.getId()).eq(KqglAssoTeshu::getLegalday, 1).eq(KqglAssoTeshu::getType, 2));
int dkjl = 0;//目前为止打卡次数 int dkjl = 0;//目前为止打卡次数
int sbqkcs = 0,xbqkcs = 0,dk=0; int sbqkcs = 0,xbqkcs = 0,dk=0;
String[] sblacks = new String[31];//上班缺卡天数 String[] sblacks = new String[31];//上班缺卡天数
...@@ -155,9 +162,9 @@ public class RealTimeUpdate{ ...@@ -155,9 +162,9 @@ public class RealTimeUpdate{
String[] dkjtts = new String[attendance.size()];//目前打卡日期明细 String[] dkjtts = new String[attendance.size()];//目前打卡日期明细
int bccs = 0; int bccs = 0;
if(attendance.size() > 0) { if(attendance.size() > 0) {
dkjl = attendance.size(); dkjl = attendance.size() + fdjjr.size();
for(PunchCardDetails pcd:attendance){ for(PunchCardDetails pcd:attendance){
AttendanceCardListDto attdate = clockincontroller.MethodCall(org_code, user.getEmpnum(), pcd.getData()); AttendanceCardListDto attdate = MethodCall(org_code, user.getEmpnum(), pcd.getData());
List<AttSchedule> ashss = attdate.getAttsch();//获取今天应打卡时间 List<AttSchedule> ashss = attdate.getAttsch();//获取今天应打卡时间
if(EmptyUtil.isNotEmpty(attdate.getAttsch()) && ashss.get(0).getId() != 0) {//班次不为空 if(EmptyUtil.isNotEmpty(attdate.getAttsch()) && ashss.get(0).getId() != 0) {//班次不为空
bccs = attdate.getAttsch().size(); bccs = attdate.getAttsch().size();
...@@ -879,4 +886,272 @@ public class RealTimeUpdate{ ...@@ -879,4 +886,272 @@ public class RealTimeUpdate{
} }
@Autowired
private KqglAssoPbmxMapper kqglassopbmxmapper;
/**
* @param qyid
* @param userid
* @param date
* @return
* 获取当天打卡班次数据
*/
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);
}
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;
}
/**
* @param shiftm
* @param attcar
* @param str
*/
public void Getshiftinformationbatch(KqglAssoBcsz shiftm,AttendanceCardListDto attcar,String str){
int isXbdk1Cr = shiftm.getIsXbdk1Cr();//下班1是否次日(0:否;1:是)
int isSbdk2Cr = shiftm.getIsSbdk2Cr();//上班2是否次日(0:否;1:是)
int isXbdk2Cr = shiftm.getIsXbdk2Cr();//下班2是否次日(0:否;1:是)
int isSbdk3Cr = shiftm.getIsSbdk3Cr();//上班3是否次日(0:否;1:是)
int isXbdk3Cr = shiftm.getIsXbdk3Cr();//下班3是否次日(0:否;1:是)
//次日专用
String next_day = ClockInTool.requires_extra_times(str,1,2,1);
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+" "+shiftm.getSbdk1()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getSbqjks1()) || shiftm.getSbqjks1() == null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbqjks1()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getSbqjjs1()) || shiftm.getSbqjjs1() == null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbqjjs1()+":00").replaceAll("\r|\n", ""))))
.nextday(0).build();
atts.add(as);
}else{
//次日
if(isXbdk1Cr > 0) {
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(2).time(Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getXbdk1()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getXbqjks1()) || shiftm.getXbqjks1() == null ? 0 : Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getXbqjks1()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getXbqjjs1()) || shiftm.getXbqjjs1() ==null ? 0 : Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getXbqjjs1()+":00").replaceAll("\r|\n", ""))))
.nextday(1).build();
atts.add(as);
}else {
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(2).time(Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbdk1()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getXbqjks1()) || shiftm.getXbqjks1() == null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbqjks1()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getXbqjjs1()) || shiftm.getXbqjjs1() ==null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbqjjs1()+":00").replaceAll("\r|\n", ""))))
.nextday(0).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){
if(isSbdk2Cr > 0) {//次日
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(3).time(Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getSbdk2()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getSbqjks2())|| shiftm.getSbqjks2()== null ? 0 : Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getSbqjks2()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getSbqjjs2()) || shiftm.getSbqjjs2()== null ? 0 : Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getSbqjjs2()+":00").replaceAll("\r|\n", ""))))
.nextday(1).build();
atts.add(as);
}else {
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(3).time(Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbdk2()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getSbqjks2())|| shiftm.getSbqjks2()== null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbqjks2()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getSbqjjs2()) || shiftm.getSbqjjs2()== null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbqjjs2()+":00").replaceAll("\r|\n", ""))))
.nextday(0).build();
atts.add(as);
}
}else{
if(isXbdk2Cr > 0) {//次日
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(4).time(Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getXbdk2()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getXbqjks2()) || shiftm.getXbqjks2()== null? 0 : Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getXbqjks2()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getXbqjjs2()) || shiftm.getXbqjjs2()== null? 0 : Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getXbqjjs2()+":00").replaceAll("\r|\n", ""))))
.nextday(1).build();
atts.add(as);
}else {
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(4).time(Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbdk2()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getXbqjks2()) || shiftm.getXbqjks2()== null? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbqjks2()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getXbqjjs2()) || shiftm.getXbqjjs2()== null? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbqjjs2()+":00").replaceAll("\r|\n", ""))))
.nextday(0).build();
atts.add(as);
}
}
}
attcar.setAttsch(atts);
}
if(shiftm.getSxbcs() == 3){//3次上下班
for(int o=0;o<2;o++){
if(o==0){
if(isSbdk3Cr > 0) {//次日
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(5).time(Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getSbdk3()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getSbqjks3()) || shiftm.getSbqjks3() == null? 0 : Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getSbqjks3()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getSbqjjs3()) || shiftm.getSbqjjs3() == null ? 0 : Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getSbqjjs3()+":00").replaceAll("\r|\n", ""))))
.nextday(1).build();
atts.add(as);
}else {
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(5).time(Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbdk3()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getSbqjks3()) || shiftm.getSbqjks3() == null? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbqjks3()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getSbqjjs3()) || shiftm.getSbqjjs3() == null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbqjjs3()+":00").replaceAll("\r|\n", ""))))
.nextday(0).build();
atts.add(as);
}
}else{
if(isXbdk3Cr > 0) {//次日
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(6).time(Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getXbdk3()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getXbqjks3()) || shiftm.getXbqjks3()== null ? 0 : Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getXbqjks3()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getXbqjjs3()) || shiftm.getXbqjjs3() ==null? 0 : Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getXbqjjs3()+":00").replaceAll("\r|\n", ""))))
.nextday(1).build();
atts.add(as);
}else {
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(6).time(Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbdk3()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getXbqjks3()) || shiftm.getXbqjks3()== null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbqjks3()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getXbqjjs3()) || shiftm.getXbqjjs3() ==null? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbqjjs3()+":00").replaceAll("\r|\n", ""))))
.nextday(0).build();
atts.add(as);
}
}
}
attcar.setAttsch(atts);
}
}
} }
...@@ -29,7 +29,9 @@ public class AttendanceAssistantDto implements Serializable{ ...@@ -29,7 +29,9 @@ public class AttendanceAssistantDto implements Serializable{
String[] attWeekdaysShifts;// 周工作日班次【固定排班】 String[] attWeekdaysShifts;// 周工作日班次【固定排班】
String[] attMustPunchData;// 必须打卡的日期【固定排班】 String[] attMustPunchData;// 必须打卡的日期【固定排班】
String[] attMustPunchShifid;// 必须打卡的班次id【固定排班】 String[] attMustPunchShifid;// 必须打卡的班次id【固定排班】
String[] attNonPunchData;// 不用打卡的日期【固定排班】
// String[] attNonPunchData;// 不用打卡的日期【固定排班】
ResttryfixdayDto[] attNonPunchData;
String[] attShifts;// 排班制 选择的班次【排班制】 String[] attShifts;// 排班制 选择的班次【排班制】
int attRemind;// 是否开启提醒:0-否、1-是【排班制】 int attRemind;// 是否开启提醒:0-否、1-是【排班制】
......
package cn.timer.api.dto.kqmk;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ResttryfixdayDto {
private String date;//日期
private Integer whether;//是否法定节假日
}
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<result column="lusj_time" property="lusjTime" jdbcType="BIGINT" /> <result column="lusj_time" property="lusjTime" jdbcType="BIGINT" />
<result column="luryid" property="luryid" jdbcType="INTEGER" /> <result column="luryid" property="luryid" jdbcType="INTEGER" />
<result column="type" property="type" jdbcType="INTEGER" /> <result column="type" property="type" jdbcType="INTEGER" />
<result column="legalday" property="legalday" jdbcType="INTEGER" />
<result column="bcname" property="bcname" jdbcType="VARCHAR" /> <result column="bcname" property="bcname" jdbcType="VARCHAR" />
<result column="sbdk1" property="sbdk1" jdbcType="VARCHAR" /> <result column="sbdk1" property="sbdk1" jdbcType="VARCHAR" />
...@@ -124,7 +125,7 @@ ...@@ -124,7 +125,7 @@
</update> </update>
<insert id="insertKqglAssoTeshuList" parameterType="java.util.List" > <insert id="insertKqglAssoTeshuList" parameterType="java.util.List" >
insert into kqgl_asso_teshu (kqzid, tsrq, bcid, lusj_time, luryid, type) insert into kqgl_asso_teshu (kqzid, tsrq, bcid, lusj_time, luryid, type,legalday)
<foreach collection="list" item="item" index="index" open="values " close="" separator=","> <foreach collection="list" item="item" index="index" open="values " close="" separator=",">
( (
<if test="item.kqzid != null" > <if test="item.kqzid != null" >
...@@ -143,7 +144,10 @@ ...@@ -143,7 +144,10 @@
#{item.luryid,jdbcType=INTEGER}, #{item.luryid,jdbcType=INTEGER},
</if> </if>
<if test="item.type != null" > <if test="item.type != null" >
#{item.type,jdbcType=INTEGER} #{item.type,jdbcType=INTEGER},
</if>
<if test="item.legalday != null" >
#{item.legalday,jdbcType=INTEGER}
</if> </if>
) )
</foreach> </foreach>
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<result column="lusj_time" property="lusjTime" /> <result column="lusj_time" property="lusjTime" />
<result column="luryid" property="luryid" /> <result column="luryid" property="luryid" />
<result column="type" property="type" /> <result column="type" property="type" />
<result column="legalday" property="legalday" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
...@@ -34,7 +35,7 @@ ...@@ -34,7 +35,7 @@
</sql> </sql>
<insert id="insertKqglAssoTeshuList" parameterType="java.util.List" > <insert id="insertKqglAssoTeshuList" parameterType="java.util.List" >
insert into kqgl_asso_teshu (kqzid, tsrq, bcid, lusj_time, luryid, type) insert into kqgl_asso_teshu (kqzid, tsrq, bcid, lusj_time, luryid, type,legalday)
<foreach collection="list" item="item" index="index" open="values " close="" separator=","> <foreach collection="list" item="item" index="index" open="values " close="" separator=",">
( (
<if test="item.kqzid != null" > <if test="item.kqzid != null" >
...@@ -53,7 +54,10 @@ ...@@ -53,7 +54,10 @@
#{item.luryid,jdbcType=INTEGER}, #{item.luryid,jdbcType=INTEGER},
</if> </if>
<if test="item.type != null" > <if test="item.type != null" >
#{item.type,jdbcType=INTEGER} #{item.type,jdbcType=INTEGER},
</if>
<if test="item.legalday != null" >
#{item.legalday,jdbcType=INTEGER}
</if> </if>
) )
</foreach> </foreach>
...@@ -65,6 +69,7 @@ ...@@ -65,6 +69,7 @@
where teshu.kqzid = #{kqzid} where teshu.kqzid = #{kqzid}
and SUBSTR(teshu.tsrq,1,7) = #{tsrq} and SUBSTR(teshu.tsrq,1,7) = #{tsrq}
and teshu.type = #{type} and teshu.type = #{type}
and teshu.legalday = 0
</select> </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