正在显示
5 个修改的文件
包含
14 行增加
和
9 行删除
@@ -98,7 +98,11 @@ func (data *CooperationApplicationDto) LoadDto(a *domain.CooperationApplication) | @@ -98,7 +98,11 @@ func (data *CooperationApplicationDto) LoadDto(a *domain.CooperationApplication) | ||
98 | data.CooperationApplyTime = a.CooperationApplyTime.Unix() * 1000 | 98 | data.CooperationApplyTime = a.CooperationApplyTime.Unix() * 1000 |
99 | data.CooperationProject = data.LoadCooperationProject(a.CooperationProject) | 99 | data.CooperationProject = data.LoadCooperationProject(a.CooperationProject) |
100 | data.Org = data.LoadOrg(a.Org) | 100 | data.Org = data.LoadOrg(a.Org) |
101 | - data.IsCanceled = a.IsCanceled | 101 | + if a.IsCanceled == 1 { |
102 | + data.IsCanceled = false | ||
103 | + } else { | ||
104 | + data.IsCanceled = true | ||
105 | + } | ||
102 | data.Company = data.LoadCompany(a.Company) | 106 | data.Company = data.LoadCompany(a.Company) |
103 | } | 107 | } |
104 | 108 |
@@ -113,7 +113,7 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop | @@ -113,7 +113,7 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop | ||
113 | CooperationApplyTime: time.Now(), | 113 | CooperationApplyTime: time.Now(), |
114 | CooperationProject: cooperationProject, | 114 | CooperationProject: cooperationProject, |
115 | Org: organization, | 115 | Org: organization, |
116 | - IsCanceled: false, | 116 | + IsCanceled: 1, |
117 | Company: company, | 117 | Company: company, |
118 | CreatedAt: time.Now(), | 118 | CreatedAt: time.Now(), |
119 | DeletedAt: time.Time{}, | 119 | DeletedAt: time.Time{}, |
@@ -281,6 +281,7 @@ func (cooperationApplicationService *CooperationApplicationService) BatchApprova | @@ -281,6 +281,7 @@ func (cooperationApplicationService *CooperationApplicationService) BatchApprova | ||
281 | } | 281 | } |
282 | cooperationApplications[i].CooperationApplicationVerifier = verifier | 282 | cooperationApplications[i].CooperationApplicationVerifier = verifier |
283 | cooperationApplications[i].CooperationApplicationVerifyTime = time.Now() | 283 | cooperationApplications[i].CooperationApplicationVerifyTime = time.Now() |
284 | + cooperationApplications[i].IsCanceled = 1 | ||
284 | } | 285 | } |
285 | cooperationApplicationsApproved, err := cooperationApplicationRepository.UpdateMany(cooperationApplications) | 286 | cooperationApplicationsApproved, err := cooperationApplicationRepository.UpdateMany(cooperationApplications) |
286 | if err != nil { | 287 | if err != nil { |
@@ -463,7 +464,7 @@ func (cooperationApplicationService *CooperationApplicationService) CreateCooper | @@ -463,7 +464,7 @@ func (cooperationApplicationService *CooperationApplicationService) CreateCooper | ||
463 | CooperationApplyTime: time.Now(), | 464 | CooperationApplyTime: time.Now(), |
464 | CooperationProject: cooperationProject, | 465 | CooperationProject: cooperationProject, |
465 | Org: organization, | 466 | Org: organization, |
466 | - IsCanceled: false, | 467 | + IsCanceled: 1, |
467 | Company: company, | 468 | Company: company, |
468 | CreatedAt: time.Now(), | 469 | CreatedAt: time.Now(), |
469 | DeletedAt: time.Time{}, | 470 | DeletedAt: time.Time{}, |
@@ -732,7 +733,7 @@ func (cooperationApplicationService *CooperationApplicationService) CancelCooper | @@ -732,7 +733,7 @@ func (cooperationApplicationService *CooperationApplicationService) CancelCooper | ||
732 | return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(cooperationApplicationId, 10))) | 733 | return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(cooperationApplicationId, 10))) |
733 | } | 734 | } |
734 | if err := cooperationApplication.Update(map[string]interface{}{ | 735 | if err := cooperationApplication.Update(map[string]interface{}{ |
735 | - "isCanceled": true, | 736 | + "isCanceled": int32(2), |
736 | }); err != nil { | 737 | }); err != nil { |
737 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | 738 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) |
738 | } | 739 | } |
@@ -27,7 +27,7 @@ type CooperationApplication struct { | @@ -27,7 +27,7 @@ type CooperationApplication struct { | ||
27 | // 数据所属组织机构 | 27 | // 数据所属组织机构 |
28 | Org *Org `json:"org"` | 28 | Org *Org `json:"org"` |
29 | // 是否被取消标志位 | 29 | // 是否被取消标志位 |
30 | - IsCanceled bool `json:"isCanceled"` | 30 | + IsCanceled int32 `json:"isCanceled"` |
31 | // 公司 | 31 | // 公司 |
32 | Company *Company `json:"company"` | 32 | Company *Company `json:"company"` |
33 | // 创建时间 | 33 | // 创建时间 |
@@ -55,7 +55,7 @@ func (cooperationApplication *CooperationApplication) Identify() interface{} { | @@ -55,7 +55,7 @@ func (cooperationApplication *CooperationApplication) Identify() interface{} { | ||
55 | 55 | ||
56 | func (cooperationApplication *CooperationApplication) Update(data map[string]interface{}) error { | 56 | func (cooperationApplication *CooperationApplication) Update(data map[string]interface{}) error { |
57 | if isCanceled, ok := data["isCanceled"]; ok { | 57 | if isCanceled, ok := data["isCanceled"]; ok { |
58 | - cooperationApplication.IsCanceled = isCanceled.(bool) | 58 | + cooperationApplication.IsCanceled = isCanceled.(int32) |
59 | } | 59 | } |
60 | if cooperationApplicationAttachment, ok := data["cooperationApplicationAttachment"]; ok { | 60 | if cooperationApplicationAttachment, ok := data["cooperationApplicationAttachment"]; ok { |
61 | cooperationApplication.CooperationApplicationAttachment = cooperationApplicationAttachment.([]*Attachment) | 61 | cooperationApplication.CooperationApplicationAttachment = cooperationApplicationAttachment.([]*Attachment) |
@@ -29,8 +29,8 @@ type CooperationApplication struct { | @@ -29,8 +29,8 @@ type CooperationApplication struct { | ||
29 | CooperationProjectNumber string `comment:"共创项目编号"` | 29 | CooperationProjectNumber string `comment:"共创项目编号"` |
30 | // 数据所属组织机构 | 30 | // 数据所属组织机构 |
31 | Org *domain.Org `comment:"数据所属组织机构"` | 31 | Org *domain.Org `comment:"数据所属组织机构"` |
32 | - // 是否被取消标志位 | ||
33 | - IsCanceled bool `comment:"是否被取消标志位"` | 32 | + // 是否被取消标志位 1正常,2取消 |
33 | + IsCanceled int32 `comment:"是否被取消标志位" pg:",default:1"` | ||
34 | // 公司 | 34 | // 公司 |
35 | Company *domain.Company `comment:"公司"` | 35 | Company *domain.Company `comment:"公司"` |
36 | // 创建时间 | 36 | // 创建时间 |
@@ -268,7 +268,7 @@ func (repository *CooperationApplicationRepository) Find(queryOptions map[string | @@ -268,7 +268,7 @@ func (repository *CooperationApplicationRepository) Find(queryOptions map[string | ||
268 | if offsetLimitFlag { | 268 | if offsetLimitFlag { |
269 | query.SetOffsetAndLimit(20) | 269 | query.SetOffsetAndLimit(20) |
270 | } | 270 | } |
271 | - query.Where("is_canceled = ?", false) | 271 | + query.Where("is_canceled = ?", 1) |
272 | query.SetOrderDirect("cooperation_application_id", "DESC") | 272 | query.SetOrderDirect("cooperation_application_id", "DESC") |
273 | if count, err := query.SelectAndCount(); err != nil { | 273 | if count, err := query.SelectAndCount(); err != nil { |
274 | return 0, cooperationApplications, err | 274 | return 0, cooperationApplications, err |
-
请 注册 或 登录 后发表评论