// Copyright (c) Shenyang Leading Edge Intelligent Technology Co., Ltd. All rights reserved.
|
|
|
|
package om
|
|
|
|
import (
|
|
"LAPP_ACURA_MOM_BACKEND/global"
|
|
"LAPP_ACURA_MOM_BACKEND/grmi"
|
|
meModel "LAPP_ACURA_MOM_BACKEND/models/me"
|
|
model "LAPP_ACURA_MOM_BACKEND/models/om"
|
|
"LAPP_ACURA_MOM_BACKEND/services/om/implments"
|
|
"github.com/go-xorm/xorm"
|
|
"time"
|
|
)
|
|
|
|
/******************************************************************************
|
|
*
|
|
* @Interface Name : SerialOrderService
|
|
*-----------------------------------------------------------------------------
|
|
*
|
|
* @Description : SerialOrder的服务接口
|
|
*
|
|
* @Author : 代码生成器创建
|
|
*
|
|
* @Date : 2021-10-22 14:06:37
|
|
*
|
|
******************************************************************************/
|
|
type SerialOrderService interface {
|
|
/******************************************************************************
|
|
*
|
|
* @Function Name : InsertOne
|
|
*-----------------------------------------------------------------------------
|
|
*
|
|
* @Description : 插入一条SerialOrder
|
|
*
|
|
* @Function Parameters : 当前访问人员信息
|
|
*
|
|
* @Function Parameters : 需要插入的SerialOrder
|
|
*
|
|
* @Return Value : 执行时发生的错误
|
|
*
|
|
* @Author : 代码生成器创建
|
|
*
|
|
* @Date : 2021-10-22 14:06:37
|
|
*
|
|
******************************************************************************/
|
|
InsertOne(*global.User, *model.SerialOrder) error
|
|
/******************************************************************************
|
|
*
|
|
* @Function Name : DeleteOne
|
|
*-----------------------------------------------------------------------------
|
|
*
|
|
* @Description : 删除指定键的SerialOrder
|
|
*
|
|
* @Function Parameters : 主键
|
|
*
|
|
* @Return Value : 执行时发生的错误
|
|
*
|
|
* @Author : 代码生成器创建
|
|
*
|
|
* @Date : 2021-10-22 14:06:37
|
|
*
|
|
******************************************************************************/
|
|
DeleteOne(*global.User, string) error
|
|
/******************************************************************************
|
|
*
|
|
* @Function Name : SelectOne
|
|
*-----------------------------------------------------------------------------
|
|
*
|
|
* @Description : 查找指定键的SerialOrder
|
|
*
|
|
* @Function Parameters : 主键
|
|
*
|
|
* @Return Value : 查找到的SerialOrder
|
|
*
|
|
* @Return Value : 执行时发生的错误
|
|
*
|
|
* @Author : 代码生成器创建
|
|
*
|
|
* @Date : 2021-10-22 14:06:37
|
|
*
|
|
******************************************************************************/
|
|
SelectOne(*global.User, string) (*model.SerialOrder, error)
|
|
/******************************************************************************
|
|
*
|
|
* @Function Name : UpdateOne
|
|
*-----------------------------------------------------------------------------
|
|
*
|
|
* @Description : 修改一条SerialOrder
|
|
*
|
|
* @Function Parameters : 当前访问人员信息
|
|
*
|
|
* @Function Parameters : 需要修改的SerialOrder
|
|
*
|
|
* @Return Value : 执行时发生的错误
|
|
*
|
|
* @Author : 代码生成器创建
|
|
*
|
|
* @Date : 2021-10-22 14:06:37
|
|
*
|
|
******************************************************************************/
|
|
UpdateOne(*global.User, *model.SerialOrder) error
|
|
/******************************************************************************
|
|
*
|
|
* @Function Name : Insert
|
|
*-----------------------------------------------------------------------------
|
|
*
|
|
* @Description : 插入多条SerialOrder
|
|
*
|
|
* @Function Parameters : 当前访问人员信息
|
|
*
|
|
* @Function Parameters : 需要插入的SerialOrder列表
|
|
*
|
|
* @Return Value : 执行时发生的错误
|
|
*
|
|
* @Author : 代码生成器创建
|
|
*
|
|
* @Date : 2021-10-22 14:06:37
|
|
*
|
|
******************************************************************************/
|
|
Insert(*global.User, *[]model.SerialOrder) error
|
|
/******************************************************************************
|
|
*
|
|
* @Function Name : Delete
|
|
*-----------------------------------------------------------------------------
|
|
*
|
|
* @Description : 删除多条SerialOrder
|
|
*
|
|
* @Function Parameters : 当前访问人员信息
|
|
*
|
|
* @Function Parameters : 需要删除的SerialOrder列表
|
|
*
|
|
* @Return Value : 执行时发生的错误
|
|
*
|
|
* @Author : 代码生成器创建
|
|
*
|
|
* @Date : 2021-10-22 14:06:37
|
|
*
|
|
******************************************************************************/
|
|
Delete(*global.User, *[]model.SerialOrder) error
|
|
/******************************************************************************
|
|
*
|
|
* @Function Name : Select
|
|
*-----------------------------------------------------------------------------
|
|
*
|
|
* @Description : 查询SerialOrder
|
|
*
|
|
* @Function Parameters : 当前访问人员信息
|
|
*
|
|
* @Function Parameters : 查询参数
|
|
*
|
|
* @Return Value : 查询结果
|
|
*
|
|
* @Return Value : 执行时发生的错误
|
|
*
|
|
* @Author : 代码生成器创建
|
|
*
|
|
* @Date : 2021-10-22 14:06:37
|
|
*
|
|
******************************************************************************/
|
|
Select(*global.User, map[string]string) ([]model.SerialOrder, error)
|
|
/******************************************************************************
|
|
*
|
|
* @Function Name : SelectAndPaging
|
|
*-----------------------------------------------------------------------------
|
|
*
|
|
* @Description : 查询SerialOrder
|
|
*
|
|
* @Function Parameters : 当前访问人员信息
|
|
*
|
|
* @Function Parameters : 查询参数
|
|
*
|
|
* @Return Value : 查询结果
|
|
*
|
|
* @Return Value : 执行时发生的错误
|
|
*
|
|
* @Author : 代码生成器创建
|
|
*
|
|
* @Date : 2021-10-22 14:06:37
|
|
*
|
|
******************************************************************************/
|
|
SelectAndPaging(*global.User, map[string]string) (grmi.PagingResult, error)
|
|
/******************************************************************************
|
|
*
|
|
* @Function Name : Update
|
|
*-----------------------------------------------------------------------------
|
|
*
|
|
* @Description : 修改多条SerialOrder
|
|
*
|
|
* @Function Parameters : 当前访问人员信息
|
|
*
|
|
* @Function Parameters : 需要修改的SerialOrder列表
|
|
*
|
|
* @Return Value : 执行时发生的错误
|
|
*
|
|
* @Author : 代码生成器创建
|
|
*
|
|
* @Date : 2021-10-22 14:06:37
|
|
*
|
|
******************************************************************************/
|
|
Update(*global.User, *[]model.SerialOrder) error
|
|
/******************************************************************************
|
|
*
|
|
* @Function Name : SelectSortOrder
|
|
*-----------------------------------------------------------------------------
|
|
*
|
|
* @Description : 查询排序工单页的已排序的工单
|
|
*
|
|
* @Function Parameters : 当前访问人员信息
|
|
*
|
|
* @Function Parameters : 查询参数
|
|
*
|
|
* @Return Value : 查询结果
|
|
*
|
|
* @Return Value : 执行时发生的错误
|
|
*
|
|
* @Author : zhangxin
|
|
*
|
|
* @Date : 2021-10-25
|
|
*
|
|
******************************************************************************/
|
|
SelectSortOrder(user *global.User, urlParameters map[string]string) (grmi.PagingResult, error)
|
|
/******************************************************************************
|
|
*
|
|
* @Function Name : SelectUnSortOrder
|
|
*-----------------------------------------------------------------------------
|
|
*
|
|
* @Description : 查询排序工单页的未排序的工单
|
|
*
|
|
* @Function Parameters : 当前访问人员信息
|
|
*
|
|
* @Function Parameters : 查询参数
|
|
*
|
|
* @Return Value : 查询结果
|
|
*
|
|
* @Return Value : 执行时发生的错误
|
|
*
|
|
* @Author : zhangxin
|
|
*
|
|
* @Date : 2021-10-25
|
|
*
|
|
******************************************************************************/
|
|
SelectUnSortOrder(user *global.User, urlParameters map[string]string) (grmi.PagingResult, error)
|
|
/******************************************************************************
|
|
*
|
|
* @Function Name : SelectUrgencyOrder
|
|
*-----------------------------------------------------------------------------
|
|
*
|
|
* @Description : 查询排序工单页的紧急工单
|
|
*
|
|
* @Function Parameters : 当前访问人员信息
|
|
*
|
|
* @Function Parameters : 查询参数
|
|
*
|
|
* @Return Value : 查询结果
|
|
*
|
|
* @Return Value : 执行时发生的错误
|
|
*
|
|
* @Author : zhangxin
|
|
*
|
|
* @Date : 2021-10-25
|
|
*
|
|
******************************************************************************/
|
|
SelectUrgencyOrder(user *global.User, urlParameters map[string]string) (grmi.PagingResult, error)
|
|
/******************************************************************************
|
|
*
|
|
* @Function Name : ChangeOrderToUrgency
|
|
*-----------------------------------------------------------------------------
|
|
*
|
|
* @Description : 将工单放到紧急工单队列中
|
|
*
|
|
* @Function Parameters : 当前访问人员信息
|
|
*
|
|
* @Function Parameters : 工单ID
|
|
*
|
|
* @Function Parameters : 优先级
|
|
*
|
|
* @Return Value : 执行时发生的错误
|
|
*
|
|
* @Author : zhangxin
|
|
*
|
|
* @Date : 2021-10-25
|
|
*
|
|
******************************************************************************/
|
|
ChangeOrderToUrgency(user *global.User, serialOrderId string, priority int) (err error)
|
|
/******************************************************************************
|
|
*
|
|
* @Function Name : WithdrawSerialOrder
|
|
*-----------------------------------------------------------------------------
|
|
*
|
|
* @Description : 撤回已计划的内部订单
|
|
*
|
|
* @Function Parameters : 当前访问人员信息
|
|
*
|
|
* @Function Parameters : 工单ID
|
|
*
|
|
* @Function Parameters : 来源
|
|
*
|
|
* @Return Value : 执行时发生的错误
|
|
*
|
|
* @Author : zhangxin
|
|
*
|
|
* @Date : 2021-10-25
|
|
*
|
|
******************************************************************************/
|
|
WithdrawSerialOrder(user *global.User, serialOrderId string, source string) (err error)
|
|
/******************************************************************************
|
|
*
|
|
* @Function Name : CancelSerialOrder
|
|
*-----------------------------------------------------------------------------
|
|
*
|
|
* @Description : 取消未计划的内部订单
|
|
*
|
|
* @Function Parameters : 当前访问人员信息
|
|
*
|
|
* @Function Parameters : 工单ID
|
|
*
|
|
* @Return Value : 执行时发生的错误
|
|
*
|
|
* @Author : zhangxin
|
|
*
|
|
* @Date : 2021-10-26
|
|
*
|
|
******************************************************************************/
|
|
CancelSerialOrder(user *global.User, serialOrderId string) error
|
|
/******************************************************************************
|
|
*
|
|
* @Function Name : PutIntSerialOrderToSeq
|
|
*-----------------------------------------------------------------------------
|
|
*
|
|
* @Description : 将未计划的内部订单放到计划队列中
|
|
*
|
|
* @Function Parameters : 当前访问人员信息
|
|
*
|
|
* @Function Parameters : 工单ID
|
|
*
|
|
* @Function Parameters : 前面的调度Key
|
|
*
|
|
* @Return Value : 执行时发生的错误
|
|
*
|
|
* @Author : zhangxin
|
|
*
|
|
* @Date : 2021-10-26
|
|
*
|
|
******************************************************************************/
|
|
PutIntSerialOrderToSeq(user *global.User, serialOrderId string, preSchedKey int64) error
|
|
/******************************************************************************
|
|
*
|
|
* @Function Name : ChangeOrderSchedKey
|
|
*-----------------------------------------------------------------------------
|
|
*
|
|
* @Description : 修改排序队列中内部订单的调用Key
|
|
*
|
|
* @Function Parameters : 当前访问人员信息
|
|
*
|
|
* @Function Parameters : 工单ID
|
|
*
|
|
* @Function Parameters : 调度Key
|
|
*
|
|
* @Return Value : 执行时发生的错误
|
|
*
|
|
* @Author : zhangxin
|
|
*
|
|
* @Date : 2021-10-26
|
|
*
|
|
******************************************************************************/
|
|
ChangeOrderSchedKey(user *global.User, serialOrderId string, schedKey int64) error
|
|
/******************************************************************************
|
|
*
|
|
* @Function Name : GetSerialOrderOperationData
|
|
*-----------------------------------------------------------------------------
|
|
*
|
|
* @Description : 获取工单末序之前的所有操作记录
|
|
*
|
|
* @Function Parameters : 当前访问人员信息
|
|
*
|
|
* @Function Parameters : 工单ID
|
|
*
|
|
* @Return Value : 工序操作结果
|
|
*
|
|
* @Return Value : 执行时发生的错误
|
|
*
|
|
* @Author : zhangxin
|
|
*
|
|
* @Date : 2021-12-10
|
|
*
|
|
******************************************************************************/
|
|
GetSerialOrderOperationData(user *global.User, serialOrderId string) (interface{}, error)
|
|
/******************************************************************************
|
|
*
|
|
* @Function Name : GetSerialOrderOperationTraceData
|
|
*-----------------------------------------------------------------------------
|
|
*
|
|
* @Description : 获取工单末序之前的所有操作记录
|
|
*
|
|
* @Function Parameters : 当前访问人员信息
|
|
*
|
|
* @Function Parameters : 工单ID
|
|
*
|
|
* @Return Value : 工序操作结果
|
|
*
|
|
* @Return Value : 执行时发生的错误
|
|
*
|
|
* @Author : zhangxin
|
|
*
|
|
* @Date : 2021-12-10
|
|
*
|
|
******************************************************************************/
|
|
GetSerialOrderOperationTraceData(user *global.User, serialOrderId string) (interface{}, error)
|
|
/******************************************************************************
|
|
*
|
|
* @Function Name : GetSerialOrderOPTrace
|
|
*-----------------------------------------------------------------------------
|
|
*
|
|
* @Description :查询serialOrder PO数据
|
|
*
|
|
* @Author : zhangxin
|
|
*
|
|
* @Date : 2021-09-16
|
|
*
|
|
******************************************************************************/
|
|
GetSerialOrderOPTrace(user *global.User, status int, workLineId, start, end, serialOrderId string, pageNumber int64, pageSize int64) (interface{}, error)
|
|
/******************************************************************************
|
|
*
|
|
* @Function Name : GetSerialOrderOperationData
|
|
*-----------------------------------------------------------------------------
|
|
*
|
|
* @Description : 查询serialOrder PO数据
|
|
*
|
|
* @Author : zhangxin
|
|
*
|
|
* @Date : 2021-09-16
|
|
*
|
|
******************************************************************************/
|
|
GetSerialOrderDetailTrace(user *global.User, serialOrderId string) (interface{}, error)
|
|
/******************************************************************************
|
|
*
|
|
* @Function Name : ExportSerialOrderTraceData
|
|
*-----------------------------------------------------------------------------
|
|
*
|
|
* @Description : 导出产品追溯数据
|
|
*
|
|
* @Author : zhangxin
|
|
*
|
|
* @Date : 2021-09-17
|
|
*
|
|
******************************************************************************/
|
|
//ExportSerialOrderTraceData(user *global.User, workOrderId string, status int, workLineId string, date string, serialOrderId string, NGCode string, repair bool) (filepath string, err error)
|
|
|
|
ExtractArtId(bomHead *meModel.BomHead) map[string]int
|
|
ExtractEOL(session *xorm.Session, user *global.User, serialOrder *model.SerialOrder) (status bool, remark string, recordT time.Time, err error)
|
|
CreateBatchSerialOrder(user *global.User, productId string, projectId string, workLineId string, qty int, preSchKey int, priority int, planDate string) error
|
|
TraceSubArticleBatch(user *global.User, barcode string, paging *grmi.Paging) (grmi.PagingResult, error)
|
|
ExportTraceSubArticleBatch(user *global.User, barcode string) (string, error)
|
|
CancelMultiSerialOrder(user *global.User, serialOrderIdLi []string) error
|
|
GetProductTraceDataReport(user *global.User, serialOrderId string) (interface{}, error)
|
|
GenerateProductCraft(user *global.User, session *xorm.Session, serialOrder *model.SerialOrder) error
|
|
ReplaceData(serialOrder *model.SerialOrder, serialNumber string, day string, isPre bool)
|
|
|
|
// BreakUp 骨架拆解
|
|
BreakUp(user *global.User, barcode string) (err error)
|
|
// ReturnToFactoryWithoutRepair 返厂非线上返修
|
|
ReturnToFactoryWithoutRepair(user *global.User, barcode string) (err error)
|
|
// ExtractArchiveData 从备份库提取工单数据到生产库
|
|
ExtractArchiveData(user *global.User, serialOrderId string) (err error)
|
|
}
|
|
|
|
/******************************************************************************
|
|
*
|
|
* @Function Name : NewSerialOrderService
|
|
*-----------------------------------------------------------------------------
|
|
*
|
|
* @Description : 创建一个SerialOrderService
|
|
*
|
|
* @Return Value : SerialOrderService实例
|
|
*
|
|
* @Author : 代码生成器创建
|
|
*
|
|
* @Date : 2021-10-22 14:06:37
|
|
*
|
|
******************************************************************************/
|
|
func NewSerialOrderService() SerialOrderService {
|
|
return implments.NewSerialOrderServiceImplement()
|
|
}
|