Commit 852a9715 by leialin

Merge branch 'lal' into 'develop'

Lal

See merge request 8timerv2/8timerapiv200!275
parents 98dc5831 c66c0e87
...@@ -105,9 +105,10 @@ public class AttendanceTaskTiming{ ...@@ -105,9 +105,10 @@ public class AttendanceTaskTiming{
*/ */
//3.添加定时任务 每四小时执行一次 //3.添加定时任务 每四小时执行一次
@Scheduled(cron = "0 0 */4 * * ?") // @Scheduled(cron = "0 0 */4 * * ?")
// @Scheduled(cron = "0 */5 * * * ?") // 测试:5秒执行一次 0 0 19 * * ? // @Scheduled(cron = "0 02 12 * * ?") // 测试:5秒执行一次 0 0 19 * * ?
@Scheduled(cron = "0 */5 * * * ?")
public void AttendanceTask() throws ParseException { public void AttendanceTask() throws ParseException {
// boolean implement = false; // boolean implement = false;
...@@ -150,10 +151,12 @@ public class AttendanceTaskTiming{ ...@@ -150,10 +151,12 @@ public class AttendanceTaskTiming{
int year = Calendar.getInstance().get(Calendar.YEAR); int year = Calendar.getInstance().get(Calendar.YEAR);
int month = Calendar.getInstance().get(Calendar.MONTH) + 1; int month = Calendar.getInstance().get(Calendar.MONTH) + 1;
KqglAssoMonthPunchSummary.builder().build().delete(new QueryWrapper<KqglAssoMonthPunchSummary>().lambda().eq(KqglAssoMonthPunchSummary::getBelongYear, year).eq(KqglAssoMonthPunchSummary::getBelongMonth, month));
for(int t = 0;t<orgcodelist.size();t++){ for(int t = 0;t<orgcodelist.size();t++){
int org_code = orgcodelist.get(t).getId();//企业组织代码 int org_code = orgcodelist.get(t).getId();//企业组织代码
KqglAssoMonthPunchSummary.builder().build().delete(new QueryWrapper<KqglAssoMonthPunchSummary>().lambda().eq(KqglAssoMonthPunchSummary::getBelongYear, year)
.eq(KqglAssoMonthPunchSummary::getBelongMonth, month).eq(KqglAssoMonthPunchSummary::getOrgCode, org_code));
List<AdditionalDto> userlist = kqglassoleavebalancemapper.selectAdditionalList(org_code); List<AdditionalDto> userlist = kqglassoleavebalancemapper.selectAdditionalList(org_code);
for(AdditionalDto user : userlist) { for(AdditionalDto user : userlist) {
double traveltotal = 0,egresstotal = 0,overtimetotal = 0; double traveltotal = 0,egresstotal = 0,overtimetotal = 0;
...@@ -181,16 +184,34 @@ public class AttendanceTaskTiming{ ...@@ -181,16 +184,34 @@ public class AttendanceTaskTiming{
dkjtts[dk] = pcd.getData(); dkjtts[dk] = pcd.getData();
dk++; dk++;
if(pcd.getYdkcs() == 2 || pcd.getYdkcs() == 4 || pcd.getYdkcs() == 6){ if(pcd.getYdkcs() == 2 || pcd.getYdkcs() == 4 || pcd.getYdkcs() == 6){
if(pcd.getSbdk1() == null){ sblacks[sbqkcs] = pcd.getData(); sbqkcs++; } if(pcd.getSbdk1() == null){
if(pcd.getXbdk1() == null){ xblacks[xbqkcs] = pcd.getData(); xbqkcs++; } sblacks[sbqkcs] = pcd.getData();
sbqkcs++;
}
if(pcd.getXbdk1() == null){
xblacks[xbqkcs] = pcd.getData();
xbqkcs++;
}
} }
if(pcd.getYdkcs() == 4 || pcd.getYdkcs() == 6){ if(pcd.getYdkcs() == 4 || pcd.getYdkcs() == 6){
if(pcd.getSbdk2() == null){ sblacks[sbqkcs] = pcd.getData(); sbqkcs++; } if(pcd.getSbdk2() == null){
if(pcd.getXbdk2() == null){ xblacks[xbqkcs] = pcd.getData(); xbqkcs++; } sblacks[sbqkcs] = pcd.getData();
sbqkcs++;
}
if(pcd.getXbdk2() == null){
xblacks[xbqkcs] = pcd.getData();
xbqkcs++;
}
} }
if(pcd.getYdkcs() == 6){ if(pcd.getYdkcs() == 6){
if(pcd.getSbdk3() == null){ sblacks[sbqkcs] = pcd.getData(); sbqkcs++; } if(pcd.getSbdk3() == null){
if(pcd.getXbdk3() == null){ xblacks[xbqkcs] = pcd.getData(); xbqkcs++; } sblacks[sbqkcs] = pcd.getData();
sbqkcs++;
}
if(pcd.getXbdk3() == null){
xblacks[xbqkcs] = pcd.getData();
xbqkcs++;
}
} }
} }
} }
...@@ -439,7 +460,7 @@ public class AttendanceTaskTiming{ ...@@ -439,7 +460,7 @@ public class AttendanceTaskTiming{
} }
//排查请假是否在最后一次打卡范围内 查询当月的请假所有日期 //排查请假是否在最后一次打卡范围内 查询当月的请假所有日期
List<KqglAssoRelationSummary> leainv = kqglassorelationsummarymapper.LeaveInvestigation(user.getEmpnum(), 2, ttstr); List<KqglAssoRelationSummary> leainv = kqglassorelationsummarymapper.LeaveInvestigation(user.getEmpnum(), 2, ttstr,org_code);
// KqglAssoBcsz shif = KqglAssoBcsz.builder().build(); // KqglAssoBcsz shif = KqglAssoBcsz.builder().build();
String beginTime = sdf1.format(new Date()); String beginTime = sdf1.format(new Date());
// List<String> rowData = new ArrayList<String>(); // List<String> rowData = new ArrayList<String>();
...@@ -676,7 +697,7 @@ public class AttendanceTaskTiming{ ...@@ -676,7 +697,7 @@ public class AttendanceTaskTiming{
summary.setEarlyLeaveTimes(Double.valueOf(leanum));//早退次数 summary.setEarlyLeaveTimes(Double.valueOf(leanum));//早退次数
summary.setLengthEarlyLeave(Double.valueOf(leahours));//早退时长(分钟) summary.setLengthEarlyLeave(Double.valueOf(leahours));//早退时长(分钟)
summary.setNumberWorkCardShortage(Double.valueOf(sbqkcs));//上班缺卡次数 summary.setNumberWorkCardShortage(Double.valueOf(sbqkcs));//上班缺卡次数
summary.setNumberDutyCardShortage(Double.valueOf(xbqkcs));//下班缺卡次数 summary.setNumberDutyCardShortage(Double.valueOf(xbqkcs < 0 ? 0 : xbqkcs));//下班缺卡次数
summary.setLengthBusinessTrip(traveltotal);//出差时长 summary.setLengthBusinessTrip(traveltotal);//出差时长
summary.setTimeOut(egresstotal);//外出时长 summary.setTimeOut(egresstotal);//外出时长
summary.setTotalOvertimeHours(overtimetotal);//加班总时长 summary.setTotalOvertimeHours(overtimetotal);//加班总时长
......
...@@ -20,7 +20,7 @@ public interface KqglAssoRelationSummaryMapper extends BaseMapper<KqglAssoRelati ...@@ -20,7 +20,7 @@ public interface KqglAssoRelationSummaryMapper extends BaseMapper<KqglAssoRelati
List<KqglAssoRelationSummary> SpecificLeave(int userid,int approvaltype,String apptime); List<KqglAssoRelationSummary> SpecificLeave(int userid,int approvaltype,String apptime);
List<KqglAssoRelationSummary> LeaveInvestigation(int userid,int approvaltype,String apptime); List<KqglAssoRelationSummary> LeaveInvestigation(int userid,int approvaltype,String apptime,int orgcode);
KqglAssoRelationSummary selectTabledata(int userid,int approvaltype,String apptime); KqglAssoRelationSummary selectTabledata(int userid,int approvaltype,String apptime);
} }
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<result column="hk_address" property="hkAddress" /> <result column="hk_address" property="hkAddress" />
<result column="qq" property="qq" /> <result column="qq" property="qq" />
<result column="wechat" property="wechat" /> <result column="wechat" property="wechat" />
<result column="email" property="email" /> <!-- <result column="email" property="email" /> -->
<result column="blood_type" property="bloodType" /> <result column="blood_type" property="bloodType" />
<result column="language" property="language" /> <result column="language" property="language" />
<result column="edu" property="edu" /> <result column="edu" property="edu" />
......
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
res.end_time res.end_time
from kqgl_asso_relation_summary res from kqgl_asso_relation_summary res
where res.user_id = #{userid} where res.user_id = #{userid}
and res.org_code = #{orgcode}
and res.approval_type = #{approvaltype} and res.approval_type = #{approvaltype}
and SUBSTR(res.app_time,1,7) = #{apptime} and SUBSTR(res.app_time,1,7) = #{apptime}
GROUP BY res.start_time,res.end_time; GROUP BY res.start_time,res.end_time;
......
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