fix
zhangqian
2023-09-21 cdbda5e3895814b688bcc0e6b34b6067b0b9b773
fix
3个文件已修改
6 ■■■■ 已修改文件
api/v1/task.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/production_progress.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/progress.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/v1/task.go
@@ -227,7 +227,7 @@
        if err != nil {
            return err
        }
        return service.NewProgressService().Upsert(db, procedure, order)
        return service.NewProgressService().Add(db, procedure, order)
    })
    if err != nil {
        logx.Errorf("SendProcessParams update order and procedure status error:%v", err.Error())
model/production_progress.go
@@ -12,7 +12,7 @@
        ID               int    `gorm:"primarykey"`
        WorkOrderID      string `gorm:"index;type:varchar(191);not null;comment:工单ID" json:"workOrderID"`
        OrderID          string `gorm:"index;type:varchar(191);not null;comment:订单ID" json:"orderID"`
        ProcedureID      string `gorm:"uniqueIndex:idx_product_procedure;type:varchar(191);comment:工序ID" json:"procedureId"`
        ProcedureID      string `gorm:"type:varchar(191);comment:工序ID" json:"procedureId"`
        DeviceID         string `gorm:"type:varchar(191);not null;comment:设备ID" json:"deviceId"`
        FinishedQuantity int64  `gorm:"type:int;not null;comment:完成数量" json:"finishedQuantity"`
        Position         int    `gorm:"type:int;comment:工作位置" json:"position"` //每个设备可能有多个机位同时生产,用position表示位置
service/progress.go
@@ -13,7 +13,7 @@
    return &ProgressService{}
}
func (slf ProgressService) Upsert(db *gorm.DB, procedure *model.Procedures, order *model.Order) error {
func (slf ProgressService) Add(db *gorm.DB, procedure *model.Procedures, order *model.Order) error {
    _, err := model.NewProductionProgressSearch(db).SetProcedureId(procedure.ProcedureID).SetWorkOrderId(procedure.WorkOrderID).First()
    if err == gorm.ErrRecordNotFound {
        progress := &model.ProductionProgress{