| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Comm; |
| | | using WIDESEA_Common; |
| | | using WIDESEA_Core.EFDbContext; |
| | | using WIDESEA_Core.FreeDB; |
| | | using WIDESEA_Entity.DomainModels; |
| | | using WIDESEA_WMS.IRepositories; |
| | | using WIDESEA_WMS.Repositories; |
| | |
| | | { |
| | | public class Task |
| | | { |
| | | static FreeDB freeDB = new FreeDB(); |
| | | /// <summary> |
| | | /// æ·»å åå²ä»»å¡ |
| | | /// </summary> |
| | |
| | | htyRepository.Add(agvtask_Hty, true); |
| | | repository.Delete(task, true); |
| | | } |
| | | /// <summary> |
| | | /// åºåå¤ç |
| | | /// </summary> |
| | | /// <param name="task"></param> |
| | | public static void Updateinventory(dt_agvtask task) |
| | | { |
| | | string[] bindSNs = task.bindSN.Split(","); |
| | | if (bindSNs.Length > 0) |
| | | { |
| | | var Materiel = QueryData.QueryMateriel(task.agv_materielid); |
| | | List<dt_inventory> inventorys = new List<dt_inventory>(); |
| | | foreach (string bindSN in bindSNs) |
| | | { |
| | | dt_inventory inventory = new dt_inventory() |
| | | { |
| | | SN = bindSN,//å¾
å®å |
| | | }; |
| | | inventorys.Add(inventory); |
| | | } |
| | | if (task.agv_tasktype == AGVTaskTypeEnum.TaskType_Inbound.ToString() || task.agv_tasktype == AGVTaskTypeEnum.TaskType_OutsourceInbound.ToString()) |
| | | freeDB.AddRange(inventorys); |
| | | else if (task.agv_tasktype == AGVTaskTypeEnum.TaskType_Outbound.ToString() || task.agv_tasktype == AGVTaskTypeEnum.TaskType_OutsourceOutbound.ToString()) |
| | | freeDB.Remove(inventorys); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// èªå¨æ´æ°ç¼åæ¶ç¶æ |
| | | /// </summary> |
| | | /// <param name="task"></param> |
| | | public static void AutoUpdateHCJState(dt_agvtask task) |
| | | { |
| | | VOLContext context = new VOLContext(); |
| | | Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(context); |
| | | var station1 = stationinfoRepository.FindFirst(t => t.stationCode == task.agv_fromaddress); |
| | | var station2 = stationinfoRepository.FindFirst(t => t.stationCode == task.agv_toaddress); |
| | | |
| | | station2.quantity = station1.quantity; |
| | | station2.bindSN = station1.bindSN; |
| | | station2.location_state = LocationStateEnum.Stroge.ToString(); |
| | | station2.tray_status = station1.tray_status; |
| | | stationinfoRepository.Update(station2, true); |
| | | |
| | | station1.quantity = 0; |
| | | station1.bindSN = string.Empty; |
| | | station1.location_state = LocationStateEnum.Empty.ToString(); |
| | | station1.tray_status = string.Empty; |
| | | stationinfoRepository.Update(station1, true); |
| | | } |
| | | } |
| | | } |