Commit 3564611f by ilal

提交

parent 5b039aea
......@@ -2342,7 +2342,12 @@ public class ClockInController {
// attdate.setAttpr(dajllist);
int dkcs = 0;
int isxbdk = 0;
List<KqglAssoDkjl> dajllist_ = kqglassodkjlmapper.getDetailedRecordClock(startDate,endDate,userBean.getEmpNum());
String yymmdd = str.substring(2, 10);
String nowattdate = yymmdd+" "+ClockInTool.dateToWeek2(str);
//查询当天考勤记录
List<KqglAssoDkjl> dajllist_ = kqglassodkjlmapper.getDetailedRecordClock(startDate,endDate,userBean.getEmpNum(),nowattdate);
if(dajllist_.size() > 0) {
dkcs = dajllist_.size();
......@@ -2353,7 +2358,7 @@ public class ClockInController {
List<AttSchedule> attsch = attdate.getAttsch();
if(EmptyUtil.isNotEmpty(attdate.getAttsch()) && attsch.get(0).getId() != 0) {//班次不为空
/******次日开始*****/
/****************次日开始***************/
int sb1 = 0,xb1 = 0,sb2 = 0,xb2 = 0,sb3 = 0,xb3 = 0;
//先判断前一天是否存在次日打卡的方式
KqglAssoBcsz jianchashif = KqglAssoBcsz.builder().build().selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, attsch.get(0).getId()));
......@@ -2368,7 +2373,16 @@ public class ClockInController {
//前一天的班次
AttendanceCardListDto beforeattdate = MethodCall(userBean.getOrgCode(),userBean.getEmpNum(),yesterday);
//前一天的打卡数据
List<KqglAssoDkjl> dajllistbefo = kqglassodkjlmapper.getDetailedRecordClock(startDateyesterday,endDateyesterday,userBean.getEmpNum());
// String yesterday = ClockInTool.requires_extra_times(now,-1,3,1);//前一天
// Long startDateyesterday = DateUtil.getStartTime(0,DateUtil.getStringTime(yesterday,"yyyy-MM-dd")).getTime();
String attdate_ = new SimpleDateFormat("yy-MM-dd").format(Double.valueOf(startDateyesterday));//转换打卡时间格式
String yeboattdate = attdate_+" "+ClockInTool.dateToWeek2(yesterday);
//次日查询昨日考勤时 时间范围扩大到 昨日开始到今日结束
List<KqglAssoDkjl> dajllistbefo = kqglassodkjlmapper.getDetailedRecordClock(startDateyesterday,endDate,userBean.getEmpNum(),yeboattdate);
List<AttSchedule> beforeattsch = beforeattdate.getAttsch();
......@@ -2377,6 +2391,7 @@ public class ClockInController {
if(befo.getNextday() == 1) {
AttSchedule attschbefo = AttSchedule.builder().build();
BeanUtil.copyProperties(befo, attschbefo,"nextdaycard","dajl");
attschbefo.setNextdaycard(1);
attschbefo.setNextday(2);//昨日
KqglAssoDkjl dkjlbefo = KqglAssoDkjl.builder().build();
for(KqglAssoDkjl ka : dajllistbefo) {
......@@ -2385,12 +2400,17 @@ public class ClockInController {
}
}
attschbefo.setDajl(dkjlbefo);
if(dkjlbefo.getDktime() != null) {
attschbefo.setIsdk(1);
}else {
attschbefo.setIsdk(0);
}
attsch.add(p,attschbefo);
p++;
}
}
}
/******次日结束*****/
/****************次日结束***************/
int bccs = attdate.getAttsch().size();
int r = 1,bc = 0;
......@@ -2517,6 +2537,16 @@ public class ClockInController {
////
// List<KqglAssoDkjl> dajllist_ = kqglassodkjlmapper.getDetailedRecordClock(startDate,endDate,userBean.getEmpNum());
// dkcs = dajllist_.size();
//attsch.get(0).getId()
// KqglAssoBcsz bcsc = KqglAssoBcsz.builder().id(attsch.get(0).getId()).build().selectById();
String afterday = ClockInTool.requires_extra_times(str,+1,3,1);//后一天
Long endDateafterday = DateUtil.getnowEndTime(23,DateUtil.getStringTime(afterday,"yyyy-MM-dd")).getTime();
if(sb1 == 1 ||xb1 == 1 || sb2 == 1 ||xb2 == 1 || sb3 == 1 ||xb3 == 1) {//当天存在次日打卡数据时 查询打卡记录范围应该是:当天的开始到后一天的结束
dajllist_ = kqglassodkjlmapper.getDetailedRecordClock(startDate,endDateafterday,userBean.getEmpNum(),nowattdate);
}
KqglAssoDkjl dkjl = KqglAssoDkjl.builder().build();
for(KqglAssoDkjl daj : dajllist_) {
if(ash.getId() == daj.getBcid() && ash.getSort() == daj.getSort()) {//班次id和打卡顺序对应
......@@ -3012,7 +3042,6 @@ public class ClockInController {
wocal.setCalendar_status(3);//打卡异常
wocal.setCalendar_status_type(0);
}
// wocal.setCalendar_status(3);//打卡异常
}
}
......@@ -3033,7 +3062,6 @@ public class ClockInController {
wocal.setCalendar_status(3);//打卡异常
wocal.setCalendar_status_type(0);
}
// wocal.setCalendar_status(3);//打卡异常
}
}
......@@ -3054,7 +3082,6 @@ public class ClockInController {
wocal.setCalendar_status(3);//打卡异常
wocal.setCalendar_status_type(0);
}
// wocal.setCalendar_status(3);//打卡异常
}
}
......@@ -3072,7 +3099,12 @@ public class ClockInController {
KqglAssoRelationSummary asssum = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, userBean.getEmpNum())
.eq(KqglAssoRelationSummary::getAppTime, num).last("LIMIT 1"));
if(asssum != null) {
if(asssum.getApprovalType() == 5) {//补卡
wocal.setCalendar_status(1);//打卡正常
}else {
wocal.setCalendar_status(2);//事务(请假,加班,调休,出差)
}
//0:无;1:事假;2:调休;3:病假;4:年假;5:产假;6:陪产假;7:婚假;8:例假;9:丧假;10:哺乳假;11:加班;12:出差;13:外出
if(asssum.getApprovalType() == 1) {
......
......@@ -2633,14 +2633,61 @@ public class TimeCardController {
}
}
// KqglAssoRelationSummary asssum = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, userBean.getEmpNum())
// .eq(KqglAssoRelationSummary::getAppTime, num).last("LIMIT 1"));
// if(asssum != null) {
// wocal.setCalendar_status(2);//事务(请假,加班,调休,出差)
// }
}else {
wocal.setCalendar_status(3);//打卡异常
}
//事务(请假,加班,调休,出差)
KqglAssoRelationSummary asssum = KqglAssoRelationSummary.builder().build().selectOne(new QueryWrapper<KqglAssoRelationSummary>().lambda().eq(KqglAssoRelationSummary::getUserId, userBean.getEmpNum())
.eq(KqglAssoRelationSummary::getAppTime, num).last("LIMIT 1"));
if(asssum != null) {
if(asssum.getApprovalType() == 5) {//补卡
wocal.setCalendar_status(1);//打卡正常
}else {
wocal.setCalendar_status(2);//事务(请假,加班,调休,出差)
}
}else {
wocal.setCalendar_status(3);//打卡异常
//0:无;1:事假;2:调休;3:病假;4:年假;5:产假;6:陪产假;7:婚假;8:例假;9:丧假;10:哺乳假;11:加班;12:出差;13:外出
if(asssum.getApprovalType() == 1) {
wocal.setCalendar_status_type(11);
}else if(asssum.getApprovalType() == 2) {
//请假
KqglAssoLeaveRules rul = KqglAssoLeaveRules.builder().build().selectOne(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getId,asssum.getLeaveTypeId()));
if(rul.getRulesType() == 1) {
wocal.setCalendar_status_type(1);
}else if(rul.getRulesType() == 2) {
wocal.setCalendar_status_type(2);
}else if(rul.getRulesType() == 3) {
wocal.setCalendar_status_type(3);
}else if(rul.getRulesType() == 4) {
wocal.setCalendar_status_type(4);
}else if(rul.getRulesType() == 5) {
wocal.setCalendar_status_type(5);
}else if(rul.getRulesType() == 6) {
wocal.setCalendar_status_type(6);
}else if(rul.getRulesType() == 7) {
wocal.setCalendar_status_type(7);
}else if(rul.getRulesType() == 8) {
wocal.setCalendar_status_type(8);
}else if(rul.getRulesType() == 9) {
wocal.setCalendar_status_type(9);
}else if(rul.getRulesType() == 10) {
wocal.setCalendar_status_type(10);
}
}else if(asssum.getApprovalType() == 3) {
wocal.setCalendar_status_type(12);
}else if(asssum.getApprovalType() == 4) {
wocal.setCalendar_status_type(13);
}
}
}else {
wocal.setCalendar_status(4);//休息
}
......
......@@ -15,5 +15,5 @@ import cn.timer.api.bean.kqmk.KqglAssoDkjl;
*/
@Repository
public interface KqglAssoDkjlMapper extends BaseMapper<KqglAssoDkjl> {
List<KqglAssoDkjl> getDetailedRecordClock(Long start,Long end,Integer userId);
List<KqglAssoDkjl> getDetailedRecordClock(Long start,Long end,Integer userId,String attdate);
}
......@@ -84,6 +84,7 @@
and dkjl.attime &lt;= #{end}
and dkjl.user_id = #{userId,jdbcType=INTEGER}
and dkjl.status not in (0,2)
and dkjl.attdate = #{attdate}
</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