Commit Graph

38 Commits (be8d8c323e675987c830a6c8f12c019f268998fe)

Author SHA1 Message Date
haoliang be8d8c323e 产量报表后端:支持机床多选、程序名多值、跨页面联动MachineIds/ProgramNames字段 1 month ago
haoliang 287281e7b3 新增API端点 GET /api/admin/machine/{id}/latest-tags:从log_collect_raw.raw_json解析最新采集数据,提取6个Tag各带独立采集时间返回;补全三维度产量报表接口定义和实现 1 month ago
haoliang 56f00f4558 新增产量报表三维度API端点(机床/员工/程序各含summary+list),从cnc_production_segment实时计算 1 month ago
haoliang a781dfabb8 新增仪表盘API端点:NC程序产量排行TOP10和NC程序产量分布(饼图数据) 1 month ago
haoliang 54910626b1 采集服务产量统计全流程测试验证:DB Schema同步、品牌映射修正、采集/模拟器代码修改、10场景测试全通过 1 month ago
haoliang 4d5cdeafe8 升级log4net 2.0.15→3.3.1 修复GHSA-4f7c-pmjv-c25w安全漏洞 1 month ago
haoliang bdf0e6b085 WebAPI增加log4net错误日志:GlobalExceptionFilter记录异常堆栈到App_Data\logs 2 months ago
haoliang 3f1e998f8e 系统设置明文化+仪表盘apiKey数据库化+日志分类+安装脚本防闪退 2 months ago
haoliang f703f92098 完善采集日志功能:原始数据详情弹窗、周期详情弹窗、修复排行榜日期格式 2 months ago
haoliang 4366cf9347 修复仪表盘三个bug:采集状态精确区分5种+暂停恢复、产量结算保留实时值、车间平均产量排除停用机床 2 months ago
haoliang 1600570b60 仪表盘优化:修复采集服务状态判断、去掉切削总时、数字保留两位小数、产量排行增加排序和TOP N 2 months ago
haoliang 72cb43c493 feat: 模拟采集集成——后端SimulatorController(22端点代理转发)+前端总览/详情页+路由+侧边栏菜单+Mock数据 2 months ago
haoliang ccdfec31bb feat: 在线状态改为基于last_ping_time实时判断,删除is_online列;新增online_timeout配置项(默认300秒);全链路修改Repository/Service/Collector/测试 2 months ago
haoliang 78b7dfea19 fix: 移除跨库JOIN避免权限问题;修复raw端点参数默认值 2 months ago
haoliang c9cca32757 实现 D1-D2 数据回放:新增 ReplayService、ReplayController、ReplayDto,DI 注册,API 端点,预览与执行回放逻辑,基于现有 SQL 迁移。 2 months ago
haoliang e3f37d5433 feat: 实现采集分析引擎(AnalysisEngine)+ 后台管理API + 前端设计文档
- 新增 log_collect_analysis + log_collect_cycle 两张按月分区表DDL
- 完整实现 AnalysisEngine:9种分析类型检测、DB写入、异常告警联动
- 修改 CollectRecordWriter.WriteBatch 返回 rawLogId
- 集成 AnalysisEngine 到 CollectWorker 采集主流程
- 新增 CollectLogController 5个API端点(分析查询/详情/周期/原始日志)
- 新增 Entity/Enum/DTO/Repository/Service 全链路代码
- 修复子代理创建的文件:DTO命名空间、Repository方法名、SQL列映射、using引用
- 新增13-采集日志前端设计文档(索引+规范+页面)
- 全部5个主项目编译通过,0错误
2 months ago
haoliang 23eda3751f 新增采集日志服务接口 ICollectLogService、实现 CollectLogService、控制器 CollectLogController,并更新 API 文档 3.14 采集日志模块 2 months ago
haoliang e9802a195d feat(cnc-service): add Windows service status checker, integrate into dashboard status, enhance startup flow; stage4 plan initialized; add frontend typings and dashboard view updates; add test scaffold for WindowsServiceChecker 2 months ago
haoliang cb3a6071bd 修复管理后台4个Bug + 改进Ping逻辑
Bug1(告警中心分页不工作): AlertPage.vue添加watch监听page.page和page.pageSize变化触发loadData

Bug2(仪表盘按钮报错): DashboardPage.vue为刷新配置/停止采集/启动采集添加ElMessage成功提示,导入ElMessage

Bug3(设备详情页数据不对): MachineService四个方法从返回空数据改为查询实际数据
- GetStatus: 从Machine entity的last_*字段获取实时状态
- GetTodayProduction: 从cnc_daily_production或cnc_production_segment查今日产量
- GetProductionTrend: 从cnc_daily_production或segment查7天趋势
- GetCollectRecords: 从cnc_collect_record查最近20条采集记录
- IMachineRepository新增4个方法声明,MachineRepository实现SQL查询

Bug4(产量报表员工筛选不正确):
- DailyProductionRepository.GetList添加WorkerId过滤(通过cnc_worker_machine关联表)
- ProductionController.GetSummary扩展参数接受startDate/endDate/machineId/workerId
- IProductionService/ProductionService.GetSummary签名同步更新

Ping逻辑改进: CollectWorker从Ping采集URL主机改为Ping每台机床IP地址
- 新增PingAllMachines()并行Ping所有机床IP,逐台更新在线状态
- 新增PingHost()执行单次ICMP Ping(超时2秒)
- 移除旧的PingAddress()(Ping URL主机)和UpdateMachineOnlineStatus()(批量更新)
2 months ago
haoliang c2c4d15453 修复端到端测试发现的3个Bug
Bug1(中): 采集服务失败时记录实际HTTP状态码
- CollectWorker新增httpStatusCode变量,捕获响应状态码
- CollectRecordWriter.WriteBatch新增statusCode参数,失败时写入实际状态码(如500)
- ParseAndSave传入statusCode参数

Bug2(低): 模拟器Stop→Start端口冲突
- SimulatorServer.Start()复用已有HttpListener,不再重复创建
- 仅在_listener为null或未监听时才创建新HttpListener

Bug3(低): 新增手动触发日终汇总API
- CollectorApiServer新增 POST /api/collector/daily-summary 端点
- CollectorEngine新增 RunDailySummary(date) 公开方法
- DashboardController新增 POST /api/admin/collector/daily-summary 转发
2 months ago
haoliang 592ebfbe08 修复采集服务启动后仪表盘状态不刷新的问题
根因:CollectorEngine.Start()不立即写心跳,仪表盘读心跳表仍显示stopped
修复:Start()中_isRunning=true后立即WriteHeartbeat('running')
附带:ForwardToCollector连接失败时返回错误码(code=50001)而非成功
2 months ago
haoliang 7354ae1641 修复仪表盘6个数据问题+补充测试规范图表维度
1. 最新告警:修复createdAt映射(snake_case→PascalCase),补齐alertType/machineName/title/isResolved字段
2. 机床状态分布:从原始group-by改为返回{online,offline,disabled}结构
3. 产量趋势:Controller包装为{items:[]}格式
4. 机床排行:补齐rank/program/status字段
5. 工人排行:补齐rank/machineCount/totalQuantity字段
6. 测试规范:新增维度3.1图表验证,扩展仪表盘速查表维度覆盖(1,2,3,3.1,5,6,9,12,17,20),新增反模式第14条
2 months ago
haoliang 9a667e5a62 添加采集服务控制API:启动、停止、刷新配置,转发到CncCollector 5800端口 2 months ago
haoliang 45cb84c08d 修复采集成功率计算bug、添加IIS localhost绑定和Vite proxy配置
- DashboardRepository: 采集成功率改用 log_collect_raw 的成功/失败比率计算(修复-800%的bug)
- Web.config: 添加 runAllManagedModulesForAllRequests=true 使API路由生效
- Vite: 添加/api代理到IIS后端(127.0.0.1),前端显示真实数据
- 测试脚本: 阶段6指定原端口重启避免URL不同步,添加仪表盘API验证
2 months ago
haoliang b76f1acc55 新增三模块批量删除API+采集地址启用停用+安装测试脚本 2 months ago
haoliang 71f8e7fbc7 修复机床排行machineId缺失+清理gitignore(移除publish/tools/dll/测试报告) 2 months ago
haoliang 3e7c34c52f 修复设备详情关联名称为空(Bug6)+布尔字段类型(Bug7)+异常过滤器生产模式 2 months ago
haoliang 6522b2ae49 补齐操作日志导出端点(adjustment/export占位) 2 months ago
haoliang 126cecfa09 补齐产量报表2个端点(adjustment-history/export占位)+修复前端API路径参数 + 新增DTO + Repository方法 2 months ago
haoliang 1168b3c4ac 补齐员工管理4个端点(machines/production-today/production-trend/available-machines)+修复前端详情页API路径参数 + 新增4个DTO 2 months ago
haoliang 6fb571f565 补齐采集地址3个详情子端点(machines/collect-records/raw-json)+修复前端详情页API路径参数 + 新增3个DTO + DI注册 2 months ago
haoliang dfc18fabb5 设备管理联调:修复brandId缺失、batchToggle改逐个toggle、详情页添加4个子API端点
- 前端:新增/编辑机床时传递brandId字段
- 前端:启停切换改为逐个调用PUT /admin/machine/{id}/toggle
- 前端:详情页API调用从query参数改为RESTful路径参数
- 后端:新增4个详情页API(status/production-today/production-trend/collect-records)
- 后端:新增3个DTO(MachineTodayProdItem/MachineTrendItem/MachineCollectRecordItem)
- 后端:更新MachineStatusResponse字段以匹配前端展示需求
2 months ago
haoliang 32a7bf49d0 fix: 修复20个列表接口返回格式与Mock不一致问题,新增5.2.1 Mock数据结构对齐规范 2 months ago
haoliang a094e59ffc 修复API返回PascalCase导致前端取不到message的问题
- WebApiConfig: 添加CamelCasePropertyNamesContractResolver
- 后端JSON输出从 Code/Message/Data 改为 code/message/data
- 前端拦截器 res.message 现在能正确取到后端错误信息
2 months ago
haoliang b28a89f263 IIS部署联调修复:OWIN禁用+程序集绑定+SPA路由回退+错误详情输出
- Web.config: 禁用OWIN自动发现(owin:AutomaticAppStartup=false),添加MySqlConnector依赖的程序集绑定重定向
- Global.asax.cs: Application_BeginRequest实现/admin/路径的SPA路由回退(无需URL Rewrite模块)
- GlobalExceptionFilter: 输出完整异常堆栈+InnerException,便于联调定位问题
- request.ts: 错误提示直接显示后端返回的message,不再覆盖为固定文案
- vite.config.ts: base设为/admin/,静态资源路径正确指向/admin/assets/
2 months ago
haoliang 126154fc7b IIS部署准备:csproj输出到bin\ + 前端build输出到admin + 修复全部TS类型错误
- CncWebApi.csproj: OutputPath改为bin\,AppendTargetFrameworkToOutputPath=false
- .gitignore: 排除src/CncWebApi/admin/目录
- vite.config.ts: build.outDir指向../src/CncWebApi/admin
- deploy-admin.ps1: 一键编译后端+前端部署脚本
- request.ts: 类型安全封装,返回Promise<ApiResponse<T>>
- types/index.ts: 扩展Machine/Alert/OperationLog/ScreenCard/CollectAddress/MachineStatus字段
- 修复11个页面文件的TS类型错误(vue-tsc 0错误)
2 months ago
haoliang 03aaeb11c2 feat(webapi): CncWebApi完整实现 - 13控制器+DI+JWT认证,编译通过
- Controllers: 13个API控制器(Auth/Dashboard/Machine/Brand/CollectAddress/Worker/Production/Alert/Settings/Log/ScreenConfig/Screen/Option)
- Infrastructure: ServiceResolver(手动DI)+JwtAuthFilter(HMACSHA256签名验证)
- 路由: 属性路由覆盖,管理后台/api/admin/**+大屏/api/screen/**
- 认证: JwtAuthFilter标记admin接口,ScreenController免认证
- DI: WebApiConfig注册ServiceResolver,手动解析Repository+Service依赖链
- WorkshopRepository: 从CncRepository.Impl移入CncRepository/Impl统一管理
2 months ago
haoliang 0ba5cede73 feat: 搭建VS2017解决方案骨架(8项目+前端文件夹),编译通过0错误
- CncDataSystem.sln: 4层源码项目 + 4测试项目 + frontend解决方案文件夹
- CncModels: ApiResponse/PagedResult/PagedQuery/ErrorCode 基础类
- CncRepository: BaseRepository 双库连接管理(BusinessRepository/LogRepository)
- CncService: BusinessException 业务异常基类
- CncWebApi: WebApiConfig路由配置/GlobalExceptionFilter/HealthController/Web.config
- 测试项目: xUnit + Moq + Microsoft.NET.Test.Sdk
- NuGet: Dapper + MySqlConnector + Newtonsoft.Json + log4net + JWT
- 编译: dotnet build 8项目全部通过
2 months ago