fix
zhangqian
2024-04-09 92bd52259879ffb1a352e154c9a613e873c64105
fix
7个文件已修改
35 ■■■■■ 已修改文件
controllers/dict.go 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/request/fineness.go 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/docs.go 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.json 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.yaml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
models/dict.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
models/fineness.go 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/dict.go
@@ -88,6 +88,9 @@
}
func (slf DictController) ParamsCheck(params models.Dict) (err error) {
    if params.Number == "" || params.Name == "" {
        return errors.New("参数缺失")
    }
    dict, err := models.NewDictSearch().SetNumber(params.Number).First()
    if err != gorm.ErrRecordNotFound && dict != nil && dict.ID != params.ID {
        return errors.New("编号重复")
controllers/request/fineness.go
@@ -17,6 +17,7 @@
    FinenessList  []FinenessItem  `json:"finenessList"`                                                    //纤度数组
    SumFineness   decimal.Decimal `gorm:"type:decimal(12,2);not null;comment:合计纤度" json:"sumFineness"`     //合计纤度
    SumQuantity   decimal.Decimal `gorm:"type:decimal(12,2);not null;comment:合计数量" json:"sumQuantity"`     //合计数量
    Position      int             `gorm:"not null;default:0;comment:车号" json:"position"`                   //最后一个车号
}
type FinenessItem struct {
docs/docs.go
@@ -1090,6 +1090,10 @@
                    "description": "编号",
                    "type": "string"
                },
                "position": {
                    "description": "最后一个车号",
                    "type": "integer"
                },
                "spec": {
                    "description": "规格",
                    "type": "string"
@@ -1252,6 +1256,10 @@
                    "description": "编号",
                    "type": "string"
                },
                "position": {
                    "description": "最后一个车号",
                    "type": "integer"
                },
                "spec": {
                    "description": "规格",
                    "type": "string"
docs/swagger.json
@@ -1078,6 +1078,10 @@
                    "description": "编号",
                    "type": "string"
                },
                "position": {
                    "description": "最后一个车号",
                    "type": "integer"
                },
                "spec": {
                    "description": "规格",
                    "type": "string"
@@ -1240,6 +1244,10 @@
                    "description": "编号",
                    "type": "string"
                },
                "position": {
                    "description": "最后一个车号",
                    "type": "integer"
                },
                "spec": {
                    "description": "规格",
                    "type": "string"
docs/swagger.yaml
@@ -226,6 +226,9 @@
      number:
        description: 编号
        type: string
      position:
        description: 最后一个车号
        type: integer
      spec:
        description: 规格
        type: string
@@ -336,6 +339,9 @@
      number:
        description: 编号
        type: string
      position:
        description: 最后一个车号
        type: integer
      spec:
        description: 规格
        type: string
models/dict.go
@@ -88,6 +88,10 @@
        db = db.Where("dict_type = ?", slf.DictType)
    }
    if slf.Name != "" {
        db = db.Where("name = ?", slf.Name)
    }
    return db
}
models/fineness.go
@@ -17,11 +17,12 @@
        WorkshopGroup int             `gorm:"type:int(11);not null;default:0;comment:车组" json:"workshopGroup"` //车组
        Market        string          `gorm:"type:varchar(255);not null;comment:庄口" json:"market"`             //庄口
        Spec          string          `gorm:"type:varchar(255);not null;comment:规格" json:"spec"`               //规格
        Circle        uint8           `gorm:"not null;comment:回数" json:"circle"`                               //回数
        TotalCircle   uint8           `gorm:"not null;comment:总回数" json:"totalCircle"`                         //总回数
        Circle        uint8           `gorm:"not null;default:0;comment:回数" json:"circle"`                     //回数
        TotalCircle   uint8           `gorm:"not null;default:0;comment:总回数" json:"totalCircle"`               //总回数
        FinenessList  []FinenessItem  `gorm:"foreignkey:FinenessRegisterID;references:ID" json:"finenessList"`
        SumFineness   decimal.Decimal `gorm:"type:decimal(12,2);not null;comment:合计纤度" json:"sumFineness"`
        SumQuantity   decimal.Decimal `gorm:"type:decimal(12,2);not null;comment:合计数量" json:"sumQuantity"`
        Position      int             `gorm:"not null;default:0;comment:车号" json:"position"` //最后一个车号
    }
    FinenessRegisterSearch struct {
        FinenessRegister