using ProductionSystem_Log; using ProductionSystem_Model.DbModel; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ProductionSystem_Service { public class ProductStepService : DbContext { /// /// 新增产品步骤内容 /// /// /// public int AddProductStep(T_Product_Step t_Product_Step) { try { return db.Insertable(t_Product_Step).ExecuteCommand(); }catch (Exception ex) { LogHelper.Error(ex, "执行ProductStepService下AddProductStep时异常"); return -1; } } /// /// 查询最新一条记录 /// /// /// /// /// public T_Product_Step QueryLatestStep(string stepName,string equipmentName,string productType,string productCode) { return db.Queryable(). Where(m => m.StepName == stepName && m.EquipmentName == equipmentName && m.ProductType == productType) .Where(x=>x.ProductBarcode==productCode) .OrderByDescending(x=>x.CreateTime) .First(); } } }