已删除2个文件
已修改22个文件
已添加2个文件
已重命名4个文件
| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="WIDESEAWCS_QuartzJob" Version="1.0.0" /> |
| | | <PackageReference Include="WIDESEAWCS_QuartzJob" Version="3.0.8" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | |
| | | Line_OutFinish = 135, |
| | | |
| | | /// <summary> |
| | | /// ä¸åAGVåºåºä»»å¡ |
| | | /// </summary> |
| | | [Description("ä¸åAGVåºåºä»»å¡")] |
| | | AGV_OutSend = 140, |
| | | |
| | | /// <summary> |
| | | /// AGVåºåºæ§è¡ä¸ |
| | | /// </summary> |
| | | [Description("AGVåºåºæ§è¡ä¸")] |
| | | AGV_OutExecuting = 140, |
| | | AGV_OutExecuting = 145, |
| | | |
| | | /// <summary> |
| | | /// AGVåºåºå®æ |
| | | /// </summary> |
| | | [Description("AGVåºåºå®æ")] |
| | | AGV_OutFinish = 145, |
| | | AGV_OutFinish = 150, |
| | | |
| | | /// <summary> |
| | | /// åºåºä»»å¡å®æ |
| | |
| | | { |
| | | if (BaseDal.QueryFirst(x => x.TaskNum == item.TaskNum || x.PalletCode == item.PalletCode) != null) |
| | | { |
| | | continue; |
| | | throw new Exception($"ä»»å¡å·ã{item.TaskNum}å·²åå¨ä»»å¡ã"); |
| | | } |
| | | Dt_Task task = _mapper.Map<Dt_Task>(item); |
| | | task.Creater = "WMS"; |
| | |
| | | //æä¸èèå¤è·¯å¾ |
| | | if (routers.Count > 0) |
| | | { |
| | | task.TaskState = (int)TaskOutStatusEnum.OutNew; |
| | | |
| | | task.TaskState = item.SourceIsPickPlace ? TaskOutStatusEnum.Car_OutFinish.ObjToInt() : TaskOutStatusEnum.OutNew.ObjToInt(); |
| | | task.CurrentAddress = item.SourceAddress; |
| | | task.NextAddress = routers.FirstOrDefault().ChildPosi; |
| | | } |
| | |
| | | { |
| | | |
| | | #region 任塿´æ° |
| | | var Tasks = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState > (int)TaskInStatusEnum.InNew && x.TaskState < (int)TaskInStatusEnum.AGV_InFinish).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList(); |
| | | var Tasks = _taskService.Db.Queryable<Dt_Task>().Where(x => |
| | | x.TaskState > (int)TaskInStatusEnum.InNew && |
| | | x.TaskState < (int)TaskInStatusEnum.AGV_InFinish || |
| | | x.TaskState > (int)TaskOutStatusEnum.Line_OutFinish && |
| | | x.TaskState < (int)TaskOutStatusEnum.AGV_OutFinish).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList(); |
| | | foreach (var Task in Tasks) |
| | | { |
| | | var ResultData = HttpHelper.PostAsync(AGVInterfaceAddress.taskResult + Task.TaskNum, null, headers: new Dictionary<string, string>()); |
| | |
| | | case "01": |
| | | break; |
| | | case "02": |
| | | Task.TaskState = TaskInStatusEnum.AGV_InExecuting.ObjToInt(); |
| | | Task.TaskState = _taskService.TaskInboundTypes.Contains(Task.TaskType) ? TaskInStatusEnum.AGV_InExecuting.ObjToInt() : TaskOutStatusEnum.AGV_OutExecuting.ObjToInt(); |
| | | break; |
| | | case "08": |
| | | { |
| | | Task.TaskState = (int)TaskInStatusEnum.AGV_InFinish; |
| | | Task.TaskState = _taskService.TaskInboundTypes.Contains(Task.TaskType) ? (int)TaskInStatusEnum.AGV_InFinish : TaskOutStatusEnum.AGV_OutFinish.ObjToInt(); |
| | | Task.CurrentAddress = Task.NextAddress; |
| | | List<Dt_Router> routers = _routerService.QueryNextRoutes(Task.CurrentAddress, Task.TargetAddress); |
| | | if (routers.Count > 0) |
| | | { |
| | | Task.NextAddress = routers.FirstOrDefault().ChildPosi; |
| | | Task.NextAddress = routers.FirstOrDefault()?.ChildPosi ?? ""; |
| | | } |
| | | } |
| | | break; |
| | |
| | | |
| | | #region ä»»å¡ä¸å |
| | | List<Dt_Task> UpnewTasks = new List<Dt_Task>(); |
| | | var newTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == (int)TaskInStatusEnum.InNew).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList(); |
| | | var newTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskInStatusEnum.InNew.ObjToInt() || x.TaskState == TaskOutStatusEnum.Line_OutFinish.ObjToInt()).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList(); |
| | | foreach (var agvTaskDTO in GetAGVTaskDTOs(newTasks)) |
| | | { |
| | | var ResultData = HttpHelper.PostAsync(AGVInterfaceAddress.taskSent, agvTaskDTO.ToJson(), headers: new Dictionary<string, string>()); |
| | |
| | | if (content.code == "20000") |
| | | { |
| | | var task = newTasks.Where(x => x.TaskNum == agvTaskDTO.outID.ObjToInt()).First(); |
| | | task.TaskState = TaskInStatusEnum.AGV_InSend.ObjToInt(); |
| | | task.TaskState = _taskService.TaskInboundTypes.Contains(task.TaskType)? TaskInStatusEnum.AGV_InSend.ObjToInt(): TaskOutStatusEnum.AGV_OutSend.ObjToInt(); |
| | | UpnewTasks.Add(task); |
| | | } |
| | | else |
| | |
| | | using WIDESEAWCS_QuartzJob; |
| | | using WIDESEAWCS_QuartzJob.ConveyorLine.Enum; |
| | | using WIDESEAWCS_QuartzJob.DTO; |
| | | using WIDESEAWCS_QuartzJob.Repository; |
| | | using WIDESEAWCS_QuartzJob.Service; |
| | | using WIDESEAWCS_Tasks.ConveyorLineJob; |
| | | |
| | |
| | | private readonly ITaskService _taskService; |
| | | private readonly ITaskExecuteDetailService _taskExecuteDetailService; |
| | | private readonly IRouterService _routerService; |
| | | private readonly IRouterRepository _routerRepository; |
| | | private readonly IMapper _mapper; |
| | | |
| | | public CommonConveyorLineJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper) |
| | | public CommonConveyorLineJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IRouterRepository routerRepository, IMapper mapper) |
| | | { |
| | | _taskService = taskService; |
| | | _taskExecuteDetailService = taskExecuteDetailService; |
| | | _routerService = routerService; |
| | | _routerRepository = routerRepository; |
| | | _mapper = mapper; |
| | | } |
| | | |
| | |
| | | if (content.Status) content.Status = conveyorLine.GetValue<ConveyorLine_AGV, bool>(ConveyorLine_AGV.ConveyorLinePermitPut, conveyor.Station); |
| | | break; |
| | | case 2: |
| | | content.Status = conveyorLine.SetValue(ConveyorLine_AGV.WriteAGVPutComplete, true, conveyor.Station); |
| | | { |
| | | content.Status = conveyorLine.SetValue(ConveyorLine_AGV.WriteAGVPutComplete, true, conveyor.Station); |
| | | if (content.Status) |
| | | { |
| | | Thread.Sleep(1000); |
| | | conveyorLine.SetValue(ConveyorLine_AGV.WriteAGVRequestPut, false, conveyor.Station); |
| | | conveyorLine.SetValue(ConveyorLine_AGV.WriteAGVPutComplete, false, conveyor.Station); |
| | | } |
| | | } |
| | | break; |
| | | case 3: |
| | | content.Status = conveyorLine.SetValue(ConveyorLine_AGV.WriteAGVRequestTake, true, conveyor.Station); |
| | | if (content.Status) content.Status = conveyorLine.GetValue<ConveyorLine_AGV, bool>(ConveyorLine_AGV.ConveyorLinePermitTake, conveyor.Station); |
| | | break; |
| | | case 4: |
| | | content.Status = conveyorLine.SetValue(ConveyorLine_AGV.WriteAGVTakeComplete, true, conveyor.Station); |
| | | { |
| | | content.Status = conveyorLine.SetValue(ConveyorLine_AGV.WriteAGVTakeComplete, true, conveyor.Station); |
| | | if (content.Status) |
| | | { |
| | | Thread.Sleep(1000); |
| | | conveyorLine.SetValue(ConveyorLine_AGV.WriteAGVRequestTake, false, conveyor.Station); |
| | | conveyorLine.SetValue(ConveyorLine_AGV.WriteAGVTakeComplete, false, conveyor.Station); |
| | | } |
| | | } |
| | | break; |
| | | default: throw new Exception($"ç±»åæè¯¯[Typeï¼{conveyor.Type}]"); |
| | | } |
| | |
| | | { |
| | | ConveyorLineInFinish(conveyorLine, command, childDeviceCode); |
| | | } |
| | | //else if (childDeviceCode == "1005" && command.Status == (ushort)ConveyorStatus.Stored) |
| | | //{ |
| | | // Dt_Task task = _taskService.QueryConveyorLineTaskNum(conveyorLine.DeviceCode, childDeviceCode, command.TaskNum); |
| | | // if (task != null) |
| | | // { |
| | | // task.TaskState = TaskOutStatusEnum.Line_OutExecuting.ObjToInt(); |
| | | // _taskService.UpdateData(task); |
| | | // ConveyorLineTaskCommandW taskCommand = _mapper.Map<ConveyorLineTaskCommandW>(task); |
| | | // taskCommand.WriterTrue = (short)command.inRead; |
| | | // conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | // } |
| | | //} |
| | | else if (childDeviceCode == "1008" && command.Status == (ushort)ConveyorStatus.Stored) |
| | | { |
| | | ConveyorLineOutFinish(conveyorLine, command, childDeviceCode); |
| | | Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode); |
| | | if (task != null) |
| | | { |
| | | List<Dt_Router> routers = _routerRepository.QueryData(x => x.StartPosi == task.NextAddress && x.ChildPosiDeviceCode == "AGV" && x.Remark == "æªå ç¨"); |
| | | if (routers.Count > 0) |
| | | { |
| | | |
| | | } |
| | | task.TaskState = TaskOutStatusEnum.Line_OutFinish.ObjToInt(); |
| | | _taskService.UpdateData(task); |
| | | } |
| | | } |
| | | } |
| | | #region MyRegion |
| | |
| | | //var content = ProductionLineToWMSRequest(MaterielGroupDTO); |
| | | //i++; |
| | | #region MyRegion |
| | | //OtherDevice ProductionLine = (OtherDevice)context.JobDetail.JobDataMap.Get("JobParams"); |
| | | //if (ProductionLine != null) |
| | | //{ |
| | | // var request = ProductionLine.GetValue<ProductionLineDBName, short>(ProductionLineDBName.request); |
| | | // if (request == 1) |
| | | // { |
| | | // var traytype = ProductionLine.GetValue<ProductionLineDBName, short>(ProductionLineDBName.trayType); |
| | | // //var content = Request(ProductionLine, traytype, ProductionLine.DeviceCode); |
| | | // if (traytype == 4) |
| | | // { |
| | | // var Barcode = ProductionLine.GetValue<ProductionLineDBName, string>(ProductionLineDBName.trayBarcode); |
| | | // var batchNo = ProductionLine.GetValue<ProductionLineDBName, string>(ProductionLineDBName.batchNo); |
| | | // ProductionLineDTO MaterielGroupDTO = new ProductionLineDTO() |
| | | // { |
| | | // stationCode = ProductionLine.DeviceCode, |
| | | // traytype = traytype, |
| | | // Barcode = Barcode, |
| | | // batchNo = batchNo, |
| | | // }; |
| | | // var content = ProductionLineToWMSRequest(MaterielGroupDTO); |
| | | // if (content.Status) ProductionLine.SetValue(ProductionLineDBName.Wrequest, 1); |
| | | // } |
| | | // } |
| | | //} |
| | | OtherDevice ProductionLine = (OtherDevice)context.JobDetail.JobDataMap.Get("JobParams"); |
| | | if (ProductionLine != null) |
| | | { |
| | | var request = ProductionLine.GetValue<ProductionLineDBName, short>(ProductionLineDBName.request); |
| | | if (request == 1) |
| | | { |
| | | var traytype = ProductionLine.GetValue<ProductionLineDBName, short>(ProductionLineDBName.trayType); |
| | | //var content = Request(ProductionLine, traytype, ProductionLine.DeviceCode); |
| | | if (traytype == 4) |
| | | { |
| | | var Barcode = ProductionLine.GetValue<ProductionLineDBName, string>(ProductionLineDBName.trayBarcode); |
| | | var batchNo = ProductionLine.GetValue<ProductionLineDBName, string>(ProductionLineDBName.batchNo); |
| | | ProductionLineDTO MaterielGroupDTO = new ProductionLineDTO() |
| | | { |
| | | stationCode = ProductionLine.DeviceCode, |
| | | traytype = traytype, |
| | | Barcode = Barcode, |
| | | batchNo = batchNo, |
| | | }; |
| | | var content = ProductionLineToWMSRequest(MaterielGroupDTO); |
| | | if (content.Status) ProductionLine.SetValue(ProductionLineDBName.Wrequest, 1); |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | #region MyRegion |
| | | //short[] shorts = { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }; |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | //Console.Out.WriteLine(nameof(CommonProductionLineJob) + ":" + ex.ToString()); |
| | | Console.Out.WriteLine(nameof(CommonProductionLineJob) + ":" + ex.ToString()); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | |
| | | // shuttleCarTaskCommand.TaskType = (short)GetCarTaskType(task.TaskType, shuttleCarTaskCommand.Direction); |
| | | } |
| | | } |
| | | else if (task.TaskType == (int)TaskOtherTypeEnum.RelocationCarCharging) |
| | | { |
| | | shuttleCarTaskCommand.TaskType = (short)GetCarTaskType(ShuttleCarTaskType.Charging.ToString()); |
| | | } |
| | | else |
| | | shuttleCarTaskCommand.TaskType = (short)GetCarTaskType(task.TaskType, shuttleCarTaskCommand.Direction); |
| | | //shuttleCarTaskCommand.TaskType = string.IsNullOrEmpty(task.Remark) ? (short)GetCarTaskType(task.TaskType, shuttleCarTaskCommand.Direction) : (short)GetCarTaskType(task.Remark); |
| | |
| | | switch (TaskType) |
| | | { |
| | | case (int)TaskInboundTypeEnum.Inbound: |
| | | case (int)TaskInboundTypeEnum.PalletInbound: |
| | | state = (int)TaskInStatusEnum.Car_InExecuting; |
| | | break; |
| | | case (int)TaskOutboundTypeEnum.Outbound: |
| | | case (int)TaskOutboundTypeEnum.PalletOutbound: |
| | | state = (int)TaskOutStatusEnum.Car_OutExecuting; |
| | | break; |
| | | case (int)TaskOtherTypeEnum.RelocationCar: |
| | | state = (int)TaskCarStatusEnum.ShuttleCar_Executing; |
| | | break; |
| | | case (int)TaskOtherTypeEnum.RelocationCarCharging: |
| | | state = (int)CarChargingTaskEnum.ShuttleCar_Charging; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region è·åå åæºç§»è½¦/ç§»åºå®æä»»å¡ |
| | | GetSC_CarFinish(); |
| | | #endregion |
| | | |
| | | #region å建移车å
çµä»»å¡ |
| | | if (command.Err_Status == (short)ShuttleCarErr.LowBattery || command.ElectricQuantity <= (short)ShuttleCarErr.LowBattery) |
| | | { |
| | |
| | | _taskService.AddRelocationCarTask(ShuttleCar.ShuttleCarPosition, "003-002-001", ShuttleCar.ShuttleCarCode, ShuttleCarTaskType.Charging.ToString()); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region è·åå åæºç§»è½¦/ç§»åºå®æä»»å¡ |
| | | GetSC_CarFinish(); |
| | | #endregion |
| | | |
| | | #region è·å移车/åºå
¥åºä»»å¡ |
| | |
| | | #region ä»»å¡é»è¾å¤ç |
| | | var onlinestate = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.Onlinestate); |
| | | var writeStatus = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WriteStatus); |
| | | if (onlinestate == (short)Onlinestate.online && writeStatus == (short)WriteStatus.Permit) |
| | | if (onlinestate == (short)Onlinestate.online /*&& writeStatus == (short)WriteStatus.Permit*/) |
| | | { |
| | | #region æ¥è¯¢ä»»å¡,é»è¾å¤ç |
| | | if (Enum.Parse<RunStatus>(commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.RunStatus).ToString()) == RunStatus.Standby) |
| | |
| | | && ASRSRqtGetGoods && task.SourceIsPickPlace)//请æ±åè´§ |
| | | { |
| | | commonStackerCrane.SetValue(StackerCraneDBName.AGVAlwASRSGetGoods, ASRSRqtGetGoods); |
| | | }else if (_taskService.TaskOutboundTypes.Contains(task.TaskType)&& ASRSPutAGoodsDone) |
| | | { |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.4" /> |
| | | <PackageReference Include="WIDESEAWCS_QuartzJob" Version="2.1.2" /> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.7" /> |
| | | <PackageReference Include="WIDESEAWCS_QuartzJob" Version="3.0.8" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | |
| | | >已鿰éï¼ {{ selectionSum }} |
| | | </span> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <!-- <el-col :span="4"> |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | |
| | | @click="revokeAssign" |
| | | >æ¤éåé
</el-link |
| | | ></el-col |
| | | > |
| | | > --> |
| | | </el-row> |
| | | </el-alert> |
| | | </div> |
| | |
| | | :width="item.width" |
| | | align="center" |
| | | > |
| | | <template #default="scoped" v-if="item.type == 'icon'"> |
| | | <el-tooltip |
| | | class="item" |
| | | effect="dark" |
| | | :content="item.title" |
| | | placement="bottom" |
| | | ><el-button |
| | | type="text" |
| | | @click="tableButtonClick(scoped.row, item)" |
| | | ><i :class="item.icon" style="font-size: 22px"></i></el-button |
| | | ></el-tooltip> |
| | | <template #default="scoped"> |
| | | <template v-if="item.type == 'icon'"> |
| | | <el-tooltip |
| | | class="item" |
| | | effect="dark" |
| | | :content="item.title" |
| | | placement="bottom" |
| | | ><el-button |
| | | type="text" |
| | | @click="tableButtonClick(scoped.row, item)" |
| | | ><i |
| | | :class="item.icon" |
| | | :style="{ fontSize: item.iconSize || '22px' }" |
| | | ></i></el-button |
| | | ></el-tooltip> |
| | | </template> |
| | | <template v-else> |
| | | <el-tooltip |
| | | :content="scoped.row[item.prop]" |
| | | placement="top" |
| | | :disabled=" |
| | | !isContentOverflow(scoped.row[item.prop], item.width) |
| | | " |
| | | > |
| | | <div class="cell-content"> |
| | | {{ scoped.row[item.prop] }} |
| | | </div> |
| | | </el-tooltip> |
| | | </template> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | type: "string", |
| | | width: 150, |
| | | }, |
| | | // { |
| | | // prop: "palletCode", |
| | | // title: "æçç¼å·", |
| | | // type: "string", |
| | | // width: 150, |
| | | // }, |
| | | { |
| | | prop: "palletCode", |
| | | title: "æçç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | }, |
| | | { |
| | | prop: "batchNo", |
| | | title: "æ¹æ¬¡å·", |
| | | type: "string", |
| | | width: 150, |
| | | }, |
| | | // { |
| | | // prop: "locationCode", |
| | | // title: "è´§ä½ç¼å·", |
| | | // type: "string", |
| | | // width: 180, |
| | | // }, |
| | | { |
| | | prop: "locationCode", |
| | | title: "è´§ä½ç¼å·", |
| | | type: "string", |
| | | |
| | | width: 180, |
| | | }, |
| | | { |
| | | prop: "useableQuantity", |
| | | title: "å¯ç¨æ°é", |
| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | isContentOverflow(content, width) { |
| | | if (!content || !width) return false; |
| | | // ä¼°ç®æ¯ä¸ªå符çå®½åº¦ï¼æ ¹æ®åä½å¤§å°è°æ´ï¼ |
| | | const charWidth = 8; // å设æ¯ä¸ªå符宽度为 8px |
| | | const maxChars = Math.floor(width / charWidth); |
| | | return content.length > maxChars; |
| | | }, |
| | | open(row) { |
| | | this.row = row; |
| | | this.showDetialBox = true; |
| | |
| | | }); |
| | | }, |
| | | outbound() { |
| | | if (this.selection.length <= 0) { |
| | | return this.$message.error("è¯·éæ©æå®åºå"); |
| | | } |
| | | this.http |
| | | .post( |
| | | "api/Task/GenerateOutboundTask?id=" + this.row.id, |
| | |
| | | .more-style { |
| | | color: red; |
| | | } |
| | | .cell-content { |
| | | white-space: nowrap; /* 鲿¢æ¢è¡ */ |
| | | overflow: hidden; /* éèè¶
åºé¨å */ |
| | | text-overflow: ellipsis; /* æ¾ç¤ºçç¥å· */ |
| | | width: 100%; /* å®½åº¦å æ»¡åå
æ ¼ */ |
| | | } |
| | | </style> |
| | | |
| | | <style> |
| | |
| | | const login = () => { |
| | | if (!userInfo.userName) return $message.error('请è¾å
¥ç¨æ·å'); |
| | | if (!userInfo.password) return $message.error('请è¾å
¥å¯ç '); |
| | | if (!userInfo.verificationCode) { |
| | | return $message.error('请è¾å
¥éªè¯ç '); |
| | | } |
| | | if (!userInfo.verificationCode) return $message.error('请è¾å
¥éªè¯ç '); |
| | | if (userInfo.verificationCode!="1234") return $message.error('éªè¯ç æè¯¯'); |
| | | loading.value = true; |
| | | http.post('/api/User/login', userInfo, 'æ£å¨ç»å½....').then((result) => { |
| | | if (!result.status) { |
| | |
| | | |
| | | WebResponseContent LockOutboundStock(int orderDetailId); |
| | | |
| | | (List<Dt_StockInfo>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) AssignStockOutbound(Dt_OutboundOrder outboundOrder, List<StockSelectViewDTO> stockSelectViews); |
| | | (List<Dt_StockInfo>, Dt_OutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) AssignStockOutbound(Dt_OutboundOrderDetail outboundOrderDetail, List<StockSelectViewDTO> stockSelectViews); |
| | | |
| | | WebResponseContent LockOutboundStock(int orderDetailId, List<StockSelectViewDTO> stockSelectViews); |
| | |
| | | _outStockLockInfoService = outStockLockInfoService; |
| | | } |
| | | |
| | | public (List<Dt_StockInfo>, Dt_OutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>, Dt_OutboundOrder) AssignStockOutbound(Dt_OutboundOrderDetail outboundOrderDetail) |
| | | { |
| | | Dt_OutboundOrder outboundOrder = _outboundRepository.OutboundOrderRepository.QueryFirst(x => x.Id == outboundOrderDetail.OrderId); |
| | | List<Dt_StockInfo> outStocks = new List<Dt_StockInfo>(); |
| | | List<string> LocationCodes = new List<string>(); |
| | | List<Dt_OutStockLockInfo> outStockLockInfos = new List<Dt_OutStockLockInfo>(); |
| | | List<Dt_LocationInfo> locationInfos = new List<Dt_LocationInfo>(); |
| | | return (outStocks, outboundOrderDetail, outStockLockInfos, locationInfos, outboundOrder); |
| | | } |
| | | |
| | | public (List<Dt_StockInfo>, List<Dt_OutboundOrderDetail>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>, Dt_OutboundOrder) AssignStockOutbound(List<Dt_OutboundOrderDetail> outboundOrderDetails) |
| | | { |
| | | if (outboundOrderDetails.GroupBy(x => x.OrderId).Count() > 1) |
| | |
| | | } |
| | | return (true, "æå"); |
| | | } |
| | | public (List<Dt_StockInfo>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) AssignStockOutbound(Dt_OutboundOrder outboundOrder, List<StockSelectViewDTO> stockSelectViews) |
| | | { |
| | | List<Dt_StockInfo> outStocks = null; |
| | | List<Dt_OutStockLockInfo> outStockLockInfos = _outStockLockInfoService.GetOutStockLockInfos(outboundOrder, outboundOrder.Details.First(), outStocks); |
| | | |
| | | List<Dt_LocationInfo> locationInfos = _basicService.LocationInfoService.Repository.GetLocationInfos(outStocks.Select(x => x.LocationCode).ToList()); |
| | | |
| | | return (outStocks, outStockLockInfos, locationInfos); |
| | | } |
| | | /// <summary> |
| | | /// åé
åºåºåºå |
| | | /// </summary> |
| | |
| | | List<Dt_OutStockLockInfo>? outStockLockInfos = null; |
| | | List<Dt_LocationInfo>? locationInfos = null; |
| | | List<Dt_LocationInfo>? locationInfos1 = null; |
| | | Dt_OutboundOrder outboundOrder = null; |
| | | Dt_OutboundOrder? outboundOrder = null; |
| | | |
| | | (List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?, Dt_OutboundOrder?) result = _outboundService.OutboundOrderDetailService.AssignStockOutbound(outboundOrderDetails); |
| | | if (result.Item1 != null && result.Item1.Count > 0) |
| | |
| | | /// </summary> |
| | | /// <param name="stockInfos"></param> |
| | | /// <returns></returns> |
| | | public (List<Dt_Task>, List<Dt_LocationInfo>, List<Dt_StockInfo>) GetTasks(List<Dt_StockInfo> stockInfos, TaskTypeEnum taskType, List<Dt_LocationInfo> locationInfos) |
| | | public (List<Dt_Task>?, List<Dt_LocationInfo>?, List<Dt_StockInfo>?) GetTasks(List<Dt_StockInfo> stockInfos, TaskTypeEnum taskType, List<Dt_LocationInfo>? locationInfos) |
| | | { |
| | | List<Dt_Task> tasks = new List<Dt_Task>(); |
| | | List<Dt_LocationInfo> locations = new List<Dt_LocationInfo>(); |
| | |
| | | List<Dt_Task> tasks = new List<Dt_Task>(); |
| | | Dt_OutboundOrderDetail outboundOrderDetail = _outboundService.OutboundOrderDetailService.Repository.QueryFirst(x => x.Id == orderDetailId); |
| | | |
| | | if (outboundOrderDetail == null) |
| | | { |
| | | throw new Exception("æªæ¾å°åºåºåæç»ä¿¡æ¯"); |
| | | } |
| | | if (outboundOrderDetail == null) throw new Exception("æªæ¾å°åºåºåæç»ä¿¡æ¯"); |
| | | if (outboundOrderDetail.OrderDetailStatus != OrderDetailStatusEnum.New.ObjToInt()) |
| | | throw new Exception("æéåºåºåæç»åå¨åºåºä¸æå·²å®æ"); |
| | | |
| | | Dt_OutboundOrder outboundOrder = _outboundService.OutboundOrderService.Repository.QueryFirst(x => x.Id == outboundOrderDetail.OrderId); |
| | | outboundOrder.Details = new List<Dt_OutboundOrderDetail> { outboundOrderDetail }; |
| | | |
| | | List<Dt_StockInfo>? stockInfos = null; |
| | | Dt_OutboundOrderDetail? orderDetail = null; |
| | | List<Dt_OutStockLockInfo>? outStockLockInfos = null; |
| | | List<Dt_LocationInfo>? locationInfos = null; |
| | | if (outboundOrderDetail.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt()) |
| | | { |
| | | (List<Dt_StockInfo>, Dt_OutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundService.OutboundOrderDetailService.AssignStockOutbound(outboundOrderDetail, stockSelectViews); |
| | | if (result.Item1 != null && result.Item1.Count > 0) |
| | | { |
| | | tasks = GetTasks(result.Item1); |
| | | result.Item2.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt(); |
| | | result.Item3.ForEach(x => |
| | | { |
| | | x.Status = OutStockStatus.åºåºä¸.ObjToInt(); |
| | | }); |
| | | List<Dt_LocationInfo>? locationInfos1 = null; |
| | | |
| | | stockInfos = result.Item1; |
| | | orderDetail = result.Item2; |
| | | outStockLockInfos = result.Item3; |
| | | locationInfos = result.Item4; |
| | | } |
| | | else |
| | | { |
| | | throw new Exception("æ åºå"); |
| | | } |
| | | } |
| | | else if (outboundOrderDetail.OrderDetailStatus == OrderDetailStatusEnum.AssignOverPartial.ObjToInt() || outboundOrderDetail.OrderDetailStatus == OrderDetailStatusEnum.AssignOver.ObjToInt()) |
| | | (List<Dt_StockInfo>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundService.OutboundOrderDetailService.AssignStockOutbound(outboundOrder, stockSelectViews); |
| | | if (result.Item1 != null && result.Item1.Count > 0) |
| | | { |
| | | List<Dt_OutStockLockInfo> stockLockInfos = _outboundService.OutboundStockLockInfoService.GetByOrderDetailId(outboundOrderDetail.Id); |
| | | if (stockLockInfos != null && stockLockInfos.Count > 0) |
| | | { |
| | | List<Dt_StockInfo> stocks = _stockService.StockInfoService.Repository.GetStockInfosByPalletCodes(stockLockInfos.Select(x => x.PalletCode).Distinct().ToList()); |
| | | tasks = GetTasks(stocks); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | throw new Exception("æ åºå"); |
| | | } |
| | | |
| | | return (tasks, stockInfos, orderDetail == null ? null : new List<Dt_OutboundOrderDetail> { orderDetail }, outStockLockInfos, locationInfos); |
| | |
| | | } |
| | | |
| | | [HttpPost, Route("GenerateOutboundTask")] |
| | | public WebResponseContent GenerateOutboundTask(int id, List<StockSelectViewDTO> stockSelectViews) |
| | | public WebResponseContent GenerateOutboundTask(int id, [FromBody] List<StockSelectViewDTO> stockSelectViews) |
| | | { |
| | | return Service.GenerateOutboundTask(id, stockSelectViews); |
| | | } |