/// <summary>
        /// 简单属性的类型转换
        /// 将移动对应的实体的字符串类型统一转换为指定的数据类型
        /// </summary>
        /// <param name="sourceType">原数据类型</param>
        /// <param name="businessTypeService">业务服务接口</param>
        /// <returns></returns>
        public DependencyObjectType ConvertToDependencyObjectType(IDataEntityType sourceType, IBusinessTypeService businessTypeService)
        {
            DependencyObjectType newType = new DependencyObjectType(sourceType.Name);

            foreach (DependencyProperty property in sourceType.SimpleProperties)
            {
                if (_dateTimeProperties.Contains(property.Name))
                {
                    newType.RegisterSimpleProperty(property.Name, typeof(DateTime), OrmDataOption.EmptyDateTime
                                                   , false, new Attribute[] { new SimplePropertyAttribute(GeneralDBType.DateTime) });
                }
                else if (_decimalProperties.Contains(property.Name))
                {
                    newType.RegisterSimpleProperty(property.Name, businessTypeService.SimpleQuantityType, 0m
                                                   , false, new Attribute[] { businessTypeService.SimpleQuantity });
                }
                else if (_intProperties.Contains(property.Name))
                {
                    newType.RegisterSimpleProperty(property.Name, typeof(int), 0
                                                   , false, new Attribute[] { new SimplePropertyAttribute(GeneralDBType.Int32) });
                }
                else
                {
                    newType.RegisterSimpleProperty(property.Name, typeof(string), string.Empty
                                                   , false, new Attribute[] { new SimplePropertyAttribute(GeneralDBType.String) });
                }
            }

            return(newType);
        }
Esempio n. 2
0
        static Customer()
        {
            // DefaultType
            DefaultType = new DependencyObjectType("Customer", new Attribute[] {
                new DataEntityAttribute("ID"),
                new Digiwin.Common.Services.DatabaseDataEntityTypeAttribute()
            });
            // ID
            SimplePropertyAttribute simplePropertyAttribute0 = new SimplePropertyAttribute(GeneralDBType.Guid);

            simplePropertyAttribute0.Description = "PrimaryKey";
            IDProperty = DefaultType.RegisterSimpleProperty("ID", typeof(System.Guid), null, false, new Attribute[] {
                simplePropertyAttribute0
            });
            // CODE
            SimplePropertyAttribute simplePropertyAttribute1 = new SimplePropertyAttribute(GeneralDBType.String);

            simplePropertyAttribute1.Description = "单据类型编号";
            simplePropertyAttribute1.Size        = 10;
            CODEProperty = DefaultType.RegisterSimpleProperty("CODE", typeof(string), null, false, new Attribute[] {
                simplePropertyAttribute1
            });
            // NAME
            SimplePropertyAttribute simplePropertyAttribute2 = new SimplePropertyAttribute(GeneralDBType.String);

            simplePropertyAttribute2.Description = "单据类型名称";
            simplePropertyAttribute2.Size        = 20;
            NAMEProperty = DefaultType.RegisterSimpleProperty("NAME", typeof(string), null, false, new Attribute[] {
                simplePropertyAttribute2
            });
        }
        private DependencyObjectCollection GetPickListDataource(string pickListName, bool allowCheck)
        {
            IPickListDataService plDataSrv = this.GetService <IPickListDataService>();
            DependencyObjectType type      = new DependencyObjectType(pickListName);

            type.RegisterSimpleProperty("Value", typeof(string));
            type.RegisterSimpleProperty("DisplayName", typeof(string));
            if (allowCheck)
            {
                type.RegisterSimpleProperty("Select", typeof(bool));
            }
            DependencyObjectCollection items = new DependencyObjectCollection(type);

            if (!allowCheck)
            {
                DependencyObject first = items.AddNew();
                first["Value"]       = "";
                first["DisplayName"] = "--空白值--";
            }
            foreach (var item in plDataSrv.GetPickListSortedData(pickListName))
            {
                DependencyObject obj = items.AddNew();
                obj["Value"]       = item.Id;
                obj["DisplayName"] = item.DisplayName;
                if (allowCheck)
                {
                    obj["Select"] = false;
                }
            }

            return(items);
        }
        /// <summary>
        /// 存储所需修改IssueReceiptD的数据集合的临时表
        /// </summary>
        private IDataEntityType CreateDTmpTable(IQueryService qrySrv)
        {
            string typeName = "Temp_UpdateSalesIssueD_" + DateTime.Now.ToString("HHmmssfff");// 临时表表名的处理
            DependencyObjectType defaultType = new DependencyObjectType(typeName, new Attribute[] { });
            IBusinessTypeService businessSrv = this.GetServiceForThisTypeKey <IBusinessTypeService>();

            #region 字段

            defaultType.RegisterSimpleProperty("item_no", businessSrv.SimpleItemCodeType, string.Empty, false, new Attribute[] { businessSrv.SimpleItemCode });

            defaultType.RegisterSimpleProperty("item_feature_no", businessSrv.SimpleItemFeatureType, string.Empty, false, new Attribute[] { businessSrv.SimpleItemFeature });

            defaultType.RegisterSimpleProperty("picking_unit_no", businessSrv.SimpleUnitCodeType, string.Empty, false, new Attribute[] { businessSrv.SimpleUnitCode });

            defaultType.RegisterSimpleProperty("doc_no", businessSrv.SimpleDocNoType, string.Empty, false, new Attribute[] { businessSrv.SimpleDocNo });

            SimplePropertyAttribute tempAttr = new SimplePropertyAttribute(GeneralDBType.Int32);
            defaultType.RegisterSimpleProperty("seq", typeof(Int32), 0, false, new Attribute[] { tempAttr });

            defaultType.RegisterSimpleProperty("warehouse_no", businessSrv.GetBusinessType("WarehouseCode"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("WarehouseCode") });

            defaultType.RegisterSimpleProperty("storage_spaces_no", businessSrv.GetBusinessType("Bin"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("Bin") });

            defaultType.RegisterSimpleProperty("lot_no", businessSrv.SimpleLotCodeType, string.Empty, false, new Attribute[] { businessSrv.SimpleLotCode });

            defaultType.RegisterSimpleProperty("picking_qty", businessSrv.SimpleQuantityType, 0M, false, new Attribute[] { businessSrv.SimpleQuantity });

            tempAttr = new SimplePropertyAttribute(GeneralDBType.String, 1000);
            defaultType.RegisterSimpleProperty("barcode_no", typeof(string), string.Empty, false, new Attribute[] { tempAttr });

            #endregion

            qrySrv.CreateTempTable(defaultType);
            return(defaultType);
        }
Esempio n. 5
0
        /// <summary>
        /// 构建attrib_list返回值
        /// </summary>
        /// <returns></returns>
        private DependencyObjectType StructureAttribList()
        {
            DependencyObjectType type = new DependencyObjectType("attrib_list");

            type.RegisterSimpleProperty("attrib_value", typeof(decimal));   //测量值
            type.RegisterSimpleProperty("result_type", typeof(string));     //判定状态
            return(type);
        }
Esempio n. 6
0
        /// <summary>
        /// 构建reason_list返回值
        /// </summary>
        /// <returns></returns>
        private DependencyObjectType StructureReasonList()
        {
            DependencyObjectType type = new DependencyObjectType("reason_list");

            type.RegisterSimpleProperty("reason_no", typeof(string));        //缺点原因编号
            type.RegisterSimpleProperty("reason_code_name", typeof(string)); //缺点原因
            type.RegisterSimpleProperty("defect_qty", typeof(decimal));      //缺点数量
            return(type);
        }
        /// <summary>
        /// 创建存储传入参数集合的临时表
        /// </summary>
        private void CreateTemp()
        {
            IBusinessTypeService businessSrv = this.GetServiceForThisTypeKey <IBusinessTypeService>();

            string typeName = "Temp_Scan" + DateTime.Now.ToString("HHmmssfff");// 临时表表名的处理
            DependencyObjectType defaultType = new DependencyObjectType(typeName, new Attribute[] { });

            #region 单头
            defaultType.RegisterSimpleProperty("ID", businessSrv.SimplePrimaryKeyType, Maths.GuidDefaultValue(), false, new Attribute[] { businessSrv.SimplePrimaryKey });
            //人员
            defaultType.RegisterSimpleProperty("employee_no", businessSrv.GetBusinessType("BusinessCode"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("BusinessCode") });
            SimplePropertyAttribute tempAttr = new SimplePropertyAttribute(GeneralDBType.String);
            tempAttr.Size = 10;
            //部门
            defaultType.RegisterSimpleProperty("picking_department_no", typeof(string), string.Empty, false, new Attribute[] { tempAttr });
            //工厂编号
            defaultType.RegisterSimpleProperty("site_no", businessSrv.GetBusinessType("Factory"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("Factory") });
            //信息批号
            tempAttr.Size = 30;
            defaultType.RegisterSimpleProperty("info_lot_no", typeof(string), string.Empty, false, new Attribute[] { tempAttr });
            _tempScan = defaultType;
            _qurService.CreateTempTable(_tempScan);
            #endregion

            typeName    = "Temp_ScanDetail" + DateTime.Now.ToString("HHmmssfff");// 临时表表名的处理
            defaultType = new DependencyObjectType(typeName, new Attribute[] { });
            #region 单身
            defaultType.RegisterSimpleProperty("ID", businessSrv.SimplePrimaryKeyType, Maths.GuidDefaultValue(), false, new Attribute[] { businessSrv.SimplePrimaryKey });
            //信息批号
            tempAttr.Size = 30;
            defaultType.RegisterSimpleProperty("info_lot_no", typeof(string), string.Empty, false, new Attribute[] { tempAttr });
            //序号
            tempAttr = new SimplePropertyAttribute(GeneralDBType.Int32);
            defaultType.RegisterSimpleProperty("SequenceNumber", typeof(Int32), 0, false, new Attribute[] { tempAttr });
            //品号
            defaultType.RegisterSimpleProperty("item_no", businessSrv.GetBusinessType("ItemCode"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("ItemCode") });
            //特征码
            defaultType.RegisterSimpleProperty("item_feature_no", businessSrv.GetBusinessType("ItemFeature"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("ItemFeature") });
            //单位
            defaultType.RegisterSimpleProperty("picking_unit_no", businessSrv.GetBusinessType("UnitCode"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("UnitCode") });
            //仓库
            defaultType.RegisterSimpleProperty("warehouse_no", businessSrv.GetBusinessType("WarehouseCode"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("WarehouseCode") });
            //库位
            defaultType.RegisterSimpleProperty("storage_spaces_no", businessSrv.GetBusinessType("Bin"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("Bin") });
            //批号
            defaultType.RegisterSimpleProperty("lot_no", businessSrv.GetBusinessType("LotCode"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("LotCode") });
            //拣货数量
            defaultType.RegisterSimpleProperty("picking_qty", businessSrv.GetBusinessType("Quantity"), 0M, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("Quantity") });
            //条码编号
            tempAttr      = new SimplePropertyAttribute(GeneralDBType.String);
            tempAttr.Size = 1000;
            defaultType.RegisterSimpleProperty("barcode_no", typeof(string), string.Empty, false, new Attribute[] { tempAttr });
            _tempScanDetail = defaultType;
            _qurService.CreateTempTable(_tempScanDetail);
            #endregion
        }
        /// <summary>
        /// 异常服务返回集合
        /// </summary>
        /// <returns></returns>
        public static DependencyObjectCollection CreateExceptionReturnCollection()
        {
            DependencyObjectType type = new DependencyObjectType("ReturnCollection");

            type.RegisterSimpleProperty("code", typeof(int));
            type.RegisterSimpleProperty("sql_code", typeof(string));
            type.RegisterSimpleProperty("description", typeof(string));
            type.RegisterSimpleProperty("report_no", typeof(string));

            DependencyObjectCollection Rtn = new DependencyObjectCollection(type);

            return(Rtn);
        }
        /// <summary>
        /// 获取企业信息
        /// </summary>
        /// <returns></returns>
        public Hashtable GetCompany()
        {
            DependencyObjectType type = new DependencyObjectType("enterprise_detail");

            type.RegisterSimpleProperty("enterprise_no", typeof(string));
            type.RegisterSimpleProperty("enterprise_name", typeof(string));
            DependencyObjectCollection enterpriseDetail = new DependencyObjectCollection(type);
            const string     company = "99";
            DependencyObject entity  = enterpriseDetail.AddNew();

            entity["enterprise_no"]   = company;
            entity["enterprise_name"] = company;
            return(new Hashtable {
                { "enterprise_detail", enterpriseDetail }
            });
        }
        /// <summary>
        /// 组建空记录
        /// </summary>
        /// <returns></returns>
        private DependencyObjectCollection CreateEmptyCollection()
        {
            string[] columnNames = new string[] {
                "item_no",
                "item_name",
                "item_spec",
                "item_feature_no",
                "item_feature_name",
                "inventory_unit",
                "enterprise_no",
                "site_no",
                "warehouse_no",
                "storage_spaces_no",
                "last_transaction_date"
                //"result",
                //"message"
            };
            DependencyObjectType rtnType = new DependencyObjectType("resultItem");

            foreach (string item in columnNames)
            {
                rtnType.RegisterSimpleProperty(item, typeof(string));
            }

            DependencyObjectCollection rtnColl = new DependencyObjectCollection(rtnType);

            return(rtnColl);
        }
        /// <summary>
        /// 移除不需要的列
        /// </summary>
        /// <param name="entity">实体集合</param>
        /// <param name="excludeColumns">需要移除的列</param>
        /// <returns></returns>
        private DependencyObjectCollection RemoveObjectType(DependencyObjectCollection entity, string[] excludeColumns)
        {
            DependencyObjectType cloneObjectType = new DependencyObjectType("collection1_clone");
            IDataEntityType      dataEntityType  = entity.ItemDependencyObjectType;

            foreach (ISimpleProperty property in dataEntityType.SimpleProperties)
            {
                if (!excludeColumns.Contains(property.Name))
                {
                    cloneObjectType.RegisterSimpleProperty(property.Name, property.PropertyType);
                }
            }
            DependencyObjectCollection cloneObject = new DependencyObjectCollection(cloneObjectType);//克隆对象

            foreach (DependencyObject item in entity)
            {
                var newItem = cloneObject.AddNew();
                foreach (ISimpleProperty property in ((IDataEntityType)item.DependencyObjectType).SimpleProperties)
                {
                    if (newItem.DependencyObjectType.Properties.Contains(property.Name))
                    {
                        newItem[property.Name] = item[property.Name];
                    }
                }
            }
            return(cloneObject);
        }
Esempio n. 12
0
        /// <summary>
        /// 创建服务返回集合
        /// </summary>
        /// <returns></returns>
        private DependencyObjectCollection CreateReturnCollection()
        {
            DependencyObjectType type = new DependencyObjectType("ReturnCollection");

            type.RegisterSimpleProperty("doc_no", typeof(string));

            DependencyObjectCollection Rtn = new DependencyObjectCollection(type);

            return(Rtn);
        }
Esempio n. 13
0
        /// <summary>
        /// 创建服务返回集合
        /// </summary>
        /// <returns></returns>
        public DependencyObjectCollection CreateReturnCollection()
        {
            DependencyObjectType type = new DependencyObjectType("ReturnCollection");

            type.RegisterSimpleProperty("doc_no", typeof(string));

            DependencyObjectCollection collDepObj = new DependencyObjectCollection(type);

            return(collDepObj);
        }
        /// <summary>
        /// 创建空的服务返回集合
        /// </summary>
        /// <returns></returns>
        private DependencyObjectCollection CreateReturnCollectionForItemDetail()
        {
            DependencyObjectType type = new DependencyObjectType("item_detail");

            type.RegisterSimpleProperty("item_no", typeof(string));
            type.RegisterSimpleProperty("item_name", typeof(string));
            type.RegisterSimpleProperty("item_spec", typeof(string));
            type.RegisterSimpleProperty("warehouse_no", typeof(string));
            type.RegisterSimpleProperty("item_feature_no", typeof(string));
            type.RegisterSimpleProperty("item_feature_name", typeof(string));
            type.RegisterSimpleProperty("storage_spaces_no", typeof(string));
            type.RegisterSimpleProperty("lot_no", typeof(string));
            type.RegisterSimpleProperty("inventory_unit", typeof(string));
            type.RegisterSimpleProperty("inventory_qty", typeof(decimal));

            DependencyObjectCollection rtn = new DependencyObjectCollection(type);

            return(rtn);
        }
        /// <summary>
        /// 创建空的服务返回集合
        /// </summary>
        /// <returns></returns>
        private DependencyObjectCollection CreateReturnCollection()
        {
            DependencyObjectType type = new DependencyObjectType("barcode_detail");

            type.RegisterSimpleProperty("barcode_no", typeof(string));
            type.RegisterSimpleProperty("item_no", typeof(string));
            type.RegisterSimpleProperty("item_feature_no", typeof(string));   //20170329 add by wangrm for P001-170316001
            type.RegisterSimpleProperty("item_feature_name", typeof(string)); //20170329 add by wangrm for P001-170316001
            type.RegisterSimpleProperty("warehouse_no", typeof(string));
            type.RegisterSimpleProperty("storage_spaces_no", typeof(string));
            type.RegisterSimpleProperty("lot_no", typeof(string));
            type.RegisterSimpleProperty("inventory_unit", typeof(string));
            type.RegisterSimpleProperty("inventory_qty", typeof(decimal));

            DependencyObjectCollection rtn = new DependencyObjectCollection(type);

            return(rtn);
        }
        /// <summary>
        /// 创建界面绑定view
        /// </summary>
        /// <returns></returns>
        private DependencyObjectView CreateDataSource()
        {
            DependencyObjectType type = new DependencyObjectType("Type");

            type.RegisterSimpleProperty("Function", typeof(string));
            foreach (ParaEntity para in CurrentFunction.ParaList)
            {
                type.RegisterSimpleProperty(para.ConditionName, typeof(string));
                type.RegisterSimpleProperty(para.Name, para.ParaType);
                if (para.ParaTypeFlag == ParaTypeEnum.SelectControl)
                {
                    type.RegisterSimpleProperty(para.Name.Replace("_ID", "_NAME"), typeof(string));
                    type.RegisterSimpleProperty(para.Name.Replace("_ID", "_CODE"), typeof(string));
                }
            }

            DependencyObject obj = new DependencyObject(type);

            DependencyObjectView view = new DependencyObjectView(obj);

            return(view);
        }
Esempio n. 17
0
File: Tools.cs Progetto: Ocun/VSTool
        public void creatTmp(string TypeKey, out DataTable dt, out DependencyObjectType targetType)
        {
            dt         = null;
            targetType = null;
            string[] spiltTypeKeys = null;
            bool     isColls       = false;
            string   primaryKey    = string.Empty;

            if (TypeKey.Contains(@"."))
            {
                spiltTypeKeys = TypeKey.Split(new[] { '.' });
                TypeKey       = spiltTypeKeys[0];
                primaryKey    = spiltTypeKeys[spiltTypeKeys.Length - 2];
                isColls       = true;
            }

            ICreateService createSrv = Provider.GetService(typeof(ICreateService), TypeKey) as ICreateService;

            if (createSrv == null)
            {
                return;
            }
            var entity = createSrv.Create() as DependencyObject;
            DependencyObjectType toType = entity.DependencyObjectType;

            if (isColls && spiltTypeKeys != null)
            {
                spiltTypeKeys.ToList().ForEach(key => {
                    if (!key.Equals(TypeKey))
                    {
                        toType =
                            ((ICollectionProperty)(toType.Properties[key])).ItemDataEntityType as DependencyObjectType;
                    }
                });
            }
            IBusinessTypeService businessTypeSrv =
                Provider.GetService(typeof(IBusinessTypeService), CallContext.TypeKey) as IBusinessTypeService;

            targetType = RegiesterType(toType, targetType);
            if (isColls)
            {
                string primaryKeyName = primaryKey + "_ID";

                targetType.RegisterSimpleProperty(primaryKeyName, businessTypeSrv.SimplePrimaryKeyType,
                                                  null, false, new Attribute[] {
                    businessTypeSrv.SimplePrimaryKey
                });
            }

            dt = CreateDt(targetType, dt);
        }
        /// <summary>
        /// 移动应用自动产生批号服务
        /// </summary>
        /// <param name="program_job_no">作业编号</param>
        /// <param name="status">执行动作</param>
        /// <param name="item_no">料件编号</param>
        /// <param name="item_feature_no">产品特征</param>
        /// <param name="site_no">营运据点</param>
        /// <param name="object_no">供货商编号//作業編號=1.2.3為必要輸入</param>
        /// <param name="action">动作:Q.查询 I.新增</param>
        /// <param name="lot_no">批号:当动作=Q时,为必输</param>
        /// <returns></returns>
        public Hashtable LotNoAndSerialNoCoding(string program_job_no, string status, string item_no, string item_feature_no, string site_no, string object_no, string action, string lot_no)  //20170109 modi by wangyq for P001-170118001 添加后两个参数
        //20170109 add by wangyq for P001-170118001 =============begin==============
        {
            if (action == "Q" && string.IsNullOrEmpty(lot_no))
            {
                throw new ArgumentNullException("lot_no");
            }
            //20170109 add by wangyq for P001-170118001 =============end==============

            string[]             convertJobNos = new string[] { "1", "2", "3", "9" };
            DependencyObjectType resultType    = new DependencyObjectType("lot_detail");

            resultType.RegisterSimpleProperty("lot_no", typeof(string));
            resultType.RegisterSimpleProperty("item_no", typeof(string));
            resultType.RegisterSimpleProperty("item_feature_no", typeof(string));
            //20170109 add by wangyq for P001-170118001 =============begin==============
            resultType.RegisterSimpleProperty("lot_description", typeof(string));
            resultType.RegisterSimpleProperty("effective_date", typeof(string));
            resultType.RegisterSimpleProperty("effective_deadline", typeof(string));
            resultType.RegisterSimpleProperty("remarks", typeof(string));
            //20170109 add by wangyq for P001-170118001 =============end==============
            DependencyObjectCollection sourceDocDetail = new DependencyObjectCollection(resultType);
            IdEntity idEntity = ConvertToId(item_no, item_feature_no, site_no, object_no);

            if (action == "I")  //新增逻辑20170109 add by wangyq for P001-170118001
            {
                if (convertJobNos.Contains(program_job_no))
                {
                    Digiwin.ERP.Common.Business.ILotNoAndSerialNoCodingService commonLotSerialService = this.GetServiceForThisTypeKey <Digiwin.ERP.Common.Business.ILotNoAndSerialNoCodingService>();
                    DependencyObject commonLotResult = commonLotSerialService.LotNoAndSerialNoCoding("1", idEntity.PlantId, idEntity.ItemId, idEntity.SupplierId, idEntity.ItemFeatureId, DateTime.Now.Date, true);//20170410 modi by wangrm 启萌口述新需求 OLD:false->true
                    DependencyObject resultObj       = sourceDocDetail.AddNew();
                    resultObj["lot_no"]          = commonLotResult["LOT_CODE"];
                    resultObj["item_no"]         = item_no;
                    resultObj["item_feature_no"] = item_feature_no;
                    //20170109 add by wangyq for P001-170118001 =============begin==============
                    //resultObj["lot_description"] = commonLotResult["LOT_CODE"];//20170509 modi by liwei1 for B001-170505004
                    resultObj["lot_description"]    = string.Empty;//20170509 add by liwei1 for B001-170505004
                    resultObj["effective_date"]     = commonLotResult["EFFECTIVE_DATE"].ToDate().ToString("yyyy-MM-dd");
                    resultObj["effective_deadline"] = commonLotResult["INEFFECTIVE_DATE"].ToDate().ToString("yyyy-MM-dd");
                    resultObj["remarks"]            = string.Empty;
                    //20170109 add by wangyq for P001-170118001 =============end==============
                    InsertItemLot(commonLotResult, idEntity.ItemId, idEntity.ItemFeatureId);//20170106 add by wangyq for P001-161230002 增加批号的新增数据库逻辑
                }
            }
            else if (action == "Q")     //20170109 add by wangyq for P001-170118001 =============begin==============
            {
                QueryNode node = OOQL.Select(OOQL.CreateProperty("ITEM_LOT.LOT_CODE"),
                                             OOQL.CreateProperty("ITEM_LOT.LOT_DESCRIPTION"),
                                             OOQL.CreateProperty("ITEM_LOT.EFFECTIVE_DATE"),
                                             OOQL.CreateProperty("ITEM_LOT.INEFFECTIVE_DATE"),
                                             OOQL.CreateProperty("ITEM_LOT.REMARK"))
                                 .From("ITEM_LOT", "ITEM_LOT")
                                 .Where(OOQL.AuthFilter("ITEM_LOT", "ITEM_LOT") &
                                        (OOQL.CreateProperty("ITEM_LOT.ITEM_ID") == OOQL.CreateConstants(idEntity.ItemId)
                                         & OOQL.CreateProperty("ITEM_LOT.ITEM_FEATURE_ID") == OOQL.CreateConstants(idEntity.ItemFeatureId)
                                         & OOQL.CreateProperty("ITEM_LOT.LOT_CODE") == OOQL.CreateConstants(lot_no)));
                DependencyObjectCollection lotColl = this.GetService <IQueryService>().ExecuteDependencyObject(node);
                foreach (DependencyObject lotObj in lotColl)
                {
                    DependencyObject resultObj = sourceDocDetail.AddNew();
                    resultObj["lot_no"]             = lotObj["LOT_CODE"];
                    resultObj["item_no"]            = item_no;
                    resultObj["item_feature_no"]    = item_feature_no;
                    resultObj["lot_description"]    = lotObj["LOT_DESCRIPTION"];
                    resultObj["effective_date"]     = lotObj["EFFECTIVE_DATE"].ToDate().ToString("yyyy-MM-dd");
                    resultObj["effective_deadline"] = lotObj["INEFFECTIVE_DATE"].ToDate().ToString("yyyy-MM-dd");
                    resultObj["remarks"]            = lotObj["REMARK"];
                }
            }
            //20170109 add by wangyq for P001-170118001 =============end==============
            //组合返回结果
            Hashtable result = new Hashtable();

            //添加单据下载数据
            result.Add("lot_detail", sourceDocDetail);
            return(result);
        }
Esempio n. 19
0
        /// <summary>
        /// 构建reason_list返回值
        /// </summary>
        /// <returns></returns>
        private DependencyObjectType StructureReceiptList()
        {
            DependencyObjectType receiptListType = new DependencyObjectType("receipt_list");

            receiptListType.RegisterSimpleProperty("seq", typeof(int));
            receiptListType.RegisterSimpleProperty("item_no", typeof(string));
            receiptListType.RegisterSimpleProperty("item_name", typeof(string));
            receiptListType.RegisterSimpleProperty("item_spec", typeof(string));
            receiptListType.RegisterSimpleProperty("item_feature_no", typeof(string));
            receiptListType.RegisterSimpleProperty("item_feature_name", typeof(string));
            receiptListType.RegisterSimpleProperty("unit_no", typeof(string));
            receiptListType.RegisterSimpleProperty("receipt_qty", typeof(decimal));
            receiptListType.RegisterSimpleProperty("ok_qty", typeof(decimal));
            receiptListType.RegisterSimpleProperty("unqualified_qty", typeof(decimal));  //20170801 add by liwei1 for P001-170717001
            receiptListType.RegisterSimpleProperty("checkdestroy_qty", typeof(decimal)); //20170801 add by liwei1 for P001-170717001reason_no
            receiptListType.RegisterSimpleProperty("result_type", typeof(string));
            receiptListType.RegisterSimpleProperty("qc_group", typeof(string));
            receiptListType.RegisterSimpleProperty("qc_degree", typeof(string));
            receiptListType.RegisterSimpleProperty("qc_level", typeof(string));
            receiptListType.RegisterSimpleProperty("qc_type", typeof(string));
            receiptListType.RegisterCollectionProperty("qc_list", StructureQcList());
            return(receiptListType);
        }
Esempio n. 20
0
        private void CreateTempTable()
        {
            IBusinessTypeService businessTypeSrv = GetServiceForThisTypeKey <IBusinessTypeService>();

            #region 单头临时表
            string tempName = "Table_scan" + "_" + DateTime.Now.ToString("HHmmssfff");
            DependencyObjectType    defaultType = new DependencyObjectType(tempName, new Attribute[] { null });
            SimplePropertyAttribute tempAttr    = new SimplePropertyAttribute(GeneralDBType.String);
            #region 字段
            //营运据点
            defaultType.RegisterSimpleProperty("site_no", typeof(string),
                                               string.Empty, false, new Attribute[] { tempAttr });
            //条码编号
            defaultType.RegisterSimpleProperty("barcode_no", typeof(string),
                                               string.Empty, false, new Attribute[] { tempAttr });
            //料件编号
            defaultType.RegisterSimpleProperty("item_no", businessTypeSrv.GetBusinessType("ItemCode"),
                                               string.Empty, false, new Attribute[] { businessTypeSrv.GetSimplePropertyAttribute("ItemCode") });
            //产品特征
            defaultType.RegisterSimpleProperty("item_feature_no", businessTypeSrv.GetBusinessType("ItemFeature"),
                                               string.Empty, false, new Attribute[] { businessTypeSrv.GetSimplePropertyAttribute("ItemFeature") });
            //库位编号
            defaultType.RegisterSimpleProperty("warehouse_no", businessTypeSrv.GetBusinessType("WarehouseCode"),
                                               string.Empty, false, new Attribute[] { businessTypeSrv.GetSimplePropertyAttribute("WarehouseCode") });
            //储位编号
            defaultType.RegisterSimpleProperty("storage_spaces_no", businessTypeSrv.GetBusinessType("Bin"),
                                               string.Empty, false, new Attribute[] { businessTypeSrv.GetSimplePropertyAttribute("Bin") });
            //批号
            defaultType.RegisterSimpleProperty("lot_no", businessTypeSrv.GetBusinessType("LotCode"),
                                               string.Empty, false, new Attribute[] { businessTypeSrv.GetSimplePropertyAttribute("LotCode") });
            //盘点数量
            defaultType.RegisterSimpleProperty("qty", businessTypeSrv.GetBusinessType("Quantity"),
                                               0M, false, new Attribute[] { businessTypeSrv.GetSimplePropertyAttribute("Quantity") });
            //盘点人员
            defaultType.RegisterSimpleProperty("employee_no", businessTypeSrv.GetBusinessType("BusinessCode"),
                                               string.Empty, false, new Attribute[] { businessTypeSrv.GetSimplePropertyAttribute("BusinessCode") });
            //盘点日期
            defaultType.RegisterSimpleProperty("complete_date", typeof(DateTime),
                                               OrmDataOption.EmptyDateTime, false, new Attribute[] { new SimplePropertyAttribute(GeneralDBType.Date) });
            //交易对象类型
            defaultType.RegisterSimpleProperty("transaction_type", typeof(string),
                                               string.Empty, false, new Attribute[] { tempAttr });
            tempAttr.Size = 10;
            //交易对象编号
            defaultType.RegisterSimpleProperty("transaction_no", typeof(string),
                                               string.Empty, false, new Attribute[] { tempAttr });
            #endregion
            _Table_scan = defaultType;
            _qurService.CreateTempTable(_Table_scan);
            #endregion
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="employee_no">扫描人员</param>
        /// <param name="scan_type">扫描类型1.有箱条码 2.无箱条码</param>
        /// <param name="report_datetime">上传时间</param>
        /// <param name="picking_department_no">部门</param>
        /// <param name="recommended_operations">建议执行作业</param>
        /// <param name="recommended_function">A.新增  S.过帐</param>
        /// <param name="scan_doc_no">扫描单号</param>
        /// <param name="collScan"></param>
        public DependencyObjectCollection InertTransactionDoc(string employee_no, string scan_type, DateTime report_datetime,
                                                              string picking_department_no, string recommended_operations, string recommended_function,
                                                              string scan_doc_no, DependencyObjectCollection scanColl)
        {
            IInfoEncodeContainer InfoEncodeSrv = this.GetService <IInfoEncodeContainer>();

            if (Maths.IsEmpty(recommended_operations))
            {
                throw new BusinessRuleException(InfoEncodeSrv.GetMessage("A111201", "recommended_operations"));//‘入参【recommended_operations】未传值’
            }
            if (Maths.IsEmpty(recommended_function))
            {
                throw new BusinessRuleException(InfoEncodeSrv.GetMessage("A111201", "recommended_function"));//‘入参【recommended_function】未传值’
            }
            DependencyObjectType type = new DependencyObjectType("ReturnCollection");

            type.RegisterSimpleProperty("doc_no", typeof(string));
            DependencyObjectCollection Rtn = new DependencyObjectCollection(type);

            if (scanColl.Count > 0)
            {
                string stockAction = string.Empty;
                string view        = string.Empty;
                if (recommended_operations.StartsWith("11"))
                {
                    stockAction = "-1";
                    view        = "TRANSACTION_DOC.I02";
                }
                else if (recommended_operations.StartsWith("12"))
                {
                    stockAction = "1";
                    view        = "TRANSACTION_DOC.I01";
                }
                DependencyObjectCollection docColl = ValidateDocSet(stockAction, scanColl[0]["site_no"].ToStringExtension());
                if (docColl.Count <= 0)
                {
                    throw new BusinessRuleException(InfoEncodeSrv.GetMessage("A111275"));
                }
                DataTable dtScan       = CreateDtScan();
                DataTable dtScanDetail = CreateDtScanDetail();
                PrepareDtForInsertScan(employee_no, picking_department_no, scanColl, dtScan, dtScanDetail);
                using (IConnectionService connService = this.GetService <IConnectionService>()) {
                    _qurService = this.GetService <IQueryService>();
                    CreateTemp();
                    InsertTemp(dtScan, dtScanDetail);
                    List <DependencyObject> saveEntities = AddEntity(docColl[0]["DOC_ID"], docColl[0]["SEQUENCE_DIGIT"].ToInt32(), report_datetime, stockAction);
                    if (saveEntities.Count > 0)
                    {
                        using (ITransactionService transService = this.GetService <ITransactionService>()) {
                            InsertBCLine(report_datetime);//20170413 add by wangyq for P001-170412001 需要在保存服务之前,保存自动审核会需要回写
                            //保存单据
                            ISaveService saveSrv = this.GetService <ISaveService>("TRANSACTION_DOC");
                            saveSrv.Save(saveEntities.ToArray());

                            UpdateTD();//更新

                            //InsertBCLine(report_datetime);//20170413 mark by wangyq for P001-170412001

                            //EFNET签核
                            foreach (DependencyObject item in saveEntities)
                            {
                                IEFNETStatusStatusService efnetSrv = this.GetService <IEFNETStatusStatusService>();
                                efnetSrv.GetFormFlow(view, item["DOC_ID"], ((DependencyObject)item["Owner_Org"])["ROid"], new object[] { item["TRANSACTION_DOC_ID"] });
                            }
                            transService.Complete();
                        }
                        foreach (DependencyObject item in saveEntities)
                        {
                            DependencyObject obj = Rtn.AddNew();
                            obj["doc_no"] = item["DOC_NO"];
                        }
                    }
                }
            }
            return(Rtn);
        }
Esempio n. 22
0
        /// <summary>
        /// 构建reason_list返回值
        /// </summary>
        /// <returns></returns>
        private DependencyObjectType StructureQcList()
        {
            DependencyObjectType qcListType = new DependencyObjectType("qc_list");

            qcListType.RegisterSimpleProperty("qc_seq", typeof(int));
            qcListType.RegisterSimpleProperty("test_no", typeof(string));
            qcListType.RegisterSimpleProperty("test_name", typeof(string));
            qcListType.RegisterSimpleProperty("defect_level", typeof(string));
            qcListType.RegisterSimpleProperty("reject_qty", typeof(decimal));
            qcListType.RegisterSimpleProperty("test_qty", typeof(decimal));
            qcListType.RegisterSimpleProperty("reason_qty", typeof(decimal));
            qcListType.RegisterSimpleProperty("acceptable_qty", typeof(decimal)); //20170801 add by liwei1 for P001-170717001
            qcListType.RegisterSimpleProperty("rejected_qty", typeof(decimal));   //20170801 add by liwei1 for P001-170717001
            qcListType.RegisterSimpleProperty("return_qty", typeof(decimal));
            qcListType.RegisterSimpleProperty("reason_no", typeof(string));       //缺点原因
            qcListType.RegisterSimpleProperty("measure_max", typeof(decimal));
            qcListType.RegisterSimpleProperty("measure_min", typeof(decimal));
            qcListType.RegisterSimpleProperty("result_type", typeof(string));
            qcListType.RegisterCollectionProperty("reason_list", StructureReasonList());
            qcListType.RegisterCollectionProperty("attrib_list", StructureAttribList());
            return(qcListType);
        }
Esempio n. 23
0
        /// <summary>
        /// 检验单获取质检方案相关抽样数量
        /// </summary>
        /// <param name="paraInspectionPlanId">质检方案id</param>
        /// <param name="paraInspectionItemId">检验项目</param>
        /// <param name="paraQty">送检批量</param>
        /// <param name="paraDegree">宽严程度</param>
        /// <returns></returns>
        public DependencyObject GetInspectionQty(object paraInspectionPlanId, object paraInspectionItemId,
                                                 decimal paraQty, string paraDegree)
        {
            IQueryService    querySrv  = GetService <IQueryService>();
            DependencyObject queryPlan = null;
            QueryNode        node      = OOQL.Select((Formulas.Case(null, OOQL.CreateProperty("A.MI_AQL"),
                                                                    OOQL.CreateCaseArray(
                                                                        OOQL.CreateCaseItem(
                                                                            OOQL.CreateProperty("B.DEFECT_CLASS") == OOQL.CreateConstants("1"),
                                                                            OOQL.CreateProperty("A.CR_AQL")),
                                                                        OOQL.CreateCaseItem(
                                                                            OOQL.CreateProperty("B.DEFECT_CLASS") == OOQL.CreateConstants("2"),
                                                                            OOQL.CreateProperty("A.MA_AQL"))), "AQL")),
                                                     (Formulas.Case(null, OOQL.CreateProperty("A.MI_LQ"),
                                                                    OOQL.CreateCaseArray(
                                                                        OOQL.CreateCaseItem(
                                                                            OOQL.CreateProperty("B.DEFECT_CLASS") == OOQL.CreateConstants("1"),
                                                                            OOQL.CreateProperty("A.CR_LQ")),
                                                                        OOQL.CreateCaseItem(
                                                                            OOQL.CreateProperty("B.DEFECT_CLASS") == OOQL.CreateConstants("2"),
                                                                            OOQL.CreateProperty("A.MA_LQ"))), "LQ")),
                                                     (Formulas.Case(null, OOQL.CreateProperty("A.MI_RQL"),
                                                                    OOQL.CreateCaseArray(
                                                                        OOQL.CreateCaseItem(
                                                                            OOQL.CreateProperty("B.DEFECT_CLASS") == OOQL.CreateConstants("1"),
                                                                            OOQL.CreateProperty("A.CR_RQL")),
                                                                        OOQL.CreateCaseItem(
                                                                            OOQL.CreateProperty("B.DEFECT_CLASS") == OOQL.CreateConstants("2"),
                                                                            OOQL.CreateProperty("A.MA_RQL"))), "RQL")),
                                                     OOQL.CreateProperty("A.INSPECTION_TIMES", "INSPECTION_TIMES"),
                                                     OOQL.CreateProperty("B.IL", "IL"),
                                                     OOQL.CreateProperty("B.DL", "DL"),
                                                     OOQL.CreateProperty("A.INSPECTION_METHOD", "INSPECTION_METHOD"),
                                                     OOQL.CreateProperty("A.AI_STANDARD", "AI_STANDARD"),
                                                     OOQL.CreateProperty("A.VI_STANDARD", "VI_STANDARD"),
                                                     OOQL.CreateProperty("A.CUSTOM_STANDARD_ID", "CUSTOM_STANDARD_ID"),
                                                     OOQL.CreateProperty("B.DEFECT_CLASS", "DEFECT_CLASS"),
                                                     OOQL.CreateProperty("A.INSPECTION_PLAN_ID", "INSPECTION_PLAN_ID"),
                                                     OOQL.CreateProperty("B.INSPECTION_ITEM_ID", "INSPECTION_ITEM_ID"),
                                                     OOQL.CreateProperty("A.MODE", "MODE"))
                                         .From("INSPECTION_PLAN", "A")
                                         .LeftJoin("INSPECTION_PLAN.INSPECTION_PLAN_D", "B")
                                         .On(OOQL.CreateProperty("A.INSPECTION_PLAN_ID") == OOQL.CreateProperty("B.INSPECTION_PLAN_ID"))
                                         .Where(OOQL.AuthFilter("INSPECTION_PLAN", "A") &
                                                OOQL.CreateProperty("A.INSPECTION_PLAN_ID") == OOQL.CreateConstants(paraInspectionPlanId)
                                                & OOQL.CreateProperty("B.INSPECTION_ITEM_ID") == OOQL.CreateConstants(paraInspectionItemId));
            DependencyObjectCollection coll = querySrv.ExecuteDependencyObject(node);

            if (coll != null && coll.Count > 0)
            {
                queryPlan = coll[0];
            }

            if (queryPlan == null)
            {
                return(null);
            }
            //6.2	根据抽样标准call不同的服务
            //6.2.1	全检
            DependencyObject result;

            if (queryPlan["INSPECTION_METHOD"].ToInt32() == 2)
            {
                return(null);
            }
            INumberedSampleTestService numberedSampleTestService = GetService <INumberedSampleTestService>("AI_STANDARD");

            if (queryPlan["AI_STANDARD"].Equals("1") || queryPlan["AI_STANDARD"].Equals("4"))
            {
                result = numberedSampleTestService.GetNumberStandard(paraQty, paraDegree, queryPlan["IL"].ToString(),
                                                                     queryPlan["AQL"].ToString(), queryPlan["INSPECTION_TIMES"].ToString());
            }
            else if (queryPlan["AI_STANDARD"].Equals("2"))
            {
                if (queryPlan["MODE"].Equals("1"))
                {
                    result = numberedSampleTestService.GetNumberStandard(paraQty, queryPlan["LQ"].ToString(),
                                                                         queryPlan["INSPECTION_TIMES"].ToString());
                }
                else
                {
                    result = numberedSampleTestService.GetNumberStandard(paraQty, queryPlan["LQ"].ToString(),
                                                                         queryPlan["INSPECTION_TIMES"].ToString(), queryPlan["IL"].ToString());
                }
            }
            else if (queryPlan["AI_STANDARD"].Equals("0"))
            {
                result = numberedSampleTestService.GetNumberStandard(queryPlan["DL"].ToString(),
                                                                     queryPlan["RQL"].ToString());
            }
            else
            {
                return(null);
            }

            //6.2.4	抽检GB2829(暂不实现)

            //6.2.5	抽检自定义
            if (!Maths.IsEmpty(queryPlan["CUSTOM_STANDARD_ID"]))
            {
                ICustomTestService customTestService = GetService <ICustomTestService>("CUSTOM_STANDARD");
                DependencyObject   obj = customTestService.GetCustomStandard(queryPlan["CUSTOM_STANDARD_ID"], paraQty);
                result["SAMPLE_SIZE_1ST"] = Convert.ToInt32(obj["SAMPLE_SIZE"].ToDecimal());
                result["AC_1ST"]          = Convert.ToInt32(obj["AC"].ToDecimal());
                result["RE_1ST"]          = Convert.ToInt32(obj["RE"].ToDecimal());
                result["Result"]          = obj["Result"].ToBoolean();
            }
            //6.2.6	回传处理,如果样本量大于送检量,则样本量等于送检数量 zhufei
            //(/  / / /)>送检量(paraQty)
            decimal sampleSize1St = result["SAMPLE_SIZE_1ST"].ToDecimal();
            decimal sampleSize2Nd = result["SAMPLE_SIZE_2ND"].ToDecimal();
            decimal sampleSize3Rd = result["SAMPLE_SIZE_3RD"].ToDecimal();
            decimal sampleSize4Th = result["SAMPLE_SIZE_4TH"].ToDecimal();
            decimal sampleSize5Th = result["SAMPLE_SIZE_5TH"].ToDecimal();

            if (result["SAMPLE_SIZE_1ST"].ToDecimal() > paraQty)
            {
                sampleSize1St = paraQty;
            }
            if (result["SAMPLE_SIZE_2ND"].ToDecimal() > paraQty)
            {
                sampleSize2Nd = paraQty;
            }
            if (result["SAMPLE_SIZE_3RD"].ToDecimal() > paraQty)
            {
                sampleSize3Rd = paraQty;
            }
            if (result["SAMPLE_SIZE_4TH"].ToDecimal() > paraQty)
            {
                sampleSize4Th = paraQty;
            }
            if (result["SAMPLE_SIZE_5TH"].ToDecimal() > paraQty)
            {
                sampleSize5Th = paraQty;
            }

            DependencyObjectType root01 = new DependencyObjectType("INSPECTION_QTY");

            root01.RegisterSimpleProperty("SAMPLE_SIZE_1ST", typeof(decimal));
            root01.RegisterSimpleProperty("AC_1ST", typeof(decimal));
            root01.RegisterSimpleProperty("RE_1ST", typeof(decimal));
            root01.RegisterSimpleProperty("SAMPLE_SIZE_2ND", typeof(decimal));
            root01.RegisterSimpleProperty("AC_2ND", typeof(decimal));
            root01.RegisterSimpleProperty("RE_2ND", typeof(decimal));
            root01.RegisterSimpleProperty("SAMPLE_SIZE_3RD", typeof(decimal));
            root01.RegisterSimpleProperty("AC_3RD", typeof(decimal));
            root01.RegisterSimpleProperty("RE_3RD", typeof(decimal));
            root01.RegisterSimpleProperty("SAMPLE_SIZE_4TH", typeof(decimal));
            root01.RegisterSimpleProperty("AC_4TH", typeof(decimal));
            root01.RegisterSimpleProperty("RE_4TH", typeof(decimal));
            root01.RegisterSimpleProperty("SAMPLE_SIZE_5TH", typeof(decimal));
            root01.RegisterSimpleProperty("AC_5TH", typeof(decimal));
            root01.RegisterSimpleProperty("RE_5TH", typeof(decimal));
            root01.RegisterSimpleProperty("Result", typeof(Boolean));
            root01.RegisterSimpleProperty("Msg", typeof(String));
            DependencyObject collection = new DependencyObject(root01);

            collection["SAMPLE_SIZE_1ST"] = sampleSize1St; //            result["SAMPLE_SIZE_1ST"];
            collection["AC_1ST"]          = result["AC_1ST"];
            collection["RE_1ST"]          = result["RE_1ST"];
            collection["SAMPLE_SIZE_2ND"] = sampleSize2Nd; // result["SAMPLE_SIZE_2ND"];
            collection["AC_2ND"]          = result["AC_2ND"];
            collection["RE_2ND"]          = result["RE_2ND"];
            collection["SAMPLE_SIZE_3RD"] = sampleSize3Rd; // result["SAMPLE_SIZE_3RD"];
            collection["AC_3RD"]          = result["AC_3RD"];
            collection["RE_3RD"]          = result["RE_3RD"];
            collection["SAMPLE_SIZE_4TH"] = sampleSize4Th; // result["SAMPLE_SIZE_4TH"];
            collection["AC_4TH"]          = result["AC_4TH"];
            collection["RE_4TH"]          = result["RE_4TH"];
            collection["SAMPLE_SIZE_5TH"] = sampleSize5Th; // result["SAMPLE_SIZE_5TH"];
            collection["AC_5TH"]          = result["AC_5TH"];
            collection["RE_5TH"]          = result["RE_5TH"];
            collection["Result"]          = result["Result"];
            collection["Msg"]             = result["Msg"];
            return(collection);
        }
        /// <summary>
        /// 创建临时表#Table_scan_detail
        /// </summary>
        /// <returns></returns>
        private void CreateTempTableScanDetail()
        {
            string tempName = "TEMP_SCAN_DETAIL" + "_" + DateTime.Now.ToString("HHmmssfff");
            DependencyObjectType    defaultType = new DependencyObjectType(tempName, new Attribute[] { });
            SimplePropertyAttribute tempAttr    = new SimplePropertyAttribute(GeneralDBType.String);

            #region 字段
            ////主键
            //defaultType.RegisterSimpleProperty("Table_scan_detail_ID", _businessTypeSrv.SimplePrimaryKeyType,
            //                                   Maths.GuidDefaultValue(), false,
            //                                   new Attribute[] { _businessTypeSrv.SimplePrimaryKey });
            //信息批号
            defaultType.RegisterSimpleProperty("info_lot_no", typeof(string),
                                               string.Empty, false, new Attribute[] { tempAttr });

            // 转入仓库
            defaultType.RegisterSimpleProperty("site_no", typeof(string),
                                               string.Empty, false, new Attribute[] { tempAttr });
            //条码编号
            defaultType.RegisterSimpleProperty("barcode_no", typeof(string),
                                               string.Empty, false, new Attribute[] { tempAttr });

            //料件编号
            defaultType.RegisterSimpleProperty("item_no", _businessTypeSrv.SimpleItemCodeType,
                                               string.Empty, false, new Attribute[] { _businessTypeSrv.SimpleItemCode });

            // 产品特征
            defaultType.RegisterSimpleProperty("item_feature_no", _businessTypeSrv.SimpleItemFeatureType,
                                               string.Empty, false, new Attribute[] { _businessTypeSrv.SimpleItemFeature });

            // 仓库
            defaultType.RegisterSimpleProperty("warehouse_no", typeof(string),
                                               string.Empty, false, new Attribute[] { tempAttr });
            //库位
            defaultType.RegisterSimpleProperty("storage_spaces_no", typeof(string),
                                               string.Empty, false, new Attribute[] { tempAttr });
            //批号
            defaultType.RegisterSimpleProperty("lot_no", _businessTypeSrv.SimpleLotCodeType,
                                               string.Empty, false, new Attribute[] { _businessTypeSrv.SimpleLotCode });
            //拣货数量
            defaultType.RegisterSimpleProperty("picking_qty", _businessTypeSrv.SimpleQuantityType,
                                               0m, false, new Attribute[] { _businessTypeSrv.SimpleQuantity });
            //拣货单位
            defaultType.RegisterSimpleProperty("picking_unit_no", typeof(string), string.Empty, false, new Attribute[] { tempAttr });

            //单号
            defaultType.RegisterSimpleProperty("doc_no", _businessTypeSrv.SimpleDocNoType, string.Empty, false, new Attribute[] { _businessTypeSrv.SimpleDocNo });

            //来源序号
            tempAttr = new SimplePropertyAttribute(GeneralDBType.Int32);
            defaultType.RegisterSimpleProperty("seq", typeof(int), 0, false, new Attribute[] { tempAttr });


            #endregion

            _TEMP_SCAN_DETAIL = defaultType;

            _querySrv.CreateTempTable(defaultType);
        }
Esempio n. 25
0
        /// <summary>
        /// 存储所需修改IssueReceiptD的数据集合的临时表
        /// </summary>
        private IDataEntityType CreateIssueReceiptDTmpTable(IQueryService qrySrv)
        {
            string typeName = "Temp_UpdateIssueReceiptD_" + DateTime.Now.ToString("HHmmssfff");// 临时表表名的处理
            DependencyObjectType defaultType = new DependencyObjectType(typeName, new Attribute[] { });

            IBusinessTypeService    businessSrv        = this.GetServiceForThisTypeKey <IBusinessTypeService>();
            SimplePropertyAttribute simplePrimaryAttri = businessSrv.SimplePrimaryKey;
            SimplePropertyAttribute qtyAttri           = businessSrv.SimpleQuantity;
            SimplePropertyAttribute tempAttr;

            #region 字段
            //单号
            tempAttr = new SimplePropertyAttribute(GeneralDBType.String);
            defaultType.RegisterSimpleProperty("DOC_NO", typeof(string), string.Empty, false, new Attribute[] { tempAttr });
            //序号
            tempAttr = new SimplePropertyAttribute(GeneralDBType.Int32);
            defaultType.RegisterSimpleProperty("SequenceNumber", typeof(int), 0, false, new Attribute[] { tempAttr });
            //拣货数量  //该数量等价于规格中的picking_qty
            defaultType.RegisterSimpleProperty("ISSUE_RECEIPT_QTY", businessSrv.SimpleQuantityType, 0m, false, new Attribute[] { qtyAttri });
            //工厂编号
            tempAttr = new SimplePropertyAttribute(GeneralDBType.String);
            defaultType.RegisterSimpleProperty("PLANT_CODE", typeof(string), string.Empty, false, new Attribute[] { tempAttr });
            //品号
            defaultType.RegisterSimpleProperty("ITEM_CODE", businessSrv.SimpleItemCodeType, "", false, new Attribute[] { businessSrv.SimpleItemCode });
            //特征码
            defaultType.RegisterSimpleProperty("ITEM_FEATURE_CODE", businessSrv.SimpleItemFeatureType, "", false, new Attribute[] { businessSrv.SimpleItemFeature });
            tempAttr = new SimplePropertyAttribute(GeneralDBType.String);
            //单位编号
            defaultType.RegisterSimpleProperty("UNIT_CODE", typeof(string), "", false, new Attribute[] { tempAttr });
            //仓库编号
            defaultType.RegisterSimpleProperty("WAREHOUSE_CODE", typeof(string), "", false, new Attribute[] { tempAttr });
            //库位编号
            defaultType.RegisterSimpleProperty("BIN_CODE", typeof(string), "", false, new Attribute[] { tempAttr });
            //批号
            defaultType.RegisterSimpleProperty("LOT_CODE", businessSrv.SimpleLotCodeType, "", false, new Attribute[] { businessSrv.SimpleLotCode });
            //条码
            defaultType.RegisterSimpleProperty("BARCODE_NO", typeof(string), "", false, new Attribute[] { tempAttr });
            #endregion

            qrySrv.CreateTempTable(defaultType);

            return(defaultType);
        }