Merge branch 'htq20251215' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu into htq20251215
| | |
| | | this.$refs.gridBody.open(row); |
| | | } |
| | | }); |
| | | |
| | | let BatchOrderFeedbackToMesBtn = this.buttons.find(x => x.value == 'BatchOrderFeedbackToMes'); |
| | | if (BatchOrderFeedbackToMesBtn) { |
| | | const _this = this; |
| | | BatchOrderFeedbackToMesBtn.onClick = function () { |
| | | let selectedRows = _this.$refs.table.getSelected(); |
| | | |
| | | // æ ¡éªæ¯å¦æé䏿°æ® |
| | | if (!selectedRows || selectedRows.length === 0) { |
| | | return _this.$Message.warning('请å
éæ©éè¦å¤ççåæ®'); |
| | | } |
| | | if (selectedRows.length > 1) { |
| | | return _this.$Message.warning('è¯·éæ©ä¸æ¡æ°æ®'); |
| | | } |
| | | |
| | | _this.http |
| | | .post(`api/MesFeedback/OutboundFeedback?orderNo=${selectedRows[0].orderNo}`, {}, "æ°æ®å¤çä¸...") |
| | | .then((x) => { |
| | | if (x.status) { |
| | | _this.$Message.success('åæ¹åºåºåè°å®æ'); |
| | | _this.refresh(); |
| | | } else { |
| | | return _this.$Message.error('åæ¹åºåºåè°å¤±è´¥'); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | |
| | | }); |
| | | }; |
| | | } |
| | | let TaskHandCompletedBtn = this.buttons.find(x => x.value == 'NoStockOut'); |
| | | if (TaskHandCompletedBtn) { |
| | | TaskHandCompletedBtn.onClick = function () { |
| | | this.$refs.gridHeader.open(); |
| | | } |
| | | } |
| | | |
| | | var EmptyTrayOutboundBtn = this.buttons.find(x => x.value == "EmptyTrayOutbound"); |
| | | if (EmptyTrayOutboundBtn != null) { |
| | | EmptyTrayOutboundBtn.onClick = () => { |
| | | this.$refs.gridFooter.open(); |
| | | } |
| | | } |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-form ref="form" :model="form" label-width="90px" v-if="isBatch === 1"> |
| | | <el-form ref="form" :model="form" label-width="90px" v-if="isBatch === 1" v-show="this.outboundQuantity>1"> |
| | | <el-form-item label="åºåºæ°é:"> |
| | | <el-input-number v-model="outboundQuantity" :controls="true" placeholder="è¯·éæ©åºåºæ°é" |
| | | style="width: 100%;"></el-input-number> |
| | |
| | | operator: "", |
| | | orderNo: this.orderNo, |
| | | }; |
| | | console.log(requestParams); |
| | | this.http.post("api/Outbound/ProcessPickingOutbound", requestParams, 'æ°æ®å¤çä¸...') |
| | | .then((x) => { |
| | | if (!x.status) { |
| | |
| | | if (this.selection.length === 0) { |
| | | return this.$message.error("è¯·éæ©åæ®æç»"); |
| | | } |
| | | if (this.selection.length > 1) { |
| | | return this.$message.error("åªè½éæ©ä¸æ¡åæ®æç»è¿è¡åæ¹åºåº"); |
| | | } |
| | | |
| | | const keys = this.selection.map((item) => item.id); |
| | | const requestParams = { |
| | | detailIds: keys, |
| | | outboundQuantity: this.selection[0].orderQuantity, |
| | | outboundQuantity: this.selection.length>1?1: this.selection[0].orderQuantity-this.selection[0].lockQuantity, |
| | | operator: "", |
| | | orderNo: this.row.orderNo, |
| | | isBatch: this.isBatch |
| | |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "unit", |
| | | title: "åä½", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "orderDetailStatus", |
| | | title: "订åæç»ç¶æ", |
| | | type: "string", |
| | |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "unit", |
| | | title: "åä½", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "orderDetailStatus", |
| | | title: "订åæç»ç¶æ", |
| | | type: "string", |
| | |
| | | SupplyCode=detail.SupplyCode, |
| | | WarehouseCode=detail.WarehouseCode, |
| | | Barcode=detail.Barcode, |
| | | OutBoxbarcodes="", |
| | | OutBoxbarcodes= detail.BoxSN, |
| | | BarcodeQty=(decimal)detail.BarcodeQty, |
| | | BarcodeUnit=detail.BarcodeUnit |
| | | }).ToList() |
| | |
| | | using System; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Serialization; |
| | | using Org.BouncyCastle.Asn1.Ocsp; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Newtonsoft.Json; |
| | | using SqlSugar; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçåºåºåä¿¡æ¯"); |
| | | } |
| | | |
| | | List<Dt_MesReturnRecord> returnRecords = BaseDal.QueryData(x => x.OrderNo == orderNo && x.OrderId == outboundOrder.Id && x.ReturnStatus == 2); |
| | | foreach (var item in returnRecords) |
| | | { |
| | | HttpResponseResult<MesResponseDTO> httpResponse = _httpClientHelper.Post<MesResponseDTO>(item.ApiUrl, item.RequestData); |
| | | item.ReturnCount += 1; |
| | | bool success = httpResponse.IsSuccess && httpResponse.Data.Code == "200"; |
| | | item.ReturnStatus = success ? 1 : 2; |
| | | item.HttpStatusCode = httpResponse.StatusCode.ObjToInt(); |
| | | item.LastReturnTime = DateTime.Now; |
| | | item.ResponseData = httpResponse.Content; |
| | | item.SuccessTime = httpResponse.IsSuccess ? DateTime.Now : null; |
| | | } |
| | | BaseDal.UpdateData(returnRecords); |
| | | |
| | | HttpResponseResult<MesResponseDTO> httpResponseResult = new HttpResponseResult<MesResponseDTO>(); |
| | | string reqCode = Guid.NewGuid().ToString(); |
| | | string reqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
| | |
| | | string apiUrl = AppSettings.GetValue("MaterialOutboundFeedbackUrl"); |
| | | returnDTO.ReqCode = reqCode; |
| | | returnDTO.ReqTime = reqTime; |
| | | requestData = returnDTO.Serialize(); |
| | | JsonSerializerSettings settings = new JsonSerializerSettings |
| | | { |
| | | ContractResolver = new CamelCasePropertyNamesContractResolver() |
| | | }; |
| | | requestData = JsonConvert.SerializeObject(returnDTO, settings); |
| | | lineNos = returnDTO.Details.Select(x => x.LineNo).ToList(); |
| | | httpResponseResult = _httpClientHelper.Post<MesResponseDTO>(apiUrl, requestData); |
| | | httpResponseResult.ApiUrl = apiUrl; |
| | |
| | | string apiUrl = AppSettings.GetValue("AllocationFeedbackUrl"); ; |
| | | returnDTO.ReqCode = reqCode; |
| | | returnDTO.ReqTime = reqTime; |
| | | requestData = returnDTO.Serialize(); |
| | | JsonSerializerSettings settings = new JsonSerializerSettings |
| | | { |
| | | ContractResolver = new CamelCasePropertyNamesContractResolver() |
| | | }; |
| | | requestData = JsonConvert.SerializeObject(returnDTO, settings); |
| | | lineNos = returnDTO.Details.Select(x => x.LineNo).ToList(); |
| | | httpResponseResult = _httpClientHelper.Post<MesResponseDTO>(apiUrl, requestData); |
| | | httpResponseResult.ApiUrl = apiUrl; |
| | |
| | | _unitOfWorkManage.BeginTran(); |
| | | _unitOfWorkManage.Db.Insertable(mesReturnRecord).ExecuteCommand(); |
| | | |
| | | if (isSuccess) |
| | | { |
| | | List<Dt_OutboundOrderDetail> outboundOrderDetails = outboundOrder.Details.Where(x => lineNos.Contains(x.lineNo)).ToList(); |
| | | outboundOrderDetails.ForEach(x => |
| | | { |
| | |
| | | |
| | | _outboundOrderRepository.Db.Updateable(outboundOrderDetails).ExecuteCommand(); |
| | | _outboundOrderRepository.UpdateData(outboundOrder); |
| | | } |
| | | |
| | | _unitOfWorkManage.CommitTran(); |
| | | |
| | |
| | | Details = returnDetails, |
| | | FactoryArea = outboundOrder.FactoryArea, |
| | | OperationType = 1, |
| | | OrderNo = outboundOrder.OrderNo, |
| | | OrderNo = outboundOrder.UpperOrderNo, |
| | | FromWarehouse = fromWarehouse, |
| | | ToWarehouse = toWarehouse |
| | | }; |
| | |
| | | { |
| | | Business_type = outboundOrder.BusinessType, |
| | | Details = returnDetails, |
| | | DocumentsNO = "", |
| | | DocumentsNO = _basicService.CreateCodeByRule("OutboundOrderRule"), |
| | | FactoryArea = outboundOrder.FactoryArea, |
| | | OperationType = 1, |
| | | Operator = App.User.UserName, |
| | | OrderNo = outboundOrder.OrderNo, |
| | | OrderNo = outboundOrder.UpperOrderNo, |
| | | Status = 1 |
| | | }; |
| | | |
| | |
| | | |
| | | string reqCode = Guid.NewGuid().ToString(); |
| | | string reqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
| | | string requestData = returnDTO.Serialize(); |
| | | JsonSerializerSettings settings = new JsonSerializerSettings |
| | | { |
| | | ContractResolver = new CamelCasePropertyNamesContractResolver() |
| | | }; |
| | | |
| | | string requestData = JsonConvert.SerializeObject(returnDTO, settings); |
| | | HttpResponseResult<MesResponseDTO> httpResponseResult = _httpClientHelper.Post<MesResponseDTO>(apiUrl, requestData); |
| | | httpResponseResult.ApiUrl = apiUrl; |
| | | |
| | |
| | | public string Barcode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¤ç®±æ¡ç |
| | | /// </summary> |
| | | [JsonProperty("boxSN")] |
| | | public string BoxSN { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¹æ¬¡å· |
| | | /// </summary> |
| | | [JsonProperty("batchNo")] |
| | |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.Seed; |
| | | using WIDESEA_Core.Utilities; |
| | | using WIDESEA_DTO.Base; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IInboundService; |
| | |
| | | private readonly IRepository<Dt_WarehouseArea> _warehouseAreaRepository; |
| | | private readonly IRepository<Dt_LocationType> _locationTypeRepository; |
| | | private readonly IRepository<Dt_StockInfo> _stockRepository; |
| | | private readonly IBasicService _basicService; |
| | | public IRepository<Dt_InboundOrder> Repository => BaseDal; |
| | | |
| | | public InboundOrderService(IRepository<Dt_InboundOrder> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository, IRepository<Dt_Task> taskRepository, IStockService stockService, IInboundOrderDetailService inboundOrderDetailService, IMaterialUnitService materialUnitService, IRepository<Dt_StockInfoDetail> stockDetailRepository, IRepository<Dt_InboundOrder> inboundOrderRepository, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IRepository<Dt_StockInfo> stockRepository, IRepository<Dt_LocationType> locationTypeRepository, IMaterielInfoService materielInfoService) : base(BaseDal) |
| | | public InboundOrderService(IRepository<Dt_InboundOrder> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository, IRepository<Dt_Task> taskRepository, IStockService stockService, IInboundOrderDetailService inboundOrderDetailService, IMaterialUnitService materialUnitService, IRepository<Dt_StockInfoDetail> stockDetailRepository, IRepository<Dt_InboundOrder> inboundOrderRepository, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IRepository<Dt_StockInfo> stockRepository, IRepository<Dt_LocationType> locationTypeRepository, IMaterielInfoService materielInfoService, IBasicService basicService) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | |
| | | _stockRepository = stockRepository; |
| | | _locationTypeRepository = locationTypeRepository; |
| | | _materielInfoService = materielInfoService; |
| | | _basicService = basicService; |
| | | } |
| | | |
| | | public async Task<WebResponseContent> ReceiveInboundOrder(List<Dt_InboundOrder> models, int operateType) |
| | |
| | | |
| | | foreach (var item in model.Details) |
| | | { |
| | | var purchaseToStockResult = await _materialUnitService.ConvertPurchaseToStockAsync(item.MaterielCode, item.BarcodeQty); |
| | | item.Unit = purchaseToStockResult.Unit; |
| | | item.OrderQuantity = purchaseToStockResult.Quantity; |
| | | //var purchaseToStockResult = await _materialUnitService.ConvertPurchaseToStockAsync(item.MaterielCode, item.BarcodeQty); |
| | | |
| | | UnitConvertResultDTO totalResult = _basicService.UnitQuantityConvert(item.MaterielCode, item.Unit, item.BarcodeUnit, item.OrderQuantity); |
| | | item.Unit = totalResult.ToUnit; |
| | | item.OrderQuantity = totalResult.ToQuantity; |
| | | if (materielInfos.Any()) |
| | | { |
| | | item.MaterielName = materielInfos.FirstOrDefault(x => x.MaterielCode == item.MaterielCode)?.MaterielName ?? ""; |
| | |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æ¡å½¢ç ")] |
| | | public string Barcode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¡å½¢ç |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æ¡å½¢ç ")] |
| | | public string BoxSN { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// ä¾åºåç¼å· |
| | |
| | | Dt_OutboundOrder outboundOrder = _outboundOrderService.Repository.QueryFirst(x => x.Id == searchParameters.Value.ObjToInt()); |
| | | if (outboundOrder != null) |
| | | { |
| | | if (outboundOrder.IsBatch == 0) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.OrderId == searchParameters.Value.ObjToInt()); |
| | | var dataList = sugarQueryable1.ToPageList(options.Page, options.Rows, ref totalCount); |
| | | return new PageGridData<Dt_OutboundOrderDetail>(totalCount, dataList); |
| | | } |
| | | else |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.OrderId == searchParameters.Value.ObjToInt()); |
| | | sugarQueryable1.GroupBy(x => new { x.MaterielCode, x.MaterielName, x.BatchNo, x.SupplyCode, x.WarehouseCode }).Select(s => new Dt_OutboundOrderDetail |
| | | { |
| | | WarehouseCode = s.WarehouseCode, |
| | | SupplyCode = s.SupplyCode, |
| | | BatchNo = s.BatchNo, |
| | | MaterielName = s.MaterielName, |
| | | MaterielCode = s.MaterielCode, |
| | | AllocatedQuantity = SqlFunc.AggregateSum(s.AllocatedQuantity), |
| | | OrderQuantity = SqlFunc.AggregateSum(s.OrderQuantity), |
| | | PickedQty = SqlFunc.AggregateSum(s.PickedQty), |
| | | OverOutQuantity = SqlFunc.AggregateSum(s.OverOutQuantity), |
| | | MoveQty = SqlFunc.AggregateSum(s.MoveQty), |
| | | NoStockOutQty = SqlFunc.AggregateSum(s.NoStockOutQty), |
| | | LockQuantity = SqlFunc.AggregateSum(s.LockQuantity), |
| | | BarcodeMoveQty = SqlFunc.AggregateSum(s.BarcodeMoveQty), |
| | | BarcodeQty =SqlFunc.AggregateMin( s.BarcodeQty), |
| | | BarcodeUnit = SqlFunc.AggregateMin(s.BarcodeUnit), |
| | | BatchAllocateStatus = SqlFunc.AggregateMin(s.BatchAllocateStatus), |
| | | CreateDate = SqlFunc.AggregateMin(s.CreateDate), |
| | | Creater = SqlFunc.AggregateMin(s.Creater), |
| | | documentsNO = SqlFunc.AggregateMin(s.documentsNO), |
| | | Id = SqlFunc.AggregateMin(s.Id), |
| | | lineNo = SqlFunc.AggregateMin(s.lineNo), |
| | | Modifier = SqlFunc.AggregateMin(s.Modifier), |
| | | ModifyDate = SqlFunc.AggregateMin(s.ModifyDate), |
| | | OrderDetailStatus = SqlFunc.AggregateMin(s.OrderDetailStatus), |
| | | OrderId = SqlFunc.AggregateMin(s.OrderId), |
| | | Remark = SqlFunc.AggregateMin(s.Remark), |
| | | ReturnJsonData = SqlFunc.AggregateMin(s.ReturnJsonData), |
| | | ReturnToMESStatus = SqlFunc.AggregateMin(s.ReturnToMESStatus), |
| | | RowNo = SqlFunc.AggregateMin(s.RowNo), |
| | | Unit = SqlFunc.AggregateMin(s.Unit) |
| | | }); |
| | | var dataList = sugarQueryable1.ToPageList(options.Page, options.Rows, ref totalCount); |
| | | return new PageGridData<Dt_OutboundOrderDetail>(totalCount, dataList); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return new PageGridData<Dt_OutboundOrderDetail>(); |
| | | } |
| | | |
| | |
| | | PickingOutboundResponseDTO response = new PickingOutboundResponseDTO(); |
| | | try |
| | | { |
| | | _unitOfWorkManage.BeginTran(); |
| | | // 1. 计ç®åºåºæ°éé»è¾ |
| | | OutboundCalculationDTO calculationResult = CalcOutboundQuantity(request); |
| | | |
| | |
| | | // è·åéæ©çåºåºæç» |
| | | List<Dt_OutboundOrderDetail> selectedDetails = _detailRepository.QueryData(x => x.OrderId == outboundOrder.Id && request.DetailIds.Contains(x.Id)); |
| | | |
| | | if (outboundOrder.IsBatch == 1) |
| | | if (outboundOrder.IsBatch == 1 && request.DetailIds.Count == 1) |
| | | { |
| | | selectedDetails = _detailRepository.QueryData(x => x.OrderId == selectedDetails.First().OrderId && x.WarehouseCode == selectedDetails.First().WarehouseCode && x.MaterielCode == selectedDetails.First().MaterielCode && x.BatchNo == selectedDetails.First().BatchNo && x.SupplyCode == selectedDetails.First().SupplyCode); |
| | | } |
| | |
| | | result.OutboundOrder = outboundOrder; |
| | | result.SelectedDetails = selectedDetails; |
| | | |
| | | if (outboundOrder.IsBatch == 0) |
| | | if (outboundOrder.IsBatch == 0 || request.DetailIds.Count > 1) |
| | | { |
| | | // 夿ç»åºåºï¼æç©æåç»å¤ç |
| | | result.MaterielCalculations = CalcMaterielOutboundQuantities(outboundOrder, selectedDetails.ToList()); |
| | |
| | | { |
| | | throw new Exception($"ç©æ {materielCalc.MaterielCode} å¯ç¨åºå {totalAvailableStock} ä¸è¶³åºåºæ°é {materielCalc.UnallocatedQuantity}"); |
| | | } |
| | | |
| | | //decimal remainingQuantity = Math.Min(totalAvailableStock, materielCalc.UnallocatedQuantity); |
| | | |
| | | // éåé
æ°é |
| | | decimal remainingQuantity = materielCalc.UnallocatedQuantity; |
| | |
| | | |
| | | if (outboundOrder.OrderType != 0) |
| | | { |
| | | |
| | | Dt_AllocateOrder allocateOrder = _allocateOrderRepository.QueryFirst(x => x.OrderNo == outboundOrder.OrderNo); |
| | | if (allocateOrder != null) |
| | | { |
| | |
| | | { |
| | | UpdateOutboundOrderStatus(request.OrderNo, OutOrderStatusEnum.åºåºå®æ.ObjToInt()); |
| | | |
| | | |
| | | //todo: åä¼ MES |
| | | _feedbackMesService.OutboundFeedback(outboundOrder.OrderNo); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | UpdateOutboundOrderStatus(request.OrderNo, OutOrderStatusEnum.åºåºå®æ.ObjToInt()); |
| | | |
| | | |
| | | //todo: åä¼ MES |
| | | _feedbackMesService.OutboundFeedback(outboundOrder.OrderNo); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Microsoft.Extensions.Logging; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Serialization; |
| | | using Org.BouncyCastle.Asn1.Ocsp; |
| | | using Org.BouncyCastle.Asn1.Pkcs; |
| | | using SqlSugar; |
| | |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.Util; |
| | | using WIDESEA_DTO.Allocate; |
| | | using WIDESEA_DTO.Base; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_DTO.Outbound; |
| | |
| | | private readonly IRepository<Dt_AllocateMaterialInfo> _allocateMaterialInfo; |
| | | private readonly IRepository<Dt_AllocateMaterialInfo_Hty> _allocateMaterialInfo_Hty; |
| | | private readonly HttpClientHelper _httpClientHelper; |
| | | private readonly IBasicService _basicService; |
| | | public IRepository<Dt_Task> Repository => BaseDal; |
| | | |
| | | private Dictionary<string, SqlSugar.OrderByType> _taskOrderBy = new() |
| | |
| | | |
| | | public List<int> TaskOutboundTypes => typeof(TaskTypeEnum).GetEnumIndexList(); |
| | | |
| | | public TaskService(IRepository<Dt_Task> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfo> stockRepository, ILocationInfoService locationInfoService, IInboundOrderService inboundOrderService, ILocationStatusChangeRecordService locationStatusChangeRecordService, IESSApiService eSSApiService, ILogger<TaskService> logger, IStockService stockService, IRecordService recordService, IInboundOrderDetailService inboundOrderDetailService, IOutboundOrderService outboundOrderService, IOutboundOrderDetailService outboundOrderDetailService, IInvokeMESService invokeMESService, IOutStockLockInfoService outStockLockInfoService, IAllocateService allocateService, IRepository<Dt_OutboundBatch> outboundBatchRepository, IRepository<Dt_ReCheckOrder> reCheckOrderRepository, IRepository<Dt_AllocateOrderDetail> allocateOrderDetailRepository, IRepository<Dt_AllocateOrder> allocateOrderRepository, IMaterialUnitService materialUnitService, ITask_HtyService task_HtyService, IRepository<Dt_AllocateMaterialInfo> allocateMaterialInfo, IRepository<Dt_AllocateMaterialInfo_Hty> allocateMaterialInfo_Hty, HttpClientHelper httpClientHelper) : base(BaseDal) |
| | | public TaskService(IRepository<Dt_Task> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfo> stockRepository, ILocationInfoService locationInfoService, IInboundOrderService inboundOrderService, ILocationStatusChangeRecordService locationStatusChangeRecordService, IESSApiService eSSApiService, ILogger<TaskService> logger, IStockService stockService, IRecordService recordService, IInboundOrderDetailService inboundOrderDetailService, IOutboundOrderService outboundOrderService, IOutboundOrderDetailService outboundOrderDetailService, IInvokeMESService invokeMESService, IOutStockLockInfoService outStockLockInfoService, IAllocateService allocateService, IRepository<Dt_OutboundBatch> outboundBatchRepository, IRepository<Dt_ReCheckOrder> reCheckOrderRepository, IRepository<Dt_AllocateOrderDetail> allocateOrderDetailRepository, IRepository<Dt_AllocateOrder> allocateOrderRepository, IMaterialUnitService materialUnitService, ITask_HtyService task_HtyService, IRepository<Dt_AllocateMaterialInfo> allocateMaterialInfo, IRepository<Dt_AllocateMaterialInfo_Hty> allocateMaterialInfo_Hty, HttpClientHelper httpClientHelper, IBasicService basicService) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | |
| | | _allocateMaterialInfo = allocateMaterialInfo; |
| | | _allocateMaterialInfo_Hty = allocateMaterialInfo_Hty; |
| | | _httpClientHelper = httpClientHelper; |
| | | _basicService = basicService; |
| | | } |
| | | |
| | | public async Task TaskStatusChange(string taskNum, TaskStatusEnum taskStatusEnum) |
| | |
| | | { |
| | | await Db.Deleteable(task).ExecuteCommandAsync(); |
| | | } |
| | | Dt_OutboundOrder outboundOrder = _outboundOrderService.Db.Queryable<Dt_OutboundOrder>().Where(x => x.OrderNo == stockInfo.Details.FirstOrDefault().OrderNo).Includes(x=>x.Details).First(); |
| | | |
| | | if(outboundOrder.OrderStatus == OutOrderStatusEnum.åºåºå®æ.ObjToInt()) |
| | | { |
| | | HttpResponseResult<MesResponseDTO> httpResponseResult = new HttpResponseResult<MesResponseDTO>(); |
| | | string reqCode = Guid.NewGuid().ToString(); |
| | | string reqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
| | | string requestData = string.Empty; |
| | | List<string> lineNos = new List<string>(); |
| | | Dt_AllocateOrder allocateOrder = _allocateOrderRepository.QueryFirst(x => x.OrderNo == outboundOrder.OrderNo); |
| | | if (allocateOrder == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçè°æ¨å"); |
| | | } |
| | | AllocationReturnDTO? returnDTO = BuildAllocationFeedbackData(outboundOrder, allocateOrder.FromWarehouse, allocateOrder.ToWarehouse); |
| | | if (returnDTO == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æå»ºåè°å¯¹è±¡å¤±è´¥"); |
| | | } |
| | | string apiUrl = AppSettings.GetValue("AllocationFeedbackUrl"); ; |
| | | returnDTO.ReqCode = reqCode; |
| | | returnDTO.ReqTime = reqTime; |
| | | JsonSerializerSettings settings = new JsonSerializerSettings |
| | | { |
| | | ContractResolver = new CamelCasePropertyNamesContractResolver() |
| | | }; |
| | | requestData = JsonConvert.SerializeObject(returnDTO, settings); |
| | | lineNos = returnDTO.Details.Select(x => x.LineNo).ToList(); |
| | | httpResponseResult = _httpClientHelper.Post<MesResponseDTO>(apiUrl, requestData); |
| | | httpResponseResult.ApiUrl = apiUrl; |
| | | } |
| | | try |
| | | { |
| | | _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforelocationStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum); |
| | |
| | | } |
| | | } |
| | | |
| | | public AllocationReturnDTO? BuildAllocationFeedbackData(Dt_OutboundOrder outboundOrder, string fromWarehouse, string toWarehouse) |
| | | { |
| | | try |
| | | { |
| | | List<Dt_OutboundOrderDetail> details = outboundOrder.Details; |
| | | |
| | | List<AllocationDetail> returnDetails = new List<AllocationDetail>(); |
| | | |
| | | foreach (var detail in details) |
| | | { |
| | | List<Barcodes>? barcodes = JsonConvert.DeserializeObject<List<Barcodes>>(detail.ReturnJsonData); |
| | | if (barcodes != null && barcodes.Any()) |
| | | { |
| | | UnitConvertResultDTO currentResult = _basicService.UnitQuantityConvert(detail.MaterielCode, detail.Unit, detail.BarcodeUnit, detail.CurrentDeliveryQty); |
| | | UnitConvertResultDTO totalResult = _basicService.UnitQuantityConvert(detail.MaterielCode, detail.Unit, detail.BarcodeUnit, detail.OrderQuantity); |
| | | |
| | | returnDetails.Add(new AllocationDetail |
| | | { |
| | | Barcodes = barcodes, |
| | | BatchNo = detail.BatchNo, |
| | | LineNo = detail.lineNo, |
| | | MaterialCode = detail.MaterielCode, |
| | | Qty = totalResult.ToQuantity, |
| | | WarehouseCode = detail.WarehouseCode, |
| | | Unit = detail.BarcodeUnit |
| | | }); |
| | | } |
| | | } |
| | | |
| | | AllocationReturnDTO outboundReturnDTO = new AllocationReturnDTO() |
| | | { |
| | | Business_type = outboundOrder.BusinessType, |
| | | Details = returnDetails, |
| | | FactoryArea = outboundOrder.FactoryArea, |
| | | OperationType = 1, |
| | | OrderNo = outboundOrder.OrderNo, |
| | | FromWarehouse = fromWarehouse, |
| | | ToWarehouse = toWarehouse |
| | | }; |
| | | |
| | | return outboundReturnDTO; |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | public async Task<WebResponseContent> InPickTaskCompleted(Dt_Task task) |
| | | { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | //"BarcodeFeedbackUrl": "http://127.0.0.1:450/api/AldBarcodeInformation/BarcodeInformation", |
| | | //"MaterialOutboundFeedbackUrl": "http://127.0.0.1:450/api/AldMaterialOutbound/MaterialOutbound", |
| | | //"AllocationFeedbackUrl": "http://127.0.0.1:450/api/AldAllocationOperation/AllocationOperation", |
| | | //"ApiLogIgnore": "get,query,download,upload,template", |
| | |
| | | BarcodeQty = barcodeDto.Qty, |
| | | BarcodeUnit = barcodeDto.Unit, |
| | | ValidDate = barcodeDto.validDate, |
| | | |
| | | BoxSN = barcodeDto.BoxSN |
| | | }; |
| | | allocateOrder.Details.Add(orderDetail); |
| | | } |
| | |
| | | using System.IO; |
| | | using WIDESEA_Model.Models; |
| | | using System; |
| | | using WIDESEA_IBasicService; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers |
| | | { |
| | |
| | | private readonly IInboundService _inboundService; |
| | | private readonly IOutboundService _outboundService; |
| | | private readonly ITaskService _taskService; |
| | | private readonly IErpApiService _erpApiService; |
| | | |
| | | public PDAController(ITaskService taskService, IInboundService inboundService, IOutboundService outboundService) |
| | | public PDAController(ITaskService taskService, IInboundService inboundService, IOutboundService outboundService,IErpApiService erpApiService) |
| | | { |
| | | _inboundService = inboundService; |
| | | _outboundService = outboundService; |
| | | _taskService = taskService; |
| | | _erpApiService = erpApiService; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | [HttpPost, HttpGet, Route("GetMaterialUnitAsync"), AllowAnonymous] |
| | | public Task GetMaterialUnitAsync() |
| | | { |
| | | return _erpApiService.GetMaterialUnitAsync(); |
| | | } |
| | | } |
| | | } |