| | |
| | | var editDate = DateTime.Now.ToString("yyyy-MM-dd"); |
| | | |
| | | // 发送HTTP请求到数据刷新接口 |
| | | MesNumerical mesNumerical = null; |
| | | MesNumericalBycl mesNumerical = null; |
| | | try |
| | | { |
| | | using (var httpClient = new HttpClient()) |
| | |
| | | if (responseObj != null && responseObj.code == 200) |
| | | { |
| | | // 请求成功,获取MesNumerical数据 |
| | | mesNumerical = Db.Queryable<MesNumerical>() |
| | | mesNumerical = Db.Queryable<MesNumericalBycl>() |
| | | .Where(s => s.EditDate == editDate |
| | | && s.MachineNo == entity.MachineNo) |
| | | .OrderByDescending(s => s.Id) |
| | |
| | | Db.Insertable<MesAnchors>(eAnchors) |
| | | .ExecuteCommand(); |
| | | |
| | | // 新增逻辑:送检时间有值时,判断最新首检单是否合格,合格则写入调机完成时间为当前时间 |
| | | if (!string.IsNullOrEmpty(entity.MaShoutTime)) |
| | | { |
| | | // 查找该工单号下最新的首检单 |
| | | var sjRecord = Db.Queryable<MesQaItemsDetect02>() |
| | | .Where(x => x.Aufnr == womdaa.Daa001 && x.Ftype == "首检") |
| | | .OrderBy(x => x.CreateDate, OrderByType.Desc) |
| | | .First(); |
| | | |
| | | if (sjRecord != null && sjRecord.FcheckResu == "合格") |
| | | { |
| | | //将送检时间写入开工时间 |
| | | entity.StartTime = entity.MaShoutTime; |
| | | entity.MaEndTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
| | | } |
| | | } |
| | | |
| | | // 更新工单状态表 |
| | | return Db.Updateable<MesOrderSta>() |
| | |
| | | // var reportingOkQty = |
| | | // Convert.ToDecimal(vOrder.todayOutput) - |
| | | // reporting.OkQty; |
| | | var CjQty = Db.Queryable<MesNumerical>() |
| | | var CjQty = Db.Queryable<MesNumericalBycl>() |
| | | .Where(s => s.MachineNo == entity.MachineNo && s.EditDate == date) |
| | | .OrderByDescending(s=>s.CjTiem) |
| | | .Select<long?>(s=>s.CjNum).First(); |