<P>谢谢大家!各家的产品不同,解决方案也不仅相同,总体上有两种:</P>
<P>一、ID卡 考勤和售饭使用同一套软件,系统时时通讯,考勤的数据可以下传到就餐的数据里,相当与给那些正常上班的人进行“解冻”,就可在消费机上就餐了,否则报警。</P>
<P>二、IC卡 考勤时考勤机给IC些个标记,吃饭的时候,由另外的消费机识别是否考勤,如果考勤才能吃饭,注:好多厂家是用两台考勤机来实现,只能记次消费。</P>
<P>请大家多指教,是否还有其他成熟的方案,按照班次更准确的进行考勤就餐管理的系统?</P>
<P>QQ;4817930 电话:0311-83030430 </P></TD></TR></TABLE>作者: davei 时间: 2005-6-21 18:12
<P>同意楼主所说,不过第一种情况,考勤和餐饮机都要是全实时的,线路不能有一点问题,还有就是早餐,是不是也只有打了上班卡才能吃。</P>作者: cwjjack 时间: 2005-6-23 16:06
<P>这样呀,太简单了用ID卡就可以了。发一个定餐+混饭的源代码,B/S结构</P><P><!--#include file="conn.asp"-->
<%
'http://192.168.200.100/kaoq/kcardsea.asp?cardid=0000999999&jihao=10261
'这条是表示卡钟向服务器IP地址为192.168.200.100发送为卡号为0000999999和发送这台卡钟的机器编号10261</P><P>
if request("CardId")="" or request("jihao")="" then
Response.Write "Ricom Systemswww.ricom.com.hk"&"count=0&"&"gzbh=&"&"xm="&"TransErr"&"&bmbh=&"&"ksbh=1"&"&"&"ly="
'卡钟自动上传卡号,和机器编号,如果上传为空值,就发一条数据告诉卡钟没有接收成功。
else
'定义时间变量。
dim jobb,dtime,ddate,skkhtemp
dim jobb1,nowtime,beforetime,aftertime
ddate=year(now)&"-"&month(now)&"-"&day(now)
if hour(now)<10 then
dtime="0"&hour(now)
else
dtime=hour(now)
end if
if minute(now)<10 then
dtime=dtime&":"&"0"&minute(now)
else
dtime=dtime&":"&minute(now)
end if
if second(now)<10 then
dtime=dtime&":"&"0"&second(now)
else
dtime=dtime&":"&second(now)
end if
skkhtemp=Right("0000000"&trim(request("CardId")),7)
'定义卡号不足7位地自动在前补0
end if
set jobb0=server.CreateObject("adodb.recordset")
set jobb0.activeconnection=conn
jobb0.open "select beforetime from ST_CS_SYSTEM ",,1,3
if jobb0.eof then
Response.Write "Ricom Systemswww.ricom.com.hkcount=0&gzbh=&"&"xm=参数没有设置&"&"bmbh=&"&"ksbh=1"&"&"&"ly="
response.end
else
beforetime=dateadd("s",- jobb0("beforetime"),nowtime)
aftertime=dateadd("s",jobb0("beforetime"),nowtime)
end if
set jobb1=server.CreateObject("adodb.recordset")
set jobb1.activeconnection=conn
'查找数据库里是否有这张卡的人事资料,如果没有就在卡钟显示非法卡,并且可以外接报警灯,提示工作人员
jobb1.open "select xm,gzbh,poskh,mustpre from ST_CS_GZB where gzbh ='"&skkhtemp&"' and (outf is null or outf>'"&ddate&"')",,1,3
if jobb1.eof then
Response.Write "Ricom Systemswww.ricom.com.hkcount=0&gzbh=&"&"xm=非法卡&"&"bmbh=&"&"ksbh=1"&"&"&"ly="
response.end</P><P>
else
'这里判是就餐还是定餐
set jobb2=server.CreateObject("adodb.recordset")
set jobb2.activeconnection=conn
jobb2.open "select machine_fun from parameter where coding ="&clng(trim(request("jihao"))),,1,3
if jobb2.eof then
'在数据库查找,这台卡钟是否设置了
Response.Write "Ricom Systemswww.ricom.com.hkcount=0&gzbh=&"&"xm=卡钟未设置&"&"bmbh=&"&"ksbh=1"&"&"&"ly="
response.end
else
if jobb2("machine_fun")=1 then '订餐
'response.write trim(request("CardId"))&"abc"
'response.write ddate&"abc"
'response.write ddate&" "&dtime&"abc"
'response.write dtime&"abc"
'response.write clng(trim(request("jihao")))&"abc"
'response.write jobb2("machine_fun")&"abc"
'response.write jobb1("gzbh")
'response.end
set jobb21=server.CreateObject("adodb.recordset")
set jobb21.activeconnection=conn
'判断卡钟是否是在订餐时间内
jobb21.Open "select xh from ST_CS_CC_DC where jhfw like '%"&trim(request("jihao"))&"%' and dcdate1<='"&nowtime1&"' and dcdate2>='"&nowtime1&"'",,1,3
if jobb21.eof then
Response.Write "Ricom Systemswww.ricom.com.hkcount=0&gzbh=&"&"xm=未在定餐时间内&"&"bmbh=&"&"ksbh=1"&"&"&"ly="
else
conn.execute "insert into ST_RECORD_DC(poskh,fdate,skrq,sksj,DevID,machine_fun,gzbh)values('"&trim(request("CardId"))&"','"&ddate&"','"&ddate&" "&left(dtime,5)&"','"&left(dtime,5)&"',"&clng(trim(request("jihao")))&","&jobb2("machine_fun")&",'"&jobb1("gzbh")&"')"
Response.Write "Ricom Systemswww.ricom.com.hk"&"count=1&gzbh="&jobb1("gzbh")&"&"&"xm="&jobb1("xm")&skkhtemp&"订餐成功"&"&"&"bmbh=&"&"ksbh=1"&"&"&"ly="
end if </P><P>
response.end
else '就餐
'machine_fun=2
set jobb3=server.CreateObject("adodb.recordset")
set jobb3.activeconnection=conn
'判断卡钟的就餐时间
jobb3.Open "select xh,defaultmoney,defaultmoney1,ghfw from ST_CS_CC where ghfw like '%"&left(skkhtemp,1)&"%' and jhfw like '%"&trim(request("jihao"))&"%' and qssjc<='"&dtime&"' and zzsjc>='"&dtime&"'",,1,3
if jobb3.eof then
Response.Write "Ricom Systemswww.ricom.com.hkcount=0&gzbh=&"&"xm=未在就餐时间&"&"bmbh=&"&"ksbh=1"&"&"&"ly="
response.end
end if
'每餐只能就餐一次
set jobb5=server.CreateObject("adodb.recordset")
set jobb5.activeconnection=conn
'response.write "Select gzbh from ST_RECORD Where gzbh='"&jobb1("gzbh")&"' and fdate='"&ddate&"' and skrq>='"&(beforetime)&"' and cc="&jobb3("xh")
jobb5.Open "Select gzbh from ST_RECORD Where gzbh='"&jobb1("gzbh")&"' and fdate='"&ddate&"' and (skrq<'"&beforetime&"' or skrq>'"&aftertime&"') and cc="&jobb3("xh")
if jobb5.Eof then
set jobb52=server.CreateObject("adodb.recordset")
set jobb52.activeconnection=conn
jobb52.Open "Select gzbh from ST_RECORD Where gzbh='"&jobb1("gzbh")&"' and fdate='"&ddate&"' and (skrq>='"&beforetime&"' and skrq<='"&aftertime&"') and cc="&jobb3("xh")
if jobb52.eof then '已就餐,但是还在定义的时间范围内,不报警
else
Response.Write "Ricom Systemswww.ricom.com.hk"&"count=1&gzbh="&jobb1("gzbh")&"&"&"xm="&jobb1("xm")&"&"&"bmbh=&"&"ksbh=1"&"&"&"ly="
response.end
end if
else
'重复就餐,并且报警
Response.Write "Ricom Systemswww.ricom.com.hkcount=0&gzbh=&"&"xm=重复就餐&"&"bmbh=&"&"ksbh=1"&"&"&"ly="
response.end
end if
'自己特别设置的就餐卡,不用定餐也可以就餐
if left(skkhtemp,1)<>"1" and left(skkhtemp,1)<>"2" then
set jobb4=server.CreateObject("adodb.recordset")
set jobb4.activeconnection=conn
'判断是否已经定餐了,如果没有定餐就餐,报警
jobb4.Open "Select gzbh from ST_RECORD_DC_RESULT Where gzbh='"&jobb1("gzbh")&"' and fdate='"&ddate&"' and cc="&jobb3("xh")&" and flag='T'"
if jobb4.eof then
Response.Write "Ricom Systemswww.ricom.com.hkcount=0&gzbh=&"&"xm=未定餐&"&"bmbh=&"&"ksbh=1"&"&"&"ly="
response.end
end if
end if
'判断不同人员就餐的金额
if mid(skkhtemp,2,1)="1"then
conn.execute "insert into ST_RECORD(atttime,gzbh,poskh,skrq,fdate,jcje,cc,oper,posid) Values('"&dtime&"','"&jobb1("gzbh")&"','"&trim(request("CardId"))&"','"&ddate&" "&dtime&"','"&ddate&"',"&jobb3("defaultmoney1")&","&jobb3("xh")&",0,"&clng(trim(request("jihao")))&")"
else
conn.execute "insert into ST_RECORD(atttime,gzbh,poskh,skrq,fdate,jcje,cc,oper,posid) Values('"&dtime&"','"&jobb1("gzbh")&"','"&trim(request("CardId"))&"','"&ddate&" "&dtime&"','"&ddate&"',"&jobb3("defaultmoney")&","&jobb3("xh")&",0,"&clng(trim(request("jihao")))&")"
end if
Response.Write "Ricom Systemswww.ricom.com.hk"&"count=1&gzbh="&jobb1("gzbh")&"&"&"xm="&jobb1("xm")&skkhtemp&"&"&"bmbh=&"&"ksbh=1"&"&"&"ly="
'消费成功,并且在卡钟上显示姓名和工号,(这里可以自己随便定义显示的内容如:可以显示剩于金额和次数)
response.end
end if
end if
end if