private async Task CopyInsertVehicleWorker(PreVehicleWorker src, int routeId) { RouteWorker worker = new RouteWorker(); worker.RouteId = routeId; worker.WorkerId = src.WorkerId; worker.WorkRoleId = src.WorkRoleId; await _workerRepository.InsertAsync(worker); }
private RouteWorkerDto MapToWorker(RouteWorker rw) { var dto = ObjectMapper.Map <RouteWorkerDto>(rw); var workerId = rw.GetFactWorkerId(); var worker = WorkManager.GetWorker(workerId); dto.Signin = WorkManager.GetSigninInfo(worker.DepotId, workerId, DateTime.Now); if (rw.Articles == null) { return(dto); } foreach (var ra in rw.Articles) { var record = _articleRecordRepository.Get(ra.ArticleRecordId); var a = WorkManager.GetArticle(record.ArticleId); var s = record.ReturnTime.HasValue ? string.Format("{0}已还", record.ReturnTime.Value.ToString("HH:mm")) : "未还"; dto.ArticleList += string.Format("{0}({1}) ", a.Name, s); } return(dto); }