完成未完成合同数量的统计

This commit is contained in:
徐俊杰 2023-03-17 10:46:56 +08:00
parent f53fcb6e29
commit 93290429a2
2 changed files with 12 additions and 6 deletions

View File

@ -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,
}

View File

@ -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"`