Kaynağa Gözat

update:优化内部库为线上引用

zoie 3 hafta önce
ebeveyn
işleme
528dea2aa3

+ 3 - 3
Nats/Nats.go

@@ -5,13 +5,13 @@ import (
 	"ERP_storage/models/Account"
 	"ERP_storage/models/Contract"
 	"fmt"
-	menulibs "git.baozhida.cn/ERP_libs/Menu"
-	powerlibs "git.baozhida.cn/ERP_libs/Power"
-	"git.baozhida.cn/ERP_libs/lib"
 	"github.com/astaxie/beego/logs"
 	"github.com/beego/beego/v2/adapter/orm"
 	"github.com/nats-io/nats.go"
 	"github.com/vmihailenco/msgpack/v5"
+	menulibs "gogs.baozhida.cn/zoie/ERP_libs/Menu"
+	powerlibs "gogs.baozhida.cn/zoie/ERP_libs/Power"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 )
 
 var Nats *nats.Conn

+ 4 - 4
Nats/NatsServer/NatsERP_user.go

@@ -4,10 +4,10 @@ import (
 	"ERP_storage/Nats"
 	"ERP_storage/conf"
 	"ERP_storage/logs"
-	natslibs "git.baozhida.cn/ERP_libs/Nats"
-	powerlibs "git.baozhida.cn/ERP_libs/Power"
-	userlibs "git.baozhida.cn/ERP_libs/User"
-	"git.baozhida.cn/ERP_libs/lib"
+	natslibs "gogs.baozhida.cn/zoie/ERP_libs/Nats"
+	powerlibs "gogs.baozhida.cn/zoie/ERP_libs/Power"
+	userlibs "gogs.baozhida.cn/zoie/ERP_libs/User"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 )
 
 // 验证TOKEY

+ 74 - 0
conf/app_prod.conf

@@ -0,0 +1,74 @@
+appname = ERP_storage
+HTTPPort = 6703
+runmode = dev
+Graceful = true
+EnableDocs = true
+copyrequestbody = true
+
+Sys_Name = "ERP_STORAGE"
+# Nats
+NatsServer_Url = "127.0.0.1:4223"
+NatsSubj_Prefix = ""
+
+# Mysql 线上
+MysqlServer_UrlPort = "127.0.0.1:3316"
+MysqlServer_Database = "erp_storage"
+MysqlServer_Username = "erp_storage"
+MysqlServer_Password = "cHFeFmxFhZJdijDn"
+MysqlServer_MaxIdleConnections = 100
+MysqlServer_MaxOpenConnections = 200
+
+# NatsSubj_Prefix = ""
+
+
+# Mysql 线上
+# MysqlServer_UrlPort = "127.0.0.1:3316"
+# MysqlServer_Database = "erp_storage"
+# MysqlServer_Username = "erp_storage"
+# MysqlServer_Password = "cHFeFmxFhZJdijDn"
+# MysqlServer_MaxIdleConnections = 100
+# MysqlServer_MaxOpenConnections = 200
+
+# Mysql Mqtt
+MysqlMqtt_UrlPort = "127.0.0.1:40306"
+MysqlMqtt_Database = "mqtt"
+MysqlMqtt_Username = "mqtt"
+MysqlMqtt_Password = "UQ7sPD8YZwCF2Zg!"
+MysqlMqtt_MaxIdleConnections = 100
+MysqlMqtt_MaxOpenConnections = 200
+
+# Redis
+Redis_address = "127.0.0.1:6378"
+Redis_password = ""
+Redis_dbNum = "2"
+
+FilterExcludeURL =
+FilterOnlyLoginCheckURL =
+
+# 消息通知前端页面跳转url
+ContractApprovalUrl = "/contract"
+VerifyContractUrl = "/contract"
+PercentageApprovalUrl = "/percentage"
+ContractReviewAuditUrl = "/contractReviewList"
+# 财务uuid
+FinanceUuid = "NeGSMvREXA8xDZWo6q1YjLHTm0dJg7zc"
+
+# 静态资源
+Qiniu_AccessKey = -8ezB_d-8-eUFTMvhOGbGzgeQRPeKQnaQ3DBcUxo
+Qiniu_SecretKey = KFhkYxTAJ2ZPN3ZS3euTsfWk8-C92rKgkhAMkDRN
+Qiniu_BUCKET = baozhida-erp
+Qiniu_Url = https://erposs.baozhida.cn/
+
+# 日志配置
+# 0-控制台输出 1-文件输出 2-文件和控制台输出
+adapter_type = 0
+# 文件最多保存多少天
+maxdays = 7
+# 日志级别 (0-紧急 1-报警 2-严重错误 3-错误 4-警告 5-注意 6-信息 7-调试)
+level = 7
+# SQL日志级别 (1-静音 2-错误 3-警告 4-信息). 注意: sql日志只在level大于等于5级别才会输出。
+sqlloglevel = 4
+# 慢SQL阈值(毫秒)。慢SQL会在sqlloglevel大于等于3时输出。
+slow_threshold = 200
+# 每个文件保存的最大行数
+maxlines = 10000

+ 2 - 2
controllers/Basic.go

@@ -8,8 +8,8 @@ import (
 	"ERP_storage/models/Percentage"
 	"ERP_storage/models/Stock"
 	"fmt"
-	userlibs "git.baozhida.cn/ERP_libs/User"
-	"git.baozhida.cn/ERP_libs/lib"
+	userlibs "gogs.baozhida.cn/zoie/ERP_libs/User"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"github.com/beego/beego/v2/adapter/orm"
 	beego "github.com/beego/beego/v2/server/web"
 	"math"

+ 2 - 2
controllers/Contract.go

@@ -9,8 +9,8 @@ import (
 	"ERP_storage/models/Contract"
 	"ERP_storage/models/Stock"
 	"fmt"
-	userlibs "git.baozhida.cn/ERP_libs/User"
-	"git.baozhida.cn/ERP_libs/lib"
+	userlibs "gogs.baozhida.cn/zoie/ERP_libs/User"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"github.com/beego/beego/v2/adapter/orm"
 	beego "github.com/beego/beego/v2/server/web"
 	"github.com/robfig/cron/v3"

+ 3 - 3
controllers/ContractReview.go

@@ -11,9 +11,9 @@ import (
 	"ERP_storage/services"
 	"encoding/json"
 	"fmt"
-	natslibs "git.baozhida.cn/ERP_libs/Nats"
-	userlibs "git.baozhida.cn/ERP_libs/User"
-	"git.baozhida.cn/ERP_libs/lib"
+	natslibs "gogs.baozhida.cn/zoie/ERP_libs/Nats"
+	userlibs "gogs.baozhida.cn/zoie/ERP_libs/User"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	beego "github.com/beego/beego/v2/server/web"
 	"github.com/xuri/excelize/v2"
 	"math"

+ 2 - 2
controllers/Percentage.go

@@ -9,8 +9,8 @@ import (
 	"ERP_storage/models/Percentage"
 	"ERP_storage/models/Stock"
 	"fmt"
-	userlibs "git.baozhida.cn/ERP_libs/User"
-	"git.baozhida.cn/ERP_libs/lib"
+	userlibs "gogs.baozhida.cn/zoie/ERP_libs/User"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"github.com/beego/beego/v2/adapter/orm"
 	beego "github.com/beego/beego/v2/server/web"
 	"math"

+ 2 - 2
controllers/Property.go

@@ -5,8 +5,8 @@ import (
 	"ERP_storage/conf"
 	"ERP_storage/models/Account"
 	"ERP_storage/models/Property"
-	userlibs "git.baozhida.cn/ERP_libs/User"
-	"git.baozhida.cn/ERP_libs/lib"
+	userlibs "gogs.baozhida.cn/zoie/ERP_libs/User"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"github.com/beego/beego/v2/adapter/orm"
 	beego "github.com/beego/beego/v2/server/web"
 	"math"

+ 3 - 3
controllers/Stock.go

@@ -12,9 +12,9 @@ import (
 	"ERP_storage/models/Property"
 	"ERP_storage/models/Stock"
 	"fmt"
-	natslibs "git.baozhida.cn/ERP_libs/Nats"
-	userlibs "git.baozhida.cn/ERP_libs/User"
-	"git.baozhida.cn/ERP_libs/lib"
+	natslibs "gogs.baozhida.cn/zoie/ERP_libs/Nats"
+	userlibs "gogs.baozhida.cn/zoie/ERP_libs/User"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"github.com/beego/beego/v2/adapter/orm"
 	beego "github.com/beego/beego/v2/server/web"
 	"github.com/robfig/cron/v3"

+ 1 - 1
controllers/power.go

@@ -2,7 +2,7 @@ package controllers
 
 import (
 	"ERP_storage/Nats/NatsServer"
-	powerlibs "git.baozhida.cn/ERP_libs/Power"
+	powerlibs "gogs.baozhida.cn/zoie/ERP_libs/Power"
 	"github.com/beego/beego/v2/adapter/orm"
 )
 

+ 1 - 1
dto/Stock.go

@@ -1,7 +1,7 @@
 package dto
 
 import (
-	"git.baozhida.cn/ERP_libs/lib"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"sort"
 )
 

+ 1 - 3
go.mod

@@ -2,10 +2,7 @@ module ERP_storage
 
 go 1.19
 
-replace git.baozhida.cn/ERP_libs => /Users/zoie/work/bzd_project/ERP/ERP_libs
-
 require (
-	git.baozhida.cn/ERP_libs v0.0.0-00010101000000-000000000000
 	github.com/astaxie/beego v1.12.3
 	github.com/beego/beego/v2 v2.0.7
 	github.com/bytedance/go-tagexpr/v2 v2.9.11
@@ -15,6 +12,7 @@ require (
 	github.com/smartystreets/goconvey v1.8.1
 	github.com/vmihailenco/msgpack/v5 v5.3.5
 	github.com/xuri/excelize/v2 v2.7.1
+	gogs.baozhida.cn/zoie/ERP_libs v0.0.0-20241029034120-31ca607abb2e
 	gorm.io/driver/mysql v1.5.7
 	gorm.io/gorm v1.25.11
 )

+ 2 - 0
go.sum

@@ -353,6 +353,8 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
 go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
 go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
 go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
+gogs.baozhida.cn/zoie/ERP_libs v0.0.0-20241029034120-31ca607abb2e h1:sUbmO6gD9GcYjW1abZ2Brfw5xay2a3R6KlSVy7+QE4I=
+gogs.baozhida.cn/zoie/ERP_libs v0.0.0-20241029034120-31ca607abb2e/go.mod h1:wS/rgL1FkdfMsCwKpwG04dZtG4SOFcBADi4lxHN7UeM=
 golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
 golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=

+ 2 - 2
models/Account/Menu.go

@@ -4,8 +4,8 @@ import (
 	"ERP_storage/conf"
 	"ERP_storage/logs"
 	"fmt"
-	menulibs "git.baozhida.cn/ERP_libs/Menu"
-	"git.baozhida.cn/ERP_libs/lib"
+	menulibs "gogs.baozhida.cn/zoie/ERP_libs/Menu"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"github.com/astaxie/beego/cache"
 	_ "github.com/astaxie/beego/cache/redis"
 	"github.com/beego/beego/v2/adapter/orm"

+ 1 - 1
models/Account/Power.go

@@ -1,7 +1,7 @@
 package Account
 
 import (
-	powerlibs "git.baozhida.cn/ERP_libs/Power"
+	powerlibs "gogs.baozhida.cn/zoie/ERP_libs/Power"
 	"github.com/beego/beego/v2/adapter/orm"
 )
 

+ 1 - 1
models/Account/User.go

@@ -1,7 +1,7 @@
 package Account
 
 import (
-	userlibs "git.baozhida.cn/ERP_libs/User"
+	userlibs "gogs.baozhida.cn/zoie/ERP_libs/User"
 	"sync"
 )
 

+ 1 - 1
models/Basic/Depot.go

@@ -2,7 +2,7 @@ package Basic
 
 import (
 	"ERP_storage/logs"
-	"git.baozhida.cn/ERP_libs/lib"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	_ "github.com/astaxie/beego/cache/redis"
 	"github.com/beego/beego/v2/adapter/orm"
 	orm2 "github.com/beego/beego/v2/client/orm"

+ 1 - 1
models/Basic/Product.go

@@ -6,7 +6,7 @@ import (
 	"encoding/json"
 	"errors"
 	"fmt"
-	"git.baozhida.cn/ERP_libs/lib"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"github.com/astaxie/beego/cache"
 	_ "github.com/astaxie/beego/cache/redis"
 	"github.com/beego/beego/v2/adapter/orm"

+ 1 - 1
models/Basic/ProductClass.go

@@ -2,7 +2,7 @@ package Basic
 
 import (
 	"ERP_storage/logs"
-	"git.baozhida.cn/ERP_libs/lib"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	_ "github.com/astaxie/beego/cache/redis"
 	"github.com/beego/beego/v2/adapter/orm"
 	orm2 "github.com/beego/beego/v2/client/orm"

+ 1 - 1
models/Basic/ProductSpec.go

@@ -2,7 +2,7 @@ package Basic
 
 import (
 	"ERP_storage/logs"
-	"git.baozhida.cn/ERP_libs/lib"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	_ "github.com/astaxie/beego/cache/redis"
 	"github.com/beego/beego/v2/adapter/orm"
 	orm2 "github.com/beego/beego/v2/client/orm"

+ 1 - 1
models/Basic/VerifyItem.go

@@ -2,7 +2,7 @@ package Basic
 
 import (
 	"ERP_storage/logs"
-	"git.baozhida.cn/ERP_libs/lib"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	_ "github.com/astaxie/beego/cache/redis"
 	"github.com/beego/beego/v2/adapter/orm"
 	orm2 "github.com/beego/beego/v2/client/orm"

+ 1 - 1
models/Contract/Contract.go

@@ -4,7 +4,7 @@ import (
 	"ERP_storage/logs"
 	"ERP_storage/models/Account"
 	"fmt"
-	"git.baozhida.cn/ERP_libs/lib"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	orm2 "github.com/beego/beego/v2/client/orm"
 	"strconv"
 	"strings"

+ 1 - 1
models/Contract/ContractProduct.go

@@ -4,7 +4,7 @@ import (
 	"ERP_storage/logs"
 	"ERP_storage/models/Basic"
 	"fmt"
-	"git.baozhida.cn/ERP_libs/lib"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	orm2 "github.com/beego/beego/v2/client/orm"
 	"strconv"
 	"time"

+ 1 - 1
models/Contract/VerifyContract.go

@@ -2,7 +2,7 @@ package Contract
 
 import (
 	"ERP_storage/logs"
-	"git.baozhida.cn/ERP_libs/lib"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	orm2 "github.com/beego/beego/v2/client/orm"
 	"time"
 

+ 1 - 1
models/Percentage/Percentage.go

@@ -7,7 +7,7 @@ import (
 	"ERP_storage/models/Contract"
 	"encoding/json"
 	"fmt"
-	"git.baozhida.cn/ERP_libs/lib"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	orm2 "github.com/beego/beego/v2/client/orm"
 	"strings"
 	"time"

+ 1 - 1
models/Property/IotCard.go

@@ -1,7 +1,7 @@
 package Property
 
 import (
-	"git.baozhida.cn/ERP_libs/lib"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	orm2 "github.com/beego/beego/v2/client/orm"
 	"time"
 

+ 1 - 1
models/Stock/Device.go

@@ -5,7 +5,7 @@ import (
 	"ERP_storage/models/Basic"
 	"errors"
 	"fmt"
-	"git.baozhida.cn/ERP_libs/lib"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	_ "github.com/astaxie/beego/cache/redis"
 	"github.com/beego/beego/v2/adapter/orm"
 	orm2 "github.com/beego/beego/v2/client/orm"

+ 1 - 1
models/Stock/Mqtt.go

@@ -2,7 +2,7 @@ package Stock
 
 import (
 	"ERP_storage/logs"
-	"git.baozhida.cn/ERP_libs/lib"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	orm2 "github.com/beego/beego/v2/client/orm"
 )
 

+ 1 - 1
models/Stock/Stock.go

@@ -4,7 +4,7 @@ import (
 	"ERP_storage/models/Basic"
 	"errors"
 	"fmt"
-	"git.baozhida.cn/ERP_libs/lib"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	orm2 "github.com/beego/beego/v2/client/orm"
 	"strconv"
 	"sync"

+ 1 - 1
models/Stock/StockIn.go

@@ -4,7 +4,7 @@ import (
 	"ERP_storage/models/Account"
 	"ERP_storage/models/Basic"
 	"fmt"
-	"git.baozhida.cn/ERP_libs/lib"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	orm2 "github.com/beego/beego/v2/client/orm"
 	"strconv"
 	"time"

+ 1 - 1
models/Stock/StockInProduct.go

@@ -3,7 +3,7 @@ package Stock
 import (
 	"ERP_storage/models/Account"
 	"ERP_storage/models/Basic"
-	"git.baozhida.cn/ERP_libs/lib"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	orm2 "github.com/beego/beego/v2/client/orm"
 	"strconv"
 	"time"

+ 1 - 1
models/Stock/StockMonth.go

@@ -2,7 +2,7 @@ package Stock
 
 import (
 	"ERP_storage/models/Basic"
-	"git.baozhida.cn/ERP_libs/lib"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	orm2 "github.com/beego/beego/v2/client/orm"
 	"time"
 

+ 1 - 1
models/Stock/StockOut.go

@@ -4,7 +4,7 @@ import (
 	"ERP_storage/models/Account"
 	"ERP_storage/models/Basic"
 	"fmt"
-	"git.baozhida.cn/ERP_libs/lib"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	orm2 "github.com/beego/beego/v2/client/orm"
 	"strconv"
 	"strings"

+ 1 - 1
models/Stock/StockOutProduct.go

@@ -3,7 +3,7 @@ package Stock
 import (
 	"ERP_storage/models/Account"
 	"ERP_storage/models/Basic"
-	"git.baozhida.cn/ERP_libs/lib"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	orm2 "github.com/beego/beego/v2/client/orm"
 	"strconv"
 	"time"

+ 2 - 2
routers/filter.go

@@ -5,8 +5,8 @@ import (
 	"ERP_storage/conf"
 	"ERP_storage/logs"
 	"ERP_storage/models/Account"
-	powerlibs "git.baozhida.cn/ERP_libs/Power"
-	"git.baozhida.cn/ERP_libs/lib"
+	powerlibs "gogs.baozhida.cn/zoie/ERP_libs/Power"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"github.com/beego/beego/v2/adapter/orm"
 	"github.com/beego/beego/v2/server/web/context"
 	"strings"

+ 1 - 1
routers/router.go

@@ -1,7 +1,7 @@
 package routers
 
 import (
-	errorlibs "git.baozhida.cn/ERP_libs/Error"
+	errorlibs "gogs.baozhida.cn/zoie/ERP_libs/Error"
 	beego "github.com/beego/beego/v2/server/web"
 )
 

+ 1 - 1
services/ContractReview.go

@@ -10,7 +10,7 @@ import (
 	models "ERP_storage/models/ContractReview"
 	"errors"
 	"fmt"
-	"git.baozhida.cn/ERP_libs/lib"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 )
 
 type ContractReview struct {

+ 1 - 1
services/ServiceItem.go

@@ -6,7 +6,7 @@ import (
 	"ERP_storage/logs"
 	models "ERP_storage/models/ContractReview"
 	"errors"
-	"git.baozhida.cn/ERP_libs/lib"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"gorm.io/gorm"
 )
 

+ 1 - 1
services/ServiceType.go

@@ -6,7 +6,7 @@ import (
 	"ERP_storage/logs"
 	models "ERP_storage/models/ContractReview"
 	"errors"
-	"git.baozhida.cn/ERP_libs/lib"
+	"gogs.baozhida.cn/zoie/ERP_libs/lib"
 	"gorm.io/gorm"
 )