|
@@ -157,6 +157,7 @@ public class OrderController : BaseController
|
|
|
private readonly IIndustryRepository _industryRepository;
|
|
|
private readonly IRepository<SystemDicData> _sysDicDataRepository;
|
|
|
private readonly IRepository<SystemOrganize> _systemOrganizeRepository;
|
|
|
+ private readonly IRepository<OrderComplement> _orderComplementRepository;
|
|
|
|
|
|
public OrderController(
|
|
|
IOrderDomainService orderDomainService,
|
|
@@ -229,7 +230,8 @@ public class OrderController : BaseController
|
|
|
IIndustryRepository industryRepository,
|
|
|
IOrderSnapshotApplication orderSnapshotApplication,
|
|
|
IRepository<SystemDicData> sysDicDataRepository,
|
|
|
- IRepository<SystemOrganize> systemOrganizeRepository)
|
|
|
+ IRepository<SystemOrganize> systemOrganizeRepository,
|
|
|
+ IRepository<OrderComplement> orderComplementRepository)
|
|
|
{
|
|
|
_orderDomainService = orderDomainService;
|
|
|
_orderRepository = orderRepository;
|
|
@@ -302,6 +304,7 @@ public class OrderController : BaseController
|
|
|
_orderSnapshotApplication = orderSnapshotApplication;
|
|
|
_sysDicDataRepository = sysDicDataRepository;
|
|
|
_systemOrganizeRepository = systemOrganizeRepository;
|
|
|
+ _orderComplementRepository = orderComplementRepository;
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
@@ -8945,4 +8948,37 @@ public class OrderController : BaseController
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
+
|
|
|
+ #region 添加补充
|
|
|
+ /// <summary>
|
|
|
+ /// 添加补充
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("add_order_complement")]
|
|
|
+ public async Task AddOrderComplement([FromBody] AddComplementDto dto)
|
|
|
+ {
|
|
|
+ if (dto == null)
|
|
|
+ throw UserFriendlyException.SameMessage("数据错误!");
|
|
|
+ if (string.IsNullOrEmpty(dto.Opinion))
|
|
|
+ throw UserFriendlyException.SameMessage("补充内容不能为空!");
|
|
|
+ if (dto.Opinion.Length > 2000)
|
|
|
+ throw UserFriendlyException.SameMessage("补充内容限制2000字!");
|
|
|
+ var data = await _orderDomainService.GetOrderAsync(dto.OrderId, cancellationToken: HttpContext.RequestAborted);
|
|
|
+ if (data == null)
|
|
|
+ throw UserFriendlyException.SameMessage("工单查询失败!");
|
|
|
+
|
|
|
+ OrderComplement complement = new OrderComplement()
|
|
|
+ {
|
|
|
+ OrderId = dto.OrderId,
|
|
|
+ Opinion = dto.Opinion,
|
|
|
+ SupplyName = _sessionContext.UserName,
|
|
|
+ SupplyTime = DateTime.Now,
|
|
|
+ No = data.No,
|
|
|
+ IsProComplement = false
|
|
|
+ };
|
|
|
+
|
|
|
+ await _orderComplementRepository.AddAsync(complement, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
}
|