Merge branch 'oa' into dev

main
jhc 1 year ago
commit 8f5015a173

File diff suppressed because it is too large Load Diff

@ -302,6 +302,7 @@ message BundlePayPrice {
uint64 ID = 10 [json_name = "ID"];
uint64 Status = 11 [json_name = "status"];
string ArtistName = 12 [json_name = "artistName"];
int32 Rollback = 13 [json_name = "rollback"];
}
message CreateRequest {

@ -49,7 +49,7 @@ func (la *LeaveApply) Scan(src interface{}) error {
return json.Unmarshal(src.([]byte), la)
}
func (la *LeaveApply) Value() (driver.Value, error) {
func (la LeaveApply) Value() (driver.Value, error) {
v, err := json.Marshal(la)
@ -81,7 +81,7 @@ func (owa *OutWorkApply) Scan(src interface{}) error {
return json.Unmarshal(src.([]byte), owa)
}
func (owa *OutWorkApply) Value() (driver.Value, error) {
func (owa OutWorkApply) Value() (driver.Value, error) {
v, err := json.Marshal(owa)
@ -110,7 +110,7 @@ func (mua *MakeUpApply) Scan(src interface{}) error {
return json.Unmarshal(src.([]byte), mua)
}
func (mua *MakeUpApply) Value() (driver.Value, error) {
func (mua MakeUpApply) Value() (driver.Value, error) {
v, err := json.Marshal(mua)
@ -141,7 +141,7 @@ func (ta *TurnoverApply) Scan(src interface{}) error {
return json.Unmarshal(src.([]byte), ta)
}
func (ta *TurnoverApply) Value() (driver.Value, error) {
func (ta TurnoverApply) Value() (driver.Value, error) {
v, err := json.Marshal(ta)
@ -171,7 +171,7 @@ func (ota *OverTimeApply) Scan(src interface{}) error {
return json.Unmarshal(src.([]byte), ota)
}
func (ota *OverTimeApply) Value() (driver.Value, error) {
func (ota OverTimeApply) Value() (driver.Value, error) {
v, err := json.Marshal(ota)
@ -202,7 +202,7 @@ func (l *Leave) Scan(src interface{}) error {
return json.Unmarshal(src.([]byte), l)
}
func (l *Leave) Value() (driver.Value, error) {
func (l Leave) Value() (driver.Value, error) {
v, err := json.Marshal(l)
@ -211,14 +211,31 @@ func (l *Leave) Value() (driver.Value, error) {
type VerifyFiles []string
//type ApplyTime struct {
// Date string `json:"date"` // 日期 2023-05-08
// Hour string `json:"hour"` // 时间 09:00
// M string `json:"m"` // 上午|下午
//}
type ApplyTime struct {
Date string `json:"date"` // 日期 2023-05-08
Hour string `json:"hour"` // 时间 09:00
M string `json:"m"` // 上午|下午
Date string // 日期 2023-05-08
Hour string // 时间 09:00
M string // 上午|下午
}
type ApplyTimes []ApplyTime
func (at *ApplyTimes) Scan(src interface{}) error {
return json.Unmarshal(src.([]byte), at)
}
func (at ApplyTimes) Value() (driver.Value, error) {
v, err := json.Marshal(at)
return string(v), err
}
var sonMap = map[string]string{
"leave": "leave", // 事假
"sick": "leave", // 病假

@ -24,6 +24,7 @@ type BundlePayPrice struct {
ArtworkSize string `gorm:"type:varchar(32);column:artwork_size;default:'';comment:作品总平尺" json:"artworkSize"`
ShowAddress string `gorm:"type:varchar(50);column:show_address;default:'';comment:画展地址" json:"showAddress"`
ArtistName string `gorm:"type:varchar(50);column:artist_name;default:'';comment:画家名称" json:"artistName"`
Rollback int32 `gorm:"type:int;column:rollback;default:'1';comment:是否回滚(默认 1 回滚 2)" json:"rollback"`
Status uint64 `gorm:"type:int(11);column:status;default:1;comment:状态" json:"status"`
}
@ -32,7 +33,6 @@ func (m *BundlePayPrice) TableName() string {
return "bundle_pay_price"
}
func (m *BundlePayPrice) GetApproval(id uint64) (*Approval, error) {
var entity *Approval
@ -59,6 +59,7 @@ func (m *BundlePayPrice) SaveApprovalContent(in *approval.CreateRequest, a *Appr
m.ArtworkSize = in.BundlePayPrice.ArtworkSize
m.ShowAddress = in.BundlePayPrice.ShowAddress
m.ArtistName = in.BundlePayPrice.ArtistName
m.Rollback = in.BundlePayPrice.Rollback
return DB.Create(&m).Error
}
@ -81,6 +82,7 @@ func (m *BundlePayPrice) UpdateApprovalContent(in *approval.CreateRequest, a *Ap
m.ArtworkSize = in.BundlePayPrice.ArtworkSize
m.ShowAddress = in.BundlePayPrice.ShowAddress
m.ArtistName = in.BundlePayPrice.ArtistName
m.Rollback = in.BundlePayPrice.Rollback
return DB.Model(&m).Updates(m).Error
}
@ -100,6 +102,7 @@ func (m *BundlePayPrice) BuildResContent(a *Approval, request *approval.CreateRe
ShowAddress: a.BundlePayPrice.ShowAddress,
Status: a.BundlePayPrice.Status,
ArtistName: a.BundlePayPrice.ArtistName,
Rollback: a.BundlePayPrice.Rollback,
ID: a.BundlePayPrice.ID,
}
}

@ -3,6 +3,7 @@ package service
import (
"context"
"errors"
"fmt"
"github.com/fonchain_enterprise/fonchain-approval/api/approval"
"github.com/fonchain_enterprise/fonchain-approval/pkg/e"
"github.com/fonchain_enterprise/fonchain-approval/pkg/model"
@ -23,6 +24,8 @@ func (a *ApprovalProvider) UpdateApprovalOAUUID(_ context.Context, in *approval.
if model.GetOaType(in.ApplyType) == "leave" {
approvalOA.Leave.UUID = in.UUID
fmt.Println("oa apply UUID is :", in.UUID)
fmt.Println("approvalOA UUID is :", approvalOA.Leave.UUID)
model.DB.Model(&model.ApprovalOA{}).Where(&model.ApprovalOA{ApprovalID: in.ApprovalID}).Update("leave", approvalOA.Leave)
} else if model.GetOaType(in.ApplyType) == "outWork" {
approvalOA.OutWork.UUID = in.UUID

Loading…
Cancel
Save