|
@@ -0,0 +1,97 @@
|
|
|
+using Hotline.Api.Filter;
|
|
|
+using Hotline.Enterprise;
|
|
|
+using Hotline.Share.Dtos.Enterprise;
|
|
|
+using Hotline.Share.Dtos.Order;
|
|
|
+using Hotline.Share.Requests;
|
|
|
+using Microsoft.AspNetCore.Mvc;
|
|
|
+using XF.Domain.Repository;
|
|
|
+
|
|
|
+namespace Hotline.Api.Controllers
|
|
|
+{
|
|
|
+ public class EnterprisesController : BaseController
|
|
|
+ {
|
|
|
+ private readonly IEnterpriseService _enterpriseService;
|
|
|
+ private readonly IRepository<EnterpriseSpecialist> _enterpriseSpecialistRepository;
|
|
|
+
|
|
|
+ public EnterprisesController(
|
|
|
+ IEnterpriseService enterpriseService,
|
|
|
+ IRepository<EnterpriseSpecialist> enterpriseSpecialistRepository)
|
|
|
+ {
|
|
|
+ _enterpriseService = enterpriseService;
|
|
|
+ _enterpriseSpecialistRepository = enterpriseSpecialistRepository;
|
|
|
+ }
|
|
|
+
|
|
|
+ #region (宜宾)获取企业信息
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 获取企业信息(宜宾)
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("enterprise/list")]
|
|
|
+ [LogFilter("查询企业列表")]
|
|
|
+ public async Task<YbEnterprisePaged> QueryYbEnterprises([FromQuery] PagedKeywordRequest dto)
|
|
|
+ {
|
|
|
+ return await _enterpriseService.QueryYbEnterprisesAsync(dto.Keyword!, dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 泸州
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 批量新增企业专员
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("specialist-batch")]
|
|
|
+ public Task<EnterpriseSpecialist> AddSpecialists()
|
|
|
+ {
|
|
|
+ throw new NotImplementedException();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 批量删除企业专员
|
|
|
+ /// </summary>
|
|
|
+ [HttpDelete("specialist-batch/{id}")]
|
|
|
+ public Task RemoveSpecialists(string id)
|
|
|
+ {
|
|
|
+ //清除子元素
|
|
|
+ //then delete
|
|
|
+ throw new NotImplementedException();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 查询企业专员
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("specialists-tree")]
|
|
|
+ public Task<List<EnterpriseSpecialist>> QuerySpecialists()
|
|
|
+ {
|
|
|
+ return _enterpriseSpecialistRepository.Queryable()
|
|
|
+ .OrderBy(d=>d.Id)
|
|
|
+ .ToTreeAsync(d=>d.Children, it => it.ParentId, null);
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 查询企业专员工单
|
|
|
+ /// </summary>
|
|
|
+ [HttpGet("specialist/orders")]
|
|
|
+ public Task<IReadOnlyList<OrderDto>> QueryEnterpriseSpecialistOrders([FromQuery] QueryOrderDto dto)
|
|
|
+ {
|
|
|
+ throw new NotImplementedException();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 查询总数
|
|
|
+ /// </summary>
|
|
|
+ [HttpGet("specialist/orders/count")]
|
|
|
+ public Task<int> CountEnterpriseSpecialistOrders([FromQuery] QueryOrderDto dto)
|
|
|
+ {
|
|
|
+ throw new NotImplementedException();
|
|
|
+ }
|
|
|
+
|
|
|
+ //todo export
|
|
|
+
|
|
|
+ #endregion
|
|
|
+ }
|
|
|
+}
|