1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- 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>
- /// 质检管理/质检记录表Service业务层处理
- ///
- /// @author admin
- /// @date 2023-05-05
- /// </summary>
- [AppService(ServiceType = typeof(IQaInspectRecordService), ServiceLifetime = LifeTime.Transient)]
- public class QaInspectRecordService : BaseService<QaInspectRecord>, IQaInspectRecordService
- {
- #region 业务逻辑代码
- /// <summary>
- /// 查询质检管理/质检记录表列表
- /// </summary>
- /// <param name="parm"></param>
- /// <returns></returns>
- public PagedInfo<QaInspectRecordDto> GetList(QaInspectRecordQueryDto parm)
- {
- //开始拼装查询条件
- var predicate = Expressionable.Create<QaInspectRecord>();
- //搜索条件查询语法参考Sqlsugar
- var response = Queryable()
- .Where(predicate.ToExpression())
- .ToPage<QaInspectRecord, QaInspectRecordDto>(parm);
- return response;
- }
- /// <summary>
- /// 添加质检管理/质检记录表
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public int AddQaInspectRecord(QaInspectRecord model)
- {
- return Add(model, true);
- }
- /// <summary>
- /// 修改质检管理/质检记录表
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public int UpdateQaInspectRecord(QaInspectRecord model)
- {
- //var response = Update(w => w.InspectId == model.InspectId, it => new QaInspectRecord()
- //{
- // InspectNo = model.InspectNo,
- // DeliverNo = model.DeliverNo,
- // BomNo = model.BomNo,
- // RowNo = model.RowNo,
- // Category = model.Category,
- // MaterialCode = model.MaterialCode,
- // MaterialName = model.MaterialName,
- // MaterialSpec = model.MaterialSpec,
- // KeyFlag = model.KeyFlag,
- // BnSnCode = model.BnSnCode,
- // Qty = model.Qty,
- // CheckQty = model.CheckQty,
- // InspectedBy = model.InspectedBy,
- // InspectTime = model.InspectTime,
- // Result = model.Result,
- // UpdateBy = model.UpdateBy,
- // UpdateTime = model.UpdateTime,
- // Remark = model.Remark,
- //});
- //return response;
- return Update(model, true);
- }
- /// <summary>
- /// 清空质检管理/质检记录表
- /// </summary>
- /// <returns></returns>
- public void TruncateQaInspectRecord()
- {
- Truncate();
- }
- #endregion
- }
- }
|