From 93290429a287d66d6bae25e0da0ef2802d70f8fa Mon Sep 17 00:00:00 2001 From: dorlolo <428192774@qq.com> Date: Fri, 17 Mar 2023 10:46:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=9C=AA=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E5=90=88=E5=90=8C=E6=95=B0=E9=87=8F=E7=9A=84=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/internal/dao/artistInfo_user.go | 14 ++++++++++---- cmd/model/contract.go | 4 ++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/cmd/internal/dao/artistInfo_user.go b/cmd/internal/dao/artistInfo_user.go index 3392975..783170e 100644 --- a/cmd/internal/dao/artistInfo_user.go +++ b/cmd/internal/dao/artistInfo_user.go @@ -317,7 +317,7 @@ func UserLock(req *artistInfoUser.UserLockRequest) (rep *artistInfoUser.UserLock if err = tx.Model(model.ArtshowVideoRecord{}).Where("artist_uid = ? AND status =2", thisUser.MgmtArtistUid).Update("status", 3).Error; err != nil { return nil, err } - // 与合同服务进行联动 + // 与画家宝的合同表进行联动 if err = tx.Model(model.Contract{}).Where("artist_uid = ? AND status =2", thisUser.MgmtArtistUid).Update("status", 3).Error; err != nil { return nil, err } @@ -386,8 +386,9 @@ func UnFinishList(req *artistInfoUser.UnFinishListRequest) (rep *artistInfoUser. UnfinishedArtistSupplementCount int64 `gorm:"column:unfinished_artist_supplement_count;comment:未完成的画家补充信息数量"` UnfinishedArtistVideoRecordCount int64 `gorm:"column:unfinished_artist_video_record_count;comment:未完成的画展视频统计"` UnfinishedArtistIndexCount int64 `gorm:"column:unfinished_artist_index_count;comment:未完成的画家指数"` + // UnfinishedContractCount int64 `gorm:"column:unfinished_contract_count;comment:未签署合同统计;"` }{} - //todo 目前缺少合同列表 + // 查询未完成的画展相关操作统计 var sql = fmt.Sprintf(` SELECT COUNT(1) unfinished_artwork_base_count , @@ -403,9 +404,14 @@ WHERE artist_uid = ? AND STATUS = 2 AND base_audit_status IN (1,3,5) if err != nil { return nil, err } - + //未签署合同统计 + var UnfinishedContractCount int64 + err = db.DB.Model(model.Contract{}).Where("artist_uid = ? AND STATUS = 2 AND state =1", user.MgmtArtistUid).Count(&UnfinishedContractCount).Error + if err != nil { + return nil, err + } rep = &artistInfoUser.UnFinishListRespond{ - ContractList: 0, //todo + ContractList: UnfinishedContractCount, SupplyInfoList: viewData.UnfinishedArtworkBaseCount + viewData.UnfinishedArtworkSupplementCount + viewData.UnfinishedArtistIndexCount + viewData.UnfinishedArtistSupplementCount, AccountStateList: accountStatusList, } diff --git a/cmd/model/contract.go b/cmd/model/contract.go index 5ba1ee1..4ccbcd9 100644 --- a/cmd/model/contract.go +++ b/cmd/model/contract.go @@ -13,8 +13,8 @@ type Contract struct { Type int32 `gorm:"column:type;type:int(1);comment:合同类型;NOT NULL" json:"type"` ViewUrl string `gorm:"column:view_url;type:varchar(500);comment:在线查看合同链接" json:"view_url"` DownloadUrl string `gorm:"column:download_url;type:varchar(500);comment:合同下载链接" json:"download_url"` - State int32 `gorm:"column:state;type:int(1);comment:合同状态;NOT NULL" json:"state"` - Status int32 `gorm:"column:status;default:2;comment:2=锁定 3=解锁" json:"status" ` //跟随用户的锁定和解锁状态,用于控制数据的展示 + State int32 `gorm:"column:state;type:int(1);comment:合同状态;NOT NULL" json:"state"` //1 未签署 + Status int32 `gorm:"column:status;default:2;comment:2=锁定 3=解锁" json:"status" ` //跟随用户的锁定和解锁状态,用于控制数据的展示 LockTime string `gorm:"column:lock_time;comment:锁定时间" json:"lockTime"` SignTime string `gorm:"column:sign_time;comment:签署时间" json:"sign_time"` BatchId int32 `gorm:"column:batch_id;comment:批次ID" json:"batch_id"`