using System; using SqlSugar; using Infrastructure.Attribute; using Infrastructure.Extensions; using DOAN.Model; using DOAN.Model.Dto; using DOAN.Model.DW_production_trace.ODS.U01.Dto; using DOAN.Service.DwProductionTrace.U01.ISevice; using DOAN.Repository; using System.Linq; using DOAN.Model.DW_production_trace.ODS.U01; namespace DOAN.Service.DwProductionTrace.U01; /// /// Service业务层处理 /// [AppService(ServiceType = typeof(IProductdatatableService), ServiceLifetime = LifeTime.Transient)] public class ProductdatatableService : BaseService, IProductdatatableService { /// /// 查询列表 /// /// /// public PagedInfo GetList(ProductdatatableQueryDto parm) { var predicate = Expressionable.Create(); var response = Queryable() .Where(predicate.ToExpression()) .OrderByDescending(it=>it.Fdate) .ToPage(parm); return response; } /// /// 获取详情 /// /// /// public Productdatatable GetInfo(int Id) { var response = Queryable() .Where(x => x.Id == Id) .First(); return response; } /// /// 添加 /// /// /// public Productdatatable AddProductdatatable(Productdatatable model) { return Context.Insertable(model).ExecuteReturnEntity(); } /// /// 修改 /// /// /// public int UpdateProductdatatable(Productdatatable model) { //var response = Update(w => w.Id == model.Id, it => new Productdatatable() //{ // Fyear = model.Fyear, // Fweek = model.Fweek, // Fdate = model.Fdate, // Ftime = model.Ftime, // Equipmentno = model.Equipmentno, // Workingstation = model.Workingstation, // Partno = model.Partno, // Processno = model.Processno, // QrCode = model.QrCode, // Fbatchno = model.Fbatchno, // Status = model.Status, // A1 = model.A1, // A2 = model.A2, // A3 = model.A3, // A4 = model.A4, // A5 = model.A5, // A6 = model.A6, // A7 = model.A7, // A8 = model.A8, // A9 = model.A9, // A10 = model.A10, // A11 = model.A11, // A12 = model.A12, // A13 = model.A13, // A14 = model.A14, // A15 = model.A15, // A16 = model.A16, // A17 = model.A17, // A18 = model.A18, // A19 = model.A19, // A20 = model.A20, // A21 = model.A21, // A22 = model.A22, // A23 = model.A23, // A24 = model.A24, // A25 = model.A25, // A26 = model.A26, // A27 = model.A27, // A28 = model.A28, // A29 = model.A29, // A30 = model.A30, // A31 = model.A31, // A32 = model.A32, // A33 = model.A33, // A34 = model.A34, // A35 = model.A35, // A36 = model.A36, // A37 = model.A37, // A38 = model.A38, // A39 = model.A39, // A40 = model.A40, // A41 = model.A41, // A42 = model.A42, // A43 = model.A43, // A44 = model.A44, // A45 = model.A45, // A46 = model.A46, // A47 = model.A47, // A48 = model.A48, // A49 = model.A49, // A50 = model.A50, // A51 = model.A51, // A52 = model.A52, // A53 = model.A53, // A54 = model.A54, // A55 = model.A55, // A56 = model.A56, // A57 = model.A57, // A58 = model.A58, // A59 = model.A59, // A60 = model.A60, // Ftest = model.Ftest, // Finsertdate = model.Finsertdate, // Flag = model.Flag, // Sqltime = model.Sqltime, //}); //return response; return Update(model, true); } }