feat: 新增拧紧待签任务集中签字功能
新增了巡检终端的拧紧待签任务聚合查询和批量审核签字接口,支持检验员对拧紧任务进行第二签;在权限系统中新增对应按钮权限,前端页面新增指标选择下拉和绩效报表的上机记录页签,同时完善相关帮助文档和配置项。
This commit is contained in:
@@ -203,7 +203,7 @@ func StationCheckinInternalHandler(svcCtx *svc.ServiceContext) http.HandlerFunc
|
||||
}
|
||||
}
|
||||
|
||||
// PerformanceExportHandler GET /performance/export 绩效报表导出(一个 xlsx 三个 sheet:按人/按工位/明细)
|
||||
// PerformanceExportHandler GET /performance/export 绩效报表导出(一个 xlsx 四个 sheet:按人/按工位/明细/上机记录)
|
||||
// 执行全项目统一导出时间硬规则:起止必填(默认近3个月)、间隔≤1年
|
||||
func PerformanceExportHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -233,8 +233,8 @@ func PerformanceExportHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
{"按工位", "byStation", []string{"工位", "完成数", "合格", "不合格", "累计作业时长(秒)", "平均作业时长(秒)", "效率(件/小时)"}, func(r *logic.WorkloadRow) []any {
|
||||
return []any{r.StationNo, r.DoneCount, r.OkCount, r.NgCount, r.TotalDurationSec, r.AvgDurationSec, r.Efficiency}
|
||||
}},
|
||||
{"明细", "detail", []string{"操作人", "工位", "日期", "工艺ID", "工艺名", "完成数", "合格", "不合格", "累计作业时长(秒)", "平均作业时长(秒)", "效率(件/小时)"}, func(r *logic.WorkloadRow) []any {
|
||||
return []any{r.Operator, r.StationNo, r.Date, r.FlowId, r.ProcessName, r.DoneCount, r.OkCount, r.NgCount, r.TotalDurationSec, r.AvgDurationSec, r.Efficiency}
|
||||
{"明细", "detail", []string{"操作人", "工单号", "工位", "日期", "工艺ID", "工艺名", "完成数", "合格", "不合格", "累计作业时长(秒)", "平均作业时长(秒)", "效率(件/小时)"}, func(r *logic.WorkloadRow) []any {
|
||||
return []any{r.Operator, r.OrderNo, r.StationNo, r.Date, r.FlowId, r.ProcessName, r.DoneCount, r.OkCount, r.NgCount, r.TotalDurationSec, r.AvgDurationSec, r.Efficiency}
|
||||
}},
|
||||
}
|
||||
for i, vw := range views {
|
||||
@@ -258,6 +258,26 @@ func PerformanceExportHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 第四个 sheet:上机记录(由开工签到+报工实绩推导,不受工单号筛选影响)
|
||||
if sess, ok := data["sessions"].(map[string]any); ok {
|
||||
if sessList, ok2 := sess["list"].([]logic.StationSessionRow); ok2 {
|
||||
sheet := "上机记录"
|
||||
f.NewSheet(sheet)
|
||||
headers := []string{"操作人", "工位", "日期", "上机时间(签到)", "下机时间(最后活动)", "在机时长(秒)", "加工件数", "效率(件/小时)"}
|
||||
for c, h := range headers {
|
||||
cell, _ := excelize.CoordinatesToCellName(c+1, 1)
|
||||
_ = f.SetCellValue(sheet, cell, h)
|
||||
}
|
||||
for rIdx, it := range sessList {
|
||||
vals := []any{it.Operator, it.StationNo, it.Date, it.CheckinAt, it.LastActiveAt, it.DurationSec, it.DoneCount, it.Efficiency}
|
||||
for c := range headers {
|
||||
cell, _ := excelize.CoordinatesToCellName(c+1, rIdx+2)
|
||||
_ = f.SetCellValue(sheet, cell, vals[c])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
w.Header().Set("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
||||
w.Header().Set("Content-Disposition", "attachment; filename*=UTF-8''"+url.PathEscape("绩效报表.xlsx"))
|
||||
_, _ = f.WriteTo(w)
|
||||
|
||||
Reference in New Issue
Block a user