zhangqian
2023-12-08 8e941bd782f574597f19c980982afade4dc11748
snowflake的id传参换成字符串
6个文件已删除
15个文件已修改
456 ■■■■■ 已修改文件
model/device.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/device_plc.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/model.go 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/net_config.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/plc_brand.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/process_model.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/process_model_plc_address.go 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/production_progress.go 286 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/report_work.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/reports_to_cloud.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/request/cluster.go 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/request/common.go 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/request/device.go 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/request/plcBrand.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/request/schedule_task.go 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/request/task.go 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/request/user.go 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/sqlite.go 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/system_status.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/task_status_sync.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/work_order.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/device.go
@@ -10,7 +10,7 @@
type (
    // Device 设备
    Device struct {
        gorm.Model
        CommonModel
        DeviceID             string   `gorm:"column:device_id;type:varchar(255);not null;unique" json:"deviceID"` //设备编号
        DeviceName           string   `gorm:"column:device_name;type:varchar(255);" json:"deviceName"`            //设备名称
        ExtChannelAmount     int      `gorm:"type:tinyint;default:0" json:"extChannelAmount"`
model/device_plc.go
@@ -12,7 +12,7 @@
    // DevicePlc 设备的PLC配置
    DevicePlc struct {
        gorm.Model
        CommonModel
        DeviceID   string             `gorm:"column:device_id;type:varchar(255);not null;unique" json:"deviceID"` //设备编号
        Brand      string             `gorm:"type:varchar(191)" json:"brand"`
        Method     constvar.PlcMethod `gorm:"type:varchar(191)" json:"method"`
model/model.go
@@ -1,6 +1,7 @@
package model
import (
    "apsClient/pkg/snowflake"
    "time"
)
@@ -10,3 +11,9 @@
    UpdatedAt time.Time
    DeletedAt *time.Time `sql:"index"`
}
func (c *CommonModel) BeforeCreate() {
    if c.ID == 0 {
        c.ID = uint(snowflake.GenerateID())
    }
}
model/net_config.go
@@ -9,7 +9,7 @@
type (
    NetConfig struct {
        gorm.Model
        CommonModel
        NetworkCard string          `gorm:"type:varchar(100);not null;default ''" json:"networkCard" binding:"required"` //网卡
        IP          string          `gorm:"type:varchar(100);not null;default ''" json:"ip" binding:"required"`          //本机ip
        MASK        string          `gorm:"type:varchar(100);not null;default ''" json:"mask" binding:"required"`        //子网掩码
@@ -172,7 +172,7 @@
func (slf *NetConfigSearch) CreateBatch(records []*NetConfig) error {
    var db = slf.build()
    for _, record := range records{
    for _, record := range records {
        db.Create(record)
    }
    return nil
model/plc_brand.go
@@ -12,7 +12,7 @@
type (
    // PlcBrand plc品牌
    PlcBrand struct {
        gorm.Model
        CommonModel
        Name string `json:"name" gorm:"column:name;type:varchar(255);not null;default:''"`
    }
@@ -54,7 +54,7 @@
func (slf *PlcBrandSearch) CreateBatch(records []*PlcBrand) error {
    var db = slf.build()
    for _, record := range records{
    for _, record := range records {
        db.Create(record)
    }
    return nil
model/process_model.go
@@ -11,7 +11,7 @@
type (
    // ProcessModel 工艺参数
    ProcessModel struct {
        gorm.Model
        CommonModel
        Number       string `gorm:"index;column:number;type:varchar(255);not null;default ''" json:"number"` //工艺模型编号
        Product      string `gorm:"column:product;type:varchar(255);not null;default ''" json:"product"`     //产品名称
        Procedure    string `gorm:"column:procedure;type:varchar(255);not null;default ''" json:"procedure"` //工序
model/process_model_plc_address.go
@@ -15,7 +15,8 @@
    // ProcessModelPlcAddress 工艺参数plc读写地址
    ProcessModelPlcAddress struct {
        ID          uint                   `gorm:"primaryKey;" json:"id"`
        CommonModel
        ID          uint                   `json:"id"`
        AddressList []*ProcessModelAddress `json:"addressList" gorm:"-"`
        Address     string                 `json:"-" gorm:"address"`
        DeviceID    string                 `json:"deviceId" gorm:"column:device_id;index;type:varchar(255)"`
model/production_progress.go
File was deleted
model/report_work.go
@@ -8,7 +8,7 @@
type (
    ReportWork struct {
        gorm.Model
        CommonModel
        ProceduresID       uint   `gorm:"index;type:varchar(191)" json:"proceduresId"`        //procedures表的id
        ProductProcedureID string `gorm:"index;type:varchar(191);" json:"productProcedureID"` //产品工序id
        WorkOrderID        string `gorm:"index;type:varchar(191);" json:"workOrderId"`
model/reports_to_cloud.go
@@ -10,7 +10,7 @@
type (
    // ReportsToCloud 数据上报
    ReportsToCloud struct {
        gorm.Model
        CommonModel
        ReportType constvar.ReportType `json:"reportType"` //上报类型
        Content    string              `json:"Content"`
    }
model/request/cluster.go
File was deleted
model/request/common.go
@@ -5,10 +5,6 @@
    PageSize int `json:"pageSize" form:"pageSize"` // 每页大小
}
type GetById struct {
    ID uint `json:"id"` // 主键ID
}
type SetCurrentDevice struct {
    CurrentDeviceID string `json:"currentDeviceID,omitempty"` //当前选定的生产设备
}
@@ -18,12 +14,12 @@
}
type ReportWork struct {
    ProcedureId  uint   `json:"procedureId" binding:"required"`   //工序id
    ReportAmount int    `json:"reportAmount"  binding:"required"` //报工数量
    WorkerID     string `json:"workerID"  binding:"required"`     //报告者id
    ProcedureId  uint   `json:"procedureId,string" binding:"required"` //工序id
    ReportAmount int    `json:"reportAmount"  binding:"required"`      //报工数量
    WorkerID     string `json:"workerID"  binding:"required"`          //报告者id
}
type ReportWorkList struct {
    PageInfo
    ProcedureId uint `json:"procedureId" binding:"required" form:"procedureId"` //工序id
    ProcedureId uint `json:"procedureId,string" binding:"required" form:"procedureId"` //工序id
}
model/request/device.go
File was deleted
model/request/plcBrand.go
@@ -10,7 +10,7 @@
}
type UpdatePlcBrand struct {
    Id uint `json:"id"`
    Id uint `json:"id,string"`
    model.PlcBrand
}
model/request/schedule_task.go
File was deleted
model/request/task.go
@@ -2,15 +2,6 @@
import "apsClient/constvar"
// TaskInfo 任务开启通知请求参数
type TaskInfo struct {
    OrderId   string `json:"orderId"`   // 订单号
    Product   string `json:"password"`  // 产品
    Procedure string `json:"procedure"` // 工序
    WorkOrder string `json:"workOrder"` // 工单
    Device    string `json:"device"`    // 设备
}
// TaskList 任务列表请求参数
type TaskList struct {
    PageInfo
@@ -29,7 +20,7 @@
// ProcessModelList 工艺参数列表请求参数
type ProcessModelList struct {
    PageInfo
    ProcedureId uint `json:"procedureId" form:"procedureId" binding:"required"` //当前的工序id
    ProcedureId uint `json:"procedureId,string" form:"procedureId" binding:"required"` //当前的工序id
}
// TaskListByChannel 按channel返回任务列表请求参数
model/request/user.go
File was deleted
model/sqlite.go
File was deleted
model/system_status.go
@@ -12,7 +12,7 @@
type (
    // SystemStatus 系统状态
    SystemStatus struct {
        gorm.Model
        CommonModel
        Key   constvar.SystemStatusKey   `json:"key" gorm:"column:key;type:varchar(255);not null"`
        Value constvar.SystemStatusValue `json:"value" gorm:"column:value;type:varchar(255);not null"`
    }
model/task_status_sync.go
@@ -10,7 +10,7 @@
type (
    // TaskStatusSync 任务状态同步
    TaskStatusSync struct {
        gorm.Model
        CommonModel
        WorkOrderId        string              `json:"workOrderId"`                                  //工单编号
        ProductProcedureID string              `gorm:"type:varchar(191);" json:"productProcedureID"` //产品工序id
        ProcedureID        string              `json:"procedureId"`                                  // 工序编号
model/work_order.go
@@ -9,7 +9,7 @@
type (
    Order struct {
        gorm.Model
        CommonModel
        WorkOrderID string          `gorm:"index;type:varchar(191);not null" json:"workOrderId"`
        OrderID     string          `gorm:"index;type:varchar(191);not null" json:"orderId"`
        ProductID   string          `gorm:"type:varchar(191)" json:"productId"`