Files
yanpeng200212 a8890c81e9 新增质量模块(工艺执行书 / 样茧试缫)与报表中心
质量模块:
- 11 张工艺执行书表:封面、试产、选剥茧(含混茧明细)、试缫与大样、煮茧(含分车间配温、副煮车间)、自动缫(含大样)、后缫
- 10 张样茧试缫表:原料小样/综合样主表 + 选茧、解舒、茧幅、切剖、清洁洁净、茧丝百回纤度
- 服务与接口、主控指针回写(列表 √ 标记)、封面编号自增、报表数据包
- 前端 8 张报表打印版式、7 类工艺单据与 6 类调查录入弹窗、字段驱动表单/表格组件
- 菜单种子新增「质量」目录,样茧子表增加 YjssType 判别列,避免原料小样与综合样自增 Id 重号串数据

报表中心:
- 报表模板管理、锐浪 grhtml5 加载与预览、全屏设计面板、数据源 Provider(落丝记录、职工花名册)

其他:同步工作进度 1-11 文档、开发数据库快照、.gitignore 忽略运行日志目录
2026-10-22 10:30:37 +08:00

63 lines
2.5 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using F9WebAiTest.Application.Dtos.SYS.Reports;
using F9WebAiTest.Application.Interfaces.Repositories.SYS.Employees;
using MediatR;
namespace F9WebAiTest.Application.CQRS.SYS.Reports.Queries;
/// <summary>职工花名册报表数据查询(示例,对应 DsName = RepDt_Sys_Users)</summary>
public record GetEmployeeDirectoryRepQuery(long DepId, string Like) : IRequest<ReportDto_DataSource>;
public class GetEmployeeDirectoryRepQueryHandler : IRequestHandler<GetEmployeeDirectoryRepQuery, ReportDto_DataSource>
{
private readonly IEmployeeReadRepository _readRepository;
public GetEmployeeDirectoryRepQueryHandler(IEmployeeReadRepository readRepository)
{
_readRepository = readRepository;
}
public async Task<ReportDto_DataSource> Handle(GetEmployeeDirectoryRepQuery query, CancellationToken cancellationToken)
{
var dto = new ReportDto_DataSource
{
Report_Data = new Dictionary<string, ReportDataDto_Data>()
};
// 1. 通过仓储查询职工数据(部门含子部门)
var page = await _readRepository.GetPagedAsync(query.DepId, 0, null, null,
string.IsNullOrWhiteSpace(query.Like) ? "" : query.Like, 1, 1000);
// 2. 部门名称(查询条件展示用)
var depName = query.DepId > 0 ? await _readRepository.GetDepNameAsync(query.DepId) : "";
// 3. 明细数据:属性名须与 .grf 模板 DetailGrid.Recordset.Field 一致
var rows = new List<object>();
foreach (var e in page.Items)
{
rows.Add(new
{
EmployeeCode = e.Code ?? "",
EmployeeName = e.Name ?? "",
Gender = e.Gender ?? "",
DepName = e.DepName ?? "",
WorktypeName = e.WorktypeName ?? "",
Phone = e.Phone ?? "",
RuzhiDate = e.RuzhiDate?.ToString("yyyy-MM-dd") ?? ""
});
}
// 4. 报表参数(模板以 StaticBox 的 Parameter 属性引用)
var mainData = new ReportDataDto_Data { Field_Data = rows };
mainData.Parameter_Data = new
{
部门 = string.IsNullOrWhiteSpace(depName) ? "(全部)" : depName,
关键字 = string.IsNullOrWhiteSpace(query.Like) ? "(全部)" : query.Like,
记录数 = page.Total,
查询时间 = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
};
dto.Report_Data.Add("main", mainData);
return dto;
}
}