1
huangxiaoqiang
2 天以前 5a15fa73d5f6a39917013871a65eb11a8c013391
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/ERPInboundOrderService.cs
@@ -9,10 +9,12 @@
using System.Threading.Tasks;
using WIDESEA_Common;
using WIDESEA_Core.Const;
using WIDESEA_IOrderRepository;
using WIDESEA_IServices;
using WIDESEA_IStorageBasicServices.Stock;
using WIDESEA_Model.Models.ERP;
using WIDESEA_Model.Models.Order;
using WIDESEA_OrderRepository;
namespace WIDESEA_StorageBasicServices
{
@@ -20,10 +22,12 @@
    {
        private readonly IUnitOfWorkManage _unitOfWorkManage; 
        private readonly ISys_ConfigService _configService;
        public ERPInboundOrderService(IUnitOfWorkManage unitOfWorkManage, ISys_ConfigService configService)
        private readonly IDt_InboundOrderRepository _inboundOrderRepository;
        public ERPInboundOrderService(IUnitOfWorkManage unitOfWorkManage, ISys_ConfigService configService,IDt_InboundOrderRepository inboundOrderRepository)
        {
            _unitOfWorkManage = unitOfWorkManage;
            _configService = configService;
            _inboundOrderRepository = inboundOrderRepository;
        }
        public virtual PageGridData<WMS_采购及成品入库清单_ST> GetPageData(PageDataOptions options)
        {
@@ -36,7 +40,45 @@
            new PageGridData<WMS_采购及成品入库清单_ST>(totalCount, data);
            return new PageGridData<WMS_采购及成品入库清单_ST>(totalCount, data);
        }
        public WebResponseContent Print(List<WMS_采购及成品入库清单_ST> wMSs)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                List<Dt_InboundOrder> orderinbound=new List<Dt_InboundOrder>();
                foreach (var wMS in wMSs)
                {
                    Dt_InboundOrder Print = new Dt_InboundOrder()
                    {
                        OrderNo = GetOrderPintCode("OrderNoIn"),
                        UpperOrderNo = wMS.单号,
                        DemandClassification = wMS.需求分类,
                        OrderType = wMS.单据类型,
                        WarehouseName = wMS.入库仓库名称,
                        Datetime = wMS.日期.ToString(),
                        LineNumber = wMS.行号,
                        ProductDrawingNumber = wMS.产品图号,
                        MaterialNo = wMS.料号,
                        MaterialName = wMS.品名,
                        Weight = wMS.单重,
                        WareHouseId = wMS.入库仓库编码,
                        Specs = wMS.规格,
                        Unit = wMS.单位,
                        Texture = wMS.用友材质,
                        Quantity = wMS.入库数量,
                        OrderStatus = wMS.单据状态
                    };
                    orderinbound.Add(Print);
                }
                _inboundOrderRepository.AddData(orderinbound);
                PrintInbound(orderinbound);
                return content.OK("打印成功");
            }
            catch (Exception ex)
            {
                return content.Error(ex.Message);
            }
        }
        public void PrintInbound(List<Dt_InboundOrder> orders)
        {
            var configs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress);