Exemplo n.º 1
0
        public (bool, string) CheckinByRfid(string rfid, DateTime carryoutDate, int depotId, int affairId)
        {
            Worker worker = WorkManager.GetWorkerByRfid(rfid);

            if (worker == null)
            {
                return(false, "找不到此人");
            }
            var aw = WorkManager.GetCacheAffairWorker(carryoutDate, depotId, affairId, worker.Id);

            if (aw.Item2 == null)
            {
                return(false, "此人没被安排在此任务中");
            }
            if (!ClcUtils.NowInTimeZone(aw.Item1.StartTime, aw.Item1.EndTime))
            {
                return(false, "没在任务时段");
            }
            WorkManager.DoCheckin(aw.Item1, aw.Item2, worker.Id);
            return(true, "刷卡验入成功");
        }
Exemplo n.º 2
0
        public (bool, string) CheckinByFinger(string finger, int workerId, DateTime carryoutDate, int depotId, int affairId)
        {
            var mR = WorkManager.MatchFinger(finger, workerId);

            if (!mR.Item1)
            {
                return(mR);
            }

            var aw = WorkManager.GetCacheAffairWorker(carryoutDate, depotId, affairId, workerId);

            if (aw.Item2 == null)
            {
                return(false, "此人没被安排在此任务中");
            }
            if (!ClcUtils.NowInTimeZone(aw.Item1.StartTime, aw.Item1.EndTime))
            {
                return(false, "没在任务时段");
            }
            WorkManager.DoCheckin(aw.Item1, aw.Item2, workerId);
            return(true, "验入成功!" + mR.Item2);
        }