All checks were successful
continuous-integration/drone/push Build is passing
- Add marker pole CRUD functionality with database tables (odf_marker_poles, odf_marker_pole_images) - Implement marker pole API endpoints and service layer with data isolation by department - Add UniApp pages for marker pole list, detail, and creation workflows - Add Vue management backend pages for marker pole and audit log management - Implement audit logging system via ActionFilter to track all business entity modifications - Extend search API to include marker poles in results alongside cables and faults - Add OdfAuditLogsController and service for querying audit trail data - Update optical box detail page with left-right frame color scheme (green-orange) - Add cable type page as entry point for marker poles and fault lists - Create database migration scripts for v1.2.0 schema and permissions - Add DeptDataScopeHelper for department-based data access control - Update MCP settings to disable SQL Server connection and fix formatting - Add marker pole service integration in UniApp with COS image upload support
130 lines
4.4 KiB
C#
130 lines
4.4 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
using ZR.Admin.WebApi.Filters;
|
||
using ZR.Model.Business;
|
||
using ZR.Model.Business.Dto;
|
||
using ZR.Service.Business.IBusinessService;
|
||
|
||
//创建时间:2025-09-21
|
||
namespace ZR.Admin.WebApi.Controllers.Business
|
||
{
|
||
/// <summary>
|
||
/// 光缆管理
|
||
/// </summary>
|
||
[Route("business/OdfCables")]
|
||
public class OdfCablesController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 光缆管理接口
|
||
/// </summary>
|
||
private readonly IOdfCablesService _OdfCablesService;
|
||
|
||
public OdfCablesController(IOdfCablesService OdfCablesService)
|
||
{
|
||
_OdfCablesService = OdfCablesService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询光缆列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "odfcables:list")]
|
||
public IActionResult GetList([FromQuery] OdfCablesQueryDto parm)
|
||
{
|
||
var deptId = HttpContext.GetDeptId();
|
||
var response = _OdfCablesService.GetList(parm, deptId);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 搜索光缆、故障和标石/杆号牌(限定公司范围)
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpGet("search")]
|
||
[ActionPermissionFilter(Permission = "odfcables:query")]
|
||
public IActionResult Search([FromQuery] long deptId, [FromQuery] string keyword)
|
||
{
|
||
var response = _OdfCablesService.Search(deptId, keyword);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 新增光缆
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "odfcables:add")]
|
||
[Log(Title = "光缆管理", BusinessType = BusinessType.INSERT)]
|
||
[ServiceFilter(typeof(OdfAuditLogFilter))]
|
||
public IActionResult Add([FromBody] OdfCables parm)
|
||
{
|
||
parm.CreatedAt = DateTime.Now;
|
||
parm.UpdatedAt = DateTime.Now;
|
||
var response = _OdfCablesService.Add(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 修改光缆
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "odfcables:edit")]
|
||
[Log(Title = "光缆管理", BusinessType = BusinessType.UPDATE)]
|
||
[ServiceFilter(typeof(OdfAuditLogFilter))]
|
||
public IActionResult Update([FromBody] OdfCables parm)
|
||
{
|
||
parm.UpdatedAt = DateTime.Now;
|
||
var response = _OdfCablesService.Update(parm);
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询光缆详情
|
||
/// </summary>
|
||
/// <param name="id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{id}")]
|
||
[ActionPermissionFilter(Permission = "odfcables:query")]
|
||
public IActionResult GetDetail(int id)
|
||
{
|
||
var response = _OdfCablesService.GetDetail(id);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除光缆
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost("delete/{id}")]
|
||
[ActionPermissionFilter(Permission = "odfcables:delete")]
|
||
[Log(Title = "光缆管理", BusinessType = BusinessType.DELETE)]
|
||
[ServiceFilter(typeof(OdfAuditLogFilter))]
|
||
public IActionResult Delete(int id)
|
||
{
|
||
var response = _OdfCablesService.Delete(id);
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 导出光缆列表
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[Log(Title = "光缆管理", BusinessType = BusinessType.EXPORT, IsSaveResponseData = false)]
|
||
[HttpGet("export")]
|
||
[ActionPermissionFilter(Permission = "odfcables:export")]
|
||
public IActionResult Export([FromQuery] OdfCablesQueryDto parm)
|
||
{
|
||
var deptId = HttpContext.GetDeptId();
|
||
var list = _OdfCablesService.ExportList(parm, deptId);
|
||
if (list == null || list.Result == null || list.Result.Count <= 0)
|
||
{
|
||
return ToResponse(ResultCode.FAIL, "没有要导出的数据");
|
||
}
|
||
var result = ExportExcelMini(list.Result, "光缆列表", "光缆列表");
|
||
return ExportExcel(result.Item2, result.Item1);
|
||
}
|
||
}
|
||
}
|