Ejemplo n.º 1
0
        public string PostStorage(dynamic data)
        {
            string msg      = "";
            string BillCode = data["BillCode"];
            var    result   = new QMS_ProcessInspectionItemService().AuditBillCode(data["BillCode"].ToString(), out msg);
            //生成物料条码:自制件
            var QMS_ProcessInspectionModel = new QMS_ProcessInspectionService().GetModel(ParamQuery.Instance().AndWhere("BillCode", BillCode));

            if (QMS_ProcessInspectionModel != null)
            {
                string InnerFactoryBatch = QMS_ProcessInspectionModel.BatchCode;         //厂内批次
                string OuterFactoryBatch = QMS_ProcessInspectionModel.OuterFactoryBatch; //厂外批次

                string PartCode       = QMS_ProcessInspectionModel.PartCode;
                string PartName       = QMS_ProcessInspectionModel.PartName;
                string PartFigureCode = QMS_ProcessInspectionModel.partFigure;

                string ContractCode = QMS_ProcessInspectionModel.ContractCode;
                string ProductName  = QMS_ProcessInspectionModel.ProductName;
                int    ProductID    = new PMS_BN_ProjectDetailService().GetModel(ParamQuery.Instance().AndWhere("ProductName", ProductName)).ID;

                var ProcessBomModel = new PRS_Process_BOMService().GetModel(ParamQuery.Instance().AndWhere("PartCode", PartCode));
                if (ProcessBomModel != null)
                {
                    string InventoryCode = ProcessBomModel.InventoryCode; //存货编码
                    string InventoryName = ProcessBomModel.InventoryName; //存货名称

                    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(700000000000);
                        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)
                                     .Column("ContractCode", ContractCode)
                                     .Column("ProductID", ProductID));
                    }
                }
            }
            return(msg);
        }
Ejemplo n.º 2
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_ProcessInspectionItemService();
                return(service0.GetNewKey("ID", "maxplus", qty, ParamQuery.Instance().AndWhere("ID", key, Cp.Equal)));

            default:
                return("");
            }
        }