pan
2025-12-03 1a465495340bfea81b1e4d1db130399ccdf58fb4
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -645,7 +645,7 @@
                    locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
                }
                _locationInfoService.Repository.UpdateData(locationInfo);
                _locationInfoService.Repository.UpdateData(locationInfo);
                task.TaskStatus = TaskStatusEnum.Finish.ObjToInt();
@@ -749,7 +749,7 @@
                        await _outboundOrderDetailService.Db.Updateable<Dt_OutboundOrderDetail>()
                            .SetColumns(it => new Dt_OutboundOrderDetail
                            {
                                LockQuantity = currentLockQty,
                                LockQuantity = currentLockQty,
                            })
                            .Where(it => it.Id == detailId)
                            .ExecuteCommandAsync();
@@ -853,7 +853,7 @@
                    await _outboundOrderDetailService.Db.Updateable<Dt_OutboundOrderDetail>()
                        .SetColumns(it => new Dt_OutboundOrderDetail
                        {
                            OrderDetailStatus = newStatus,
                            OrderDetailStatus = newStatus,
                        })
                        .Where(it => it.Id == orderDetail.Id)
                        .ExecuteCommandAsync();
@@ -940,7 +940,7 @@
                        .SetColumns(x => new Dt_OutboundOrder
                        {
                            OrderStatus = newStatus,
                            Operator = App.User.UserName,
                            Operator = App.User.UserName,
                        })
                        .Where(x => x.OrderNo == orderNo)
                        .ExecuteCommandAsync();
@@ -1049,7 +1049,7 @@
                                MaterialCode = detail.MaterielCode,
                                LineNo = detail.lineNo,
                                WarehouseCode = detail.WarehouseCode,
                                Qty =0,
                                Qty = 0,
                                Unit = detail.BarcodeUnit,
                                Barcodes = new List<BarcodeInfo>()
                            };
@@ -1057,44 +1057,47 @@
                            {
                                if (item.PickedQty > 0)
                                {
                                    Barcode = item.CurrentBarcode,
                                    SupplyCode = item.SupplyCode,
                                    BatchNo = item.BatchNo,
                                    Unit = detail.BarcodeUnit,
                                    Qty = 0
                                };
                                // 鍗曚綅涓嶄竴鑷存椂杞崲
                                if (detail.BarcodeUnit != detail.Unit)
                                {
                                    var convertResult = await _materialUnitService.ConvertAsync(item.MaterielCode, item.PickedQty, detail.Unit, detail.BarcodeUnit);
                                    barModel.Unit = convertResult.Unit;
                                    barModel.Qty = convertResult.Quantity;
                                    var barModel = new BarcodeInfo
                                    {
                                        Barcode = item.CurrentBarcode,
                                        SupplyCode = item.SupplyCode,
                                        BatchNo = item.BatchNo,
                                        Unit = detail.BarcodeUnit,
                                        Qty = 0
                                    };
                                    // 鍗曚綅涓嶄竴鑷存椂杞崲
                                    if (detail.BarcodeUnit != detail.Unit)
                                    {
                                        var convertResult = await _materialUnitService.ConvertAsync(item.MaterielCode, item.PickedQty, detail.Unit, detail.BarcodeUnit);
                                        barModel.Unit = convertResult.Unit;
                                        barModel.Qty = convertResult.Quantity;
                                    }
                                    else
                                    {
                                        barModel.Qty = item.PickedQty;
                                    }
                                    detailModel.Qty += barModel.Qty;
                                    detailModel.Barcodes.Add(barModel);
                                }
                                else
                                {
                                    barModel.Qty = item.PickedQty;
                                }
                                detailModel.Qty += barModel.Qty;
                                detailModel.Barcodes.Add(barModel);
                                allocatefeedmodel.Details.Add(detailModel);
                            }
                            var result = await _invokeMESService.FeedbackAllocate(allocatefeedmodel);
                            if (result != null && result.code == 200)
                            {
                                await _outboundOrderDetailService.Db.Updateable<Dt_OutboundOrderDetail>()
                                       .SetColumns(x => x.ReturnToMESStatus == 1)
                                       .Where(x => x.OrderId == outboundOrder.Id).ExecuteCommandAsync();
                            allocatefeedmodel.Details.Add(detailModel);
                        }
                        var result = await _invokeMESService.FeedbackAllocate(allocatefeedmodel);
                        if (result != null && result.code == 200)
                        {
                            await _outboundOrderDetailService.Db.Updateable<Dt_OutboundOrderDetail>()
                                   .SetColumns(x => x.ReturnToMESStatus == 1)
                                   .Where(x => x.OrderId == outboundOrder.Id).ExecuteCommandAsync();
                            await _outboundOrderService.Db.Updateable<Dt_OutboundOrder>()
                                  .SetColumns(x => new Dt_OutboundOrder
                                  {
                                      ReturnToMESStatus = 1,
                                      Operator = App.User.UserName,
                                  }).Where(x => x.OrderNo == orderNo).ExecuteCommandAsync();
                                await _outboundOrderService.Db.Updateable<Dt_OutboundOrder>()
                                      .SetColumns(x => new Dt_OutboundOrder
                                      {
                                          ReturnToMESStatus = 1,
                                          Operator = App.User.UserName,
                                      }).Where(x => x.OrderNo == orderNo).ExecuteCommandAsync();
                            }
                        }
                    }
                    else if (outboundOrder.OrderType == OutOrderTypeEnum.ReCheck.ObjToInt())
@@ -1133,7 +1136,7 @@
                                lineNo = detail.lineNo, // 娉ㄦ剰锛氳繖閲屽彲鑳介渶瑕佽皟鏁村瓧娈靛悕
                                warehouseCode = detail.WarehouseCode,
                                qty = 0,
                                currentDeliveryQty =0,
                                currentDeliveryQty = 0,
                                unit = detail.Unit,
                                barcodes = new List<WIDESEA_DTO.Outbound.BarcodesModel>()
                            };
@@ -1141,7 +1144,6 @@
                            {
                                if (item.PickedQty > 0)
                                {
<<<<<<< .mine
                                    var barModel = new WIDESEA_DTO.Outbound.BarcodesModel
                                    {
                                        barcode = item.CurrentBarcode,
@@ -1151,60 +1153,24 @@
                                        qty = item.PickedQty
                                    };
                                    // 鍗曚綅涓嶄竴鑷存椂杞崲
                                    if (item.BarcodeUnit != item.Unit)
                                    if (detail.BarcodeUnit != detail.Unit)
                                    {
                                        var convertResult = await _materialUnitService.ConvertAsync(item.MaterielCode, item.PickedQty, item.Unit, item.BarcodeUnit);
                                        var convertResult = await _materialUnitService.ConvertAsync(item.MaterielCode, item.PickedQty, detail.Unit, detail.BarcodeUnit);
                                        barModel.unit = convertResult.Unit;
                                        barModel.qty = convertResult.Quantity;
                                    }
                                    else
                                    {
                                        barModel.qty = item.PickedQty;
                                    }
                                    detailModel.qty += barModel.qty;
                                    detailModel.currentDeliveryQty += barModel.qty;
                                    detailModel.barcodes.Add(barModel);
=======
                                    barcode = item.CurrentBarcode,
                                    supplyCode = item.SupplyCode,
                                    batchNo = item.BatchNo,
                                    unit = detail.BarcodeUnit,
                                    qty = item.PickedQty
                                };
                                // 鍗曚綅涓嶄竴鑷存椂杞崲
                                if (detail.BarcodeUnit != detail.Unit)
                                {
                                    var convertResult = await _materialUnitService.ConvertAsync(item.MaterielCode, item.PickedQty, detail.Unit, detail.BarcodeUnit);
                                    barModel.unit = convertResult.Unit;
                                    barModel.qty = convertResult.Quantity;
>>>>>>> .theirs
                                }
<<<<<<< .mine
=======
                                else
                                {
                                    barModel.qty = item.PickedQty;
                                }
                                    detailModel.qty += barModel.qty;
                                detailModel.currentDeliveryQty += barModel.qty;
                                detailModel.barcodes.Add(barModel);
>>>>>>> .theirs
                            }
                            feedmodel.details.Add(detailModel);
                        }
                        var result = await _invokeMESService.FeedbackOutbound(feedmodel);
                        if (result != null && result.code == 200)
                        {