Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn
| | |
| | | WebResponseContent RequestWMSTask(string palletCode, string sourceAddress); |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// åWMSç³è¯·ä»»å¡ |
| | | /// </summary> |
| | | /// <param name="palletCode"></param> |
| | | /// <param name="sourceAddress"></param> |
| | | /// <param name="palletCode">æçå·</param> |
| | | /// <param name="sourceAddress">èµ·å§å°å</param> |
| | | /// <returns></returns> |
| | | WebResponseContent RequestWMSTaskSimple(string palletCode, string sourceAddress); |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// åWMSç³è¯·ä»»å¡ |
| | | /// </summary> |
| | | /// <param name="palletCode"></param> |
| | | /// <param name="sourceAddress"></param> |
| | | /// <param name="roadway"></param> |
| | | /// <param name="palletCode">æçå·</param> |
| | | /// <param name="sourceAddress">èµ·å§å°å</param> |
| | | /// <param name="roadway">å··éå·</param> |
| | | /// <returns></returns> |
| | | WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string roadway); |
| | | |
| | |
| | | string? RequestAssignLocation(int taskNum, string roadwayNo); |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// åWMSç³è¯·åé
è´§ä½ |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <param name="roadwayNo"></param> |
| | | /// <param name="heightType"></param> |
| | | /// <param name="taskNum">ä»»å¡å·</param> |
| | | /// <param name="roadwayNo">å··éå·</param> |
| | | /// <param name="heightType">é«åº¦</param> |
| | | /// <returns></returns> |
| | | string? RequestAssignLocationByHeight(int taskNum, string roadwayNo, int heightType); |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// ä»»å¡å®æ |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <param name="taskNum">ä»»å¡å·</param> |
| | | /// <returns></returns> |
| | | WebResponseContent TaskCompleted(int taskNum); |
| | | |
| | |
| | | <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
| | | </Content> |
| | | <Content Update="wwwroot\swg-login.html"> |
| | | <CopyToOutputDirectory>Never</CopyToOutputDirectory> |
| | | <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
| | | </Content> |
| | | <Content Update="wwwroot\WIDESEAWCS_DB.DBSeed.Json\Sys_Tenant.tsv"> |
| | | <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// åWMSç³è¯·åé
è´§ä½ |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <param name="roadwayNo"></param> |
| | |
| | | { |
| | | #region çæä»»å¡åç»è¾é线å¯å¨ä¿¡å· |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) /*&& x.DeviceCode == item.StationDeviceCode*/ && (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.WarehouseId == warehouseDevice.WarehouseId); |
| | | if (task != null && conveyorLineInfoWrite.Spare2 == 0) |
| | | if (task != null && conveyorLineInfoWrite.Spare2 == 0 && conveyorLineStatus.Goods) |
| | | { |
| | | List<string> stations = _routerExtension.GetEndPoint(item.StationCode, TaskTypeEnum.Inbound.ObjToInt()).Select(x => x.NextPosi).ToList(); |
| | | WebResponseContent responseContent = _taskService.RequestWMSAssignRoadway(stations, task.TaskNum, conveyorLineInfoRead.Spare2); |
| | |
| | | WebResponseContent responseContent = _taskService.RequestWMSAssignRoadway(stations, task.TaskNum, conveyorLineInfoRead.Spare2); |
| | | if (responseContent.Status) |
| | | { |
| | | //string currentAddress = task.CurrentAddress; |
| | | //string nextAddress = task.NextAddress; |
| | | //string targetAddress = task.TargetAddress; |
| | | string roadwayNo = task.Roadway; |
| | | |
| | | string currentAddress = task.CurrentAddress; |
| | | string nextAddress = task.NextAddress; |
| | | string targetAddress = task.TargetAddress; |
| | | string deviceCode = task.DeviceCode; |
| | | TaskStatusEnum taskState = TaskStatusEnum.Line_Executing; |
| | | List<Dt_Router> routers = _routerService.QueryNextRoutes(item.StationCode, task.Roadway, task.TaskType); |
| | | List<Dt_Router> routers = _routerService.QueryNextRoutes(item.StationCode, responseContent.Data.ToString(), task.TaskType); |
| | | Dt_Router? router = routers.FirstOrDefault(); |
| | | if (routers == null || routers.Count == 0 || router == null) |
| | | { |
| | |
| | | |
| | | if (router.IsEnd) |
| | | { |
| | | string? targetLoca = _taskService.RequestAssignLocationByHeight(task.TaskNum, task.Roadway, conveyorLineInfoRead.Spare2); |
| | | string? targetLoca = _taskService.RequestAssignLocationByHeight(task.TaskNum, responseContent.Data.ToString(), conveyorLineInfoRead.Spare2); |
| | | if (!string.IsNullOrEmpty(targetLoca)) |
| | | { |
| | | currentAddress = item.StackerCraneStationCode; |
| | | nextAddress = targetAddress; |
| | | taskState = TaskStatusEnum.SC_Execute; |
| | | targetAddress = targetLoca; |
| | | nextAddress = targetLoca; |
| | | taskState = TaskStatusEnum.SC_Execute; |
| | | deviceCode = item.StackerCraneCode; |
| | | roadwayNo = responseContent.Data.ToString(); |
| | | device.SetValue(W_ConveyorLineDB.EndPos, task.CurrentAddress, item.StationCode); |
| | | } |
| | | else |
| | |
| | | device.SetValue(W_ConveyorLineDB.StartPos, task.CurrentAddress, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Outbound.ObjToInt(), item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |
| | | _taskService.UpdateTask(task, taskState, currentAddress: currentAddress, nextAddress: nextAddress, targetAddress: targetAddress); |
| | | _taskService.UpdateTask(task, taskState, currentAddress: currentAddress, nextAddress: nextAddress, targetAddress: targetAddress, deviceCode: deviceCode, roadwayNo: roadwayNo); |
| | | } |
| | | #endregion |
| | | } |
| | |
| | | |
| | | if (item.StationType == StationTypeEnum.StationType_InStartAndOutEnd.ObjToInt()) |
| | | { |
| | | if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.ACK && !string.IsNullOrEmpty(conveyorLineInfoRead.Barcode) && conveyorLineInfoRead.TaskNum == 0)//å
¥åº |
| | | if (conveyorLineSignalRead.STB && /*conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && */!conveyorLineSignalWrite.ACK && !string.IsNullOrEmpty(conveyorLineInfoRead.Barcode) && conveyorLineInfoRead.TaskNum == 0)//å
¥åº |
| | | { |
| | | WebResponseContent content = _taskService.RequestWMSTaskSimple(conveyorLineInfoRead.Barcode, item.StationCode); |
| | | if (content.Status) |
| | |
| | | device.SetValue(W_ConveyorLineDB.TaskNum, task.TaskNum, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.StartPos, task.CurrentAddress, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Inbound.ObjToInt(), item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.EndPos, task.NextAddress, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing); |
| | | } |
| | |
| | | //} |
| | | #endregion |
| | | } |
| | | else if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.ACK && conveyorLineInfoRead.TaskNum > 0)//åºåº |
| | | else if (conveyorLineSignalRead.STB /*&& conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm*/ && !conveyorLineSignalWrite.ACK && conveyorLineInfoRead.TaskNum > 0)//åºåº |
| | | { |
| | | //_taskService.TaskCompleted(conveyorLineInfoRead.TaskNum); |
| | | _taskService.TaskCompleted(conveyorLineInfoRead.TaskNum); |
| | | device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |
| | | } |
| | | else if (!conveyorLineSignalRead.STB && conveyorLineSignalWrite.ACK && !conveyorLineStatus.Alarm) |
| | |
| | | /// <param name="e"></param> |
| | | private void CommonStackerCrane_StackerCraneTaskCompletedEventHandler(object? sender, WIDESEAWCS_QuartzJob.StackerCrane.StackerCraneTaskCompletedEventArgs e) |
| | | { |
| | | CommonStackerCrane? commonStackerCrane = sender as CommonStackerCrane; |
| | | if (commonStackerCrane != null) |
| | | try |
| | | { |
| | | if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) |
| | | CommonStackerCrane? commonStackerCrane = sender as CommonStackerCrane; |
| | | if (commonStackerCrane != null) |
| | | { |
| | | StackerCraneTaskCompleted(e.TaskNum, commonStackerCrane.DeviceCode); |
| | | commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); |
| | | //if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) |
| | | { |
| | | if (e.TaskNum != 0) |
| | | { |
| | | WriteDebug(commonStackerCrane.DeviceCode, $"读åå°ä»»å¡å®æ,ä»»å¡å·:{e.TaskNum}"); |
| | | StackerCraneTaskCompleted(e.TaskNum, commonStackerCrane.DeviceCode); |
| | | commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | WriteError(nameof(StackerCraneJob_BC), "ä»»å¡å®æå¤±è´¥", ex); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"è¾é线åºåºç«ç¹æªé
ç½®,{task.NextAddress}"); |
| | | _taskService.UpdateTaskExceptionMessage(taskNum, $"è¾é线åºåºç«ç¹æªé
ç½®,{task.NextAddress}"); |
| | | WriteInfo(deviceCode, $"è¾é线åºåºç«ç¹æªé
ç½®,{task.NextAddress}"); |
| | | return WebResponseContent.Instance.Error($"è¾é线åºåºç«ç¹æªé
ç½®,{task.NextAddress}"); |
| | | } |
| | | Dt_Router router = _routerRepository.QueryFirst(x => x.InOutType == task.TaskType && x.StartPosi == stationManger.StationCode); |
| | |
| | | /// <returns></returns> |
| | | private Dt_Task? GetTask(CommonStackerCrane commonStackerCrane) |
| | | { |
| | | try |
| | | { |
| | | Dt_Task oldTask = _taskRepository.QueryFirst(x => x.DeviceCode == commonStackerCrane.DeviceCode && x.TaskState == TaskStatusEnum.SC_Executing.ObjToInt()); |
| | | if (oldTask != null) |
| | | { |
| | | StackerCraneTaskCompleted(oldTask.TaskNum, commonStackerCrane.DeviceCode); |
| | | } |
| | | } |
| | | catch { } |
| | | |
| | | Dt_Task task; |
| | | if (commonStackerCrane.LastTaskType == null) |
| | | { |
| | |
| | | tableAction: '', //æå®æå¼ 表çæé(è¿éå¡«å表å,é»è®¤ä¸ç¨å¡«å) |
| | | buttons: { view: [], box: [], detail: [] }, //æ©å±çæé® |
| | | methods: { |
| | | //è·å表åé
ç½® |
| | | getOption(field) { |
| | | let option; |
| | | this.editFormOptions.forEach(x => { |
| | | x.forEach(item => { |
| | | if (item.field == field) { |
| | | option = item; |
| | | } |
| | | }) |
| | | }) |
| | | return option; |
| | | }, |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { //æ¡æ¶åå§åé
ç½®åï¼ |
| | | let materielCodeOption = this.getOption("materielCode"); |
| | | let purchaseOrderNoOption = this.getOption("purchaseOrderNo"); |
| | | purchaseOrderNoOption.onChange = (val, option) => { |
| | | this.editFormFields.materielCode = ""; |
| | | materielCodeOption.data = []; |
| | | if (val == null || val == 0) { |
| | | return this.$error("è¯·éæ©ç©æç¼å·ï¼") |
| | | } |
| | | // console.log(val) |
| | | // console.log(option) |
| | | this.http.post("/api/PurchaseOrder/GetPurchaseOrderInfo?purchaseOrderNo=" + val, {}, true).then( |
| | | source => { |
| | | if (!source.status) return this.$error(source.message); |
| | | for (let i = 0; i < source.data.length; i++) { |
| | | materielCodeOption.data.push({ key: i, value: source.data[i] }) |
| | | } |
| | | // this.editFormFields.InputOder_itemname = source.data.itemName; |
| | | // this.$success(source.data.itemName); |
| | | this.refresh(); |
| | | }) |
| | | } |
| | | |
| | | this.columns.push({ |
| | | field: 'æä½', |
| | | title: 'æä½', |
| | |
| | | url: "/MaterielCodeInfo/", |
| | | sortName: "id", |
| | | }); |
| | | const editFormFields = ref({}); |
| | | const editFormFields = ref({ |
| | | purchaseOrderNo:"", |
| | | materielCode:"", |
| | | }); |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | | title: "ç©æç¼ç ", |
| | | field: "materielCode", |
| | | required: true, |
| | | }, |
| | | { |
| | | title: "æ¹æ¬¡å·", |
| | | field: "lotNo", |
| | | required: true, |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "éè´åå·", |
| | | field: "purchaseOrderNo", |
| | | type:"select", |
| | | dataKey: "purchaseOrderNos", |
| | | data: [], |
| | | required: true, |
| | | }, |
| | | { |
| | | title: "ç©æç¼ç ", |
| | | field: "materielCode", |
| | | type: "select", |
| | | dataKey: "MaterielCodes", |
| | | data: [], |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "æ¹æ¬¡å·", |
| | | field: "lotNo", |
| | | required: true, |
| | | }, |
| | | { |
| | |
| | | { |
| | | title: "çäº§æ¥æ", |
| | | field: "productionDate", |
| | | type:"date", |
| | | type: "date", |
| | | required: true, |
| | | }, |
| | | { |
| | | title: "æææ", |
| | | field: "effectiveDate", |
| | | type:"date", |
| | | type: "date", |
| | | required: true, |
| | | }, |
| | | ], |
| | |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | | hidden:true, |
| | | hidden: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | hidden:true, |
| | | hidden: true, |
| | | sort: true, |
| | | }, |
| | | ]); |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_IInboundRepository; |
| | | using WIDESEA_Model.Models; |
| | |
| | | { |
| | | public interface IPurchaseOrderDetailService : IService<Dt_PurchaseOrderDetail> |
| | | { |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | public interface IPurchaseOrderService : IService<Dt_PurchaseOrder> |
| | | { |
| | | WebResponseContent GetPurchaseOrderInfo(string purchaseOrderNo); |
| | | WebResponseContent ReceivePurchaseOrder(PurchaseOrderModel model); |
| | | } |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | |
| | | |
| | | namespace WIDESEA_InboundService |
| | | { |
| | | public class PurchaseOrderDetailService : ServiceBase<Dt_PurchaseOrderDetail, IPurchaseOrderDetailRepository>,IPurchaseOrderDetailService |
| | | public class PurchaseOrderDetailService : ServiceBase<Dt_PurchaseOrderDetail, IPurchaseOrderDetailRepository>, IPurchaseOrderDetailService |
| | | { |
| | | public IPurchaseOrderDetailRepository Repository => BaseDal; |
| | | |
| | |
| | | _supplierInfoRepository = supplierInfoRepository; |
| | | _materielInfoRepository = materielInfoRepository; |
| | | } |
| | | |
| | | public WebResponseContent GetPurchaseOrderInfo(string purchaseOrderNo) |
| | | { |
| | | try |
| | | { |
| | | Dt_PurchaseOrder purchaseOrder = BaseDal.Db.Queryable<Dt_PurchaseOrder>().Where(x => x.PurchaseOrderNo == purchaseOrderNo).Includes(x => x.Details).First(); |
| | | List<string> MaterielCodes = purchaseOrder.Details.Where(x => x.PurchaseDetailStatus != PurchaseOrderDetailStatusEnum.Received.ObjToInt()).Select(x => x.MaterielCode).ToList(); |
| | | return WebResponseContent.Instance.OK(data: MaterielCodes); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | public WebResponseContent ReceivePurchaseOrder(PurchaseOrderModel model) |
| | | { |
| | | try |
| | |
| | | { |
| | | MaterielCode = item.MCode, |
| | | PurchaseDetailQuantity = item.Qty, |
| | | PurchaseDetailReceiveQty=0, |
| | | PurchaseDetailReceiveQty = 0, |
| | | PurchaseDetailStatus = PurchaseOrderDetailStatusEnum.NotReceived.ObjToInt(), |
| | | Unit = item.Unit, |
| | | WarehouseId = warehouse.WarehouseId, |
| | |
| | | PalletCode = model.CarrierCode, |
| | | PalletType = palletTypeInfo.PalletType, |
| | | WarehouseId = warehouse.WarehouseId, |
| | | StockStatus = StockStatusEmun.ç»çæå.ObjToInt() |
| | | StockStatus = StockStatusEmun.MESéåº.ObjToInt() |
| | | }; |
| | | |
| | | Dt_StockInfoDetail_Hty stockInfoDetail_Hty = _stockRepository.StockInfoDetail_HtyRepository.QueryFirst(x => x.BatchNo == model.MaterialLot && x.MaterielCode == model.MaterialCode); |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_Model.Models; |
| | |
| | | public PurchaseOrderController(IPurchaseOrderService service) : base(service) |
| | | { |
| | | } |
| | | [HttpPost, HttpGet, Route("GetPurchaseOrderInfo"), AllowAnonymous] |
| | | public WebResponseContent GetPurchaseOrderInfo(string purchaseOrderNo) |
| | | { |
| | | return Service.GetPurchaseOrderInfo(purchaseOrderNo); |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_Model.Models; |