first commit

This commit is contained in:
蒋海成 2025-02-19 14:24:15 +08:00
commit f3224da714
483 changed files with 162270 additions and 0 deletions

57
README.md Normal file
View File

@ -0,0 +1,57 @@
# 管理系统客户端---帮助文档
新管理系统客户端
## 模块汇总
## 本地化测试
修改go.mod文件中replace <br>
github.com/fonchain_enterprise/fonchain-account => ../fonchain-account <br>
cd cmd <br>
go run . <br>
## 数据校验
### 使用govalidators生成pd校验文件可以在client或者server做数据校验(filter)
> 校验文件可在proto时生成建议在client的filter做前置校验,校验文件可通用
#### 1、安装go-proto-validators
* [使用go-proto-validators生成校验文件](https://github.com/mwitkow/go-proto-validators)
#### 2、生成校验文件
```
protoc --proto_path=. --proto_path=C:/Users/user054/go/src --go_out=./api/account --govalidators_out=./api/account --go-triple_out=./api/account ./api/account/account.proto
```
#### 3、校验(filter中)
```go
func (f *FonValidateFilter) Invoke(ctx context.Context, invoker protocol.Invoker, invocation protocol.Invocation) protocol.Result {
if len(invocation.Arguments()) > 0 {
if v, ok := invocation.Arguments()[0].(validator); ok {
if err := v.Validate(); err != nil {
return &protocol.RPCResult{Err: perrors.Errorf("%v,info:%v,method:%s ", err.Error(),
invoker, invocation.MethodName())}
}
}
}
return invoker.Invoke(ctx, invocation)
}
```
* 使用dubbo-go3的filter校验数据[使用文档](https://github.com/apache/dubbo-go-samples/blob/master/filter/custom/go-server)[filter文件位置](http://192.168.31.6:8090/bugmaker/mgmt/fonchain-account/-/blob/main/pkg/common/filter/filter.go)
#### server做校验
## 部署
### 测试
```bash
docker build . -f ./fonchain-main/DockerfileTest -t main-server
```
### 正式
```bash
docker build . -f ./fonchain-main/DockerfileProd -t main-server
```
protoc --proto_path=. --proto_path=C:/Users/Admin/go/pkg/mod --go_out=./api/recruit --govalidators_out=./api/recruit --go-triple_out=./api/recruit ./api/recruit/recruit.proto

60
cmd/app.go Normal file
View File

@ -0,0 +1,60 @@
package main
import (
"fmt"
_ "github.com/fonchain_enterprise/fonchain-main/pkg/common/filter"
"github.com/fonchain_enterprise/fonchain-main/pkg/config"
pkgcron "github.com/fonchain_enterprise/fonchain-main/pkg/cron"
"github.com/fonchain_enterprise/fonchain-main/pkg/e"
"github.com/fonchain_enterprise/fonchain-main/pkg/es"
"github.com/fonchain_enterprise/fonchain-main/pkg/mq"
pkgOaCron "github.com/fonchain_enterprise/fonchain-main/pkg/oa_cron"
"github.com/fonchain_enterprise/fonchain-main/pkg/register"
"github.com/fonchain_enterprise/fonchain-main/pkg/router"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/artistInfo/artistInfoTask"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/auth/sso"
"github.com/fonchain_enterprise/fonchain-main/pkg/tracing"
"github.com/fonchain_enterprise/fonchain-main/pkg/utils"
"github.com/robfig/cron/v3"
)
// export DUBBO_GO_CONFIG_PATH=$PATH_TO_APP/conf/dubbogo.yaml
func main() {
config.GetOptions()
if config.JaegerOpen {
tracing.InitTracing()
}
// rabbitmq 初始化
mq.NewRabbitMq()
if err := utils.InitTrans("zh"); err != nil {
panic(e.Error)
}
if config.Cron {
c := cron.New()
service.Task(c)
pkgcron.Task(c)
pkgOaCron.Task(c)
artistInfoTask.Task(c)
service.OneQueryTask(c)
c.Start()
fmt.Println("======================================= 打印定时任务 =====================================================")
for i := 0; i < len(c.Entries()); i++ {
fmt.Println("定时任务", c.Entries()[i])
}
fmt.Println("======================================= 打印定时任务 =====================================================")
}
register.Register()
//sso init
sso.LoadEnv()
if config.AppMode != "local" {
es.InitElastic()
}
r := router.NewRouter()
if config.RunHttps {
_ = r.RunTLS(config.HttpPort, config.Cert, config.Key)
} else {
_ = r.Run(config.HttpPort)
}
select {}
}

32
cmd/init.go Normal file
View File

@ -0,0 +1,32 @@
package main
import (
"fmt"
"gopkg.in/ini.v1"
)
var (
AppMode string
HttpPort string
Key string
Cert string
IsHttps bool
)
func Init() {
fmt.Println("第一处")
file, err := ini.Load("../conf/conf.ini")
if err != nil {
fmt.Println("服务器配置文件读取错误,请检查文件路径:", err)
}
LoadServer(file)
}
func LoadServer(file *ini.File) {
AppMode = file.Section("service").Key("AppMode").String()
IsHttps, _ = file.Section("service").Key("IsHTTPS").Bool()
Key = file.Section("service").Key("Key").String()
Cert = file.Section("service").Key("Cert").String()
HttpPort = file.Section("service").Key("HttpPort").String()
}

63
conf/cert/cert.pem Normal file
View File

@ -0,0 +1,63 @@
-----BEGIN CERTIFICATE-----
MIIGBDCCBOygAwIBAgIQBUU6WXwaMqHmOB+CnlVLsjANBgkqhkiG9w0BAQsFADBy
MQswCQYDVQQGEwJDTjElMCMGA1UEChMcVHJ1c3RBc2lhIFRlY2hub2xvZ2llcywg
SW5jLjEdMBsGA1UECxMURG9tYWluIFZhbGlkYXRlZCBTU0wxHTAbBgNVBAMTFFRy
dXN0QXNpYSBUTFMgUlNBIENBMB4XDTIyMDMyOTAwMDAwMFoXDTIzMDMyOTIzNTk1
OVowGDEWMBQGA1UEAxMNbXMuZm9udHJlZS5jbjCCASIwDQYJKoZIhvcNAQEBBQAD
ggEPADCCAQoCggEBAKUdYvcnylmI6Nlqfvn/5rTPNPyfucIaoRMSyJxMmDaMqmeI
+gd2iQrHRRyM94G9DSmcUP/1P/1RuZxVIHHnl8+ZRlLQuEJLEz8pB7BclOvYBIcz
0lEDUG4OpIV1odV2wdGHSNVwHRwblhQUQ/LrvvcrjAmyTDlAoRSrZX3U6ka8fyyj
Fr6pdPl3TLoIzdwBxere9gSE44DxtsIuhGveC6q0wUWcFS81cMNbjCRmeB1EQHQM
PIoHnVNaKPusADTanO8lSwjgY8iwzYaDWhBfNkUJszgpAwSH9XwBLQwybQ4B3tKl
1dUmDHqYwt1nSstBOrubhSkVx+FMuzpJcOjNCT0CAwEAAaOCAu4wggLqMB8GA1Ud
IwQYMBaAFH/TmfOgRw4xAFZWIo63zJ7dygGKMB0GA1UdDgQWBBRaN+Q3QDgtKmdS
ASqq5dP8LgEcCTAYBgNVHREEETAPgg1tcy5mb250cmVlLmNuMA4GA1UdDwEB/wQE
AwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwPgYDVR0gBDcwNTAz
BgZngQwBAgEwKTAnBggrBgEFBQcCARYbaHR0cDovL3d3dy5kaWdpY2VydC5jb20v
Q1BTMIGSBggrBgEFBQcBAQSBhTCBgjA0BggrBgEFBQcwAYYoaHR0cDovL3N0YXR1
c2UuZGlnaXRhbGNlcnR2YWxpZGF0aW9uLmNvbTBKBggrBgEFBQcwAoY+aHR0cDov
L2NhY2VydHMuZGlnaXRhbGNlcnR2YWxpZGF0aW9uLmNvbS9UcnVzdEFzaWFUTFNS
U0FDQS5jcnQwCQYDVR0TBAIwADCCAX0GCisGAQQB1nkCBAIEggFtBIIBaQFnAHYA
6D7Q2j71BjUy51covIlryQPTy9ERa+zraeF3fW0GvW4AAAF/0z8qvgAABAMARzBF
AiAX1VSEBfFBXXyNFzTaOmNbKtV1AkTsJ+48Y+ROy0F+EgIhAM2AkGMMs7ND1bWT
HUW05eJileEnm9B6dprIP5XIFFGkAHYANc8ZG7+xbFe/D61MbULLu7YnICZR6j/h
Ku+oA8M71kwAAAF/0z8q5QAABAMARzBFAiEAt26ksGeoXFFd9vQn2aTHeaS8atuE
f+l7Xql1Fhi2X/QCIGGetQr+yF1PznxPFSVuUHWytQX9OjuDBniNfcrAS9lAAHUA
s3N3B+GEUPhjhtYFqdwRCUp5LbFnDAuH3PADDnk2pZoAAAF/0z8q/wAABAMARjBE
AiAFo6xsNmRJ1zZHHM55DPeU3YdA2lPuxC9+kORq5TpvTwIgNBueD+NlqYOp8T7T
JnaX+AwRpWHHNc8YGypQWtXjIS0wDQYJKoZIhvcNAQELBQADggEBADd952RyuJiT
qgW3MJ3wJkYf5wSdZm39IxZqR3G6bcktkuI+usw9uYSfW/gl/Qihx1t0FHcd/xwI
E57KyVZvJgJjRjp4SYFC8YNqT6os1LrWnobx2orJOh9tYdiWTqe5rBzTH+Cw1tOS
zztan1dOJ6rh8zEXPBeTOGJj3Ephx2U8hkMsOBV46tcg5TOqDWQOKFWdm0YD2AZ1
uEDg5mLNdKUyrXmXC8WCT4C0+uEhdORfNkwhKzJFqkGrWOiBNfIxTflS6STQNsV+
y7zmqCjDAFuo+FnLgdGBPakOKyMYex0dJI9g6kSH6YyznYHouf4mrB5W/ODcXzcv
1LtI3DW+9cc=
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIErjCCA5agAwIBAgIQBYAmfwbylVM0jhwYWl7uLjANBgkqhkiG9w0BAQsFADBh
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD
QTAeFw0xNzEyMDgxMjI4MjZaFw0yNzEyMDgxMjI4MjZaMHIxCzAJBgNVBAYTAkNO
MSUwIwYDVQQKExxUcnVzdEFzaWEgVGVjaG5vbG9naWVzLCBJbmMuMR0wGwYDVQQL
ExREb21haW4gVmFsaWRhdGVkIFNTTDEdMBsGA1UEAxMUVHJ1c3RBc2lhIFRMUyBS
U0EgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCgWa9X+ph+wAm8
Yh1Fk1MjKbQ5QwBOOKVaZR/OfCh+F6f93u7vZHGcUU/lvVGgUQnbzJhR1UV2epJa
e+m7cxnXIKdD0/VS9btAgwJszGFvwoqXeaCqFoP71wPmXjjUwLT70+qvX4hdyYfO
JcjeTz5QKtg8zQwxaK9x4JT9CoOmoVdVhEBAiD3DwR5fFgOHDwwGxdJWVBvktnoA
zjdTLXDdbSVC5jZ0u8oq9BiTDv7jAlsB5F8aZgvSZDOQeFrwaOTbKWSEInEhnchK
ZTD1dz6aBlk1xGEI5PZWAnVAba/ofH33ktymaTDsE6xRDnW97pDkimCRak6CEbfe
3dXw6OV5AgMBAAGjggFPMIIBSzAdBgNVHQ4EFgQUf9OZ86BHDjEAVlYijrfMnt3K
AYowHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDgYDVR0PAQH/BAQD
AgGGMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjASBgNVHRMBAf8ECDAG
AQH/AgEAMDQGCCsGAQUFBwEBBCgwJjAkBggrBgEFBQcwAYYYaHR0cDovL29jc3Au
ZGlnaWNlcnQuY29tMEIGA1UdHwQ7MDkwN6A1oDOGMWh0dHA6Ly9jcmwzLmRpZ2lj
ZXJ0LmNvbS9EaWdpQ2VydEdsb2JhbFJvb3RDQS5jcmwwTAYDVR0gBEUwQzA3Bglg
hkgBhv1sAQIwKjAoBggrBgEFBQcCARYcaHR0cHM6Ly93d3cuZGlnaWNlcnQuY29t
L0NQUzAIBgZngQwBAgEwDQYJKoZIhvcNAQELBQADggEBAK3dVOj5dlv4MzK2i233
lDYvyJ3slFY2X2HKTYGte8nbK6i5/fsDImMYihAkp6VaNY/en8WZ5qcrQPVLuJrJ
DSXT04NnMeZOQDUoj/NHAmdfCBB/h1bZ5OGK6Sf1h5Yx/5wR4f3TUoPgGlnU7EuP
ISLNdMRiDrXntcImDAiRvkh5GJuH4YCVE6XEntqaNIgGkRwxKSgnU3Id3iuFbW9F
UQ9Qqtb1GX91AJ7i4153TikGgYCdwYkBURD8gSVe8OAco6IfZOYt/TEwii1Ivi1C
qnuUlWpsF1LdQNIdfbW3TSe0BhQa7ifbVIfvPWHYOu3rkg1ZeMo6XRU9B4n5VyJY
RmE=
-----END CERTIFICATE-----

View File

@ -0,0 +1,66 @@
-----BEGIN CERTIFICATE-----
MIIGaDCCBNCgAwIBAgIQb6rm7ri6MwqLviT4dhBn2zANBgkqhkiG9w0BAQwFADBZ
MQswCQYDVQQGEwJDTjElMCMGA1UEChMcVHJ1c3RBc2lhIFRlY2hub2xvZ2llcywg
SW5jLjEjMCEGA1UEAxMaVHJ1c3RBc2lhIFJTQSBEViBUTFMgQ0EgRzIwHhcNMjIx
MDA4MDAwMDAwWhcNMjMxMDA4MjM1OTU5WjAZMRcwFQYDVQQDEw5lcnAuZm9udHJl
ZS5jbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMJTyM9GWK1YR2Q9
Hvnnnd2RJnDWTlGB6xdfE24VLAm5AiQxUvmVwPfDiUVtZwUXII/OBePt0U/mA32g
RHm8tNTyW074KeEwOw64MAJwHEWDrPe7+THIzg3nrkqO6aiPxCnaxub5fU3kwbTQ
lVbjL0IMn9UsoOoH1AEtj5yrMVPnsxVc68iPxdN9VulcL9oH9+x0aoo4Myy9JdwK
TQXUVBIsZSeOnQOdXwGFaZVMuQU0CdKoYiFLEeZFAdt/+NIyTi/wV89EGc2lb/aO
XAUgumKjwz7nvgD3TBiKdFec6YZ9D3vzTHtE+INZ1H+E9/GsK3x/oBr8rB4L/kLQ
t92ARSUCAwEAAaOCAuowggLmMB8GA1UdIwQYMBaAFF86fBEQfgxncWHci6O1AANn
9VccMB0GA1UdDgQWBBSk9Saoo3OuKy27HaCEm8UdRu+LOzAOBgNVHQ8BAf8EBAMC
BaAwDAYDVR0TAQH/BAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIw
SQYDVR0gBEIwQDA0BgsrBgEEAbIxAQICMTAlMCMGCCsGAQUFBwIBFhdodHRwczov
L3NlY3RpZ28uY29tL0NQUzAIBgZngQwBAgEwfQYIKwYBBQUHAQEEcTBvMEIGCCsG
AQUFBzAChjZodHRwOi8vY3J0LnRydXN0LXByb3ZpZGVyLmNuL1RydXN0QXNpYVJT
QURWVExTQ0FHMi5jcnQwKQYIKwYBBQUHMAGGHWh0dHA6Ly9vY3NwLnRydXN0LXBy
b3ZpZGVyLmNuMBkGA1UdEQQSMBCCDmVycC5mb250cmVlLmNuMIIBgAYKKwYBBAHW
eQIEAgSCAXAEggFsAWoAdwCt9776fP8QyIudPZwePhhqtGcpXc+xDCTKhYY069yC
igAAAYO2kOknAAAEAwBIMEYCIQDuxGX9u+vkFZL+GhdnEUvxrW87mXtwGIpItyxn
EmCeEgIhAOgPpUsUj3FQNnSibN2fnFx1hWMKaFKMyTL/mppIgPisAHYAejKMVNi3
LbYg6jjgUh7phBZwMhOFTTvSK8E6V6NS61IAAAGDtpDpLwAABAMARzBFAiEAiJOj
P4eobLuBMVaO0OyPaddsPrGGPbZHPMX671QxJ4ECIB6KajkfRnCNvELkP6R+UHol
EXHpS7KNdDrZeRz62UO/AHcA6D7Q2j71BjUy51covIlryQPTy9ERa+zraeF3fW0G
vW4AAAGDtpDpCQAABAMASDBGAiEAlly04fN+WpaPd6+u0yuwn0+2h6ipcM76Dem/
xtSldYoCIQCUkaysgQTbVYVHUfVzB+fCUODhoHvh4E/pB407lFqZZzANBgkqhkiG
9w0BAQwFAAOCAYEAAtM37PdnWYQ8MENXvWjpOP8lOUcKlQy4XdAV+2z13+mj7O8y
ELOgpbuWXirMHq9DzaVBDQeDdLDC6LYyekAxqD3jEW5Zc3WutDx63PYUt9uz9Eat
Y7Y/jJoNmwdXO2mLmHwCDzKZaQh5qVi1WgaCQD3jZk6mBbEzHTIUiGTuUAJ3aXd8
EsisAKHkUiK7eSUFB7r1lB0kNQdTGdoX/8w3T2neQE7ru0igVtj0fw3GH2zSyZbD
MjEtsvGHedFhmh4K6KjsoMJt3uSeFKOZp9LO+GDR70pqnxb+TaypkcbX3nAp/e5u
vVEvDu3qKztD4YerXb3Pkhe/IrBs+6xxegtOlk/oezPtXvfQgzLUFl5Fnjlr+cwG
VmF2j/yK0T7CP+I1wf3+Bx3apjQ0qDT7CPsDwWAp5k0x1XlD/guyOUJMXC1zRtOA
ccgv1l54VC69WJe1H+XgKfD3qvY244bmQz/NdIZ37MVKcPlsYfAxZQ7Z1Gf4JyL6
zqn0sZ7twxYiR4GC
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIFBzCCA++gAwIBAgIRALIM7VUuMaC/NDp1KHQ76aswDQYJKoZIhvcNAQELBQAw
ezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
A1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV
BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczAeFw0yMjAxMTAwMDAwMDBaFw0y
ODEyMzEyMzU5NTlaMFkxCzAJBgNVBAYTAkNOMSUwIwYDVQQKExxUcnVzdEFzaWEg
VGVjaG5vbG9naWVzLCBJbmMuMSMwIQYDVQQDExpUcnVzdEFzaWEgUlNBIERWIFRM
UyBDQSBHMjCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBAKjGDe0GSaBs
Yl/VhMaTM6GhfR1TAt4mrhN8zfAMwEfLZth+N2ie5ULbW8YvSGzhqkDhGgSBlafm
qq05oeESrIJQyz24j7icGeGyIZ/jIChOOvjt4M8EVi3O0Se7E6RAgVYcX+QWVp5c
Sy+l7XrrtL/pDDL9Bngnq/DVfjCzm5ZYUb1PpyvYTP7trsV+yYOCNmmwQvB4yVjf
IIpHC1OcsPBntMUGeH1Eja4D+qJYhGOxX9kpa+2wTCW06L8T6OhkpJWYn5JYiht5
8exjAR7b8Zi3DeG9oZO5o6Qvhl3f8uGU8lK1j9jCUN/18mI/5vZJ76i+hsgdlfZB
Rh5lmAQjD80M9TY+oD4MYUqB5XrigPfFAUwXFGehhlwCVw7y6+5kpbq/NpvM5Ba8
SeQYUUuMA8RXpTtGlrrTPqJryfa55hTuX/ThhX4gcCVkbyujo0CYr+Uuc14IOyNY
1fD0/qORbllbgV41wiy/2ZUWZQUodqHWkjT1CwIMbQOY5jmrSYGBwwIDAQABo4IB
JjCCASIwHwYDVR0jBBgwFoAUoBEKIz6W8Qfs4q8p74Klf9AwpLQwHQYDVR0OBBYE
FF86fBEQfgxncWHci6O1AANn9VccMA4GA1UdDwEB/wQEAwIBhjASBgNVHRMBAf8E
CDAGAQH/AgEAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAiBgNVHSAE
GzAZMA0GCysGAQQBsjEBAgIxMAgGBmeBDAECATBDBgNVHR8EPDA6MDigNqA0hjJo
dHRwOi8vY3JsLmNvbW9kb2NhLmNvbS9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNy
bDA0BggrBgEFBQcBAQQoMCYwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmNvbW9k
b2NhLmNvbTANBgkqhkiG9w0BAQsFAAOCAQEAHMUom5cxIje2IiFU7mOCsBr2F6CY
eU5cyfQ/Aep9kAXYUDuWsaT85721JxeXFYkf4D/cgNd9+hxT8ZeDOJrn+ysqR7NO
2K9AdqTdIY2uZPKmvgHOkvH2gQD6jc05eSPOwdY/10IPvmpgUKaGOa/tyygL8Og4
3tYyoHipMMnS4OiYKakDJny0XVuchIP7ZMKiP07Q3FIuSS4omzR77kmc75/6Q9dP
v4wa90UCOn1j6r7WhMmX3eT3Gsdj3WMe9bYD0AFuqa6MDyjIeXq08mVGraXiw73s
Zale8OMckn/BU3O/3aFNLHLfET2H2hT6Wb3nwxjpLIfXmSVcVd8A58XH0g==
-----END CERTIFICATE-----

View File

@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEAwlPIz0ZYrVhHZD0e+eed3ZEmcNZOUYHrF18TbhUsCbkCJDFS
+ZXA98OJRW1nBRcgj84F4+3RT+YDfaBEeby01PJbTvgp4TA7DrgwAnAcRYOs97v5
McjODeeuSo7pqI/EKdrG5vl9TeTBtNCVVuMvQgyf1Syg6gfUAS2PnKsxU+ezFVzr
yI/F031W6Vwv2gf37HRqijgzLL0l3ApNBdRUEixlJ46dA51fAYVplUy5BTQJ0qhi
IUsR5kUB23/40jJOL/BXz0QZzaVv9o5cBSC6YqPDPue+APdMGIp0V5zphn0Pe/NM
e0T4g1nUf4T38awrfH+gGvysHgv+QtC33YBFJQIDAQABAoIBACSQZb4kdx6EuAgj
HP86JsDQJSrBlCJvftfarpn9t1fL/RxowHtQQ2sLGnrbAzGYwKp2QjL5JjNxrNH4
NDIwwNi5klcpSB4EOHSEURpAVH168XJ6psCIj0bcAzYprkrmZCtY7Ch9JKfhpVX7
kkHzRMrZe8B9YXiviONA2p8IsiMeZyq4Z9m34xViBE4tRRCFBAX/oWBILQ5ZivSy
X3fItD23Rxp5PxbFx86tXZ8t8l5RTsJ4PFsphVp8FZM5sNotUGoopXbcgrQkr39Z
9EEg2DZF1+CB4Rfh/Yaa9NzdJ6ZKk9sJ2m/L3yk9inaW7YLQ0Q5whAQCrF0VVzRQ
AlW1CekCgYEA8QDvFbW+8KhPiMoVVQc0+Lk8Clx6YjSBsX+QLqckMgF/NeQaQXJD
+qhSg8kfFgJlv/cjDa2bd3I7KegyhpsNrJ1xI18BU71Op822klDYf9TirwBanpO2
pHZtfWO+hEyebqmmGRFA+/ZWlCbNDtgbgtBYku82fOK3G8kEjgN88RkCgYEAzmtR
0u+l647mFb22XQ/uLSW+XXNVf9PfsBVjFj6Bi+hmtRA4p7H8riBH7UE30EChpFct
7svTggSxK4etAQh/G49kV/ww0zj+vWerb8Tgv1AsRYbxMg288CLw+sFmcTyq5VFM
UwDBL6Ji6mV3q8eE1qwBd0ayQIe1pGzj/O6que0CgYEA15mzSWO29kpMJJ5MaS2y
WNQ1fztuDM7WO3lX/jRucAHg0NBIIMZdRC8y6kyRb7ojVpF7nW/zBe9+OCZOlRa/
K+4JWdBTOpu/cuTYcJq8o9dKF66kYvrYSNbdanBB7s8waOWB/yjtTrr4hz8S8TWp
nuROaNxxjVWw4714QqeiLXkCgYEAq20vUAncdqt/Y9DhEZp4SCBPX1a4S+eOnrK0
TrXsal/AZGCrXIGRgp6mfWArVRVH6K7KI8Y8yn7REICl6fS/cwj74aI8fj6YOH5P
Pwx3Rgr0KW2vA82q+pdaIDXbuPEUUEvbIhe/WKr4kQdhglS5enrw4LjisnrCHGKe
WOFxAeUCgYEAmyl5xvs5dpoYPmyiC0TTME0e4af6VayoT70Faq3393lXaWtbjyrQ
Us7+aMWpLuwu4bhPa/qbMHvrYilsGg5epoZgTJc8+KsSGjBsh6Qzu0c8/dJnZrtq
8LR4w21FuJXZvPjrCb7OJrDNLYcJd1X9SK2ldy71z2h3/Ok1s7W6CyU=
-----END RSA PRIVATE KEY-----

View File

@ -0,0 +1,66 @@
-----BEGIN CERTIFICATE-----
MIIGbDCCBNSgAwIBAgIQDjc4PJb6HrFS+crgmkw2ozANBgkqhkiG9w0BAQwFADBZ
MQswCQYDVQQGEwJDTjElMCMGA1UEChMcVHJ1c3RBc2lhIFRlY2hub2xvZ2llcywg
SW5jLjEjMCEGA1UEAxMaVHJ1c3RBc2lhIFJTQSBEViBUTFMgQ0EgRzIwHhcNMjIx
MDE5MDAwMDAwWhcNMjMxMDE5MjM1OTU5WjAcMRowGAYDVQQDExFlcnBhcGkuZm9u
dHJlZS5jbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANU5Q5lYCF4d
018aeengza4OXSjuSYwYJnTTpBxCdAHPddGgCfDVEjGmxY6ZujdTFUDbBfewXxHK
jGUWZ7drWKuhPF7bGnrO9MPb80OfNVmlmteIPzcUiQ2S2zYwbnG3h78EQJdNYaEK
tfhMzLRlfdI1+P7Fhm/8cGSC3RLEf+d3jSherW45GO+G2SWVm1fNfYqhJLsk5sha
3vha2L06O8ZN10LZJCN+IAXErO0H0DkqwFZpQyWH7E9G+UALpDQzXWhM2xInTwH2
J7Zn8qdbpog9fUjWc9LWY92zLhTxZg3ra3pWmv4p9cgn79iJ1ZPplAh/xj+B5vdI
xdranmp4OCMCAwEAAaOCAuswggLnMB8GA1UdIwQYMBaAFF86fBEQfgxncWHci6O1
AANn9VccMB0GA1UdDgQWBBQtU12qUQQhaYTio4lP+HjHwXRblTAOBgNVHQ8BAf8E
BAMCBaAwDAYDVR0TAQH/BAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUH
AwIwSQYDVR0gBEIwQDA0BgsrBgEEAbIxAQICMTAlMCMGCCsGAQUFBwIBFhdodHRw
czovL3NlY3RpZ28uY29tL0NQUzAIBgZngQwBAgEwfQYIKwYBBQUHAQEEcTBvMEIG
CCsGAQUFBzAChjZodHRwOi8vY3J0LnRydXN0LXByb3ZpZGVyLmNuL1RydXN0QXNp
YVJTQURWVExTQ0FHMi5jcnQwKQYIKwYBBQUHMAGGHWh0dHA6Ly9vY3NwLnRydXN0
LXByb3ZpZGVyLmNuMBwGA1UdEQQVMBOCEWVycGFwaS5mb250cmVlLmNuMIIBfgYK
KwYBBAHWeQIEAgSCAW4EggFqAWgAdgCt9776fP8QyIudPZwePhhqtGcpXc+xDCTK
hYY069yCigAAAYPv6GLgAAAEAwBHMEUCIDuuqWj77dqMqPXh2o+Rcxts9rV+ZzRp
00RAhhodqyjQAiEA15dVJfTk+SZu419d6EC7M0VaVOkV6fyLLQOjTHIBa7UAdQB6
MoxU2LcttiDqOOBSHumEFnAyE4VNO9IrwTpXo1LrUgAAAYPv6GK8AAAEAwBGMEQC
IGEBfQxasMk6sjKdUtvIpx9E3hCeEss0MCwP07asr5XFAiBK0AO/d/dj9ed7eGFO
eez1rBZqrcafdcTxmiMrrJCqHgB3AOg+0No+9QY1MudXKLyJa8kD08vREWvs62nh
d31tBr1uAAABg+/oYooAAAQDAEgwRgIhAK3GB2fyLP/jwoEM/6eulH67aCjwYIZC
nS3DZ2ZL9TPUAiEA/GIxI91stUByOhtk0wDJwpgIX2bu7B4ao0uYEAOR6OUwDQYJ
KoZIhvcNAQEMBQADggGBAD1mna9uckTZwxJjbYpD0n4FnWUGgooTe9ZigdZvyOss
Q/TT0TbJQgPueiKx9THriKy+Q73KXfm6vRT30edsB69SA/wMW6HHfrnsBGgGSBMK
3knoX8Zx25yTEQchIOF2/psGu4mERwiVxgcREDAvf/21eZUetQ8VZ98ySvpcdD56
5RqNYzDARzQh8FjDcDFfF/6QWKkLdj99U8CFpEisGFqEs3BXYKucpOVOwVrNRStO
ylZ7jnOvTXd6tcT2MpmBqC0M1zh2I5XT6lZQ7Ma5J0GJd5DmrDOJp+VjUkoqFX8X
h9AQfOZLLOM8AfpRerwWpCctLh8pxBWLnrLd3lxJLbBTI4ZgaXyOqDgrfJh1REUY
mjXH73da83sMOjK2g8eZPBsbyujG42JyafKChg1mZk4pfkQ2TQFGR/a+HoxQjS/R
hnW2c8ceVXrDMMKadWUJliKgiwy5g+qhk5ayFRLK4upkNehkoJ9Ys5k2z+TMMT//
PPs8UXsp8kfWmNve/lIvPQ==
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIFBzCCA++gAwIBAgIRALIM7VUuMaC/NDp1KHQ76aswDQYJKoZIhvcNAQELBQAw
ezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
A1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV
BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczAeFw0yMjAxMTAwMDAwMDBaFw0y
ODEyMzEyMzU5NTlaMFkxCzAJBgNVBAYTAkNOMSUwIwYDVQQKExxUcnVzdEFzaWEg
VGVjaG5vbG9naWVzLCBJbmMuMSMwIQYDVQQDExpUcnVzdEFzaWEgUlNBIERWIFRM
UyBDQSBHMjCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBAKjGDe0GSaBs
Yl/VhMaTM6GhfR1TAt4mrhN8zfAMwEfLZth+N2ie5ULbW8YvSGzhqkDhGgSBlafm
qq05oeESrIJQyz24j7icGeGyIZ/jIChOOvjt4M8EVi3O0Se7E6RAgVYcX+QWVp5c
Sy+l7XrrtL/pDDL9Bngnq/DVfjCzm5ZYUb1PpyvYTP7trsV+yYOCNmmwQvB4yVjf
IIpHC1OcsPBntMUGeH1Eja4D+qJYhGOxX9kpa+2wTCW06L8T6OhkpJWYn5JYiht5
8exjAR7b8Zi3DeG9oZO5o6Qvhl3f8uGU8lK1j9jCUN/18mI/5vZJ76i+hsgdlfZB
Rh5lmAQjD80M9TY+oD4MYUqB5XrigPfFAUwXFGehhlwCVw7y6+5kpbq/NpvM5Ba8
SeQYUUuMA8RXpTtGlrrTPqJryfa55hTuX/ThhX4gcCVkbyujo0CYr+Uuc14IOyNY
1fD0/qORbllbgV41wiy/2ZUWZQUodqHWkjT1CwIMbQOY5jmrSYGBwwIDAQABo4IB
JjCCASIwHwYDVR0jBBgwFoAUoBEKIz6W8Qfs4q8p74Klf9AwpLQwHQYDVR0OBBYE
FF86fBEQfgxncWHci6O1AANn9VccMA4GA1UdDwEB/wQEAwIBhjASBgNVHRMBAf8E
CDAGAQH/AgEAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAiBgNVHSAE
GzAZMA0GCysGAQQBsjEBAgIxMAgGBmeBDAECATBDBgNVHR8EPDA6MDigNqA0hjJo
dHRwOi8vY3JsLmNvbW9kb2NhLmNvbS9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNy
bDA0BggrBgEFBQcBAQQoMCYwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmNvbW9k
b2NhLmNvbTANBgkqhkiG9w0BAQsFAAOCAQEAHMUom5cxIje2IiFU7mOCsBr2F6CY
eU5cyfQ/Aep9kAXYUDuWsaT85721JxeXFYkf4D/cgNd9+hxT8ZeDOJrn+ysqR7NO
2K9AdqTdIY2uZPKmvgHOkvH2gQD6jc05eSPOwdY/10IPvmpgUKaGOa/tyygL8Og4
3tYyoHipMMnS4OiYKakDJny0XVuchIP7ZMKiP07Q3FIuSS4omzR77kmc75/6Q9dP
v4wa90UCOn1j6r7WhMmX3eT3Gsdj3WMe9bYD0AFuqa6MDyjIeXq08mVGraXiw73s
Zale8OMckn/BU3O/3aFNLHLfET2H2hT6Wb3nwxjpLIfXmSVcVd8A58XH0g==
-----END CERTIFICATE-----

View File

@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEA1TlDmVgIXh3TXxp56eDNrg5dKO5JjBgmdNOkHEJ0Ac910aAJ
8NUSMabFjpm6N1MVQNsF97BfEcqMZRZnt2tYq6E8Xtsaes70w9vzQ581WaWa14g/
NxSJDZLbNjBucbeHvwRAl01hoQq1+EzMtGV90jX4/sWGb/xwZILdEsR/53eNKF6t
bjkY74bZJZWbV819iqEkuyTmyFre+FrYvTo7xk3XQtkkI34gBcSs7QfQOSrAVmlD
JYfsT0b5QAukNDNdaEzbEidPAfYntmfyp1umiD19SNZz0tZj3bMuFPFmDetrelaa
/in1yCfv2InVk+mUCH/GP4Hm90jF2tqeang4IwIDAQABAoIBAF3vRGCh783Gxf/3
4g2vA+3SVihaEfyuBwMg2gO5IvJJO1aGctqug71sA0y3XNpSt+JCm3ZrNPbZjNBb
9oVPvVifR8FiNWA1HI/Mrnb0BMThuD2LwI27dkWMlRZib8WZXSxB61K8vG3+Efy5
mNVAgRXCwVc8HeXoCHu/SzWha9fEfYOItlO65Mh/gYFR4DwkGwFlFaNLyrzKqgwA
pEmKZtNMFF49J1P+QwQeyQjcVCqTnl0FSbdkuLtUnjIAFVIybdzwMQk8O/KHLb/V
SNVsF59dzFswoOYn/wBc6r4T3FAtGoQabVCeTXcN/SG6r/pDI+JndCW358OqBWCj
Lg8pGMECgYEA7MIFjSDQW42BGMyubuzYNNBcU95qa25F1Sjlj2Wr54+5ios2OSdb
5GQUgD6fbFSLQAFJl9rkGppY4v1Fs4toZOOHzc0cBDPxd8Vp1Gz8JJQuuO6HWChl
ZSZELt+xUiXvc+KY6300nQBQMdNQgxfXFjcgcp+Ga0WWmP4j5oODnmcCgYEA5o2X
GxW3HfbyA5XOHr7DbNrlxe9fEM3egCPGSlDUMgskXoBLaD5oQNwM+ywyXXKiZrhB
uoA1cfIZM39v1R3oH8AolwKsnt9MZhuq+k/AW8KjxA9t/7qJERXPy0IH4IOr2+r5
L7maNsF/v0y6DUfEMm/hOCCw9D/5K7QienPoiuUCgYEAne9X0KshEtG0Wpy/h9OK
7sBHttLZ3sxy3R0o9Z13LUNdHCR9iWbOD+8LFfmwU42aTpoNQ7WLEIwB23nksz69
5v85Kno2xD76R1FzpXcGREhtWoQT2SUpbm42caZbHVedAosYQ48EN+9rj7FNNgYD
PxiLFqt/+bM0IN73h+AXPuUCgYATPxixMyPhRX84m2XknSo1SSTLXEtEXNtJOTNR
euPr9ZAor28cGbGcUIJo6Wye7nXuO02JYzCS/ZHrAaV1VhTNqb35tUhxztRS5dZl
JQk638nKETuukITmvzpkjnOX44YSStBYkpb0IT0n3CDgAPC5ASv9AoWjLj//zP7f
2BM+nQKBgQDWqmKvtJr8vVzgjmokqRPn1JkYVCi7Dw+gVc1wTKxFqTKdPCBBDAsA
yKKa+447B5InBkick53Cb9mgOQjBJp7IzXvz6T7dXD+ZA1F4Lr0d4Bdj1SIBG1Iy
D3vQkJosHrQUqo2OlIvA5M9X4quMTMXi5Ov7NBz+6uhJ9LV9+dybHg==
-----END RSA PRIVATE KEY-----

27
conf/cert/pri.key Normal file
View File

@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEApR1i9yfKWYjo2Wp++f/mtM80/J+5whqhExLInEyYNoyqZ4j6
B3aJCsdFHIz3gb0NKZxQ//U//VG5nFUgceeXz5lGUtC4QksTPykHsFyU69gEhzPS
UQNQbg6khXWh1XbB0YdI1XAdHBuWFBRD8uu+9yuMCbJMOUChFKtlfdTqRrx/LKMW
vql0+XdMugjN3AHF6t72BITjgPG2wi6Ea94LqrTBRZwVLzVww1uMJGZ4HURAdAw8
igedU1oo+6wANNqc7yVLCOBjyLDNhoNaEF82RQmzOCkDBIf1fAEtDDJtDgHe0qXV
1SYMepjC3WdKy0E6u5uFKRXH4Uy7Oklw6M0JPQIDAQABAoIBAC3mYe0YJCHItAZA
myTPVSidU3sIwgBqG63sMlV023mKmBJpGyx48LbM13MM4v8veVnAaSoGWPAISINj
jL3tZh/hWZHLEPXo3eRYeRk3W3TGm9ej+crok3LM4kJxhXgMZ+vh4kbnQEhgiNNz
IMKGc5NNiUPmy1a9FypiTTfyOOBJsvLQB1yT9iHS6vJeoad+LkkQ7HNXWUYYniod
tQhToyByqviko0YNKtcnfgTaJYEikvfScneaT42+F6Nu/O33A/S2bJw2Gdns5///
K5dp07KMz4QiBAz+qTJRhFzonMsNtyMV0bvQnuzbspZcfOnLOiMJZNDQ6mmWoKrW
jHSeurcCgYEA0YHbpmKQQdgz6q5nRk8qgL9a6hIRMcvW/WzBF64CVmEvWXmjbKud
5Mb5ii8T07nfgRfKPnsqi66KHkZXlRWmHelQunvpNNuh4gXzXkVnphCV0gg7wVUm
hAC+SONe0/vcCUgJQOi/jSk6+KtwrRCAHg8FNLsb0a4xegNan8KCne8CgYEAycGV
0CQusFN9ecnnPUkSdXgUj4XkRj2+gZ9lqopSSJ4YB06GD6ofV+8dCF43UE5mNuY0
O1Yr+UjV5WE2/TtLisCw3KU8oCzHZehRQ0W8ymwwO+tlfKjiw9Tb0BSprAgAm9Aj
y9l19v78oWU3NvkM5L6xOaRTL7236bq/ldQCN5MCgYEAzzL9t8U85FHdrpjDfK6o
22HkmSA7LyNowYRAR5oJp8I/4N7C+KOV6X+7paU/l6L5X6PWmgqXnkOFR8HLtp8N
hgGMnJIVpvgcVvwJn89GXd+DPJB2AJOlHuHZTx7HVyF8kRVUSYSmhQYk03BCZHaw
LoouXOM79Riwx/nvM5dcNLMCgYBDAPSFFI8g5glk2gXe15a2xnNlmtzN6xGKsOot
shRTo5VtT8m8CA6ywGmO7uNF21Oc5eTw09R0zJikvh1qCjgzU30pOgMhWt253Wan
hdCGFVoLfEjPFrOAv/9kYoha5ql1FbHdsFG5/sLdwuSMcDe0/BOVhhpOX55llCyu
UKOP2wKBgFjjdJ8VcH2sUIoYmV7fNqpJAGj1eUIaL3pi3gSUrK2+ILSZLQHlavfb
DUa8FuURoneTm0Kp2X0/VLjv0AP724pWfCEoNb4hjRKMUuKKQJfXVfMYLzOdS2WV
6Sq/iNdo2KBylFXKieuBb/uE3FQ55fslg6AEwAa4XE3L60PIC4cc
-----END RSA PRIVATE KEY-----

85
conf/conf.ini Normal file
View File

@ -0,0 +1,85 @@
[service]
Domain = fontree
AppMode = local
HttpPort = :9020
Key=conf/cert/shop.fontree.cn.key
Cert=conf/cert/shop.fontree.cn.crt
IsHTTPS = false
OssDomain = false
ServerDM = "http://114.218.158.24:9020"
Env = local
DriverUrl = "http://114.218.158.24:9010/driver/login.html"
JaegerHost="jaeger:6831"
Cron = false
MapAppCode = 6e73489b6eaf4bbeb611e6b0fb70eab1
;AppointUrl = "http://appointtest2.szjixun.cn"
AppointUrl = "http://172.16.100.93:8026"
MaterialHost = "http://172.16.100.93:9046"
ApiHost = "http://114.218.158.24:9020"
YearGiftCheckHost = "http://gy.fontree.cn/pages/check/index?id="
BaiduMapAK = "3bAjKGA0pv7qvszGe98RsVZ04Ob5r4ZZ"
IsOut = false
OutUrl = "https://erpapi-out.szjixun.cn"
[file]
ImagePath = "./runtime/images"
ProjectMapDir = "/data/fonchain-main"
[bos]
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
Sk = "d2ecaa9d75114d3b9f42b99014198306"
BucketName = "dci-file-new"
BosUrl = ".bj.bcebos.com"
BosBaseDir = "fonchain-main"
BosHttp = "https://"
BosDomain = "cdns.fontree.cn"
[ding]
AccessToken: 1139fa5b9ee0dab11ecff51ac107ad2e92d09c121a693bdcc32013c44de8faee
Url: https://oapi.dingtalk.com/robot/send
[holiday]
ID: o6kqk3pftihvicgm
Secret: YmkrTDVRS0xjYjNaekFhL040ZisyZz09
SingleUrl: https://www.mxnzp.com/api/holiday/single/%v?ignoreHoliday=%v&app_id=%v&app_secret=%v
MultiUrl: https://www.mxnzp.com/api/holiday/multi/%v?ignoreHoliday=%v&app_id=%v&app_secret=%v
[rabbitmq]
User: "myuser"
Password: "mypass"
Host: "114.218.158.24"
Port: 9053
Vhost: "artist"
[shop]
ShopHost = "http://114.218.158.24:9088"
[es]
;ElasticHost: http://192.168.12.3:9085
ElasticHost: "http://elstic-es.fontree.cn"
ApprovalIndex: "approval"
[redis]
RedisDB:
RedisAddr: 127.0.0.1:6379
RedisPW:
RedisDBNAme: 15
[zap]
Level= "info"
Filename= "runtime/logs/zap/main.log"
MaxSize= "100"
MaxAge= "30"
MaxBackups= "30"
[oss]
AccessKeyId = "LTAI5tLz1fSK53FQAEC9uNSb"
AccessKeySecret = "oGB9chrQzQzITXR2IGv37Ji5WxZh4j"
Endpoint = "oss-cn-hangzhou.aliyuncs.com"
BucketName = "fontree-test"
BaseDir = "fonchain-main"
CdnHost = "https://cdn-test.szjixun.cn"
[msg]
defaultSignNo= 220028
[send]
SendTime = 3
XMChannelId = ""
OPChannelId = ""
OPNotifyLevel = 1
[mail_artwork];画家宝退画配置
;EditReturnArtworkUrl = "https://artisttest.fontree.cn/api/v3/mail/show/address/confirm"
EditReturnArtworkUrl = "https://artisttest.fontree.cn/pages/transferPage/returnArtworkAddress"

95
conf/dev/conf.ini Normal file
View File

@ -0,0 +1,95 @@
[service]
Domain = fontree
AppMode = local
HttpPort = :8084
Key=conf/cert/shop.fontree.cn.key
Cert=conf/cert/shop.fontree.cn.crt
RunHTTPS = false
IsHTTPS = false
OssDomain = false
ServerDM = "http://192.168.1.26:8084"
Env = dev
DriverUrl = "http://114.218.158.24:9010/driver/login.html"
JaegerHost="127.0.0.1:6831"
JaegerOpen = true
Cron = false
MapAppCode = 6e73489b6eaf4bbeb611e6b0fb70eab1
;AppointUrl = "http://appointtest2.szjixun.cn"
AppointUrl = "http://172.16.100.93:8026"
MaterialHost = "http://172.16.100.93:9046"
ApiHost = "http://114.218.158.24:9020"
YearGiftCheckHost = "http://gy.fontree.cn/pages/check/index?id="
BaiduMapAK = "3bAjKGA0pv7qvszGe98RsVZ04Ob5r4ZZ"
[file]
ImagePath = "./runtime/images"
ProjectMapDir = "D:\GOPATH\src\github.com\fonchain-main"
[bos]
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
Sk = "d2ecaa9d75114d3b9f42b99014198306"
BucketName = "dci-file-new"
BosUrl = ".bj.bcebos.com"
BosBaseDir = "fonchain-main"
BosHttp = "https://"
BosDomain = "cdns.fontree.cn"
[redis]
RedisDB:
RedisAddr: 127.0.0.1:6379
;RedisPW: kP6tW4tS3qB2dW4aE6uI5cX2
RedisPW: "7532T6R"
RedisDBNAme: 15
[ding]
AccessToken: 1139fa5b9ee0dab11ecff51ac107ad2e92d09c121a693bdcc32013c44de8faee
Url: https://oapi.dingtalk.com/robot/send
[holiday]
ID: o6kqk3pftihvicgm
Secret: YmkrTDVRS0xjYjNaekFhL040ZisyZz09
SingleUrl: https://www.mxnzp.com/api/holiday/single/%v?ignoreHoliday=%v&app_id=%v&app_secret=%v
MultiUrl: https://www.mxnzp.com/api/holiday/multi/%v?ignoreHoliday=%v&app_id=%v&app_secret=%v
[rabbitmq]
User: "myuser"
Password: "mypass"
Host: "localhost"
Port: 5672
Vhost: "artist"
VhostArtwork: "artwork"
vhostCopyright: "copyright"
[shop]
ShopHost = "http://114.218.158.24:9088"
[es]
;ElasticHost: http://121.228.2.240:9026
ElasticHost: http://172.16.100.91:9026
;ElasticHost: "http://elstic-es.fontree.cn"
ApprovalIndex: "approval"
[api]
erpak:"tjazzvQxyVg4wZ8zECCW"
erpsk:"7eBq75ZuF7xKH34vr2DK"
SendIndexesUrl: "https://itest.tyfon.com.cn/ecmall/api/brandPoint"
chatGptHost: "http://127.0.0.1:9010"
[aliyun]
accessKeyId:"LTAI5tNjFwVMpf6RDoKkrdVF"
accessKeySecret:"oZ5yDVoLT1RiFij3xofCXkP6GZs6Tm"
[zap]
Level= "info"
Filename= "runtime/logs/zap/main.log"
MaxSize= "100"
MaxAge= "30"
MaxBackups= "30"
[oss]
AccessKeyId = "LTAI5tLz1fSK53FQAEC9uNSb"
AccessKeySecret = "oGB9chrQzQzITXR2IGv37Ji5WxZh4j"
Endpoint = "oss-cn-hangzhou.aliyuncs.com"
BucketName = "fontree-test"
BaseDir = "fonchain-main"
CdnHost = "https://cdn-test.szjixun.cn"
[pdf]
Host = "https://gotenberg.szjixun.cn"
[send]
SendTime = 3
XMChannelId = ""
OPChannelId = ""
OPNotifyLevel = 1
[mail_artwork];画家宝退画配置
;EditReturnArtworkUrl = "https://artisttest.fontree.cn/api/returnArtwork/edit"
EditReturnArtworkUrl = "https://artisttest.fontree.cn/pages/transferPage/returnArtworkAddress"

398
conf/dev/dubbogo.yaml Normal file
View File

@ -0,0 +1,398 @@
dubbo:
registries:
demoZK:
protocol: zookeeper
timeout: 3s
# address: 121.229.45.214:9004
address: 127.0.0.1:2181
# address: 114.218.158.24:2181
consumer:
filter: tracing
request-timeout: 30s
references:
ChainClientImpl:
timeout: 40s
protocol: tri
interface: com.fontree.microservices.common.chain
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-Chain-04"
.secretAccessKey: "Al-Chain-FDF112"
methods:
- name: "UploadFile"
retries: 0
- name: "CoWtChain"
retries: 0
AccountClientImpl:
protocol: tri
retries: 0
interface: com.fontree.microservices.common.Account
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "Accountksl"
.secretAccessKey: "BSDY-FDF1-Fontree_account"
OrderClientImpl:
retries: 0
protocol: tri
interface: com.fontree.microservices.common.order # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-order-04"
.secretAccessKey: "Al-order-FDF112"
EmployeeClientImpl:
retries: 0
protocol: tri
interface: com.fontree.microservices.common.employee # must be compatible with grpc or dubbo-java
filter: sign
params:
.accessKeyId: "SYD8-employee-04"
.secretAccessKey: "Al-employee-FDF112"
PatentClientImpl:
protocol: tri
interface: com.fontree.microservices.common.patent # must be compatible with grpc or dubbo-java
filter: sign
params:
.accessKeyId: "SYD8-patent-04"
.secretAccessKey: "Al-patent-FDF112"
DepartmentClientImpl:
interface: com.fontree.microservices.common.Department # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-23DF"
.secretAccessKey: "BSDY-FDF1"
PositionClientImpl:
interface: com.fontree.microservices.common.Position # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-23DF"
.secretAccessKey: "BSDY-FDF1"
methods:
- name: "Update"
retries: 0
RuleClientImpl:
interface: com.fontree.microservices.common.Rule # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-23DF"
.secretAccessKey: "BSDY-FDF1"
methods:
- name: "Create"
retries: 0
RuleLogClientImpl:
interface: com.fontree.microservices.common.RuleLog # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-23DF"
.secretAccessKey: "BSDY-FDF1"
methods:
- name: "Create"
retries: 0
TaskClientImpl:
interface: com.fontree.microservices.common.task # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
protocol: tri
params:
.accessKeyId: "SYD8-task-04"
.secretAccessKey: "Al-task-FDF112"
ApprovalClientImpl:
interface: com.fontree.microservices.common.Approval # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-Approval-12"
.secretAccessKey: "Al-Approval-FDF1"
ArtistClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Artist
# filter: authFilter
ArtworkClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Artwork
# filter: authFilter
ArtworkQueryClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtworkQuery
# filter: authFilter
LogClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Log
NoteClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Note
ShopBrandClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ShopBrand
ArtShowClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtShow
ArtworkChainClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtworkChain
WorkbenchClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Workbench
ArtworkThirdPartyClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtworkThirdParty
DrawClientImpl:
timeout: 100s
protocol: tri
interface: com.fontree.microservices.common.Draw
methods:
- name: "AddAccount"
retries: 0
methods:
- name: "SetResult"
retries: 0
BackupClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Backup
PushClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Push
SeriesClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.series
group: shop
BrandClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.ShopBrand
group: shop
CollectionsClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Collections
ArtistThirdPartyClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistThirdParty
PaybillClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Paybill
PrebookClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Prebook
OrderproductClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Orderproduct
HealthClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Health
PreorderClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Preorder
ExpressClientImpl:
timeout: 30s
retries: 0
interface: com.fontree.microservices.common.express # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-express-04"
.secretAccessKey: "Al-express-FDF112"
#画家宝服务端6个
ArtistInfoUserClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfoUser
ArtistInfoArtworkClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfoArtwork
ArtistInfoArtshowClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfoArtshow
ArtistInfoContractClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfoContract
ArtistInfoStatementClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfoStatement
InCircleArticleClientImpl:
protocol: tri
interface: com.fontree.microservices.common.InCircleArticleProvider
ArtworkShopClientImpl:
timeout: 60s
protocol: tri
interface: com.fontree.microservices.common.ArtworkShop
OAClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.OA
JournalClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Journal
MealAccountClientImpl:
protocol: tri
interface: com.fontree.microservices.meal.backend.account
group: meal
MealGoodsClientImpl:
protocol: tri
interface: com.fontree.microservices.meal.backend.goods
group: meal
MealOrderClientImpl:
protocol: tri
interface: com.fontree.microservices.meal.backend.order
group: meal
IndentClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Indent
AppointmentClientImpl:
protocol: tri
interface: com.fontree.microservices.common.AppointmentNew
BuyClientImpl:
protocol: tri
interface: com.fontree.microservices.common.BuyNew
CollectionRecordClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.collection_record
RecruitClientImpl:
protocol: tri
filter: tps
interface: com.fonchain.approval.proto.IApprovalService
GoodsManagementClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.GoodsManagement
InventoryClientImpl:
timeout: 15s
retries: 0
interface: com.fontree.microservices.common.inventory # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "inventoryksl"
.secretAccessKey: "BSDY-FDF1-Fontree_inventory"
WarehouseClientImpl:
timeout: 15s
retries: 0
interface: com.fontree.microservices.common.warehouse # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "inventoryksl"
.secretAccessKey: "BSDY-FDF1-Fontree_inventory"
PaymentClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.payment
params:
.accessKeyId: "SYD8-pay-04"
.secretAccessKey: "Al-pay-FDF112"
ExamClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Exam
CopyrightClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.digital.copyright
DciClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.chain.dci
SiteSignInClientImpl:
protocol: tri
interface: com.fontree.microservices.common.SiteSignIn
ChainBrowserClientImpl:
protocol: tri
interface: com.fontree.microservices.chain.browser
group: chain
SoftwareCopyrightClientImpl:
protocol: tri
interface: com.fontree.microservices.common.SoftwareCopyright
TrademarkClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Trademark
CoinClientImpl:
protocol: tri
interface: com.fontree.microservices.common.coin
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
retries: 0
params:
.accessKeyId: "Accountksl"
.secretAccessKey: "BSDY-FDF1-Fontree_account"
FeedbackClientImpl:
protocol: tri
interface: com.fontree.microservices.common.feedback
ExhibitionFClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ExhibitionF
InvoiceClientImpl:
interface: com.fontree.microservices.common.Invoice
retries: 100
BlockchainClientImpl:
interface: com.fontree.microservices.common.Blockchain
retries: 100
EquityClientImpl:
retries: 0
protocol: tri
timeout: 100s
interface: com.fontree.microservices.common.Equity
LoanBillClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.digital.loanbill
ConferenceClientImpl:
interface: com.fontree.microservices.common.Conference
DocumentContractClientImpl:
interface: com.fontree.microservices.common.DocumentContract
ChildrenCompetitionClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.ChildrenCompetition
ECardClientImpl:
interface: com.fontree.microservices.common.ECard
retries: 0
timeout: 100s
ChatRecordClientImpl:
interface: com.fontree.microservices.common.AsChat
protocol: tri
MailArtworkClientImpl:
protocol: tri
interface: com.fontree.microservices.common.MailArtworkProvider
OperationRecordClientImpl:
protocol: tri
interface: com.fontree.microservices.common.OperationRecordProvider
logger:
zap-config:
level: error # 日志级别
development: false
disableCaller: false
disableStacktrace: false
encoding: "json"
# zap encoder 配置
encoder-config:
messageKey: "message"
levelKey: "level"
timeKey: "time"
nameKey: "logger"
callerKey: "caller"
stacktraceKey: "stacktrace"
level-encoder: "capital"
timeEncoder: "iso8601"
durationEncoder: "seconds"
callerEncoder: "short"
nameEncoder: ""
EncodeTime: zapcore.TimeEncoderOfLayout("2006-01-02 15:04:05.000"),
EncodeDuration: zapcore.SecondsDurationEncoder,
outputPaths:
- "stderr"
errorOutputPaths:
- "stderr"
lumberjack-config:
# 写日志的文件名称
filename: "logs/main.log"
# 每个日志文件长度的最大大小,单位是 MiB。默认 100MiB
maxSize: 10
# 日志保留的最大天数(只保留最近多少天的日志)
maxAge: 15
# 只保留最近多少个日志文件,用于控制程序总日志的大小
maxBackups: 10
# 是否使用本地时间,默认使用 UTC 时间
localTime: true
# 是否压缩日志文件,压缩方法 gzip
compress: false

377
conf/dubbogo.yaml Normal file
View File

@ -0,0 +1,377 @@
dubbo:
registries:
demoZK:
protocol: zookeeper
timeout: 3s
# address: 121.229.45.214:9004
address: 127.0.0.1:2181
# address: 172.16.100.93:2181
consumer:
request-timeout: 30s
references:
ChainClientImpl:
timeout: 40s
protocol: tri
interface: com.fontree.microservices.common.chain
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-Chain-04"
.secretAccessKey: "Al-Chain-FDF112"
methods:
- name: "UploadFile"
retries: 0
- name: "CoWtChain"
retries: 0
AccountClientImpl:
protocol: tri
retries: 0
interface: com.fontree.microservices.common.Account
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "Accountksl"
.secretAccessKey: "BSDY-FDF1-Fontree_account"
OrderClientImpl:
retries: 0
protocol: tri
interface: com.fontree.microservices.common.order # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-order-04"
.secretAccessKey: "Al-order-FDF112"
EmployeeClientImpl:
retries: 0
protocol: tri
interface: com.fontree.microservices.common.employee # must be compatible with grpc or dubbo-java
filter: sign
params:
.accessKeyId: "SYD8-employee-04"
.secretAccessKey: "Al-employee-FDF112"
PatentClientImpl:
protocol: tri
interface: com.fontree.microservices.common.patent # must be compatible with grpc or dubbo-java
filter: sign
params:
.accessKeyId: "SYD8-patent-04"
.secretAccessKey: "Al-patent-FDF112"
DomainNameClientImpl:
protocol: tri
interface: com.fontree.microservices.common.domainName # must be compatible with grpc or dubbo-java
filter: sign
params:
.accessKeyId: "SYD8-domainName-04"
.secretAccessKey: "Al-domainName-FDF112"
DepartmentClientImpl:
interface: com.fontree.microservices.common.Department # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-23DF"
.secretAccessKey: "BSDY-FDF1"
PositionClientImpl:
interface: com.fontree.microservices.common.Position # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-23DF"
.secretAccessKey: "BSDY-FDF1"
methods:
- name: "Update"
retries: 0
RuleClientImpl:
interface: com.fontree.microservices.common.Rule # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-23DF"
.secretAccessKey: "BSDY-FDF1"
methods:
- name: "Create"
retries: 0
RuleLogClientImpl:
interface: com.fontree.microservices.common.RuleLog # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-23DF"
.secretAccessKey: "BSDY-FDF1"
methods:
- name: "Create"
retries: 0
TaskClientImpl:
interface: com.fontree.microservices.common.task # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
protocol: tri
params:
.accessKeyId: "SYD8-task-04"
.secretAccessKey: "Al-task-FDF112"
ApprovalClientImpl:
interface: com.fontree.microservices.common.Approval # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-Approval-12"
.secretAccessKey: "Al-Approval-FDF1"
ArtistClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Artist
# filter: authFilter
ArtworkClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Artwork
# filter: authFilter
ArtworkQueryClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtworkQuery
# filter: authFilter
LogClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Log
NoteClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Note
ArtShowClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtShow
ArtworkChainClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtworkChain
AppointmentClientImpl:
protocol: tri
interface: com.fontree.microservices.common.AppointmentNew
ArtArtworkClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtArtwork
WorkbenchClientImpl:
protocol: tri
params:
max-call-send-msg-size: 70000000
max-call-recv-msg-size: 70000000
interface: com.fontree.microservices.common.Workbench
ArtworkThirdPartyClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtworkThirdParty
DrawClientImpl:
timeout: 200s
protocol: tri
interface: com.fontree.microservices.common.Draw
methods:
- name: "AddAccount"
retries: 0
BackupClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Backup
SeriesClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.series
group: shop
PushClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Push
BrandClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.ShopBrand
group: shop
CollectionsClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Collections
PaybillClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Paybill
PrebookClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Prebook
OrderproductClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Orderproduct
HealthClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Health
PreorderClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Preorder
ExpressClientImpl:
retries: 0
interface: com.fontree.microservices.common.express # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-express-04"
.secretAccessKey: "Al-express-FDF112"
#画家宝服务端6个
ArtistInfoUserClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfoUser
filter: fonValidateFilter
ArtistInfoArtworkClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfoArtwork
filter: fonValidateFilter
ArtistInfoArtshowClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfoArtshow
filter: fonValidateFilter
ArtistInfoContractClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfoContract
ArtistInfoStatementClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfoStatement
retries: 100
InCircleArticleClientImpl:
protocol: tri
interface: com.fontree.microservices.common.InCircleArticleProvider
OAClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.OA
JournalClientImpl:
protocol: tri
filter: tps
params:
max-call-send-msg-size: 80000000
max-call-recv-msg-size: 80000000
interface: com.fontree.microservices.common.Journal
IndentClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Indent
InventoryClientImpl:
timeout: 15s
retries: 0
interface: com.fontree.microservices.common.inventory # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "inventoryksl"
.secretAccessKey: "BSDY-FDF1-Fontree_inventory"
WarehouseClientImpl:
timeout: 15s
retries: 0
interface: com.fontree.microservices.common.warehouse # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "inventoryksl"
.secretAccessKey: "BSDY-FDF1-Fontree_inventory"
PaymentClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.payment
params:
.accessKeyId: "SYD8-pay-04"
.secretAccessKey: "Al-pay-FDF112"
CollectionRecordClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.collection_record
RecruitClientImpl:
protocol: tri
filter: tps
interface: com.fonchain.approval.proto.IApprovalService
GoodsManagementClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.GoodsManagement
ExamClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Exam
SiteSignInClientImpl:
protocol: tri
interface: com.fontree.microservices.common.SiteSignIn
BuyClientImpl:
protocol: tri
interface: com.fontree.microservices.common.BuyNew
SoftwareCopyrightClientImpl:
protocol: tri
interface: com.fontree.microservices.common.SoftwareCopyright
TrademarkClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Trademark
CoinClientImpl:
protocol: tri
interface: com.fontree.microservices.common.coin
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
retries: 0
params:
.accessKeyId: "Accountksl"
.secretAccessKey: "BSDY-FDF1-Fontree_account"
FeedbackClientImpl:
protocol: tri
interface: com.fontree.microservices.common.feedback
ExhibitionFClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ExhibitionF
InvoiceClientImpl:
interface: com.fontree.microservices.common.Invoice
retries: 100
BlockchainClientImpl:
interface: com.fontree.microservices.common.Blockchain
retries: 100
EquityClientImpl:
retries: 0
protocol: tri
timeout: 100s
interface: com.fontree.microservices.common.Equity
ConferenceClientImpl:
interface: com.fontree.microservices.common.Conference
DocumentContractClientImpl:
interface: com.fontree.microservices.common.DocumentContract
ChildrenCompetitionClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.ChildrenCompetition
ECardClientImpl:
interface: com.fontree.microservices.common.ECard
retries: 0
timeout: 100s
ChatRecordClientImpl:
interface: com.fontree.microservices.common.AsChat
protocol: tri
MailArtworkClientImpl:
protocol: tri
interface: com.fontree.microservices.common.MailArtworkProvider
OperationRecordClientImpl:
protocol: tri
interface: com.fontree.microservices.common.OperationRecordProvider
logger:
zap-config:
level: info # 日志级别
development: false
disableCaller: false
disableStacktrace: false
encoding: "json"
# zap encoder 配置
encoderConfig:
messageKey: "message"
levelKey: "level"
timeKey: "time"
nameKey: "logger"
callerKey: "caller"
stacktraceKey: "stacktrace"
lineEnding: ""
levelEncoder: "capitalColor"
timeEncoder: "iso8601"
durationEncoder: "seconds"
callerEncoder: "short"
nameEncoder: ""
EncodeTime: zapcore.TimeEncoderOfLayout("2006-01-02 15:04:05.000"),
EncodeDuration: zapcore.SecondsDurationEncoder,
outputPaths:
- "stderr"
errorOutputPaths:
- "stderr"
lumberjack-config:
# 写日志的文件名称
filename: "logs/main.log"
# 每个日志文件长度的最大大小,单位是 MiB。默认 100MiB
maxSize: 10
# 日志保留的最大天数(只保留最近多少天的日志)
maxAge: 15
# 只保留最近多少个日志文件,用于控制程序总日志的大小
maxBackups: 10
# 是否使用本地时间,默认使用 UTC 时间
localTime: true
# 是否压缩日志文件,压缩方法 gzip
compress: false

95
conf/k8s/conf.ini Normal file
View File

@ -0,0 +1,95 @@
[service]
Domain = fontree
AppMode = prod
HttpPort = :9020
Key=conf/cert/erpapi.fontree.cn.key
Cert=conf/cert/erpapi.fontree.cn.crt
RunHTTPS = false
IsHTTPS = true
OssDomain = false
ServerDM = "http://192.168.88.6:9020"
Env = prod
DriverUrl = "https://erp.fontree.cn/driver/login.html"
JaegerHost="jaeger:6831"
Cron = true
;AppointUrl = "http://appointtest2.szjixun.cn"
AppointUrl = "https://train.szjixun.cn"
MaterialHost = "https://material.szjixun.cn"
ApiHost = "https://erpapi.fontree.cn"
YearGiftCheckHost = "http://gift.fontree.cn/pages/check/index?id="
BaiduMapAK = "3bAjKGA0pv7qvszGe98RsVZ04Ob5r4ZZ"
IsOut = false
OutUrl = "https://erpapi-out.szjixun.cn"
[file]
ImagePath = "./runtime/images"
ProjectMapDir = "/data/fonchain-main"
[bos]
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
Sk = "d2ecaa9d75114d3b9f42b99014198306"
BucketName = "dci-file-new"
BosUrl = ".bj.bcebos.com"
BosBaseDir = "fonchain-main"
BosHttp = "https://"
BosDomain = "cdns.fontree.cn"
[redis]
RedisDB = 15
RedisAddr = "svc-fontree-redis-service:6379"
RedisPW = "fonchain_opv:kP6tW4tS3qB2dW4aE6uI5cX2"
RedisDBNAme = 15
[ding]
AccessToken: 1139fa5b9ee0dab11ecff51ac107ad2e92d09c121a693bdcc32013c44de8faee
Url: https://oapi.dingtalk.com/robot/send
[holiday]
ID: o6kqk3pftihvicgm
Secret: YmkrTDVRS0xjYjNaekFhL040ZisyZz09
SingleUrl: https://www.mxnzp.com/api/holiday/single/%v?ignoreHoliday=%v&app_id=%v&app_secret=%v
MultiUrl: https://www.mxnzp.com/api/holiday/multi/%v?ignoreHoliday=%v&app_id=%v&app_secret=%v
[rabbitmq]
User: "MjphbXFwLWNuLXBlMzM2d2ltcjAwNzpMVEFJNXRORXZGSGNTRlVBN1paMXk2RHo="
Password: "MDM4NDBEMEEwN0NCRUQ3OTE0QzQ0M0YxQjE0MThBNzJBMEIwNTNGRDoxNjgyNTYyNzkyNzUy"
Host: "amqp-cn-pe336wimr007.cn-hangzhou.amqp-8.net.mq.amqp.aliyuncs.com"
Port: 5672
Vhost: "artist"
VhostArtwork: "artwork"
vhostCopyright: "copyright"
[shop]
ShopHost = "https://shop.szjixun.cn"
[es]
;ElasticHost: http://121.228.2.240:9026
ElasticHost: "http://elstic-es.fontree.cn"
ApprovalIndex: approval_in
[api]
SendIndexesUrl: "https://ivos.tyfon.com.cn/ecmall/api/brandPoint"
;chatGptHost: "http://chatgpt.fontree.cn"
;chatGptHost: "http://47.242.86.11:9010"
chatGptHost: "https://chatgpt.fontree.cn"
[aliyun]
accessKeyId:"LTAI5tNjFwVMpf6RDoKkrdVF"
accessKeySecret:"oZ5yDVoLT1RiFij3xofCXkP6GZs6Tm"
[zap]
Level= "info"
Filename= "runtime/logs/zap/main.log"
MaxSize= "100"
MaxAge= "30"
MaxBackups= "30"
[oss]
AccessKeyId = "LTAI5tHfjSmWXHqfWgaL7Uo5"
AccessKeySecret = "kOPctFZ3DHsbdSSym1fLyDK39hkzPI"
Endpoint = "oss-cn-hangzhou-internal.aliyuncs.com"
BucketName = "erp-k8s-store"
BaseDir = "fonchain-main"
CdnHost = "https://e-cdn.fontree.cn"
[msg]
defaultSignNo= 220028
[pdf]
Host = "https://gotenberg.szjixun.cn"
[send]
SendTime = 3
XMChannelId = "129831"
OPChannelId = ""
OPNotifyLevel = 1
Route = "/moceapp"
[mail_artwork];画家宝退画配置
EditReturnArtworkUrl = "https://artistv3.szjixun.cn/pages/transferPage/returnArtworkAddress"

406
conf/k8s/dubbogo.yaml Normal file
View File

@ -0,0 +1,406 @@
dubbo:
registries:
demoZK:
protocol: zookeeper
timeout: 3s
# address: 121.229.45.214:9004
address: zookeeper:2181
# address: 114.218.158.24:2181
consumer:
filter: tracing
request-timeout: 30s
references:
ChainClientImpl:
timeout: 40s
protocol: tri
interface: com.fontree.microservices.common.chain
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-Chain-04"
.secretAccessKey: "Al-Chain-FDF112"
methods:
- name: "UploadFile"
retries: 0
- name: "CoWtChain"
retries: 0
AccountClientImpl:
protocol: tri
retries: 0
interface: com.fontree.microservices.common.Account
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "Accountksl"
.secretAccessKey: "BSDY-FDF1-Fontree_account"
OrderClientImpl:
retries: 0
protocol: tri
interface: com.fontree.microservices.common.order # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-order-04"
.secretAccessKey: "Al-order-FDF112"
EmployeeClientImpl:
retries: 0
protocol: tri
interface: com.fontree.microservices.common.employee # must be compatible with grpc or dubbo-java
filter: sign
params:
.accessKeyId: "SYD8-employee-04"
.secretAccessKey: "Al-employee-FDF112"
PatentClientImpl:
protocol: tri
interface: com.fontree.microservices.common.patent # must be compatible with grpc or dubbo-java
filter: sign
params:
.accessKeyId: "SYD8-patent-04"
.secretAccessKey: "Al-patent-FDF112"
DomainNameClientImpl:
protocol: tri
interface: com.fontree.microservices.common.domainName # must be compatible with grpc or dubbo-java
filter: sign
params:
.accessKeyId: "SYD8-domainName-04"
.secretAccessKey: "Al-domainName-FDF112"
DepartmentClientImpl:
interface: com.fontree.microservices.common.Department # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-23DF"
.secretAccessKey: "BSDY-FDF1"
PositionClientImpl:
interface: com.fontree.microservices.common.Position # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-23DF"
.secretAccessKey: "BSDY-FDF1"
methods:
- name: "Update"
retries: 0
RuleClientImpl:
interface: com.fontree.microservices.common.Rule # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-23DF"
.secretAccessKey: "BSDY-FDF1"
methods:
- name: "Create"
retries: 0
RuleLogClientImpl:
interface: com.fontree.microservices.common.RuleLog # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-23DF"
.secretAccessKey: "BSDY-FDF1"
methods:
- name: "Create"
retries: 0
TaskClientImpl:
interface: com.fontree.microservices.common.task # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
protocol: tri
params:
.accessKeyId: "SYD8-task-04"
.secretAccessKey: "Al-task-FDF112"
ApprovalClientImpl:
interface: com.fontree.microservices.common.Approval # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-Approval-12"
.secretAccessKey: "Al-Approval-FDF1"
payload: 12582912
ArtistClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Artist
# filter: authFilter
ArtworkClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Artwork
# filter: authFilter
ArtworkQueryClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtworkQuery
# filter: authFilter
LogClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Log
NoteClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Note
ShopBrandClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ShopBrand
ArtShowClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtShow
ArtworkChainClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtworkChain
WorkbenchClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Workbench
ArtworkThirdPartyClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtworkThirdParty
DrawClientImpl:
timeout: 100s
protocol: tri
interface: com.fontree.microservices.common.Draw
methods:
- name: "AddAccount"
retries: 0
methods:
- name: "SetResult"
retries: 0
BackupClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Backup
PushClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Push
SeriesClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.series
group: shop
BrandClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.ShopBrand
group: shop
CollectionsClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Collections
ArtistThirdPartyClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistThirdParty
PaybillClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Paybill
PrebookClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Prebook
OrderproductClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Orderproduct
HealthClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Health
PreorderClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Preorder
ExpressClientImpl:
timeout: 30s
retries: 0
interface: com.fontree.microservices.common.express # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-express-04"
.secretAccessKey: "Al-express-FDF112"
#画家宝服务端6个
ArtistInfoUserClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfoUser
ArtistInfoArtworkClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfoArtwork
ArtistInfoArtshowClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfoArtshow
ArtistInfoContractClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfoContract
ArtistInfoStatementClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfoStatement
InCircleArticleClientImpl:
protocol: tri
interface: com.fontree.microservices.common.InCircleArticleProvider
ArtworkShopClientImpl:
timeout: 60s
protocol: tri
interface: com.fontree.microservices.common.ArtworkShop
OAClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.OA
JournalClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Journal
MealAccountClientImpl:
protocol: tri
interface: com.fontree.microservices.meal.backend.account
group: meal
MealGoodsClientImpl:
protocol: tri
interface: com.fontree.microservices.meal.backend.goods
group: meal
MealOrderClientImpl:
protocol: tri
interface: com.fontree.microservices.meal.backend.order
group: meal
IndentClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Indent
AppointmentClientImpl:
protocol: tri
interface: com.fontree.microservices.common.AppointmentNew
BuyClientImpl:
protocol: tri
interface: com.fontree.microservices.common.BuyNew
CollectionRecordClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.collection_record
RecruitClientImpl:
protocol: tri
filter: tps
interface: com.fonchain.approval.proto.IApprovalService
GoodsManagementClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.GoodsManagement
InventoryClientImpl:
timeout: 15s
retries: 0
interface: com.fontree.microservices.common.inventory # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "inventoryksl"
.secretAccessKey: "BSDY-FDF1-Fontree_inventory"
WarehouseClientImpl:
timeout: 15s
retries: 0
interface: com.fontree.microservices.common.warehouse # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "inventoryksl"
.secretAccessKey: "BSDY-FDF1-Fontree_inventory"
PaymentClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.payment
params:
.accessKeyId: "SYD8-pay-04"
.secretAccessKey: "Al-pay-FDF112"
ExamClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Exam
CopyrightClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.digital.copyright
DciClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.chain.dci
SiteSignInClientImpl:
protocol: tri
interface: com.fontree.microservices.common.SiteSignIn
ChainBrowserClientImpl:
protocol: tri
interface: com.fontree.microservices.chain.browser
group: chain
SoftwareCopyrightClientImpl:
protocol: tri
interface: com.fontree.microservices.common.SoftwareCopyright
TrademarkClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Trademark
CoinClientImpl:
protocol: tri
interface: com.fontree.microservices.common.coin
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
retries: 0
params:
.accessKeyId: "Accountksl"
.secretAccessKey: "BSDY-FDF1-Fontree_account"
FeedbackClientImpl:
protocol: tri
interface: com.fontree.microservices.common.feedback
ExhibitionFClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ExhibitionF
InvoiceClientImpl:
interface: com.fontree.microservices.common.Invoice
retries: 100
BlockchainClientImpl:
interface: com.fontree.microservices.common.Blockchain
retries: 100
EquityClientImpl:
retries: 0
protocol: tri
timeout: 100s
interface: com.fontree.microservices.common.Equity
LoanBillClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.digital.loanbill
ConferenceClientImpl:
interface: com.fontree.microservices.common.Conference
DocumentContractClientImpl:
interface: com.fontree.microservices.common.DocumentContract
ChildrenCompetitionClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.ChildrenCompetition
ECardClientImpl:
interface: com.fontree.microservices.common.ECard
retries: 0
timeout: 100s
ChatRecordClientImpl:
interface: com.fontree.microservices.common.AsChat
protocol: tri
MailArtworkClientImpl:
protocol: tri
interface: com.fontree.microservices.common.MailArtworkProvider
OperationRecordClientImpl:
protocol: tri
interface: com.fontree.microservices.common.OperationRecordProvider
logger:
zap-config:
level: error # 日志级别
development: false
disableCaller: false
disableStacktrace: false
encoding: "json"
# zap encoder 配置
encoder-config:
messageKey: "message"
levelKey: "level"
timeKey: "time"
nameKey: "logger"
callerKey: "caller"
stacktraceKey: "stacktrace"
level-encoder: "capital"
timeEncoder: "iso8601"
durationEncoder: "seconds"
callerEncoder: "short"
nameEncoder: ""
EncodeTime: zapcore.TimeEncoderOfLayout("2006-01-02 15:04:05.000"),
EncodeDuration: zapcore.SecondsDurationEncoder,
outputPaths:
- "stderr"
errorOutputPaths:
- "stderr"
lumberjack-config:
# 写日志的文件名称
filename: "logs/main.log"
# 每个日志文件长度的最大大小,单位是 MiB。默认 100MiB
maxSize: 10
# 日志保留的最大天数(只保留最近多少天的日志)
maxAge: 15
# 只保留最近多少个日志文件,用于控制程序总日志的大小
maxBackups: 10
# 是否使用本地时间,默认使用 UTC 时间
localTime: true
# 是否压缩日志文件,压缩方法 gzip
compress: false

105
conf/test/conf.ini Normal file
View File

@ -0,0 +1,105 @@
[service]
Domain = fontree
AppMode = debug
HttpPort = :9020
Key=conf/cert/shop.fontree.cn.key
Cert=conf/cert/shop.fontree.cn.crt
RunHTTPS = false
IsHTTPS = false
OssDomain = false
ServerDM = "http://114.218.158.24:9020"
Env = test
DriverUrl = "http://114.218.158.24:9010/driver/login.html"
JaegerHost="172.16.100.93:9031"
JaegerOpen = true
Cron = true
MapAppCode = 6e73489b6eaf4bbeb611e6b0fb70eab1
;AppointUrl = "http://appointtest2.szjixun.cn"
AppointUrl = "http://172.16.100.93:8026"
MaterialHost = "http://172.16.100.93:9046"
ApiHost = "http://114.218.158.24:9020"
YearGiftCheckHost = "http://gy.fontree.cn/pages/check/index?id="
BaiduMapAK = "3bAjKGA0pv7qvszGe98RsVZ04Ob5r4ZZ"
IsOut = false
OutUrl = "https://erpapi-out.szjixun.cn"
[file]
ImagePath = "./runtime/images"
ProjectMapDir = "/data/fonchain-main"
[bos]
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
Sk = "d2ecaa9d75114d3b9f42b99014198306"
BucketName = "dci-file-new"
BosUrl = ".bj.bcebos.com"
BosBaseDir = "fonchain-main"
BosHttp = "https://"
BosDomain = "cdns.fontree.cn"
[ding]
AccessToken: 1139fa5b9ee0dab11ecff51ac107ad2e92d09c121a693bdcc32013c44de8faee
Url: https://oapi.dingtalk.com/robot/send
[holiday]
ID: o6kqk3pftihvicgm
Secret: YmkrTDVRS0xjYjNaekFhL040ZisyZz09
SingleUrl: https://www.mxnzp.com/api/holiday/single/%v?ignoreHoliday=%v&app_id=%v&app_secret=%v
MultiUrl: https://www.mxnzp.com/api/holiday/multi/%v?ignoreHoliday=%v&app_id=%v&app_secret=%v
[rabbitmq]
User: "myuser"
Password: "mypass"
Host: "172.16.100.93"
Port: 9053
Vhost: "artist"
VhostArtwork: "artwork"
vhostCopyright: "copyright"
[redis]
RedisDB:
RedisAddr: 172.16.100.93:9008
RedisPW:
RedisDBNAme: 15
[shop]
ShopHost = "http://114.218.158.24:9088"
[es]
ElasticHost: http://172.16.100.91:9026
;ElasticHost: "http://elstic-es.fontree.cn"
ApprovalIndex: "approval"
[api]
erpak:"tjazzvQxyVg4wZ8zECCW"
erpsk:"7eBq75ZuF7xKH34vr2DK"
SendIndexesUrl: "https://itest.tyfon.com.cn/ecmall/api/brandPoint"
;chatGptHost: "https://chatgpttest.fontree.cn"
;chatGptHost: "http://8.219.63.1:9002"
;chatGptHost: "http://47.242.86.11:9002"
chatGptHost: "https://chatgpttest.fontree.cn"
[aliyun]
accessKeyId:"LTAI5tNjFwVMpf6RDoKkrdVF"
accessKeySecret:"oZ5yDVoLT1RiFij3xofCXkP6GZs6Tm"
[zap]
Level= "info"
Filename= "runtime/logs/zap/main.log"
MaxSize= "5"
MaxAge= "30"
MaxBackups= "30"
[oss]
AccessKeyId = "LTAI5tLz1fSK53FQAEC9uNSb"
AccessKeySecret = "oGB9chrQzQzITXR2IGv37Ji5WxZh4j"
Endpoint = "oss-cn-hangzhou.aliyuncs.com"
BucketName = "fontree-test"
BaseDir = "fonchain-main"
CdnHost = "https://cdn-test.szjixun.cn"
[pdf]
Host = "https://gotenberg.szjixun.cn"
[msg]
defaultSignNo= 220028
[send]
SendTime = 3
XMChannelId = ""
OPChannelId = ""
OPNotifyLevel = 1
;画家宝退画配置
[mail_artwork]
;EditReturnArtworkUrl = "https://artisttest.fontree.cn/api/returnArtwork/edit"
EditReturnArtworkUrl = "https://artisttest.fontree.cn/pages/transferPage/returnArtworkAddress"

427
conf/test/dubbogo.yaml Normal file
View File

@ -0,0 +1,427 @@
dubbo:
registries:
demoZK:
protocol: zookeeper
timeout: 3s
# address: 121.229.45.214:9004
# address: 127.0.0.1:2181
address: 172.16.100.93:2181
consumer:
filter: tracing
request-timeout: 30s
references:
ChainClientImpl:
timeout: 40s
protocol: tri
interface: com.fontree.microservices.common.chain
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-Chain-04"
.secretAccessKey: "Al-Chain-FDF112"
methods:
- name: "UploadFile"
retries: 0
- name: "CoWtChain"
retries: 0
AccountClientImpl:
retries: 0
protocol: tri
interface: com.fontree.microservices.common.Account
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "Accountksl"
.secretAccessKey: "BSDY-FDF1-Fontree_account"
OrderClientImpl:
retries: 0
protocol: tri
interface: com.fontree.microservices.common.order # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-order-04"
.secretAccessKey: "Al-order-FDF112"
PatentClientImpl:
protocol: tri
interface: com.fontree.microservices.common.patent # must be compatible with grpc or dubbo-java
filter: sign
params:
.accessKeyId: "SYD8-patent-04"
.secretAccessKey: "Al-patent-FDF112"
DomainNameClientImpl:
protocol: tri
interface: com.fontree.microservices.common.domainName # must be compatible with grpc or dubbo-java
filter: sign
params:
.accessKeyId: "SYD8-domainName-04"
.secretAccessKey: "Al-domainName-FDF112"
DepartmentClientImpl:
interface: com.fontree.microservices.common.Department # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-23DF"
.secretAccessKey: "BSDY-FDF1"
PositionClientImpl:
interface: com.fontree.microservices.common.Position # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-23DF"
.secretAccessKey: "BSDY-FDF1"
methods:
- name: "Update"
retries: 0
RuleClientImpl:
interface: com.fontree.microservices.common.Rule # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-23DF"
.secretAccessKey: "BSDY-FDF1"
methods:
- name: "Create"
retries: 0
RuleLogClientImpl:
interface: com.fontree.microservices.common.RuleLog # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-23DF"
.secretAccessKey: "BSDY-FDF1"
methods:
- name: "Create"
retries: 0
TaskClientImpl:
interface: com.fontree.microservices.common.task # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
protocol: tri
params:
.accessKeyId: "SYD8-task-04"
.secretAccessKey: "Al-task-FDF112"
ApprovalClientImpl:
interface: com.fontree.microservices.common.Approval # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-Approval-12"
.secretAccessKey: "Al-Approval-FDF1"
ArtistClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Artist
# filter: authFilter
ArtworkClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Artwork
# filter: authFilter
ArtworkQueryClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtworkQuery
# filter: authFilter
LogClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Log
NoteClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Note
ShopBrandClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ShopBrand
ArtShowClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtShow
ArtworkChainClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtworkChain
ArtArtworkClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtArtwork
WorkbenchClientImpl:
protocol: tri
params:
max-call-send-msg-size: 70000000
max-call-recv-msg-size: 70000000
interface: com.fontree.microservices.common.Workbench
ArtworkThirdPartyClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtworkThirdParty
DrawClientImpl:
timeout: 200s
protocol: tri
interface: com.fontree.microservices.common.Draw
methods:
- name: "AddAccount"
retries: 0
methods:
- name: "SetResult"
retries: 0
BackupClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Backup
SeriesClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.series
group: shop
PushClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Push
BrandClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.ShopBrand
group: shop
CollectionsClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Collections
ArtistThirdPartyClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistThirdParty
PaybillClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Paybill
PrebookClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Prebook
OrderproductClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Orderproduct
EmployeeClientImpl:
retries: 0
protocol: tri
interface: com.fontree.microservices.common.employee # must be compatible with grpc or dubbo-java
filter: sign
params:
.accessKeyId: "SYD8-employee-04"
.secretAccessKey: "Al-employee-FDF112"
HealthClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Health
PreorderClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Preorder
ExpressClientImpl:
timeout: 30s
retries: 0
interface: com.fontree.microservices.common.express # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-express-04"
.secretAccessKey: "Al-express-FDF112"
#画家宝服务端6个
ArtistInfoUserClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfoUser
filter: fonValidateFilter
ArtistInfoArtworkClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfoArtwork
filter: fonValidateFilter
ArtistInfoArtshowClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfoArtshow
filter: fonValidateFilter
ArtistInfoContractClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfoContract
ArtistInfoStatementClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfoStatement
retries: 100
InCircleArticleClientImpl:
protocol: tri
interface: com.fontree.microservices.common.InCircleArticleProvider
ArtworkShopClientImpl:
timeout: 60s
protocol: tri
interface: com.fontree.microservices.common.ArtworkShop
OAClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.OA
JournalClientImpl:
protocol: tri
filter: tps
params:
max-call-send-msg-size: 80000000
max-call-recv-msg-size: 80000000
interface: com.fontree.microservices.common.Journal
AppointmentClientImpl:
protocol: tri
interface: com.fontree.microservices.common.AppointmentNew
MealAccountClientImpl:
protocol: tri
interface: com.fontree.microservices.meal.backend.account
group: meal
MealGoodsClientImpl:
protocol: tri
interface: com.fontree.microservices.meal.backend.goods
group: meal
MealOrderClientImpl:
protocol: tri
interface: com.fontree.microservices.meal.backend.order
group: meal
IndentClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Indent
BuyClientImpl:
protocol: tri
interface: com.fontree.microservices.common.BuyNew
InventoryClientImpl:
timeout: 15s
retries: 0
interface: com.fontree.microservices.common.inventory # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "inventoryksl"
.secretAccessKey: "BSDY-FDF1-Fontree_inventory"
PaymentClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.payment
params:
.accessKeyId: "SYD8-pay-04"
.secretAccessKey: "Al-pay-FDF112"
CollectionRecordClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.collection_record
RecruitClientImpl:
protocol: tri
filter: tps
interface: com.fonchain.approval.proto.IApprovalService
WarehouseClientImpl:
timeout: 15s
retries: 0
interface: com.fontree.microservices.common.warehouse # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "inventoryksl"
.secretAccessKey: "BSDY-FDF1-Fontree_inventory"
GoodsManagementClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.GoodsManagement
MeetingClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.oa.meeting
DciClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.chain.dci
ExamClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Exam
CopyrightClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.digital.copyright
SiteSignInClientImpl:
protocol: tri
interface: com.fontree.microservices.common.SiteSignIn
ChainBrowserClientImpl:
protocol: tri
interface: com.fontree.microservices.chain.browser
group: chain
SoftwareCopyrightClientImpl:
protocol: tri
interface: com.fontree.microservices.common.SoftwareCopyright
TrademarkClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Trademark
CoinClientImpl:
protocol: tri
interface: com.fontree.microservices.common.coin
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
retries: 0
params:
.accessKeyId: "Accountksl"
.secretAccessKey: "BSDY-FDF1-Fontree_account"
FeedbackClientImpl:
protocol: tri
interface: com.fontree.microservices.common.feedback
ExhibitionFClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ExhibitionF
InvoiceClientImpl:
interface: com.fontree.microservices.common.Invoice
retries: 100
BlockchainClientImpl:
interface: com.fontree.microservices.common.Blockchain
retries: 100
EquityClientImpl:
retries: 0
protocol: tri
timeout: 100s
interface: com.fontree.microservices.common.Equity
LoanBillClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.digital.loanbill
ConferenceClientImpl:
interface: com.fontree.microservices.common.Conference
DocumentContractClientImpl:
interface: com.fontree.microservices.common.DocumentContract
ChildrenCompetitionClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.ChildrenCompetition
ECardClientImpl:
interface: com.fontree.microservices.common.ECard
retries: 0
timeout: 100s
ChatRecordClientImpl:
interface: com.fontree.microservices.common.AsChat
protocol: tri
MailArtworkClientImpl:
protocol: tri
interface: com.fontree.microservices.common.MailArtworkProvider
OperationRecordClientImpl:
protocol: tri
interface: com.fontree.microservices.common.OperationRecordProvider
logger:
zap-config:
level: error # 日志级别
development: false
disableCaller: false
disableStacktrace: false
encoding: "json"
# zap encoder 配置
encoder-config:
messageKey: "message"
levelKey: "level"
timeKey: "time"
nameKey: "logger"
callerKey: "caller"
stacktraceKey: "stacktrace"
lineEnding: ""
level-encoder: "capital"
timeEncoder: "iso8601"
durationEncoder: "seconds"
callerEncoder: "short"
nameEncoder: ""
EncodeTime: zapcore.TimeEncoderOfLayout("2006-01-02 15:04:05.000"),
EncodeDuration: zapcore.SecondsDurationEncoder,
outputPaths:
- "stderr"
errorOutputPaths:
- "stderr"
lumberjack-config:
# 写日志的文件名称
filename: "logs/main.log"
# 每个日志文件长度的最大大小,单位是 MiB。默认 100MiB
maxSize: 10
# 日志保留的最大天数(只保留最近多少天的日志)
maxAge: 15
# 只保留最近多少个日志文件,用于控制程序总日志的大小
maxBackups: 10
# 是否使用本地时间,默认使用 UTC 时间
localTime: true
# 是否压缩日志文件,压缩方法 gzip
compress: false

82
conf/xjj/conf.ini Normal file
View File

@ -0,0 +1,82 @@
[service]
Domain = fontree
AppMode = debug
HttpPort = :9020
Key=conf/cert/shop.fontree.cn.key
Cert=conf/cert/shop.fontree.cn.crt
RunHTTPS = false
IsHTTPS = false
OssDomain = false
ServerDM = "http://127.0.0.1:9020"
Env = dev
DriverUrl = "http://114.218.158.24:9010/driver/login.html"
JaegerHost="127.0.0.1:6831"
JaegerOpen = true
Cron = false
MapAppCode = 6e73489b6eaf4bbeb611e6b0fb70eab1
;AppointUrl = "http://appointtest2.szjixun.cn"
AppointUrl = "http://172.16.100.93:8026"
MaterialHost = "http://172.16.100.93:9046"
ApiHost = "http://114.218.158.24:9020"
YearGiftCheckHost = "http://gy.fontree.cn/pages/check/index?id="
BaiduMapAK = "3bAjKGA0pv7qvszGe98RsVZ04Ob5r4ZZ"
[file]
ImagePath = "./runtime/images"
ProjectMapDir = "D:\GOPATH\src\github.com\fonchain-main"
[bos]
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
Sk = "d2ecaa9d75114d3b9f42b99014198306"
BucketName = "dci-file-new"
BosUrl = ".bj.bcebos.com"
BosBaseDir = "fonchain-main"
BosHttp = "https://"
BosDomain = "cdns.fontree.cn"
[redis]
RedisDB:
RedisAddr: 127.0.0.1:6379
;RedisPW: kP6tW4tS3qB2dW4aE6uI5cX2
RedisPW: ""
RedisDBNAme: 15
[ding]
AccessToken: 1139fa5b9ee0dab11ecff51ac107ad2e92d09c121a693bdcc32013c44de8faee
Url: https://oapi.dingtalk.com/robot/send
[holiday]
ID: o6kqk3pftihvicgm
Secret: YmkrTDVRS0xjYjNaekFhL040ZisyZz09
SingleUrl: https://www.mxnzp.com/api/holiday/single/%v?ignoreHoliday=%v&app_id=%v&app_secret=%v
MultiUrl: https://www.mxnzp.com/api/holiday/multi/%v?ignoreHoliday=%v&app_id=%v&app_secret=%v
[rabbitmq]
User: "user123"
Password: "123456"
Host: "localhost"
Port: 5672
Vhost: "artist"
VhostArtwork: "artwork"
[shop]
ShopHost = "http://114.218.158.24:9088"
[es]
ElasticHost: http://121.228.2.240:9026
[api]
erpak:"tjazzvQxyVg4wZ8zECCW"
erpsk:"7eBq75ZuF7xKH34vr2DK"
SendIndexesUrl: "https://itest.tyfon.com.cn/ecmall/api/brandPoint"
chatGptHost: "http://127.0.0.1:9010"
[aliyun]
accessKeyId:"LTAI5tNjFwVMpf6RDoKkrdVF"
accessKeySecret:"oZ5yDVoLT1RiFij3xofCXkP6GZs6Tm"
[zap]
Level= "info"
Filename= "runtime/logs/zap/main.log"
MaxSize= "100"
MaxAge= "30"
MaxBackups= "30"
[mail_artwork];画家宝退画配置
EditReturnArtworkUrl = "https://artisttest.fontree.cn/api/v3/mail/show/address/confirm"
[send]
SendTime = 3
XMChannelId = ""
OPChannelId = ""
OPNotifyLevel = 1

459
conf/xjj/dubbogo.yaml Normal file
View File

@ -0,0 +1,459 @@
dubbo:
registries:
demoZK:
timeout: 30s
protocol: zookeeper
address: 127.0.0.1:2181
# protocol: nacos
# address: 127.0.0.1:8848
# username: "dyb"
# password: "rootdyb"
# namespace: "4684d3a3-165f-4218-8ab8-f4fa03c8efe0"
# group: GROUP_AERTIST
# data_id: com.fontree.microservices.common.Artist
consumer:
filter: tracing
request-timeout: 30s
params:
max-call-send-msg-size: 8000000
max-call-recv-msg-size: 8000000
references:
ChainClientImpl:
timeout: 40s
protocol: tri
interface: com.fontree.microservices.common.chain
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-Chain-04"
.secretAccessKey: "Al-Chain-FDF112"
methods:
- name: "UploadFile"
retries: 0
- name: "CoWtChain"
retries: 0
AccountClientImpl:
protocol: tri
retries: 0
interface: com.fontree.microservices.common.Account
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "Accountksl"
.secretAccessKey: "BSDY-FDF1-Fontree_account"
OrderClientImpl:
protocol: tri
interface: com.fontree.microservices.common.order # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-order-04"
.secretAccessKey: "Al-order-FDF112"
EmployeeClientImpl:
retries: 0
protocol: tri
interface: com.fontree.microservices.common.employee # must be compatible with grpc or dubbo-java
filter: sign
params:
.accessKeyId: "SYD8-employee-04"
.secretAccessKey: "Al-employee-FDF112"
PatentClientImpl:
protocol: tri
interface: com.fontree.microservices.common.patent # must be compatible with grpc or dubbo-java
filter: sign
params:
.accessKeyId: "SYD8-patent-04"
.secretAccessKey: "Al-patent-FDF112"
DepartmentClientImpl:
interface: com.fontree.microservices.common.Department # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-23DF"
.secretAccessKey: "BSDY-FDF1"
PositionClientImpl:
interface: com.fontree.microservices.common.Position # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-23DF"
.secretAccessKey: "BSDY-FDF1"
methods:
- name: "Update"
retries: 0
RuleClientImpl:
interface: com.fontree.microservices.common.Rule # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-23DF"
.secretAccessKey: "BSDY-FDF1"
methods:
- name: "Create"
retries: 0
RuleLogClientImpl:
interface: com.fontree.microservices.common.RuleLog # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-23DF"
.secretAccessKey: "BSDY-FDF1"
methods:
- name: "Create"
retries: 0
TaskClientImpl:
interface: com.fontree.microservices.common.task # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
protocol: tri
params:
.accessKeyId: "SYD8-task-04"
.secretAccessKey: "Al-task-FDF112"
ApprovalClientImpl:
interface: com.fontree.microservices.common.Approval # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-Approval-12"
.secretAccessKey: "Al-Approval-FDF1"
ArtistClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Artist
ArtworkClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Artwork
# filter: authFilter
ArtworkQueryClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtworkQuery
# filter: authFilter
LogClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Log
NoteClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Note
ShopBrandClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ShopBrand
ArtShowClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtShow
ArtworkChainClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtworkChain
WorkbenchClientImpl:
protocol: tri
params:
max-call-send-msg-size: 8000000
max-call-recv-msg-size: 8000000
interface: com.fontree.microservices.common.Workbench
ArtworkThirdPartyClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtworkThirdParty
DrawClientImpl:
timeout: 100s
protocol: tri
interface: com.fontree.microservices.common.Draw
methods:
- name: "AddAccount"
retries: 0
methods:
- name: "SetResult"
retries: 0
BackupClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Backup
SeriesClientImpl:
timeout: 60s
protocol: tri
filter: tps
interface: com.fontree.microservices.common.series
group: shop
PushClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Push
BrandClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.ShopBrand
group: shop
CollectionsClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Collections
ArtistThirdPartyClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistThirdParty
PaybillClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Paybill
PrebookClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Prebook
OrderproductClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Orderproduct
HealthClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Health
PreorderClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Preorder
OpenaiClientImpl:
protocol: tri
filter: tps
retries: 0
interface: com.fontree.microservices.common.openai
group: openai
ArtworkShopClientImpl:
timeout: 60s
protocol: tri
interface: com.fontree.microservices.common.ArtworkShop
OAClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.OA
JournalClientImpl:
protocol: tri
filter: tps
params:
max-call-send-msg-size: 80000000
max-call-recv-msg-size: 80000000
interface: com.fontree.microservices.common.Journal
ExpressClientImpl:
timeout: 30s
retries: 0
interface: com.fontree.microservices.common.express # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "SYD8-express-04"
.secretAccessKey: "Al-express-FDF112"
InventoryClientImpl:
timeout: 15s
retries: 0
interface: com.fontree.microservices.common.inventory # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
params:
.accessKeyId: "inventoryksl"
.secretAccessKey: "BSDY-FDF1-Fontree_inventory"
#画家宝服务端6个
ArtistInfoStatementClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfoStatement
ArtistInfoUserClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfoUser
filter: fonValidateFilter
ArtistInfoArtworkClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfoArtwork
filter: fonValidateFilter
ArtistInfoArtshowClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfoArtshow
filter: fonValidateFilter
ArtistInfoContractClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfoContract
InCircleArticleClientImpl:
protocol: tri
interface: com.fontree.microservices.common.InCircleArticleProvider
AppointmentClientImpl:
protocol: tri
interface: com.fontree.microservices.common.AppointmentNew
MealAccountClientImpl:
protocol: tri
interface: com.fontree.microservices.meal.backend.account
group: meal
MealGoodsClientImpl:
protocol: tri
interface: com.fontree.microservices.meal.backend.goods
group: meal
MealOrderClientImpl:
protocol: tri
interface: com.fontree.microservices.meal.backend.order
group: meal
IndentClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Indent
PaymentClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.payment
params:
.accessKeyId: "SYD8-pay-04"
.secretAccessKey: "Al-pay-FDF112"
CollectionRecordClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.collection_record
RecruitClientImpl:
protocol: tri
filter: tps
interface: com.fonchain.approval.proto.IApprovalService
MeetingClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.oa.meeting
GoodsManagementClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.GoodsManagement
ChainBrowserClientImpl:
protocol: tri
interface: com.fontree.microservices.chain.browser
group: chain
ExamClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.common.Exam
CopyrightClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.digital.copyright
DciClientImpl:
protocol: tri
filter: tps
interface: com.fontree.microservices.chain.dci
SiteSignInClientImpl:
protocol: tri
interface: com.fontree.microservices.common.SiteSignIn
SoftwareCopyrightClientImpl:
protocol: tri
interface: com.fontree.microservices.common.SoftwareCopyright
TrademarkClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Trademark
CoinClientImpl:
protocol: tri
interface: com.fontree.microservices.common.coin
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
retries: 0
params:
.accessKeyId: "Accountksl"
.secretAccessKey: "BSDY-FDF1-Fontree_account"
FeedbackClientImpl:
protocol: tri
interface: com.fontree.microservices.common.feedback
ExhibitionFClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ExhibitionF
InvoiceClientImpl:
interface: com.fontree.microservices.common.Invoice
retries: 100
BlockchainClientImpl:
interface: com.fontree.microservices.common.Blockchain
retries: 100
EquityClientImpl:
retries: 0
protocol: tri
timeout: 100s
interface: com.fontree.microservices.common.Equity
ConferenceClientImpl:
interface: com.fontree.microservices.common.Conference
DocumentContractClientImpl:
interface: com.fontree.microservices.common.DocumentContract
LoanBillClientImpl:
protocol: tri
filter: tps
<<<<<<<< HEAD:conf/xjj/dubbogo.yaml
interface: com.fontree.microservices.digital.loanbill
========
interface: com.fontree.microservices.common.ChildrenCompetition
ECardClientImpl:
interface: com.fontree.microservices.common.ECard
retries: 0
timeout: 100s
AsChatProvider:
interface: com.fontree.microservices.common.AsChatProvider
retries: 0
MailArtworkProvider:
interface: com.fontree.microservices.common.MailArtworkProvider
retries: 0
>>>>>>>> feat-xjj-artistinfo3:conf/prod/dubbogo.yaml
ChatRecordClientImpl:
interface: com.fontree.microservices.common.AsChat
protocol: tri
MailArtworkClientImpl:
protocol: tri
interface: com.fontree.microservices.common.MailArtworkProvider
<<<<<<<< HEAD:conf/xjj/dubbogo.yaml
# logger:
# zap-config:
# level: error # 日志级别
# development: false
# disableCaller: false
# disableStacktrace: false
# encoding: "json"
# # zap encoder 配置
# encoder-config:
# messageKey: "message"
# levelKey: "level"
# timeKey: "time"
# nameKey: "logger"
# callerKey: "caller"
# stacktraceKey: "stacktrace"
# level-encoder: "capital"
# timeEncoder: "iso8601"
# durationEncoder: "seconds"
# callerEncoder: "short"
# nameEncoder: ""
# EncodeTime: zapcore.TimeEncoderOfLayout("2006-01-02 15:04:05.000"),
# EncodeDuration: zapcore.SecondsDurationEncoder,
# outputPaths:
# - "stderr"
# errorOutputPaths:
# - "stderr"
# lumberjack-config:
# # 写日志的文件名称
# filename: "logs/main.log"
# # 每个日志文件长度的最大大小,单位是 MiB。默认 100MiB
# maxSize: 10
# # 日志保留的最大天数(只保留最近多少天的日志)
# maxAge: 15
# # 只保留最近多少个日志文件,用于控制程序总日志的大小
# maxBackups: 10
# # 是否使用本地时间,默认使用 UTC 时间
# localTime: true
# # 是否压缩日志文件,压缩方法 gzip
# compress: false
========
logger:
zap-config:
level: error # 日志级别
development: false
disableCaller: false
disableStacktrace: false
encoding: "json"
# zap encoder 配置
encoder-config:
messageKey: "message"
levelKey: "level"
timeKey: "time"
nameKey: "logger"
callerKey: "caller"
stacktraceKey: "stacktrace"
level-encoder: "capital"
timeEncoder: "iso8601"
durationEncoder: "seconds"
callerEncoder: "short"
nameEncoder: ""
EncodeTime: zapcore.TimeEncoderOfLayout("2006-01-02 15:04:05.000"),
EncodeDuration: zapcore.SecondsDurationEncoder,
outputPaths:
- "stderr"
errorOutputPaths:
- "stderr"
lumberjack-config:
# 写日志的文件名称
filename: "logs/main.log"
# 每个日志文件长度的最大大小,单位是 MiB。默认 100MiB
maxSize: 10
# 日志保留的最大天数(只保留最近多少天的日志)
maxAge: 15
# 只保留最近多少个日志文件,用于控制程序总日志的大小
maxBackups: 10
# 是否使用本地时间,默认使用 UTC 时间
localTime: true
# 是否压缩日志文件,压缩方法 gzip
compress: false
>>>>>>>> feat-xjj-artistinfo3:conf/prod/dubbogo.yaml

10092
logs/main.log Normal file

File diff suppressed because one or more lines are too long

256
pkg/config/config.go Normal file
View File

@ -0,0 +1,256 @@
package config
import (
"fmt"
"github.com/fonchain_enterprise/fonchain-main/pkg/common"
"github.com/spf13/viper"
"gopkg.in/ini.v1"
"os"
"strconv"
)
var (
AppMode string
HttpPort string
Key string
Cert string
IsHttps bool
RunHttps bool
Domain string
OssDomain string
ServerDM string
Env string
DriverUrl string
AppointUrl string
MaterialHost string
//TODO
//BosAk string
//BosSk string
//BosBucketName string
//BosBaseDir string
//BosUrl string
//BosHttp string
//BosDomain string
//TODO
ProjectMapDir string
JaegerHost string
JaegerOpen bool
Cron bool
DingAccessToken string
DingUrl string
HolidayID string
HolidaySecret string
HolidaySingleUrl string
HolidayMultiUrl string
ErpAk string
ErpSk string
// rabbitmq
RabbitmqUser string
RabbitmqPassword string
RabbitmqHost string
RabbitmqPort int
RabbitmqVhost string
RabbitmqVhostArtwork string
RedisDB int
RedisAddr string
RedisPw string
//shop配置
ShopHost string
//ShopDetail string
// 地图
MapAppCode string
//百度地图的ak
BaiduMapAK string
// es
ElasticHost string
SendIndexesUrl string
ChatGptHost string
ApiHost string
Level string
Filename string
MaxSize string
MaxAge string
MaxBackups string
YearGiftCheckHost string
IsOut bool
OutUrl string
Aliyun struct {
AccessKeyId string
AccessKeySecret string
}
SendTime int
XMChannelId string
OPChannelId string
OPNotifyLevel int
Route string
PdfHost string
DefaultSignNo uint64
// 审批 es index
ApprovalIndex string
)
var ConfigData = new(AppConfig)
type AppConfig struct {
Oss struct {
AccessKeyId string
AccessKeySecret string
Endpoint string
BucketName string
BaseDir string
CdnHost string
}
Rabbitmq struct {
User string
Password string
Host string
Port int
Vhost string
VhostArtwork string
VhostCopyright string
}
}
func GetOptions() {
iniConf, err := common.GetConf()
if err != nil {
panic("iniConf error")
}
file, err := ini.Load(iniConf)
if err != nil {
fmt.Println("服务器配置文件读取错误,请检查文件路径:", err)
}
_ = os.MkdirAll("runtime", os.ModePerm)
LoadServer(file)
_ = Viper(iniConf)
}
func LoadServer(file *ini.File) {
AppMode = file.Section("service").Key("AppMode").String()
IsHttps, _ = file.Section("service").Key("IsHTTPS").Bool()
RunHttps, _ = file.Section("service").Key("RunHTTPS").Bool()
Key = file.Section("service").Key("Key").String()
Cert = file.Section("service").Key("Cert").String()
HttpPort = file.Section("service").Key("HttpPort").String()
Domain = file.Section("service").Key("Domain").String()
OssDomain = file.Section("service").Key("OssDomain").String()
ServerDM = file.Section("service").Key("ServerDM").String()
DriverUrl = file.Section("service").Key("DriverUrl").String()
Env = file.Section("service").Key("Env").String()
JaegerHost = file.Section("service").Key("JaegerHost").String()
JaegerOpen, _ = file.Section("service").Key("JaegerOpen").Bool()
Cron, _ = file.Section("service").Key("Cron").Bool()
YearGiftCheckHost = file.Section("service").Key("YearGiftCheckHost").String()
IsOut, _ = file.Section("service").Key("IsOut").Bool()
OutUrl = file.Section("service").Key("OutUrl").String()
ProjectMapDir = file.Section("file").Key("ProjectMapDir").String()
AppointUrl = file.Section("service").Key("AppointUrl").String()
MaterialHost = file.Section("service").Key("MaterialHost").String()
//TODO
//BosAk = file.Section("bos").Key("Ak").String()
//BosSk = file.Section("bos").Key("Sk").String()
//BosBucketName = file.Section("bos").Key("BucketName").String()
//BosBaseDir = file.Section("bos").Key("BosBaseDir").String()
//BosUrl = file.Section("bos").Key("BosUrl").String()
//BosHttp = file.Section("bos").Key("BosHttp").String()
//BosDomain = file.Section("bos").Key("BosDomain").String()
//TODO
DingUrl = file.Section("ding").Key("Url").String()
DingAccessToken = file.Section("ding").Key("AccessToken").String()
//加载获取万年历配置
HolidayID = file.Section("holiday").Key("ID").String()
HolidaySecret = file.Section("holiday").Key("Secret").String()
HolidaySingleUrl = file.Section("holiday").Key("SingleUrl").String()
HolidayMultiUrl = file.Section("holiday").Key("MultiUrl").String()
// 加载 rabbitmq 配置
RabbitmqUser = file.Section("rabbitmq").Key("User").String()
RabbitmqPassword = file.Section("rabbitmq").Key("Password").String()
RabbitmqHost = file.Section("rabbitmq").Key("Host").String()
RabbitmqPort, _ = file.Section("rabbitmq").Key("Port").Int()
RabbitmqVhost = file.Section("rabbitmq").Key("Vhost").String()
RabbitmqVhostArtwork = file.Section("rabbitmq").Key("VhostArtwork").String()
//加载 redis
dbStr := file.Section("redis").Key("RedisDBNAme").String()
RedisDB, _ = strconv.Atoi(dbStr)
RedisAddr = file.Section("redis").Key("RedisAddr").String()
RedisPw = file.Section("redis").Key("RedisPW").String()
ShopHost = file.Section("shop").Key("ShopHost").String()
//ShopDetail = file.Section("shop").Key("ShopDetail").String()
// 地图
MapAppCode = file.Section("service").Key("MapAppCode").String()
BaiduMapAK = file.Section("service").Key("BaiduMapAK").String()
// 地图
ElasticHost = file.Section("es").Key("ElasticHost").String()
SendIndexesUrl = file.Section("api").Key("SendIndexesUrl").String()
ChatGptHost = file.Section("api").Key("chatGptHost").String()
ErpAk = file.Section("api").Key("erpak").String()
ErpSk = file.Section("api").Key("erpsk").String()
ApiHost = file.Section("service").Key("ApiHost").String()
// zap
Level = file.Section("zap").Key("Level").String()
Filename = file.Section("zap").Key("Filename").String()
MaxSize = file.Section("zap").Key("MaxSize").String()
MaxAge = file.Section("zap").Key("MaxAge").String()
MaxBackups = file.Section("zap").Key("MaxBackups").String()
Aliyun.AccessKeyId = file.Section("aliyun").Key("accessKeyId").String()
Aliyun.AccessKeySecret = file.Section("aliyun").Key("accessKeySecret").String()
Aliyun.AccessKeySecret = file.Section("aliyun").Key("accessKeySecret").String()
//发送次数
SendTime, _ = file.Section("send").Key("SendTime").Int()
OPNotifyLevel, _ = file.Section("send").Key("OPNotifyLevel").Int()
XMChannelId = file.Section("send").Key("XMChannelId").String()
OPChannelId = file.Section("send").Key("OPChannelId").String()
PdfHost = file.Section("pdf").Key("Host").String()
DefaultSignNo, _ = file.Section("msg").Key("defaultSignNo").Uint64()
Route = file.Section("send").Key("Route").String()
// 审批 es index
ApprovalIndex = file.Section("es").Key("ApprovalIndex").String()
}
func Viper(iniConf string) (err error) {
viper.SetConfigFile(iniConf)
err = viper.ReadInConfig()
if err != nil {
panic("viper.ReadInConfig failed" + err.Error())
return
}
if err = viper.Unmarshal(ConfigData); err != nil {
panic("viper.Unmarshal failed" + err.Error())
return
}
if err = viper.UnmarshalKey("mail_artwork.EditReturnArtworkUrl", &MailArtwork.EditReturnArtworkUrl); err != nil {
panic("viper.Unmarshal 'mail_artwork' config failed" + err.Error())
return
}
fmt.Printf("mailartwork:%+v\n", MailArtwork)
return
}

17
pkg/config/mailArtwork.go Normal file
View File

@ -0,0 +1,17 @@
// Package config -----------------------------
// @file : mailArtwork.go
// @author : JJXu
// @contact : wavingbear@163.com
// @time : 2024/11/4 下午1:22
// -------------------------------------------
package config
var MailArtwork = new(MailArtworkConfig)
type MailArtworkConfig struct {
EditReturnArtworkUrl string
}
func (MailArtworkConfig) KeyName() string {
return "mail_artwork"
}

146
pkg/e/approval_type.go Normal file
View File

@ -0,0 +1,146 @@
package e
var TypeMap = map[string]string{
"content": "",
"work": "",
"exhibition": "exhibition",
"bundle": "",
"show": "",
"leave": "oa", // 事假
"sick": "oa", // 病假
"annualLeave": "oa", // 年假
"dayOff": "oa", // 调休
"maritalLeave": "oa", // 婚假
"matingCheckLeave": "oa", // 孕检假
"maternityLeave": "oa", // 产假
"paternityLeave": "oa", // 陪产假
"parentalLeave": "oa", // 育儿假
"nursingLeave": "oa", // 独生子女护理假
"funeralLeave": "oa", // 丧假
"abortLeave": "oa", // 流产假
"breastFeedingLeave": "oa", // 哺乳假
"makeUp": "oa", // 补卡
"overTime": "oa", // 加班
"outWork": "oa", // 外勤
"turnover": "oa", // 离职
"turnover-1": "oa", // 离职
"turnover-2": "oa", // 离职
"turnover-3": "oa", // 离职
"turnover-4": "oa", // 离职
"turnover-5": "oa", // 离职
"turnover-6": "oa", // 离职
"turnover-7": "oa", // 离职
"turnover-8": "oa", // 离职
"turnover-9": "oa", // 离职
"turnover-10": "oa", // 离职
"turnover-11": "oa", // 离职
"turnover-12": "oa", // 离职
"turnover-13": "oa", // 离职
"turnover-14": "oa", // 离职
"turnover-15": "oa", // 离职
"turnover-16": "oa", // 离职
"turnover-17": "oa", // 离职
"turnover-18": "oa", // 离职
"turnover-19": "oa", // 离职
"turnover-20": "oa", // 离职
"turnover-21": "oa", // 离职
"turnover-22": "oa", // 离职
"turnover-23": "oa", // 离职
"turnover-24": "oa", // 离职
"turnover-25": "oa", // 离职
"turnover-26": "oa", // 离职
"turnover-27": "oa", // 离职
"turnover-28": "oa", // 离职
"businessTrip": "oa", // 出差
"goOut": "oa", // 外出
"annualLeaveApply": "oa", // 年假申请
"maritalLeaveApply": "oa", // 婚假申请
"matingCheckLeaveApply": "oa", // 孕检假申请
"maternityLeaveApply": "oa", // 产假申请
"paternityLeaveApply": "oa", // 陪产假申请
"parentalLeaveApply": "oa", // 育儿假申请
"nursingLeaveApply": "oa", // 独生子女护理假申请
"funeralLeaveApply": "oa", // 丧假
"financialFormApply": "", // 财务表单审批
}
var CheckLeaveApplyMap = map[string]string{
"annualLeave": "annualLeaveApply", // 年假
"maritalLeave": "maritalLeaveApply", // 婚假
"matingCheckLeave": "matingCheckLeaveApply", // 孕检假
"maternityLeave": "maternityLeaveApply", // 产假
"paternityLeave": "paternityLeaveApply", // 陪产假
"parentalLeave": "parentalLeaveApply", // 育儿假
"nursingLeave": "nursingLeaveApply", // 独生子女护理假
"funeralLeave": "funeralLeaveApply", // 丧假
}
var TitleMap = map[string]string{
"content": "",
"work": "",
"exhibition": "exhibition",
"bundle": "",
"show": "",
"事假": "oa", // 事假
"病假": "oa", // 病假
"年假": "oa", // 年假
"调休": "oa", // 调休
"婚假": "oa", // 婚假
"孕检假": "oa", // 孕检假
"产假": "oa", // 产假
"陪产假": "oa", // 陪产假
"育儿假": "oa", // 育儿假
"独生子女护理假": "oa", // 独生子女护理假
"丧假": "oa", // 丧假
"补卡": "oa", // 补卡
"加班": "oa", // 加班
"外勤": "oa", // 外勤
"离职": "oa", // 离职
"出差": "oa", // 出差
"外出": "oa", // 外出
"年假申请": "oa", // 年假申请
"婚假申请": "oa", // 婚假申请
"孕检假申请": "oa", // 孕检假申请
"产假申请": "oa", // 产假申请
"陪产假申请": "oa", // 陪产假申请
"育儿假申请": "oa", // 育儿假申请
"独生子女护理假申请": "oa", // 独生子女护理假申请
"丧假申请": "oa", // 丧假申请
"financialFormApply": "", // 财务表单审批
}
var MakeUp = "makeUp"
const (
MakeUpNum = "makeUpNum"
CheckChickIn = "checkChickIn"
LeaveApplyTypes = "leaveApplyTypes"
ChickInWifi = "chickInWifi"
MaritalLeaveBalance = "maritalLeaveBalance"
)
const (
IsNotOver = iota + 1
IsOver
)
const (
OutWorkOut = "out"
OutWorkBack = "back"
)
// 或签 会签
const (
AndSignType = "AND"
OrSignType = "OR"
ErrorSignType = "签核类型错误"
)

95
pkg/e/artistinfoMsg.go Normal file
View File

@ -0,0 +1,95 @@
// Package e -----------------------------
// @file : artistinfoMsg.go
// @author : JJXu
// @contact : wavingbear@163.com
// @time : 2023/10/24 14:58
// -------------------------------------------
package e
import "fmt"
type ErrorCode int
// String 使用 fmt.Sprintf(Err13ArtistUidIsNull) 返回 "画家UID不能为空"
func (e ErrorCode) String() string {
if v, ok := MsgFlags[e]; ok {
return v
} else {
return fmt.Sprintf("未知错误:[%d]", e)
}
}
const (
Err13IDIsNull = 130001
Err13DuplicateData = 130002
Err13ScriptIsRunning = 130003
//用户相关错误
Err13ArtistUidIsNull = 130101
Err13ArtistTnumIsnull = 130102
Err13UserIsUnLock = 130103
Err13UserNotFound = 130104
Err13IDNumISNULL = 130105
Err13TelNumISNull = 130106
Err13NoOperationAfterUnlock = 130107
Err13RealNameIsNull = 130108
Err13OriginIsNull = 130109
ErrorTelNumInBlackList = 130110
ErrorIdCardInBlackList = 130111
//画作相关错误
Err13ArtworkUidIsNull = 130201
Err13ArtworkTfnumIsNull = 130202
Err13UnknownAuditNode = 130203
Err13ArtworkNotFound = 130204
Err13BaseAuditNotFinish = 130205
//画家指数
Err13DuplicateTile = 130301
//经纪人补充信息
Err13ArtPackageUidIsNull = 130701
Err13AgentNotExist = 130702
Err13AgentNotSpecified = 130703
Err13AgentHasSpecified = 130704
Err13DataHaventGenerate = 130705
//合同
Err13ContractDuplicate = 130801
Err13IllegalContract = 130802
)
var err13Msg = map[ErrorCode]string{
Error13ArtistInfoCodeStart: "画家宝模块错误",
Error13ArtistInfoCodeEnd: "画家宝模块错误",
Err13IDIsNull: "ID不能为空",
Err13DuplicateData: "数据已存在",
Err13ScriptIsRunning: "脚本正在运行,不可重复操作",
Err13ArtistUidIsNull: "画家UID不能为空",
Err13ArtistTnumIsnull: "画家编号不能为空",
Err13UserIsUnLock: "未锁定该用户,操作取消",
Err13UserNotFound: "找不到此用户",
Err13IDNumISNULL: "身份证号不能为空",
Err13TelNumISNull: "手机号不能为空",
Err13RealNameIsNull: "真实姓名不能为空",
Err13OriginIsNull: "数据来源不能为空",
Err13NoOperationAfterUnlock: "未做任何操作,无法解锁",
Err13AgentNotExist: "经纪人不存在",
Err13ArtworkUidIsNull: "画作UID不能为空",
Err13ArtworkTfnumIsNull: "画作编号不能为空",
Err13ArtworkNotFound: "画作不存在",
Err13BaseAuditNotFinish: "画作基本信息未审批完成,操作取消",
Err13UnknownAuditNode: "未知的审批节点",
Err13DuplicateTile: "标题重复",
Err13ArtPackageUidIsNull: "画展包Uid为必填",
Err13AgentNotSpecified: "用户尚未指定经纪人",
Err13AgentHasSpecified: "您已指定经纪人,不可重复操作",
Err13DataHaventGenerate: "数据尚未生成",
Err13ContractDuplicate: "合同已存在,请勿重复操作",
Err13IllegalContract: "存在非法的合同",
}
func init() {
for k, v := range err13Msg {
if _, ok := MsgFlags[k]; ok {
panic(fmt.Sprintf("错误代码%d冲突,请检查pkg/e目录下的代码", k))
} else {
MsgFlags[k] = v
}
}
}

7
pkg/e/auth_msg.go Normal file
View File

@ -0,0 +1,7 @@
package e
const (
DEFAULT_PWD = "Aa.123456"
DateFormatting = "2006-01-02"
UserFailure = "更新用户信息失败"
)

394
pkg/e/code.go Normal file
View File

@ -0,0 +1,394 @@
package e
var (
JWTSecret = []byte("asdfqwer1234")
)
const (
AddUser = "addUser" //下发人员信息
EditUser = "editUser" //修改人员信息
DelUser = "delUser" //删除人员信息
DelMultiUser = "delMultiUser" //批量删除人员
DelAllUserRet = "delAllUserRet" //删除全部人员
AddVisitRet = "addVisitRet" //下发人证对比
OnlineAuthorization = "onlineAuthorization" //抓拍现场照片
Reboot = "reboot" //重启设备
VerifyPhoto = "verifyPhoto" //检测图片质量
AddPassRule = "addPassRule" //下发人员通行规则
GetPassRule = "getPassRule" //获取通行规则
DelPassRule = "delPassRule" //删除通行规则
SetPasswordVerify = "setPasswordVerify" //设备密码开门开关
SetOpenDoorPassword = "setOpenDoorPassword" //设置设备开门密码
UploadFaceInfo = "uploadFaceInfo" //通知设备同步人员数据
GetUserInfo = "getUserInfo" //查询设备人员数量和id
GetUserDetails = "getUserDetails" //根据userid读取用户数据
GetDeviceSettings = "getDeviceSettings" //获取设备设置
CustomHomeLogo = "customHomeLogo" //设置设备 logo
AetAd = "setAd" //设置广告语
SetTime = "setTime" //设置时间
SetDoor = "setDoor" //设置开关门
SetRecognitionInterval = "setRecognitionInterval" //设置识别间隔
SetRecognitionDistance = "setRecognitionDistance" //设置识别距离
SetMaskDetection = "setMaskDetection" //口罩检测开关
SetLivenessDetection = "setLivenessDetection" //活体检测
SetLivenessLevel = "setLivenessLevel" //活体检测等级
SetStrangerRecognition = "setStrangerRecognition" //陌生人识别
SetVolume = "setVolume" //设置设备音量
SetPlayUserName = "setPlayUserName" //播放用户名
SetVoice = "setVoice" //设置设备提示语音
SetPassword = "setPassword" //修改进入设置页面密码
SetRelayState = "setRelayState" //设置继电器状态-常开/正常
SetRecordPictureQuality = "setRecordPictureQuality" //设置设备识别照片抓拍的质量
SetVisitorCallStatus = "setVisitorCallStatus" //访问呼叫开关
SetPrinterStatus = "setPrinterStatus" //打印机开关
//SetVisitorApplyValue = "setVisitorApplyValue" //首页访客申请入库内容
SetHttpToken = "setHttpToken" //设置http请求的token
SetVerifyTimeout = "setVerifyTimeout" //设置验证接口超时时长
SetOpenDoorDelay = "setOpenDoorDelay" //设置设备开门延迟
SetAdminLongPressTime = "setAdminLongPressTime" //进入设置页面长按时间
SetDesensitizationName = "setDesensitizationName" //姓名脱敏显示
SetReadCardInfo = "setReadCardInfo" //设置读卡扇区
SetGeofence = "setGeofence" //设置设备位置围栏
SetScreensaverState = "setScreensaverState" //设备节能屏保开关
AddCarousePicture = "addCarousePicture" //设置设备屏保
DelCarouselPic = "delCarouselPic" //删除屏保
SetScreensaverInterval = "setScreensaverInterval" //设置屏保显示时长
SetTemperatureDetection = "setTemperatureDetection" //体温检测开关
SetTemperatureMode = "setTemperatureMode" //体温检测模式
SetPreliminaryScreeningStandard = "setPreliminaryScreeningStandard" //初筛模式标准
SetTemperatureCalibrationMode = "setTemperatureCalibrationMode" //设置体温校准模式
SetLowTemperaturePass = "setLowTemperaturePass" //低温可通行开关
SetPlayTemperature = "setPlayTemperature" //播报体温开关
SetReflectivity = "setReflectivity" //设置体温反射率
SetTemperatureCorrection = "setTemperatureCorrection" //设置体温校准值
SetTemperatureDetectDistance = "setTemperatureDetectDistance" //设置设备体温检测距离
SetMeasureTemperatureTime = "setMeasureTemperatureTime" //设置测温时间段
SetAutoUpdate = "setAutoUpdate" //开机自动更新
GetVersionInfo = "getVersionInfo" //获取设备版本信息
PushVersionInfo = "pushVersionInfo" //发送设备版本信息给服务端
CheckForUpdates = "checkForUpdates" //通知设备在线检查更新
SetVisitorApplyValue = "setVisitorApplyValue" //设置设备首页二维码
SetVisitorQRCodePrefix = "setVisitorQRCodePrefix" //设置访客二维码前缀
SetPanoramicCamera = "setPanoramicCamera" //全景相机开关
SetPanoramicCameraParams = "setPanoramicCameraParams" //设置全景相机的参数
SetRecognitionResultStyle = "setRecognitionResultStyle" //识别结果样式
SetOnlineVerifyAfterRecognition = "setOnlineVerifyAfterRecognition" //识别后在线验证
SetOnlineVerifyCard = "setOnlineVerifyCard" //在线验证卡号
SetOnlineVerifyIdCard = "setOnlineVerifyIdCard" //在线验证身份证号
SetOnlineRecognitionInterval = "setOnlineRecognitionInterval" //设置在线识别间隔
SetOnlineRecognitionState = "setOnlineRecognitionState" //在线识别开关
SetOnlineRecognition = "setOnlineRecognition" //临时启用在线识别
SetPassType = "setPassType" //设置可通行人员类型
SetRecognitionLevel = "setRecognitionLevel" //设置设备识别置信度
SetSwitch = "setSwitch" //开启/关闭设备识别
SetDisablePass = "setDisablePass" //停用状态通行人数
AddImageAd = "addImageAd" //下发广告 - 图片
DelAd = "delAd" //删除广告
ChangeADStatus = "changeADStatus" //启用停用广告
GetDoorLockState = "getDoorLockState" //获取(上报)门锁状态
SetDoorLockListener = "setDoorLockListener" //设置门锁实时监听开关
)
const (
AuthFinanceKey = "auth_search_finance" //财务
AuthTrainingKey = "auth_search_training" //教培
AuthPublicizeKey = "auth_search_publicize" //宣传
AuthWarehouseKey = "auth_search_warehouse" //仓库
AuthDriveKey = "ge_diver_auth"
AuthEmployeeAllKey = "auth_search_employee" //员工档案查看权限
AuthEmployeeMaiKey = "auth_search_mai_employee" //员工档案查看权限
AuthDriveSupervisorKey = "ge_driver_supervisor_auth"
SellerBossKey = "seller_mobile_boss_auth"
SellerStaffKey = "seller_mobile_staff_auth"
SellerTellerKey = "seller_teller_auth"
DepartmentKey = "department_boss_auth"
ExhibitionInsideKey = "exhibition_inside_key" //画展包内部
ExhibitionShowKey = "exhibition_show_key" //画展包画展数据
QueryCanShow = "can_show_exh" //查看可画展画展包
SecretDataBoss = "secret_data_boss" //查看可画展画展包加密数据
AuthArtworkFix = "artwork-fix-button-mobile-auth"
AUthOnlySiteLogin = "only-site-login"
AuthCollectionAllDetailKey = "auth_collection_all_detail" //员工考勤查看权限
AuthCollectionMaiDetailKey = "auth_collection_mai_detail" //员工考勤亿麦查看权限
)
const (
ErrNotLogin = "ErrNotLogin"
ErrOffline = "ErrOffline"
ErrOfflineSqueeze = "您的账号已在其他设备登录"
ErrAccountNotExist = "当前手机号不在系统中,请您确认手机号码正确性"
)
var LoginMap = map[string]string{
"ErrNotLoginZhCN": "请先登录",
"ErrNotLoginEN": "Please login first",
"ErrNotLoginZhTW": "請先登錄",
}
var OfflineMap = map[string]string{
"ErrOfflineZhCN": "您已经下线",
"ErrOfflineEN": "You have been offline",
"ErrOfflineZhTW": "您已經下線",
}
const (
Authorization = "Authorization"
)
const (
ApprovalWorkStatusDoing = 1
ApprovalWorkStatusOk = 2
ApprovalWorkStatusFail = 3
ApprovalWorkStatusRevoking = 6
ApprovalWorkStatusRevokeOk = 7
)
const (
TypeContent = "content"
TypeWork = "work"
TypeExhibition = "exhibition"
TypeShow = "show"
TypeBundle = "bundle"
)
const (
Success = 200
Error = 500
ParamsError = 400
InvalidToken = 501
)
const (
Domain_Mall = "mall"
)
const (
RULE_TYPE_MENU = "menu"
RULE_TYPE_BUTTON = "button"
RULE_TYPE_INTERFACE = "interface"
)
const (
Auth_Artwork_Task = "Auth_Artwork_Task"
Task_Type_Feedback = "feedback"
Task_Type_Art = "art"
CreateQrUrl = "https://common.szjixun.cn/api/image/qr/url?url="
)
// 订单状态参数
const (
ORDER_STATUS_NEED_PUBLIC = iota + 1 //待发布
ORDER_STATUS_NEED_CONFIRM //待确认
ORDER_STATUS_APPEAL //申诉状态
ORDER_STATUS_CONFIRMED //已确认
)
const (
Pay_Need_Pay = iota + 1
Pay_Success
Pay_Fail
Pay_Express
Pay_Express_Agree
)
const (
REPORT_STATUS_NEED_PUBLIC = iota + 1 //待发布
REPORT_PUBLISH //已发布
REPORT_NEED_CASHIER_SURE //待出纳补充
REPORT_NEED_BOSS_SURE //带最后总价确认
REPORT_CASHIER_FINAL_OPTION //待出纳确认 重置
)
const (
Transaction_Doing = iota + 1 //待总监确认
Transaction_Need_Seller_Sure //待销售确认
Transaction_Question //申诉订单
Transaction_Done //完成
Transaction_Need_Cashier_Sure //待出纳确认
Transaction_Need_Control_Sure //待内控确认
Transaction_Need_Finance_Sure //待财务确认
)
const (
Order_Doing = iota + 1 //待总监确认 待发布
Order_Need_Seller_Sure //待销售确认
Order_Status_Question //申诉订单
Order_Done //完成
Order_Need_Cashier_Sure //待出纳确认
Order_Need_Control_Sure //待内控确认
Order_Need_Finance_Sure //待财务确认
)
const (
Pay_Type_Zhi = iota + 1 //支付宝
Pay_Type_Transer //转账
Pay_Type_Pos //Pos机支付
Pay_Type_Zhi_Transer //支付宝转账
Pay_Type_Transer_Pos //转账和pos机
Pay_Type_Pos_Zhi //pos和支付宝
Pay_Type_All //pos和支付宝和转账
)
// 画展包及画展包申请状态码定义
const (
ARTSHOW_INSIDE = iota + 1 // 内部
ARTSHOW_PASS // 可展
//ARTSHOW_SHOW_PASS // 画展包的画展地址和时间 审批
ARTSHOW_SALE_ADDRESS_PASS // 画展包中画作的销售地址 审批
ARTSHOW_REWARD_PASS // 润格 审批
)
// 审批人的状态码
const (
IsLive = iota // 是否有效 0 有效 1 无效
IsLiveInvalid
)
// 可画展画展包状态
const (
NotCanShow = 1 // 不可画展
CanShow = 2 // 可画展
)
const (
Failed = 1
Ok = 0
BindError = 2
JsonUnmarshal = 3
NOTDATA = 4
ErrorHttp = 5
ErrorBody = 6
NotLogin = 401
OffLine = 402
NotLoginSqueeze = 409
SUCCESS = 200
UpdatePasswordSuccess = 201
DeleteSuccess = 204
NotExistInentifier = 202
ERROR = 500
InvalidParams = 400
//成员错误
ErrorExistNick = 10001
ErrorExistUser = 10002
ErrorNotExistUser = 10003
ErrorNotCompare = 10004
ErrorNotComparePassword = 10005
ErrorFailEncryption = 10006
ErrorNotExistProduct = 10007
ErrorNotExistAddress = 10008
ErrorExistFavorite = 10009
ErrorGetUserInfo = 10010
ErrorGetDepart = 10011
ErrorUpdateAw = 10012
ErrorGetArtShow = 10013
ErrorPriceRunFailed = 10014
ErrorArtistNotLock = 10015
ErrorArtistCardId = 10016
ErrorIndexes = 10017
ErrorNoArtist = 10018
//店家错误
ErrorBossCheckTokenFail = 20001
ErrorBossCheckTokenTimeout = 20002
ErrorBossToken = 20003
ErrorBoss = 20004
ErrorBossInsufficientAuthority = 20005
ErrorBossProduct = 20006
//管理员错误
ErrorAuthCheckTokenFail = 30001 //token 错误
ErrorAuthCheckTokenTimeout = 30002 //token 过期
ErrorAuthToken = 30003
ErrorAuth = 30004
ErrorAuthInsufficientAuthority = 30005
ErrorReadFile = 30006
ErrorSendEmail = 30007
ErrorCallApi = 30008
ErrorUnmarshalJson = 30009
ErrorAdminFindUser = 30010
//数据库错误
ErrorDatabase = 40001
//对象存储错误
ErrorOss = 50001
ErrorUploadFile = 50002
ErrorSelect = 50003
//店铺错误
ErrorExistShopName = 60001
ErrorNotExistShopName = 60002
ErrorNotAdmin = 60003
ErrNoDomain = 70001
ErrTelNum = 70002
ErrNoCode = 70003
ErrNoID = 70004
ErrNickName = 70005
InvalidID = 70006
InvalidPas = 70007
ErrStatus = 70008
ErrNoType = 70009
ErrNoUserID = 70010
ErrNoName = 70011
ErrNoDepCode = 70012
ErrNoTitle = 70013
ErrNoUrl = 70014
ErrNoMethod = 70015
ErrNotDep = 70016
ErrCreateQr = 70017
ErrNotSellerBoss = 70018
//上传
ErrorUploadVideoCover = 80001
ErrorUploadValidParam = 80002
ErrorFileReadErr = 80003
ErrorFileNotExists = 80004
ErrorChunkNotGt = 80005
ErrorChunk = 80006
ErrorUploadBos = 80007
ErrorFileCreate = 80008
ERROR_UID = 80009
ERROR_NOT_ZIP = 80010
ERROR_EMPTY_ZIP = 80011
ERROR_COPYRIGHT_CHUNK = 80012
ERROR_EMPTY_FILE = 80013
ERROR_OPEN_FILE = 80014
ERROR_READ_DIR = 80015
ERROR_ZIP = 80016
ERROR_NO_FILE = 80017
ERROR_ROTATE_IMG = 80018
ERROR_BAIDU_IMAGE = 80019
ERROR_BAIDU_FAIL = 80020
ERROR_DOWNLOAD_FILE = 80021
ERROR_INVALID_FILE_EXT = 80022
ERROR_ALIYUN_DOC_SUBMIT = 80023
ERROR_ALIYUN_DOC_PARSE = 80024
ERROR_DECODE_IMAGE = 80025
ErrorUpdateEmployee = 80026
//画作
ErrorAllotUids = 90001
ErrorBrandList = 11001
ErrorStoreNTF = 11002
//品牌方助记词注册失败
ErrorCreateAccount = 11010
ErrorUpdateVideo = 12001
//画家宝服务错误代码 130000 ~ 139999
Error13ArtistInfoCodeStart = 130000
Error13ArtistInfoCodeEnd = 139999
)
const (
SendPromotionMsgSuccess = 2
)
const (
NotHasFormula = 1 // 不存在 公式
HasFormula = 2 // 存在 公式
NotCare = 3 // 忽略 公式
)

8
pkg/e/dci/amendType.go Normal file
View File

@ -0,0 +1,8 @@
package err
var AmendType = map[string]string{
"TOBE_AMEND": "待补正",
"AMEND_CHECK_FAIL": "待补正审核不通过",
"REPLACE_DCI": "需要替换DCI补正",
"NO_NEED_REPLACE_DCI": "不需要替换DCI补正",
}

48
pkg/e/dci/areaCode.go Normal file
View File

@ -0,0 +1,48 @@
package err
/*var ProMunRegCode = map[string][]struct{}{
"北京市": "11",
"天津市": "12",
"河北省": "13",
"山西省": "14",
"内蒙古自治区": "15",
"辽宁省": "21",
"吉林省": "22",
"黑龙江省": "23",
"上海市": "31",
"江苏省": "32",
"浙江省": "33",
"安徽省": "34",
"福建省": "35",
"江西省": "36",
"山东省": "37",
"河南省": "41",
"湖北省": "42",
"湖南省": "43",
"广东省": "44",
"广西壮族自治区": "45",
"海南省": "46",
"重庆市": "50",
"四川省": "51",
"贵州省": "52",
"云南省": "53",
"西藏自治区": "54",
"陕西省": "61",
"甘肃省": "62",
"青海省": "63",
"宁夏回族自治区": "64",
"新疆维吾尔自治区": "65",
}
var BeiJing = map[string]string{}
var TianJin = map[string]string{}
var HeBei = map[string]string{}
var ShanXi14 = map[string]string{}
var NeiMeng = map[string]string{}
var ShanXi61 = map[string]string{}
*/

6
pkg/e/dci/certType.go Normal file
View File

@ -0,0 +1,6 @@
package err
var CertTypeMap = map[string]string{
"IDENTITY_CARD": "身份证",
"NATIONAL_LEGAL_MERGE": "统⼀社会信⽤代码",
}

View File

@ -0,0 +1,13 @@
package err
var DciDigitalRegStatusEnum = map[string]string{
"CHECK": "初审中",
"CHECK_FAIL": "初审不通过",
"PAY": "待支付",
"REVIEW": "复审中",
"TOBE_AMEND": "待补正",
"AMEND_CHECK_FAIL": "待补正审核失败",
"FINISH": "数登完成",
"DISREGARD": "不予处理",
"REGISTRATION_STOP": "申请停止",
}

8
pkg/e/dci/failDetail.go Normal file
View File

@ -0,0 +1,8 @@
package err
var FailDetail = map[string]string{
"CHECK_FAIL": "初审不通过",
"TOBE_AMEND": "待补正",
"AMEND_CHECK_FAIL": "待补正审核不通过",
"DISREGARD": "不予受理",
}

9
pkg/e/dci/fileType.go Normal file
View File

@ -0,0 +1,9 @@
package err
var FileType = map[string]string{
"TEXT": "文本(限制pdf类型)(限制文件大小10M)",
"IMAGE": "图片(限制jpg、jpeg、png类型)(限制文件大小5M)",
"AUDIO": "音频(限制mp3、wav类型)(限制文件大小50M)",
"VIDEO": "视频(限制mp4、avi、wmv类型)(限制文件大小200M)",
"PDF_IMAGE": "系列图(限制pdf类型)(限制文件大小10M)(限制子图数量2-30)",
}

View File

@ -0,0 +1,8 @@
package err
var FontCopyrightEnum = map[string]string{
"NO_NEED": "不涉及字体版权",
"FREE_FONT": "公共免费字体",
"ORIGINAL_FONT": "原创字体",
"AUTHORIZED_FONT": "商用字体已授权",
}

View File

@ -0,0 +1,6 @@
package err
var InvoiceTypeEnum = map[string]string{
"NORMAL": "普票",
"SPECIAL": "专票",
}

View File

@ -0,0 +1,6 @@
package err
var OwnershipWay = map[string]string{
"PERSON": "个人作品",
"ENTERPRISE": "法人作品",
}

7
pkg/e/dci/payStatus.go Normal file
View File

@ -0,0 +1,7 @@
package err
var PayStatus = map[string]string{
"PAY_SUCCESS": "支付成功",
"PAY_FAIL": "支付失败",
"UNPAID": "待支付",
}

View File

@ -0,0 +1,8 @@
package err
var PreRegistrationTrueWill = map[string]string{
"PASSWORD": "密码验证",
"CONFIRM_SMS": "用户短信验证",
"LIVE_SMS": "指纹或视频人脸验证",
"CERTIFICATE": "电子签名验证",
}

View File

@ -0,0 +1,5 @@
package err
var PublicationStatus = map[string]string{
"PUBLISHED": "作品已发表",
}

9
pkg/e/dci/resultCode.go Normal file
View File

@ -0,0 +1,9 @@
package err
var ResultCode = map[string]string{
"OK": "正常返回",
"BAD_REQUEST": "请求参数错误",
"PERMISSION_ERROR": "权限错误",
"BUSINESS_ERROR": "业务内容错误",
"SERVER_ERROR": "服务器错误",
}

66
pkg/e/dci/resultMsg.go Normal file
View File

@ -0,0 +1,66 @@
package err
var ResultMsg = map[string]string{
"PERMISSION_IS_NOT_EXIST": "权限未开通",
"WORK_NAME_IS_NULL": "作品名称为空",
"WORK_NAME_INVALID_LENGTH": "作品名称长度错误",
"WORK_CATEGORY_INVALID": "作品类型错误",
"WORK_FILE_ID_IS_NULL": "作品fileId为空",
"WORK_FILE_NOT_EXIST": "作品文件不存在",
"WORK_CREATION_INFO_IS_NULL": "作品创作信息为空",
"WORK_CREATION_NATURE_INVALID": "作品创作性质错误",
"WORK_CREATION_DATE_INVALID": "作品创作时间错误",
"WORK_CREATION_CODE_IS_NULL": "作品创作地点为空",
"WORK_PUBLICATION_INFO_IS_NULL": "作品发表信息为空",
"WORK_PUBLICATION_STATUS_INVALID": "作品发表状态错误",
"WORK_PUBLICATION_DATE_INVALID": "作品发表时间错误",
"WORK_PUBLICATION_CODE_INVALID": "作品发表地点错误",
"WORK_AUTHOR_NAME_IS_NULL": "作品作者名称为空",
"WORK_RIGHT_INFO_IS_NULL": "作品权利信息为空",
"WORK_RIGHT_SCOPE_INVALID": "作品权利范围错误",
"WORK_RIGHT_OBTAIN_WAY_INVALID": "作品权利获取方式错误",
"WORK_OWNERSHIP_WAY_INVALID": "作品权利归属方式错误",
"PREREGISTRATION_TRUE_WILL_INVALID": "真实意愿表达错误",
"ACCOUNT_BALANCE_STATUS_INVALID": "账号余额不足",
"DCI_FILE_TYPE_INVALID": "dci文件类型错误",
"DCI_COPYRIGHT_OWNER_ID_IS_NULL": "著作权人用户id为空",
"DCI_COPYRIGHT_OWNER_ID_INVALID": "著作权人用户id无效",
"DCI_CATEGORY_NOT_OPTIONAL": "DCI作品类型不可选",
"DCI_FILE_SIZE_INVALID": "dci作品文件大小超限",
"DCI_FILE_INVALID": "dci作品文件异常",
"DCI_FILE_NAME_INVALID": "dci作品文件为空",
"WORK_FILE_ID_INVALID": "dci作品文件id异常",
"WORK_CREATION_CODE_INVALID": "作品创作地点无效",
"CHANNEL_TERMINAL_INVALID": "渠道标签无效",
"DCI_CONTENT_ALREADY_EXIST": "相同文件已发起过dci申领",
"DCI_USER_ID_IS_NULL": "dci用户id为空",
"DCI_USER_ID_INVALID": "dci用户id有误",
"DCI_USER_CERT_FRONT_FILE_EMPTY": "dci证件正面文件入参为空",
"DCI_USER_CERT_BACK_FILE_EMPTY": "dci证件背面文件入参为空",
"DCI_USER_CERT_FRONT_FILE_NOT_EXIST": "dci证件正面文件不存在",
"DCI_USER_CERT_BACK_FILE_NOT_EXIST": "dci用户证件背面文件不存在",
"DCI_USER_PHONE_INVALID": "dci用户手机号无效",
"DCI_USER_NAME_INVALID": "dci用户名错误",
"DCI_USER_LEGAL_PERSON_CERT_NAME_EMPTY": "dci用户法人姓名无效",
"DCI_USER_LEGAL_PERSON_CERT_TYPE_EMPTY": "dci用户法人证件类型无效",
"DCI_USER_LEGAL_PERSON_CERT_NO_EMPTY": "dci用户法人证件号无效",
"DCI_USER_LEGAL_PERSON_CERT_NO_INVALID": "dci用户法人证件号错误",
"DCI_CERTIFICATE_START_TIME_INVALID": "dci证件开始时间错误",
"DCI_CERTIFICATE_END_TIME_INVALID": "dci证件结束时间错误",
"DCI_CERTIFICATE_FRONT_ID_INVALID": "dci证件正面文件d为空",
"DCI_CERTIFICATE_FRONT_NOT_EXIST": "dci证件正面文件不存在",
"DCI_CERTIFICATE_BACK_NOT_EXIST": "dci证件背面文件不存在",
"DCI_IDENTITY_START_TIME_INVALID": "dci证件开始时间错误",
"DCI_USER_AREA_INVALID": "dci用户所属地区错误,当前只支持CHINA_MAINLAND",
"DCI_USER_ALREADY_EXIST": "已注册过dci用户",
"DCI_CERTIFICATE_TYPE_INVALID": "dci证件类型错误",
"DCI_CERTIFICATE_NUMBER_INVALID": "dci证件号错误",
"DCI_CERTIFICATE_NUMBER_IS_NULL": "dci证件号为空",
"DCI_USER_PHONE_IS_NULL": "dci用户手机号为空",
"REPEAT_REQUEST_INTERCEPTION": "重复请求",
"DCI_CONTENT_NOT_EXIST": "DCI作品不存在",
"DCI_CONTENT_ID_INVALID": "dci申领id有误",
"DCI_CONTENT_ID_IS_NULL": "dci申领id为空",
"DCI_USER_NOT_EXIST": "dci用户不存在",
"DCI_USER_NOT_MATCH": "dci用户不匹配",
}

View File

@ -0,0 +1,5 @@
package err
var RightObtainWay = map[string]string{
"ORIGINAL": "原创",
}

5
pkg/e/dci/rightScope.go Normal file
View File

@ -0,0 +1,5 @@
package err
var RightScope = map[string]string{
"ALL": "全选",
}

6
pkg/e/dci/userStatus.go Normal file
View File

@ -0,0 +1,6 @@
package err
var UserStatus = map[string]string{
"NORMAL": "正常",
"DISABLE": "停用",
}

19
pkg/e/dci/workCategory.go Normal file
View File

@ -0,0 +1,19 @@
package err
var WorkCategory = map[string]string{
"WORD": "文字作品支持文件类型TEXT",
"ORAL": "口述作品支持文件类型AUDIO",
"MUSIC": "音乐作品支持文件类型AUDIO",
"DRAMA": "戏剧作品支持文件类型TEXT",
"QUYI": "曲艺作品支持文件类型TEXT",
"DANCE": "舞蹈作品支持文件类型VIDEO",
"ACRABATICS": "杂技作品支持文件类型VIDEO",
"ART": "美术作品支持文件类型IMAGE",
"ARCHITECTURE": "建筑作品支持文件类型IMAGE",
"PHOTOGRAPHY": "摄影作品支持文件类型IMAGE",
"MOVIE": "电影作品支持文件类型VIDEO",
"AUDIOVISUAL": "类似摄制电影方法创作作品支持文件类型VIDEO",
"DESIGN": "工程设计图、产品设计图支持文件类型IMAGE",
"DIAGRAM": "示意图支持文件类型IMAGE",
"MODEL": "模型支持文件类型IMAGE",
}

View File

@ -0,0 +1,5 @@
package err
var WorkCreationNature = map[string]string{
"ORIGINAL": "原创",
}

9
pkg/e/dci/workStatus.go Normal file
View File

@ -0,0 +1,9 @@
package err
var WorkStatus = map[string]string{
"DCI_PRE_REG_AUDITING": "申领审核中",
"DCI_PRE_REG_FINISH": "申领成功",
"DCI_PRE_REG_FAIL": "申领失败",
"DCI_PRE_REG_CANCEL": "dci撤销",
"DCI_PRE_REG_TOBE_CONFIRM": "申领待确认,账户余额不足",
}

247
pkg/e/msg.go Normal file
View File

@ -0,0 +1,247 @@
package e
const (
SERVER_CONFIG = "conf.ini"
SERVER_DUBBOGO_CONFIG = "dubbogo.yaml"
MODE_ENV = "MODE_ENV"
LoginFromPC = "pc"
OfflineSqueeze = "squeeze"
)
const (
ErrorOutputReward = "润格审批未通过,无法导出润格信息"
ErrorCreateApproval = "请勿重复提交"
ErrorExport = "无数据可导出"
ErrorExportNotAllowed = "未被允许的数据,不可导出"
ErrorSaveFile = "文件保存错误"
ErrorQueryArtistData = "查询画家基础信息失败"
ErrorNotAllow = "暂无权限"
ErrorZip = "文件压缩失败"
ErrorNotFoundArtwork = "画作数据缺失"
ErrorQueryRules = "获取权限失败"
ErrorReadTemp = "模板文件获取错误"
ErrorEncodeImage = "图片解码失败"
ErrorOVerSendBossMsg = "您今天已经对该审批人同类的审批发送过短信!"
ErrorCreateTalents = "创建岗位审核审批失败"
ErrorRollbackTalents = "回滚岗位审核审批失败"
ErrorCreateOffer = "创建入职审核审批失败"
ErrorRollbackOffer = "回滚入职审核审批失败"
ErrorResumeHireJudge = "录用申请确认失败"
ErrorResumeID = "无效的简历ID"
// 同步信息到站点签到
ErrorSendInfoToSiteSignIn = "同步信息到站点签到失败"
// 查询审批内容失败
ErrorQueryApprovalContent = "查询审批内容失败"
// 画展包ID不能为空
ErrorShowUidIsEmpty = "画展包ID不能为空"
// 获取用户状态信息失败
ErrorGetUserStatus = "获取用户状态信息失败"
ErrorLoanMoney = "借款金额错误"
ErrorImgExt = "图片格式错误"
ErrorImgDecode = "图片解析错误"
)
const (
ErrorQueryHonorInfo = "获取画家荣誉信息失败"
ErrorQueryArtShowInfo = "获取画展包信息失败"
ErrorUpdateCanShowStatus = "更新画展包可画展状态失败"
)
const (
ErrNotSameApprovalBossId = "当前审批人不一致"
ErrorApprovalUser = "获取审批人错误"
InvalidApprovalAndCopy = "无效的审批人"
ErrorQueryDirectOrDepartmentApprovalUser = "获取直属上级或部门审批人错误"
ErrorCurrentApprovalIsNotUsed = "审批设置无效,当前审批不可用"
ErrorNotSelectDepartment = "未选择所属部门"
// 任命审批
ErrorNotCatchUserDepartmentBoss = "未获取到任命的用户部门负责人"
ErrorEmptyPromotionStaffUid = "未获取到任命的员工信息"
ErrorEmptyHiredStaffUid = "未获取到录用的员工信息"
)
// 更新 销售站点信息提示
const (
FailedUpdateArtworkPriceSaleAddress = "更新画展包画作销售站点失败"
FailedUpdateArtworkSaleAddress = "更新画作销售站点失败"
)
// 画展包撤销提示
const (
FailedQueryArtShowInfo = "查询画展包信息失败"
ErrorNotAllowedRevokeArtShowApply = "当前审批中的画展包的状态不符合撤销条件"
ErrorShowInvoiceMiss = "缺少单据信息"
ErrorNoPrice = "当前画展包无价格信息"
)
const (
ErrorUserDisabled = "用户已停用"
ErrorNoArtworkLicense = "画作未授权"
ErrorNoWorkFile = "缺少作品文件"
ErrorNoDigitalRegisterId = "数登未申请"
ErrorNoArtworkUuid = "未选择画作"
ErrorArtworkAlreadyDci = "画作已经dci"
ErrorArtworkAlreadyDigital = "画作已经数登"
ErrorArtworkNotDci = "Dci尚未申请"
ErrorUnknown = "未知错误"
ErrorReplaceArtwork = "不能更换画作"
ErrorCreateAddressCode = "创作地址编码为空"
ErrorGetPayUrl = "获取支付链接失败"
ErrorRightAuthFile = "肖像权文件错误"
ErrorDciUserNoReg = "dci用户未注册"
ErrorDciUpload = "dci上传失败"
ErrorDciNoNeedUpdate = "dci用户无需更新"
ErrorNotEmpty = "不能为空"
ErrorDownloadFile = "下载文件错误"
ErrorBaiduChainError = "百度链错误"
ErrorBaiduChainAlreadyDone = "百度链已完成"
ErrorBaiduChaining = "百度链未完成"
ErrorOcr = "ocr错误"
ErrorArtworkEditNo = "画作属性不可修改"
ErrorDataNil = "数据为空"
ErrorDciUserNOFinish = "dci用户状态未完结"
ErrorNoCreationCompletionDate = "创作完成日期错误"
COPYRIGHT_NOT_IN_ARTIST_INFO_USER = "画家不在画家宝"
ERROR_CARDID_OCR = "身份证OCR失败"
ERROR_ARTIST_BLACKLIST = "画家已加入黑名单"
ERROR_EDIT_LIMIT = "编辑限制"
ERROR_DCI_USER_QUERY = "dci用户查询失败"
ErrorFileOverSize = "文件过大"
)
const (
CountSimilarIng = "相似度计算中"
)
var MsgFlags = map[ErrorCode]string{
SUCCESS: "操作成功",
UpdatePasswordSuccess: "修改密码成功",
NotExistInentifier: "该第三方账号未绑定",
ERROR: "fail",
NOTDATA: "没有数据",
InvalidParams: "请求参数错误",
BindError: "参数绑定错误,类型不一致",
JsonUnmarshal: "Json解析错误",
ErrorHttp: "请求错误",
ErrorBody: "响应错误",
ErrorExistNick: "已存在该昵称",
ErrorExistUser: "已存在该用户名",
ErrorNotExistUser: "该用户不存在",
ErrorNotCompare: "账号密码错误",
ErrorNotComparePassword: "两次密码输入不一致",
ErrorFailEncryption: "加密失败",
ErrorNotExistProduct: "该商品不存在",
ErrorNotExistAddress: "该收获地址不存在",
ErrorExistFavorite: "已收藏该商品",
ErrorGetUserInfo: "获取用户信息错误",
ErrorGetDepart: "获取部门信息错误",
ErrorUpdateAw: "同步画作信息错误",
ErrorGetArtShow: "获取画展包信息错误",
ErrorPriceRunFailed: "润格审批不通过",
ErrorArtistNotLock: "画家不是锁定状态",
ErrorArtistCardId: "画家身份证错误",
ErrorIndexes: "画家指数错误",
ErrorNoArtist: "没有该画家",
ErrorBossCheckTokenFail: "商家的Token鉴权失败",
ErrorBossCheckTokenTimeout: "商家TOken已超时",
ErrorBossToken: "商家的Token生成失败",
ErrorBoss: "商家Token错误",
ErrorBossInsufficientAuthority: "商家权限不足",
ErrorBossProduct: "商家读文件错误",
ErrorAuthCheckTokenFail: "Token鉴权失败",
ErrorAuthCheckTokenTimeout: "TOken已超时",
ErrorAuthToken: "Token生成失败",
ErrorAuth: "Token错误",
ErrorAuthInsufficientAuthority: "权限不足",
ErrorReadFile: "读文件失败",
ErrorSendEmail: "发送邮件失败",
ErrorCallApi: "调用接口失败",
ErrorUnmarshalJson: "解码JSON失败",
ErrorUploadFile: "上传失败",
ErrorAdminFindUser: "管理员查询用户失败",
ErrorSelect: "查询失败",
ErrorDatabase: "数据库操作出错,请重试",
ErrorOss: "OSS配置错误",
ErrorExistShopName: "店铺已被注册,请检查店铺名称和统一社会信用码",
ErrorNotExistShopName: "店铺不存在",
ErrorNotAdmin: "非管理员",
InvalidToken: "Token验证失败",
ErrorUploadVideoCover: "视频截取封面错误",
ErrorUploadValidParam: "上传参数非法",
ErrorFileReadErr: "读取文件错误",
ErrorFileNotExists: "文件不存在",
ErrorChunkNotGt: "分块数量不一致",
ErrorChunk: "读取分块错误",
ErrorUploadBos: "上传bos错误",
ErrorFileCreate: "文件创建错误",
ERROR_UID: "uid创建错误",
ERROR_NOT_ZIP: "压缩文件不是zip格式",
ERROR_EMPTY_ZIP: "压缩文件为空",
ERROR_COPYRIGHT_CHUNK: "批量上传不支持版权图",
ERROR_EMPTY_FILE: "文件为空",
ERROR_OPEN_FILE: "打开文件错误",
ERROR_READ_DIR: "读取文件夹错误",
ERROR_ZIP: "zip压缩错误",
ERROR_NO_FILE: "没有文件",
ERROR_ROTATE_IMG: "旋转图片出错",
ERROR_BAIDU_IMAGE: "图片审核不通过",
ERROR_BAIDU_FAIL: "图片审核失败",
ERROR_DOWNLOAD_FILE: "下载文件错误",
ERROR_INVALID_FILE_EXT: "不支持的文件格式",
ERROR_ALIYUN_DOC_SUBMIT: "文档提交错误",
ERROR_ALIYUN_DOC_PARSE: "文档解析错误",
ERROR_DECODE_IMAGE: "图片解析错误",
ErrNoDomain: "环境变量必须要有",
ErrTelNum: "手机号码错误",
ErrNoCode: "验证码必须要有",
ErrNoID: "ID缺少",
ErrNickName: "请正确填写姓名项",
InvalidID: "身份证长度18位",
InvalidPas: "密码不小于6位",
ErrStatus: "状态非法",
ErrNoType: "缺少类型",
ErrNoUserID: "缺少用户ID",
ErrNoName: "缺少名称",
ErrNoDepCode: "缺少部门code",
ErrNoTitle: "缺少标题",
ErrNoUrl: "缺少url",
ErrNoMethod: "缺少method",
ErrNotDep: "缺少部门",
ErrCreateQr: "生成二维码错误",
ErrNotSellerBoss: "当前人员身份非销售总监,不能操作",
ErrorAllotUids: "分配人员错误",
ErrorBrandList: "获取品牌方列表错误",
ErrorStoreNTF: "系列上链错误",
ErrorUpdateVideo: "保存成功,同步画家宝错误",
ErrorUpdateEmployee: "更新员工档案错误",
}
// GetMsg 获取状态码对应信息
func GetMsg(code int) string {
msg, ok := MsgFlags[ErrorCode(code)]
if ok {
return msg
}
return MsgFlags[ERROR]
}

1093
pkg/e/oa_msg.go Normal file

File diff suppressed because it is too large Load Diff

38
pkg/router/ai_images.go Normal file
View File

@ -0,0 +1,38 @@
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/ai_images"
"github.com/gin-gonic/gin"
)
func AiImageRoute(r *gin.RouterGroup) {
aiRoute := r.Group("api/ai")
//帐号
useRoute := aiRoute.Group("user")
useRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider))
{
useRoute.POST("list", ai_images.CoinAccounts) //帐号列表
}
//积分
coinRoute := aiRoute.Group("coin")
coinRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider))
{
coinRoute.POST("/acquire/list", ai_images.AcquireList) //获取积分列表
coinRoute.POST("/custom/list", ai_images.CustomList) //使用列表
}
//浏览器
feed := aiRoute.Group("feedback")
feed.Use(middleware.CheckLogin(service.AccountProvider))
{
feed.POST("create", ai_images.Create)
feed.POST("remove", ai_images.Remove)
feed.POST("detail", ai_images.Detail)
feed.POST("list", ai_images.List)
feed.POST("update", ai_images.Update)
}
}

65
pkg/router/artist.go Normal file
View File

@ -0,0 +1,65 @@
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
serviceArtist "github.com/fonchain_enterprise/fonchain-main/pkg/service/artist"
"github.com/gin-gonic/gin"
)
func ArtistRoute(r *gin.RouterGroup) {
noAuth := r.Group("")
auth := r.Group("")
auth.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
//需要登陆保护
artist := auth.Group("artist")
{
artist.POST("add", service.CreateProfile)
artist.PUT("edit", service.UpdateProfile)
artist.POST("edit-limit", serviceArtist.EditLimit)
artist.POST("detail", service.Detail)
artist.POST("list", service.List)
artist.PUT("media", service.Media)
artist.PUT("indexs", service.Indexs)
artist.PUT("honor", service.Honor)
artist.DELETE("honor-del", service.HonorDel)
artist.POST("list-export", service.ListExport)
artist.POST("export-field-list", service.ExportArtistField)
artist.POST("contract-add", service.ContractAdd)
artist.PUT("contract", service.ContractEdit)
artist.POST("contract-list", service.ContractList)
artist.DELETE("del", service.DelArtist)
artist.POST("idname", service.IdName)
artist.POST("invitation-add", service.InvitationAdd)
artist.POST("invitation-list", service.InvitationList)
artist.POST("invitation-update", service.InvitationUpdate)
artist.POST("invitation-update2", service.InvitationUpdate2)
artist.POST("invitation-del", service.InvitationDel)
artist.POST("invitation-reAdd", service.InvitationReAdd) //重新发起邀请函
artist.POST("download", service.DownloadArtist)
artist.POST("get-cardid-withimg", service.GetCardIdWithImg)
artist.POST("del-contract", service.DelContract)
artist.POST("one-query-list", service.ArtistOneQueryList)
artist.POST("one-query-export", service.ArtistOneQueryExport)
artist.POST("one-query-audit", service.ArtistOneQueryAudit)
artist.POST("one-query-show-time-point", service.ArtistOneQueryShowTimePoint) //未核验的画展再画展时间组件标记红点
artist.POST("send-indexes", service.SendIndexes)
artist.POST("indexes-log", service.IndexesLog)
artist.POST("sync-low-artist", service.BatchUpdLowArtist)
artist.POST("save-low-artist", service.SaveLowArtist)
artist.POST("low-artist-list", service.LowArtistList)
artist.POST("base-info", service.ArtistBaseInfo)
artist.POST("base-info-list", service.ArtistBaseList)
artist.POST("black-list-update", serviceArtist.BlackListUpdate)
artist.POST("black-list", serviceArtist.BlackList)
artist.POST("search-list", service.SearchList)
artist.POST("update-contract", serviceArtist.UpdateContract)
}
// 画作服不需要登录的接口
artistNoLogin := noAuth.Group("artist")
{
artistNoLogin.POST("invitation-info", service.InvitationInfo)
artistNoLogin.POST("invitation-detail", service.InvitationDetail) //查看邀请函详情
artistNoLogin.GET("list-export", service.ListExport)
}
}

View File

@ -0,0 +1,330 @@
// Package router -----------------------------
// @file : artistinfoRouter.go
// @author : JJXu
// @contact : wavingbear@163.com
// @time : 2023/3/6 16:45
// -------------------------------------------
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/artistInfo/area"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/artistInfo/asArtist"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/artistInfo/asArtshow"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/artistInfo/asArtwork"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/artistInfo/asContract"
//"github.com/fonchain_enterprise/fonchain-main/pkg/service/artistInfo/asCopyright"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/artistInfo/asPush"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/artistInfo/asStatement"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/artistInfo/asUser"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/artistInfo/authPayment"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/artistInfo/blackList"
inCircleArticle "github.com/fonchain_enterprise/fonchain-main/pkg/service/artistInfo/inCricleArticle"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/artistInfo/mailArtwork"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/backend"
"github.com/gin-gonic/gin"
)
func NewAuditRouter(r *gin.Engine) {
// 后端
v1 := r.Group("api")
v1.Use(middleware.CheckLogin(service.AccountProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
v2 := r.Group("api/v2")
v2.Use(middleware.CheckLogin(service.AccountProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
noAuth := r.Group("api")
//
//========================================================================================
// 画家
authGroup := v1.Group("")
{
noCheckLoginRouter := r.Group("api")
//cacheUserCheckLoginRouter := v1.Use(new(middleware.ApiCache).ApiCacheMiddleware(30 * time.Second))
//cacheUserCheckLoginRouter.POST("user/view/list/get", asArtist.GetArtistProfileList)
v1.POST("user/view/list/get", asArtist.GetArtistProfileList)
v1.POST("artist/supplement/getSupplementDetail", asArtshow.ArtistSupplement.GetSupplementDetail)
v1.POST("user/lock", asUser.LockUser)
v1.POST("user/lockRollback", asUser.LockRollBack) //取消解锁
v1.POST("user/getInvitedList", asUser.GetInvitedListByBackendSide2) // 获取接受邀请的画家列表(邀请了哪些人)
noCheckLoginRouter.POST("user/getInvitedList2", asUser.GetInvitedListByBackendSide2) // 获取接受邀请的画家列表(邀请了哪些人),无身份校验
v1.POST("user/getInviterUserList", asUser.GetInviterUserList) // 获取邀请人列表(被哪些人邀请过)
v1.POST("user/inviteStatic", asUser.InviteStatic) // 邀请人数统计列表(只统计邀请人数大于1的画家列表)
v1.POST("user/batchCreateQrCode", asUser.BatchCreateQrCode) // 批量生成二维码
v1.POST("artist/import", asArtist.ImportUserToArtistService) // 导入画家宝画家到画家服务
v1.POST("artist/importArtistToArtistinfo", asArtist.ImportArtistToArtistinfo) //画家导入画家宝
v1.POST("realNameAudit/query", asUser.GetRealNameAuditList) //获取实名审批列表
v1.POST("realNameAudit/edit", asUser.EditRealNameAudit) //编辑实名审批信息
//------------------------------User
v1.POST("user/User/create", asUser.Handler.CreateUser)
v1.POST("user/User/delete", asUser.Handler.DeleteUser)
v1.POST("user/User/update", asUser.Handler.UpdateUser)
v1.POST("user/User/detail", asUser.Handler.GetUserDetail)
v1.POST("user/User/query", asUser.Handler.GetUserList)
v1.POST("artistInfoUser/export/view", asUser.GetBackendUserViewList)
v1.POST("artistInfoUser/export/excel", asUser.ExportBackendUserViewList)
v1.POST("artistInfoUser/export/static", asUser.ExportBackendUserStatic)
}
//========================================================================================
// 画作
{
//v1.POST("artwork/profile/create", asArtwork.CreateWorkProfile) //创建画作首选项
//v1.POST("artwork/profile/update", asArtwork.UpdateArtwork) //更新画作首选项
//v1.POST("artwork/profile/update2", asArtwork.UpdateArtwork2) //更新画作首选项(根据页面进行了优化)
v1.POST("artwork/profile/get", asArtwork.GetArtworkProfile) //查询画作详情
//v1.POST("artwork/profile/preview/get", asArtwork.GetArtworkPreviewListAtUserSide) //查询画作预览列表(画作管理中的列表)
v1.POST("artwork/profile/preview/history", asArtwork.GetArtworkHistoryList) //查询画作历史记录
//v1.POST("artwork/list/query", asArtwork.GetArtworkList) //查询画作列表 todo暂时弃用
v1.POST("artwork/delete", asArtwork.DelArtwork) //删除画作
//v1.POST("artwork/supplement/UnsupplementedList", asArtwork.Supplement.GetSupplementDataListAtUserSide) //获取当前的画作信息补充列表(用户端) //GetUnsupplementedDataList
//v1.POST("artwork/supplement/update", asArtwork.Supplement.UpdateSupplement) //画作信息补充
v1.POST("artwork/supplement/detail", asArtwork.Supplement.Detail) //获取画作补充信息详情
v1.POST("artwork/getArtistArtworkList", asArtwork.GetArtworkList2) //获取指定画家的画作列表
v1.POST("artwork/import", asArtwork.ImportArtowrkToArtworkService) //导入画作到画作服务
}
//========================================================================================
// 画展
{
v1.POST("artshow/UnfinishedAuditStatistics", asArtshow.GetAuditUnfinishedStatistics) //获取画展模块未完成审批统计
v1.POST("artshow/video/getvideos", asArtshow.ArtshowVideo.GetArtshowVideoListAtUserSide) //获取画展视频列表
v1.POST("artshow/video/updateVideo", asArtshow.ArtshowVideo.UpdateArtshowVideo) //更新视频信息
v1.POST("artshow/video/getVideoDetail", asArtshow.ArtshowVideo.GetVideoDetail) //获取视频详情
v1.POST("artshow/artistIndex/getArtistIndexList", asArtshow.ArtshowIndex.GetArtistIndexListAtUserSide) //用户端获取画家指数列表
v1.POST("artshow/artistIndex/updateArtistIndex", asArtshow.ArtshowIndex.UpdateArtistIndex) //更新画家指数
v1.POST("artshow/artistSupplement/getSupplementList", asArtshow.ArtistSupplement.GetArtistSupplementListAtUserSide) //用户端获取画家补充信息列表
v1.POST("artshow/artistSupplement/updateSupplement", asArtshow.ArtistSupplement.UpdateArtistSupplement) //更新画家补充信息
v1.POST("artshow/artshowHistoryGroup", asArtshow.ArtshowHistoryGroup) //获取画家的画展历史记录
v1.POST("artshow/list", asArtshow.ArtshowList) //获取画家的画展历史记录
v1.POST("artshow/update-recommend", asArtshow.UpdateRecomend) //获取画家的画展历史记录
}
{
v1.POST("backend/artwork/auditFlow/audit", asArtwork.Supplement.AuditSupplement) //画作审批(基本信息和补充信息共用一个接口)
v1.POST("backend/artwork/auditFlow/reAudit", asArtwork.Supplement.ReAuditBaseInfo) //重新审批(目前只有基本信息审批有这功能) Deprecated 此逻辑由前端控制,后台不需要处理
v1.POST("backend/artwork/preview/list", asArtwork.GetArtworkPreviewListAtBackendSide2) //画作基本信息列表(后端)
v1.POST("backend/artwork/preview/detail", asArtwork.GetArtworkPreviewDetailAtBackendSide2) //画作基本信息详情
//v1.POST("backend/artwork/supplement/list", asArtwork.Supplement.GetSupplementDataListAtBackendSide3) //画作信息补充列表(后端)
v1.POST("backend/artwork/supplement/list", asArtwork.Supplement.GetViewArtworkSupplementDetailList)
v1.POST("backend/artwork/viewReviewArtistStatic/query", asArtwork.Supplement.GetViewReviewArtistStaticList)
v1.POST("backend/artwork/auditFlow/baseReviewAudit", asArtwork.Supplement.ReviewBaseArtworkV2) //基本画作复审
v1.POST("backend/artwork/auditFlow/baseReviewList", asArtwork.Supplement.ReviewBaseArtworkList) //复审画作列表
v1.POST("backend/artwork/review/export/excel", asArtwork.Supplement.ExportArtworkReviewList) //导出基本画作复审数据
v1.POST("backend/artwork/review/export/static", asArtwork.Supplement.ExportArtworkReviewStatic) //导出复审静态资源
v1.POST("backend/artwork/auditFlow/baseReviewAudit/save", asArtwork.Supplement.TempSaveReviewStatus)
v1.POST("backend/artwork/auditFlow/baseReviewAudit/list", asArtwork.Supplement.TempSaveReviewStatusList)
v1.POST("artistInfoArtwork/artworkBaseAuditHistory/query", asArtwork.Supplement.GetArtworkBaseAuditHistoryList)
v1.POST("artistInfoArtwork/reviewAuditMessage/query", asArtwork.Supplement.GetReviewAuditMessageList) //复审消息查询
v1.POST("artistInfoArtwork/reviewAuditMessage/static", asArtwork.Supplement.GetReviewAuditMessageStatic) //复审消息阅读状态统计
v1.POST("artistInfoArtwork/reviewAuditMessage/update", asArtwork.Supplement.UpdateReviewAuditMessage) //更新复审消息,一键审批
v1.POST("artistInfoArtwork/reviewAuditMessage/delete", asArtwork.Supplement.DeleteReviewAuditMessage) //删除复审消息,一键删除已读消息
v1.POST("backend/artwork/supplement/generate", asArtwork.Supplement.GenerateSupplementInfo) //生成画作补充信息
v1.POST("backend/menus/get", backend.MenusGet) //画作信息补充列表(后端)
v1.POST("backend/artist/UnfinishedArtworkBase", backend.GetArtistListUnfinishedArtworkBase) //获取未完成画作基本信息审批的艺术家列表
v1.POST("backend/artist/UnfinishedArtworkSupplement", backend.GetArtistListOfUnfinishedArtworkSupplement) //获取未完成画作补充信息审批的艺术家列表
v1.POST("backend/artist/ArtistsArtworkStaticList", asArtist.ArtistsArtworkStaticList) //画家的画作数据统计
v1.POST("backend/export-field-list", backend.ExportFieldList)
authGroup.Use(middleware.CheckLogin(service.AccountProvider))
//获取导出信息
//authGroup.POST("backend/artwork/preview/list-export", asArtwork.GetArtworkPreviewListAtBackendSideExport2) //画作基本信息列表(后端)
v1.POST("backend/artwork/preview/list-export", asArtwork.GetArtworkPreviewListAtBackendSideExport2) //画作基本信息列表(后端)
v1.POST("backend/artshow/video/generateVideoRecord", asArtshow.ArtshowVideo.GenerateArtshowVideoRecord) //生成画展视频记录
v1.POST("backend/artshow/video/getVideoRecords", asArtshow.ArtshowVideo.GetArtshowVideoListAtBackendSide) //获取待审批画展视频列表
v1.POST("backend/artshow/video/auditVideo", asArtshow.ArtshowVideo.AuditArtshowVideo) //审批画展视频资料
v1.POST("backend/artshow/video/getLockedArtistList", asArtshow.ArtshowVideo.GetLockedArtistList) //获取锁定的画家列表(视频)
v1.POST("backend/artshow/artistIndex/createArtistIndex", asArtshow.ArtshowIndex.GenerateArtistIndexRecords) //生成画家指数记录
v1.POST("backend/artshow/artistIndex/getArtistIndexRecords", asArtshow.ArtshowIndex.GetArtistIndexListAtBackendSide) //获取画家指数审批列表
v1.POST("backend/artshow/artistIndex/auditArtistIndex", asArtshow.ArtshowIndex.AuditArtistIndex) //审批画家指数数据
v1.POST("backend/artshow/artistIndex/getLockedArtistList", asArtshow.ArtshowIndex.GetLockedArtistList) //获取锁定的画家列表(画家指数)
v1.POST("backend/artshow/artistIndex/getArtistIndexDetail", asArtshow.ArtshowIndex.GetArtistIndexDetail) //获取画家指数详情
v1.POST("backend/artshow/artistIndex/staticDetail", asArtshow.ArtshowIndex.GetViewArtistIndexStaticDetail) //锁定画家画家指数统计详情
v1.POST("backend/artshow/artistIndex/staticList", asArtshow.ArtshowIndex.GetViewArtistIndexStaticList) //锁定画家画家指数统计列表
v1.POST("backend/artshow/artistSupplement/createSupplement", asArtshow.ArtistSupplement.GenerateArtistSupplementRecords) //生成画家补充信息记录
v1.POST("backend/artshow/artistSupplement/getSupplementRecords", asArtshow.ArtistSupplement.GetArtistSupplementListAtBackendSide) //获取成画家补充信息审批列表
v1.POST("backend/artshow/artistSupplement/auditSupplement", asArtshow.ArtistSupplement.AuditArtistSupplement) //审批成画家补充信息数据
//v1.POST("backend/artshow/artistSupplement/getSupplementList", asArtshow.ArtistSupplement.GetLockedArtistList) //获取锁定的画家列表(画家信息补充)
v1.POST("artshow/broker/getItemList", asArtshow.BrokerSupplement.GetItemList) //获取经纪人下拉菜单列表
v1.POST("artshow/broker/updateRecord", asArtshow.BrokerSupplement.UpdateBrokerSupplementRecord) //更新经纪人补充信息
v1.POST("artshow/broker/getSupplementDetail", asArtshow.BrokerSupplement.GetSupplementDetail) //获取经纪人补充信息详情
v1.POST("artshow/broker/getSupplementList", asArtshow.BrokerSupplement.GetSupplementList) //获取经纪人补充信息列表s
v1.POST("backend/artshow/broker/createBrokerSupplementRecord", asArtshow.BrokerSupplement.CreateBrokerSupplementRecord) //创建经纪人补充信息
v1.POST("backend/artshow/broker/bindAndGetBroker", asArtshow.BrokerSupplement.BindAndGetArtPackageAndBrokerSupplement) //绑定并获取画展包经纪人
v1.POST("backend/artshow/generateAllSupplement", asArtshow.ArtshowIndex.GenerateAllSupplement) //生成所有画家补充信息(画展视频资料、画家指数、画家补充信息、经纪人补充信息)
}
// 经纪人画展
{
v1.POST("artshow/broker/updateArtistSupplement", asArtshow.ArtistSupplement.AuditArtistSupplement) //审批成画家补充信息数据
}
//========================================================================================
// 经纪人代补充画展信息
{
v1.POST("artshow/broker/getArtistSupplementStatus", asArtshow.BrokerOperationControl.GetArtistSupplementStatus) //获取画家信息的补充状态
v1.POST("artshow/broker/getArtistSupplementDetail", asArtshow.BrokerOperationControl.GetArtistSupplementDetail) //获取画家简介补充信息
v1.POST("artshow/broker/getArtworkSupplementStatusList", asArtshow.BrokerOperationControl.GetArtworkSupplementStatusList) //获取画作补充状态列表
v1.POST("artshow/broker/getArtistIndexSupplementList", asArtshow.BrokerOperationControl.GetArtistIndexSupplementList) //获取画家指数列表
v1.POST("artshow/broker/getArtistVideo", asArtshow.BrokerOperationControl.GetArtistVideo) //获取画家视频
v1.POST("artshow/broker/getArtworkSupplementDetail", asArtshow.BrokerOperationControl.GetArtworkSupplementDetail) //获取画作补充信息
v1.POST("artshow/broker/updateArtistInfo", asArtshow.BrokerOperationControl.UpdateArtistInfo) //更新画家信息
v1.POST("artshow/broker/updateArtistVideoSupplement", asArtshow.BrokerOperationControl.UpdateArtistVideoSupplement) //更新画家视频信息
v1.POST("artshow/broker/createArtistIndexSupplement", asArtshow.BrokerOperationControl.CreateArtistIndexSupplement) //更新画家指数
v1.POST("artshow/broker/updateArtworkSupplement", asArtshow.BrokerOperationControl.UpdateArtworkSupplement) //更新画作补充信息
v2.POST("artshow/broker/getArtistSupplementDetail", asArtshow.BrokerOperationControl.GetArtistSupplementDetailV2) //获取画家简介补充信息V2
v2.POST("artshow/broker/updateArtistInfo", asArtshow.BrokerOperationControl.UpdateArtistInfoV2) //更新画家信息V2
v1.POST("artshow/broker/getArtshowFlowPrice", asArtshow.BrokerOperationControl.GetArtshowFlowPrice) //获取平尺数底价详情
v1.POST("artshow/broker/createArtshowFlowPrice", asArtshow.BrokerOperationControl.CreateArtshowFlowPrice) //获取平尺数底价详情
v1.POST("artshow/broker/getSupplementFromArtistSystem", asArtshow.BrokerOperationControl.GetArtistSupplementFromSystem) //从画家系统获取补充信息
v1.POST("artshow/bankInfo/update", asArtshow.BrokerOperationControl.UpdateBankInfo) //从画家系统获取补充信息
v1.POST("artshow/bankInfo/get", asArtshow.BrokerOperationControl.GetBankInfo) //从画家系统获取补充信息
v1.POST("artshow/copyrightComment/list", asArtshow.BrokerOperationControl.GetCopyrightCommentList)
v1.POST("artshow/copyrightComment/update", asArtshow.BrokerOperationControl.UpdateCopyrightComment)
v1.POST("artshow/copyrightComment/detail", asArtshow.BrokerOperationControl.GetCopyrightCommentDetail)
}
//========================================================================================
// 合同
{
v1.POST("contract/createContractMgmt", asContract.CreateContractMgmt) //创建合同
v1.POST("contract/contractListMgmt", asContract.ContractListMgmt) //画家合同列表
v1.POST("contract/contractListMgmt2", asContract.ContractListMgmtV2) //画家合同列表v2
v1.POST("contract/contractArtistStatList", asContract.GetContractArtistStatList) //画家合同统计列表
v1.POST("contract/batchCreate", asContract.BatchCreateContract) //批量创建合同
v1.POST("contract/reBatchCreate", asContract.ReBatchCreateContract) //重新一键发起合同
v1.POST("contract/artworkList", asContract.ContractArtworkList) //合同画作列表
}
//========================================================================================
// 对账单
{
v1.POST("statement/uploadExcelOneTx", asStatement.UploadExcelOneTx) //导入物权附件一
v1.POST("statement/uploadExcelTwoTx", asStatement.UploadExcelTwoTx) //导入物权附件二
v1.POST("statement/uploadExcelOneCopy", asStatement.UploadExcelOneCopy) //导入版权附件一
v1.POST("statement/uploadExcelTwoCopy", asStatement.UploadExcelTwoCopy) //导入版权附件二
v1.POST("statement/getAllBatchTimeTx", asStatement.GetAllBatchTimeTx) //获取物权所有批次时间
v1.POST("statement/getAllBatchTimeCopy", asStatement.GetAllBatchTimeCopy) //获取版权所有批次时间
v1.POST("statement/getArtworkSoldTxList", asStatement.GetArtworkSoldTxList) //按要求获取画家列表(物权)
v1.POST("statement/getArtworkSoldTxDetailList", asStatement.GetArtworkSoldTxDetailList) //根据批次uid获取画家已售的画作物权列表
v1.POST("statement/getArtworkSoldCopyList", asStatement.GetArtworkSoldCopyList) //按要求获取画家列表(版权)
v1.POST("statement/getArtworkSoldCopyDetailList", asStatement.GetArtworkSoldCopyDetailList) //根据批次uid获取画家已售的画作版权列表
}
//========================================================================================
// 黑名单
{
v1.POST("blackList/create", blackList.Service.Create)
v1.POST("blackList/delete", blackList.Service.Delete)
v1.POST("blackList/search", blackList.Service.Search)
v1.POST("blackList/update", blackList.Service.Update)
}
//========================================================================================
// 展讯
{
//--------------------------------展讯文章内容
v1.POST("inCircleArticle/InCircleArticle/create", inCircleArticle.Handler.CreateInCircleArticle)
v1.POST("inCircleArticle/InCircleArticle/delete", inCircleArticle.Handler.DeleteInCircleArticle)
v1.POST("inCircleArticle/InCircleArticle/update", inCircleArticle.Handler.UpdateInCircleArticle)
v1.POST("inCircleArticle/InCircleArticle/detail", inCircleArticle.Handler.GetInCircleArticleDetail)
v1.POST("inCircleArticle/InCircleArticle/query", inCircleArticle.Handler.GetInCircleArticleList)
v1.POST("inCircleArticle/InCircleArticle/like", inCircleArticle.Handler.SetLike) //点赞
v1.POST("inCircleArticle/InCircleArticle/sync", inCircleArticle.Handler.SyncInCircleArticle) //点赞
//--------------------------------展讯用户信息
v1.POST("inCircleArticle/InCircleUser/create", inCircleArticle.Handler.CreateInCircleUser)
v1.POST("inCircleArticle/InCircleUser/delete", inCircleArticle.Handler.DeleteInCircleUser)
v1.POST("inCircleArticle/InCircleUser/update", inCircleArticle.Handler.UpdateInCircleUser)
v1.POST("inCircleArticle/InCircleUser/detail", inCircleArticle.Handler.GetInCircleUserDetail)
v1.POST("inCircleArticle/InCircleUser/query", inCircleArticle.Handler.GetInCircleUserList)
//--------------------------------展讯文章评论
v1.POST("inCircleArticle/Comment/create", inCircleArticle.Handler.CreateComment)
v1.POST("inCircleArticle/Comment/delete", inCircleArticle.Handler.DeleteComment)
v1.POST("inCircleArticle/Comment/update", inCircleArticle.Handler.UpdateComment)
v1.POST("inCircleArticle/Comment/detail", inCircleArticle.Handler.GetCommentDetail)
v1.POST("inCircleArticle/Comment/query", inCircleArticle.Handler.GetCommentList)
//------------------------------Swiper轮播图
v1.POST("inCircleArticle/Swiper/create", inCircleArticle.Handler.CreateSwiper)
v1.POST("inCircleArticle/Swiper/delete", inCircleArticle.Handler.DeleteSwiper)
v1.POST("inCircleArticle/Swiper/update", inCircleArticle.Handler.UpdateSwiper)
v1.POST("inCircleArticle/Swiper/detail", inCircleArticle.Handler.GetSwiperDetail)
v1.POST("inCircleArticle/Swiper/query", inCircleArticle.Handler.GetSwiperList)
}
{
//------------------------------ExportField
v1.POST("artistInfoUser/exportField/create", asUser.Handler.CreateExportField)
v1.POST("artistInfoUser/exportField/delete", asUser.Handler.DeleteExportField)
v1.POST("artistInfoUser/exportField/update", asUser.Handler.UpdateExportField)
v1.POST("artistInfoUser/exportField/detail", asUser.Handler.GetExportFieldDetail)
v1.POST("artistInfoUser/exportField/query", asUser.Handler.GetExportFieldList)
}
{
//------------------------------省市区,银行网点查询
v1.POST("area/queryBankList", area.GetBankListHandler) //获取银行列表
v1.POST("area/queryMainBankList", area.GetMainBankListHandler) //获取总行列表
v1.POST("area/getTree", area.GetAreaTreeHandler) //获取省市区树
}
//----------------------------------其它
{
noAuth.POST("tmp/uploadpic", service.UploadImg)
v1.POST("test/microErr", service.MicroErr)
v1.POST("script/syncLowerArtist", asUser.SyncLowArtistHandler) //同步低优先级画家
noAuth.POST("fake/login", asUser.FakeLogin) //模拟登录
noAuth.POST("unipush2v0/test", asPush.Test)
}
//========================================================================================
//// asCopyright
//{
// //------------------------------CopyrightReg
// v1.POST("copyright/artwork/update", asCopyright.Handler.UpdateCopyrightReg)
// v1.POST("copyright/artwork/updateStatus", asCopyright.Handler.UpdateCopyrightRegStatus)
// v1.POST("copyright/artwork/detail", asCopyright.Handler.GetCopyrightRegDetail)
// v1.POST("copyright/artwork/query", asCopyright.Handler.GetCopyrightRegList)
// v1.POST("copyright/artwork/record/query", asCopyright.Handler.GetCopyrightRegRecordList)
// v1.POST("copyright/artwork/getDciPayUrl", asCopyright.Handler.GetDciPayUrl) //获取支付链接
// //v1.GET("copyright/artwork/dciPayWs", asCopyright.DigitPayService.ConnDciPayWebsocket)
// v1.POST("copyright/status/static", asCopyright.Handler.GetCopyrightStatusStatic)
// v1.POST("copyright/sync/dciData", asCopyright.Handler.SyncDciData) //同步初审数据
// v1.POST("copyright/startSecondReview", asCopyright.Handler.StartSecondReview) //开始复审
// v1.POST("copyright/syncPaymentStatus", asCopyright.Handler.SyncPaymentStatusFromThirdParty) //同步支付状态
//}
//========================================================================================
// authPayment
{
paymentRouter := v1.Group("")
paymentRouter.Use(middleware.InitBody(), middleware.RecordOperation())
//------------------------------AuthPayment
//v1.POST("authPayment/detail", authPayment.Handler.GetAuthPaymentDetail)
//v1.POST("authPayment/query", authPayment.Handler.GetAuthPaymentList)
paymentRouter.POST("authArtshow/view/query", authPayment.Handler.GetAuthPaymentArtShowList) //可发起支付画展包视图列表(一级)
paymentRouter.POST("authPayment/view/query", authPayment.Handler.GetViewAuthPaymentList) //发起支付记录视图列表(二级)
paymentRouter.POST("authPayment/update/per", authPayment.Handler.UpdateAuthPaymentPercent) //更新比例
paymentRouter.POST("authPayment/create", authPayment.Handler.CreateAuthPaymentSend) //发起支付
paymentRouter.POST("authPayment/update", authPayment.Handler.UpdateAuthPayment) //更新支付
paymentRouter.POST("authPayment/delete", authPayment.Handler.DeleteAuthPayment) //删除支付
paymentRouter.POST("authPayment/stat", authPayment.Handler.GetAuthPaymentStat) //鉴证支付统计
}
//========================================================================================
// mailArtwork 寄画退画
{
//寄画
v1.POST("mailArtwork/viewArtistMailStat/query", mailArtwork.Handler.GetViewArtistMailStatList) //一级列表,画家寄画统计列表
v1.POST("mailArtwork/viewMailArtworkData/query", mailArtwork.Handler.GetViewMailArtworkDataList) //二级列表 寄画的画作列表,包含画作信息
v1.POST("mailArtwork/cansend/query", mailArtwork.Handler.GetCanSendMailArtworkList) //查询可寄出的画作列表
v1.POST("mailArtwork/confirm", mailArtwork.Handler.ConfirmMailArtwork) //发起寄画/退画
v1.POST("mailArtwork/courierEdit", mailArtwork.Handler.CourierEdit) //快递信息填写
v1.POST("mailArtwork/courierDetail", mailArtwork.Handler.CourierDetail) //快递信息查询
v1.POST("mailArtwork/putInStorage", mailArtwork.Handler.PutInStorage) //入库
v1.POST("mailArtwork/artworkCourierGroup", mailArtwork.Handler.ArtworkCourierGroup) //通过uid查询画作和快递信息并按照寄出状态分组
//退画
v1.POST("returnArtwork/artistReturnStat/query", mailArtwork.Handler.GetArtistReturnStatDataList) //一级列表,画家退画统计列表
v1.POST("returnArtwork/viewReturnArtwork/query", mailArtwork.Handler.GetViewReturnArtworkDataList) //二级列表,查询已发起退回的画作列表
v1.POST("returnArtwork/canreturn/query", mailArtwork.Handler.GetCanReturnArtworkList) //查询可退回的画作列表
v1.POST("mailArtwork/mailArtwork/delete", mailArtwork.Handler.DeleteMailArtwork) //删除寄画信息
v1.POST("mailArtwork/mailArtwork/update", mailArtwork.Handler.UpdateMailArtwork) //更新寄画信息
v1.POST("mailArtwork/mailArtwork/shortUrlTest", mailArtwork.Handler.ShortUrlTest)
}
}

136
pkg/router/artwork.go Normal file
View File

@ -0,0 +1,136 @@
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
service_artwork "github.com/fonchain_enterprise/fonchain-main/pkg/service/artwork"
"github.com/gin-gonic/gin"
)
func ArtworkRoute(r *gin.RouterGroup) {
noAuth := r.Group("")
auth := r.Group("")
auth.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
artwork := auth.Group("artwork")
{
artwork.POST("add", service.CreateAwProfile)
artwork.PUT("edit", service.UpdateAwProfile)
artwork.DELETE("del", service.DelAwProfile)
artwork.PUT("market-edit", service.UpdateMarketInfo)
artwork.PUT("ext-data", service.UpdateExtInfo)
artwork.PUT("digi-info", service.DigiInfo)
artwork.PUT("tags", service.AwTags)
artwork.PUT("auth-data", service.AuthData)
artwork.POST("verify-data", service.VerifyData)
artwork.PUT("auth-img", service.AuthImg)
artwork.PUT("storage", service.Storage) // 更新仓储数据
artwork.POST("detail", service.AwDetail)
artwork.POST("storage-info", service.StorageInfo)
artwork.POST("market-info", service.MarketInfo)
artwork.POST("list", service.AwList)
artwork.GET("tag-list", service.AwTagList)
artwork.DELETE("auth-del", service.DelAuthData)
artwork.DELETE("market-del", service.DelMarketData)
artwork.DELETE("storage-del", service.DelStorageData)
artwork.GET("random-hash", service.RandomHash)
artwork.POST("cat-list", service.CatList)
artwork.POST("get-chunk-list", service.GetFileChunkInfo)
artwork.POST("upload-chunk", service.UploadChunk)
artwork.PUT("third-party-edit", service.UpdateThirdParty)
artwork.DELETE("third-party-del", service.DelThirdParty)
artwork.POST("third-party-list", service.ThirdPartyList)
artwork.POST("my-aw-list", service.MyAwList)
artwork.PUT("edit-aw-status", service.EditAwStatus)
artwork.POST("allot-artwork", service.AllotArtwork)
artwork.POST("shelf-no-list", service.ShelfNoList)
artwork.POST("update-copyright", service.UpdateCopyright)
artwork.POST("export-artwork", service.ExportArtwork)
artwork.POST("export-field-list", service.ExportArtworkField)
artwork.POST("update-copyright-info", service.UpdateCopyrightInfo)
artwork.POST("update-transfer-info", service.UpdateTransferInfo)
artwork.POST("transfer-info-list", service.TransferInfoList)
artwork.POST("update-price-run", service.UpdateAwPriceRun)
artwork.POST("download", service.DownloadArtwork)
artwork.POST("download-hash", service.DownloadHash)
artwork.POST("sync-aw-signdate", service.SyncAwSignDate)
artwork.POST("sync-aw-storage", service.SyncAwStorage)
artwork.POST("auth-img-batch", service.AuthImgBatch)
artwork.POST("update-info-with-kv", service.UpdateAwInfoWithKey)
artwork.POST("add-brand", service.AddBrand)
artwork.POST("update-aw-batch", service.UpdateAwBatch)
artwork.POST("verify-list", service.VerifyList)
artwork.POST("sync-artwork-data", service.SyncArtworkData)
artwork.POST("update-aw-comment", service.UpdateAwComment)
artwork.POST("download-tf-image", service.DownloadTfImage)
artwork.POST("count-verify-similar", service.CountVerifySimilar)
artwork.POST("one-query-list", service.OneQueryList)
artwork.POST("one-query-export", service.OneQueryExport)
artwork.POST("one-query-audit", service.ArtworkOneQueryAudit)
artwork.POST("one-query-audit-syncTest", service.SyncArtworkTest)
artwork.POST("filter-list", service.ArtworkFilterList)
artwork.POST("edit-filter", service.ArtworkEditFilter)
artwork.POST("batch-dci-list", service.BatchDciList)
artwork.POST("second-list", service_artwork.SecondArtworkList)
artwork.POST("traditional-to-simplified", service_artwork.TraditionalToSimplified)
artwork.POST("generate-supplement", service_artwork.GenerateSupplement)
}
// 画作服不需要登录的接口
artworkNoLogin := noAuth.Group("artwork")
{
//artworkNoLogin.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
artworkNoLogin.GET("export-artwork", service.ExportArtwork)
artworkNoLogin.POST("nfc-list", service.NfcList)
artworkNoLogin.Any("load-data", service.LoadData)
artworkNoLogin.POST("add-collector", service.AddCollector)
}
{
artwork.POST("rate-list", service_artwork.RateList)
artwork.POST("update-rate-status", service_artwork.UpdateRateStatus)
artwork.POST("scale-info", service_artwork.ScaleInfo)
}
// 比率
{
artwork.POST("repair-list", service_artwork.RepairList)
artwork.POST("repair-update", service_artwork.RepairUpdate)
artwork.POST("repair-del", service_artwork.RepairDel)
artwork.POST("repair-detail", service_artwork.RepairDetail)
artwork.POST("repair-export", service_artwork.RepairExport)
}
//工作台
workbench := auth.Group("workbench")
{
workbench.POST("index-count", service.IndexCount)
workbench.POST("add-shelf", service.AddShelf)
workbench.POST("del-shelf", service.DelShelf)
workbench.POST("shelf-list", service.ShelfList)
workbench.POST("shelf-detail", service.ShelfDetail)
workbench.POST("shelf-add-artwork", service.ShelfAddArtwork)
workbench.POST("artwork-list", service.SimpleArtworkList)
workbench.POST("shelf-drag-artwork", service.ShelfDragArtwork)
workbench.POST("update-aw-shelf", service.UpdateAwShelf)
workbench.POST("exportby-showid", service.ExportByShowId)
workbench.POST("artshow-done", service.ArtShowDone)
workbench.POST("list-show", service.ListShow)
workbench.PUT("aws-storage", service.AwsStorage) //批量更新画作仓储
workbench.POST("schedule-add", service.ScheduleAdd)
workbench.POST("schedule-info", service.ScheduleInfo)
workbench.POST("schedule-list", service.ScheduleList)
workbench.POST("schedule-read", service.ScheduleRead)
workbench.POST("common-seal-list", service.CommonSealList)
workbench.POST("post-batch-art", service.PostBatchArt)
workbench.POST("recheck-artist-list", service.RecheckArtistList)
workbench.POST("recheck-artwork-list", service.RecheckArtworkList)
workbench.POST("recheck-edit", service.RecheckEdit)
workbench.POST("recheck-submit", service.RecheckSubmit)
workbench.POST("submit-info", service.SubmitInfo)
}
artworkShop := auth.Group("artwork-shop")
{
artworkShop.POST("artwork-list", service.AwShopList)
artworkShop.POST("sync-order", service.SyncOrder)
}
}

95
pkg/router/auth.go Normal file
View File

@ -0,0 +1,95 @@
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/account"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/auth/department"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/auth/position"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/auth/rule"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/deliver"
"github.com/gin-gonic/gin"
"net/http"
)
func AuthRoute(router *gin.RouterGroup) {
r := router.Group("")
r.StaticFS("/pdfst/print_model", http.Dir("./data/print_model"))
positionV2Route := r.Group("/position/v2")
positionV2Route.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider))
{
positionV2Route.Use(middleware.WarnLog(service.AccountProvider, service.GrpcLogImpl))
positionV2Route.POST("create", position.CreateV2)
positionV2Route.POST("update", position.UpdateV2)
positionV2Route.POST("detail", position.DetailV2)
positionV2Route.POST("list", position.ListV2)
positionV2Route.POST("batch/remove", position.BatchRemove)
positionV2Route.POST("batch/bind/auth", position.BatchBindAuth)
positionV2Route.POST("model/create", position.CreateModel) //创建模版
positionV2Route.POST("model/remove", position.DeleteModel) //删除模版
positionV2Route.POST("model/list", position.ListModel) //模版列表
positionV2Route.POST("model/detail", position.DetailModel) //模版详情
positionV2Route.POST("log/list", position.LogList) //日志列表
}
deliverV2Route := r.Group("/api/deliver")
deliverV2Route.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider))
{
deliverV2Route.POST("create", deliver.Create)
deliverV2Route.POST("update", deliver.Update)
deliverV2Route.POST("detail", deliver.Detail)
deliverV2Route.POST("list", deliver.List)
deliverV2Route.POST("remove", deliver.Remove)
}
departmentRoute := r.Group("/department/v2")
departmentRoute.Use(middleware.CheckLogin(service.AccountProvider))
departmentRoute.POST("tree/filter", department.FilterTree)
departmentRoute.Use(middleware.CheckAuth(service.AccountProvider, service.RuleProvider))
{
departmentRoute.Use(middleware.WarnLog(service.AccountProvider, service.GrpcLogImpl))
departmentRoute.POST("boss/level", department.LevelBoss) //绑定部门
departmentRoute.POST("boss/direct", department.DirectBoss) //绑定部门
departmentRoute.POST("create", department.CreateV2)
departmentRoute.POST("update", department.UpdateV2)
departmentRoute.POST("detail", department.DetailV2)
departmentRoute.POST("tree/my", department.MyTree)
departmentRoute.POST("tree/all", department.AllTree)
departmentRoute.POST("tree/all/position", department.AllTreeWithPosition)
departmentRoute.POST("remove", department.Remove) //删除部门
departmentRoute.POST("bind", department.Bind) //绑定部门
departmentRoute.POST("unbind", department.UnBind) //绑定部门
departmentRoute.POST("list/key", department.ListByAuth) //绑定部门
departmentRoute.POST("position", department.DetailsV2) //绑定部门
departmentRoute.POST("base/all/list", department.BaseListV2) //绑定部门
}
ruleV2Route := r.Group("/rule/v2")
ruleV2Route.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider))
{
ruleV2Route.Use(middleware.WarnLog(service.AccountProvider, service.GrpcLogImpl))
ruleV2Route.POST("update", rule.UpdateV2)
ruleV2Route.POST("detail", rule.DetailV2)
ruleV2Route.POST("menu/list", rule.ListV2)
}
userV2Route := r.Group("/user/v2")
userV2Route.POST("sample/account", account.SampleAccount) //登陆-校验这是否有其他人有登陆信息
userV2Route.POST("login", account.UserLoginSqueezeOther) //新登陆,挤掉其他人
userV2Route.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider))
{
userV2Route.Use(middleware.WarnLog(service.AccountProvider, service.GrpcLogImpl))
userV2Route.POST("create", account.UserRegisterV2) //注册
userV2Route.POST("update", account.UpdateV2) //更新
userV2Route.POST("reset/pwd", account.ResetPwd) //更新
userV2Route.POST("detail", account.DetailV2) //获取详情
userV2Route.POST("boss/staff/detail", account.DetailNowDepartmentV2) // 部门领导获取该员工信息 (部门岗位仅仅限制领导可见的岗位)
userV2Route.POST("boss/staff/update", account.BossDetailUpdate) // 部门领导获取该员工信息 (部门岗位仅仅限制领导可见的岗位)
userV2Route.POST("my/info", account.MyInfo) //获取详情
userV2Route.POST("list", account.ListV2) //获取详情
userV2Route.POST("batch/remove", account.BatchRemoveV2) //删除
userV2Route.POST("remove", account.RemoveV2) //删除
userV2Route.POST("check/register", account.CheckBeforeRegister) //删除
userV2Route.POST("/face", account.Face)
}
}

View File

@ -0,0 +1,92 @@
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/blockchain"
service_chainbrowser "github.com/fonchain_enterprise/fonchain-main/pkg/service/chainbrowser"
service_invoice "github.com/fonchain_enterprise/fonchain-main/pkg/service/invoice"
"github.com/gin-gonic/gin"
)
func ChainBrowserRoute(r *gin.RouterGroup) {
//noAuth := r.Group("")
auth := r.Group("")
eCardErpAuth := r.Group("eCard")
eCardAuth := r.Group("e_card")
auth.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
browser := auth.Group("browser")
{
browser.POST("home-data", service_chainbrowser.HomeData)
browser.POST("block-list", service_chainbrowser.BlockList)
browser.POST("tx-list", service_chainbrowser.TxList)
browser.POST("blockhash-detail", service_chainbrowser.BlockHashDetail)
browser.POST("txhash-detail", service_chainbrowser.TxHashDetail)
browser.POST("filehash-list", service_chainbrowser.FileHashList)
browser.POST("file-add-chain", service_chainbrowser.FileAddChain)
browser.POST("filehash-detail", service_chainbrowser.FileHashDetail)
browser.POST("refresh-file-chain", service_chainbrowser.RefreshFileChain)
browser.POST("hash-detail", service_chainbrowser.HashDetail)
}
equity := auth.Group("equity")
{
equity.POST("update/free/resources", service_chainbrowser.UpdateFreeResources) // 修改系统赠送权益值
equity.POST("get/all/free/resources", service_chainbrowser.GetAllFreeResources) // 获取所有的系统赠送权益值
equity.POST("update/consume/resources", service_chainbrowser.UpdateConsumeResources) // 修改消费权益值的存证消费值
equity.POST("get/all/consume/resources", service_chainbrowser.GetAllConsumeResources) // 获取消费权益值的存证的消费值
equity.POST("update/conversion/ratio", service_chainbrowser.UpdateConversionRatio) // 更新权益兑换比例表
equity.POST("get/all/refill/card/status", service_chainbrowser.GetAllRefillCardStatus) // 获取未删除的充值卡金额的状态
equity.POST("create/refill/card/amount/info", service_chainbrowser.CreateRefillCardAmountInfo) // 新增充值金额信息
equity.POST("get/refill/card/amount/info", service_chainbrowser.GetRefillCardAmountInfo) // 获取所有的充值卡金额信息
equity.POST("stop/refill/card/amount/info", service_chainbrowser.StopRefillCardAmountInfo) // 停用充值金额
equity.POST("open/refill/card/amount/info", service_chainbrowser.OpenRefillCardAmountInfo) // 启用充值金额信息
equity.POST("delete/refill/card/amount/info", service_chainbrowser.DeleteRefillCardAmountInfo) // 删除充值金额信息
equity.POST("get/all/pay/status", service_chainbrowser.GetAllPayStatus) // 获取所有的支付状态
equity.POST("recharge/record/manage", service_chainbrowser.RechargeRecordManage) // 充值卡订单管理
equity.POST("recharge/record/manage/export/form", service_chainbrowser.RechargeRecordManageExportForm) // 充值卡订单管理表导出
equity.POST("get/all/refund/status", service_chainbrowser.GetAllRefundStatus) // 获取所有的退款状态
equity.POST("refund/apply/manage", service_chainbrowser.RefundApplyManage) // 充值卡退款申请管理
equity.POST("refund/apply/manage/export/form", service_chainbrowser.RefundApplyManageExportForm) // 充值卡退款申请管理表导出
equity.POST("wx/refund", service_chainbrowser.WxRefund) // 退款允许
equity.POST("ali/refund", service_chainbrowser.AliRefund) // 退款允许
equity.POST("refund/refuse", service_chainbrowser.RefundRefuse) // 退款驳回
equity.POST("get/all/add/type", service_chainbrowser.GetAllAddType) // 获取所有的增加权益值的类型
equity.POST("resource/usage/detail/add/manage", service_chainbrowser.ResourceUsageDetailAddManage) // 资源权益使用(充值)
equity.POST("resource/usage/detail/add/manage/export/form", service_chainbrowser.ResourceUsageDetailAddManageExportForm) // 资源权益使用表(充值)导出
equity.POST("get/all/reduce/type", service_chainbrowser.GetAllReduceType) // 获取所有的消费权益值的类型
equity.POST("resource/usage/detail/reduce/manage", service_chainbrowser.ResourceUsageDetailReduceManage) // 资源权益使用(消费)
equity.POST("resource/usage/detail/reduce/manage/export/form", service_chainbrowser.ResourceUsageDetailReduceManageExportForm) // 资源权益使用(消费)导出
equity.POST("get/resources/by/user/ids", service_chainbrowser.GetResourcesByUserIds) // 根据用户id列表查询资源
equity.Use(middleware.CheckLogin(service.AccountProvider))
equity.POST("refund/allow", service_chainbrowser.RefundAllow) // 退款允许
equity.POST("admin/top/up/resource", service_chainbrowser.AdminTopUpResource) // 管理员赠送丰值
invoice := auth.Group("invoice")
invoice.Use(middleware.CheckLogin(service.AccountProvider))
{
invoice.POST("list", service_invoice.FindInvoice) //发票列表
invoice.POST("handle", service_invoice.HandelInvoice) //发票处理
}
BlockUser := auth.Group("block-user")
BlockUser.Use(middleware.CheckLogin(service.AccountProvider))
{
BlockUser.POST("list", blockchain.BlockUserList)
BlockUser.POST("setting", blockchain.BlockUserSetting)
}
{
eCardErpAuth.POST("eCard-user-manage", blockchain.ECardUserManage)
eCardErpAuth.POST("chain-record", blockchain.ChainRecord)
eCardAuth.POST("save-info", blockchain.SaveInfo)
eCardAuth.POST("exist", blockchain.UserExist)
eCardAuth.POST("send", blockchain.Send)
eCardAuth.POST("login", blockchain.Login)
eCardAuth.POST("check", blockchain.Check)
}
}
}

28
pkg/router/chat.go Normal file
View File

@ -0,0 +1,28 @@
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/gin-gonic/gin"
)
func ChatRoute(r *gin.RouterGroup) {
auth := r.Group("")
noAuth := r.Group("")
auth.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
chat := auth.Group("chat")
{
chat.POST("completion", service.Completion)
chat.POST("list", service.ChatList)
chat.POST("create", service.ChatCreate)
chat.POST("del", service.ChatDel)
chat.POST("detail", service.ChatDetail)
chat.POST("completion-text", service.CompletionText)
}
noAuthChat := noAuth.Group("chat")
{
noAuthChat.POST("app-completion", service.AppCompletion)
noAuthChat.POST("audio-to-text", service.AudioToText)
noAuthChat.POST("get-file-text", service.GetFileText)
}
}

68
pkg/router/copyright.go Normal file
View File

@ -0,0 +1,68 @@
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
service_copyright "github.com/fonchain_enterprise/fonchain-main/pkg/service/copyright"
"github.com/gin-gonic/gin"
)
func CopyrightRoute(r *gin.RouterGroup) {
noAuth := r.Group("")
auth := r.Group("")
auth.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
copyrightAuth := auth.Group("copyright")
{
copyrightAuth.POST("create-aw-dci", service_copyright.CreateArtworkDci)
copyrightAuth.POST("aw-additional-info", service_copyright.AwAdditionalInfo)
copyrightAuth.POST("list", service_copyright.CopyrightList)
copyrightAuth.POST("detail", service_copyright.CopyrightDetail)
copyrightAuth.POST("del", service_copyright.DeleteCopyright)
copyrightAuth.POST("schedule", service_copyright.CopyrightSchedule)
copyrightAuth.POST("status-info", service_copyright.CopyrightStatusInfo)
copyrightAuth.POST("dci-retry", service_copyright.RetryDigitalRegister) //补正申请
copyrightAuth.POST("dci-content-info", service_copyright.DciContentInfo) //查询申领信息
copyrightAuth.POST("dci-registration", service_copyright.DciRegistration) //数登申请
copyrightAuth.POST("dci-query-registration", service_copyright.DciQueryRegistration) //查询数登申请
copyrightAuth.POST("dci-pay-url", service_copyright.DciGetPayUrl) //获取支付链接
copyrightAuth.POST("dci-pay-query", service_copyright.DciGetPayQuery) // 查询支付结果
copyrightAuth.POST("dci-cert", service_copyright.DciGetRegistrationCert) // 获取数登证书
copyrightAuth.POST("dci-close", service_copyright.CloseDigitalRegister)
copyrightAuth.POST("dci-update-user", service_copyright.UpdateUser) //
copyrightAuth.POST("dci-user-info", service_copyright.DciUserInfo) //
copyrightAuth.POST("data-summary", service_copyright.DataSummary) //
copyrightAuth.POST("category-data-summary", service_copyright.CategoryDataSummary) //
copyrightAuth.POST("category-day-summary", service_copyright.CategoryDaySummary) //
copyrightAuth.POST("all-status-info", service_copyright.AllStatusInfo) //
copyrightAuth.POST("batch-dci", service_copyright.BatchDci) //批量申请
copyrightAuth.POST("update-supplement", service_copyright.UpdateSupplement) // 版权补充
copyrightAuth.POST("copyright-info", service_copyright.CopyrightInfo) // 版权详情
copyrightAuth.POST("supplement-detail", service_copyright.SupplementDetail) // 版权详情
copyrightAuth.POST("supplement-list", service_copyright.SupplementList)
copyrightAuth.POST("refresh-copyright", service_copyright.RefreshCopyright)
copyrightAuth.POST("update-payinfo-result", service_copyright.UpdatePayInfoResult)
}
copyrightNoAuth := noAuth.Group("copyright")
{
copyrightNoAuth.POST("no-auth-dci-content-info", service_copyright.DciContentInfo)
copyrightNoAuth.POST("no-auth-dci-query-registration", service_copyright.DciQueryRegistration) //查询数登申请
copyrightNoAuth.POST("unpack-callback", service_copyright.UnpackCallback) //查询数登申请
copyrightNoAuth.POST("test", service_copyright.Test) //查询数登申请
}
//软件版权登记
softwareAuth := auth.Group("software")
{
softwareAuth.POST("save-copyright", service_copyright.SaveSoftwareCopyright)
softwareAuth.POST("list", service_copyright.SoftwareCopyrightList)
softwareAuth.POST("delete", service_copyright.DelSoftwareCopyright)
}
//商标管理
trademarkAuth := auth.Group("trademark")
{
trademarkAuth.POST("save-trademark", service_copyright.SaveTrademark)
trademarkAuth.POST("list", service_copyright.TrademarkList)
trademarkAuth.POST("delete", service_copyright.DelTrademark)
}
}

48
pkg/router/dci.go Normal file
View File

@ -0,0 +1,48 @@
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/dci"
"github.com/gin-gonic/gin"
)
func DciRoute(r *gin.RouterGroup) {
basic := r.Group("dci")
noAuth := r.Group("dci")
basic.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
file := basic.Group("file")
{
file.POST("upload", dci.GetUploadFile)
}
{
noAuth.GET("area", dci.GetAreaCode)
noAuth.POST("callback", dci.Callback)
}
user := basic.Group("user")
{
user.POST("add", dci.AddDciUser)
user.POST("update", dci.UpdateDciUser)
user.POST("info", dci.QueryDciUser)
}
work := basic.Group("work")
{
work.POST("create", dci.CreateDciRegistration)
work.POST("info", dci.QueryDciRegistration)
work.POST("pay-url", dci.GetDciPayUrl)
work.POST("pay-info", dci.QueryDciPay)
work.POST("cert-info", dci.GetDciRegistrationcert)
work.POST("retry", dci.RetryDciRegistration)
work.POST("close", dci.CloseDciRegistration)
}
reg := basic.Group("reg")
{
reg.POST("create", dci.CreateDciPreregistration)
reg.POST("info", dci.QueryDciPreregistration)
}
}

22
pkg/router/domain_name.go Normal file
View File

@ -0,0 +1,22 @@
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/domain_name"
"github.com/gin-gonic/gin"
)
// DomainNameRoute 域名管理
func DomainNameRoute(r *gin.RouterGroup) {
domainNameRoute := r.Group("/domain_name")
domainNameRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
{
domainNameRoute.POST("create", domain_name.Create)
domainNameRoute.PUT("update", domain_name.Update)
domainNameRoute.POST("list", domain_name.List)
domainNameRoute.DELETE("deleted", domain_name.Deleted)
domainNameRoute.POST("download", domain_name.Download)
}
}

View File

@ -0,0 +1,62 @@
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/employee"
"github.com/gin-gonic/gin"
)
func EmployeeFileRoute(r *gin.RouterGroup) {
employeeFileRoute := r.Group("/employee-file")
employeeFileRoute.Use(middleware.CheckLogin(service.AccountProvider))
{
//查询字典表
employeeFileRoute.POST("dictionary/search", employee.SearchDictionaryList)
//员工档案curd
employeeFileRoute.POST("create", employee.CreateEmployeeFile)
employeeFileRoute.POST("update", employee.UpdateEmployeeFile)
employeeFileRoute.POST("new/changes", employee.MoreNewChanges)
employeeFileRoute.POST("set/attendance/group", employee.TheAttendanceGroupIsSet)
employeeFileRoute.POST("list", employee.FindEmployeeFileList)
//展示列
employeeFileRoute.POST("create/display", employee.CreateDisplayColumns)
employeeFileRoute.POST("details/display", employee.DetailsDisplayColumns)
employeeFileRoute.POST("all/display", employee.DisplayColumnAll)
//导出
employeeFileRoute.POST("download/excel", employee.DownloadExcel)
employeeFileRoute.POST("download/docx", employee.DownloadDocx)
employeeFileRoute.POST("create/excel", employee.CreateExcel)
employeeFileRoute.POST("find/total", employee.QueryStatistics)
//奖惩记录
employeeFileRoute.POST("create/rewards/punishments", employee.CreateRewardsAndPunishments)
employeeFileRoute.POST("find/rewards/punishments", employee.FindRewardsAndPunishments)
employeeFileRoute.POST("download/rewards/punishments", employee.DownloadRewardsAndPunishments)
employeeFileRoute.POST("create/rewards/punishments/excel", employee.CreateRewardsAndPunishmentsExcel)
//离职记录
employeeFileRoute.POST("create/turnover/record", employee.CreateTurnoverRecord)
employeeFileRoute.POST("find/turnover/record", employee.FindTurnoverRecord)
employeeFileRoute.POST("download/turnover/record", employee.DownloadTurnoverRecord)
//薪资记录
employeeFileRoute.POST("find/payroll/record", employee.FindPayrollRecordList)
employeeFileRoute.POST("download/payroll/record", employee.DownloadPayrollRecordList)
//合同记录
employeeFileRoute.POST("create/contract/record", employee.CreateContractRecord)
employeeFileRoute.POST("find/contract/record", employee.FindContractRecord)
employeeFileRoute.POST("create/contract/excel", employee.CreateContractExcel)
employeeFileRoute.POST("download/contract/record", employee.DownloadContractRecord)
employeeFileRoute.POST("update/contract/attachment", employee.UpdateContractAttachment)
//异动记录
employeeFileRoute.POST("find/changes/record", employee.FindChangesRecord)
employeeFileRoute.POST("download/changes/record", employee.DownloadChangesRecord)
employeeFileRoute.POST("create/changes/excel", employee.CreateChangesExcel)
employeeFileRoute.POST("update/changes/attachment", employee.UpdateChangesAttachment)
//提醒记录
employeeFileRoute.POST("find/reminder/record", employee.FindReminderList)
employeeFileRoute.POST("processing/reminder", employee.ProcessingReminder)
employeeFileRoute.POST("find/out/standing", employee.QueryOutstanding)
//redis初始化
employeeFileRoute.POST("init/redis/attendance-section", employee.InitRedisAttendance)
employeeFileRoute.POST("init/redis/recent-img", employee.InitRedisRecentImg)
}
}

85
pkg/router/exam.go Normal file
View File

@ -0,0 +1,85 @@
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/exam"
"github.com/gin-gonic/gin"
)
func ExamRoute(r *gin.RouterGroup) {
noAuth := r.Group("")
auth := r.Group("")
//auth := r.Group("")
auth.Use(middleware.CheckLogin(service.AccountProvider))
examNoAuth := noAuth.Group("exam")
{
examNoAuth.POST("user/send", exam.SendExamMsg)
examNoAuth.POST("user/reg", exam.UserExamRegister)
examNoAuth.POST("user/login", exam.UserExamLogin)
}
examAuth := auth.Group("exam")
{
examAuth.POST("user/all", exam.GetAllUserInfo)
examAuth.POST("user/save-answer", exam.SaveUserAnswerHis)
examAuth.POST("user/save-train", exam.SaveUserTrainHis)
examAuth.POST("user/save-exam", exam.SaveUserHis)
examAuth.POST("user/answer-his", exam.UserHisInfo)
examAuth.POST("save-exam", exam.SaveExam)
examAuth.POST("exam-info", exam.GetExamInfo)
examAuth.POST("exam-infos", exam.GetExamInfos)
examAuth.POST("save-train", exam.SaveTrain)
examAuth.POST("train-info", exam.GetTrainInfo)
examAuth.POST("train-infos", exam.GetTrainInfos)
examAuth.POST("update-train", exam.UpdateTrain)
examAuth.POST("delete-train", exam.DeleteTrain)
examAuth.POST("save-gift", exam.SaveGift)
examAuth.POST("gift-info", exam.GetGiftInfo)
examAuth.POST("save-question", exam.SaveQuestion)
examAuth.POST("question-info", exam.GetQuestionInfo)
examAuth.POST("check-question", exam.CheckQuestion)
examAuth.POST("update-question", exam.UpdateQuestion)
examAuth.POST("delete-question", exam.DeleteQuestion)
examAuth.POST("detail-question", exam.DetailQuestion)
examAuth.POST("import-questions", exam.ImportQuestions)
examAuth.POST("exam-user", exam.GetExamUserInfo)
examAuth.POST("fuzzy-query-user", exam.FuzzyQueryUser)
examAuth.POST("export-excel", exam.ExportExcel)
examAuth.POST("question-classify-info", exam.GetQuestionClassifies)
examAuth.POST("save-exam-paper", exam.SaveExamPaper)
examAuth.POST("update-exam-paper", exam.UpdateExamPaper)
examAuth.POST("delete-exam-paper", exam.DeleteExamPaper)
examAuth.POST("get-exam-papers", exam.GetExamPapers)
examAuth.POST("detail-exam-paper", exam.DetailExamPaper)
examAuth.POST("save-exam-task", exam.SaveExamTask)
examAuth.POST("update-exam-task", exam.UpdateExamTask)
examAuth.POST("delete-exam-task", exam.DeleteExamTask)
examAuth.POST("get-exam-tasks", exam.GetExamTasks)
examAuth.POST("detail-exam-task", exam.DetailExamTask)
examAuth.POST("check-exam-task", exam.CheckExamTask)
examAuth.POST("publish-exam-task", exam.PublishExamTask)
examAuth.POST("update-exam-task-range", exam.UpdateExamTaskRange)
examAuth.POST("save-user-exam-task", exam.SaveUserExam)
examAuth.POST("get-person-exam-tasks", exam.GetPersonUserExamTaskRecords)
examAuth.POST("get-person-exam—sub-tasks", exam.GetPersonUserExamSubTaskRecords)
examAuth.POST("get-person-score", exam.GetPersonScore)
examAuth.POST("grading-paper", exam.GradingPaper)
examAuth.POST("data-user-task-details", exam.DataUserTaskDetails)
examAuth.POST("data-person-monitor", exam.DataPersonMonitor)
examAuth.POST("data-header-monitor", exam.DataHearMonitor)
examAuth.POST("export-excel-data-person-monitor", exam.ExportExcelDataPersonMonitor)
}
}

31
pkg/router/examV2.go Normal file
View File

@ -0,0 +1,31 @@
// Package router -----------------------------
// @file : examV2.go
// @author : JJXu
// @contact : wavingbear@163.com
// @time : 2024/5/13 上午11:12
// -------------------------------------------
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/exam"
"github.com/gin-gonic/gin"
)
func ExamV2Route(r *gin.RouterGroup) {
auth := r.Group("")
auth.Use(middleware.CheckLogin(service.AccountProvider))
examAuth := auth.Group("examV2")
{
examAuth.POST("cert/create", exam.CertHandler.CreateCert)
examAuth.POST("cert/delete", exam.CertHandler.DeleteCert)
examAuth.POST("cert/update", exam.CertHandler.UpdateCert)
examAuth.POST("cert/detail", exam.CertHandler.GetCertDetail)
examAuth.POST("cert/query", exam.CertHandler.GetCertList)
examAuth.POST("cert/getMyCert", exam.CertHandler.GetMyCert)
examAuth.POST("cert/check", exam.CertHandler.CheckCert)
}
}

26
pkg/router/exhibitionF.go Normal file
View File

@ -0,0 +1,26 @@
package router
//
//import (
// "github.com/fonchain_enterprise/fonchain-main/pkg/service"
// "github.com/gin-gonic/gin"
//)
//
//func ExhibitionRoute(r *gin.RouterGroup) {
// noAuth := r.Group("")
// //auth := r.Group("")
// //auth.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
// //exhibitionAuth := auth.Group("meeting")
// //{+
// // exhibitionAuth.POST("auth-info", service.AuthInfo)
// //}
//
// exhibitionNoAuth := noAuth.Group("exhibition")
// {
// exhibitionNoAuth.POST("save", service.SaveExhibition)
// exhibitionNoAuth.POST("list", service.ExhibitionList)
// exhibitionNoAuth.POST("chose_compere", service.ChoseCompere)
// exhibitionNoAuth.POST("node-list", service.ExhibitionNodeList)
//
// }
//}

145
pkg/router/gitea.go Normal file
View File

@ -0,0 +1,145 @@
package router
import (
"fmt"
"github.com/dorlolo/simpleRequest"
"github.com/fonchain_enterprise/fonchain-main/pkg/config"
"github.com/fonchain_enterprise/fonchain-main/pkg/e"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/auth/sso"
"github.com/gin-gonic/gin"
"net/http"
"net/http/httputil"
"net/url"
"time"
)
func GiteaRoute(router *gin.RouterGroup) {
proxyDev(router)
r := router.Group("sso")
// OpenID发现文档端点
r.GET("/.well-known/openid-configuration", sso.Configuration)
r.GET("/login", sso.LoginHtml)
r.POST("/login", sso.Login)
// 授权端点
r.GET("/auth", sso.Auth)
r.GET("/auth/pass", sso.AuthSuccess)
// 令牌端点
r.POST("/token", sso.Token)
// 用户信息端点
r.GET("/userinfo", sso.SsoUserInfo)
//通过微信绑定手机号
r.GET("/wechat/bind", sso.WechatLoginHtml)
r.POST("/wechat/bind", sso.WechatBind)
r.POST("/wechat/phone/now", sso.WechatNowPhone)
}
func proxyDev(r *gin.RouterGroup) {
fmt.Println("1------", config.AppMode)
if config.AppMode == "debug" {
target := "http://172.16.100.93:8046"
targetUrl, err := url.Parse(target)
if err != nil {
return
}
proxy := httputil.NewSingleHostReverseProxy(targetUrl)
tempTarget := "http://172.16.100.93:9100"
tempTargetUrl, err := url.Parse(tempTarget)
if err != nil {
return
}
proxy1 := httputil.NewSingleHostReverseProxy(tempTargetUrl)
// 使用Gin的Any方法来匹配所有请求方法
r.Any("/apiv2/*action", func(c *gin.Context) {
// 修改请求的主机为目标主机这是因为在反向代理中请求的Host头信息不会自动更新
c.Request.Host = targetUrl.Host
c.Request.URL.Host = targetUrl.Host
c.Request.URL.Scheme = targetUrl.Scheme
// 反向代理转发请求
proxy.ServeHTTP(c.Writer, c.Request)
})
r.Any("/containeradm/*action", func(c *gin.Context) {
// 修改请求的主机为目标主机这是因为在反向代理中请求的Host头信息不会自动更新
c.Request.Host = tempTargetUrl.Host
c.Request.URL.Host = tempTargetUrl.Host
c.Request.URL.Scheme = tempTargetUrl.Scheme
// 反向代理转发请求
proxy1.ServeHTTP(c.Writer, c.Request)
})
}
ArtistInfoProxy(r)
}
// 使用simpleRequest实现的画家宝聊天模块简单代理
func ArtistInfoProxy(r *gin.RouterGroup) {
var artistinfoTarget string
if config.Env == "dev" {
artistinfoTarget = "http://127.0.0.1:8084"
} else if config.Env == "test" {
artistinfoTarget = "http://114.218.158.24:9048"
} else {
artistinfoTarget = "https://artist.fontree.cn"
}
artistinfotargetUrl, err := url.Parse(artistinfoTarget)
if err != nil {
return
}
fmt.Println("artistinfotargetUrl:", artistinfotargetUrl)
//画家宝客服聊天代理转发
r.Any("/api/aschat/*action", func(c *gin.Context) {
c.Request.Host = artistinfotargetUrl.Host
c.Request.URL.Host = artistinfotargetUrl.Host
c.Request.URL.Scheme = artistinfotargetUrl.Scheme
authorization := c.GetHeader(e.Authorization)
if authorization == "" {
service.NotLoginRes(c, e.ErrNotLogin)
return
}
fmt.Println("c.Request.URL.String()", c.Request.URL.String())
req := simpleRequest.NewRequest()
req.TimeOut(15 * time.Second)
req.Headers().Set(e.Authorization, authorization).Set("domain", "fontree")
params := c.Params
action := params[0].Value
fmt.Println("action:", action)
if file, errs := c.FormFile("file"); file != nil && errs == nil {
fmt.Println("上传文件")
req.Headers()
req.Body().
SetFromDataMultipartFile("file", file)
formData, _ := c.MultipartForm()
for key, value := range formData.Value {
req.Body().Set(key, value[0])
}
} else {
fmt.Println("普通请求")
bodybuf, _ := c.GetRawData()
req.Body().SetBytes(bodybuf)
req.Headers().ConentType_json()
fmt.Printf("请求参数:%+v\n", string(bodybuf))
}
resp, requestError := req.LaunchTo(c.Request.URL.String(), c.Request.Method)
if requestError != nil {
fmt.Println("req.POST Err", requestError.Error())
service.Error(c, e.Failed, requestError, "请求失败")
return
}
c.String(http.StatusOK, string(resp))
})
}

45
pkg/router/inventory.go Normal file
View File

@ -0,0 +1,45 @@
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/inventory"
"github.com/gin-gonic/gin"
)
// InventoryRoute 库管接口
func InventoryRoute(Router *gin.RouterGroup) {
inventoryRoute := Router.Group("api/inventory")
inventoryRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider))
{
inventoryRoute.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
inventoryRoute.POST("remove", inventory.Remove)
inventoryRoute.POST("list", inventory.List)
inventoryRoute.POST("detail", inventory.Detail)
inventoryRoute.POST("detail/barcode", inventory.DetailBarCode)
inventoryRoute.POST("create", inventory.Create)
inventoryRoute.POST("update", inventory.Update)
inventoryRoute.POST("log/detail", inventory.DetailProductLog)
inventoryRoute.POST("log/list", inventory.ListProductLog)
inventoryRoute.POST("stock/update", inventory.ChangeStock)
}
wareHouseRoute := Router.Group("api/warehouse")
wareHouseRoute.GET("down", inventory.DownWareHouse)
wareHouseRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider))
{
//wareHouseRoute.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
wareHouseRoute.POST("remove", inventory.RemoveWareHouse)
wareHouseRoute.POST("list", inventory.ListWareHouse)
wareHouseRoute.POST("pick/count", inventory.CountPickUpWareHouse)
wareHouseRoute.POST("export", inventory.ExportWareHouse)
wareHouseRoute.POST("pay/list", inventory.WareHousePayBill) //付款单列表
wareHouseRoute.POST("detail", inventory.DetailWareHouse)
wareHouseRoute.POST("preinfo", inventory.GetProductPreInfo)
wareHouseRoute.POST("pickup", inventory.PickUp)
wareHouseRoute.POST("edit", inventory.EditWareHouse)
wareHouseRoute.POST("end/at", inventory.GetEndAtYmd)
}
}

33
pkg/router/launch.go Normal file
View File

@ -0,0 +1,33 @@
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/launch"
"github.com/gin-gonic/gin"
)
// LaunchRoute 专利申请
func LaunchRoute(r *gin.RouterGroup) {
launchRoute := r.Group("/launch")
launchRoute.Use(middleware.CheckLogin(service.AccountProvider))
{
launchRoute.POST("conference/create", launch.CreateConference)
launchRoute.POST("conference/update", launch.UpdateConference)
launchRoute.POST("conference/deleted", launch.DeletedConference)
launchRoute.POST("conference/list", launch.FindConference)
}
{
launchRoute.POST("contract/create", launch.CreateContract)
launchRoute.POST("contract/update", launch.UpdateContract)
launchRoute.POST("contract/deleted", launch.DeletedContract)
launchRoute.POST("contract/list", launch.FindContract)
}
{
launchRoute.POST("sort/create", launch.CreateSort)
launchRoute.POST("sort/list", launch.FindSort)
}
{
launchRoute.POST("/download/packaged", launch.DownloadPackaged)
}
}

32
pkg/router/loanbill.go Normal file
View File

@ -0,0 +1,32 @@
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
service_loanbill "github.com/fonchain_enterprise/fonchain-main/pkg/service/loanbill"
"github.com/gin-gonic/gin"
)
func LoanBillRoute(r *gin.RouterGroup) {
//noAuth := r.Group("")
auth := r.Group("")
auth.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
//需要登陆保护
loanbill := auth.Group("loanbill")
{
loanbill.POST("project-list", service_loanbill.ProjectList)
loanbill.POST("update-bill", service_loanbill.UpdateBill)
loanbill.POST("bill-detail", service_loanbill.BillDetail)
loanbill.POST("bill-list", service_loanbill.BillList)
loanbill.POST("bill-list-export", service_loanbill.BillListExport)
loanbill.POST("billstatus-update", service_loanbill.BillStatusUpdate)
loanbill.POST("voucher-update", service_loanbill.VoucherUpdate)
loanbill.POST("copyright-artwork-list", service_loanbill.CopyrightArtworkList)
loanbill.POST("del-bill", service_loanbill.BillDel)
loanbill.POST("testll", service_loanbill.Test)
}
// 不需要登录的接口
//loanbillNoLogin := noAuth.Group("loanbill")
//{
//}
}

49
pkg/router/meal.go Normal file
View File

@ -0,0 +1,49 @@
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
service_meal "github.com/fonchain_enterprise/fonchain-main/pkg/service/meal"
"github.com/gin-gonic/gin"
)
func MealRoute(r *gin.RouterGroup) {
r = r.Group("meal")
noAuth := r.Group("")
auth := r.Group("")
auth.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
//需要登陆保护
userAuth := auth.Group("user")
{
userAuth.POST("list", service_meal.UserList)
}
userNoAuth := noAuth.Group("user")
{
userNoAuth.POST("info-phone", service_meal.InfoPhone)
}
goods := auth.Group("goods")
{
goods.POST("category-plate-list", service_meal.CategoryPlateList)
goods.POST("category-list", service_meal.CategoryGoodsList)
goods.POST("update-category-goods", service_meal.UpdateCategoryGoods)
goods.POST("update-feast", service_meal.UpdateFeast)
goods.POST("update-box-meal", service_meal.UpdateBoxMeal)
goods.POST("update-drink", service_meal.UpdateDrink)
}
// 不需要登录的接口
orderNoAuth := noAuth.Group("order")
{
orderNoAuth.POST("order-data-h5", service_meal.OrderDataH5)
}
//管理系统订单和用户列表
indent := noAuth.Group("/indent")
{
indent.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
indent.POST("/userlist", service_meal.UserListMtgt)
indent.POST("/goodlist", service_meal.IndentList)
indent.POST("pay/refunds", service_meal.Orderback) //退款
}
}

23
pkg/router/meeting.go Normal file
View File

@ -0,0 +1,23 @@
package router
import (
"fmt"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/gin-gonic/gin"
)
func MeetingRoute(r *gin.RouterGroup) {
noAuth := r.Group("")
auth := r.Group("")
//auth.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
MeetingAuth := auth.Group("meeting")
{
MeetingAuth.POST("auth-info", service.AuthInfo)
}
MeetingNoAuth := noAuth.Group("meeting")
{
MeetingNoAuth.Any("subscribe-callback", service.SubscribeCallback)
}
fmt.Println(noAuth)
}

193
pkg/router/oa.go Normal file
View File

@ -0,0 +1,193 @@
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/oa"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/oa_new"
"github.com/gin-gonic/gin"
)
func OaRoute(r *gin.RouterGroup) {
oaRoute := r.Group("oa")
oaRoute.POST("check-wifi", oa.CheckWifi)
{
oaRoute.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl), middleware.CheckLogin(service.AccountProvider))
{
oaRoute.Use(middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
oaRoute.POST("clock-in", oa.ClockIn)
oaRoute.GET("action-type", oa.ConfirmActionType)
oaRoute.POST("record", oa.OARecord)
oaRoute.POST("record/miss", oa.MissRecordForMakeUpV2)
oaRoute.POST("record/single", oa.OARecordSingle)
oaRoute.POST("staff/collection-all", oa.AttendanceCollectionV2)
oaRoute.POST("staff/collection-single", oa.StaffAttendanceCollectionV1)
oaRoute.POST("staff/collection-detail", oa.StaffAttendanceCollectionDetailV2)
oaRoute.POST("make-up/useful-num", oa.MakeUpNum) // 补卡 使用 以及 剩余 次数
oaRoute.POST("abnormal", oa.QueryAbnormal)
oaRoute.POST("record/other", oa.QueryOther)
// 员工管理
oaRoute.POST("users", oa.OaUserList)
// 外勤确认
oaRoute.POST("out-work-check", oa.OutWorkCheck)
oaRoute.POST("out-work-check/add", oa.CreateOutWorkCheck)
// 系统补卡
oaRoute.POST("system/make-up", oa_new.SystemMakeUp)
}
// 考勤设置
workingTimeRoute := oaRoute.Group("/working-time")
{
workingTimeRoute.Use(middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
workingTimeRoute.POST("options", oa.WorkingTimeList)
workingTimeRoute.POST("create", oa.CreateWorkingTime)
workingTimeRoute.POST("update", oa.SaveTimeOption)
workingTimeRoute.POST("duration", oa.TimeDuration)
//workingTimeRoute.POST("options", oa.WorkingTimeList)
workingTimeRoute.GET("num", oa.QueryNoSettingWorkingTimeNum)
workingTimeRoute.POST("best", oa.QueryWorkingTimeBest)
workingTimeRoute.POST("in-use", oa.TimeOptionInUse)
workingTimeRoute.POST("cancel", oa.CancelTimeOption)
workingTimeRoute.POST("positions", oa_new.WorkingTimeWithPositions)
}
applyRoute := oaRoute.Group("/apply")
{
applyRoute.Use(middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
applyRoute.POST("leave-apply/info", oa.QueryLeaveApplyInfo)
applyRoute.POST("list", oa.QueryOaApply)
applyRoute.POST("over-time/duration", oa.OverTimeDuration)
applyRoute.POST("info", oa_new.QueryOaApplyInfo)
}
settingRoute := oaRoute.Group("/setting")
{
settingRoute.Use(middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
settingRoute.POST("save", oa.SaveOaSetting)
settingRoute.POST("detail", oa.QueryOaSetting)
settingRoute.POST("remove", oa.DeleteOaSetting)
}
// 请假时长
{
oaRoute.POST("leave/duration", oa.LeaveDuration)
oaRoute.POST("annual-leave/duration", oa.AnnualLeaveDuration)
oaRoute.POST("leave/check", oa.CheckLeave)
}
// 考勤组
workTimeTemplateRoute := oaRoute.Group("/work-time-template")
{
workTimeTemplateRoute.Use(middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
workTimeTemplateRoute.POST("template-save", oa_new.SaveWorkTimeTemplate)
workTimeTemplateRoute.POST("template-list", oa_new.GetWorkTimeTemplateList)
workTimeTemplateRoute.POST("template-remove", oa_new.DeleteWorkTimeTemplate)
workTimeTemplateRoute.POST("template-effective", oa_new.WorkingTimeTemplateEffective)
workTimeTemplateRoute.POST("template-not-effective", oa_new.WorkingTimeTemplateNotEffective)
workTimeTemplateRoute.POST("template-relation-save", oa_new.SaveWorkTimeTemplateRelation)
workTimeTemplateRoute.POST("template-relation-cancel", oa_new.BatchCancelWorkingTimeTemplateRelation)
workTimeTemplateRoute.POST("map-disable", oa_new.ChickInMapDisable)
workTimeTemplateRoute.POST("template-relation-save-now", oa_new.SaveWorkTimeTemplateRelationEffectiveNow)
workTimeTemplateRoute.POST("template-date", oa_new.QueryWorkTimeTemplateDate)
}
// 打卡地址
chickInMapRoute := oaRoute.Group("/chick-in-map")
{
chickInMapRoute.Use(middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
chickInMapRoute.POST("map-save", oa_new.SaveChickInMap)
chickInMapRoute.POST("map-list", oa_new.GetChickInMapList)
chickInMapRoute.POST("map-remove", oa_new.DeleteChickInMap)
}
// 考勤规则
workTimeRuleRoute := oaRoute.Group("/work-time-rule")
{
workTimeRuleRoute.Use(middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
workTimeRuleRoute.POST("time-rule-save", oa_new.SaveWorkTimeRule)
workTimeRuleRoute.POST("time-rule-list", oa_new.GetWorkTimeRuleList)
workTimeRuleRoute.POST("time-rule-remove", oa_new.DeleteWorkTimeRule)
}
// 假勤规则
oaRuleRoute := oaRoute.Group("/oa-rule")
{
oaRuleRoute.Use(middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
oaRuleRoute.POST("rule-save", oa_new.SaveOaRule)
oaRuleRoute.POST("rule-list", oa_new.GetOaRuleList)
oaRuleRoute.POST("rule-remove", oa_new.DeleteOaRule)
}
// 假期余额
oaLeaveBalanceRoute := oaRoute.Group("/leave-balance")
{
oaLeaveBalanceRoute.Use(middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
oaLeaveBalanceRoute.POST("balance-list", oa_new.GetLeaveBalanceList)
oaLeaveBalanceRoute.POST("balance-info", oa_new.GetLeaveBalanceInfo)
oaLeaveBalanceRoute.POST("balance-create-excel", oa_new.CreateLeaveBalanceExcel)
oaLeaveBalanceRoute.POST("balance-download-excel", oa_new.DownloadLeaveBalanceExcel)
oaLeaveBalanceRoute.POST("balance-update-annual", oa_new.BalanceUpdateAnnual)
}
{
oaRoute.POST("check-oa-month", oa.CheckOaMonth)
oaRoute.POST("query-oa-month", oa.AttendanceCollectionTest)
}
collectionRoute := oaRoute.Group("/collection")
{
r.POST("oa/collection/date/inner", oa_new.StaffCollectionDetailDate)
collectionRoute.Use(middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
collectionRoute.POST("detail", oa_new.StaffCollectionDetail)
collectionRoute.POST("dates", oa_new.StaffCollectionDetailDates)
collectionRoute.POST("date", oa_new.StaffCollectionDetailDate)
collectionRoute.POST("all", oa_new.StaffCollectionDetailMonth)
collectionRoute.POST("download", oa_new.StaffCollectionMonthDownload)
collectionRoute.POST("download/list", oa_new.StaffCollectionMonthDownloadList)
collectionRoute.POST("download/del", oa_new.StaffCollectionMonthDownloadDel)
//collectionRoute.POST("download/old", oa_new.StaffCollectionMonthDownloadOld)
collectionRoute.POST("download/action-time", oa_new.ExportActionRecord)
}
v2 := oaRoute.Group("/v2")
{
v2.Use(middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
v2.POST("clock-in", oa_new.ClockIn)
v2.POST("action-type", oa_new.ActionType)
v2.GET("chick-in-map", oa_new.ChickInMapInfo)
v2.GET("workingTime-info", oa_new.WorkingTimeInfo)
v2.POST("make-up/useful-num", oa_new.MakeUpNum)
v2.POST("record/miss", oa_new.MissRecordForMakeUp)
v2.POST("system/common", oa_new.SystemCommon)
v2.POST("record/face", oa_new.QueryOtherRecord)
}
oaMonthFieldRoute := v2.Group("/oa-month-field")
{
oaMonthFieldRoute.POST("field-save", oa_new.SaveOaMonthField)
oaMonthFieldRoute.POST("field-list", oa_new.FindOaMonthField)
}
durationRoute := v2.Group("/duration")
{
durationRoute.POST("over-time", oa_new.OverTimeDuration)
durationRoute.POST("leave", oa_new.LeaveDuration)
durationRoute.POST("annual-leave", oa_new.AnnualLeaveDuration)
durationRoute.POST("businessTrip", oa_new.BusinessTripDuration)
durationRoute.POST("out-work", oa_new.OutWorkDuration)
}
// 考勤组分类
tempGroupRoute := oaRoute.Group("/temp-group")
{
tempGroupRoute.Use(middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
tempGroupRoute.POST("group-save", oa_new.SaveTemplateGroup)
tempGroupRoute.POST("group-list", oa_new.QueryTemplateGroup)
tempGroupRoute.POST("group-remove", oa_new.DeleteTemplateGroup)
}
}
}

18
pkg/router/ocr.go Normal file
View File

@ -0,0 +1,18 @@
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/ocr"
"github.com/gin-gonic/gin"
)
func OcrRoute(r *gin.RouterGroup) {
//noAuth := r.Group("")
auth := r.Group("")
auth.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
ocrAuth := auth.Group("ocr")
{
ocrAuth.POST("card-info", ocr.CardInfo)
}
}

23
pkg/router/patent.go Normal file
View File

@ -0,0 +1,23 @@
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/patent"
"github.com/gin-gonic/gin"
)
// PatentRoute 专利申请
func PatentRoute(r *gin.RouterGroup) {
parentRoute := r.Group("/patent")
parentRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
{
parentRoute.POST("create", patent.Create)
parentRoute.POST("/before/create", patent.BeforeCreate)
parentRoute.PUT("update", patent.Update)
parentRoute.POST("list", patent.List)
parentRoute.POST("info", patent.Info)
parentRoute.DELETE("deleted", patent.Deleted)
}
}

38
pkg/router/paybill.go Normal file
View File

@ -0,0 +1,38 @@
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/pay_bill"
"github.com/gin-gonic/gin"
)
// PayBillRoute 库管接口
func PayBillRoute(Router *gin.RouterGroup) {
v1yRoute := Router.Group("api/paybill")
v1yRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider))
{
//v1yRoute.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
v1yRoute.POST("secret/des", pay_bill.Des)
v1yRoute.POST("secret/update", pay_bill.Update)
v1yRoute.POST("secret/send", pay_bill.Send)
//新的v2 付款单
v1yRoute.POST("/list", pay_bill.PayBillList)
v1yRoute.POST("date/list", pay_bill.DateList)
v1yRoute.POST("/statics", pay_bill.StaticsInfo)
v1yRoute.POST("/process/update", pay_bill.UpdateProcessStatus) //更新 流程状态
v1yRoute.POST("/update", pay_bill.UpdatePayBill)
v1yRoute.POST("/history", pay_bill.PayBillProcesses)
v1yRoute.POST("/excel", pay_bill.ExcelBill)
v1yRoute.POST("/all", pay_bill.ArtistAll)
v1yRoute.POST("/search", pay_bill.ArtistBill)
v1yRoute.POST("/rollback", pay_bill.RollbackState)
v1yRoute.POST("/nocount", pay_bill.NoCount)
v1yRoute.POST("/editadd", pay_bill.UpdateAddress)
v1yRoute.POST("/updateTalentAgency", pay_bill.SyncArtShowTalentAgency)
}
}

896
pkg/router/router.go Normal file
View File

@ -0,0 +1,896 @@
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/service/home_page"
"net/http"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/children_competition"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/customer_service"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/goods_management"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/recruit"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/train"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/weekmeal"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/oa"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/order"
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/account"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/approval"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/auth/department"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/auth/position"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/auth/rule"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/auth/rule_log"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/auth/supplyinfo"
es_approval "github.com/fonchain_enterprise/fonchain-main/pkg/service/es_service/approval"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/push"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/task"
"github.com/gin-contrib/gzip"
"github.com/gin-contrib/pprof"
"github.com/gin-gonic/gin"
)
//Router 管理""组
/*func Router(g *gin.RouterGroup) {
// g.GET("/", func(c *gin.Context) {
// c.HTML(http.StatusOK, "login.html", nil)
// })
// g.GET("/login", func(c *gin.Context) {
// c.HTML(http.StatusOK, "login.html", nil)``
// })
g.GET("/", func(c *gin.Context) {
c.HTML(http.StatusOK, "index.html", nil)
})
}*/
// 路由配置
func NewRouter() *gin.Engine {
//使用默认gin路由
r := gin.Default()
//Router(gin.Default().Group(""))
originRoute := r.Group("")
r.Use(gzip.Gzip(gzip.DefaultCompression))
//加入日志中间件,跨域中间件
privateGroup := r.Group("")
r.Use(middleware.Cors())
privateGroup.Use(middleware.NewLogger(), middleware.Cors(), middleware.GinRecovery(true))
originRoute.Use(middleware.NewLogger(), middleware.Cors(), middleware.GinRecovery(true))
ShopRoute(privateGroup)
ArtworkRoute(privateGroup)
ArtistRoute(privateGroup)
ChatRoute(originRoute)
MealRoute(privateGroup)
InventoryRoute(privateGroup)
MeetingRoute(privateGroup)
AuthRoute(privateGroup)
CopyrightRoute(privateGroup)
ChainBrowserRoute(originRoute)
workMealDayRoute(privateGroup)
GiteaRoute(originRoute)
DciRoute(originRoute)
ExamRoute(privateGroup)
TurnstileRoute(privateGroup)
PatentRoute(privateGroup)
PayBillRoute(privateGroup)
AiImageRoute(privateGroup)
//ExhibitionRoute(privateGroup)
//ExamV2Route(privateGroup)
OaRoute(privateGroup)
LoanBillRoute(privateGroup)
ExamV2Route(privateGroup)
//ExhibitionRoute(privateGroup)
LaunchRoute(privateGroup)
EmployeeFileRoute(privateGroup)
OcrRoute(privateGroup)
websocketRoute(privateGroup)
DomainNameRoute(privateGroup)
//请求相关信息备份
//r.Use(middleware.Backup(service.AccountProvider, service.GrpcBackupImpl))
// r.POST("user/register", account.UserRegister) //用户注册
// r.POST("user/login", account.UserLogin) //登录
// r.POST("user/send", account.SendMsg)
test := r.Group("test") // grpc 测试路由组
{
//test.POST("chain", approval.StoreBaiduChainApprovalFilePost)
//test.GET("make-up", service.CheckClickIn)
test.POST("demo", service.Demo)
}
//自己生成日志
//r.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
//账号模块
{
r.POST("user/login", account.UserLogin) //登录
r.POST("user/artwork/login", account.ArtworkUserLogin)
r.POST("user/send", account.SendMsg)
//r.GET("user/online/infos", account.OnlineInfos)
r.GET("user/online/info", account.OnlineInfoById)
r.GET("user/offline", account.Offline)
r.POST("user/refresh/token", account.RefreshToken) //登出
acRoute := r.Group("/user")
acRoute.POST("logout", account.UserLogout) //登出
acRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
{
r.POST("user/register", account.UserRegister) //用户注册
acRoute.POST("auth", account.Authentication) //实名授权
acRoute.POST("check", account.CheckMsg) //校验验证码
acRoute.DELETE("remove", account.Remove) //删除
acRoute.POST("update", account.Update) //更新
acRoute.POST("privacyInfo", account.PrivacyInfo) //私密的加密信息
acRoute.POST("info", account.Info) //用户信息
acRoute.POST("now/info", account.NowInfo) //用户信息
acRoute.POST("base", account.BaseInfo) //基本信息
acRoute.POST("list", account.List) //用户列表
acRoute.POST("list/supper", department.SupperUsers) //用户列表
acRoute.POST("leader", account.DepartmentLeaderList) // 部门主管名字
acRoute.POST("mail/account", account.MailAccount) // 根据昵称获取mail帐号
acRoute.POST("map/ip/to/location", account.LocationNowIp) // 定位--ip转化
acRoute.POST("map/location/query", account.SiteQuery) // 定位--位置转坐标
acRoute.POST("ocr/card", account.OcrCardId) // 用户管理-识别身份证
}
}
//权限模块
{
positionRoute := r.Group("/position")
positionRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider))
{
positionRoute.Use(middleware.WarnLog(service.AccountProvider, service.GrpcLogImpl))
positionRoute.POST("create", position.Create)
positionRoute.DELETE("remove", position.Remove)
positionRoute.POST("update", position.Update)
positionRoute.POST("detail", position.Detail)
positionRoute.POST("list", position.List)
}
departmentHeadRoute := r.Group("/department/head")
{
departmentHeadRoute.POST("create", department.CreateDepartmentHead)
departmentHeadRoute.POST("update", department.UpdateDepartmentHead)
departmentHeadRoute.POST("list",
middleware.CheckLogin(service.AccountProvider),
middleware.CheckAuth(service.AccountProvider, service.RuleProvider),
department.FindDepartmentHeadList)
}
departmentRoute := r.Group("/department")
departmentRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider))
{
departmentRoute.Use(middleware.WarnLog(service.AccountProvider, service.GrpcLogImpl))
departmentRoute.POST("create", department.Create)
departmentRoute.DELETE("remove", department.Remove)
departmentRoute.POST("update", department.Update)
departmentRoute.POST("detail", department.Detail)
departmentRoute.POST("details", department.Details)
departmentRoute.POST("user/remove", department.RemoveUser)
departmentRoute.POST("list", department.List)
departmentRoute.POST("list/all", department.ListAll)
departmentRoute.POST("all", department.All)
departmentRoute.POST("users", department.Users)
departmentRoute.POST("users/v2", department.SupperUsers)
departmentRoute.POST("base/list", department.BaseList)
departmentRoute.POST("base/user", department.BaseDepartmentList)
}
SupplyInfoRoute := r.Group("/supplyinfo")
SupplyInfoRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.WarnLog(service.AccountProvider, service.GrpcLogImpl))
{
SupplyInfoRoute.POST("/createsupplyinfo", supplyinfo.CreateSupplyInfo)
SupplyInfoRoute.POST("/getsupplyinfolist", supplyinfo.GetSupplyInfoList)
SupplyInfoRoute.POST("/getsupplyinfo", supplyinfo.GetSupplyInfo)
SupplyInfoRoute.POST("/applyartwork", supplyinfo.ApplyArtwork)
SupplyInfoRoute.POST("/getexam", supplyinfo.GetExam)
SupplyInfoRoute.POST("/getexamlist", supplyinfo.GetExamList)
SupplyInfoRoute.POST("/applyvideo", supplyinfo.ApplyExhVideo)
SupplyInfoRoute.POST("/getvideolist", supplyinfo.GetVideoList)
SupplyInfoRoute.POST("/applyexam", supplyinfo.ApplyExhExam)
SupplyInfoRoute.POST("/applyartistinfo", supplyinfo.ApplyArtistInfo)
SupplyInfoRoute.POST("/getartistinfolist", supplyinfo.GetArtistInfoList)
SupplyInfoRoute.POST("/importartistsupplylist", supplyinfo.ImportArtistSupplyList)
SupplyInfoRoute.POST("/importartworksupplylist", supplyinfo.ImportArtworkSupplyList)
}
ruleRoute := r.Group("/rule")
ruleRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider))
{
ruleRoute.Use(middleware.WarnLog(service.AccountProvider, service.GrpcLogImpl))
ruleRoute.POST("create", rule.Create)
ruleRoute.DELETE("remove", rule.Remove)
ruleRoute.POST("update", rule.Update)
ruleRoute.POST("detail", rule.Detail)
ruleRoute.POST("list", rule.List)
ruleRoute.POST("rules", rule.Rules)
ruleRoute.POST("interface", rule.InterfaceAuth)
ruleRoute.POST("tree/list", rule.TreeList) //顶级菜单带上子菜单
ruleRoute.POST("menu/top", rule.TopList) //顶层
}
ruleLogRoute := r.Group("/rule_log")
ruleLogRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider))
{
ruleLogRoute.Use(middleware.WarnLog(service.AccountProvider, service.GrpcLogImpl))
ruleLogRoute.POST("list", rule_log.List)
}
}
//审核模块
{
approvalRoute := r.Group("/approval")
approvalRoute.POST("detail/ex", approval.DetailEx)
approvalRoute.POST("list/ex", approval.ListEx)
approvalRoute.POST("status/ex", approval.SetStatusEx)
approvalRoute.POST("status/batch-ex", approval.SetStatusBatchEx)
approvalRoute.POST("v2/status/batch-ex", approval.SetStatusBatchExV2)
approvalRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider))
{
approvalRoute.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
approvalRoute.POST("create", approval.Create)
approvalRoute.POST("exhibition/num", approval.UsedNumByUser)
approvalRoute.POST("status", approval.SetStatus)
approvalRoute.DELETE("remove", approval.Remove)
approvalRoute.POST("update", approval.Update)
approvalRoute.POST("detail", approval.Detail)
approvalRoute.POST("send", approval.Send)
approvalRoute.POST("revoke", approval.RevokeAllApproval)
approvalRoute.POST("print/detail", approval.PrintDetail)
approvalRoute.POST("/my/work", approval.MyWork)
approvalRoute.POST("/my/submit", approval.MySubmit)
approvalRoute.POST("/my/approved", approval.Approved) //我审批过的
//画展包付款单申请下载的权限
approvalRoute.POST("/check/pay/right", approval.CheckBundlePay)
approvalRoute.POST("viewed", approval.Viewed)
approvalRoute.POST("information", approval.Information)
approvalRoute.POST("setting/update", approval.UpdateSetting)
approvalRoute.POST("setting/detail", approval.DetailSetting)
approvalRoute.POST("type/create", approval.CreateType)
approvalRoute.DELETE("type/remove", approval.RemoveType)
approvalRoute.POST("type/update", approval.UpdateType)
approvalRoute.POST("type/detail", approval.DetailType)
approvalRoute.POST("type/all", approval.AllType)
approvalRoute.POST("group/all", approval.AllGroup)
// 财务报表审批
approvalRoute.POST("financial_form/setting", approval.GetName)
approvalRoute.POST("financial_form/export", approval.FinancialFormExport)
// 招聘
approvalRoute.POST("job/list", approval.JobList)
approvalRoute.POST("job/close", approval.CloseJob)
approvalRoute.POST("job/interviewer", approval.CreateInterviewer)
approvalRoute.POST("job/interviewer-edit", approval.UpdateInterviewer)
approvalRoute.POST("employ/close", approval.CloseEmploy)
// 审批抄送人预览
approvalRoute.POST("setting/preview", approval.MakeApprovalAndUser)
// 批量催办
approvalRoute.POST("list-send", approval.ListSend)
// 批量审批
approvalRoute.POST("status/batch", approval.SetStatusBatch)
// 查询画展包相关审批
approvalRoute.POST("show-list", approval.ArtShowApprovalList)
}
{
approvalRoute.POST("v2/create", approval.CreateV2)
approvalRoute.POST("v2/type/create", approval.CreateApprovalType)
approvalRoute.POST("v2/type/update", approval.UpdateApprovalType)
approvalRoute.POST("v2/type/copy", approval.CopyApprovalType)
approvalRoute.POST("v2/type/status", approval.UpdateApprovalTypeStatus)
approvalRoute.POST("v2/type/all", approval.ApprovalTypeList)
approvalRoute.POST("v3/type/all", approval.ApprovalTypeListV3)
approvalRoute.POST("v2/group/create", approval.CreateApprovalGroup)
approvalRoute.POST("v2/group/all", approval.ApprovalGroupList)
approvalRoute.POST("v2/my/work", approval.MyWorkV2)
approvalRoute.POST("v2/setting/preview", approval.MakeApprovalAndUserV2)
approvalRoute.POST("v2/status", approval.SetStatusBatchV2)
approvalRoute.POST("v2/only-group", approval.OnlyGroupList) //只查看分组列表
approvalRoute.POST("v2/approval-his-type", approval.ApprovalHisTypeList) //查询历史审批类型
approvalRoute.POST("v2/export-approval", approval.ExportApproval)
//查询是否有重复的录用
approvalRoute.POST("v2/find-employ", approval.FindEmploy)
approvalRoute.POST("v2/updates-old", approval.UpdatesOldData)
approvalRoute.POST("v2/export-detail-setting", approval.ExportDetailSettingV2)
approvalRoute.POST("v2/create-auth", approval.CreateAuthQuick) //快速添加发起人
approvalRoute.POST("v2/find-turnover", approval.FindTurnoverAndHandover) //查询离职相关审批
approvalRoute.POST("v2/find-super-type", approval.FindSuperType) //查询离职相关审批
approvalRoute.POST("v2/create-auth-batch", approval.CreateAuthBatch) //批量添加发起人
approvalRoute.POST("v2/search", es_approval.SearchApproval)
approvalRoute.POST("v2/bulk", es_approval.BulkApproval)
}
}
//工作餐预约
{
weekRoute := r.Group("/work/meal")
weekRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
{
weekRoute.POST("week", weekmeal.Week) //主列表
weekRoute.POST("weeks", weekmeal.Weeks) //周报详情
weekRoute.POST("update", weekmeal.Update) //更新
weekRoute.POST("update/weekInfo", weekmeal.UpdateWeekInfo) //修改就餐人数
}
}
//私宴
{
selfMealRoute := r.Group("/self/meal")
selfMealRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
{
selfMealRoute.POST("qr/create", weekmeal.CreateQr) //主列表
}
}
//销售宝后端
{
orderRoute := r.Group("/report")
orderRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
{
orderRoute.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
orderRoute.POST("list", order.ReportsList) //主列表
orderRoute.POST("my/list", order.ReportsMyList) //历史周报
orderRoute.POST("users", order.ReportUsers) //周报详情
orderRoute.GET("down/users", order.DownReportUsers) //周报详情下载
orderRoute.POST("create/before", order.BeforeUser) //未发布之前的业绩报表
orderRoute.GET("now", order.NowReport) //获取当前提交的报表
orderRoute.POST("create", order.ReportCreate) //生成周报
orderRoute.POST("publish", order.ReportPublish) //发布周报
orderRoute.GET("sell/amount", order.CheckSalesAmount) //查询销售员到期金额
orderRoute.GET("find/dates", order.FindDates) //查询周报日期
}
sellerRoute := r.Group("/seller")
sellerRoute.Use(middleware.CheckLogin(service.AccountProvider))
{
sellerRoute.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
sellerRoute.POST("report/cashier/list", order.CashierReportsList) //出纳查看列表
sellerRoute.POST("report/cashier/sure", order.ReportSure) //出纳确认订单 内控待确认
sellerRoute.POST("report/cashier/re", order.ReportRe) //出纳确认订单 内控待确认
sellerRoute.POST("reportuser/batch/update", order.ReportUsersUpdate) //出纳查看列表
sellerRoute.GET("order/down", order.DownReportUsers) //财务下载订单
sellerRoute.POST("order/cashier/list", order.CashierOrders) //出纳 订单列表
sellerRoute.POST("order/control/list", order.ControlOrders) //内控 订单列表
sellerRoute.POST("order/finance/list", order.FinanceOrders) //财务 订单列表
//出纳增加权限 列表 详情 编辑 发起
sellerRoute.POST("cashier/transactions", order.Transactions) //管理下的叮当
sellerRoute.POST("cashier/seller/users", order.Users) //管理下的销售
sellerRoute.POST("cashier/publish", order.CashierSure) //发起订单
sellerRoute.POST("cashier/order/update", order.SetOrder) //更新
sellerRoute.POST("cashier/order/detail", order.OrderDetail) //
sellerRoute.POST("cashier/order/list", order.OrderList) //
sellerRoute.POST("order/cashier/sure", order.CashierSure) //出纳确认订单 内控待确认
sellerRoute.POST("order/control/sure", order.ControlSure) //内控确认订单 财务待确认
sellerRoute.POST("order/finance/sure", order.FinanceSure) //财务确认订单 内控待确认
sellerRoute.POST("order/finance/stage/pass", order.FinancePass) //财务确认订单 内控待确认
sellerRoute.POST("order/finance/stage/refuse", order.FinanceRefuse) //财务确认订单 内控待确认
sellerRoute.POST("order/finance/sures", order.FinanceSures) //财务确认订单 内控待确认
sellerRoute.POST("order/finance/statist", order.Statist) //财务获取统计数据
sellerRoute.POST("order/batch/update", order.UpdateOrder) //批量更新
//sellerRoute.GET("transaction/list", order.DownReportUsers) //买家列表
sellerRoute.POST("transaction/cashier/list", order.SiteTransactions) //出纳 买家列表
sellerRoute.POST("transaction/cashier/detail", order.Transaction) //出纳 买家列表
sellerRoute.GET("order/finance/down", order.DownOrders) //财务下载
sellerRoute.POST("department/bases", order.DepartmentBases)
sellerRoute.POST("transaction/update", order.TransactionUpdate)
//委托单
sellerRoute.POST("entrust/list", order.GetEntrusts)
sellerRoute.POST("entrust/detail", order.GetEntrust)
sellerRoute.POST("entrust/delete", order.EntrustDelete)
sellerRoute.POST("entrust/batch/update", order.UpdateEntrustKeys)
sellerRoute.POST("entrust/batch/delete", order.EntrustBatchDelete)
sellerRoute.POST("entrust/import", order.ImportEntrusts)
//员工汇报
sellerRoute.POST("weekly/staff/list", order.GetWeeklyStaffList)
sellerRoute.POST("weekly/staff/info", order.GetWeeklyStaffInfo)
sellerRoute.POST("weekly/staff/excel", order.GetWeeklyStaffExcel)
//总监周报
sellerRoute.POST("weekly/boss/list", order.GetWeeklyBossList)
sellerRoute.POST("weekly/boss/info", order.GetWeeklyBossInfo)
sellerRoute.POST("weekly/comment/create", order.CreateWeeklyComment)
sellerRoute.POST("weekly/comment/info", order.GetWeeklyComment)
// 账号审核
sellerRoute.POST("examine/list", account.ExamineList) //审核列表
sellerRoute.POST("examine/approve", account.ExamineApprove) //审批
}
}
//需要登陆保护
{
taskRoute := r.Group("/task")
taskRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
taskRoute.POST("detail", task.Detail)
taskRoute.POST("create", task.Create)
taskRoute.POST("update", task.Update)
taskRoute.POST("remove", task.Remove)
taskRoute.POST("list", task.List)
taskRoute.POST("finish", task.Finish)
taskRoute.POST("statistics", task.DataInfo)
}
//日志
log := r.Group("/log")
log.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
{
log.POST("/loglist", service.LogList)
log.POST("/loginfo", service.LogInfo)
log.POST("/listbyawid", service.LogListByAwId)
}
//留言板
note := r.Group("/note")
note.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
{
note.POST("/createnote", service.CreateNote)
note.POST("/noteinfo", service.NoteInfo)
// note.POST("note/deletenote", service.DeleteNote)
note.POST("/notelist", service.NoteList)
note.POST("/notelistbyawid", service.NoteListByAwId)
}
//品牌方
shopbrand := r.Group("/shopbrand")
shopbrand.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
{
shopbrand.POST("/createbrand", service.CreateBrand)
shopbrand.POST("/brandlist", service.BrandList)
shopbrand.POST("/brandinfo", service.BrandInfo)
shopbrand.POST("/updatebrand", service.UpdateBrand)
shopbrand.POST("/deletebrand", service.DeleteBrand)
}
artShow := r.Group("artshow")
artShow.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
{
artShow.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl), middleware.CheckLogin(service.AccountProvider))
artShow.POST("show/add", service.CreateShow)
artShow.PUT("show/edit", service.UpdateShow)
artShow.DELETE("show/remove", service.DelShow)
artShow.POST("show/list", service.ShowList)
artShow.POST("show/list-with-rel", service.ShowListWithRel)
artShow.POST("show/list-apply", service.ShowListApply)
artShow.POST("show/date-list", service.QueryShowDate)
artShow.POST("show/list-lately", service.ShowListWithRelLately)
artShow.POST("show/no-price-num", service.ShowListNoPriceNum)
artShow.POST("show/artwork-info", service.ShowArtworkInfo)
artShow.POST("show/detail", service.ShowDetail)
artShow.POST("show/num", service.ShowStatisticalInfo)
artShow.POST("show/cancel", service.CancelShow)
artShow.POST("apply/add", service.CreateApply)
artShow.PUT("apply/edit", service.UpdateApply)
artShow.DELETE("apply/remove", service.DelApply)
artShow.POST("apply/show-list", service.ShowListWithApply)
artShow.PUT("apply/edit-status", service.UpdateApplyStatus)
artShow.POST("apply/list", service.ApplyList)
artShow.POST("apply/rel-info", service.ApplyRelInfoDetail)
artShow.POST("artwork/price", service.ArtworkPrice)
artShow.POST("artist/list", service.ShowListForArtwork)
artShow.POST("show/download-temp", service.ExportShowPrice)
artShow.POST("show/download", service.ExportShowPrice_withoutCopyright)
//artShow.POST("show/export-by-artist", service.ExportByArtist)
artShow.POST("show/export-by-artist", service.ExportByArtist_withoutCopyright)
artShow.POST("show/show-time-list", service.ShowTimeList)
artShow.POST("show/all-time-list", service.AllTimeList)
artShow.POST("show/entertainment-list", service.FindEntertainment)
artShow.POST("entertainment/edit", service.SaveEntertainment)
artShow.POST("show/no-price-list", service.FindNoPriceShow)
artShow.POST("show/no-price-edit", service.UpdateShowPrice)
artShow.POST("show/price-policy-edit", service.SavePolicy)
artShow.POST("show/price-policy-info", service.QueryPolicy)
artShow.POST("entertainment/download", service.ExportEntertainment)
artShow.POST("show/show-host-edit", service.UpdateArtShowHost)
//artShow.POST("one-query/price/download", service.ExportShowPriceOneQuery)
artShow.POST("one-query/price/download", service.ExportShowPriceOneQuery_withoutCopyright)
artShow.POST("one-query/show-list", service.OnQueryShowList)
artShow.POST("one-query/show/download", service.ExportShowFieldOneQuery)
artShow.POST("entertainment/download-png", service.ExportEntertainmentImage)
artShow.POST("entertainment/group-field", service.FindEntertainmentGroupField)
artShow.POST("show/can-show", service.CanShow)
artShow.POST("show/startCheck", service.ShowStartCheck)
//无底价画展包改版
artShow.POST("show/artwork-price-list", service.ArtworkPriceListV2)
artShow.POST("show/update-artwork-price", service.UpdateArtworkPriceV2)
artShow.POST("show/cal-price", service.CalPriceSingle)
// 单据
artShow.POST("invoice/save", service.CreateInvoice)
artShow.POST("invoice/list", service.ShowInvoiceList)
artShow.POST("invoice/single", service.ShowInvoice)
artShow.POST("invoice/num-add", service.UpdateInvoicePrintNum)
artShow.POST("show/num-add", service.UpdateShowPrintNum)
//artShow.POST("invoice/price-info", service.QueryPrice)
artShow.POST("invoice/price-info", service.QueryPrice_withoutCopyright)
artShow.POST("invoice/status", service.UpdateShowInvoiceStatus)
// 打印管理
artShow.POST("print/list", service.ArtShowListForPrint) // 画展包列表
artShow.POST("print/preview", service.PrintPreviewFile) // 打印预览
artShow.POST("print/detail", service.GetPrintDetail) // 打印详情
artShow.POST("print/num-add", service.CreatePrintDetail) // 添加打印详情
artShow.POST("print/artistList", service.SearchArtistListByKeyword) // 搜索画家
// 经纪公司
artShow.POST("talent-agency/list", service.TalentAgencyList) // 经纪公司列表
}
// 无需登录
noLoginArtShow := r.Group("artshow")
{
noLoginArtShow.POST("artwork/price-info", service.ArtworkPriceWholeInfo)
}
address := r.Group("address")
{
address.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
address.POST("addres-list", service.QuerySaleAddress)
}
// 打卡机 打卡
ClockInMachine := r.Group("/api/v1")
{
ClockInMachine.POST("record/face", oa.ClockFaceLog)
ClockInMachine.POST("stranger", oa.Stranger) //陌生人识别
ClockInMachine.POST("callPhone", oa.CallPhone2) //访客呼叫
ClockInMachine.POST("callManagement", oa.CallPhone3) //访客呼叫管理员
}
chain := r.Group("chain")
chain.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
{
chain.POST("co-chain", service.CoChain)
chain.POST("create-cert", service.CreateCert)
chain.POST("auth-img-cochain", service.AuthImgCoChain)
}
// 上传
upload := privateGroup.Group("upload")
upload.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
{
upload.POST("img", service.UploadImg)
upload.POST("multi", service.UploadMulti)
upload.POST("upload-chunk", service.UploadChunk)
}
//抽奖
draw := r.Group("/draw")
{
draw.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
draw.POST("addAccount", service.AddAccount) //用户注册并绑定hash
draw.POST("addprizenum", service.AddPrizeNum) //奖金累加
draw.POST("setpool", service.SetPool) //设置奖池
draw.POST("setresult", service.SetResult) //保存结果密文到百度链
draw.POST("getaccountprize", service.GetAccountPrize) //查询中奖的账户的信息
draw.POST("prizelist", service.PrizeList) //列出奖品信息
// draw.POST("encrypt", service.Encrypt) //加密
// draw.POST("decrypt", service.Decrypt) //解密
}
//推送
pushRoute := r.Group("/push")
{
pushRoute.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
//空投相关
pushRoute.POST("putIn", push.PutIn) //投放空投
pushRoute.POST("dropHistortList", push.DropHistortList) //历史空投列表
pushRoute.POST("dropHistortDel", push.DropHistortDel) //删除未开始的空投
pushRoute.POST("user/data", account.MallRandList) //获取用户数据
//公告相关
pushRoute.POST("pushAnnouncement", push.PushAnnouncement) //推送公告
pushRoute.POST("announcementHisList", push.AnnouncementHisList) //历史公告列表
pushRoute.POST("announcementDel", push.AnnouncementDel) //删除未开始公告
}
//销售
saleRoute := r.Group("/sale")
{
saleRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
saleRoute.POST("series", order.SeriesList) //系列列表
saleRoute.POST("series/collections", order.CollectionsList) //系列下藏品列表
saleRoute.POST("pay/detail", order.PayDetail) //detail
saleRoute.POST("pay/express/set", order.PayAgreeExpress) //修改订单状态
saleRoute.POST("pay/approval/list", order.PayList) //订单列表列表
saleRoute.POST("pay/approval/info", order.PayHasExpress) //订单列表列表
saleRoute.POST("pay/refund", order.Refund) //订单列表列表
saleRoute.POST("pay/offline/list", order.OfflinePayList) //订单列表列表
saleRoute.POST("pay/add/tracking/number", order.AddTrackingNumber) //订单添加快递单号
}
// 假期
holidayRoute := r.Group("/holiday")
{
holidayRoute.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
holidayRoute.POST("single", service.SingleHolidayInfo) // 单日
holidayRoute.POST("multi", service.MultiHolidayInfo) // 区间
}
// 地图 经纬度 换地址
addressRoute := r.Group("address")
{
addressRoute.POST("address-detail", service.LatLngToAddress)
}
//付款单
paybill := r.Group("/paybill")
{
paybill.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
paybill.POST("/list", service.PayBillList)
paybill.POST("/update", service.UpdatePayBill)
paybill.POST("/excel", service.ExcelBill)
paybill.POST("/all", service.ArtistAll)
paybill.POST("/search", service.ArtistBill)
paybill.POST("/rollback", service.RollbackState)
paybill.POST("/nocount", service.NoCount)
paybill.POST("/editadd", service.UpdateAddress)
}
//管理系统预约列表
prebook := r.Group("/prebook")
{
prebook.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
prebook.POST("prebookList", service.PrebookList)
prebook.POST("customerList", service.CustomerList)
prebook.POST("newList", service.NewList)
prebook.POST("feastList", service.FeastList)
prebook.POST("addpulg", service.Addpulg)
prebook.POST("sure", service.SureNo)
prebook.POST("alter", service.AlterPrice)
prebook.POST("del", service.DelFeast)
prebook.POST("feastInfo", service.GetAllFeastInfo)
}
//儿童画展报名投票
childrenCompetition := r.Group("/children/competition")
{
childrenCompetition.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
childrenCompetition.POST("registration/records", children_competition.GetRegistrationRecordInfo) //获取报名记录
childrenCompetition.POST("participant/registration/records", children_competition.GetParticipantRegistrationRecords) //获取个人报名记录
childrenCompetition.POST("set/registration/deadline", children_competition.SetRegistrationDeadline) //设置报名截止时间
childrenCompetition.POST("update/work/status", children_competition.UpdateWorkStatus) // 更新作品状态
childrenCompetition.POST("generate/qr/code", children_competition.GenerateQrCode) // 生成投票二维码
childrenCompetition.POST("batch/generate/qrCode", children_competition.BatchGenerateQrCode) // 生成全部投票二维码
childrenCompetition.POST("works/votes/info", children_competition.GetWorksVotesInfo) // 获取投票结果
childrenCompetition.POST("works/votes/export/form", children_competition.WorksVotesExportForm) // 导出投票结果
}
//快递柜
expressRoute := r.Group("/express")
{
expressRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
expressRoute.POST("singlechip/edit", service.EditSinglechip) //修改开发板信息 单个
expressRoute.POST("singlechip/batch/edit", service.BatchEditSinglechip) //修改开发板信息 单个
expressRoute.POST("circuit/edit", service.EditCircuit) //修改柜门信息
expressRoute.POST("circuit/setStatus", service.EditCircuit) //柜门修改开闭状态
expressRoute.POST("circuit/list", service.ListCircuit) //快递柜列表
expressRoute.POST("send", service.Send) //寄件
expressRoute.POST("history/list", service.HistoryList) //寄件历史明细
expressRoute.POST("singlechip/open", service.Open) //开发板开启关闭状态
expressRoute.POST("singlechip/remove", service.Remove) //开发板一键删除
expressRoute.POST("singlechip/list", service.ExpressList) //开发板一键删除
expressRoute.POST("singlechip/create", service.Create)
}
//管理系统预约商城
productRoute := r.Group("/product")
{
productRoute.POST("/list", service.ProductList) //商品列表
productRoute.POST("/info", service.ProductInfo) //商品详情
productRoute.POST("/sell", service.SellList) //商品购买记录
productRoute.POST("/add", service.AddProduct) //新增商品
productRoute.POST("/updatestate", service.UpdateProductState) //更新商品状态
productRoute.POST("/del", service.DelProduct) //删除未上架的商品
productRoute.POST("/updategoods", service.UpdateProduct) //修改未上架的商品
productRoute.POST("/sale", service.SaleLog) //没有商品版的售卖记录
productRoute.POST("/refuse", service.WechatRefunds) //退款
}
healthRoute := r.Group("/health")
{
healthRoute.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
healthRoute.POST("/list", service.DoctorList) //医生信息列表
healthRoute.POST("/prelist", service.PreList) //预约列表
healthRoute.POST("/info", service.PreInfo) //预约详情
healthRoute.POST("/edit", service.UpdatePre) //更新预约信息
healthRoute.POST("/illmessage", service.SendMedical) //发送电子病历
healthRoute.POST("/okmsg", service.SendPremsg) //发送电子病历
healthRoute.POST("/editstreet", service.UpdateStreet) //更新街道
healthRoute.POST("/adddr", service.AddDr) //增加预约科室医生
healthRoute.POST("/call", service.CallSign) //叫号
healthRoute.POST("/callup", service.QueueUp) //插队
healthRoute.POST("/drde", service.DrDe) //医生和对应科室
healthRoute.POST("/delex", service.DelExAdd) //删除科室
healthRoute.POST("/appoint/list", service.HealthAppointList) //删除科室
healthRoute.POST("/appoint/del", service.DelHealthAppoint) //删除科室
healthRoute.POST("/appoint/update", service.UpdateHealthAppoint) //删除科室
}
preorderRoute := r.Group("/preorder")
{
preorderRoute.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
// preorderRoute.POST("/add", service.AddTeamType) //增加团队类型
preorderRoute.POST("/list", service.TeamTypeList) //查看团队类型
preorderRoute.POST("/edit", service.EditTeamType) //修改团队类型
// preorderRoute.POST("/del", service.DelTeamType) //删除团队类型
preorderRoute.POST("/lotset", service.LotSet) //批量设置可预约日期
preorderRoute.POST("/setlist", service.SetList) //根据给的时间展示可展的和不可展的日期
preorderRoute.POST("/editset", service.EditSet) //删除当天,把当天变成不可展
preorderRoute.POST("/timeedit", service.EditTime) //设置时间段(时间段的增删改查)
preorderRoute.POST("/timelist", service.AllTime) //时间段列表
}
journalRoute := r.Group("/journal")
{
journalRoute.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
journalRoute.POST("/add", service.AddJournal) //创建一条日志
journalRoute.POST("/selflist", service.SelfList) //自己创建的日志列表
journalRoute.POST("/acceptlist", service.AcceptList) //接收到的日志
journalRoute.POST("/info", service.JournalInfo) //日志详情
journalRoute.POST("/read", service.ReadJournal) //日志已读
journalRoute.POST("/undo", service.UndoJournal) //日志撤销
}
paymentRoute := r.Group("/payment")
{
paymentRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
paymentRoute.POST("/add", order.AddShop)
paymentRoute.POST("/list", order.ShopList)
paymentRoute.POST("/edit", order.EditShop)
paymentRoute.POST("/del", order.DelShop)
paymentRoute.POST("/addqr", order.AddQr)
paymentRoute.POST("/addqr64", order.AddQrBase64)
paymentRoute.POST("/onqr", order.OnQr)
paymentRoute.POST("/offqr", order.OffQr)
paymentRoute.POST("/downloadqr", order.Downloadqr)
}
// 二维码收款订单管理
collectionRecordRoute := r.Group("/collection/record")
{
collectionRecordRoute.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
collectionRecordRoute.POST("/list", order.CollectionRecordList) //特定条件的收款列表
collectionRecordRoute.POST("/export/excel", order.ExportForm) //导出特定条件的收款信息到excel表
collectionRecordRoute.POST("/modify/remarks", order.ModifyRemarks) //编辑收款订单备注
}
// 培训管理
trainRoute := r.Group("/train")
{
trainRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
trainRoute.POST("/createTrainInfo", train.CreateTrainInfo) //新增培训信息
trainRoute.POST("/updateTrainInfo", train.UpdateTrainInfo) //更改培训信息
trainRoute.POST("/deleteTrainInfo", train.DeleteTrainInfo) //删除培训信息
trainRoute.POST("/trainInfoList", train.TrainInfoList) //培训信息列表
trainRoute.POST("/specific/trainInfo/list", train.SpecificTrainInfoList) //具体培训下签到人员列表
trainRoute.GET("/specific/trainInfo/list", train.SpecificTrainInfoListJson) //具体培训下签到人员列表
trainRoute.POST("/pic/stream", train.GetPicStream) //具体培训下签到人员列表
trainRoute.POST("/personnel/upload", train.UploadPersonnel) //人员名单批量上传
}
// 招聘管理
recruitRoute := r.Group("/recruit")
{
recruitRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
recruitRoute.POST("/resume/upload/multi", recruit.UploadMulti) // 简历设计业务上传
recruitRoute.POST("/post/submit", recruit.PostSubmit) // 提交岗位审批
recruitRoute.POST("/post/up", recruit.PostUp) // 关闭岗位审批
recruitRoute.POST("/post/cancel/up", recruit.PostCancelUp) // 关闭岗位审批
recruitRoute.POST("/post/pass", recruit.PostPass) // 岗位审批审核通过
recruitRoute.POST("/post/reject", recruit.PostReject) // 岗位审批审核不通过
recruitRoute.POST("/post/check", recruit.PostCheck) // 岗位审批抄送已阅
recruitRoute.POST("/post/close", recruit.PostClose) // 关闭岗位审批
recruitRoute.POST("/resume/submit", recruit.ResumeSubmit) // 简历上传
recruitRoute.POST("/resume/submit/v2", recruit.ResumeSubmitV2) // 简历上传v2 版本携带上传的文件的名称以及附件
recruitRoute.POST("/resume/pass", recruit.ResumePass) // 简历审核通过
recruitRoute.POST("/resume/offer/sure", recruit.GiveResumeOffer) // 简历给予offer 录用最终一步 创建帐号信息
recruitRoute.POST("/resume/reject", recruit.ResumeReject) // 简历审核不通过
recruitRoute.POST("/resume/interview/time", recruit.ResumeInterviewTime) // 预约面试时间
recruitRoute.POST("/resume/modify/interview/time", recruit.ResumeModifyInterviewTime) // 修改面试时间
recruitRoute.POST("/resume/modify/info", recruit.ResumeModifyInfo) // 修改面试信息
recruitRoute.POST("/resume/interview/pass", recruit.ResumeInterviewPass) // 面试通过
recruitRoute.POST("/resume/interview/reject", recruit.ResumeInterviewReject) // 面试不通过
recruitRoute.POST("/resume/terminate", recruit.ResumeTerminate) // 简历终止
recruitRoute.POST("/resume/upload/detail", recruit.ResumeUploadDetail) // 上传面试信息
recruitRoute.POST("/offer/submit", recruit.OfferSubmit) // 提交入职申请
recruitRoute.POST("/offer/pass", recruit.OfferPass) // 入职申请审核通过
recruitRoute.POST("/offer/reject", recruit.OfferReject) // 入职申请审核不通过
recruitRoute.POST("/offer/check", recruit.OfferCheck) // 入职申请已阅
recruitRoute.POST("/position/query", recruit.PositionQuery) // 分页查询岗位申请
recruitRoute.POST("/resume/page/query", recruit.ResumePageQuery) // 分页查询简历
recruitRoute.POST("/offer/query", recruit.OfferQuery) // 分页查询入职申请
recruitRoute.POST("/detail/query", recruit.DetailQuery) // 分页查询审批详情
recruitRoute.POST("/copied/query", recruit.CopiedQuery) // 分页查询审批抄送
recruitRoute.POST("/change/record/query", recruit.ChangeRecordQuery) // 查询变更记录
recruitRoute.POST("/status/query", recruit.StatusQuery) // 查询状态列表
recruitRoute.POST("/data/info", recruit.DataInfo) // 查询状态列表
recruitRoute.POST("/resume/queryphone", recruit.CheckResumeExist) // 根据手机号查询,简历是否存在人才招聘系统中,是的话不允许直接发起录用申请
}
// 物资管理
goodsManagementRoute := r.Group("/goods/management")
{
goodsManagementRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
goodsManagementRoute.POST("/add/borrow/goods", goods_management.AddBorrowGoods) // 增加借用商品
goodsManagementRoute.POST("/borrow/goods/list", goods_management.BorrowGoodsList) // 借用商品列表
goodsManagementRoute.POST("/generate/qr/code", goods_management.GenerateBorrowQrCode) // 具体借用商品生成二维码
goodsManagementRoute.POST("/put/down/borrow/goods", goods_management.PutDownBorrowGoods) // 上下架借用的商品
goodsManagementRoute.POST("/delete/borrow/goods", goods_management.DeleteBorrowGoods) // 删除借用的商品
goodsManagementRoute.POST("/specific/borrow/record", goods_management.SpecificBorrowRecord) // 具体物品的借用记录
}
// 站点签到
SiteSignInRoute := r.Group("/site")
{
SiteSignInRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
SiteSignInRoute.POST("/siteList", service.SiteSignInList) // 站点列表
SiteSignInRoute.POST("/creCodeImage", service.CreCodeImage) // 生成二维码
SiteSignInRoute.POST("/downloadCodeImage", service.DownloadCodeImage) // 下载二维码
SiteSignInRoute.POST("/queryByApi", service.QuerySiteByApi) // 通过API查询经纬度
SiteSignInRoute.POST("/reverseGeocoding", service.ReverseGeocoding) // 自选地图点
}
// 客服工作台
customerService := r.Group("/customerService")
{
customerService.Use(middleware.CheckLogin(service.AccountProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
customerService.POST("/lock/artist/list", customer_service.GetLockArtistList) // 已经锁定的画家列表
customerService.POST("/audit/artwork/list", customer_service.GetPassedArtworkList) // 审核完成的画作列表
customerService.POST("/notify/artist", customer_service.UpdateNotifyStatus) // 更新通知画家
customerService.POST("/notified/artistList", customer_service.GetNotifiedArtistList) // 已通知画家列表
customerService.POST("/notified/artworkList", customer_service.GetNotifiedArtworkList) // 已通知画家列表
}
// 首页
homePage := r.Group("/homePage")
{
homePage.Use(middleware.CheckLogin(service.AccountProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
homePage.POST("/apply/count", home_page.ApplyCount) // 审核/考勤-申请数量
homePage.POST("/clockIn/info", home_page.ClockingIn) // 考勤信息
homePage.POST("/clockIn/record", home_page.ClockRecord) // 打卡记录
}
//新增画家宝审批流相关接口 By JJxu 2023-03-06
NewAuditRouter(r)
//静态文件
r.StaticFS("/static", http.Dir("./runtime"))
r.NoRoute(func(c *gin.Context) {
c.JSON(http.StatusNotFound, gin.H{
"status": 1,
"msg": "不存在的路由",
})
})
pprof.Register(r)
return r
}

78
pkg/router/shop.go Normal file
View File

@ -0,0 +1,78 @@
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/shop"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/task"
"github.com/gin-gonic/gin"
)
// ShopRoute 商城后台 路由配置
func ShopRoute(Router *gin.RouterGroup) {
series := Router.Group("series")
series.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider))
{
series.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
series.POST("save", shop.SaveSeries)
series.POST("detail", shop.SeriesDetail)
series.POST("update-lang", shop.UpdateSeriesLang)
series.POST("autoshelf", shop.AutoShelf)
series.POST("handshelf", shop.HandShelf)
series.POST("series-list", shop.SeriesList)
series.POST("del", shop.SeriesDel)
series.POST("get/series/language/info", shop.GetSeriesLanguageInfo)
}
brand := Router.Group("brand")
brand.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider))
{
brand.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
brand.POST("create", shop.CreateBrand)
brand.POST("info", shop.BrandInfo)
brand.POST("update", shop.BrandUpdate)
brand.POST("del", shop.BrandDel)
brand.POST("list", shop.BrandList)
brand.POST("allbrand", shop.AllBrand)
brand.POST("update/language/info", shop.UpdateLanguageInfo)
brand.POST("get/all/language/info", shop.GetAllLanguageInfo)
}
feedback := Router.Group("feedback")
feedback.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider))
{
feedback.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
feedback.POST("create", task.FeedBackCreate)
feedback.POST("top", task.Topping)
feedback.POST("list", task.FeedBackList)
}
collections := Router.Group("collections")
collections.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider))
{
collections.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
collections.POST("create", shop.AddCollections)
collections.POST("update", shop.UpdateCollectionsProfile)
collections.POST("del", shop.UpdateCollectionsProfile)
collections.POST("list", shop.CollectionsList)
collections.POST("detail", shop.CollectionsDetail)
collections.POST("qr", shop.Qr)
collections.POST("extend", shop.Extend)
collections.POST("get/language/status", shop.GetCollectionLanguageInfo) // 获取藏品多语言填写状态
}
recordRouter := Router.Group("shop/record")
recordRouter.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider))
{
recordRouter.POST("list", shop.RecordList)
}
testRouter := Router.Group("shop/test")
//testRouter.Use(middleware.CheckLogin(service.AccountProvider))
{
testRouter.POST("auto/wiped", shop.MethodAutoWipedOut)
testRouter.POST("auto/position", shop.MethodAutoPosition)
testRouter.GET("push/wiped", shop.PushAutoWipedOut)
testRouter.GET("push/position", shop.PushAutoPosition)
}
}

135
pkg/router/turnstile.go Normal file
View File

@ -0,0 +1,135 @@
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/account"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/turnstile"
"github.com/gin-gonic/gin"
)
// TurnstileRoute 速通门的认证
func TurnstileRoute(r *gin.RouterGroup) {
turnRoute := r.Group("turnstile")
turnRoute.GET("ws", turnstile.DeviceWs) //websocket
//turnRoute.POST("update/account", account.UpdateDeviceAccount) //更新/创建 设备人员帐号
//turnRoute.POST("del/account", account.DelSingleDeviceAccount) //删除人员
noSecret := r.Group("/secret")
{
//访客
noSecret.POST("visitor", account.ClockVisitor) // 访客申请
//noSecret.POST("set/door", account.ClockDeviceWXSetDoor) // 控制设备开门/关门
//noSecret.POST("batch/capture/photo", account.ClockDeviceWXCapturePhoto) // 抓拍现场照片
}
clockRoute := r.Group("/clock")
clockRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
{
clockRoute.POST("create", account.CreateClockDevice) // 创建打卡机设备
clockRoute.POST("update", account.UpdateClockDevice) // 更新打卡机设备
clockRoute.DELETE("remove", account.RemoveClockDevice) // 删除打卡机设备
clockRoute.POST("info", account.ClockDeviceInfo) // 查看打卡机详情
clockRoute.POST("list", account.ClockDeviceList) // 查看打卡机列表
clockRoute.POST("single/untie", account.ClockDeviceSingleUntie) // 单人解绑打卡机设备
clockRoute.POST("batch/bind", account.ClockDeviceBatchBind) // 批量绑定打卡机
clockRoute.POST("batch/untie", account.ClockDeviceBatchUntie) // 批量解绑打卡机
clockRoute.POST("batch/detection/photo", account.ClockDeviceDetectionPhoto) // 检测图片质量
clockRoute.POST("batch/capture/photo", account.ClockDeviceCapturePhoto) // 抓拍现场照片
//通行规则
clockRoute.POST("rule/issuance", account.ClockDeviceRuleIssuance) // 人员通行规则下发
clockRoute.POST("rule/acquire", account.ClockDeviceRuleAcquire) // 获取人员通行规则
clockRoute.POST("rule/delete", account.ClockDeviceRuleDelete) // 删除人员通行规则
//密码开门
clockRoute.POST("password/switch", account.ClockDevicePasswordSwitch) // 设置密码开门开关
clockRoute.POST("password/set", account.ClockDevicePasswordSet) // 设置设备开门密码
//读取设备人员
clockRoute.POST("person/sync", account.ClockDevicePersonSync) // 通知设备同步人员数据
clockRoute.POST("person/total", account.ClockDevicePersonTotal) // 查询设备人员数量和id
clockRoute.POST("person/info", account.ClockDevicePersonInfo) // 根据userid读取用户数据
//设备设置
clockRoute.POST("set/acquire", account.ClockDeviceSetAcquire) // 获取设备设置
clockRoute.POST("set/logo", account.ClockDeviceSetLogo) // 设置设备logo
clockRoute.POST("set/slogan", account.ClockDeviceSetSlogan) // 设置广告语
clockRoute.POST("set/time", account.ClockDeviceSetTime) // 设置设备时间
clockRoute.POST("set/interval", account.ClockDeviceSetInterval) // 设置设备识别间隔
clockRoute.POST("set/distance", account.ClockDeviceSetDistance) // 设置设备识别距离
clockRoute.POST("set/mask", account.ClockDeviceSetMask) // 口罩检测开关
clockRoute.POST("set/living", account.ClockDeviceSetLiving) // 活体检测
clockRoute.POST("set/living/class", account.ClockDeviceSetLivingClass) // 活体检测等级
clockRoute.POST("set/stranger", account.ClockDeviceSetStranger) // 陌生人识别
clockRoute.POST("set/volume", account.ClockDeviceSetVolume) // 设备音量
clockRoute.POST("set/username", account.ClockDeviceSetUsername) // 播放用户名
clockRoute.POST("set/hint", account.ClockDeviceSetHint) // 设置设备提示语音
clockRoute.POST("set/password", account.ClockDeviceSetPassword) // 修改进入设置页面密码
clockRoute.POST("set/restart", account.ClockDeviceSetRestart) // 重启设备
clockRoute.POST("set/relay", account.ClockDeviceSetRelay) // 设置继电器状态-常开/正常
clockRoute.POST("set/capture", account.ClockDeviceSetCapture) // 设置设备识别照片抓拍的质量
clockRoute.POST("set/callout", account.ClockDeviceSetCallout) // 访问呼叫开关
clockRoute.POST("set/printer", account.ClockDeviceSetPrinter) // 打印机开关
clockRoute.POST("set/visitor", account.ClockDeviceSetVisitor) // 首页访客申请入库内容
clockRoute.POST("set/token", account.ClockDeviceSetToken) // 设置http请求的token
clockRoute.POST("set/verify", account.ClockDeviceSetVerify) // 设置验证接口超时时长
clockRoute.POST("set/delay", account.ClockDeviceSetDelay) // 设置设备开门延迟
clockRoute.POST("set/press/time", account.ClockDeviceSetPressTime) // 进入设置页面长按时间
clockRoute.POST("set/desensitization", account.ClockDeviceSetDesensitization) // 姓名脱敏显示
clockRoute.POST("set/section", account.ClockDeviceSetSection) // 设置读卡扇区
clockRoute.POST("set/rail", account.ClockDeviceSetRail) // 设置设备位置围栏
clockRoute.POST("set/door", account.ClockDeviceSetDoor) // 控制设备开门/关门
//屏保
clockRoute.POST("screensaver/switch", account.ClockScreensaverState) // 设备节能屏保开关
clockRoute.POST("screensaver/settings", account.ClockScreensaver) // 设置设备屏保
clockRoute.POST("screensaver/delete", account.ClockDelScreensaver) // 删除屏保
clockRoute.POST("screensaver/interval", account.ClockScreensaverInterval) // 设置屏保显示时长
//体温检测
clockRoute.POST("temperature/detection", account.ClockTemperatureDetection) // 体温检测开关
clockRoute.POST("temperature/mode", account.ClockTemperatureMode) // 体温检测模式
clockRoute.POST("temperature/standard", account.ClockTemperatureStandard) // 初筛模式标准
clockRoute.POST("temperature/calibration", account.ClockTemperatureCalibration) // 设置体温校准模式
clockRoute.POST("temperature/low/pass", account.ClockTemperatureLowPass) // 低温可通行开关
clockRoute.POST("temperature/play", account.ClockTemperaturePlay) // 播报体温开关
clockRoute.POST("temperature/reflectivity", account.ClockTemperatureReflectivity) // 设置体温反射率
clockRoute.POST("temperature/correction", account.ClockTemperatureCorrection) // 设置体温校准值
clockRoute.POST("temperature/distance", account.ClockTemperatureDistance) // 设置设备体温检测距离
clockRoute.POST("temperature/measure", account.ClockTemperatureMeasure) // 设置测温时间段
//设备更新
clockRoute.POST("version/auto", account.ClockVersionAuto) // 开机自动更新
clockRoute.POST("version/info", account.ClockVersionInfo) // 获取设备版本信息
//clockRoute.POST("version/push", account.ClockVersionPush) // 发送设备版本信息给服务端
clockRoute.POST("version/check", account.ClockVersionCheck) // 通知设备在线检查更新
//clockRoute.POST("version/Interval", account.ClockDeviceSetRail) // 发送升级结果给服务端
//clockRoute.POST("version/Interval", account.ClockDeviceSetRail) // 更新下载进度
//二维码
clockRoute.POST("apply/value", account.ClockApplyValue) // 设置设备首页二维码
clockRoute.POST("apply/prefix", account.ClockApplyPrefix) // 设置访客二维码前缀
//全景相机设置
clockRoute.POST("camera/panoramic", account.ClockCameraPanoramic) // 全景相机开关
clockRoute.POST("camera/params", account.ClockCameraParams) // 设置全景相机的参数
//个性化设置
clockRoute.POST("recognition/style", account.ClockRecognitionStyle) // 识别结果样式
//识别后在线验证
clockRoute.POST("online/verify", account.ClockOnlineVerify) // 识别后在线验证
clockRoute.POST("online/card", account.ClockOnlineCard) // 在线验证卡号
clockRoute.POST("online/id/card", account.ClockOnlineIdCard) // 在线验证身份证号
//在线识别
clockRoute.POST("online/recognition", account.ClockOnline) // 设置在线识别间隔
clockRoute.POST("online/state", account.ClockOnlineState) // 在线识别开关
clockRoute.POST("online/temporary", account.ClockOnlineTemporary) // 临时启用在线识别
//识别设置
clockRoute.POST("discern/settings", account.ClockDiscernSettings) // 设置可通行人员类型
clockRoute.POST("discern/class", account.ClockDiscernClass) // 设置设备识别置信度
//设备禁用
clockRoute.POST("forbidden/switch", account.ClockForbiddenSwitch) // 开启/关闭设备识别
clockRoute.POST("forbidden/number", account.ClockForbiddenNumber) // 停用状态通行人数
//广告
clockRoute.POST("advertising/add", account.ClockAdvertisingAdd) // 下发广告 - 图片
clockRoute.POST("advertising/del", account.ClockAdvertisingDel) // 删除广告
clockRoute.POST("advertising/change", account.ClockAdvertisingChange) // 启用停用广告
//门磁状态
clockRoute.POST("door/lock", account.ClockDoorLock) // 获取(上报)门锁状态
clockRoute.POST("door/listener", account.ClockDoorListener) // 设置门锁实时监听开关
//打卡记录
clockRoute.POST("log/list", account.ClockLogList) // 查看打卡记录列表
clockRoute.POST("log/info", account.ClockLogInfo) // 查看打卡记录详情
}
}

23
pkg/router/websocket.go Normal file
View File

@ -0,0 +1,23 @@
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
websocketController "github.com/fonchain_enterprise/fonchain-main/pkg/service/websocket/controller"
websocketServer "github.com/fonchain_enterprise/fonchain-main/pkg/service/websocket/server"
"github.com/gin-gonic/gin"
)
func websocketRoute(r *gin.RouterGroup) {
noAuth := r.Group("")
auth := r.Group("")
noAuth.GET("/ws/info", websocketServer.HandleWebSocket)
websocketServer.Register("similar-result", websocketController.SimilarResult)
auth.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
auth = auth.Group("socket")
{
auth.POST("login", websocketController.Login)
auth.POST("info", websocketController.Info)
}
}

22
pkg/router/workdaymeal.go Normal file
View File

@ -0,0 +1,22 @@
package router
import (
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/work_day_meal"
"github.com/gin-gonic/gin"
)
func workMealDayRoute(r *gin.RouterGroup) {
workDayMealRoute := r.Group("/api/workdaymeal")
workDayMealRoute.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider))
//需要登陆保护
{
workDayMealRoute.POST("now/nextWorkDay", work_day_meal.NowNextWorkDay) //获取当天下一个工作日
workDayMealRoute.POST("list", work_day_meal.MealList) //工作餐列表
workDayMealRoute.POST("user/detail", work_day_meal.UserWorkDayMeal) //用户某天的点餐记录
workDayMealRoute.POST("sure", work_day_meal.SureWorkDayMeal) //申请预约
workDayMealRoute.POST("cancel", work_day_meal.CancelWorkDayMeal) //取消预约
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,92 @@
/**
* @Author: sun
* @Company: 苏州天和汇工业
* @Description:
* @File: ocr_card_id
* @Version: 1.0.0
* @Date: 2024/10/17 13:25
*/
package account
import (
"bytes"
"dubbo.apache.org/dubbo-go/v3/common/logger"
"encoding/base64"
"github.com/fonchain_enterprise/fonchain-main/pkg/e"
"github.com/fonchain_enterprise/fonchain-main/pkg/model"
"github.com/fonchain_enterprise/fonchain-main/pkg/serializer"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/fonchain_enterprise/utils/baidu"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
"io"
"mime/multipart"
)
func OcrCardId(c *gin.Context) {
file, err := c.FormFile("file")
if err != nil {
logger.Errorf("Recevice File err: %v", err)
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Data: nil,
Msg: err.Error(),
Status: e.Failed,
})
return
}
f, err := file.Open()
if err != nil {
logger.Errorf("Open File err: %v", err)
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Data: nil,
Msg: err.Error(),
Status: e.Failed,
})
return
}
defer func(f multipart.File) {
err := f.Close()
if err != nil {
logger.Errorf("Close File err: %v", err)
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Data: nil,
Msg: err.Error(),
Status: e.Failed,
})
}
}(f)
// 读取文件内容到缓冲区
buf := new(bytes.Buffer)
if _, err := io.Copy(buf, f); err != nil {
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Data: nil,
Msg: e.ERROR_CARDID_OCR,
Status: e.Failed,
})
return
}
btBase64 := base64.StdEncoding.EncodeToString(buf.Bytes())
result, _err := baidu.OcrGetIdCard(btBase64, "front")
if _err != nil {
zap.L().Error("Ocr IDCard err:", zap.Error(_err))
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Data: nil,
Msg: e.ERROR_CARDID_OCR,
Status: e.Failed,
})
return
}
resp := &model.OcrCardIdResp{}
resp.Name = result.Name
resp.CardNo = result.IdCard
resp.Address = result.Path
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Data: resp,
Msg: "",
Status: e.SUCCESS,
})
return
}

View File

@ -0,0 +1,45 @@
package account
import (
"github.com/fonchain_enterprise/fonchain-main/api/account"
"github.com/fonchain_enterprise/fonchain-main/api/exam"
"github.com/fonchain_enterprise/fonchain-main/pkg/e"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/gin-gonic/gin"
)
func ShopRegisterOnlyTel(c *gin.Context, info *exam.UserInfo) (*account.RequestStatus, error) {
tempNick := info.Name
userByTelReq := account.UserByTelRequest{
Tel: info.TelNum,
Domain: e.Domain_Mall,
}
//查询是否有该账号
userByTelRes, err := service.AccountProvider.UserByTel(c, &userByTelReq)
if err != nil {
return nil, err
}
if userByTelRes.IsExist == true {
return &account.RequestStatus{ID: userByTelRes.Info.ID}, nil
}
//账号服务
registerRequest := account.RegistRequest{
NickName: info.Name,
TelNum: info.TelNum,
Password: tempNick + "fontree",
Extend: &account.Extend{},
Domain: e.Domain_Mall,
}
res, err := service.AccountProvider.Register(c, &registerRequest)
if err != nil {
return nil, err
}
return res, nil
}

129
pkg/service/account/site.go Normal file
View File

@ -0,0 +1,129 @@
package account
import (
"encoding/json"
"errors"
"fmt"
"github.com/fonchain_enterprise/fonchain-main/api/account"
"github.com/fonchain_enterprise/fonchain-main/pkg/common"
config2 "github.com/fonchain_enterprise/fonchain-main/pkg/config"
"github.com/fonchain_enterprise/fonchain-main/pkg/e"
"github.com/fonchain_enterprise/fonchain-main/pkg/model/request"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
"io/ioutil"
"net/http"
)
type BaiDuMapSt struct {
Status int `json:"status"`
Message string `json:"message"`
Result interface{} `json:"result"`
Address interface{} `json:"address"`
Content interface{} `json:"content"`
}
func SiteQuery(c *gin.Context) {
var req request.SiteLocationReq
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, e.InvalidParams, err)
return
}
//config2.BaiduMapAK
//https: //api.map.baidu.com/place/v2/suggestion?query=滨河路166号&region=苏州&city_limit=true&output=json&ak=3bAjKGA0pv7qvszGe98RsVZ04Ob5r4ZZ
httpClient := http.Client{}
resp, err2 := httpClient.Get("https://api.map.baidu.com/place/v2/suggestion?query=" + req.Query + "&region=" + req.Region + "&city_limit=false&output=json&ak=" + req.AK + "&ret_coordtype=" + req.RetCoordtype)
if err2 != nil {
service.Error(c, e.InvalidParams, err2)
return
}
defer resp.Body.Close()
// 读取响应体
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println("Error reading response body:", err)
service.Error(c, e.InvalidParams, err)
return
}
var info *BaiDuMapSt
err = json.Unmarshal(body, &info)
if err != nil {
fmt.Println("Error reading response body:", err)
service.Error(c, e.InvalidParams, err)
return
}
if info.Status != 0 && info.Message != "" {
fmt.Println("Error reading response body:", err)
service.Error(c, e.InvalidParams, errors.New(info.Message))
return
}
var infoMap = make(map[string]interface{})
infoMap["result"] = info.Result
service.Success(c, infoMap)
return
}
func LocationNowIp(c *gin.Context) {
//创建一个UserLoginService对象
var req account.InfoRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, e.InvalidParams, err)
return
}
nowIp := c.ClientIP()
if config2.AppMode == "debug" && common.IsPrivateIP(nowIp) == true {
nowIp = "114.218.158.24"
}
httpClient := http.Client{}
//nowIp = "114.218.158.24"
resp, err2 := httpClient.Get(fmt.Sprintf("https://api.map.baidu.com/location/ip?ip=%s&ak=3bAjKGA0pv7qvszGe98RsVZ04Ob5r4ZZ", nowIp))
if err2 != nil {
service.Error(c, e.InvalidParams, err2)
return
}
defer resp.Body.Close()
// 读取响应体
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println("Error reading response body:", err)
service.Error(c, e.InvalidParams, err)
return
}
var info *BaiDuMapSt
err = json.Unmarshal(body, &info)
if err != nil {
fmt.Println("Error reading response body:", err)
service.Error(c, e.InvalidParams, err)
return
}
if info.Status != 0 && info.Message != "" {
fmt.Println("Error reading response body:", err)
service.Error(c, e.InvalidParams, errors.New(info.Message))
return
}
var infoMap = make(map[string]interface{})
infoMap["content"] = info.Content
infoMap["address"] = info.Address
service.Success(c, infoMap)
return
}

File diff suppressed because it is too large Load Diff

50
pkg/service/address.go Normal file
View File

@ -0,0 +1,50 @@
package service
import (
"dubbo.apache.org/dubbo-go/v3/common/logger"
service "github.com/fonchain_enterprise/fonchain-main/api"
"github.com/fonchain_enterprise/fonchain-main/pkg/e"
"github.com/fonchain_enterprise/fonchain-main/pkg/serializer"
"github.com/fonchain_enterprise/fonchain-main/pkg/utils/plat"
"github.com/gin-gonic/gin"
"strings"
)
func LatLngToAddress(c *gin.Context) {
req := plat.LatLng{}
if err := c.ShouldBind(&req); err != nil {
logger.Errorf("LatLng ShouldBind err", err)
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Msg: err.Error(),
Status: e.Failed,
})
return
}
res, err := plat.ExchangeLatLngToAddress(req.Lat, req.Lng)
if err != nil {
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Msg: err.Error(),
Status: e.Ok,
})
return
}
var address []string
if res.Resp.RespCode == 0 || res.Resp.RespMsg == "ok" {
address = append(address, res.Data.Address)
if res.Data.Reference.LandmarkL1.Name != "" {
address = append(address, res.Data.Reference.LandmarkL1.Name)
}
if res.Data.Reference.LandmarkL2.Name != "" {
address = append(address, res.Data.Reference.LandmarkL2.Name)
}
}
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Data: strings.Join(address, ""),
Status: e.Ok,
})
}

View File

@ -0,0 +1,49 @@
package ai_images
import (
"fmt"
"github.com/fonchain_enterprise/fonchain-main/api/coin"
"github.com/fonchain_enterprise/fonchain-main/pkg/e"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
)
func CustomList(c *gin.Context) {
var req coin.CustomListRequest
fmt.Println("1--------1123-12-3")
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, e.InvalidParams, err)
return
}
res, err := service.CoinProvider.CustomList(c, &req)
if err != nil {
service.Error(c, e.Error, err)
return
}
service.Success(c, res)
return
}
func AcquireList(c *gin.Context) {
var req coin.AcquireListRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, e.InvalidParams, err)
return
}
res, err := service.CoinProvider.AcquireList(c, &req)
if err != nil {
service.Error(c, e.Error, err)
return
}
service.Success(c, res)
return
}

View File

@ -0,0 +1,131 @@
package ai_images
import (
"strconv"
"dubbo.apache.org/dubbo-go/v3/common/logger"
"github.com/fonchain_enterprise/fonchain-main/api/feedback"
"github.com/fonchain_enterprise/fonchain-main/pkg/e"
"github.com/fonchain_enterprise/fonchain-main/pkg/model/login"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
)
func Create(c *gin.Context) {
var req feedback.FeedbackRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, e.InvalidParams, err)
return
}
userInfo := login.GetUserInfoFromC(c)
logger.Info("-------------------------------")
logger.Info("userInfo:", userInfo)
// TODO 创建审批 防止重复提交
// lockKey := fmt.Sprintf("create_feedback_%v_%v", userInfo.ID, req.FeedbackType)
// reply := cache.RedisClient.SetNX(lockKey, 0, 3*time.Second)
// if !reply.Val() {
// service.Error(c, e.Error, nil, e.ErrorCreateFeedback)
// return
// }
//提交人
req.SubmitterName = userInfo.NickName
req.SubmitterID = userInfo.ID
res, err := service.FeedbackProvider.Create(c, &req)
if err != nil {
service.Error(c, e.Error, err)
return
}
service.Success(c, res)
}
func Remove(c *gin.Context) {
var req feedback.FeedbackDetail
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, e.InvalidParams, err)
return
}
res, err := service.FeedbackProvider.Remove(c, &req)
if err != nil {
service.Error(c, e.Error, err)
return
}
service.Success(c, res)
}
func Detail(c *gin.Context) {
var req feedback.FeedbackDetail
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, e.InvalidParams, err)
return
}
res, err := service.FeedbackProvider.Detail(c, &req)
if err != nil {
service.Error(c, e.Error, err)
return
}
service.Success(c, res)
}
func Update(c *gin.Context) {
var req feedback.FeedbackDetail
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, e.InvalidParams, err)
return
}
userInfo := login.GetUserInfoFromC(c)
logger.Info("-------------------------------")
logger.Info("userInfo:", userInfo)
// TODO 创建审批 防止重复提交
// lockKey := fmt.Sprintf("create_feedback_%v_%v", userInfo.ID, req.FeedbackType)
// reply := cache.RedisClient.SetNX(lockKey, 0, 3*time.Second)
// if !reply.Val() {
// service.Error(c, e.Error, nil, e.ErrorCreateFeedback)
// return
// }
//提交人
req.HandleName = userInfo.NickName
req.HandleID = strconv.FormatInt(int64(userInfo.ID), 10)
res, err := service.FeedbackProvider.Update(c, &req)
if err != nil {
service.Error(c, e.Error, err)
return
}
service.Success(c, res)
}
func List(c *gin.Context) {
var req feedback.FeedbackList
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, e.InvalidParams, err)
return
}
res, err := service.FeedbackProvider.List(c, &req)
if err != nil {
service.Error(c, e.Error, err)
return
}
service.Success(c, res)
}

View File

@ -0,0 +1,33 @@
package ai_images
import (
"github.com/fonchain_enterprise/fonchain-main/api/coin"
"github.com/fonchain_enterprise/fonchain-main/pkg/e"
"github.com/fonchain_enterprise/fonchain-main/pkg/serializer"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
)
func CoinAccounts(c *gin.Context) {
var req coin.CoinAccountsRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Msg: err.Error(),
Status: e.Failed,
})
return
}
req.Domain = "blockchain"
res, err := service.CoinProvider.CoinAccounts(c, &req)
if err != nil {
service.Error(c, e.Error, err)
return
}
service.Success(c, res)
return
}

59
pkg/service/aliyun/doc.go Normal file
View File

@ -0,0 +1,59 @@
package aliyun
import (
"encoding/json"
"fmt"
"github.com/alibabacloud-go/docmind-api-20220711/client"
aliyunSdk "github.com/fonchain_enterprise/fonchain-main/pkg/aliyun"
"github.com/fonchain_enterprise/fonchain-main/pkg/e"
"gopkg.in/errgo.v2/fmt/errors"
"path/filepath"
)
func DocStruct(fileUrl, fileName string) (docId string, err error) {
if fileName == "" {
fileName = filepath.Base(fileUrl)
}
request := client.SubmitDocStructureJobRequest{
FileUrl: &fileUrl,
FileName: &fileName,
}
response, err := aliyunSdk.DocClient.SubmitDocStructureJob(&request)
if err != nil {
err = errors.New(e.GetMsg(e.ERROR_ALIYUN_DOC_SUBMIT))
return
}
httpOk := response.StatusCode
if *httpOk != 200 {
err = errors.New(e.GetMsg(e.ERROR_ALIYUN_DOC_SUBMIT))
return
}
docId = *response.Body.Data.Id
fmt.Println(response.Body.Data.Id)
fmt.Println(docId)
return
}
func DocResult(docId string) (complete bool, texts []string, err error) {
// 调用查询接口
request := client.GetDocStructureResultRequest{Id: &docId}
response, err := aliyunSdk.DocClient.GetDocStructureResult(&request)
if err != nil {
err = errors.New(e.GetMsg(e.ERROR_ALIYUN_DOC_PARSE))
return
}
ok := response.Body.Completed
if *ok != true {
return
}
complete = true
var layoutsSlice []map[string]interface{}
layouts := response.Body.Data["layouts"]
layoutsBytes, _ := json.Marshal(layouts)
_ = json.Unmarshal(layoutsBytes, &layoutsSlice)
for _, v := range layoutsSlice {
texts = append(texts, fmt.Sprint(v["text"]))
}
return
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,576 @@
package approval
import (
"context"
"dubbo.apache.org/dubbo-go/v3/common/logger"
"errors"
"fmt"
"github.com/fonchain_enterprise/fonchain-main/api/approval"
artShow "github.com/fonchain_enterprise/fonchain-main/api/artShow"
"github.com/fonchain_enterprise/fonchain-main/api/artist"
"github.com/fonchain_enterprise/fonchain-main/api/artwork_third_party"
"github.com/fonchain_enterprise/fonchain-main/api/paybill"
"github.com/fonchain_enterprise/fonchain-main/pkg/e"
"github.com/fonchain_enterprise/fonchain-main/pkg/serializer"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
"google.golang.org/protobuf/types/known/wrapperspb"
"strconv"
"time"
)
// ExhibitionApproveEnter 画展包审批
func ExhibitionApproveEnter(beforeApproval, afterApproval *approval.CreateRequest) (err error) {
if beforeApproval.Status == e.ApprovalWorkStatusDoing && afterApproval.Status == e.ApprovalWorkStatusOk { // 审批通过 通知画展包 以及相关 微服务
logger.Errorf("================================================= %s 3======================================", "进入 画展包审批")
err = UpdateArtShowApply(afterApproval)
if err != nil {
return err
}
} else if beforeApproval.Status == e.ApprovalWorkStatusDoing && afterApproval.Status == e.ApprovalWorkStatusFail { // 审批驳回 通知画展包
err = CancelArtShowApply(afterApproval)
if err != nil {
return err
}
} else if beforeApproval.Status == e.ApprovalWorkStatusRevoking && afterApproval.Status == e.ApprovalWorkStatusFail { // 此审批 为 撤销状态 且 当前审批人 选择的审批状态为 驳回 则 驳回 此撤销审批
err = CancelRevokeArtShowApproval(afterApproval)
if err != nil {
return err
}
}
return nil
}
// ExhibitionRewordApproveEnter 画展包润格审批
func ExhibitionRewordApproveEnter(beforeApproval, afterApproval *approval.CreateRequest) (err error) {
if beforeApproval.Status == e.ApprovalWorkStatusDoing && afterApproval.Status == e.ApprovalWorkStatusOk { // 审批通过 通知画展包 以及相关 微服务
err = UpdateArtShowReward(afterApproval)
if err != nil {
return err
}
}
return nil
}
// ShowUpdateApproveEnter 画展包修改审批
func ShowUpdateApproveEnter(beforeApproval, afterApproval *approval.CreateRequest) (err error) {
if beforeApproval.Status == e.ApprovalWorkStatusDoing && afterApproval.Status == e.ApprovalWorkStatusOk { // 审批通过 通知画展包 以及相关 微服务
err = UpdateShowInfo(afterApproval)
if err != nil {
return err
}
}
return nil
}
// UpdateArtShowApply 画展包审批通过后 更新画展包信息
func UpdateArtShowApply(afterApproval *approval.CreateRequest) (err error) {
logger.Errorf("================================================= %s 4 ======================================", "进入 画展包审批")
fmt.Println("============================== 审批之后,查看审批详情 ==============================")
fmt.Printf("审批详情:%+v\n", afterApproval)
logger.Errorf("审批详情:%+v\n", afterApproval)
fmt.Println("============================== 审批之后,查看审批详情 ==============================")
fmt.Println()
// 获取 创建 show_rel 画展包关联表 的 信息 以及 画展包中 画家的经纪人 信息
now := time.Now()
dateStr := now.Format("2006-01-02 15:04:05")
showApplyReq := new(artShow.SaveApplyReq)
showApplyReq.Rel = make([]*artShow.ShowRel, 0)
showDetail := new(artShow.ShowDetailReq)
showDetail.ShowUID = make([]string, 0)
UpdateArtShowAgentList := make([]*artShow.ArtShowAgent, 0)
// 获取 画展包审批中 审批的信息
showApplyReq = &artShow.SaveApplyReq{
ApplyUID: afterApproval.Exhibition.ApplyID,
Applicant: afterApproval.SubmitterName,
ApplicantID: strconv.FormatUint(afterApproval.SubmitterID, 10),
Num: int32(len(afterApproval.Exhibition.ApprovalExhibitions)),
ApplyTime: dateStr,
Status: int32(afterApproval.Status),
}
for index, tt := range afterApproval.Exhibition.ApprovalExhibitions {
// 组装 show_rel 画展包关联表 数据
temp := &artShow.ShowRel{
ShowUID: tt.PackageID,
Index: int32(index + 1),
Address: tt.Address,
ShowTime: tt.ShowDate,
ApplyUID: afterApproval.Exhibition.ApplyID,
}
showApplyReq.Rel = append(showApplyReq.Rel, temp)
// 组装 画展包中 画家的经纪人 信息
UpdateArtShowAgentList = append(UpdateArtShowAgentList, &artShow.ArtShowAgent{
ShowUID: tt.PackageID,
Agent: tt.ArtExhibitionDetail.Agent,
})
showDetail.ShowUID = append(showDetail.ShowUID, tt.PackageID)
}
// 获取 画展包 详情
showDetailRes, err := service.GrpcArtShowImpl.ShowDetail(context.Background(), showDetail)
if err != nil {
return errors.New(e.ErrorQueryArtShowInfo)
}
// 获取 画展包中 画家 的 荣誉信息
showApplyReq.PricePolicy = make([]*artShow.PricePolicy, 0)
for i := 0; i < len(showDetailRes.Data); i++ {
if showDetailRes.Data[i].HasFormula == e.HasFormula {
policy := new(artShow.PricePolicy)
policy.ShowUID = showDetailRes.Data[i].ShowUID
policy.ArtistUID = showDetailRes.Data[i].ArtistUID
policy.ArtistName = showDetailRes.Data[i].ArtistName
policy.Factor = new(artShow.PricePolicyFactor)
honorCountReq := new(artist.HonorCountReq)
honorCountReq.ArtistUid = showDetailRes.Data[i].ArtistUID
honorCountResp, err := service.GrpcArtistImpl.HonorCount(context.Background(), honorCountReq)
if err != nil {
return errors.New(e.ErrorQueryHonorInfo)
}
policy.Factor.MeixieYears = float32(honorCountResp.CaaJoinYear)
policy.Factor.ExternalExhibitionCount = float32(honorCountResp.Exhibition)
policy.Factor.ArtistProfessionalismIndex = float32(honorCountResp.Professionalism)
policy.Factor.ArtistCollectibilityIndex = float32(honorCountResp.Collectible)
policy.Factor.ArtistExperienceEducationIndex = float32(honorCountResp.Education)
policy.Factor.ArtistInfluencePopularityIndex = float32(honorCountResp.Influence)
policy.Factor.StudyAbroadExperienceCount = float32(honorCountResp.StudyTourCount)
policy.Factor.AwardExperienceCount = float32(honorCountResp.AwardCount)
policy.Factor.NationalTitleCount = float32(honorCountResp.NationTitleCount)
policy.Factor.ProvincialTitleCount = float32(honorCountResp.ProvinceTitleCount)
policy.Factor.OtherTitleCount = float32(honorCountResp.OtherTitleCount)
policy.Factor.PublishedPaintingCount = float32(honorCountResp.ArtworkPublishCount)
policy.Factor.ExternalExhibitionCount = float32(honorCountResp.OutsidePublishCount)
policy.Factor.AcademicPublicationCount = float32(honorCountResp.AcademicPublishCount)
policy.Factor.ThirdPartyCuratorComment = float32(honorCountResp.ThirdCommentCount)
showApplyReq.PricePolicy = append(showApplyReq.PricePolicy, policy)
fmt.Println("================================= policy --------------------------------------")
fmt.Printf("policy %+v\n", policy)
fmt.Println("================================= policy --------------------------------------")
}
}
//使用邀请函中的数据更新出行信息
defer func() {
fmt.Println("passSynToArtShow---8")
var showUids []string
for _, v := range showDetailRes.Data {
showUids = append(showUids, v.ShowUID)
}
fmt.Println("EntertainmentSetDefaultValue start---showUids:", showUids)
if len(showUids) > 0 {
go func() {
err = EntertainmentSetDefaultValue(showUids...)
fmt.Println("EntertainmentSetDefaultValue end---err:", err)
if err != nil {
zap.L().Error("更新招待数据中的出行信息失败", zap.Error(err))
}
}()
}
}()
logger.Errorf("================================================= %s 5 ======================================", "进入 画展包审批")
fmt.Println("============================== 画展包审批 ,查看创建详情 ==============================")
logger.Errorf("============================== 画展包审批 ,查看创建详情 ==============================")
fmt.Printf("画展包审批 创建:%+v\n", showApplyReq)
logger.Errorf("画展包审批 创建 %+v\n", showApplyReq)
fmt.Printf("画展包审批 show_rel 创建:%+v\n", showApplyReq.Rel)
logger.Errorf("画展包审批 show_rel 创建:%+v\n", showApplyReq.Rel)
fmt.Printf("画展包审批 del show_rel 创建:%+v\n", showApplyReq.DelRel)
logger.Errorf("画展包审批 del show_rel 创建:%+v\n", showApplyReq.DelRel)
fmt.Printf("画展包审批 price_policy 创建:%+v\n", showApplyReq.PricePolicy)
logger.Errorf("画展包审批 price_policy 创建:%+v\n", showApplyReq.PricePolicy)
fmt.Println("============================== 画展包审批 ,查看创建详情 ==============================")
logger.Errorf("============================== 画展包审批 ,查看创建详情 ==============================")
fmt.Println()
// 更新 画展包审批信息
_, err = service.GrpcArtShowImpl.UpdateApply(context.Background(), showApplyReq)
if err != nil {
return err
}
logger.Errorf("================================================= %s 6 ======================================", "进入 画展包审批")
// 更新 画展包 经纪人
_, err = service.GrpcArtShowImpl.UpdateArtShowAgent(context.Background(), &artShow.UpdateArtShowAgentReq{Data: UpdateArtShowAgentList})
if err != nil {
return err
}
// 添加 画作销售站点
err = AddSaleAddress(afterApproval)
if err != nil {
return err
}
// 通过 rabbitmq 发送 到 画家系统 用于 确认 是否 参加画展
//artistUIDs := make([]string, 0)
//for i := 0; i < len(afterApproval.Exhibition.ApprovalExhibitions); i++ {
// artistUIDs = append(artistUIDs, afterApproval.Exhibition.ApprovalExhibitions[i].ArtExhibitionDetail.ArtistUID)
//}
//
//bt, err := json.Marshal(&artistUIDs)
//fmt.Println("========================== send =====================")
//fmt.Printf("send msg to mq : %+v", artistUIDs)
//fmt.Println("========================== send =====================")
//fmt.Println()
//mq.SendToArtShowPass(bt)
return nil
}
// UpdateArtShowReward 画展包润格审批通过后 更新画展包润格信息
func UpdateArtShowReward(afterApproval *approval.CreateRequest) (err error) {
var list []*artShow.ArtworkReward
var artWorks []*artwork_third_party.UpdateAwInfoReq_Info
for _, t := range afterApproval.Exhibition.ApprovalExhibitions {
for _, tt := range t.Artworks {
temp := &artShow.ArtworkReward{ArtworkPriceUid: tt.ArtworkPriceUID, Reward: tt.Reward}
list = append(list, temp)
distFloat, err := strconv.ParseFloat(tt.Reward, 32)
if err != nil {
distFloat = 0
}
arwTemp := &artwork_third_party.UpdateAwInfoReq_Info{ArtworkUuid: tt.ArtworkUID, PriceRun: wrapperspb.Float(float32(distFloat))}
artWorks = append(artWorks, arwTemp)
}
}
if len(list) <= 0 {
return nil
}
req := &artShow.UpdateArtworkRewardReq{Data: list}
fmt.Println("请求", req)
res, err := service.GrpcArtShowImpl.UpdateArtworkReward(context.Background(), req)
fmt.Println("请求后", res, err)
//通知画作
saleReq := &artwork_third_party.UpdateAwInfoReq{Data: artWorks}
fmt.Println("画作请求", saleReq)
saleRes, err := service.GrpcArtworkThirdPartyImpl.UpdateAwInfo(context.Background(), saleReq)
fmt.Println("画作请求后", saleRes, err)
return nil
}
// UpdateShowInfo 画展包修改审批通过后 更新画展包信息
func UpdateShowInfo(afterApproval *approval.CreateRequest) (err error) {
updateShowTimeAndAddress := new(artShow.UpdateShowTimeAndAddressReq)
updateShowTimeAndAddress.Data = make([]*artShow.ShowTimeAndAddress, 0)
payBillUpdateAddress := paybill.UpdateAddressreq{}
payBillUpdateAddress.Data = make([]*paybill.UpdateAddressreq_Info, 0)
for _, tt := range afterApproval.ExhibitionHis.ApprovalExhibitionHiss {
temp := &artShow.ShowTimeAndAddress{
ShowUid: tt.PackageID,
Address: tt.Address,
ShowTime: tt.ShowDate,
}
updateShowTimeAndAddress.Data = append(updateShowTimeAndAddress.Data, temp)
payBillUpdateAddress.Data = append(payBillUpdateAddress.Data, &paybill.UpdateAddressreq_Info{
ShowUid: tt.PackageID,
ShowDate: tt.ShowDate,
Address: tt.Address,
ApprovalId: strconv.FormatUint(afterApproval.ID, 10),
ShowName: tt.PackageName,
})
}
// 更新 画展包 信息
_, err = service.GrpcArtShowImpl.UpdateShowTimeAndAddress(context.Background(), updateShowTimeAndAddress)
if err != nil {
return err
}
// 更新 付款单地址
_, err = service.GrpcPayBillImpl.UpdateAddress(context.Background(), &payBillUpdateAddress)
if err != nil {
return err
}
// 修改 画作销售站点
err = UpdateSaleAddress(afterApproval)
if err != nil {
return err
}
return nil
}
// AddSaleAddress 添加画作销售站点
func AddSaleAddress(afterApproval *approval.CreateRequest) (err error) {
updateArtworkSaleAddress := new(artShow.UpdateArtworkSaleAddressReq)
updateArtworkSaleAddress.Data = make([]*artShow.ArtworkSaleAddress, 0)
updateSaleInfoReq := new(artwork_third_party.UpdateAwSaleInfoReq)
updateSaleInfoReq.Data = make([]*artwork_third_party.UpdateAwSaleInfoReq_Info, 0)
for i := 0; i < len(afterApproval.Exhibition.ApprovalExhibitions); i++ {
for j := 0; j < len(afterApproval.Exhibition.ApprovalExhibitions[i].Artworks); j++ {
updateArtworkSaleAddress.Data = append(updateArtworkSaleAddress.Data, &artShow.ArtworkSaleAddress{
ArtworkPriceUid: afterApproval.Exhibition.ApprovalExhibitions[i].Artworks[j].ArtworkPriceUID,
SaleAddress: afterApproval.Exhibition.ApprovalExhibitions[i].Artworks[j].SaleAddress,
})
artworkSaleInfo := &artwork_third_party.UpdateAwSaleInfoReq_Info{
ArtworkUuid: afterApproval.Exhibition.ApprovalExhibitions[i].Artworks[j].ArtworkUID,
SaleAddress: afterApproval.Exhibition.ApprovalExhibitions[i].Artworks[j].SaleAddress,
}
intNum, err := strconv.ParseInt(afterApproval.Exhibition.ApprovalExhibitions[i].Artworks[j].SaleAddressID, 10, 32)
if err != nil {
intNum = 0
}
artworkSaleInfo.SaleId = int32(intNum)
updateSaleInfoReq.Data = append(updateSaleInfoReq.Data, artworkSaleInfo)
}
}
// 更新 artwork_price 画作销售地址
if len(updateArtworkSaleAddress.Data) > 0 {
_, err = service.GrpcArtShowImpl.UpdateArtworkSaleAddress(context.Background(), updateArtworkSaleAddress)
if err != nil {
return errors.New(e.FailedUpdateArtworkPriceSaleAddress)
}
}
// 更新 artwork 画作销售地址
if len(updateSaleInfoReq.Data) > 0 {
_, err = service.GrpcArtworkThirdPartyImpl.UpdateAwSaleInfo(context.Background(), updateSaleInfoReq)
if err != nil {
return errors.New(e.FailedUpdateArtworkSaleAddress)
}
}
return err
}
// UpdateSaleAddress 更新画作销售站点
func UpdateSaleAddress(afterApproval *approval.CreateRequest) (err error) {
updateArtworkSaleAddress := new(artShow.UpdateArtworkSaleAddressReq)
updateArtworkSaleAddress.Data = make([]*artShow.ArtworkSaleAddress, 0)
updateSaleInfoReq := new(artwork_third_party.UpdateAwSaleInfoReq)
updateSaleInfoReq.Data = make([]*artwork_third_party.UpdateAwSaleInfoReq_Info, 0)
for i := 0; i < len(afterApproval.ExhibitionHis.ApprovalExhibitionHiss); i++ {
for j := 0; j < len(afterApproval.ExhibitionHis.ApprovalExhibitionHiss[i].Artworks); j++ {
updateArtworkSaleAddress.Data = append(updateArtworkSaleAddress.Data, &artShow.ArtworkSaleAddress{
ArtworkPriceUid: afterApproval.ExhibitionHis.ApprovalExhibitionHiss[i].Artworks[j].ArtworkPriceUID,
SaleAddress: afterApproval.ExhibitionHis.ApprovalExhibitionHiss[i].Artworks[j].SaleAddress,
})
artworkSaleInfo := &artwork_third_party.UpdateAwSaleInfoReq_Info{
ArtworkUuid: afterApproval.ExhibitionHis.ApprovalExhibitionHiss[i].Artworks[j].ArtworkUID,
SaleAddress: afterApproval.ExhibitionHis.ApprovalExhibitionHiss[i].Artworks[j].SaleAddress,
}
intNum, err := strconv.ParseInt(afterApproval.ExhibitionHis.ApprovalExhibitionHiss[i].Artworks[j].SaleAddressID, 10, 32)
if err != nil {
intNum = 0
}
artworkSaleInfo.SaleId = int32(intNum)
updateSaleInfoReq.Data = append(updateSaleInfoReq.Data, artworkSaleInfo)
}
}
// 更新 artwork_price 画作销售地址
if len(updateArtworkSaleAddress.Data) > 0 {
_, err = service.GrpcArtShowImpl.UpdateArtworkSaleAddress(context.Background(), updateArtworkSaleAddress)
if err != nil {
return errors.New(e.FailedUpdateArtworkPriceSaleAddress)
}
}
// 更新 artwork 画作销售地址
if len(updateSaleInfoReq.Data) > 0 {
_, err = service.GrpcArtworkThirdPartyImpl.UpdateAwSaleInfo(context.Background(), updateSaleInfoReq)
if err != nil {
return errors.New(e.FailedUpdateArtworkSaleAddress)
}
}
return err
}
// RevokeArtShowApproval 画展包审批撤销
func RevokeArtShowApproval(afterApproval *approval.CreateRequest) (err error) {
/*撤销画展包审批*/
revokeReq := new(artShow.RevokeReq)
revokeReq.ShowUid = make([]string, 0)
for i := 0; i < len(afterApproval.Exhibition.ApprovalExhibitions); i++ {
revokeReq.ShowUid = append(revokeReq.ShowUid, afterApproval.Exhibition.ApprovalExhibitions[i].PackageID)
}
revokeReq.ApplyUid = afterApproval.Exhibition.ApplyID
_, err = service.GrpcArtShowImpl.RevokeApply(context.Background(), revokeReq)
if err != nil {
return err
}
// 画作系统 更新 销售站点
// 传空值
updateSaleInfoReq := new(artwork_third_party.UpdateAwSaleInfoReq)
updateSaleInfoReq.Data = make([]*artwork_third_party.UpdateAwSaleInfoReq_Info, 0)
for i := 0; i < len(afterApproval.Exhibition.ApprovalExhibitions); i++ {
for j := 0; j < len(afterApproval.Exhibition.ApprovalExhibitions[i].Artworks); j++ {
artworkSaleInfo := &artwork_third_party.UpdateAwSaleInfoReq_Info{
ArtworkUuid: afterApproval.Exhibition.ApprovalExhibitions[i].Artworks[j].ArtworkUID,
SaleAddress: "",
SaleId: 0,
}
updateSaleInfoReq.Data = append(updateSaleInfoReq.Data, artworkSaleInfo)
}
}
if len(updateSaleInfoReq.Data) > 0 {
_, err = service.GrpcArtworkThirdPartyImpl.UpdateAwSaleInfo(context.Background(), updateSaleInfoReq)
if err != nil {
return errors.New(e.FailedUpdateArtworkSaleAddress)
}
}
return nil
}
// CancelRevokeArtShowApproval 驳回画展包审批撤销
func CancelRevokeArtShowApproval(afterApproval *approval.CreateRequest) (err error) {
/*驳回撤销画展包审批*/
revokeReq := new(artShow.RevokeReq)
revokeReq.ShowUid = make([]string, 0)
revokeReq.RevokeData = make([]*artShow.RevokeData, 0)
for i := 0; i < len(afterApproval.Exhibition.ApprovalExhibitions); i++ {
revokeReq.ShowUid = append(revokeReq.ShowUid, afterApproval.Exhibition.ApprovalExhibitions[i].PackageID)
for j := 0; j < len(afterApproval.Exhibition.ApprovalExhibitions[i].Artworks); j++ {
revokeReq.RevokeData = append(revokeReq.RevokeData, &artShow.RevokeData{
ArtworkPriceUid: afterApproval.Exhibition.ApprovalExhibitions[i].Artworks[j].ArtworkPriceUID,
SaleAddress: afterApproval.Exhibition.ApprovalExhibitions[i].Artworks[j].SaleAddress,
})
}
}
revokeReq.ApplyUid = afterApproval.Exhibition.ApplyID
_, err = service.GrpcArtShowImpl.OverruleRevoke(context.Background(), revokeReq)
if err != nil {
return err
}
// 画作系统 恢复 销售站点
updateSaleInfoReq := new(artwork_third_party.UpdateAwSaleInfoReq)
updateSaleInfoReq.Data = make([]*artwork_third_party.UpdateAwSaleInfoReq_Info, 0)
for i := 0; i < len(afterApproval.Exhibition.ApprovalExhibitions); i++ {
for j := 0; j < len(afterApproval.Exhibition.ApprovalExhibitions[i].Artworks); j++ {
artworkSaleInfo := &artwork_third_party.UpdateAwSaleInfoReq_Info{
ArtworkUuid: afterApproval.Exhibition.ApprovalExhibitions[i].Artworks[j].ArtworkUID,
SaleAddress: afterApproval.Exhibition.ApprovalExhibitions[i].Artworks[j].SaleAddress,
}
intNum, err := strconv.ParseInt(afterApproval.Exhibition.ApprovalExhibitions[i].Artworks[j].SaleAddressID, 10, 32)
if err != nil {
intNum = 0
}
artworkSaleInfo.SaleId = int32(intNum)
updateSaleInfoReq.Data = append(updateSaleInfoReq.Data, artworkSaleInfo)
}
}
if len(updateSaleInfoReq.Data) > 0 {
_, err = service.GrpcArtworkThirdPartyImpl.UpdateAwSaleInfo(context.Background(), updateSaleInfoReq)
if err != nil {
return errors.New(e.FailedUpdateArtworkSaleAddress)
}
}
return nil
}
// RevokeRewordApproval 画展包润格审批撤销
func RevokeRewordApproval(detail *approval.CreateRequest) (err error) {
//TODO
// 撤销画展包润格审批
return nil
}
// CancelArtShowApply 驳回画展包审批
func CancelArtShowApply(detail *approval.CreateRequest) error {
fmt.Println("取消画展包", detail)
if detail.Exhibition == nil {
return nil
}
if detail.Exhibition.ApplyID == "" {
return nil
}
delReq := artShow.DelApplyReq{ApplyUID: []string{detail.Exhibition.ApplyID}}
fmt.Println("取消画展包:req", delReq)
r, err := service.GrpcArtShowImpl.DelApply(context.Background(), &delReq)
fmt.Println("取消画展包:res", r, err)
return err
}
func ArtShowApprovalList(c *gin.Context) {
req := new(approval.ArtShowApprovalListReq)
if err := c.ShouldBind(req); err != nil {
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Msg: err.Error(),
Status: e.Failed,
})
return
}
if req.ShowUid == "" {
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Msg: e.ErrorShowUidIsEmpty,
Status: e.Failed,
})
return
}
res, err := service.ApprovalProvider.ListApprovalByShowUID(context.Background(), req)
if err != nil {
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Msg: err.Error(),
Status: e.Failed,
})
return
}
fmt.Println("============================== 画展包审批列表 ==============================")
fmt.Printf("画展包审批列表:%+v\n", res)
fmt.Println("============================== 画展包审批列表 ==============================")
fmt.Println()
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Data: res.Data,
Status: e.Ok,
})
}

View File

@ -0,0 +1,17 @@
package approval
import (
"context"
api "github.com/fonchain_enterprise/fonchain-main/api/approval"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
)
// QueryApprovalSetStatusBefore 查询 审批状态未更改之前的审批信息
func QueryApprovalSetStatusBefore(approvalID uint64) *api.CreateRequest {
detailReq := api.DetailRequest{ID: approvalID}
detail, err := service.ApprovalProvider.Detail(context.Background(), &detailReq)
if err != nil {
return nil
}
return detail
}

View File

@ -0,0 +1,26 @@
package approval
import (
"github.com/fonchain_enterprise/fonchain-main/api/approval"
"strconv"
)
// BuildBundlePayPriceBefore 构建画展包审批前价格
func BuildBundlePayPriceBefore(in *approval.CreateRequest) {
if in.BundlePayPrice == nil {
return
}
price, _ := strconv.Atoi(in.BundlePayPrice.ShowLowPrice)
if price == 0 {
return
}
if in.BundlePayPrice.ArtworkNum == 0 {
return
}
// TODO
//firstArtworkPrice, firstCopyrightPrice, secondArtworkPrice, secondCopyrightPrice := logic.CalcArtworkAndCopyrightPriceForPay(price,int(in.BundlePayPrice.ArtworkNum))
//in.BundlePayPrice. = firstArtworkPrice
}

View File

@ -0,0 +1,42 @@
package approval
import (
"context"
"errors"
"fmt"
"github.com/fonchain_enterprise/fonchain-main/api/approval"
"github.com/fonchain_enterprise/fonchain-main/api/site_sign_in"
"github.com/fonchain_enterprise/fonchain-main/pkg/e"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"strconv"
)
func passSendInfoToSiteSignIn(detail *approval.CheckIn) error {
siteSignInInfo := new(site_sign_in.SiteF)
siteSignInInfo.Name = detail.SaleAddress
siteSignInInfo.Address = detail.DetailAddress
if detail.Latitude != "" {
siteSignInInfo.Latitude, _ = strconv.ParseFloat(detail.Latitude, 64)
}
if detail.Longitude != "" {
siteSignInInfo.Longitude, _ = strconv.ParseFloat(detail.Longitude, 64)
}
fmt.Println("==================================== siteSignInInfo ====================================")
fmt.Printf("siteSignInInfo ======== %+v\n", siteSignInInfo)
fmt.Println("==================================== siteSignInInfo ====================================")
res, err := service.GrpcSiteSignInImpl.SaveSite(context.Background(), siteSignInInfo)
if err != nil {
return errors.New(e.ErrorSendInfoToSiteSignIn)
}
fmt.Println("==================================== SaveSite ====================================")
fmt.Println("res ======== ", res)
fmt.Println("==================================== SaveSite ====================================")
if res.Msg != "success" {
return errors.New(e.ErrorSendInfoToSiteSignIn)
}
return nil
}

View File

@ -0,0 +1,744 @@
package approval
import (
"context"
"dubbo.apache.org/dubbo-go/v3/common/logger"
"fmt"
"github.com/360EntSecGroup-Skylar/excelize"
approval "github.com/fonchain_enterprise/fonchain-main/api/approval"
"github.com/fonchain_enterprise/fonchain-main/pkg/common"
"github.com/fonchain_enterprise/fonchain-main/pkg/config"
"github.com/fonchain_enterprise/fonchain-main/pkg/model"
"github.com/fonchain_enterprise/fonchain-main/pkg/model/vo"
"github.com/fonchain_enterprise/fonchain-main/pkg/serializer"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/account"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/auth/department"
"github.com/fonchain_enterprise/fonchain-main/pkg/utils"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
"github.com/signintech/gopdf"
"os"
"strconv"
"strings"
"time"
api "github.com/fonchain_enterprise/fonchain-main/api/approval"
"github.com/fonchain_enterprise/fonchain-main/pkg/e"
"github.com/fonchain_enterprise/fonchain-main/pkg/model/login"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
)
func FinancialFormExport(c *gin.Context) {
var req api.DetailRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, e.Error, err)
return
}
userInfo := login.GetUserInfoFromC(c)
req.UserId = userInfo.ID
res, err := service.ApprovalProvider.Detail(c, &req)
if err != nil {
service.Error(c, e.Error, err)
return
}
if res.Status != e.ApprovalWorkStatusOk {
service.Error(c, e.Error, err, "审批未通过,无法导出")
return
}
if res.SubmitterID != userInfo.ID {
service.Error(c, e.Error, err, "当前用户非提交人,无法导出")
return
}
fmt.Println("approval", res.FinancialForm)
dirPath, err := financialForm(res)
if err != nil {
service.Error(c, e.Error, err)
return
}
var httpType string
if config.IsHttps {
httpType = model.HttpsType
} else {
httpType = model.HttpType
}
var exportUrl = strings.Replace(strings.Join([]string{strings.Replace(dirPath, ".", fmt.Sprintf("%s%s", httpType, c.Request.Host), 1)}, ""), "runtime", "static", 1)
service.ResponseQuickMsg(c, e.Ok, "导出成功", map[string]string{
"ExportUrl": exportUrl,
})
}
func financialForm(form *api.CreateRequest) (string, error) {
xlsx := excelize.NewFile()
// 付款申请单
financialFormSheet1(xlsx, form.FinancialForm)
// 付款明细
financialFormSheet2(xlsx, form.FinancialForm)
dirPath := "./runtime/form"
utils.CheckDirPath(dirPath, true)
path := dirPath + "/" + form.SubmitterName + strings.Replace(time.Now().Format("2006-01-02 15:04:05"), " ", "_", -1) + ".xlsx"
err := xlsx.SaveAs(path)
if err != nil {
fmt.Println("save rows err :", err)
return "", err
}
return path, nil
}
func financialFormSheet1(xlsx *excelize.File, form *api.FinancialForm) {
index := "Sheet1"
// 公司抬头
songTi18BoldStyle, _ := xlsx.NewStyle(`{"alignment":{"horizontal":"center","vertical":"center"},"font":{"bold":true,"size":18,"family":"宋体"}}`)
// 付款申请单
songTi14BoldStyle, _ := xlsx.NewStyle(`{"alignment":{"horizontal":"center","vertical":"center"},"font":{"bold":true,"size":14,"family":"宋体"}}`)
// 日期 当前日期 例2023-04-26 经办部门:
// 居中
//songTi10BoldCenterStyle, _ := xlsx.NewStyle(`{"alignment":{"horizontal":"center"},"font":{"bold":true,"size":10,"family":"宋体"}}`)
songTi10BoldCenterBorderStyle, _ := xlsx.NewStyle(`{"alignment":{"horizontal":"center","vertical":"center"},"font":{"bold":true,"size":10,"family":"宋体"},"border":[{"type":"top","color":"#000000","style":1},{"type":"left","color":"#000000","style":1},{"type":"right","color":"#000000","style":1},{"type":"bottom","color":"#000000","style":1}]}`)
// 左对齐
songTi10BoldLeftStyle, _ := xlsx.NewStyle(`{"alignment":{"horizontal":"left"},"font":{"bold":true,"size":10,"family":"宋体"}}`)
songTi10BoldLeftBorderStyle, _ := xlsx.NewStyle(`{"alignment":{"horizontal":"left"},"font":{"bold":true,"size":10,"family":"宋体"},"border":[{"type":"top","color":"#000000","style":1},{"type":"left","color":"#000000","style":1},{"type":"right","color":"#000000","style":1},{"type":"bottom","color":"#000000","style":1}]}`)
// 右对齐
songTi10BoldRightStyle, _ := xlsx.NewStyle(`{"alignment":{"horizontal":"right"},"font":{"bold":true,"size":10,"family":"宋体"}}`)
//songTi10BoldRightBorderStyle, _ := xlsx.NewStyle(`{"alignment":{"horizontal":"right"},"font":{"bold":true,"size":10,"family":"宋体"},{"border":[
// {"type":"top","color":"#000000","style":1},
// {"type":"left","color":"#000000","style":1},
// {"type":"right","color":"#000000","style":1},
// {"type":"bottom","color":"#000000","style":1}
//]}}`)
// 经办部门 的具体 部门
songTi10Style, _ := xlsx.NewStyle(`{"alignment":{"horizontal":"center"},"font":{"size":10,"family":"宋体"}}`)
xlsx.SetCellStyle(index, "A2", "H2", songTi18BoldStyle)
xlsx.MergeCell(index, "A2", "H2")
xlsx.SetCellValue(index, "A2", form.PaymentCompany)
xlsx.SetCellStyle(index, "A3", "H3", songTi14BoldStyle)
xlsx.MergeCell(index, "A3", "H3")
xlsx.SetCellValue(index, "A3", "付款申请单")
// 日期 自动获取 2023年4月26日
xlsx.SetCellStyle(index, "D4", "F4", songTi14BoldStyle)
xlsx.MergeCell(index, "D4", "F4")
xlsx.SetCellFormula(index, "D4", "=now()")
dateFormat, _ := xlsx.NewStyle(`{"alignment":{"horizontal":"center"},"font":{"bold":true,"size":10,"family":"宋体"},"number_format":31,"lang":"zh-cn"}`)
xlsx.SetCellStyle(index, "D4", "D4", dateFormat)
// 经办部门
xlsx.SetCellStyle(index, "G4", "G4", songTi10BoldRightStyle)
xlsx.SetCellValue(index, "G4", "经办部门:")
xlsx.SetCellStyle(index, "H4", "H4", songTi10Style)
xlsx.SetCellValue(index, "H4", form.TransactionDepartment)
// 收款人信息
xlsx.SetCellStyle(index, "A5", "A7", songTi10BoldCenterBorderStyle)
xlsx.MergeCell(index, "A5", "A7")
xlsx.SetCellValue(index, "A5", "收款人信息")
// 全称
xlsx.SetCellStyle(index, "B5", "B5", songTi10BoldLeftBorderStyle)
xlsx.SetCellValue(index, "B5", "全称")
xlsx.SetCellStyle(index, "C5", "G5", songTi10BoldLeftBorderStyle)
xlsx.MergeCell(index, "C5", "G5")
xlsx.SetCellValue(index, "C5", form.Payee)
xlsx.SetColWidth(index, "H", "H", 11) // 设置 列宽
xlsx.SetCellStyle(index, "H5", "H5", songTi10BoldCenterBorderStyle)
xlsx.SetCellValue(index, "H5", "总经办意见")
xlsx.MergeCell(index, "H6", "H7")
xlsx.SetCellStyle(index, "H6", "H7", songTi10BoldCenterBorderStyle)
// 开户银行
xlsx.SetCellStyle(index, "B6", "B6", songTi10BoldLeftBorderStyle)
xlsx.SetCellValue(index, "B6", "开户银行")
xlsx.SetCellStyle(index, "C6", "G6", songTi10BoldLeftBorderStyle)
xlsx.MergeCell(index, "C6", "G6")
xlsx.SetCellValue(index, "C6", form.BeneficiaryBank)
// 账号
xlsx.SetCellStyle(index, "B7", "B7", songTi10BoldLeftBorderStyle)
xlsx.SetCellValue(index, "B7", "账号")
xlsx.SetCellStyle(index, "C7", "G7", songTi10BoldLeftBorderStyle)
xlsx.MergeCell(index, "C7", "G7")
xlsx.SetCellValue(index, "C7", form.BankNo)
// 摘要 等
xlsx.SetCellStyle(index, "A8", "B8", songTi10BoldCenterBorderStyle)
xlsx.MergeCell(index, "A8", "B8")
xlsx.SetCellValue(index, "A8", "摘要")
xlsx.SetCellStyle(index, "C8", "C8", songTi10BoldCenterBorderStyle)
xlsx.SetCellValue(index, "C8", "所属部门")
xlsx.SetCellStyle(index, "D8", "D8", songTi10BoldCenterBorderStyle)
xlsx.SetCellValue(index, "D8", "数量")
xlsx.SetCellStyle(index, "E8", "E8", songTi10BoldCenterBorderStyle)
xlsx.SetCellValue(index, "E8", "单位")
xlsx.SetCellStyle(index, "F8", "F8", songTi10BoldCenterBorderStyle)
xlsx.SetCellValue(index, "F8", "单价")
xlsx.SetCellStyle(index, "G8", "G8", songTi10BoldCenterBorderStyle)
xlsx.SetCellValue(index, "G8", "金额")
xlsx.SetCellStyle(index, "H8", "H8", songTi10BoldCenterBorderStyle)
xlsx.SetCellValue(index, "H8", "董事长意见")
startRowIndex := 9
var countPrice float64
for i := 0; i < len(form.CostInfo); i++ {
xlsx.MergeCell(index, fmt.Sprintf("A%v", startRowIndex), fmt.Sprintf("B%v", startRowIndex))
xlsx.SetCellStyle(index, fmt.Sprintf("A%v", startRowIndex), fmt.Sprintf("B%v", startRowIndex), songTi10BoldCenterBorderStyle)
xlsx.SetCellValue(index, fmt.Sprintf("A%v", startRowIndex), form.CostInfo[i].Description)
xlsx.SetCellStyle(index, fmt.Sprintf("C%v", startRowIndex), fmt.Sprintf("G%v", startRowIndex), songTi10BoldCenterBorderStyle)
xlsx.SetSheetRow(index, fmt.Sprintf("C%v", startRowIndex), &[]interface{}{form.CostInfo[i].UsedDepartment, form.CostInfo[i].CostNum, form.CostInfo[i].CostUnit, form.CostInfo[i].UnitPrice, form.CostInfo[i].TotalPrice})
totalPrice, _ := strconv.ParseFloat(form.CostInfo[i].TotalPrice, 10)
countPrice = countPrice + totalPrice
startRowIndex++
}
// 合并 董事长意见 单元格
// 预留 两行
for i := 0; i < 3; i++ {
xlsx.MergeCell(index, fmt.Sprintf("A%v", startRowIndex), fmt.Sprintf("B%v", startRowIndex))
xlsx.SetCellStyle(index, fmt.Sprintf("A%v", startRowIndex), fmt.Sprintf("B%v", startRowIndex), songTi10BoldCenterBorderStyle)
xlsx.SetCellStyle(index, fmt.Sprintf("C%v", startRowIndex), fmt.Sprintf("G%v", startRowIndex), songTi10BoldCenterBorderStyle)
startRowIndex++
}
xlsx.MergeCell(index, "H9", fmt.Sprintf("H%v", startRowIndex-1))
xlsx.SetCellStyle(index, "H9", fmt.Sprintf("H%v", startRowIndex-1), songTi10BoldCenterBorderStyle)
// 付款方式
xlsx.SetCellStyle(index, fmt.Sprintf("A%v", startRowIndex), fmt.Sprintf("A%v", startRowIndex+1), songTi10BoldCenterBorderStyle)
xlsx.MergeCell(index, fmt.Sprintf("A%v", startRowIndex), fmt.Sprintf("A%v", startRowIndex+1))
xlsx.SetCellValue(index, fmt.Sprintf("A%v", startRowIndex), "付款方式")
// √ □
xlsx.SetCellStyle(index, fmt.Sprintf("B%v", startRowIndex), fmt.Sprintf("B%v", startRowIndex+1), songTi10BoldCenterBorderStyle)
xlsx.MergeCell(index, fmt.Sprintf("B%v", startRowIndex), fmt.Sprintf("B%v", startRowIndex+1))
rowValue1 := "银行转账"
rowValue2 := "现金"
rowValue3 := "其他"
if form.PaymentMethod == rowValue1 {
rowValue1 = "√" + rowValue1
rowValue2 = " □" + rowValue2
rowValue3 = " □" + rowValue3
} else if form.PaymentMethod == rowValue2 {
rowValue1 = "□" + rowValue1
rowValue2 = " √" + rowValue2
rowValue3 = " □" + rowValue3
} else if form.PaymentMethod == rowValue3 {
rowValue3 = " √" + rowValue3
rowValue2 = " □" + rowValue2
rowValue1 = "□" + rowValue1
}
xlsx.SetCellValue(index, fmt.Sprintf("B%v", startRowIndex), rowValue1+"\n"+rowValue2+"\n"+rowValue3)
// 合计小写
xlsx.SetCellStyle(index, fmt.Sprintf("C%v", startRowIndex), fmt.Sprintf("C%v", startRowIndex), songTi10BoldCenterBorderStyle)
xlsx.SetCellValue(index, fmt.Sprintf("C%v", startRowIndex), "合计小写")
xlsx.SetCellStyle(index, fmt.Sprintf("D%v", startRowIndex), fmt.Sprintf("H%v", startRowIndex), songTi10BoldLeftBorderStyle)
xlsx.MergeCell(index, fmt.Sprintf("D%v", startRowIndex), fmt.Sprintf("H%v", startRowIndex))
xlsx.SetCellValue(index, fmt.Sprintf("D%v", startRowIndex), countPrice)
// 合计大写
xlsx.SetCellStyle(index, fmt.Sprintf("C%v", startRowIndex+1), fmt.Sprintf("C%v", startRowIndex+1), songTi10BoldCenterBorderStyle)
xlsx.SetCellValue(index, fmt.Sprintf("C%v", startRowIndex+1), "合计大写")
xlsx.SetCellStyle(index, fmt.Sprintf("D%v", startRowIndex+1), fmt.Sprintf("H%v", startRowIndex+1), songTi10BoldLeftBorderStyle)
xlsx.MergeCell(index, fmt.Sprintf("D%v", startRowIndex+1), fmt.Sprintf("H%v", startRowIndex+1))
price, _ := utils.ConvertNumToCny(countPrice)
xlsx.SetCellValue(index, fmt.Sprintf("D%v", startRowIndex+1), price)
startRowIndex = startRowIndex + 3
xlsx.SetCellStyle(index, fmt.Sprintf("A%v", startRowIndex), fmt.Sprintf("A%v", startRowIndex), songTi10BoldLeftStyle)
xlsx.SetCellValue(index, fmt.Sprintf("A%v", startRowIndex), "总监:")
xlsx.SetCellStyle(index, fmt.Sprintf("C%v", startRowIndex), fmt.Sprintf("C%v", startRowIndex), songTi10BoldLeftStyle)
xlsx.SetCellValue(index, fmt.Sprintf("C%v", startRowIndex), "财务审核:")
xlsx.SetCellStyle(index, fmt.Sprintf("E%v", startRowIndex), fmt.Sprintf("E%v", startRowIndex), songTi10BoldLeftStyle)
xlsx.SetCellValue(index, fmt.Sprintf("E%v", startRowIndex), "部门负责人:")
xlsx.SetCellStyle(index, fmt.Sprintf("G%v", startRowIndex), fmt.Sprintf("G%v", startRowIndex), songTi10BoldLeftStyle)
xlsx.SetCellValue(index, fmt.Sprintf("G%v", startRowIndex), "申请人:")
startRowIndex = startRowIndex + 1
xlsx.SetCellStyle(index, fmt.Sprintf("A%v", startRowIndex), fmt.Sprintf("H%v", startRowIndex), songTi10BoldLeftStyle)
xlsx.MergeCell(index, fmt.Sprintf("A%v", startRowIndex), fmt.Sprintf("H%v", startRowIndex))
xlsx.SetCellValue(index, fmt.Sprintf("A%v", startRowIndex), "备注1、适用于预付款或款项未结清的情况")
startRowIndex = startRowIndex + 1
xlsx.SetCellStyle(index, fmt.Sprintf("A%v", startRowIndex), fmt.Sprintf("H%v", startRowIndex), songTi10BoldLeftStyle)
xlsx.MergeCell(index, fmt.Sprintf("A%v", startRowIndex), fmt.Sprintf("H%v", startRowIndex))
xlsx.SetCellValue(index, fmt.Sprintf("A%v", startRowIndex), " 2、明细内容按实际情况可增加删减")
}
func financialFormSheet2(xlsx *excelize.File, form *api.FinancialForm) {
xlsx.NewSheet("Sheet2")
index := "Sheet2"
dengXian11BoldBorderStyle, _ := xlsx.NewStyle(`{"alignment":{"horizontal":"center"},"font":{"bold":false,"size":11,"family":"等线"},"border":[{"type":"top","color":"#000000","style":1},{"type":"left","color":"#000000","style":1},{"type":"right","color":"#000000","style":1},{"type":"bottom","color":"#000000","style":1}]}`)
dengXian11BoldStyle, _ := xlsx.NewStyle(`{"alignment":{"horizontal":"center"},"font":{"bold":false,"size":11,"family":"等线"}}`)
xlsx.SetCellStyle(index, "A1", "L1", dengXian11BoldBorderStyle)
xlsx.SetSheetRow(index, "A1", &[]string{"序号", "付款或报销月份", "发票日期", "发票号码(电子发票需提供)", "发票供应商名称", "发票或付款金额", "费用用途", "申请人", "付款方式", "付款或报销对象", "发票类型", "备注"})
rowIndex := 2
var countPrice float64
if len(form.InvoiceInfo) < 1 {
return
}
for i := 0; i < len(form.InvoiceInfo); i++ {
rowIndex = rowIndex + i
xlsx.SetCellStyle(index, fmt.Sprintf("A%v", rowIndex), fmt.Sprintf("L%v", rowIndex), dengXian11BoldBorderStyle)
xlsx.SetCellInt(index, fmt.Sprintf("A%v", rowIndex), i+1)
xlsx.SetSheetRow(index, fmt.Sprintf("B%v", rowIndex), &[]interface{}{form.InvoiceInfo[i].InvoiceDate, form.InvoiceInfo[i].InvoiceDate, form.InvoiceInfo[i].InvoiceNo, form.InvoiceInfo[i].InvoiceProvider, form.InvoiceInfo[i].Amount, form.InvoiceInfo[i].UseTo, form.InvoiceInfo[i].Applicant, form.InvoiceInfo[i].PaymentMethod, form.InvoiceInfo[i].PaymentObj, form.InvoiceInfo[i].InvoiceType, form.InvoiceInfo[i].Notes})
totalPrice, _ := strconv.ParseFloat(form.InvoiceInfo[i].Amount, 10)
countPrice = countPrice + totalPrice
}
rowIndex = rowIndex + 1
xlsx.SetCellStyle(index, fmt.Sprintf("A%v", rowIndex), fmt.Sprintf("L%v", rowIndex), dengXian11BoldBorderStyle)
rowIndex = rowIndex + 1
xlsx.SetCellStyle(index, fmt.Sprintf("A%v", rowIndex), fmt.Sprintf("L%v", rowIndex), dengXian11BoldBorderStyle)
rowIndex = rowIndex + 1
xlsx.SetCellStyle(index, fmt.Sprintf("A%v", rowIndex), fmt.Sprintf("L%v", rowIndex), dengXian11BoldBorderStyle)
rowIndex = rowIndex + 1
xlsx.SetCellStyle(index, fmt.Sprintf("E%v", rowIndex), fmt.Sprintf("E%v", rowIndex), dengXian11BoldStyle)
xlsx.SetCellValue(index, fmt.Sprintf("E%v", rowIndex), "合计")
xlsx.SetCellStyle(index, fmt.Sprintf("F%v", rowIndex), fmt.Sprintf("F%v", rowIndex), dengXian11BoldStyle)
xlsx.SetCellValue(index, fmt.Sprintf("F%v", rowIndex), countPrice)
}
// 采购以及付款申请 导出 (全部)
func ExportApproval(c *gin.Context) {
var req api.ListRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, e.Error, err)
return
}
if req.OrderBy == "" {
req.OrderBy = "desc"
}
list, err := service.ApprovalProvider.MySubmit(context.Background(), &req)
if err != nil {
service.Error(c, e.Error, err)
return
}
if list.Data == nil || len(list.Data) == 0 {
service.ResponseQuickMsg(c, e.Ok, "暂无数据可导出", nil)
return
}
// 文件的路径 压缩包的名字
now := strconv.FormatInt(time.Now().Unix(), 10)
dirPath := "./runtime/approval_export"
utils.CheckDirPath(dirPath, true)
zipPathName := now + ".zip"
zipPath := fmt.Sprintf("./runtime/")
utils.CheckDirPath(zipPath, true)
// 组装数据
for i := 0; i < len(list.Data); i++ {
fmt.Println("=============================== 打印 审批内容 ==================================")
fmt.Printf("approval content %+v\n", list.Data[i])
fmt.Println("=============================== 打印 审批内容 ==================================")
err = exportPDF(list.Data[i], dirPath)
if err != nil {
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Msg: e.ErrWritePDF,
Status: e.Failed,
})
return
}
}
if err := utils.ZipFile(dirPath, zipPath+zipPathName); err != nil {
logger.Errorf("CompressByFiles err", err)
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Msg: e.ErrorZip,
Status: e.Failed,
})
return
}
if err = os.RemoveAll(dirPath); err != nil {
logger.Errorf("RemoveAll err", err)
}
var httpType string
if config.IsHttps {
httpType = model.HttpsType
} else {
httpType = model.HttpType
}
var exportUrl = strings.Replace(strings.Join([]string{strings.Replace(zipPath, ".", fmt.Sprintf("%s%s", httpType, c.Request.Host), 1), zipPathName}, ""), "runtime", "static", 1)
service.ResponseQuickMsg(c, e.Ok, "导出成功", map[string]string{
"ExportUrl": exportUrl,
})
}
// 写入 pdf 并保存成文件 添加到 文件夹中
// 审批 通过的 logo https://cdns.fontree.cn/fonchain-main/prod/image/139/avatar/b28c5a8b-c8a5-402e-9e5b-311bb42b2537.png
// 审批 不通过的 logo https://cdns.fontree.cn/fonchain-main/prod/image/139/avatar/741862fd-81b3-4987-883e-e1de69259baa.png
func exportPDF(detail *approval.CreateRequest, dirPath string) error {
pdf := gopdf.GoPdf{}
pdf.Start(gopdf.Config{PageSize: *gopdf.PageSizeA4})
pdf.AddPage()
defer pdf.Close()
// 设置文本和字体
addTTFFontErr := pdf.AddTTFFont("simfang", "./data/simfang.ttf")
if addTTFFontErr != nil {
fmt.Println("========================================= setFont ==========================================")
fmt.Printf("%+v\n", addTTFFontErr)
fmt.Println("========================================= setFont ==========================================")
return addTTFFontErr
}
setFontErr := pdf.SetFont("simfang", "", 16)
if setFontErr != nil {
fmt.Println("========================================= setFont ==========================================")
fmt.Printf("%+v\n", setFontErr)
fmt.Println("========================================= setFont ==========================================")
return setFontErr
}
accountInfo, err := account.GetUserInfoById(new(gin.Context), detail.SubmitterID, "")
if err != nil {
return err
}
submitterInfo := vo.SubmitterInfo{
Name: accountInfo.NickName,
DepartmentName: accountInfo.DepartmentName,
TelNum: accountInfo.TelNum,
}
printerInfo := vo.PrinterInfo{
Name: submitterInfo.Name,
TelNum: submitterInfo.TelNum,
}
var userIds []uint64
var copyUsers []string
var approvalUsers []string
var content []vo.ContentInfo
for _, tt := range detail.CopyUsers {
userIds = append(userIds, tt.ID)
}
for _, tt := range detail.WorkFlows {
userIds = append(userIds, tt.ID)
}
fmt.Println("1----查看", userIds)
departmentUserMap, err := department.GetDepartmentUsersMap(new(gin.Context), userIds)
fmt.Println("2----查看", departmentUserMap)
if err != nil {
return err
}
detailReq := api.TypeResponse{
Keyword: detail.Type,
}
detailRes, err := service.ApprovalProvider.DetailType(new(gin.Context), &detailReq)
if err != nil {
return err
}
fmt.Println("2----查看", detail)
for i, tt := range detail.CopyUsers {
if _, ok := departmentUserMap[tt.ID]; ok {
temp := fmt.Sprintf("第%s抄送人: %s %s", common.TransferNum(i+1), departmentUserMap[tt.ID], tt.Name)
copyUsers = append(copyUsers, temp)
} else {
temp := fmt.Sprintf("第%s抄送人: %s", common.TransferNum(i+1), tt.Name)
copyUsers = append(copyUsers, temp)
}
}
//fmt.Println(res.WorkFlows)
//fmt.Println(departmentUserMap)
for i, tt := range detail.WorkFlows {
passString := "审批中"
greetString := ""
if tt.Status == e.ApprovalWorkStatusOk {
passString = "通过"
greetString = "同意"
} else if tt.Status == e.ApprovalWorkStatusFail {
passString = "未通过"
greetString = "不同意"
}
if _, ok := departmentUserMap[tt.UserID]; ok {
temp := fmt.Sprintf("第%s审批人: %s %s %s %s %s", common.TransferNum(i+1), departmentUserMap[tt.ID], tt.Name, passString, tt.OperatedAt, greetString)
approvalUsers = append(approvalUsers, temp)
} else {
temp := fmt.Sprintf("第%s审批人: %s %s %s %s", common.TransferNum(i+1), tt.Name, passString, tt.OperatedAt, greetString)
approvalUsers = append(approvalUsers, temp)
}
}
switch detail.Type {
case e.TypeContent: //
temp := vo.ContentInfo{
Info: detail.Content,
Type: "string",
Title: "内容",
}
content = append(content, temp)
case e.TypeShow:
temp := vo.ContentInfo{
Info: detail.Content,
Type: "string",
Title: "具体内容",
}
content = append(content, temp)
case e.TypeWork:
if detail.Work != nil {
temp := vo.ContentInfo{
Info: detail.Work.ReceivedAt,
Type: "string",
Title: "领取时间",
}
content = append(content, temp)
title := ""
for _, t := range detail.Work.ApprovalWorks {
title = title + " " + t.ArtworkName
}
content = append(content, vo.ContentInfo{
Info: title,
Type: "string",
Title: "申请内容",
})
}
temp1 := vo.ContentInfo{
Info: detail.Content,
Type: "string",
Title: "具体内容",
}
content = append(content, temp1)
case e.TypeBundle:
if detail.Bundle != nil {
temp := vo.ContentInfo{
Info: detail.Bundle.ApplicationsNum,
Type: "num",
Title: "申请数量",
}
content = append(content, temp)
content = append(content, vo.ContentInfo{
Info: detail.Bundle.ReceivedAt,
Type: "string",
Title: "领取时间",
})
}
temp1 := vo.ContentInfo{
Info: detail.Content,
Type: "string",
Title: "具体内容",
}
content = append(content, temp1)
case e.TypeExhibition:
if detail.Exhibition != nil {
for i, t := range detail.Exhibition.ApprovalExhibitions {
content = append(content, vo.ContentInfo{
Info: t.PackageName,
Type: "string",
Title: "名称" + fmt.Sprintf("%d", i+1),
})
content = append(content, vo.ContentInfo{
Info: t.ShowDate,
Type: "string",
Title: "画展时间",
})
content = append(content, vo.ContentInfo{
Info: t.Address,
Type: "string",
Title: "画展地址",
})
}
content = append(content, vo.ContentInfo{
Info: detail.Bundle.ReceivedAt,
Type: "string",
Title: "领取时间",
})
}
temp1 := vo.ContentInfo{
Info: detail.Content,
Type: "string",
Title: "具体内容",
}
content = append(content, temp1)
default: //其它json
for _, tt := range detail.CustomizeInfo {
temp := vo.ContentInfo{
Info: tt.ApprovalValue,
Type: tt.ApprovalType,
Title: tt.ApprovalName,
}
content = append(content, temp)
}
}
approvalInfo := vo.ApprovalPrintInfo{
Status: detail.Status,
ApprovalNum: common.GenerateCode(detail.ID),
CreatedAt: detail.CreatedAt,
TypeString: detailRes.Title,
SubmitterInfo: submitterInfo,
PrinterInfo: printerInfo,
CopyUsers: copyUsers,
ApprovalUsers: approvalUsers,
ContentMap: content,
}
if detail.Status == model.ApprovalWorkStatusOk {
pdf.Image("./data/print-success.png",
480,
70, &gopdf.Rect{
W: 195 / 2,
H: 170 / 2,
})
} else if detail.Status == model.ApprovalWorkStatusOk {
pdf.Image("./data/print-no.png",
480,
70, &gopdf.Rect{
W: 195 / 2,
H: 170 / 2,
})
}
fmt.Println("==================================== approvalInfos ===================================================")
fmt.Printf("approvalInfos is %+v\n", approvalInfo)
fmt.Println("==================================== approvalInfos ===================================================")
var space float64 = 10
var rangeSpace float64 = 10
// 固定 大标题
pdf.SetXY(200, rangeSpace)
pdf.Cell(nil, "泰丰文化审批单-"+approvalInfo.TypeString)
rangeSpace = rangeSpace + space + 70
// 审核编号 及 日期
rangeSpace = rangeSpace + space
pdf.SetXY(0, rangeSpace)
pdf.Cell(nil, fmt.Sprintf("审核编号: %s 审核日期: %s", approvalInfo.ApprovalNum, approvalInfo.CreatedAt))
rangeSpace = rangeSpace + space
// 小标题
rangeSpace = rangeSpace + space
pdf.SetXY(0, rangeSpace)
pdf.Cell(nil, approvalInfo.TypeString)
rangeSpace = rangeSpace + space
for i := 0; i < len(approvalInfo.ContentMap); i++ {
rangeSpace = rangeSpace + space
pdf.SetXY(0, rangeSpace)
pdf.Cell(nil, fmt.Sprintf("%s:%s", approvalInfo.ContentMap[i].Title, approvalInfo.ContentMap[i].Info))
rangeSpace = rangeSpace + space
}
// 审核人
for i := 0; i < len(approvalInfo.ApprovalUsers); i++ {
rangeSpace = rangeSpace + space
pdf.SetXY(0, rangeSpace)
pdf.Cell(nil, fmt.Sprintf("%s", approvalInfo.ApprovalUsers[i]))
rangeSpace = rangeSpace + space
}
// 抄送人
for i := 0; i < len(approvalInfo.CopyUsers); i++ {
rangeSpace = rangeSpace + space
pdf.SetXY(0, rangeSpace)
pdf.Cell(nil, fmt.Sprintf("%s", approvalInfo.CopyUsers[i]))
rangeSpace = rangeSpace + space
}
rangeSpace = rangeSpace + space
pdf.SetXY(200, rangeSpace)
pdf.Cell(nil, fmt.Sprintf("打印日期:%s 打印人:%s", time.Now().Format("2006-01-02 15:04:05"), approvalInfo.SubmitterInfo.Name))
// 输出PDF
filePath := fmt.Sprintf(dirPath + "/" + approvalInfo.SubmitterInfo.Name + "_" + approvalInfo.TypeString + "_" + strconv.FormatInt(time.Now().Unix(), 10) + ".pdf")
err = pdf.WritePdf(filePath)
if err != nil {
fmt.Println("======================================================================== WritePdf ==========================================")
fmt.Printf("err is %+v\n", err)
fmt.Println("======================================================================== WritePdf ==========================================")
return err
}
return nil
}

View File

@ -0,0 +1,145 @@
package approval
import (
"context"
"dubbo.apache.org/dubbo-go/v3/common/logger"
"fmt"
api "github.com/fonchain_enterprise/fonchain-main/api/approval"
"github.com/fonchain_enterprise/fonchain-main/pkg/e"
"github.com/fonchain_enterprise/fonchain-main/pkg/serializer"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/gin-gonic/gin"
"strings"
)
// PassCreateJob 通过 创建 招聘信息
func PassCreateJob(c *gin.Context, id uint64) error {
detailReq := api.DetailRequest{ID: id}
detail, err := service.ApprovalProvider.Detail(c, &detailReq)
if err != nil {
fmt.Println("查询失败", err)
return nil
}
if detail.Status != e.ApprovalWorkStatusOk {
return nil
}
// 人员增补申请
if strings.Contains(detail.Type, TypeStaffSupply) {
job := &api.Job{
ApprovalID: detail.ID,
PositionName: detail.StaffSupply.PositionName,
Num: int64(detail.StaffSupply.Num),
JobAsk: detail.StaffSupply.JobAsk,
JoinInTime: detail.StaffSupply.JoinInTime,
Poster: detail.SubmitterName,
DepartmentName: detail.StaffSupply.DepartmentName,
}
_, err = service.ApprovalProvider.CreateJob(context.Background(), job)
if err != nil {
return err
}
}
return nil
}
func JobList(c *gin.Context) {
var commonReq api.CommonRequest
if err := c.ShouldBind(&commonReq); err != nil {
logger.Errorf("JobList ShouldBind err", err)
service.ResponseMsg(c, e.InvalidParams, serializer.Response{
Msg: err.Error(),
Status: e.Failed,
})
return
}
jobList, err := service.ApprovalProvider.JobList(context.Background(), &commonReq)
if err != nil {
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Msg: err.Error(),
Status: e.Failed,
})
return
}
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Data: jobList,
Status: e.Ok,
})
}
func CloseJob(c *gin.Context) {
var commonReq api.UpdateJobStatusRequest
if err := c.ShouldBind(&commonReq); err != nil {
logger.Errorf("JobList ShouldBind err", err)
service.ResponseMsg(c, e.InvalidParams, serializer.Response{
Msg: err.Error(),
Status: e.Failed,
})
return
}
_, err := service.ApprovalProvider.CloseJob(context.Background(), &commonReq)
if err != nil {
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Msg: err.Error(),
Status: e.Failed,
})
return
}
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Status: e.Ok,
})
}
func CreateInterviewer(c *gin.Context) {
var commonReq api.SaveInterviewerInfo
if err := c.ShouldBind(&commonReq); err != nil {
logger.Errorf("JobList ShouldBind err", err)
service.ResponseMsg(c, e.InvalidParams, serializer.Response{
Msg: err.Error(),
Status: e.Failed,
})
return
}
_, err := service.ApprovalProvider.CreateInterviewer(context.Background(), &commonReq)
if err != nil {
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Msg: err.Error(),
Status: e.Failed,
})
return
}
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Status: e.Ok,
})
}
func UpdateInterviewer(c *gin.Context) {
var commonReq api.SaveInterviewerInfo
if err := c.ShouldBind(&commonReq); err != nil {
logger.Errorf("JobList ShouldBind err", err)
service.ResponseMsg(c, e.InvalidParams, serializer.Response{
Msg: err.Error(),
Status: e.Failed,
})
return
}
_, err := service.ApprovalProvider.UpdateInterviewer(context.Background(), &commonReq)
if err != nil {
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Msg: err.Error(),
Status: e.Failed,
})
return
}
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Status: e.Ok,
})
}

View File

@ -0,0 +1,85 @@
package approval
import (
"github.com/fonchain_enterprise/fonchain-main/api/approval"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/approval/model"
)
// OA 相关审批 需要 判断 days
func MakeRetApprovalUser(req *approval.CreateRequest, approvalUsers []*approval.ApprovalUser) (retApprovalUsers []*approval.ApprovalUser) {
if approvalUsers == nil && len(approvalUsers) < 1 {
return nil
}
if model.GetOaType(req.Type) != "" {
if req.Type == "outWork" ||
req.Type == "funeralLeave" ||
req.Type == "paternityLeave" ||
req.Type == "maritalLeave" ||
req.Type == "parentalLeave" ||
req.Type == "nursingLeave" ||
req.Type == "matingCheckLeave" ||
req.Type == "annualLeave" ||
req.Type == "businessTrip" ||
req.Type == "sick" ||
req.Type == "leave" ||
req.Type == "maternityLeave" ||
req.Type == "abortLeave" ||
req.Type == "goOut" {
var days float32
if req.ApprovalOA.Leave != nil {
days = req.ApprovalOA.Leave.Days
}
if req.ApprovalOA.BusinessTrip != nil {
days = req.ApprovalOA.BusinessTrip.TotalDays
}
if req.ApprovalOA.GoOut != nil {
days = req.ApprovalOA.GoOut.Hours / 8
}
if req.ApprovalOA.OutWork != nil {
days = req.ApprovalOA.OutWork.Hours / 8
}
//出纳特殊处理
if req.Domain == "8fa1d8936af32f97aae832a3224bc93d" {
if days <= 1 {
// 获取审批人 的 全部直属 和 剔除 指定岗位的 最后2位
// 获取审批人第一级
retApprovalUser := approvalUsers[0]
retApprovalUser.Level = 1
retApprovalUsers = append(retApprovalUsers, retApprovalUser)
retApprovalUsers = append(retApprovalUsers, approvalUsers[1:len(approvalUsers)-2]...)
} else if days > 1 && days <= 3 {
// 获取审批人 的 全部直属 和 剔除 指定岗位的 最后一位
retApprovalUsers = append(retApprovalUsers, approvalUsers[:len(approvalUsers)-1]...)
} else if days > 3 {
// 获取审批人 全部
retApprovalUsers = approvalUsers
}
} else {
if days <= 1 {
// 获取审批人第一级
retApprovalUser := approvalUsers[0]
retApprovalUser.Level = 1
retApprovalUsers = append(retApprovalUsers, retApprovalUser)
} else if days > 1 && days <= 3 {
// 获取审批人 的 全部直属 和 剔除 指定岗位的 最后一位
retApprovalUsers = append(retApprovalUsers, approvalUsers[:len(approvalUsers)-1]...)
} else if days > 3 {
// 获取审批人 全部
retApprovalUsers = approvalUsers
}
}
return retApprovalUsers
}
}
return approvalUsers
}
func DeleteApprovalUser(userId uint64, approvalUsers []*approval.ApprovalUser) (retApprovalUsers []*approval.ApprovalUser) {
retApprovalUsers = make([]*approval.ApprovalUser, 0)
for i := 0; i < len(approvalUsers); i++ {
if approvalUsers[i].ID != userId {
retApprovalUsers = append(retApprovalUsers, approvalUsers[i])
}
}
return
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,919 @@
package approval
import (
"context"
"dubbo.apache.org/dubbo-go/v3/common/logger"
"errors"
"fmt"
approvalApi "github.com/fonchain_enterprise/fonchain-main/api/approval"
oaApi "github.com/fonchain_enterprise/fonchain-main/api/oa"
"github.com/fonchain_enterprise/fonchain-main/pkg/e"
"github.com/fonchain_enterprise/fonchain-main/pkg/model/login"
"github.com/fonchain_enterprise/fonchain-main/pkg/model/oa_model"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/oa_new/common"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/oa_new/model"
"github.com/fonchain_enterprise/fonchain-main/pkg/service/oa_new/oa_logic"
"github.com/fonchain_enterprise/fonchain-main/pkg/utils/holiday"
"github.com/jinzhu/copier"
"strconv"
"strings"
"time"
)
func SyncApprovalToOA(req *approvalApi.CreateRequest) (saveRes *oaApi.CommonRes, err error) {
// 赋值 给 oa系统中的 oa 审批
oaApply := retOaApply(req, true, false, false)
//oaApply.ApprovalID = strconv.FormatUint(approvalID, 10)
//oaApply.StaffUID = strconv.FormatUint(req.SubmitterID, 10)
//oaApply.StaffName = req.SubmitterName
// 保存 oa 审批内容
saveRes, err = service.GrpcOAImpl.SaveOaApply(context.Background(), oaApply)
fmt.Println("保存 oa 审批 UUID 到 审批 开始")
fmt.Println("oa apply uuid is :", saveRes.ID)
fmt.Println("保存 oa 审批 UUID 到 审批 结束")
return
}
// 更新--通过或者拒绝
func UpdateApprovalStatusToOAStatus(req *approvalApi.CreateRequest) (updateRes *oaApi.CommonRes, err error) {
// 赋值 给 oa系统中的 oa 审批
oaApply := retOaApply(req, false, true, false)
// 保存 oa 审批内容
updateRes, err = service.GrpcOAImpl.UpdateOaApply(context.Background(), oaApply)
err = UpdateSlackBalance(req)
if err != nil {
fmt.Printf("更新假勤余额失败---%v", err)
}
return
}
// 撤销
func RevokeOaApproval(req *approvalApi.CreateRequest) (updateRes *oaApi.CommonRes, err error) {
// 赋值 给 oa系统中的 oa 审批
oaApply := retOaApply(req, false, false, true)
// 保存 oa 审批内容
updateRes, err = service.GrpcOAImpl.UpdateOaApply(context.Background(), oaApply)
err = UpdateSlackBalance(req)
if err != nil {
fmt.Printf("更新假勤余额失败---%v", err)
}
return
}
// 删除
func DeleteApproval(req *approvalApi.CreateRequest) (updateRes *oaApi.CommonRes, err error) {
// 赋值 给 oa系统中的 oa 审批
oaApply := retOaApply(req, false, false, false)
// 保存 oa 审批内容
updateRes, err = service.GrpcOAImpl.DeleteOaApply(context.Background(), oaApply)
req.Status = e.ApprovalWorkStatusRevokeOk
err = UpdateSlackBalance(req)
if err != nil {
fmt.Printf("更新假勤余额失败---%v", err)
}
return
}
func UpdateSlackBalance(req *approvalApi.CreateRequest) error {
// ty := 1 //增加假期天数 ty = 2 // 减少假期天数
fmt.Printf("更新假勤余额请求参数---%v", req.ApprovalOA.Leave)
switch req.Type {
case oa_model.TypeAnnualLeave, oa_model.TypeParentalLeave, oa_model.TypeNursingLeave:
fmt.Printf("这里是额度余额变动---:%v", req.Type)
if req.Status == e.ApprovalWorkStatusRevokeOk || req.Status == e.ApprovalWorkStatusFail { //撤销或者拒绝才会减去假勤余额
return modifyLeaveBalance(req, req.Type, 1)
} else {
return nil
}
case oa_model.TypeParentalLeaveApply, oa_model.TypeNursingLeaveApply:
fmt.Printf("这里是额度申请---:%v", req.Type)
if req.Status == e.ApprovalWorkStatusOk { //只有审批通过才会添加假勤余额
return updateFalseAttendanceStatus(req, req.Type, 2)
} else {
return nil
}
default:
return nil
}
}
func modifyLeaveBalance(req *approvalApi.CreateRequest, leaveType string, ty int) error {
date, _ := time.Parse("2006-01-02 15:04:05", req.ApprovalOA.Leave.ActionTime)
year := int32(date.Year())
_, err := service.GrpcOAImpl.ModifyTheLeaveBalance(context.Background(), &oaApi.ModifyTheLeaveBalanceReq{
StaffUid: req.SubmitterID,
LeaveType: leaveType,
Movement: int32(ty),
Year: year,
Days: req.ApprovalOA.Leave.Days,
})
if err != nil {
fmt.Printf("更新假勤余额失败---%v", err)
}
return err
}
func updateFalseAttendanceStatus(req *approvalApi.CreateRequest, leaveType string, ty int) error {
date, _ := time.Parse("2006-01-02 15:04:05", req.ApprovalOA.LeaveApply.ActionTime)
year := int32(date.Year())
_, err := service.GrpcOAImpl.UpdateFalseAttendanceStatus(context.Background(), &oaApi.UpdateFalseAttendanceStatusReq{
StaffUid: req.SubmitterID,
LeaveType: leaveType,
Year: year,
Days: req.ApprovalOA.LeaveApply.LeaveBalance,
Status: int32(ty),
})
if err != nil {
fmt.Printf("更新假勤余额失败---%v", err)
}
return err
}
func retOaApply(req *approvalApi.CreateRequest, save, updateStatus, revoke bool) (oaApply *oaApi.OAApply) {
oaApply = new(oaApi.OAApply)
fmt.Println("============== 打印 approval 审批内容 ========== 开始 =========")
fmt.Printf("CreateRequest info is : %+v \n", req)
fmt.Println("============== 打印 approval 审批内容 ========== 结束 =========")
// 通过 copier 赋值 可行
if req.ApprovalOA.MakeUp != nil {
copier.CopyWithOption(&oaApply, req.ApprovalOA.MakeUp, copier.Option{DeepCopy: true})
copier.CopyWithOption(&oaApply.ApplyTimes, req.ApprovalOA.MakeUp.ApplyTimes, copier.Option{DeepCopy: true})
copier.CopyWithOption(&oaApply.ApprovalUsers, req.ApprovalOA.MakeUp.ApprovalUsers, copier.Option{DeepCopy: true})
copier.CopyWithOption(&oaApply.CopyUsers, req.ApprovalOA.MakeUp.CopyUsers, copier.Option{DeepCopy: true})
}
if req.ApprovalOA.OutWork != nil {
copier.CopyWithOption(&oaApply, req.ApprovalOA.OutWork, copier.Option{DeepCopy: true})
copier.CopyWithOption(&oaApply.ApplyTimes, req.ApprovalOA.OutWork.ApplyTimes, copier.Option{DeepCopy: true})
copier.CopyWithOption(&oaApply.ApprovalUsers, req.ApprovalOA.OutWork.ApprovalUsers, copier.Option{DeepCopy: true})
copier.CopyWithOption(&oaApply.CopyUsers, req.ApprovalOA.OutWork.CopyUsers, copier.Option{DeepCopy: true})
}
if req.ApprovalOA.LeaveApply != nil {
copier.CopyWithOption(&oaApply, req.ApprovalOA.LeaveApply, copier.Option{DeepCopy: true})
copier.CopyWithOption(&oaApply.ApprovalUsers, req.ApprovalOA.LeaveApply.ApprovalUsers, copier.Option{DeepCopy: true})
copier.CopyWithOption(&oaApply.CopyUsers, req.ApprovalOA.LeaveApply.CopyUsers, copier.Option{DeepCopy: true})
}
if req.ApprovalOA.Turnover != nil {
copier.CopyWithOption(&oaApply, req.ApprovalOA.Turnover, copier.Option{DeepCopy: true})
//copier.CopyWithOption(&oaApply.ApplyTimes, req.ApprovalOA.Turnover.ApplyTimes, copier.Option{DeepCopy: true})
copier.CopyWithOption(&oaApply.ApprovalUsers, req.ApprovalOA.Turnover.ApprovalUsers, copier.Option{DeepCopy: true})
copier.CopyWithOption(&oaApply.CopyUsers, req.ApprovalOA.Turnover.CopyUsers, copier.Option{DeepCopy: true})
//copier.CopyWithOption(&oaApply.Positions, req.ApprovalOA.Turnover.Positions, copier.Option{DeepCopy: true})
}
if req.ApprovalOA.OverTime != nil {
copier.CopyWithOption(&oaApply, req.ApprovalOA.OverTime, copier.Option{DeepCopy: true})
copier.CopyWithOption(&oaApply.ApplyTimes, req.ApprovalOA.OverTime.ApplyTimes, copier.Option{DeepCopy: true})
copier.CopyWithOption(&oaApply.ApprovalUsers, req.ApprovalOA.OverTime.ApprovalUsers, copier.Option{DeepCopy: true})
copier.CopyWithOption(&oaApply.CopyUsers, req.ApprovalOA.OverTime.CopyUsers, copier.Option{DeepCopy: true})
}
if req.ApprovalOA.Leave != nil {
copier.CopyWithOption(&oaApply, req.ApprovalOA.Leave, copier.Option{DeepCopy: true})
copier.CopyWithOption(&oaApply.ApplyTimes, req.ApprovalOA.Leave.ApplyTimes, copier.Option{DeepCopy: true})
copier.CopyWithOption(&oaApply.ApprovalUsers, req.ApprovalOA.Leave.ApprovalUsers, copier.Option{DeepCopy: true})
copier.CopyWithOption(&oaApply.CopyUsers, req.ApprovalOA.Leave.CopyUsers, copier.Option{DeepCopy: true})
}
if req.ApprovalOA.BusinessTrip != nil {
copier.CopyWithOption(&oaApply, req.ApprovalOA.BusinessTrip, copier.Option{DeepCopy: true})
copier.CopyWithOption(&oaApply.ApprovalUsers, req.ApprovalOA.BusinessTrip.ApprovalUsers, copier.Option{DeepCopy: true})
copier.CopyWithOption(&oaApply.CopyUsers, req.ApprovalOA.BusinessTrip.CopyUsers, copier.Option{DeepCopy: true})
}
if req.ApprovalOA.GoOut != nil {
copier.CopyWithOption(&oaApply, req.ApprovalOA.GoOut, copier.Option{DeepCopy: true})
copier.CopyWithOption(&oaApply.ApprovalUsers, req.ApprovalOA.GoOut.ApprovalUsers, copier.Option{DeepCopy: true})
copier.CopyWithOption(&oaApply.CopyUsers, req.ApprovalOA.GoOut.CopyUsers, copier.Option{DeepCopy: true})
}
oaApply.Remark = req.Reply
oaApply.ApplyType = req.Type
oaApply.ApprovalID = strconv.FormatUint(req.ID, 10)
oaApply.NowLevel = req.NowLevel
oaApply.NowUserId = req.NowUserId
oaApply.NowUserName = req.NowUserName
oaApply.RevokeReason = req.ApprovalOA.RevokeReason
oaApply.Domain = req.Domain
// 保存
oaApply.Status = int32(req.Status)
if save {
for i := 0; i < len(oaApply.ApprovalUsers); i++ {
oaApply.ApprovalUsers[i].Status = req.Status
}
}
// 更新 状态
if updateStatus {
for i := 0; i < len(oaApply.ApprovalUsers); i++ {
for j := 0; j < len(req.WorkFlows); j++ {
if oaApply.ApprovalUsers[i].ID == req.WorkFlows[j].UserID {
oaApply.ApprovalUsers[i].Status = req.WorkFlows[j].Status
oaApply.ApprovalUsers[i].Reply = req.WorkFlows[j].Reply
oaApply.ApprovalUsers[i].Tips = req.WorkFlows[j].Tips
}
}
}
}
if revoke {
fmt.Println("============== 打印 OA approvalUser ========== 开始 =========")
fmt.Printf("approvalUser is : %+v \n", oaApply.ApprovalUsers)
fmt.Println("============== 打印 OA approvalUser ========== 结束 =========")
//newApprovalUsers := make([]*oaApi.ApplyUser, 0)
for i := 0; i < len(oaApply.ApprovalUsers); i++ {
//newApprovalUsers = append(newApprovalUsers, &oaApi.ApplyUser{
// ID: req.ApprovalUsers[i].ID,
// Name: req.ApprovalUsers[i].Name,
// Status: e.ApprovalWorkStatusDoing,
//})
oaApply.ApprovalUsers[i].Status = e.ApprovalWorkStatusDoing
}
//oaApply.ApprovalUsers = newApprovalUsers
}
fmt.Println("============== 打印 OA 审批内容 ========== 开始 =========")
fmt.Printf("oa_apply info is : %+v \n", oaApply)
fmt.Println("============== 打印 OA 审批内容 ========== 结束 =========")
return oaApply
}
// 旧的 补卡规则
func CheckMakeUpApplyApprovalV1(req *approvalApi.CreateRequest) (err error) {
oaSettingReq := new(oaApi.OaSettingReq)
oaSettingReq.Keyword = e.MakeUpNum
oaSettingRes, err := service.GrpcOAImpl.QueryOaSetting(context.Background(), oaSettingReq)
if err != nil {
return err
}
if len(oaSettingRes.Data) != 1 {
return errors.New("查询OA补卡次数设置错误")
}
queryOaApplyReq := new(oaApi.ApplyRecordReq)
queryOaApplyReq.StaffUID = req.SubmitterID
queryOaApplyReq.ApplyType = []string{req.Type}
// 当前月 的 月初 和 月底
queryOaApplyReq.BeginTime = time.Now().Format("2006-01") + "-01" + " 00:00:00"
queryOaApplyReq.EndTime = time.Now().AddDate(0, 1, -1).Format("2006-01-02") + " 23:59:59"
queryOaApplyReq.ApplyStatus = []int32{e.ApprovalWorkStatusDoing, e.ApprovalWorkStatusOk}
queryOaApplyRes, err := service.GrpcOAImpl.QueryOaApply(context.Background(), queryOaApplyReq)
if err != nil {
return err
}
if oaSettingRes.Data[0].Value.Num > int32(queryOaApplyRes.Total) {
return nil
}
return errors.New("当月补卡次数已用完")
}
// 新的补卡规则
func CheckMakeUpApplyApproval(req *approvalApi.CreateRequest, userInfo login.Info) (err error) {
// 查询 考勤信息
workingTime, workingTimeErr := oa_logic.QueryWorkingTimeInUse(userInfo.PositionUsers, userInfo.ID)
if workingTimeErr != nil {
return workingTimeErr
}
logger.Infof("workingTime: %+v", workingTime)
fmt.Printf("workingTime: %+v", workingTime)
makeUpRule := new(oaApi.MakeUp)
for i := 0; i < len(workingTime.OaRules); i++ {
if workingTime.OaRules[i].Keyword == model.MakeUpRule && workingTime.OaRules[i].MakeUpRule != nil {
makeUpRule = workingTime.OaRules[i].MakeUpRule
}
}
if makeUpRule.Num == 0 {
return errors.New(e.ErrMissMakeUpRule)
}
// 获取当前考勤周期
//month := common.CurrentMonth()
// 根据补卡的时间 确定 考勤的周期
month := common.CheckAttendanceMonth(req.ApprovalOA.MakeUp.ApplyTimes[0].Date)
month = common.Add25ForMonth(month)
dates := holiday.SplitMonthV1(month, common.YYMMDD)
var queryMakeUpDates []string
// 暂时 使用 当前周期的 日期
queryMakeUpDates = append(queryMakeUpDates, dates...)
// 查询 oa审批
oaApplys, oaApplyErr := oa_logic.QueryOaApplyDates(userInfo.ID, queryMakeUpDates, []int32{e.ApprovalWorkStatusDoing, e.ApprovalWorkStatusOk}, []string{oa_model.TypeMakeUp})
if oaApplyErr != nil {
return oaApplyErr
}
if makeUpRule.Num > int64(len(oaApplys)) {
return nil
}
return errors.New("当月补卡次数已用完")
}
// 新的加班规则
func CheckOverTimeApplyApproval(req *approvalApi.CreateRequest, userInfo login.Info) (err error) {
// 查询 考勤信息
workingTime, workingTimeErr := oa_logic.QueryWorkingTimeInUse(userInfo.PositionUsers, userInfo.ID)
if workingTimeErr != nil {
return workingTimeErr
}
logger.Infof("workingTime: %+v", workingTime)
fmt.Printf("workingTime: %+v", workingTime)
overtimeRule := new(oaApi.Overtime)
for i := 0; i < len(workingTime.OaRules); i++ {
if workingTime.OaRules[i].Keyword == model.OvertimeRule && workingTime.OaRules[i].OvertimeRule != nil {
overtimeRule = workingTime.OaRules[i].OvertimeRule
}
}
// 获取当前考勤周期
month := common.CurrentMonth()
currentMonth := common.Add25ForMonth(month)
dates := holiday.SplitMonthV1(currentMonth, common.YYMMDD)
// 添加 上个考勤周期
if dates[0] == common.CurrentDateStr() {
addDate := common.PreDate().Format(common.YYMMDD)
if !common.IsInArray(addDate, dates) {
dates = append([]string{addDate}, dates...)
}
}
dateMap := make(map[string]string)
for i := 0; i < len(dates); i++ {
dateMap[dates[i]] = dates[i]
}
fmt.Println("========= CheckOverTimeApplyApproval SplitMonthV1 currentMonth ========================= ")
fmt.Printf("=== %+v\n", dates)
fmt.Println("========= CheckOverTimeApplyApproval SplitMonthV1 currentMonth ========================= ")
if overtimeRule.TimeLimit == model.TimeLimitMonth {
if dateMap[req.ApprovalOA.OverTime.ApplyTimes[0].Date] == "" && dateMap[req.ApprovalOA.OverTime.ApplyTimes[1].Date] == "" {
return errors.New("加班时间不在本次考勤周期内")
}
}
if overtimeRule.TimeLimit == model.TimeLimitYesterday {
if common.ConvertApplyTimeToTime(req.ApprovalOA.OverTime.ApplyTimes[0].Date, req.ApprovalOA.OverTime.ApplyTimes[0].Hour).Before(common.PreDateFour()) {
return errors.New("加班开始时间不得早于昨天凌晨4点")
}
}
return nil
}
func CheckLeaveApproval(req *approvalApi.CreateRequest, userInfo login.Info) (err error) {
if len(req.ApprovalOA.Leave.ApplyTimes) != 2 {
return errors.New(e.ErrApplyTime)
}
use, forMoney, canDayOffErr := oa_logic.QueryCanDayOffUserWithWorkTimeTemplate(userInfo)
if canDayOffErr != nil {
return canDayOffErr
}
checkLeaveReq := new(oa_model.CheckLeave)
checkLeaveReq.ApplyType = req.Type
checkLeaveReq.StartTime = req.ApprovalOA.Leave.ApplyTimes[0].Date
checkLeaveReq.M = req.ApprovalOA.Leave.ApplyTimes[0].M
checkLeaveReq.Children = req.ApprovalOA.Leave.Children
checkLeaveReq.Month = req.ApprovalOA.Leave.Month
checkLeaveReq.Dystocia = req.ApprovalOA.Leave.Dystocia
res, err := service.CheckLeaveHandle(checkLeaveReq, userInfo, forMoney)
if err != nil {
return err
}
fmt.Println("========= checkLeaveReq 1 ========================= ")
fmt.Printf("=== %+v\n", checkLeaveReq)
fmt.Println("========= checkLeaveReq 2 ========================= ")
fmt.Println("========= CheckLeaveHandle 1 ========================= ")
fmt.Printf("=== %+v\n", res)
fmt.Println("========= CheckLeaveHandle 2 ========================= ")
if res.OtherLeave.EndTime != "" {
req.ApprovalOA.Leave.ApplyTimes[1].Date = res.OtherLeave.EndTime
req.ApprovalOA.Leave.ApplyTimes[1].M = res.OtherLeave.EndM
if req.Type == oa_model.TypeMatingCheckLeave {
req.ApprovalOA.Leave.Days = 1 // 孕检假 默认是一次一天
}
}
if req.Type == oa_model.TypeAnnualLeave || req.Type == oa_model.TypeParentalLeave || req.Type == oa_model.TypeNursingLeave {
if strings.Split(req.ApprovalOA.Leave.ApplyTimes[0].Date, "-")[0] != time.Now().Format("2006") || strings.Split(req.ApprovalOA.Leave.ApplyTimes[1].Date, "-")[0] != time.Now().Format("2006") {
return errors.New(e.ErrNotInCurrentYear)
}
}
if req.Type == oa_model.TypeNursingLeave || req.Type == oa_model.TypeParentalLeave || req.Type == oa_model.TypeMatingCheckLeave {
if req.ApprovalOA.Leave.Days > res.CommonLeave.Balance {
return errors.New(e.ErrNoBalance)
}
}
//年假新处理
if req.Type == oa_model.TypeAnnualLeave {
date := req.ApprovalOA.Leave.ApplyTimes[0].Date
year, err1 := strconv.ParseInt(date[0:4], 10, 32)
if err1 != nil {
return err1
}
balanceList, err2 := service.GrpcOAImpl.GetLeaveBalanceList(context.Background(), &oaApi.LeaveBalanceListReq{
Page: 1,
PageSize: 10,
StaffUID: userInfo.ID,
Year: int32(year),
})
if err2 != nil {
return err2
}
fmt.Println("===========================新假期余额=======================================")
fmt.Println(year)
fmt.Println(balanceList)
if len(balanceList.Data) < 1 {
return errors.New("未查到假期余额")
}
if req.ApprovalOA.Leave.Days > balanceList.Data[0].AnnualLeave {
return errors.New(e.ErrNoBalance)
}
}
if req.Type == oa_model.TypeBreastFeedingLeave {
if req.ApprovalOA.Leave.Hours > res.CommonLeave.Balance {
return errors.New(e.ErrHourNoBalance)
}
}
if req.Type == oa_model.TypeDayOff {
//调休时间限制上月的26号到本月的25号
fmt.Println("====================================上月的26号到本月的25号=====================================================")
fmt.Println(isDateInRange(req.ApprovalOA.Leave.ApplyTimes[0].Date))
fmt.Println(isDateInRange(req.ApprovalOA.Leave.ApplyTimes[1].Date))
if !isDateInRange(req.ApprovalOA.Leave.ApplyTimes[0].Date) {
return errors.New(e.ErrNotInCurrentMonth)
}
if !isDateInRange(req.ApprovalOA.Leave.ApplyTimes[1].Date) {
return errors.New(e.ErrNotInCurrentMonth)
}
//if strings.Join(strings.Split(req.ApprovalOA.Leave.ApplyTimes[0].Date, "-")[:2], "-") != time.Now().Format("2006-01") || strings.Join(strings.Split(req.ApprovalOA.Leave.ApplyTimes[1].Date, "-")[:2], "-") != time.Now().Format("2006-01") {
// return errors.New(e.ErrNotInCurrentMonth)
//}
// 特殊设置的用户 可以无加班调休
users, userErr := QueryCanDayOffUser()
if userErr != nil {
return userErr
}
if forMoney {
if req.ApprovalOA.Leave.Hours > res.CommonLeave.Balance {
if users[req.SubmitterName] == req.SubmitterID || !use {
return nil
} else {
return errors.New(e.ErrNoBalance)
}
}
} else {
balance, CheckDayOffBalanceErr := service.CheckDayOffBalance(userInfo.ID)
if CheckDayOffBalanceErr != nil {
return CheckDayOffBalanceErr
}
if req.ApprovalOA.Leave.Hours > balance {
return errors.New(e.ErrNoBalance)
}
}
}
if req.ApprovalOA.Leave.Days <= 0 && req.ApprovalOA.Leave.Hours <= 0 {
return errors.New(e.ErrNoBalance)
}
return nil
}
func CheckOutWorkTime(req *approvalApi.CreateRequest) (err error) {
outWorkStartTime, _ := time.ParseInLocation("2006-01-02 15:04:05", req.ApprovalOA.OutWork.ApplyTimes[0].Date+" 00:00:00", time.Local)
nowTime, _ := time.ParseInLocation("2006-01-02 15:04:05", time.Now().Format("2006-01-02")+" 00:00:00", time.Local)
if !outWorkStartTime.Before(nowTime) {
return nil
}
return errors.New("当前外勤申请时间无效")
}
func CheckLeaveApprovalV1(req *approvalApi.CreateRequest) (err error) {
leaveApplyRecordReq := new(oaApi.LeaveApplyInfoReq)
leaveApplyRecordReq.StaffUID = req.SubmitterID
leaveApplyRecordReq.LeaveApplyType = e.CheckLeaveApplyMap[req.Type]
leaveApplyRecordReq.IsOver = e.IsNotOver
leaveApplyRecordRes, err := service.GrpcOAImpl.QueryLeaveApplyInfo(context.Background(), leaveApplyRecordReq)
if err != nil {
fmt.Println("=========== approval_oa QueryLeaveApplyInfo ====== start =====")
fmt.Println(err.Error())
fmt.Println("=========== approval_oa QueryLeaveApplyInfo ====== end =====")
return errors.New("未查询到相关假期余额申请")
}
if req.ApprovalOA.Leave.Days > leaveApplyRecordRes.LeaveApply.LeaveBalance {
return errors.New("假期余额不足")
}
return nil
}
func CheckLeaveApply(req *approvalApi.CreateRequest, userInfo login.Info) (err error) {
//leaveApplyRecordReq := new(oaApi.LeaveApplyInfoReq)
//leaveApplyRecordReq.StaffUID = req.SubmitterID
//leaveApplyRecordReq.LeaveApplyType = req.Type
//leaveApplyRecordReq.IsOver = e.IsNotOver
//leaveApplyRecordReq.UsefulTime = time.Now().Format("2006")
//leaveApplyRecordRes, err := service.GrpcOAImpl.QueryLeaveApplyInfo(context.Background(), leaveApplyRecordReq)
//if err != nil && err.Error() != e.ErrNotHaveBalance {
// fmt.Println("=========== approval_oa QueryLeaveApplyInfo ====== start =====")
// fmt.Println(err.Error())
// fmt.Println("=========== approval_oa QueryLeaveApplyInfo ====== end =====")
// //return errors.New("未查询到相关假期余额申请")
// return errors.New(e.ErrNotHaveBalance)
//}
//
//if leaveApplyRecordRes.LeaveApply != nil {
// return errors.New(e.ErrHaveBalanceApply)
//}
reqList := &approvalApi.ListRequest{}
reqList.Domain = req.Domain
reqList.Type = req.Type
reqList.UserID = userInfo.ID
reqList.Status = 1
res1, err := service.ApprovalProvider.MySubmit(context.Background(), reqList)
if err != nil {
return errors.New(e.ErrNotHaveBalance)
}
if len(res1.Data) > 0 {
for i := 0; i < len(res1.Data); i++ {
if strings.Split(strings.Split(res1.Data[i].ApprovalOA.LeaveApply.ActionTime, " ")[0], "-")[0] == time.Now().Format("2006") {
return errors.New(e.ErrHaveBalanceApply)
}
}
}
reqList.Status = 2
res2, err := service.ApprovalProvider.MySubmit(context.Background(), reqList)
if err != nil {
return errors.New(e.ErrNotHaveBalance)
}
for i := 0; i < len(res2.Data); i++ {
if strings.Split(strings.Split(res2.Data[i].ApprovalOA.LeaveApply.ActionTime, " ")[0], "-")[0] == time.Now().Format("2006") {
return errors.New(e.ErrHaveBalanceApply)
}
}
reqList.Status = 6
res3, err := service.ApprovalProvider.MySubmit(context.Background(), reqList)
if err != nil {
return errors.New(e.ErrNotHaveBalance)
}
for i := 0; i < len(res3.Data); i++ {
if strings.Split(strings.Split(res3.Data[i].ApprovalOA.LeaveApply.ActionTime, " ")[0], "-")[0] == time.Now().Format("2006") {
return errors.New(e.ErrHaveBalanceApply)
}
}
return nil
}
func CheckLeaveTime(req *approvalApi.CreateRequest, userInfo login.Info) (err error) {
queryOaApplyReq := new(oaApi.ApplyRecordReq)
queryOaApplyReq.StaffUID = req.SubmitterID
queryOaApplyReq.Page = 1
queryOaApplyReq.PageSize = 9999
if req.ApprovalOA.Leave != nil {
queryOaApplyReq.BeginTime = req.ApprovalOA.Leave.ApplyTimes[0].Date
queryOaApplyReq.EndTime = req.ApprovalOA.Leave.ApplyTimes[len(req.ApprovalOA.Leave.ApplyTimes)-1].Date
} else if req.ApprovalOA.OverTime != nil {
queryOaApplyReq.BeginTime = req.ApprovalOA.OverTime.ApplyTimes[0].Date
queryOaApplyReq.EndTime = req.ApprovalOA.OverTime.ApplyTimes[len(req.ApprovalOA.OverTime.ApplyTimes)-1].Date
// 如果是加班 则 剔除 外勤申请
queryOaApplyReq.ApplyType = append(queryOaApplyReq.ApplyType, common.WithOutOutworkApply...)
} else if req.ApprovalOA.OutWork != nil {
queryOaApplyReq.BeginTime = req.ApprovalOA.OutWork.ApplyTimes[0].Date
queryOaApplyReq.EndTime = req.ApprovalOA.OutWork.ApplyTimes[len(req.ApprovalOA.OutWork.ApplyTimes)-1].Date
// 如果是外勤申请 则 剔除 加班
queryOaApplyReq.ApplyType = append(queryOaApplyReq.ApplyType, common.WithOutOvertimeApply...)
} else if req.ApprovalOA.GoOut != nil { //外出
queryOaApplyReq.BeginTime = req.ApprovalOA.GoOut.ApplyTimes[0].Date
queryOaApplyReq.EndTime = req.ApprovalOA.GoOut.ApplyTimes[len(req.ApprovalOA.GoOut.ApplyTimes)-1].Date
queryOaApplyReq.ApplyType = append(queryOaApplyReq.ApplyType, common.WithGoOutApply...)
}
queryOaApplyReq.ApplyStatus = []int32{e.ApprovalWorkStatusDoing, e.ApprovalWorkStatusOk, e.ApprovalWorkStatusRevoking}
queryOaApplyRes, err := service.GrpcOAImpl.QueryOaApply(context.Background(), queryOaApplyReq)
if err != nil {
return err
}
// 查询 考勤信息
workingTime, workingTimeErr := oa_logic.QueryWorkingTimeInUse(userInfo.PositionUsers, userInfo.ID)
if workingTimeErr != nil {
return workingTimeErr
}
// 当前的申请
applyStartTimeStr := ""
applyEndTimeStr := ""
if req.ApprovalOA.Leave != nil {
applyTimes := make([]oa_model.ApplyTime, 0)
_ = copier.CopyWithOption(&applyTimes, req.ApprovalOA.Leave.ApplyTimes, copier.Option{DeepCopy: true})
applyStartTimeStr, applyEndTimeStr = oa_logic.ConvertApplyTime(applyTimes, workingTime.Time)
} else if req.ApprovalOA.OverTime != nil {
applyTimes := make([]oa_model.ApplyTime, 0)
_ = copier.CopyWithOption(&applyTimes, req.ApprovalOA.OverTime.ApplyTimes, copier.Option{DeepCopy: true})
applyStartTimeStr, applyEndTimeStr = oa_logic.ConvertApplyTime(applyTimes, workingTime.Time)
} else if req.ApprovalOA.OutWork != nil {
applyTimes := make([]oa_model.ApplyTime, 0)
_ = copier.CopyWithOption(&applyTimes, req.ApprovalOA.OutWork.ApplyTimes, copier.Option{DeepCopy: true})
applyStartTimeStr, applyEndTimeStr = oa_logic.ConvertApplyTime(applyTimes, workingTime.Time)
} else if req.ApprovalOA.GoOut != nil {
applyTimes := make([]oa_model.ApplyTime, 0)
_ = copier.CopyWithOption(&applyTimes, req.ApprovalOA.GoOut.ApplyTimes, copier.Option{DeepCopy: true})
applyStartTimeStr, applyEndTimeStr = oa_logic.ConvertApplyTime(applyTimes, workingTime.Time)
}
applyStartTime, _ := time.ParseInLocation("2006-01-02 15:04:05", applyStartTimeStr, time.Local)
applyEndTime, _ := time.ParseInLocation("2006-01-02 15:04:05", applyEndTimeStr, time.Local)
//fmt.Println("======== applyStartTime ,applyEndTime 1 =================")
//fmt.Println("======= applyStartTime", applyStartTime)
//fmt.Println("======= applyEndTime", applyEndTime)
//fmt.Println("======== applyStartTime ,applyEndTime 1 =================")
// 历史的申请
for i := 0; i < len(queryOaApplyRes.Data); i++ {
hadApplyStartTimeStr := ""
hadApplyEndTimeStr := ""
if queryOaApplyRes.Data[i] != nil {
applyTimes := make([]oa_model.ApplyTime, 0)
//如果是出差,循环走流程
if len(queryOaApplyRes.Data[i].ItineraryList) > 0 {
for _, itinerary := range queryOaApplyRes.Data[i].ItineraryList {
applyTimes2 := make([]oa_model.ApplyTime, 0)
_ = copier.CopyWithOption(&applyTimes2, itinerary.ApplyTimes, copier.Option{DeepCopy: true})
hadApplyStartTimeStr, hadApplyEndTimeStr = oa_logic.ConvertApplyTime(applyTimes2, workingTime.Time)
hadApplyStartTime, _ := time.ParseInLocation("2006-01-02 15:04:05", hadApplyStartTimeStr, time.Local)
hadApplyEndTime, _ := time.ParseInLocation("2006-01-02 15:04:05", hadApplyEndTimeStr, time.Local)
if (applyStartTime.After(hadApplyStartTime) && applyStartTime.Before(hadApplyEndTime)) || (applyEndTime.After(hadApplyStartTime) && applyEndTime.Before(hadApplyEndTime)) {
return errors.New(e.ErrSelectTimeRepeat)
}
// 当前申请时间 不包含 历史申请的时间段
/*if (!hadApplyStartTime.Before(applyStartTime) && !hadApplyStartTime.After(applyEndTime)) || (!hadApplyEndTime.Before(applyStartTime) && !hadApplyEndTime.After(applyEndTime)) {
return errors.New(e.ERR_SELECT_TIME_REPEAT)
}*/
if (hadApplyStartTime.After(applyStartTime) && hadApplyStartTime.Before(applyEndTime)) || (hadApplyEndTime.After(applyStartTime) && hadApplyEndTime.Before(applyEndTime)) {
return errors.New(e.ErrSelectTimeRepeat)
}
if applyStartTime.Equal(hadApplyStartTime) || applyEndTime.Equal(hadApplyEndTime) {
return errors.New(e.ErrSelectTimeRepeat)
}
}
return
} else {
_ = copier.CopyWithOption(&applyTimes, queryOaApplyRes.Data[i].ApplyTimes, copier.Option{DeepCopy: true})
hadApplyStartTimeStr, hadApplyEndTimeStr = oa_logic.ConvertApplyTime(applyTimes, workingTime.Time)
}
} else if req.ApprovalOA.OverTime != nil {
applyTimes := make([]oa_model.ApplyTime, 0)
_ = copier.CopyWithOption(&applyTimes, req.ApprovalOA.OverTime.ApplyTimes, copier.Option{DeepCopy: true})
hadApplyStartTimeStr, hadApplyEndTimeStr = oa_logic.ConvertApplyTime(applyTimes, workingTime.Time)
} else if req.ApprovalOA.OutWork != nil {
applyTimes := make([]oa_model.ApplyTime, 0)
_ = copier.CopyWithOption(&applyTimes, req.ApprovalOA.OutWork.ApplyTimes, copier.Option{DeepCopy: true})
hadApplyStartTimeStr, hadApplyEndTimeStr = oa_logic.ConvertApplyTime(applyTimes, workingTime.Time)
}
hadApplyStartTime, _ := time.ParseInLocation("2006-01-02 15:04:05", hadApplyStartTimeStr, time.Local)
hadApplyEndTime, _ := time.ParseInLocation("2006-01-02 15:04:05", hadApplyEndTimeStr, time.Local)
//fmt.Println("======== hadApplyStartTime ,hadApplyEndTime 2 =================")
//fmt.Println("======= hadApplyStartTime", hadApplyStartTime)
//fmt.Println("======= hadApplyEndTime", hadApplyEndTime)
//fmt.Println("======== hadApplyStartTime ,hadApplyEndTime 2 =================")
// 当前申请时间 不在 历史申请的时间段内
/*if (!applyStartTime.Before(hadApplyStartTime) && !applyStartTime.After(hadApplyEndTime)) || (!applyEndTime.Before(hadApplyStartTime) && !applyEndTime.After(hadApplyEndTime)) {
return errors.New(e.ERR_SELECT_TIME_REPEAT)
}*/
if (applyStartTime.After(hadApplyStartTime) && applyStartTime.Before(hadApplyEndTime)) || (applyEndTime.After(hadApplyStartTime) && applyEndTime.Before(hadApplyEndTime)) {
return errors.New(e.ErrSelectTimeRepeat)
}
// 当前申请时间 不包含 历史申请的时间段
/*if (!hadApplyStartTime.Before(applyStartTime) && !hadApplyStartTime.After(applyEndTime)) || (!hadApplyEndTime.Before(applyStartTime) && !hadApplyEndTime.After(applyEndTime)) {
return errors.New(e.ERR_SELECT_TIME_REPEAT)
}*/
if (hadApplyStartTime.After(applyStartTime) && hadApplyStartTime.Before(applyEndTime)) || (hadApplyEndTime.After(applyStartTime) && hadApplyEndTime.Before(applyEndTime)) {
return errors.New(e.ErrSelectTimeRepeat)
}
if applyStartTime.Equal(hadApplyStartTime) || applyEndTime.Equal(hadApplyEndTime) {
return errors.New(e.ErrSelectTimeRepeat)
}
}
return
}
// CheckBusinessTripTime 出差专用
func CheckBusinessTripTime(req *approvalApi.CreateRequest, userInfo login.Info) (err error) {
queryOaApplyReq := new(oaApi.ApplyRecordReq)
queryOaApplyReq.StaffUID = req.SubmitterID
queryOaApplyReq.Page = 1
queryOaApplyReq.PageSize = 9999
queryOaApplyReq.ApplyStatus = []int32{e.ApprovalWorkStatusDoing, e.ApprovalWorkStatusOk, e.ApprovalWorkStatusRevoking}
queryOaApplyReq.ApplyType = append(queryOaApplyReq.ApplyType, common.WithBusinessTripApply...)
if req.ApprovalOA.BusinessTrip != nil {
//每个行程都得走一遍检查流程
for _, itinerary := range req.ApprovalOA.BusinessTrip.ItineraryList {
queryOaApplyReq.BeginTime = itinerary.ApplyTimes[0].Date
queryOaApplyReq.EndTime = itinerary.ApplyTimes[len(itinerary.ApplyTimes)-1].Date
queryOaApplyRes, err := service.GrpcOAImpl.QueryOaApply(context.Background(), queryOaApplyReq)
if err != nil {
return err
}
// 查询 考勤信息
workingTime, workingTimeErr := oa_logic.QueryWorkingTimeInUse(userInfo.PositionUsers, userInfo.ID)
if workingTimeErr != nil {
return workingTimeErr
}
// 当前的申请
applyStartTimeStr := ""
applyEndTimeStr := ""
applyTimes := make([]oa_model.ApplyTime, 0)
_ = copier.CopyWithOption(&applyTimes, itinerary.ApplyTimes, copier.Option{DeepCopy: true})
applyStartTimeStr, applyEndTimeStr = oa_logic.ConvertApplyTime(applyTimes, workingTime.Time)
applyStartTime, _ := time.ParseInLocation("2006-01-02 15:04:05", applyStartTimeStr, time.Local)
applyEndTime, _ := time.ParseInLocation("2006-01-02 15:04:05", applyEndTimeStr, time.Local)
// 历史的申请
if len(queryOaApplyRes.Data) > 0 {
for i := 0; i < len(queryOaApplyRes.Data); i++ {
hadApplyStartTimeStr := ""
hadApplyEndTimeStr := ""
applyTimes2 := make([]oa_model.ApplyTime, 0)
_ = copier.CopyWithOption(&applyTimes2, queryOaApplyRes.Data[i].ApplyTimes, copier.Option{DeepCopy: true})
hadApplyStartTimeStr, hadApplyEndTimeStr = oa_logic.ConvertApplyTime(applyTimes2, workingTime.Time)
hadApplyStartTime, _ := time.ParseInLocation("2006-01-02 15:04:05", hadApplyStartTimeStr, time.Local)
hadApplyEndTime, _ := time.ParseInLocation("2006-01-02 15:04:05", hadApplyEndTimeStr, time.Local)
if (applyStartTime.After(hadApplyStartTime) && applyStartTime.Before(hadApplyEndTime)) || (applyEndTime.After(hadApplyStartTime) && applyEndTime.Before(hadApplyEndTime)) {
return errors.New(e.ErrSelectTimeRepeat)
}
if (hadApplyStartTime.After(applyStartTime) && hadApplyStartTime.Before(applyEndTime)) || (hadApplyEndTime.After(applyStartTime) && hadApplyEndTime.Before(applyEndTime)) {
return errors.New(e.ErrSelectTimeRepeat)
}
if applyStartTime.Equal(hadApplyStartTime) || applyEndTime.Equal(hadApplyEndTime) {
return errors.New(e.ErrSelectTimeRepeat)
}
}
}
}
}
return err
}
func isDateInRange(dateStr string) bool {
t, _ := time.Parse("2006-01-02", dateStr)
now := time.Now().Format("2006-01-02")
t1, _ := time.Parse("2006-01-02", now)
//上月25号
lastMonth25 := time.Date(t1.Year(), t1.Month()-1, 25, 0, 0, 0, 0, t1.Location())
//本月25号
thisMonth25 := time.Date(t1.Year(), t1.Month(), 25, 0, 0, 0, 0, t1.Location())
//下月26号
nextMonth26 := time.Date(t1.Year(), t1.Month()+1, 26, 0, 0, 0, 0, t1.Location())
//如果传入时间在本月25号之后,传入时间就得在下月26号之前
if t.After(thisMonth25) {
return t.Before(nextMonth26)
} else {
//如果不在本月25号之后则传入时间必须在上月25号之后
return t.After(lastMonth25)
}
}
func CheckLeaveApplyIsUse(req *approvalApi.CreateRequest) (err error) {
queryOaApplyReq := new(oaApi.ApplyRecordReq)
queryOaApplyReq.StaffUID = req.SubmitterID
queryOaApplyReq.ApplyType = []string{oa_model.LeaveApplyOaApplyMap[req.Type]}
// 当前月 的 年初 和 年底
queryOaApplyReq.BeginTime = time.Now().Format("2006") + "-01-01" + " 00:00:00"
queryOaApplyReq.EndTime = time.Now().Format("2006") + "-12-31" + " 23:59:59"
queryOaApplyReq.ApplyStatus = []int32{e.ApprovalWorkStatusDoing, e.ApprovalWorkStatusOk, e.ApprovalWorkStatusRevoking}
queryOaApplyRes, err := service.GrpcOAImpl.QueryOaApply(context.Background(), queryOaApplyReq)
if err != nil {
return err
}
if queryOaApplyRes.Total > 0 {
return errors.New(e.ErrIsUsed)
}
return nil
}
const (
CanDayOff = "canDayOff" // 无需加班,亦可调休
)
func QueryCanDayOffUser() (users map[string]uint64, err error) {
users = make(map[string]uint64, 0)
req := &oaApi.OaSettingReq{
Keyword: CanDayOff,
}
res, err := service.GrpcOAImpl.QueryOaSetting(context.Background(), req)
if err != nil {
return nil, errors.New(e.ErrQueryOaSetting)
}
if len(res.Data) > 0 {
for i := 0; i < len(res.Data); i++ {
if res.Data[i].Value.CanDayOff != nil {
for j := 0; j < len(res.Data[i].Value.CanDayOff); j++ {
users[res.Data[i].Value.CanDayOff[j].Name] = res.Data[i].Value.CanDayOff[j].ID
}
}
}
}
return users, nil
}
/*// 使用考勤组设置的 是否用于加班调休
func QueryCanDayOffUserWithWorkTimeTemplate(userInfo login.Info) (use bool, forMoney bool, err error) {
canDayOff := false
forMoney = false
// 查询 考勤信息
workingTime, workingTimeErr := oa_logic.QueryWorkingTimeInUse(userInfo.PositionUsers, userInfo.ID)
if workingTimeErr != nil {
canDayOff = true
return canDayOff, forMoney, workingTimeErr
}
logger.Infof("workingTime: %+v", workingTime)
fmt.Printf("workingTime: %+v", workingTime)
if len(workingTime.OaRules) > 0 {
for i := 0; i < len(workingTime.OaRules); i++ {
if workingTime.OaRules[i].Keyword == model.OvertimeRule && workingTime.OaRules[i].OvertimeRule != nil {
if workingTime.OaRules[i].OvertimeRule.ForDayOff == model.ForDayOffYes {
canDayOff = true
}
if workingTime.OaRules[i].OvertimeRule.ForDayOff == model.ForDayOffYes && workingTime.OaRules[i].OvertimeRule.ForMoney == model.ForMoneyYes {
forMoney = true
}
}
}
}
return canDayOff, forMoney, nil
}
*/

View File

@ -0,0 +1,420 @@
package approval
import (
"context"
"errors"
"fmt"
"strconv"
"strings"
"github.com/fonchain_enterprise/fonchain-main/api/account"
api "github.com/fonchain_enterprise/fonchain-main/api/approval"
"github.com/fonchain_enterprise/fonchain-main/api/e_card"
"github.com/fonchain_enterprise/fonchain-main/api/position"
"github.com/fonchain_enterprise/fonchain-main/api/recruit"
"github.com/fonchain_enterprise/fonchain-main/pkg/e"
"github.com/fonchain_enterprise/fonchain-main/pkg/model/login"
"github.com/fonchain_enterprise/fonchain-main/pkg/model/union"
"github.com/fonchain_enterprise/fonchain-main/pkg/serializer"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
account2 "github.com/fonchain_enterprise/fonchain-main/pkg/service/account"
"github.com/fonchain_enterprise/fonchain-main/pkg/utils/employee"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
)
const InitPassword = "Aa123456"
func offerApproveSetStatusEnter(c *gin.Context, userInfo login.Info, req *api.StatusRequest, detail *api.CreateRequest) (err error) {
if req.Status == e.ApprovalWorkStatusFail {
if detail.Employ.ResumeID != "" {
err = rejectOfferApprove(userInfo, req.ID, req.Reply)
if err != nil {
//service.Error(c, e.Error, err)
return err
}
}
} else if req.Status == e.ApprovalWorkStatusOk {
fmt.Println("进入offer审批通过-----:", req, detail)
if detail.Status == e.ApprovalWorkStatusOk {
if detail.Employ.ResumeID != "" {
// 老的人才招聘流程
fmt.Println("进入老的人才招聘流程-----:")
err = passOfferApproveNotFinish(userInfo, detail.ID)
if err != nil {
service.Error(c, e.Error, err)
return err
}
} else {
// 新的人才招聘流程,岗位待人数直接-1
fmt.Println("进入新的人才招聘流程,人数直接减一-----:")
err = PositionPostCountNumMinus(userInfo, detail.ID, detail.Employ)
if err != nil {
service.Error(c, e.Error, err)
return err
}
}
}
fmt.Println("offer审批通过结束-----:", req, detail)
if detail.Status == e.ApprovalWorkStatusOk && detail.Employ.ConfirmDate != "" {
fmt.Println("进入创建账号和员工档案-----:", req, detail)
err = createUsersAndFiles(c, detail)
if err != nil {
return errors.New("创建用户及员工档案失败!" + err.Error())
}
fmt.Println("员工档案创建成功-----:", req, detail)
if err != nil {
return
}
return nil
}
}
return nil
}
func createUsersAndFiles(c *gin.Context, detail *api.CreateRequest) error {
registerUser := union.User{
Domain: "fontree",
NickName: detail.Employ.Name,
TelNum: detail.Employ.Mobile,
Status: "notactive",
EnterDate: detail.Employ.ConfirmDate,
PositionUsers: nil,
JobNum: detail.Employ.EmployeeNo,
Password: e.DEFAULT_PWD,
Source: "entryApplication",
}
registerUser.Operator = &account.Operator{
ID: uint32(detail.NowUserId),
Name: detail.NowUserName,
}
registerUser.PositionUsers = make([]*position.PositionUser, 0)
positionId, err := strconv.ParseUint(detail.Employ.PositionId, 10, 64)
if err != nil {
fmt.Println("转换失败:", err)
return err
}
departmentId, err := strconv.ParseUint(detail.Employ.DepartmentId, 10, 64)
if err != nil {
fmt.Println("转换失败:", err)
return err
}
registerUser.PositionUsers = append(registerUser.PositionUsers, &position.PositionUser{PositionID: positionId, DepartmentID: departmentId})
err, user := account2.UserRegisters(c, registerUser)
if err != nil {
return err
}
ResumeProto := []*recruit.ResumeProto{
{
ResumeFile: detail.Employ.ResumeFile,
InterviewFile: detail.Employ.InterviewFile,
EmployeeType: detail.Employ.EmployeeType,
},
}
rep := &recruit.ResumeQueryListVo{
Resumes: ResumeProto,
}
//创建员工档案
err = employee.CreateAnEmployeeProfile(c, user.ID, registerUser, rep, registerUser.Operator)
if err != nil {
return err
}
// 生成员工电子名片
var addChainRequest *e_card.AddChainRequest
addChainRequest, err = account2.GetECardInfo(user.ID, "审批-人员增补申请")
if err != nil {
return err
}
fmt.Println("++++++++++++++++++++ addChainRequest =============================")
fmt.Printf("addChainRequest : %+v\n", addChainRequest)
_, err = service.ECardProvider.AddChain(context.Background(), addChainRequest)
return nil
}
func createOfferApprove(c *gin.Context, userInfo login.Info, res *api.ApprovalResponse, departmentID int64) (err error) {
createReq := api.DetailRequest{ID: res.ID}
createDetail, detailErr := service.ApprovalProvider.Detail(c, &createReq)
if detailErr != nil {
return detailErr
}
dealProcessForm := new(recruit.DealProcessProto)
dealProcessForm.Id = int64(createDetail.ID) // 审批申请的ID
dealProcessForm.Type = "offer-approve" // 人才招聘 的 类型
dealProcessForm.Command = "offer-submit"
dealProcessForm.User = &recruit.UserProto{ // 登录用户
Id: int64(userInfo.ID),
Nickname: userInfo.NickName,
}
// TODO 已确认 字段
dealProcessForm.Entity = &recruit.EntityProto{ // 入职信息
Offer: &recruit.OfferProto{
Applier: userInfo.NickName, // 申请人 昵称
Post: createDetail.Employ.Post,
ResumeFile: createDetail.Employ.ResumeFile,
BelongDepartment: createDetail.Employ.BelongDepartment,
Name: createDetail.Employ.Name,
Mobile: createDetail.Employ.Mobile,
EmployeeType: createDetail.Employ.EmployeeType,
EmployeeNo: createDetail.Employ.EmployeeNo,
InterviewFile: createDetail.Employ.InterviewFile,
EntryTime: createDetail.Employ.EntryTime,
ApproveCountLast: int32(len(createDetail.WorkFlows)),
},
}
dealProcessForm.Entity.Offer.ResumeId, _ = strconv.ParseInt(createDetail.Employ.ResumeID, 10, 64)
approver := make([]string, 0)
for i := 0; i < len(createDetail.WorkFlows); i++ {
approver = append(approver, createDetail.WorkFlows[i].Name)
dealProcessForm.Entity.Offer.ApproverIds = append(dealProcessForm.Entity.Offer.ApproverIds, int64(createDetail.WorkFlows[i].UserID)) // 审批人 ID
}
copyUsers := make([]string, 0)
for i := 0; i < len(createDetail.CopyUsers); i++ {
copyUsers = append(copyUsers, createDetail.CopyUsers[i].Name)
dealProcessForm.Entity.Offer.CopiedIds = append(dealProcessForm.Entity.Offer.CopiedIds, int64(createDetail.CopyUsers[i].ID)) // 抄送人 ID
}
dealProcessForm.Entity.Offer.Approver = strings.Join(approver, ",") // 审批人 名称
dealProcessForm.Entity.Offer.Copied = strings.Join(copyUsers, ",") // 抄送人 名称
//for i := 0; i < len(userInfo.PositionUsers); i++ {
// if departmentID == int64(userInfo.PositionUsers[i].DepartmentId) {
// dealProcessForm.Entity.Offer.BelongDepartment = userInfo.PositionUsers[i].DepartmentName // 申请人的 部门
// //dealProcessForm.Entity.Offer.ApplierPosition = userInfo.PositionUsers[i].PositionName // 申请人的 岗位
// }
//}
fmt.Println("++++++++++++++++++++ dealProcessForm =============================")
fmt.Printf("dealProcessForm : %+v\n", dealProcessForm)
fmt.Println("++++++++++++++++++++ dealProcessForm =============================")
dealProcessFormResp := new(recruit.ResultVo)
dealProcessFormResp, err = service.GrpcRecruitClientImpl.OfferSubmit(context.Background(), dealProcessForm)
if err != nil {
fmt.Println("++++++++++++++++++++ offer-submit =============================")
fmt.Printf("offer-submit : %+v\n", err)
fmt.Printf("dealProcessFormResp : %+v\n", dealProcessFormResp)
fmt.Println("++++++++++++++++++++ offer-submit =============================")
//service.Error(c, e.Error, errors.New(e.ErrorCreateOffer))
return errors.New(e.ErrorCreateOffer)
}
return returnRecruitError(dealProcessFormResp)
}
// offer审批通过但不是最终通过仅仅是个状态
func passOfferApproveNotFinish(userInfo login.Info, approvalID uint64) (err error) {
dealProcessForm := new(recruit.DealProcessProto)
dealProcessForm.Entity = new(recruit.EntityProto)
dealProcessForm.Entity.Detail = new(recruit.DetailProto)
dealProcessForm.User = &recruit.UserProto{ // 登录用户
Id: int64(userInfo.ID),
Nickname: userInfo.NickName,
}
dealProcessForm.Id = int64(approvalID) // 审批申请的ID
dealProcessForm.Type = "offer-approve" // 人才招聘 的 类型
dealProcessForm.Command = "offer-approval-pass"
dealProcessForm.Entity.Detail.Approver = int64(userInfo.ID)
dealProcessForm.Entity.Detail.Result = "offer审核通过"
dealProcessFormResp := new(recruit.ResultVo)
dealProcessFormResp, err = service.GrpcRecruitClientImpl.OfferPass(context.Background(), dealProcessForm)
if err != nil {
fmt.Println("++++++++++++++++++++ PostSubmit =============================")
fmt.Printf("PostSubmit : %+v\n", err)
fmt.Printf("dealProcessFormResp : %+v\n", dealProcessFormResp)
fmt.Println("++++++++++++++++++++ PostSubmit =============================")
//service.Error(c, e.Error, errors.New(e.ErrorCreateTalents))
return errors.New(e.ErrorCreateTalents)
}
return returnRecruitError(dealProcessFormResp)
}
// offer审批通过但不是最终通过仅仅是个状态
func PositionPostCountNumMinus(userInfo login.Info, approvalID uint64, detail *api.Employ) (err error) {
req := new(recruit.PositionFastAcceptReq)
aplyDepartmentId, err := strconv.ParseInt(detail.DepartmentId, 10, 32)
if err != nil {
fmt.Println("aplyDepartmentId转换错误:", err)
return
}
applyPositionId, err := strconv.ParseInt(detail.PositionId, 10, 32)
if err != nil {
fmt.Println("applyPositionId转换错误:", err)
return
}
req.ApplyDepartmentId = aplyDepartmentId
req.ApplyPositionId = applyPositionId
req.UpdatedId = int64(userInfo.ID)
req.UpdatedName = userInfo.NickName
resp := new(recruit.ResultVo)
resp, err = service.GrpcRecruitClientImpl.PositionFastAccept(context.Background(), req)
if err != nil {
fmt.Println("++++++++++++++++++++ PositionFastAccept =============================")
fmt.Printf("err : %+v\n", err)
fmt.Printf("resp : %+v\n", resp)
fmt.Println("++++++++++++++++++++ PositionFastAccept =============================")
//service.Error(c, e.Error, errors.New(e.ErrorCreateTalents))
return errors.New(err.Error())
}
return returnRecruitError(resp)
}
func PassOfferApprove(userInfo login.Info, approvalID uint64) (err error) {
dealProcessForm := new(recruit.DealProcessProto)
dealProcessForm.Entity = new(recruit.EntityProto)
dealProcessForm.Entity.Detail = new(recruit.DetailProto)
dealProcessForm.User = &recruit.UserProto{ // 登录用户
Id: int64(userInfo.ID),
Nickname: userInfo.NickName,
}
dealProcessForm.Id = int64(approvalID) // 审批申请的ID
dealProcessForm.Type = "offer-approve" // 人才招聘 的 类型
dealProcessForm.Command = "offer-pass"
dealProcessForm.Entity.Detail.Approver = int64(userInfo.ID)
dealProcessForm.Entity.Detail.Result = "通过"
dealProcessFormResp := new(recruit.ResultVo)
dealProcessFormResp, err = service.GrpcRecruitClientImpl.OfferPass(context.Background(), dealProcessForm)
if err != nil {
fmt.Println("++++++++++++++++++++ PostSubmit =============================")
fmt.Printf("PostSubmit : %+v\n", err)
fmt.Printf("dealProcessFormResp : %+v\n", dealProcessFormResp)
fmt.Println("++++++++++++++++++++ PostSubmit =============================")
//service.Error(c, e.Error, errors.New(e.ErrorCreateTalents))
return errors.New(e.ErrorCreateTalents)
}
return returnRecruitError(dealProcessFormResp)
}
func rejectOfferApprove(userInfo login.Info, approvalID uint64, reason string) (err error) {
dealProcessForm := new(recruit.DealProcessProto)
dealProcessForm.Entity = new(recruit.EntityProto)
dealProcessForm.Entity.Detail = new(recruit.DetailProto)
dealProcessForm.User = &recruit.UserProto{ // 登录用户
Id: int64(userInfo.ID),
Nickname: userInfo.NickName,
}
dealProcessForm.Id = int64(approvalID) // 审批申请的ID
dealProcessForm.Type = "offer-approve" // 人才招聘 的 类型
dealProcessForm.Command = "offer-reject"
dealProcessForm.Entity.Detail.Approver = int64(userInfo.ID)
dealProcessForm.Entity.Detail.Result = "不通过"
dealProcessForm.Entity.Detail.RejectReason = reason
dealProcessFormResp := new(recruit.ResultVo)
dealProcessFormResp, err = service.GrpcRecruitClientImpl.OfferReject(context.Background(), dealProcessForm)
if err != nil {
fmt.Println("++++++++++++++++++++ PostSubmit =============================")
fmt.Printf("PostSubmit : %+v\n", err)
fmt.Printf("dealProcessFormResp : %+v\n", dealProcessFormResp)
fmt.Println("++++++++++++++++++++ PostSubmit =============================")
//service.Error(c, e.Error, errors.New(e.ErrorCreateTalents))
return errors.New(e.ErrorCreateTalents)
}
return returnRecruitError(dealProcessFormResp)
}
func checkOfferApprove(userInfo login.Info, approvalID uint64) (err error) {
dealProcessForm := new(recruit.DealProcessProto)
dealProcessForm.Entity = new(recruit.EntityProto)
dealProcessForm.Entity.Copied = new(recruit.CopiedProto)
dealProcessForm.User = &recruit.UserProto{ // 登录用户
Id: int64(userInfo.ID),
Nickname: userInfo.NickName,
}
dealProcessForm.Id = int64(approvalID) // 审批申请的ID
dealProcessForm.Type = "offer-approve" // 人才招聘 的 类型
dealProcessForm.Command = "offer-check"
dealProcessForm.Entity.Copied.Copied = int64(userInfo.ID)
dealProcessFormResp := new(recruit.ResultVo)
dealProcessFormResp, err = service.GrpcRecruitClientImpl.OfferCheck(context.Background(), dealProcessForm)
if err != nil {
fmt.Println("++++++++++++++++++++ PostSubmit =============================")
fmt.Printf("PostSubmit : %+v\n", err)
fmt.Printf("dealProcessFormResp : %+v\n", dealProcessFormResp)
fmt.Println("++++++++++++++++++++ PostSubmit =============================")
//service.Error(c, e.Error, errors.New(e.ErrorCreateTalents))
return errors.New(e.ErrorCreateTalents)
}
return returnRecruitError(dealProcessFormResp)
}
func CloseEmploy(c *gin.Context) {
var req api.CloseEmployReq
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, e.Error, err)
return
}
_, err := service.ApprovalProvider.CloseEmploy(context.Background(), &req)
if err != nil {
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Msg: err.Error(),
Status: e.Failed,
})
return
}
service.ResponseMsg(c, e.SUCCESS, serializer.Response{
Msg: e.GetMsg(e.SUCCESS),
Status: e.Ok,
})
}
func rollbackOffer(userInfo login.Info, approvalID uint64) (err error) {
dealProcessForm := new(recruit.DealProcessProto)
dealProcessForm.Id = int64(approvalID) // 审批申请的ID
dealProcessForm.Command = "offer-rollback"
dealProcessForm.Type = "offer-approve" // 人才招聘 的 类型
dealProcessForm.User = &recruit.UserProto{ // 登录用户
Id: int64(userInfo.ID),
Nickname: userInfo.NickName,
}
dealProcessFormResp, err := service.GrpcRecruitClientImpl.OfferRollback(context.Background(), dealProcessForm)
if err != nil {
fmt.Println("++++++++++++++++++++ Offer Rollback =============================")
fmt.Printf("Offer Rollback : %+v\n", err)
fmt.Printf("dealProcessFormResp : %+v\n", dealProcessFormResp)
fmt.Println("++++++++++++++++++++ Offer Rollback =============================")
//service.Error(c, e.Error, errors.New(e.ErrorRollbackOffer))
return errors.New(e.ErrorRollbackOffer)
}
return returnRecruitError(dealProcessFormResp)
}
func resumeHireJudge(userInfo login.Info, resumeID int64) (err error) {
dealProcessForm := new(recruit.DealProcessProto)
dealProcessForm.Id = resumeID // 审批申请的ID
dealProcessForm.Command = "resume-hire-judge"
dealProcessForm.Type = "resume-approve" // 人才招聘 的 类型
dealProcessForm.User = &recruit.UserProto{ // 登录用户
Id: int64(userInfo.ID),
Nickname: userInfo.NickName,
}
dealProcessFormResp, err := service.GrpcRecruitClientImpl.ResumeHireJudge(context.Background(), dealProcessForm)
if err != nil {
fmt.Println("++++++++++++++++++++ ResumeHireJudge =============================")
fmt.Printf("ResumeHireJudge : %+v\n", err)
fmt.Printf("dealProcessFormResp : %+v\n", dealProcessFormResp)
fmt.Println("++++++++++++++++++++ ResumeHireJudge =============================")
//service.Error(c, e.Error, errors.New(e.ErrorResumeHireJudge))
return errors.New(e.ErrorResumeHireJudge)
}
return returnRecruitError(dealProcessFormResp)
}

View File

@ -0,0 +1,340 @@
package approval
import (
"context"
"errors"
"fmt"
"github.com/fonchain_enterprise/fonchain-main/api/account"
api "github.com/fonchain_enterprise/fonchain-main/api/approval"
"github.com/fonchain_enterprise/fonchain-main/api/employee"
"github.com/fonchain_enterprise/fonchain-main/api/oa"
"github.com/fonchain_enterprise/fonchain-main/api/recruit"
"github.com/fonchain_enterprise/fonchain-main/pkg/e"
"github.com/fonchain_enterprise/fonchain-main/pkg/model/login"
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
employee1 "github.com/fonchain_enterprise/fonchain-main/pkg/service/employee"
"github.com/gin-gonic/gin"
"strconv"
"strings"
"time"
)
func postApproveSetStatusEnter(userInfo login.Info, detail *api.CreateRequest) (err error) {
fmt.Println("++++++++++++++++++++ postApproveSetStatusEnter =============================")
fmt.Printf("detail : %+v\n", detail)
fmt.Println("++++++++++++++++++++ postApproveSetStatusEnter =============================")
if detail.Status == e.ApprovalWorkStatusFail {
fmt.Println("++++++++++++++++++++ postApproveSetStatusEnter ApprovalWorkStatusFail =============================")
err = rejectPostApprove(userInfo, detail.ID, detail.Reply)
if err != nil {
//service.Error(c, e.Error, err)
return err
}
} else if detail.Status == e.ApprovalWorkStatusOk {
fmt.Println("++++++++++++++++++++ postApproveSetStatusEnter ApprovalWorkStatusOk =============================")
err = passPostApprove(userInfo, detail.ID)
if err != nil {
//service.Error(c, e.Error, err)
return err
}
}
return nil
}
func createPostApprove(c *gin.Context, userInfo login.Info, res *api.ApprovalResponse, departmentID int64) (err error) {
createReq := api.DetailRequest{ID: res.ID}
createDetail, detailErr := service.ApprovalProvider.Detail(c, &createReq)
if detailErr != nil {
return detailErr
}
dealProcessForm := new(recruit.DealProcessProto)
dealProcessForm.Id = int64(createDetail.ID) // 审批申请的ID
dealProcessForm.Command = "position-submit"
dealProcessForm.Type = "post-approve" // 人才招聘 的 类型
dealProcessForm.User = &recruit.UserProto{ // 登录用户
Id: int64(userInfo.ID),
Nickname: userInfo.NickName,
}
dealProcessForm.Entity = &recruit.EntityProto{ // 岗位信息
Position: &recruit.PositionProto{
Applier: userInfo.NickName, // 申请人 昵称
ApplierId: int64(userInfo.ID), // 申请人 ID
Post: createDetail.StaffSupply.PositionName, // 申请岗位
PostCapacity: int32(createDetail.StaffSupply.Num), // 岗位数量
PostRequirement: createDetail.StaffSupply.JobAsk, // 岗位要求
WantedDate: createDetail.StaffSupply.JoinInTime, // 期待到职日期
ApproveCountLast: int32(len(createDetail.WorkFlows)), // 待审核人数
PostCountLast: int32(createDetail.StaffSupply.Num), // 岗位待招人数
},
}
if createDetail.StaffSupply != nil {
if createDetail.StaffSupply.DepartmentId != "" {
tempDepartmentId, err := strconv.Atoi(createDetail.StaffSupply.DepartmentId)
if err == nil {
dealProcessForm.Entity.Position.ApplyDepartmentId = int32(tempDepartmentId)
}
}
if createDetail.StaffSupply.PositionId != "" {
tempPositionId, err := strconv.Atoi(createDetail.StaffSupply.PositionId)
if err == nil {
dealProcessForm.Entity.Position.ApplyPositionId = int32(tempPositionId)
}
}
}
approver := make([]string, 0)
for i := 0; i < len(createDetail.WorkFlows); i++ {
approver = append(approver, createDetail.WorkFlows[i].Name)
dealProcessForm.Entity.Position.ApproverIds = append(dealProcessForm.Entity.Position.ApproverIds, int64(createDetail.WorkFlows[i].UserID)) // 审批人 ID
}
copyUsers := make([]string, 0)
for i := 0; i < len(createDetail.CopyUsers); i++ {
copyUsers = append(copyUsers, createDetail.CopyUsers[i].Name)
dealProcessForm.Entity.Position.CopiedIds = append(dealProcessForm.Entity.Position.CopiedIds, int64(createDetail.CopyUsers[i].ID)) // 抄送人 ID
}
dealProcessForm.Entity.Position.Approver = strings.Join(approver, ",") // 审批人 名称
dealProcessForm.Entity.Position.Copied = strings.Join(copyUsers, ",") // 抄送人 名称
for i := 0; i < len(userInfo.PositionUsers); i++ {
if departmentID == int64(userInfo.PositionUsers[i].DepartmentId) {
//dealProcessForm.Entity.Position.ApplierDepartment = userInfo.PositionUsers[i].DepartmentName // 申请人的 部门
dealProcessForm.Entity.Position.ApplierPosition = userInfo.PositionUsers[i].PositionName // 申请人的 岗位
}
}
dealProcessForm.Entity.Position.ApplierDepartment = createDetail.StaffSupply.DepartmentName // 归属部门
fmt.Println("++++++++++++++++++++ dealProcessForm =============================")
fmt.Printf("dealProcessForm : %+v\n", dealProcessForm)
fmt.Println("++++++++++++++++++++ dealProcessForm =============================")
dealProcessFormResp := new(recruit.ResultVo)
dealProcessFormResp, err = service.GrpcRecruitClientImpl.PostSubmit(context.Background(), dealProcessForm)
if err != nil {
fmt.Println("++++++++++++++++++++ PostSubmit =============================")
fmt.Printf("PostSubmit : %+v\n", err)
fmt.Printf("dealProcessFormResp : %+v\n", dealProcessFormResp)
fmt.Println("++++++++++++++++++++ PostSubmit =============================")
//service.Error(c, e.Error, errors.New(e.ErrorCreateTalents))
return errors.New(e.ErrorCreateTalents)
}
return returnRecruitError(dealProcessFormResp)
}
func passPostApprove(userInfo login.Info, approvalID uint64) (err error) {
dealProcessForm := new(recruit.DealProcessProto)
dealProcessForm.Entity = new(recruit.EntityProto)
dealProcessForm.Entity.Detail = new(recruit.DetailProto)
dealProcessForm.User = &recruit.UserProto{ // 登录用户
Id: int64(userInfo.ID),
Nickname: userInfo.NickName,
}
dealProcessForm.Id = int64(approvalID) // 审批申请的ID
dealProcessForm.Type = "post-approve" // 人才招聘 的 类型
dealProcessForm.Command = "position-pass"
dealProcessForm.Entity.Detail.Approver = int64(userInfo.ID)
dealProcessForm.Entity.Detail.Result = "通过"
dealProcessFormResp := new(recruit.ResultVo)
dealProcessFormResp, err = service.GrpcRecruitClientImpl.PostPass(context.Background(), dealProcessForm)
fmt.Println("++++++++++++++++++++ PostPass =============================")
fmt.Printf("PostPass : %+v\n", err)
fmt.Printf("dealProcessFormResp : %+v\n", dealProcessFormResp)
fmt.Println("++++++++++++++++++++ PostPass =============================")
if err != nil {
//service.Error(c, e.Error, errors.New(e.ErrorCreateTalents))
return errors.New(e.ErrorCreateTalents)
}
return returnRecruitError(dealProcessFormResp)
}
func rejectPostApprove(userInfo login.Info, approvalID uint64, reason string) (err error) {
dealProcessForm := new(recruit.DealProcessProto)
dealProcessForm.Entity = new(recruit.EntityProto)
dealProcessForm.Entity.Detail = new(recruit.DetailProto)
dealProcessForm.User = &recruit.UserProto{ // 登录用户
Id: int64(userInfo.ID),
Nickname: userInfo.NickName,
}
dealProcessForm.Id = int64(approvalID) // 审批申请的ID
dealProcessForm.Type = "post-approve" // 人才招聘 的 类型
dealProcessForm.Command = "position-reject"
dealProcessForm.Entity.Detail.Approver = int64(userInfo.ID)
dealProcessForm.Entity.Detail.Result = "不通过"
dealProcessForm.Entity.Detail.RejectReason = reason
dealProcessFormResp := new(recruit.ResultVo)
dealProcessFormResp, err = service.GrpcRecruitClientImpl.PostReject(context.Background(), dealProcessForm)
if err != nil {
fmt.Println("++++++++++++++++++++ PostSubmit =============================")
fmt.Printf("PostSubmit : %+v\n", err)
fmt.Printf("dealProcessFormResp : %+v\n", dealProcessFormResp)
fmt.Println("++++++++++++++++++++ PostSubmit =============================")
//service.Error(c, e.Error, errors.New(e.ErrorCreateTalents))
return errors.New(e.ErrorCreateTalents)
}
return returnRecruitError(dealProcessFormResp)
}
func checkPostApprove(userInfo login.Info, approvalID uint64) (err error) {
dealProcessForm := new(recruit.DealProcessProto)
dealProcessForm.Entity = new(recruit.EntityProto)
dealProcessForm.Entity.Copied = new(recruit.CopiedProto)
dealProcessForm.User = &recruit.UserProto{ // 登录用户
Id: int64(userInfo.ID),
Nickname: userInfo.NickName,
}
dealProcessForm.Id = int64(approvalID) // 审批申请的ID
dealProcessForm.Type = "post-approve" // 人才招聘 的 类型
dealProcessForm.Command = "position-check"
dealProcessForm.Entity.Copied.Copied = int64(userInfo.ID)
dealProcessFormResp := new(recruit.ResultVo)
dealProcessFormResp, err = service.GrpcRecruitClientImpl.PostCheck(context.Background(), dealProcessForm)
if err != nil {
fmt.Println("++++++++++++++++++++ PostSubmit =============================")
fmt.Printf("PostSubmit : %+v\n", err)
fmt.Printf("dealProcessFormResp : %+v\n", dealProcessFormResp)
fmt.Println("++++++++++++++++++++ PostSubmit =============================")
//service.Error(c, e.Error, errors.New(e.ErrorCreateTalents))
return errors.New(e.ErrorCreateTalents)
}
return returnRecruitError(dealProcessFormResp)
}
func rollbackPost(userInfo login.Info, approvalID uint64) (err error) {
dealProcessForm := new(recruit.DealProcessProto)
dealProcessForm.Id = int64(approvalID) // 审批申请的ID
dealProcessForm.Command = "position-rollback"
dealProcessForm.Type = "post-approve" // 人才招聘 的 类型
dealProcessForm.User = &recruit.UserProto{ // 登录用户
Id: int64(userInfo.ID),
Nickname: userInfo.NickName,
}
dealProcessFormResp, err := service.GrpcRecruitClientImpl.PostRollback(context.Background(), dealProcessForm)
if err != nil {
fmt.Println("++++++++++++++++++++ Post Rollback =============================")
fmt.Printf("Post Rollback : %+v\n", err)
fmt.Printf("dealProcessFormResp : %+v\n", dealProcessFormResp)
fmt.Println("++++++++++++++++++++ Post Rollback =============================")
//service.Error(c, e.Error, errors.New(e.ErrorRollbackTalents))
return errors.New(e.ErrorRollbackTalents)
}
return returnRecruitError(dealProcessFormResp)
}
func returnRecruitError(res *recruit.ResultVo) (err error) {
if res.Code != 0 {
//service.Error(c, e.Error, errors.New(res.Msg))
return errors.New(res.Msg)
}
return err
}
func turnoverUpdateAccountEmployee(c *gin.Context, info *api.TurnoverApply) error {
//查询员工档案
req := &employee.CreateTurnoverRecordRequest{
ResignationDate: info.LeftTime,
Reason: info.Reason,
Remark: "审批申请离职",
}
infoRes, err := service.GrpcEmployeeProvider.QueryBasicInfoAboutEmployees(context.Background(), &employee.QueryBasicInfoAboutEmployeesRequest{
UserId: []uint64{info.StaffUID},
})
if err != nil {
return err
}
if len(infoRes.List) == 0 {
return errors.New("获取用户档案错误")
}
req.EmployeeFileId = infoRes.List[0].EmployeeFileId
userReq := &account.InfoRequest{
ID: infoRes.List[0].UserId,
}
userInfo, err := service.AccountProvider.Info(context.Background(), userReq)
// 更新用户信息(如果需要)
err = employee1.UpdateUserWorkingCondition(c, userInfo, req)
if err != nil {
return err
}
_, err = service.GrpcEmployeeProvider.CreateTurnoverRecord(c, req)
if err != nil {
return err
}
// 更新年假扣除
//updateDeductAnnualLeave(info)
//service.Success(c, basicInfo)
return nil
}
func updateDeductAnnualLeaveZeroClearing(info *api.TurnoverApply) {
t, err := time.Parse("2006-01-02", info.LeftTime)
if err != nil {
fmt.Println("解析日期失败:", err)
return
}
year := int32(t.Year())
_, err = service.GrpcOAImpl.UpdateDeductAnnualLeave(context.Background(), &oa.UpdateDeductAnnualLeaveReq{
StaffUID: info.StaffUID,
Year: year,
DeductDays: 0,
})
if err != nil {
return
}
}
func UpdateDeductAnnualLeave(info *api.TurnoverApply, createInfo login.Info) {
t, err := time.Parse("2006-01-02", info.LeftTime)
if err != nil {
fmt.Println("解析日期失败:", err)
return
}
year := int32(t.Year())
// 计算当年 1 月 1 日至离职日期的天数
startOfYear := time.Date(int(year), time.January, 1, 0, 0, 0, 0, time.UTC)
daysWorked := int(t.Sub(startOfYear).Hours() / 24) // 只取整数
userInfo, err := service.GrpcEmployeeProvider.FindEmployeeFileList(context.Background(), &employee.FindEmployeeFileListRequest{
UserId: createInfo.ID,
})
if err != nil || len(userInfo.EmployeeFileList) == 0 {
return
}
serviceLength := userInfo.EmployeeFileList[0].ServiceLength
if serviceLength < 1 {
return
}
// 确定年假基数
var annualLeaveBase int
switch {
case serviceLength >= 20:
annualLeaveBase = 15
case serviceLength >= 10:
annualLeaveBase = 10
case serviceLength >= 5:
annualLeaveBase = 7
default:
annualLeaveBase = 5
}
// 计算应有年假天数(取整数)
eligibleLeave := (daysWorked * annualLeaveBase) / 365
// 计算需扣除的年假天数
deductDays := int32(annualLeaveBase - eligibleLeave)
_, err = service.GrpcOAImpl.UpdateDeductAnnualLeave(context.Background(), &oa.UpdateDeductAnnualLeaveReq{
StaffUID: createInfo.ID,
Year: year,
DeductDays: deductDays,
})
if err != nil {
return
}
}

Some files were not shown because too many files have changed in this diff Show More