📄 unitkqsj.pas
字号:
begin
bj1:='0:00:00';
swsb:='0:00:00';
swxb:='0:00:00';
end;
if card[4]<>'0:00:00' then
begin
decodetime(strtotime(card[4]),hh,mm,ss,mes); //
ff:=mm-30;
if ff<0 then //满60分中换为小时;
begin
hh:=hh-1;
ff:=ff+60;
end;
mm:=ff;
bj2:=timetostr(encodetime(hh,mm,ss,mes)); //
end else
begin
bj2:='0:00:00';
xwsb:='0:00:00';
xwxb:='0:00:00';
end;
if card[6]<>'0:00:00' then
begin
decodetime(strtotime(card[6]),hh,mm,ss,mes); //
ff:=mm-30;
if ff<0 then //满60分中换为小时;
begin
hh:=hh-1;
ff:=ff+60;
end;
mm:=ff;
bj3:=timetostr(encodetime(hh,mm,ss,mes)); //
end else
begin
bj3:='0:00:00';
wssb:='0:00:00';
wsxb:='0:00:00';
end;
if card[8]<>'0:00:00' then
begin
decodetime(strtotime(card[8]),hh,mm,ss,mes); //
ff:=mm-30;
if ff<0 then //满60分中换为小时;
begin
hh:=hh-1;
ff:=ff+60;
end;
mm:=ff;
bj4:=timetostr(encodetime(hh,mm,ss,mes)); //
end else
begin
bj4:='0:00:00';
jbsb:='0:00:00';
jbxb:='0:00:00';
end;
if card[3]<>'0:00:00' then
begin
decodetime(strtotime(card[3]),hh,mm,ss,mes); //下班30分钟后即可进行上班打卡。
ff:=mm-30;
if ff<0 then //满60分中换为小时;
begin
hh:=hh-1;
ff:=ff+60;
end;
mm:=ff;
by1:=timetostr(encodetime(hh,mm,ss,mes)); //
end else
begin
if card[2]<>'0:00:00' then
begin
decodetime(strtotime(card[2]),hh,mm,ss,mes); //下班30分钟后即可进行上班打卡。
ff:=mm+30;
if ff>=60 then //满60分中换为小时;
begin
hh:=hh+1;
ff:=ff-60;
end;
mm:=ff;
by1:=timetostr(encodetime(hh,mm,ss,mes)); //
end else
begin
by1:='0:00:00';
end;
xwsb:='0:00:00';
xwxb:='0:00:00';
end;
if card[5]<>'0:00:00' then //下午下班
begin
decodetime(strtotime(card[5]),hh,mm,ss,mes); //
ff:=mm-30;
if ff<0 then //满60分中换为小时;
begin
hh:=hh-1;
ff:=ff+60;
end;
mm:=ff;
by2:=timetostr(encodetime(hh,mm,ss,mes)); //
end else
begin
if card[4]<>'0:00:00' then
begin
decodetime(strtotime(card[4]),hh,mm,ss,mes); //下班30分钟后即可进行上班打卡。
ff:=mm+30;
if ff>=60 then //满60分中换为小时;
begin
hh:=hh+1;
ff:=ff-60;
end;
mm:=ff;
by2:=timetostr(encodetime(hh,mm,ss,mes)); //
end else
begin
by2:='0:00:00';
end;
wssb:='0:00:00';
wsxb:='0:00:00';
end;
if card[7]<>'0:00:00' then //晚上下班
begin
decodetime(strtotime(card[7]),hh,mm,ss,mes); //
ff:=mm-30;
if ff<0 then //满60分中换为小时;
begin
hh:=hh-1;
ff:=ff+60;
end;
mm:=ff;
by3:=timetostr(encodetime(hh,mm,ss,mes)); //
end else
begin
if card[6]<>'0:00:00' then
begin
decodetime(strtotime(card[6]),hh,mm,ss,mes); //下班30分钟后即可进行上班打卡。
ff:=mm+30;
if ff>=60 then //满60分中换为小时;
begin
hh:=hh+1;
ff:=ff-60;
end;
mm:=ff;
by3:=timetostr(encodetime(hh,mm,ss,mes)); //
end else
begin
by3:='0:00:00';
end;
jbsb:='0:00:00';
jbxb:='0:00:00';
end;
if (zs1[i]<>'') and (zs1[i]<>'00:00:00') then
begin
if (strtotime(zs1[i])<strtotime(bj1)) then //上午上班
begin
swsb:=zs1[i];
end else
begin
if swsb='' then swsb:='0:00:00';
end;
if (strtotime(zs1[i])>=strtotime(bj1)) and (strtotime(zs1[i])<=strtotime(by1)) then //上午下班
begin
swxb:=zs1[i];
end else
begin
if swxb='' then swxb:='0:00:00';
end;
if (strtotime(zs1[i])>=strtotime(by1)) and (strtotime(zs1[i])<=strtotime(bj2))then //下午上班
begin
xwsb:=zs1[i];
end else
begin
if xwsb='' then xwsb:='0:00:00';
end;
if by2<>'' then
begin
if (strtotime(zs1[i])>=strtotime(bj2)) and (strtotime(zs1[i])<=strtotime(by2)) then //下午下班( 有晚班时)
begin
xwxb:=zs1[i];
end else
begin
if xwxb='' then xwxb:='0:00:00';
end;
if (strtotime(zs1[i])>strtotime(by2)) and (strtotime(zs1[i])<=strtotime(bj3))then //晚上上班
begin
wssb:=zs1[i];
end else
begin
if (strtotime(zs1[i])>=strtotime(bj3)) and (strtotime(zs1[i])>strtotime(by2)) then //当刷卡时间为第二天时;
begin
if wssb='' then
begin
wssb:=zs1[i];
end;
end else
begin
if wssb='' then wssb:='0:00:00';
end;
end;
if (strtotime(zs1[i])>=strtotime(bj3)) and (strtotime(zs1[i])<strtotime(by3)) then //晚上下班
begin
wsxb:=zs1[i];
end else
begin
if wsxb='' then wsxb:='0:00:00';
end;
end else
begin
if (strtotime(zs1[i])>=strtotime(card[4])) then //下午下班
begin
xwxb:=zs1[i];
end else
begin
if xwxb='' then xwxb:='0:00:00';
end;
end;
//////////////////////
if by3<>'0:00:00' then
begin
if (strtotime(zs1[i])<strtotime(bj4)) then //加班上班
begin
jbsb:=zs1[i];
end else
begin
if jbsb='' then jbsb:='0:00:00';
end;
if (strtotime(zs1[i])>=strtotime(bj4)) then //加班下班
begin
jbxb:=zs1[i];
end else
begin
if jbxb='' then jbxb:='0:00:00';
end;
end ;
end else
begin
if swsb='' then swsb:='0:00:00';
if swxb='' then swxb:='0:00:00';
if xwsb='' then xwsb:='0:00:00';
if xwxb='' then xwxb:='0:00:00';
if wssb='' then wssb:='0:00:00';
if wsxb='' then wsxb:='0:00:00';
if jbsb='' then jbsb:='0:00:00';
if jbxb='' then jbxb:='0:00:00';
end;
inc(i);
end;
//////////////////////////////////////
if (trim(ygbh)<>'') then
begin
p:=1;
try
sqlpub:='insert into [Dp_KQdocument] (person_no,person_name,part_no,IC_no,M_up,m_down,a_up,a_down,n_up,n_down,add_up,add_down,newdate) values ('+''''+trim(ygbh)+''''+','+''''+trim(xm)+''''+','+''''+trim(bm)+''''+','+''''+trim(icid)+''''+','+''''+trim(swsb)+''''+','+''''+trim(swxb)+''''+','+''''+trim(xwsb)+''''+','+''''+trim(xwxb)+''''+','+''''+trim(wssb)+''''+','+''''+trim(wsxb)+''''+','+''''+trim(jbsb)+''''+','+''''+trim(jbxb)+''''+','+''''+trim(formatdatetime('YYYY''-''MM''-''DD',strtodate(carddate)))+''''+')';
ipubtemp.scrapsate(sqlpub);
except
end;
swsb:='';
swxb:='';
xwsb:='';
xwxb:='';
wssb:='';
wsxb:='';
jbsb:='';
jbxb:='';
for i:=1 to 8 do
begin
zs1[i]:='';
end;
end;
dmmain.CDSquery.Next;
end;
//////////////////////
dmmain.cdsdata.Close; //跳到下一个员工考勤记录;
dmmain.cdsdata.Data:=null;
sqlpub:='select count(person_no) as ygbh from vkqsj where person_no='+''''+trim(ygbh)+'''';
try
datas:=null;
ipubtemp.ty_query(sqlpub,datas);
if not varisnull(datas) then
begin
dmmain.cdsdata.Data:=datas;
datas:=null;
end;
except
end;
j:=j+dmmain.cdsdata.fieldbyname('ygbh').AsInteger;
dmmain.cdsdata.Close;
dmmain.cdsdata.Data:=null;
if j< dmmain.cdsKQdoc.RecordCount then
begin
dmmain.cdsKQdoc.RecNo:=j;
end;
end;
application.MessageBox('数据导出完毕!',pchar(application.Title),mb_iconinformation);
end;
end;
procedure Tfrmkqsj.spdcxClick(Sender: TObject);
begin
{if (cbqsbh.Text='') and (cbjzbh.Text='') then
begin
application.MessageBox('请输入查询条件!',pchar(application.Title),mb_iconinformation);
cbqsbh.SetFocus;
exit;
end else
begin
if (cbqsbh.Text='') and (cbjzbh.Text<>'') then
begin
application.MessageBox('请选择起始员工编号!',pchar(application.Title),mb_iconinformation);
cbqsbh.SetFocus;
exit;
end;
end;
dm.aqrykqsj.Filtered:=false;
dm.aqrykqsj.Filter:='人员编码>='+''''+trim(cbqsbh.Text)+''''+chr(0)+'ygid<='+''''+trim(cbjzbh.Text)+''''+chr(255);
dm.aqrykqsj.Filtered:=true;}
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -