质量模块: - 11 张工艺执行书表:封面、试产、选剥茧(含混茧明细)、试缫与大样、煮茧(含分车间配温、副煮车间)、自动缫(含大样)、后缫 - 10 张样茧试缫表:原料小样/综合样主表 + 选茧、解舒、茧幅、切剖、清洁洁净、茧丝百回纤度 - 服务与接口、主控指针回写(列表 √ 标记)、封面编号自增、报表数据包 - 前端 8 张报表打印版式、7 类工艺单据与 6 类调查录入弹窗、字段驱动表单/表格组件 - 菜单种子新增「质量」目录,样茧子表增加 YjssType 判别列,避免原料小样与综合样自增 Id 重号串数据 报表中心: - 报表模板管理、锐浪 grhtml5 加载与预览、全屏设计面板、数据源 Provider(落丝记录、职工花名册) 其他:同步工作进度 1-11 文档、开发数据库快照、.gitignore 忽略运行日志目录
140 lines
6.3 KiB
C#
140 lines
6.3 KiB
C#
using F9WebAiTest.Application.Common;
|
|
using F9WebAiTest.Application.Dtos.QC;
|
|
using F9WebAiTest.Application.Services.QC;
|
|
using F9WebAiTest.Domain.Entities.QC.Yjss;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace F9WebAiTest.Api.Controllers.QC;
|
|
|
|
/// <summary>
|
|
/// 质量模块 —— 样茧试缫(对应 F9 生产\质量\样茧试缫)。
|
|
/// type: 1=原料小样 2=综合样。
|
|
/// </summary>
|
|
[ApiController]
|
|
[Route("api/qc/yjss")]
|
|
[Authorize]
|
|
public class YjssController : ControllerBase
|
|
{
|
|
private readonly IYjssService _svc;
|
|
public YjssController(IYjssService svc) => _svc = svc;
|
|
|
|
// ---------- 主列表 / 主表 ----------
|
|
[HttpGet]
|
|
public async Task<IActionResult> GetPaged([FromQuery] int pageIndex = 1, [FromQuery] int pageSize = 20,
|
|
[FromQuery] int type = 1, [FromQuery] int year = 0, [FromQuery] string keyword = "")
|
|
=> Ok(ApiResult<PageResult<YjssListItemDto>>.Ok(await _svc.GetPagedAsync(pageIndex, pageSize, type, year, keyword)));
|
|
|
|
[HttpPost("ylxy")]
|
|
public async Task<IActionResult> SaveYlxy([FromBody] YjssMainYlxy dto)
|
|
{
|
|
try { return Ok(ApiResult<YjssListItemDto>.Ok(await _svc.SaveYlxyAsync(dto), "保存成功")); }
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
|
|
[HttpPost("zhy")]
|
|
public async Task<IActionResult> SaveZhy([FromBody] YjssMainZhy dto)
|
|
{
|
|
try { return Ok(ApiResult<YjssListItemDto>.Ok(await _svc.SaveZhyAsync(dto), "保存成功")); }
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
|
|
[HttpDelete("{type}/{id}")]
|
|
public async Task<IActionResult> Delete(int type, long id)
|
|
{
|
|
try { await _svc.DeleteAsync(type, id); return Ok(ApiResult<object>.Ok(null, "删除成功")); }
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
|
|
// ---------- 选茧调查 ----------
|
|
[HttpGet("xjdc/{yjssId}")]
|
|
public async Task<IActionResult> GetXjdc(long yjssId, [FromQuery] int type = 1)
|
|
=> Ok(ApiResult<YjssDcXjdc>.Ok(await _svc.GetXjdcAsync(type, yjssId)));
|
|
|
|
[HttpPost("xjdc")]
|
|
public async Task<IActionResult> SaveXjdc([FromQuery] int type, [FromBody] YjssDcXjdc dto)
|
|
{
|
|
try { return Ok(ApiResult<bool>.Ok(await _svc.SaveXjdcAsync(type, dto), "保存成功")); }
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
|
|
// ---------- 解舒调查 ----------
|
|
[HttpGet("jsdc/{yjssId}")]
|
|
public async Task<IActionResult> GetJsdc(long yjssId, [FromQuery] int type = 1)
|
|
=> Ok(ApiResult<List<YjssDcJsdc>>.Ok(await _svc.GetJsdcAsync(type, yjssId)));
|
|
|
|
[HttpPost("jsdc")]
|
|
public async Task<IActionResult> SaveJsdc([FromQuery] int type, [FromBody] YjssDcJsdc dto)
|
|
{
|
|
try { return Ok(ApiResult<bool>.Ok(await _svc.SaveJsdcAsync(type, dto), "保存成功")); }
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
|
|
[HttpDelete("jsdc/{type}/{id}")]
|
|
public async Task<IActionResult> DeleteJsdc(int type, long id)
|
|
{
|
|
try { await _svc.DeleteJsdcAsync(type, id); return Ok(ApiResult<object>.Ok(null, "删除成功")); }
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
|
|
// ---------- 茧幅调查 ----------
|
|
[HttpGet("jfdc/{yjssId}")]
|
|
public async Task<IActionResult> GetJfdc(long yjssId, [FromQuery] int type = 1)
|
|
=> Ok(ApiResult<YjssJfdcDto>.Ok(await _svc.GetJfdcAsync(type, yjssId)));
|
|
|
|
[HttpPost("jfdc")]
|
|
public async Task<IActionResult> SaveJfdc([FromQuery] int type, [FromBody] YjssJfdcDto dto)
|
|
{
|
|
try { return Ok(ApiResult<bool>.Ok(await _svc.SaveJfdcAsync(type, dto), "保存成功")); }
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
|
|
// ---------- 切剖调查 ----------
|
|
[HttpGet("qpdc/{yjssId}")]
|
|
public async Task<IActionResult> GetQpdc(long yjssId, [FromQuery] int type = 1)
|
|
=> Ok(ApiResult<YjssDcQpdc>.Ok(await _svc.GetQpdcAsync(type, yjssId)));
|
|
|
|
[HttpPost("qpdc")]
|
|
public async Task<IActionResult> SaveQpdc([FromQuery] int type, [FromBody] YjssDcQpdc dto)
|
|
{
|
|
try { return Ok(ApiResult<bool>.Ok(await _svc.SaveQpdcAsync(type, dto), "保存成功")); }
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
|
|
// ---------- 清洁洁净 ----------
|
|
[HttpGet("qjjj/{yjssId}")]
|
|
public async Task<IActionResult> GetQjjj(long yjssId, [FromQuery] int type = 1)
|
|
=> Ok(ApiResult<YjssDcQjjj>.Ok(await _svc.GetQjjjAsync(type, yjssId)));
|
|
|
|
[HttpPost("qjjj")]
|
|
public async Task<IActionResult> SaveQjjj([FromQuery] int type, [FromBody] YjssDcQjjj dto)
|
|
{
|
|
try { return Ok(ApiResult<bool>.Ok(await _svc.SaveQjjjAsync(type, dto), "保存成功")); }
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
|
|
// ---------- 茧丝百回纤度 ----------
|
|
[HttpGet("jsbhxd/{yjssId}")]
|
|
public async Task<IActionResult> GetJsbhxd(long yjssId, [FromQuery] int type = 1)
|
|
=> Ok(ApiResult<YjssJsbhxdDto>.Ok(await _svc.GetJsbhxdAsync(type, yjssId)));
|
|
|
|
[HttpPost("jsbhxd")]
|
|
public async Task<IActionResult> SaveJsbhxd([FromQuery] int type, [FromBody] YjssJsbhxdDto dto)
|
|
{
|
|
try { return Ok(ApiResult<bool>.Ok(await _svc.SaveJsbhxdAsync(type, dto), "保存成功")); }
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
|
|
// ---------- 整页 / 报表 ----------
|
|
[HttpGet("full/{type}/{id}")]
|
|
public async Task<IActionResult> GetFull(int type, long id)
|
|
{
|
|
try { return Ok(ApiResult<YjssFullDto>.Ok(await _svc.GetFullAsync(type, id))); }
|
|
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
|
}
|
|
|
|
[HttpGet("jsdc-summary/{yjssId}")]
|
|
public async Task<IActionResult> GetJsdcSummary(long yjssId, [FromQuery] int type = 1)
|
|
=> Ok(ApiResult<Dictionary<string, object?>>.Ok(await _svc.GetJsdcSummaryAsync(type, yjssId)));
|
|
}
|