Exemple #1
0
        /// <summary>
        /// 手工补货优化
        /// </summary>
        /// <param name="orderDate"></param>
        /// <param name="batchNo"></param>
        public void GenHandleSupplySchedule(string orderDate, int batchNo)
        {
            using (PersistentManager pm = new PersistentManager())
            {
                HandleSupplyOptimize handleSupplyOptimize = new THOK.Optimize.HandleSupplyOptimize();
                ScOrderDao           scOrderDao           = new ScOrderDao();
                ChannelDao           channelDao           = new ChannelDao();

                Dao.LineScheduleDao lineDao   = new LineScheduleDao();
                DataTable           lineTable = lineDao.FindAllLine(orderDate, batchNo).Tables[0];

                int currentCount = 0;
                int totalCount   = lineTable.Rows.Count;

                foreach (DataRow lineRow in lineTable.Rows)
                {
                    string lineCode = lineRow["LINECODE"].ToString();

                    DataTable handSupplyOrders  = scOrderDao.FindHandleSupplyOrder(orderDate, batchNo, lineCode);
                    DataTable multiBrandChannel = channelDao.FindMultiBrandChannel(lineCode);

                    AddColumnForChannelTable(multiBrandChannel, multiBrandChannel.Rows.Count);

                    //返回新的手工补货订单表
                    DataTable newSupplyOrders = handleSupplyOptimize.Optimize(handSupplyOrders, multiBrandChannel);

                    //保存烟道空仓作业的SortNo
                    channelDao.Update(multiBrandChannel, orderDate, batchNo);

                    //删除sc_order原来的手工补货定单
                    scOrderDao.DeleteOldSupplyOrders(orderDate, batchNo, lineCode);
                    //在sc_order中插入新的手工补货定单
                    scOrderDao.InsertNewSupplyOrders(newSupplyOrders);


                    //在AS_SC_HANDLESUPPLY中插入新的手工补货定单
                    scOrderDao.InsertHandSupplyOrders(newSupplyOrders);

                    if (OnSchedule != null)
                    {
                        OnSchedule(this, new ScheduleEventArgs(8, "正在优化" + lineRow["LINECODE"].ToString() + "分拣线手工补货定单订单", ++currentCount, totalCount));
                    }
                }
            }
        }
        /// <summary>
        /// 手工补货优化
        /// </summary>
        /// <param name="orderDate"></param>
        /// <param name="batchNo"></param>
        public void GenHandleSupplySchedule(string orderDate, int batchNo) 
        {
            using (PersistentManager pm = new PersistentManager())
            {

                HandleSupplyOptimize handleSupplyOptimize = new THOK.Optimize.HandleSupplyOptimize();
                ScOrderDao scOrderDao = new ScOrderDao();
                ChannelDao channelDao = new ChannelDao();

                Dao.LineScheduleDao lineDao = new LineScheduleDao();
                DataTable lineTable = lineDao.FindAllLine(orderDate, batchNo).Tables[0];

                int currentCount = 0;
                int totalCount = lineTable.Rows.Count;

                foreach (DataRow lineRow in lineTable.Rows)
                {
                    string lineCode = lineRow["LINECODE"].ToString();

                    DataTable handSupplyOrders = scOrderDao.FindHandleSupplyOrder(orderDate, batchNo, lineCode);
                    DataTable multiBrandChannel = channelDao.FindMultiBrandChannel(lineCode);

                    AddColumnForChannelTable(multiBrandChannel, multiBrandChannel.Rows.Count);

                    //返回新的手工补货订单表
                    DataTable newSupplyOrders = handleSupplyOptimize.Optimize(handSupplyOrders, multiBrandChannel);

                    //保存烟道空仓作业的SortNo
                    channelDao.Update(multiBrandChannel,orderDate, batchNo);

                    //删除sc_order原来的手工补货定单
                    scOrderDao.DeleteOldSupplyOrders(orderDate, batchNo, lineCode);
                    //在sc_order中插入新的手工补货定单
                    scOrderDao.InsertNewSupplyOrders(newSupplyOrders);


                    //在AS_SC_HANDLESUPPLY中插入新的手工补货定单
                    scOrderDao.InsertHandSupplyOrders(newSupplyOrders);

                    if (OnSchedule != null)
                        OnSchedule(this, new ScheduleEventArgs(8, "正在优化" + lineRow["LINECODE"].ToString() + "分拣线手工补货定单订单", ++currentCount, totalCount));
                }
            }
        }