|
@@ -45,6 +45,8 @@ namespace OASystem.API.Controllers
|
|
|
private readonly TourClientListRepository _tourClientListRep;
|
|
|
private readonly DelegationInfoRepository _delegationInfoRep;
|
|
|
private readonly TranslatorLibraryRepository _translatorRep;
|
|
|
+ private readonly MediaSuppliersRepository _mediaSupplierRep;
|
|
|
+ private readonly List<int> _portIds;
|
|
|
|
|
|
public ResourceController(
|
|
|
IMapper mapper,
|
|
@@ -65,7 +67,8 @@ namespace OASystem.API.Controllers
|
|
|
TicketBlackCodeRepository ticketBlackCodeRep,
|
|
|
TourClientListRepository tourClientListRep,
|
|
|
DelegationInfoRepository delegationInfoRep,
|
|
|
- TranslatorLibraryRepository translatorRep
|
|
|
+ TranslatorLibraryRepository translatorRep,
|
|
|
+ MediaSuppliersRepository mediaSupplierRep
|
|
|
)
|
|
|
{
|
|
|
_mapper = mapper;
|
|
@@ -87,9 +90,10 @@ namespace OASystem.API.Controllers
|
|
|
_tourClientListRep = tourClientListRep;
|
|
|
_delegationInfoRep = delegationInfoRep;
|
|
|
_translatorRep = translatorRep;
|
|
|
+ _mediaSupplierRep = mediaSupplierRep;
|
|
|
+ _portIds = new List<int> { 1, 2, 3 };
|
|
|
}
|
|
|
|
|
|
-
|
|
|
#region 车公司资料板块
|
|
|
|
|
|
/// <summary>
|
|
@@ -4144,6 +4148,94 @@ WHERE
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
+
|
|
|
+ #region 策划部供应商资料
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 策划部供应商资料
|
|
|
+ /// Init
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="id"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> MediaSupplierInit()
|
|
|
+ {
|
|
|
+ return Ok(JsonView(await _mediaSupplierRep.Init()));
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 策划部供应商资料
|
|
|
+ /// Info
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> MediaSupplierInfo(MediaSupplierInfoDto dto)
|
|
|
+ {
|
|
|
+ if (!_portIds.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
+
|
|
|
+ if (dto.Id < 1) return Ok(JsonView(false, MsgTips.Port));
|
|
|
+
|
|
|
+ return Ok(JsonView(await _mediaSupplierRep.Info(dto)));
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 策划部供应商资料
|
|
|
+ /// 分页查询
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="id"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> MediaSupplierPageItem(MediaSupplierPageItemDto dto)
|
|
|
+ {
|
|
|
+ if (!_portIds.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
+
|
|
|
+ return Ok(JsonView(await _mediaSupplierRep.PageItem(dto)));
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 策划部供应商资料
|
|
|
+ /// 操作(添加 Or 编辑)
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> MediaSupplierOp(MediaSupplierAddOrEditDto dto)
|
|
|
+ {
|
|
|
+ var result = new JsonView() { Code = 400, Msg = "操作失败" };
|
|
|
+ var userId = dto.CurrUserId;
|
|
|
+ if (!_portIds.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
+
|
|
|
+ if (userId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
+
|
|
|
+ return Ok(JsonView(await _mediaSupplierRep.AddOrEdit(dto)));
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 策划部供应商资料
|
|
|
+ /// 删除
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> MediaSupplierSoftDel(MediaSupplierSoftDelDto dto)
|
|
|
+ {
|
|
|
+ var result = new JsonView() { Code = 400, Msg = "操作失败" };
|
|
|
+ int userId = dto.CurrUserId, id = dto.Id;
|
|
|
+ if (!_portIds.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
+
|
|
|
+ if (userId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
+ if (id < 1) return Ok(JsonView(false, MsgTips.Id));
|
|
|
+
|
|
|
+ return Ok(JsonView(await _mediaSupplierRep.SoftDel(dto)));
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
}
|
|
|
}
|
|
|
|