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
111 lines
3.8 KiB
C#
111 lines
3.8 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
using ZR.Admin.WebApi.Filters;
|
||
using ZR.Model.Business.Dto;
|
||
using ZR.Service.Business.IBusinessService;
|
||
|
||
//创建时间:2025-01-01
|
||
namespace ZR.Admin.WebApi.Controllers.Business
|
||
{
|
||
/// <summary>
|
||
/// 标石/杆号牌管理
|
||
/// </summary>
|
||
[Route("business/OdfMarkerPoles")]
|
||
public class OdfMarkerPolesController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 标石/杆号牌接口
|
||
/// </summary>
|
||
private readonly IOdfMarkerPolesService _OdfMarkerPolesService;
|
||
|
||
public OdfMarkerPolesController(IOdfMarkerPolesService OdfMarkerPolesService)
|
||
{
|
||
_OdfMarkerPolesService = OdfMarkerPolesService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 标石/杆号牌列表分页查询
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "odfmarkerpoles:list")]
|
||
public IActionResult GetList([FromQuery] OdfMarkerPolesQueryDto parm)
|
||
{
|
||
var deptId = HttpContext.GetDeptId();
|
||
var response = _OdfMarkerPolesService.GetList(parm, deptId);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 标石/杆号牌详情(含图片)
|
||
/// </summary>
|
||
/// <param name="id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{id}")]
|
||
[ActionPermissionFilter(Permission = "odfmarkerpoles:query")]
|
||
public IActionResult GetDetail(int id)
|
||
{
|
||
var response = _OdfMarkerPolesService.GetDetail(id);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 新增标石/杆号牌(图片已上传至COS,提交COS URL)
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost("add")]
|
||
[ActionPermissionFilter(Permission = "odfmarkerpoles:add")]
|
||
[Log(Title = "标石/杆号牌", BusinessType = BusinessType.INSERT)]
|
||
[ServiceFilter(typeof(OdfAuditLogFilter))]
|
||
public IActionResult Add([FromBody] OdfMarkerPoleAddDto dto)
|
||
{
|
||
dto.UserId = HttpContext.GetUId();
|
||
var deptId = HttpContext.GetDeptId();
|
||
var response = _OdfMarkerPolesService.Add(dto, deptId);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 编辑标石/杆号牌
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut("edit")]
|
||
[ActionPermissionFilter(Permission = "odfmarkerpoles:edit")]
|
||
[Log(Title = "标石/杆号牌", BusinessType = BusinessType.UPDATE)]
|
||
[ServiceFilter(typeof(OdfAuditLogFilter))]
|
||
public IActionResult Update([FromBody] OdfMarkerPoleEditDto dto)
|
||
{
|
||
var response = _OdfMarkerPolesService.Update(dto);
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除标石/杆号牌(支持单个/批量)
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpDelete("delete/{ids}")]
|
||
[ActionPermissionFilter(Permission = "odfmarkerpoles:delete")]
|
||
[Log(Title = "标石/杆号牌", BusinessType = BusinessType.DELETE)]
|
||
[ServiceFilter(typeof(OdfAuditLogFilter))]
|
||
public IActionResult Delete(string ids)
|
||
{
|
||
var idList = ids.Split(',', StringSplitOptions.RemoveEmptyEntries)
|
||
.Select(s => int.TryParse(s.Trim(), out var v) ? v : 0)
|
||
.Where(v => v > 0)
|
||
.ToList();
|
||
|
||
if (idList.Count == 0)
|
||
{
|
||
return ToResponse(ResultCode.FAIL, "请选择要删除的数据");
|
||
}
|
||
|
||
int total = 0;
|
||
foreach (var id in idList)
|
||
{
|
||
total += _OdfMarkerPolesService.Delete(id);
|
||
}
|
||
return ToResponse(total);
|
||
}
|
||
}
|
||
}
|