1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- using System;
- using SqlSugar;
- using Infrastructure.Attribute;
- using ZR.Model;
- using ZR.Model.Dto;
- using ZR.Model.Models;
- using ZR.Repository;
- using ZR.Service.Business.IBusinessService;
- using System.Linq;
- namespace ZR.Service.Business
- {
- /// <summary>
- /// 接口管理/SAP关键件清单记录表Service业务层处理
- ///
- /// @author admin
- /// @date 2023-05-05
- /// </summary>
- [AppService(ServiceType = typeof(ISapBomRecordService), ServiceLifetime = LifeTime.Transient)]
- public class SapBomRecordService : BaseService<SapBomRecord>, ISapBomRecordService
- {
- #region 业务逻辑代码
- /// <summary>
- /// 查询接口管理/SAP关键件清单记录表列表
- /// </summary>
- /// <param name="parm"></param>
- /// <returns></returns>
- public PagedInfo<SapBomRecordDto> GetList(SapBomRecordQueryDto parm)
- {
- //开始拼装查询条件
- var predicate = Expressionable.Create<SapBomRecord>();
- //搜索条件查询语法参考Sqlsugar
- var response = Queryable()
- .Where(predicate.ToExpression())
- .ToPage<SapBomRecord, SapBomRecordDto>(parm);
- return response;
- }
- /// <summary>
- /// 添加接口管理/SAP关键件清单记录表
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public int AddSapBomRecord(SapBomRecord model)
- {
- return Add(model, true);
- }
- /// <summary>
- /// 修改接口管理/SAP关键件清单记录表
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public int UpdateSapBomRecord(SapBomRecord model)
- {
- //var response = Update(w => w.Id == model.Id, it => new SapBomRecord()
- //{
- // BomNo = model.BomNo,
- // EquipmentName = model.EquipmentName,
- // MakeBy = model.MakeBy,
- // MakeTime = model.MakeTime,
- // Category = model.Category,
- // MaterialCode = model.MaterialCode,
- // MaterialName = model.MaterialName,
- // MaterialSpec = model.MaterialSpec,
- // KeyFlag = model.KeyFlag,
- // Qty = model.Qty,
- // AssembleQty = model.AssembleQty,
- // Result = model.Result,
- // UpdateBy = model.UpdateBy,
- // UpdateTime = model.UpdateTime,
- // Remark = model.Remark,
- //});
- //return response;
- return Update(model, true);
- }
- /// <summary>
- /// 清空接口管理/SAP关键件清单记录表
- /// </summary>
- /// <returns></returns>
- public void TruncateSapBomRecord()
- {
- Truncate();
- }
- #endregion
- }
- }
|