Commit d041da79 by lal Committed by chenzg

提交

parent 50dd34e6
......@@ -285,50 +285,79 @@ public class ClockInController {
}
}else {
boolean getinto = true;
//打卡时间 对比班次 接近哪个时间就打哪个时间的卡
if(attdate.getAttsch().size() == 4 || attdate.getAttsch().size() == 6) {
//punchstart 应打卡开始时间 punchend:应打卡结束时间 time_:打卡时间
boolean effectiveDate1 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime1ks), new SimpleDateFormat("HH:mm").format(starttime1js),"yyyy-MM-dd HH:mm");
boolean effectiveDate1 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime1ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime1js),"yyyy-MM-dd HH:mm");
if (effectiveDate1) {//在范围内就打卡
atttype = 1;
getinto = false;
}else {
isRange = false;
if(getinto) {
isRange = false;
}
}
boolean effectiveDate2 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime1ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime1js),"yyyy-MM-dd HH:mm");
if (effectiveDate2) {//在范围内就打卡
atttype = 2;
isRange = true;//在范围
getinto = false;
}else {
isRange = false;
if(getinto) {
isRange = false;
}
}
boolean effectiveDate3 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime2ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime2js),"yyyy-MM-dd HH:mm");
if (effectiveDate3) {//在范围内就打卡
atttype = 3;
isRange = true;//在范围
getinto = false;
}else {
isRange = false;
if(getinto) {
isRange = false;
}
}
boolean effectiveDate4 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime2ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime2js),"yyyy-MM-dd HH:mm");
if (effectiveDate4) {//在范围内就打卡
atttype = 4;
isRange = true;//在范围
getinto = false;
}else {
isRange = false;
if(getinto) {
isRange = false;
}
}
}
if(attdate.getAttsch().size() == 6) {
boolean effectiveDate5 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime3ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime3js),"yyyy-MM-dd HH:mm");
if (effectiveDate5) {//在范围内就打卡
atttype = 5;
isRange = true;//在范围
getinto = false;
}else {
isRange = false;
if(getinto) {
isRange = false;
}
}
boolean effectiveDate6 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime3ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime3js),"yyyy-MM-dd HH:mm");
if (effectiveDate6) {//在范围内就打卡
atttype = 6;
isRange = true;//在范围
getinto = false;
}else {
isRange = false;
if(getinto) {
isRange = false;
}
}
}
}
......@@ -361,11 +390,13 @@ public class ClockInController {
boolean effectiveDate1 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime1ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime1js),"yyyy-MM-dd HH:mm");
if (effectiveDate1) {//在范围内就打卡
if(dkmc.getSbdk1() != null) {
sbdkkd = true;//
sbdkkd = true;//打卡无效
}else {
atttype = 1;
}
}else { isRange = false; }
}else {
isRange = false;
}
boolean effectiveDate2 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime1ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime1js),"yyyy-MM-dd HH:mm");
if (effectiveDate2) {//在范围内就打卡
......@@ -375,7 +406,9 @@ public class ClockInController {
kskd = false;
atttype = 2;
}
}else { isRange = false; }
}else {
isRange = false;
}
boolean effectiveDate3 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime2ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(starttime2js),"yyyy-MM-dd HH:mm");
if (effectiveDate3) {//在范围内就打卡
......@@ -384,7 +417,9 @@ public class ClockInController {
}else {
atttype = 3;
}
}else { isRange = false; }
}else {
isRange = false;
}
boolean effectiveDate4 = ClockInTool.hourMinuteBetween(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time_), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime2ks), new SimpleDateFormat("yyyy-MM-dd HH:mm").format(endtime2js),"yyyy-MM-dd HH:mm");
if (effectiveDate4) {//在范围内就打卡
......@@ -394,7 +429,9 @@ public class ClockInController {
kskd = false;
atttype = 4;
}
}else { isRange = false; }
}else {
isRange = false;
}
}
if(attdate.getAttsch().size() == 6) {
......@@ -482,9 +519,21 @@ public class ClockInController {
int sbdkjg = 0,yzcdsc = 0,yzcdcs = 0,kgcdcs = 0;
if(punchcardtime != 0){//有应打卡时间时
Long time = (time_ - punchcardtime)/1000/60;
if(time > 0){//上班1打卡结果
sbdkjg = Math.abs(Integer.valueOf(time.toString()));
if((atttype)%2 > 0){//上班
if(time > 0){
sbdkjg = Integer.valueOf(time.toString());
}// 打卡结果
}else{//下班
if(time > 0){}else{
sbdkjg = Math.abs(Integer.valueOf(time.toString()));
}// 打卡结果
}
// if(time > 0){//上班1打卡结果
// sbdkjg = Math.abs(Integer.valueOf(time.toString()));
// }
}
if(atttype == 1) {
pcd.setSbdk1(time_);
......@@ -802,9 +851,13 @@ public class ClockInController {
if(punchcardtime != 0){
if(isRange) {
if((atttype)%2 > 0){//上班
if(time > 0){results = Integer.valueOf(time.toString());}// 打卡结果
if(time > 0){
results = Integer.valueOf(time.toString());
}// 打卡结果
}else{//下班
if(time > 0){}else{results = Math.abs(Integer.valueOf(time.toString()));}// 打卡结果
if(time > 0){}else{
results = Math.abs(Integer.valueOf(time.toString()));
}// 打卡结果
}
}
}
......
......@@ -30,6 +30,7 @@ import cn.timer.api.bean.kqmk.KqglAssoRelationSummary;
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.qyzx.QyzxEntInfoM;
import cn.timer.api.controller.kqgl.ClockInTool;
import cn.timer.api.dao.kqgl.AttendanceWeeklySchMapper;
import cn.timer.api.dao.kqgl.PunchCardDetailsMapper;
......@@ -104,7 +105,7 @@ public class AttendanceTaskTiming{
*/
//3.添加定时任务 每天下午七点执行一次
@Scheduled(cron = "0 0 19 * * ?")
@Scheduled(cron = "0 11 10 * * ?")
//或直接指定时间间隔,例如:5秒
//@Scheduled(fixedRate=5000)
......@@ -141,7 +142,7 @@ public class AttendanceTaskTiming{
ca.set(Calendar.DAY_OF_MONTH, ca.getActualMaximum(Calendar.DAY_OF_MONTH));
Long endDate = DateUtil.getnowEndTime(23,DateUtil.getStringTime(sdf1.format(ca.getTime()),"yyyy-MM-dd")).getTime();
// List<QyzxEntInfoM> orgcodelist = qyzxentinfommapper.selectList(new QueryWrapper<QyzxEntInfoM>());//系统中的所有公司 所有未到期的公司
List<QyzxEntInfoM> orgcodelist = qyzxentinfommapper.selectList(new QueryWrapper<QyzxEntInfoM>());//系统中的所有公司 所有未到期的公司
String str = new SimpleDateFormat("yyyy-MM-dd").format(new Date()).toString();//
String ttstr = new SimpleDateFormat("yyyy-MM").format(new Date()).toString();//
......@@ -153,8 +154,8 @@ public class AttendanceTaskTiming{
KqglAssoMonthPunchSummary.builder().build().delete(new QueryWrapper<KqglAssoMonthPunchSummary>().lambda().eq(KqglAssoMonthPunchSummary::getBelongYear, year).eq(KqglAssoMonthPunchSummary::getBelongMonth, month));
// for(int t = 0;t<orgcodelist.size();t++){
int org_code = 117;//orgcodelist.get(t).getId();//企业组织代码
for(int t = 0;t<orgcodelist.size();t++){
int org_code = orgcodelist.get(t).getId();//企业组织代码
List<AdditionalDto> userlist = kqglassoleavebalancemapper.selectAdditionalList(org_code);
for(AdditionalDto user : userlist) {
double traveltotal = 0,egresstotal = 0,overtimetotal = 0;
......@@ -724,7 +725,7 @@ public class AttendanceTaskTiming{
summary.setDay31(noticesArray[30]);
summary.insert();
}
// }
}
// KqglTaskTiming.builder().task("AttendanceTask").id(sockid).executionStatus(0).lastExecutionTime(new Date().getTime()).build().updateById();
// return new Exception().getStackTrace()[0].getMethodName();
......
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