|
|
@@ -86,7 +86,6 @@ namespace UAS_CheckWork
|
|
|
SetLoadingWindow stw = new SetLoadingWindow(InitGetInfo, "正在同步数据...");
|
|
|
stw.StartPosition = FormStartPosition.CenterParent;
|
|
|
stw.ShowDialog();
|
|
|
-
|
|
|
}
|
|
|
|
|
|
private void InPrint()
|
|
|
@@ -100,7 +99,9 @@ namespace UAS_CheckWork
|
|
|
dt.Columns.Add("cl_cardcode");
|
|
|
dt.Columns.Add("cl_time");
|
|
|
showDataGrid.DataSource = dt;
|
|
|
- string LastDate = dh.getFieldDataByCondition("cardlog", "to_char(max(cl_time),'yyyy-MM-dd HH24:mi:ss')", "cl_address='考勤机数据导入'").ToString();
|
|
|
+ string SerialNum = "";
|
|
|
+ axCZKEM1.GetSerialNumber(axCZKEM1.MachineNumber, out SerialNum);
|
|
|
+ string LastDate = dh.getFieldDataByCondition("cardlog", "to_char(max(cl_time),'yyyy-MM-dd HH24:mi:ss')", "cl_address='考勤机数据导入' and cl_code='" + SerialNum + "'").ToString();
|
|
|
if (LastDate == "")
|
|
|
{
|
|
|
LastDate = "1990-01-01 00:00:00";
|
|
|
@@ -117,8 +118,10 @@ namespace UAS_CheckWork
|
|
|
int workCode = 0; //记录workCode
|
|
|
List<string> cl_cardcode = new List<string>();
|
|
|
List<string> cl_time = new List<string>();
|
|
|
+ List<string> cl_machinenum = new List<string>();
|
|
|
+
|
|
|
StringBuilder sql = new StringBuilder();
|
|
|
- sql.Append("insert into cardlog (cl_id,cl_cardcode,cl_time,cl_address) values (cardlog_seq.nextval,:cl_emcode,TO_DATE(:cl_time,'yyyy-MM-dd hh24:mi:ss'),'考勤机数据导入')");
|
|
|
+ sql.Append("insert into cardlog (cl_id,cl_cardcode,cl_time,cl_address,cl_code) values (cardlog_seq.nextval,:cl_emcode,TO_DATE(:cl_time,'yyyy-MM-dd hh24:mi:ss'),'考勤机数据导入',:cl_machinenum)");
|
|
|
int count = 0;
|
|
|
while (axCZKEM1.SSR_GetGeneralLogData(iMachineNumber, out enrollNumber, out verifyCode, out inoutMode, out year, out month, out day, out hour, out minute, out second, ref workCode))
|
|
|
{
|
|
|
@@ -127,11 +130,13 @@ namespace UAS_CheckWork
|
|
|
{
|
|
|
cl_cardcode.Add(enrollNumber);
|
|
|
cl_time.Add(year + "-" + month + "-" + day + " " + hour + ":" + minute + ":" + second);
|
|
|
+ cl_machinenum.Add(SerialNum);
|
|
|
if (count % 1000 == 0)
|
|
|
{
|
|
|
- dh.BatchInsert(sql.ToString(), new string[] { "cl_cardcode", "cl_time" }, cl_cardcode.ToArray(), cl_time.ToArray());
|
|
|
+ dh.BatchInsert(sql.ToString(), new string[] { "cl_cardcode", "cl_time", "cl_machinenum" }, cl_cardcode.ToArray(), cl_time.ToArray(), cl_machinenum.ToArray());
|
|
|
cl_cardcode.Clear();
|
|
|
cl_time.Clear();
|
|
|
+ cl_machinenum.Clear();
|
|
|
}
|
|
|
count = count + 1;
|
|
|
//将数据加入DataTable中
|
|
|
@@ -142,7 +147,7 @@ namespace UAS_CheckWork
|
|
|
}
|
|
|
}
|
|
|
if (cl_time.Count > 0)
|
|
|
- dh.BatchInsert(sql.ToString(), new string[] { "cl_cardcode", "cl_time" }, cl_cardcode.ToArray(), cl_time.ToArray());
|
|
|
+ dh.BatchInsert(sql.ToString(), new string[] { "cl_cardcode", "cl_time", "cl_machinenum" }, cl_cardcode.ToArray(), cl_time.ToArray(), cl_machinenum.ToArray());
|
|
|
showDataGrid.DataSource = dt;
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|