liujiandao
2024-04-16 647fd6d88e3e7d4809fecd5b88f3a0f537bc2623
产品修改字段
4个文件已修改
48 ■■■■ 已修改文件
conf/config.go 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
conf/config.yaml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/operation.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
models/material.go 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
conf/config.go
@@ -23,14 +23,15 @@
type (
    webConf struct {
        Host       string // 本机ip地址
        Port       string // 端口号
        NodeId     string // 主账户用户名
        OssType    string // 对象存储类型
        JWTSecret  string
        FileServer string //文件服务器地址
        ServerId   string //服务ID
        GrpcPort   string //grpc端口号
        Host        string // 本机ip地址
        Port        string // 端口号
        NodeId      string // 主账户用户名
        OssType     string // 对象存储类型
        JWTSecret   string
        FileServer  string //文件服务器地址
        ServerId    string //服务ID
        GrpcPort    string //grpc端口号
        CompanyName string //公司名
    }
    localConf struct {
conf/config.yaml
@@ -7,6 +7,8 @@
  #  fileServer: http://172.20.11.127:9333
  fileServer: http://192.168.20.189:6333
  serverId: wms
  # 通过公司名称区分出入库明细打印模版,目前支持:geruimi,jialian
  companyName: jialian
db:
  #  dsn: root:c++java123@tcp(192.168.20.119:3306)/wms?charset=utf8&parseTime=True&loc=Local
  dsn: root:c++java123@tcp(192.168.20.119:3306)/aps_server2?charset=utf8&parseTime=True&loc=Local
controllers/operation.go
@@ -890,6 +890,10 @@
    util.ResponseFormat(c, code.Success, fileUrl)
}
func JialianInputOperation() {
}
func ExportInputSelfmade(category constvar.FileTemplateCategory, operation *models.Operation) (string, error) {
    template, err := models.NewFileTemplateAttachmentSearch().SetCategory(category).First()
    if err != nil {
models/material.go
@@ -1,6 +1,7 @@
package models
import (
    "encoding/json"
    "fmt"
    "github.com/shopspring/decimal"
    "github.com/spf13/cast"
@@ -79,7 +80,8 @@
        IsVirtual               int             `json:"isVirtual" gorm:"type:tinyint(1);default:2;comment:是否虚拟物料(1是2否)"` //虚拟物料在MRP计算时跳过该层级直接领用下级物料,虚拟物料不生成工单
        ReorderRuleNum          int64           `json:"reorderRuleNum"`
        MoreUnit                bool            `json:"moreUnit" gorm:"type:tinyint(1);default:false;comment:启动多单位"`
        MoreUnitValue           string          `json:"moreUnitValue" gorm:"type:varchar(255);comment:多单位值"`
        MoreUnitList            []UnitItems     `json:"moreUnitList" gorm:"-"`
        MoreUnitValue           string          `json:"-" gorm:"type:varchar(255);comment:多单位值"`
        GrossWeight             decimal.Decimal `json:"grossWeight" gorm:"type:decimal(20,3);comment:毛重"`
        NetWeight               decimal.Decimal `json:"netWeight" gorm:"type:decimal(20,3);comment:净重"`
        GrossUnit               string          `json:"grossUnit" gorm:"type:varchar(255);comment:毛重单位"`
@@ -113,6 +115,12 @@
        Id   string `json:"id"`
        Name string `json:"name"`
    }
    UnitItems struct {
        Amount   decimal.Decimal `json:"amount"`
        Unit     string          `json:"unit"`
        Floating bool            `json:"floating"`
    }
)
func (slf Material) TableName() string {
@@ -127,6 +135,14 @@
        }
    } else if slf.PurchaseType != 0 { //兼容旧数据
        slf.PurchaseTypeList = append(slf.PurchaseTypeList, int(slf.PurchaseType))
    }
    if slf.MoreUnitValue != "" {
        var arr []UnitItems
        err := json.Unmarshal([]byte(slf.MoreUnitValue), &arr)
        if err != nil {
            return err
        }
        slf.MoreUnitList = arr
    }
    return
}
@@ -144,6 +160,13 @@
            slf.PurchaseType = constvar.PurchaseType(slf.PurchaseTypeList[0])
        }
    }
    if len(slf.MoreUnitList) != 0 {
        str, err := json.Marshal(slf.MoreUnitList)
        if err != nil {
            return err
        }
        slf.MoreUnitValue = string(str)
    }
    return
}