QaInspectRecordService.cs 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. using System;
  2. using SqlSugar;
  3. using Infrastructure.Attribute;
  4. using ZR.Model;
  5. using ZR.Model.Dto;
  6. using ZR.Model.Models;
  7. using ZR.Repository;
  8. using ZR.Service.Business.IBusinessService;
  9. using System.Linq;
  10. namespace ZR.Service.Business
  11. {
  12. /// <summary>
  13. /// 质检管理/质检记录表Service业务层处理
  14. ///
  15. /// @author admin
  16. /// @date 2023-05-05
  17. /// </summary>
  18. [AppService(ServiceType = typeof(IQaInspectRecordService), ServiceLifetime = LifeTime.Transient)]
  19. public class QaInspectRecordService : BaseService<QaInspectRecord>, IQaInspectRecordService
  20. {
  21. #region 业务逻辑代码
  22. /// <summary>
  23. /// 查询质检管理/质检记录表列表
  24. /// </summary>
  25. /// <param name="parm"></param>
  26. /// <returns></returns>
  27. public PagedInfo<QaInspectRecordDto> GetList(QaInspectRecordQueryDto parm)
  28. {
  29. //开始拼装查询条件
  30. var predicate = Expressionable.Create<QaInspectRecord>();
  31. //搜索条件查询语法参考Sqlsugar
  32. var response = Queryable()
  33. .Where(predicate.ToExpression())
  34. .ToPage<QaInspectRecord, QaInspectRecordDto>(parm);
  35. return response;
  36. }
  37. /// <summary>
  38. /// 添加质检管理/质检记录表
  39. /// </summary>
  40. /// <param name="model"></param>
  41. /// <returns></returns>
  42. public int AddQaInspectRecord(QaInspectRecord model)
  43. {
  44. return Add(model, true);
  45. }
  46. /// <summary>
  47. /// 修改质检管理/质检记录表
  48. /// </summary>
  49. /// <param name="model"></param>
  50. /// <returns></returns>
  51. public int UpdateQaInspectRecord(QaInspectRecord model)
  52. {
  53. //var response = Update(w => w.InspectId == model.InspectId, it => new QaInspectRecord()
  54. //{
  55. // InspectNo = model.InspectNo,
  56. // DeliverNo = model.DeliverNo,
  57. // BomNo = model.BomNo,
  58. // RowNo = model.RowNo,
  59. // Category = model.Category,
  60. // MaterialCode = model.MaterialCode,
  61. // MaterialName = model.MaterialName,
  62. // MaterialSpec = model.MaterialSpec,
  63. // KeyFlag = model.KeyFlag,
  64. // BnSnCode = model.BnSnCode,
  65. // Qty = model.Qty,
  66. // CheckQty = model.CheckQty,
  67. // InspectedBy = model.InspectedBy,
  68. // InspectTime = model.InspectTime,
  69. // Result = model.Result,
  70. // UpdateBy = model.UpdateBy,
  71. // UpdateTime = model.UpdateTime,
  72. // Remark = model.Remark,
  73. //});
  74. //return response;
  75. return Update(model, true);
  76. }
  77. /// <summary>
  78. /// 清空质检管理/质检记录表
  79. /// </summary>
  80. /// <returns></returns>
  81. public void TruncateQaInspectRecord()
  82. {
  83. Truncate();
  84. }
  85. #endregion
  86. }
  87. }