Пример #1
0
        //todo 改成支持多个Tab
        // 地址:GET api/mms/@(controller)/getnewrowid 预取得新的明细表的行号
        public string GetNewRowId(string type, string key, int qty = 1)
        {
            switch (type)
            {
            case "grid0":
                var service0 = new QMS_GoodsInspectionItemService();
                return(service0.GetNewKey("ID", "maxplus", qty, ParamQuery.Instance().AndWhere("ID", key, Cp.Equal)));

            default:
                return("");
            }
        }
Пример #2
0
        public string PostStorage(dynamic data)
        {
            string msg      = "";
            string BillCode = data["BillCode"];
            var    result   = new QMS_GoodsInspectionItemService().AuditBillCode(BillCode, out msg);
            //生成物料条码:外购件
            var QMS_GoodsCheckModel = new QMS_GoodsCheckService().GetModel(ParamQuery.Instance().AndWhere("BillCode", BillCode));

            if (QMS_GoodsCheckModel != null)
            {
                string InnerFactoryBatch = QMS_GoodsCheckModel.BatchCode;         //厂内批次
                string OuterFactoryBatch = QMS_GoodsCheckModel.OuterFactoryBatch; //厂外批次
                string InventoryCode     = QMS_GoodsCheckModel.InventoryCode;     //存货编码
                var    SysPartModel      = new SYS_PartService().GetModel(ParamQuery.Instance().AndWhere("InventoryCode", InventoryCode));
                if (SysPartModel != null)
                {
                    string InventoryName  = SysPartModel.InventoryName;
                    string PartCode       = SysPartModel.PartCode;
                    string PartName       = SysPartModel.PartName;
                    string PartFigureCode = SysPartModel.FigureCode;
                    //string CorrespondingBarcode = SysPartModel.CorrespondingBarcode; //无用字段

                    var SYS_MaterialBatchModel = new SYS_MaterialBatchService().GetModel(ParamQuery.Instance()
                                                                                         .AndWhere("PartCode", PartCode)
                                                                                         .AndWhere("InnerFactoryBatch", InnerFactoryBatch)
                                                                                         .AndWhere("OuterFactoryBatch", OuterFactoryBatch));

                    if (SYS_MaterialBatchModel == null)
                    {
                        var    model       = new SYS_MaterialBatchService();
                        string MateBarCode = model.CreateMateBarCode(0);
                        model.Insert(ParamInsert.Instance()
                                     .Insert("SYS_MaterialBatch")
                                     .Column("MateBarCode", MateBarCode)
                                     .Column("InventoryCode", InventoryCode)
                                     .Column("InventoryName", InventoryName)
                                     .Column("PartCode", PartCode)
                                     .Column("PartFigureCode", PartFigureCode)
                                     .Column("PartName", PartName)
                                     .Column("InnerFactoryBatch", InnerFactoryBatch)
                                     .Column("OuterFactoryBatch", OuterFactoryBatch));
                    }
                }
            }
            return(msg);
        }