12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- //using Cksoft.Data;
- //using Cksoft.Data.Repository;
- //using Cksoft.Unity;
- //using Microsoft.Extensions.Logging;
- //using System;
- //using System.Collections.Generic;
- //using System.Text;
- //using System.Threading.Tasks;
- //namespace DllEapDal.OFILM.SyncTask
- //{
- // /// <summary>
- // /// 机台当前状态
- // /// </summary>
- // public class MacCurrentStatusDal
- // {
- // /// <summary>
- // /// 获取机台最新状态
- // /// </summary>
- // /// <returns></returns>
- // public async Task SyncMacLastStatus()
- // {
- // var logger = AppConfigurtaionServices.MyLog;
- // try
- // {
- // logger.LogError("开始计算机台当前状态");
- // var dateNow = DateTime.Now;
- // string errorinfo = string.Empty;
- // using (IDatabase db = DbFactory.Base("eap"))
- // {
- // db.BeginTrans();
- // var lastStatus = await db.FindListForConditionAsync<MacStatus01>(string.Empty, ref errorinfo);
- // // var macLastStatusList = new List<MacLastStatus>();
- // foreach (var item in lastStatus)
- // {
- // var tmp = new MacLastStatus
- // {
- // MacCode = item.MacCode,
- // Flen = Convert.ToInt32((dateNow - item.STime).TotalSeconds),
- // Shift = (int)shift,
- // StatusId = item.StatusID,
- // RecTime = Convert.ToDateTime(dateNow.ToString("yyyy-MM-dd HH:mm:ss")),
- // FDate = Convert.ToDateTime(date),
- // STime = item.STime,
- // RunRate = null
- // };
- // // db.Insert<MacLastStatus>(tmp);
- // db.InsertFor(tmp, string.Empty);
- // // macLastStatusList.Add(tmp);
- // }
- // //if (db.Insert<MacLastStatus>(macLastStatusList) < 0)
- // //{
- // // AppConfigurtaionServices.MyLog.LogError("机台最后状态插入数据库失败");
- // // return;
- // //}
- // db.Commit();
- // }
- // logger.LogError("计算机台最后状态完成");
- // }
- // catch (Exception ex)
- // {
- // logger.LogError("计算机台最后状态错误," + ex.ToString());
- // throw;
- // }
- // }
- // }
- //}
|