From 28addaa46cb97c20ad37e13eb10535de7b75e71c Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期三, 29 十一月 2023 19:29:43 +0800
Subject: [PATCH] 首次报工开始时间为工序开始时间

---
 service/task.go |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/service/task.go b/service/task.go
index d393b5f..7a9eb61 100644
--- a/service/task.go
+++ b/service/task.go
@@ -1,6 +1,7 @@
 package service
 
 import (
+	"apsClient/conf"
 	"apsClient/constvar"
 	"apsClient/model"
 	"apsClient/model/common"
@@ -131,9 +132,21 @@
 	return procedure, ecode.OK
 }
 
+func (slf TaskService) GetProcedureAndWorkOrder(procedureId uint) (procedure *model.Procedures, workOrder *model.Order, err error) {
+	procedure, err = model.NewProceduresSearch(nil).SetId(procedureId).First()
+	if err != nil {
+		return nil, nil, err
+	}
+	workOrder, err = model.NewOrderSearch(nil).SetWorkOrderId(procedure.WorkOrderID).First()
+	if err != nil {
+		return nil, nil, err
+	}
+	return procedure, workOrder, nil
+}
+
 func (slf TaskService) UpdateProcedureStatusAndChannel(db *gorm.DB, id uint, status model.ProcedureStatus, channel int32, processModelNumber string) error {
 	if status == model.ProcedureStatusFinished || status == model.ProcedureStatusWaitProcess {
-		ProgressCacheUnset(channel)
+		ProgressCacheUnset(conf.Conf.CurrentDeviceID, channel)
 	}
 
 	upMap := map[string]interface{}{"status": status}

--
Gitblit v1.8.0