style(production): 优化代码格式和字段对齐
- 统一结构体字段的缩进和对齐格式 - 移除多余空行以提高代码可读性 - 标准化字段命名的一致性
This commit is contained in:
@@ -161,13 +161,12 @@ func ProcessStepsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// TorqueAuditHandler POST /torque/audit 拧紧记录审核签字
|
// TorqueAuditHandler POST /torque/audit 拧紧记录审核签字
|
||||||
func TorqueAuditHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
func TorqueAuditHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
var req struct {
|
var req struct {
|
||||||
RecordId int `json:"recordId"`
|
RecordId int `json:"recordId"`
|
||||||
Remark string `json:"remark"`
|
Remark string `json:"remark"`
|
||||||
}
|
}
|
||||||
if err := httpx.ParseJSON(r, &req); err != nil {
|
if err := httpx.ParseJSON(r, &req); err != nil {
|
||||||
httpx.BadRequest(w, "请求体解析失败")
|
httpx.BadRequest(w, "请求体解析失败")
|
||||||
@@ -202,4 +201,3 @@ func TorqueAuditLogHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
httpx.Ok(w, data)
|
httpx.Ok(w, data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -502,17 +502,17 @@ func (s *Service) ListWorkpieces(ctx context.Context, sn, orderNo string) ([]*en
|
|||||||
|
|
||||||
// InProcessItem 在制品(已进线未完工)视图项。跨天工件继续停留,日排产不重复排。
|
// InProcessItem 在制品(已进线未完工)视图项。跨天工件继续停留,日排产不重复排。
|
||||||
type InProcessItem struct {
|
type InProcessItem struct {
|
||||||
Sn string `json:"sn"`
|
Sn string `json:"sn"`
|
||||||
OrderNo string `json:"orderNo"`
|
OrderNo string `json:"orderNo"`
|
||||||
ProductCode string `json:"productCode"`
|
ProductCode string `json:"productCode"`
|
||||||
ProductName string `json:"productName"`
|
ProductName string `json:"productName"`
|
||||||
CurrentStation int `json:"currentStation"` // 0=上线位, 13=下线位, 其余为物理工位
|
CurrentStation int `json:"currentStation"` // 0=上线位, 13=下线位, 其余为物理工位
|
||||||
CurrentStationName string `json:"currentStationName"` // 工位显示名(上线位/下线位/装配X)
|
CurrentStationName string `json:"currentStationName"` // 工位显示名(上线位/下线位/装配X)
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
OnlineAt string `json:"onlineAt"`
|
OnlineAt string `json:"onlineAt"`
|
||||||
DwellSec int64 `json:"dwellSec"` // 停留时长(秒),自进线起算
|
DwellSec int64 `json:"dwellSec"` // 停留时长(秒),自进线起算
|
||||||
DoneSteps int `json:"doneSteps"`
|
DoneSteps int `json:"doneSteps"`
|
||||||
TotalSteps int `json:"totalSteps"`
|
TotalSteps int `json:"totalSteps"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// WorkpiecesInProcess 列出停在各工位、尚未完工的在制品(ONLINE/PROCESSING/REPAIR)。
|
// WorkpiecesInProcess 列出停在各工位、尚未完工的在制品(ONLINE/PROCESSING/REPAIR)。
|
||||||
@@ -588,17 +588,17 @@ func (s *Service) WorkpiecesInProcess(ctx context.Context, stationNo int, orderN
|
|||||||
stName = "下线位(虚拟)"
|
stName = "下线位(虚拟)"
|
||||||
}
|
}
|
||||||
out = append(out, InProcessItem{
|
out = append(out, InProcessItem{
|
||||||
Sn: wp.Sn,
|
Sn: wp.Sn,
|
||||||
OrderNo: wp.OrderNo,
|
OrderNo: wp.OrderNo,
|
||||||
ProductCode: code,
|
ProductCode: code,
|
||||||
ProductName: name,
|
ProductName: name,
|
||||||
CurrentStation: cur,
|
CurrentStation: cur,
|
||||||
CurrentStationName: stName,
|
CurrentStationName: stName,
|
||||||
Status: wp.Status,
|
Status: wp.Status,
|
||||||
OnlineAt: onlineAt,
|
OnlineAt: onlineAt,
|
||||||
DwellSec: dwell,
|
DwellSec: dwell,
|
||||||
DoneSteps: done,
|
DoneSteps: done,
|
||||||
TotalSteps: len(seq),
|
TotalSteps: len(seq),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
|
|||||||
Reference in New Issue
Block a user