Ejemplo n.º 1
0
        /// <summary>
        /// 获取物料根据拣货规则以及批次对应的楼层,以及物料分类对应的主管
        /// </summary>
        /// <param name="modelList"></param>
        /// <param name="pickRuleModelList"></param>
        /// <param name="strError"></param>
        /// <returns></returns>
        private bool GetFloorForModelList(ref List <T_OutStockCreateInfo> modelList, List <T_PickRuleInfo> pickRuleModelList, List <T_UserGroupInfo> userGroupList, ref string strError)
        {
            bool            bSucc            = false;
            string          strBatchNo       = string.Empty;
            int             pickRule         = 0;
            string          PickLeaderUserNo = string.Empty;
            string          PickGroupNo      = string.Empty;
            T_PickRuleInfo  _pickModel       = new T_PickRuleInfo();
            T_UserGroupInfo _userGroupModel  = new T_UserGroupInfo();
            T_StockInfo     _stockModel      = new T_StockInfo();

            foreach (var item in modelList)
            {
                strBatchNo = item.IsSpcBatch == "Y" ? item.FromBatchno : string.Empty;

                _pickModel = pickRuleModelList == null ? null : pickRuleModelList.Find(t => t.MaterialClassCode == item.MainTypeCode);

                if (_pickModel != null)
                {
                    pickRule = _pickModel.PickRuleCode;
                }

                _userGroupModel = userGroupList == null ? null: userGroupList.FindLast(t => t.MainTypeCode == item.MainTypeCode && t.WarehouseNo.Contains(item.FromErpWareHouse));

                if (_userGroupModel == null)
                {
                    strError = "请先设置物料所属分类拣货组长!" + "订单号:" + item.ErpVoucherNo + " 物料编码:" + item.MaterialNo + " 项次:" + item.RowNo + " 项序:" + item.RowNoDel + "";
                    bSucc    = false;
                    break;
                }
                else
                {
                    PickLeaderUserNo = _userGroupModel.PickLeaderUserNo; //拣货组长
                    PickGroupNo      = _userGroupModel.PickGroupNo;      //拣货组
                }

                if (GetFloorByMaterialNoID(item.MaterialNoID, strBatchNo, pickRule, ref _stockModel, ref strError, item.StrongHoldCode, item.FromErpWareHouse) == false)
                {
                    strError = strError + "订单号:" + item.ErpVoucherNo + " 物料编码:" + item.MaterialNo + " 项次:" + item.RowNo + " 项序:" + item.RowNoDel + "";
                    bSucc    = false;
                    break;
                }
                else
                {
                    item.PickLeaderUserNo = PickLeaderUserNo;
                    item.PickGroupNo      = PickGroupNo;
                    item.FloorType        = _stockModel.FloorType;
                    item.HeightArea       = _stockModel.HeightArea;
                    bSucc = true;
                }
            }
            return(bSucc);
        }
Ejemplo n.º 2
0
        public bool UpdateT_PickRuleStatus(UserInfo user, ref T_PickRuleInfo t_pickrule, int NewStatus, ref string strError)
        {
            T_PickRule_Func tfunc = new T_PickRule_Func();

            return(tfunc.UpdateModelStatus(user, ref t_pickrule, NewStatus, ref strError));
        }
Ejemplo n.º 3
0
        public bool GetT_PickRuleListByPage(ref List <T_PickRuleInfo> modelList, UserInfo user, T_PickRuleInfo t_pickrule, ref DividPage page, ref string strError)
        {
            T_PickRule_Func tfunc = new T_PickRule_Func();

            return(tfunc.GetModelListByPage(ref modelList, user, t_pickrule, ref page, ref strError));
        }
Ejemplo n.º 4
0
        public bool GetT_PickRuleByID(ref T_PickRuleInfo model, ref string strError)
        {
            T_PickRule_Func tfunc = new T_PickRule_Func();

            return(tfunc.GetModelByID(ref model, ref strError));
        }
Ejemplo n.º 5
0
        public bool DeleteT_PickRuleByModel(UserInfo user, T_PickRuleInfo model, ref string strError)
        {
            T_PickRule_Func tfunc = new T_PickRule_Func();

            return(tfunc.DeleteModelByModel(user, model, ref strError));
        }
Ejemplo n.º 6
0
        public bool SaveT_PickRule(UserInfo user, ref T_PickRuleInfo t_pickrule, ref string strError)
        {
            T_PickRule_Func tfunc = new T_PickRule_Func();

            return(tfunc.SaveModelBySqlToDB(user, ref t_pickrule, ref strError));
        }