新增质量模块(工艺执行书 / 样茧试缫)与报表中心
质量模块: - 11 张工艺执行书表:封面、试产、选剥茧(含混茧明细)、试缫与大样、煮茧(含分车间配温、副煮车间)、自动缫(含大样)、后缫 - 10 张样茧试缫表:原料小样/综合样主表 + 选茧、解舒、茧幅、切剖、清洁洁净、茧丝百回纤度 - 服务与接口、主控指针回写(列表 √ 标记)、封面编号自增、报表数据包 - 前端 8 张报表打印版式、7 类工艺单据与 6 类调查录入弹窗、字段驱动表单/表格组件 - 菜单种子新增「质量」目录,样茧子表增加 YjssType 判别列,避免原料小样与综合样自增 Id 重号串数据 报表中心: - 报表模板管理、锐浪 grhtml5 加载与预览、全屏设计面板、数据源 Provider(落丝记录、职工花名册) 其他:同步工作进度 1-11 文档、开发数据库快照、.gitignore 忽略运行日志目录
This commit is contained in:
@@ -0,0 +1,134 @@
|
||||
using F9WebAiTest.Application.Common;
|
||||
using F9WebAiTest.Application.Dtos.QC;
|
||||
using F9WebAiTest.Application.Services.QC;
|
||||
using F9WebAiTest.Domain.Entities.QC.Gyzxs;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace F9WebAiTest.Api.Controllers.QC;
|
||||
|
||||
/// <summary>
|
||||
/// 质量模块 —— 工艺执行书(对应 F9 生产\质量\工艺执行书)。
|
||||
/// 主列表按「庄口 + 年度」展示,每张子单据一个入口;保存子单据会联动主控表。
|
||||
/// </summary>
|
||||
[ApiController]
|
||||
[Route("api/qc/gyzxs")]
|
||||
[Authorize]
|
||||
public class GyzxsController : ControllerBase
|
||||
{
|
||||
private readonly IGyzxsService _svc;
|
||||
public GyzxsController(IGyzxsService svc) => _svc = svc;
|
||||
|
||||
// ---------- 主列表 ----------
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> GetPaged([FromQuery] int pageIndex = 1, [FromQuery] int pageSize = 20,
|
||||
[FromQuery] int year = 0, [FromQuery] string keyword = "")
|
||||
=> Ok(ApiResult<PageResult<GyzxsDocVersionDto>>.Ok(await _svc.GetDocVersionPagedAsync(pageIndex, pageSize, year, keyword)));
|
||||
|
||||
[HttpPost("version")]
|
||||
public async Task<IActionResult> CreateVersion([FromQuery] long gyzkId)
|
||||
{
|
||||
try { return Ok(ApiResult<GyzxsDocVersionDto>.Ok(await _svc.CreateDocVersionAsync(gyzkId), "创建成功")); }
|
||||
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
||||
}
|
||||
|
||||
[HttpDelete("version/{id}")]
|
||||
public async Task<IActionResult> DeleteVersion(long id)
|
||||
{
|
||||
try { await _svc.DeleteDocVersionAsync(id); return Ok(ApiResult<object>.Ok(null, "删除成功")); }
|
||||
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
||||
}
|
||||
|
||||
// ---------- 封面 ----------
|
||||
[HttpGet("fengmian")]
|
||||
public async Task<IActionResult> GetFengMian([FromQuery] long gyzkId)
|
||||
=> Ok(ApiResult<GyzxsFengMian>.Ok(await _svc.GetFengMianAsync(gyzkId)));
|
||||
|
||||
[HttpPost("fengmian")]
|
||||
public async Task<IActionResult> SaveFengMian([FromBody] GyzxsFengMian dto)
|
||||
{
|
||||
try { return Ok(ApiResult<bool>.Ok(await _svc.SaveFengMianAsync(dto), "保存成功")); }
|
||||
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
||||
}
|
||||
|
||||
// ---------- 试产(试缫工艺单) ----------
|
||||
[HttpGet("shichan")]
|
||||
public async Task<IActionResult> GetShichan([FromQuery] long gyzkId, [FromQuery] string guige = "")
|
||||
=> Ok(ApiResult<GyzxsShichan>.Ok(await _svc.GetShichanAsync(gyzkId, guige)));
|
||||
|
||||
[HttpPost("shichan")]
|
||||
public async Task<IActionResult> SaveShichan([FromBody] GyzxsShichan dto)
|
||||
{
|
||||
try { return Ok(ApiResult<bool>.Ok(await _svc.SaveShichanAsync(dto), "保存成功")); }
|
||||
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
||||
}
|
||||
|
||||
// ---------- 混剥选茧 ----------
|
||||
[HttpGet("xbj")]
|
||||
public async Task<IActionResult> GetXbj([FromQuery] long gyzkId)
|
||||
=> Ok(ApiResult<GyzxsXbjDto>.Ok(await _svc.GetXbjAsync(gyzkId)));
|
||||
|
||||
[HttpPost("xbj")]
|
||||
public async Task<IActionResult> SaveXbj([FromBody] GyzxsXbjDto dto)
|
||||
{
|
||||
try { return Ok(ApiResult<bool>.Ok(await _svc.SaveXbjAsync(dto), "保存成功")); }
|
||||
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
||||
}
|
||||
|
||||
// ---------- 试缫与大样 ----------
|
||||
[HttpGet("ssdy")]
|
||||
public async Task<IActionResult> GetXbjSsDy([FromQuery] long gyzkId, [FromQuery] string guige = "")
|
||||
=> Ok(ApiResult<GyzxsXbjSsDy>.Ok(await _svc.GetXbjSsDyAsync(gyzkId, guige)));
|
||||
|
||||
[HttpPost("ssdy")]
|
||||
public async Task<IActionResult> SaveXbjSsDy([FromBody] GyzxsXbjSsDy dto)
|
||||
{
|
||||
try { return Ok(ApiResult<bool>.Ok(await _svc.SaveXbjSsDyAsync(dto), "保存成功")); }
|
||||
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
||||
}
|
||||
|
||||
// ---------- 煮茧 ----------
|
||||
[HttpGet("zhujian")]
|
||||
public async Task<IActionResult> GetZhuJian([FromQuery] long gyzkId)
|
||||
=> Ok(ApiResult<GyzxsZhuJianDto>.Ok(await _svc.GetZhuJianAsync(gyzkId)));
|
||||
|
||||
[HttpPost("zhujian")]
|
||||
public async Task<IActionResult> SaveZhuJian([FromBody] GyzxsZhuJianDto dto)
|
||||
{
|
||||
try { return Ok(ApiResult<bool>.Ok(await _svc.SaveZhuJianAsync(dto), "保存成功")); }
|
||||
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
||||
}
|
||||
|
||||
// ---------- 自动缫 ----------
|
||||
[HttpGet("zds")]
|
||||
public async Task<IActionResult> GetZds([FromQuery] long gyzkId, [FromQuery] string guige = "")
|
||||
=> Ok(ApiResult<GyzxsZdsDto>.Ok(await _svc.GetZdsAsync(gyzkId, guige)));
|
||||
|
||||
[HttpPost("zds")]
|
||||
public async Task<IActionResult> SaveZds([FromBody] GyzxsZdsDto dto)
|
||||
{
|
||||
try { return Ok(ApiResult<bool>.Ok(await _svc.SaveZdsAsync(dto), "保存成功")); }
|
||||
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
||||
}
|
||||
|
||||
// ---------- 后缫(工艺执行书) ----------
|
||||
[HttpGet("hs")]
|
||||
public async Task<IActionResult> GetHs([FromQuery] long gyzkId, [FromQuery] string guige = "")
|
||||
=> Ok(ApiResult<GyzxsHs>.Ok(await _svc.GetHsAsync(gyzkId, guige)));
|
||||
|
||||
[HttpPost("hs")]
|
||||
public async Task<IActionResult> SaveHs([FromBody] GyzxsHs dto)
|
||||
{
|
||||
try { return Ok(ApiResult<bool>.Ok(await _svc.SaveHsAsync(dto), "保存成功")); }
|
||||
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
||||
}
|
||||
|
||||
// ---------- 报表数据 ----------
|
||||
/// <summary>报表数据(type: fengmian / gyzxs / xbj / shichan / ssdy / zhujian / zds / zdsdy)</summary>
|
||||
[HttpGet("print/{type}")]
|
||||
public async Task<IActionResult> GetPrintData(string type, [FromQuery] long gyzkId, [FromQuery] string guige = "")
|
||||
{
|
||||
try { return Ok(ApiResult<GyzxsPrintDto>.Ok(await _svc.GetPrintDataAsync(type, gyzkId, guige))); }
|
||||
catch (ServiceException ex) { return StatusCode(ex.Code, ApiResult<object>.Fail(ex.Message, ex.Code)); }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
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)));
|
||||
}
|
||||
Reference in New Issue
Block a user