作者 陈志颖

fix:修复共创申请校验,增加待申请判断

... ... @@ -269,6 +269,11 @@ func (cooperationApplicationService *CooperationApplicationService) ApprovalCoop
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(cooperationApplicationId, 10)))
}
// 校验共创申请是否已经审核过
if cooperationApplication.CooperationApplicationStatus != 1 {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "改申请已经审核过")
}
if approvalCooperationApplicationCommand.Action == 1 {
cooperationApplication.CooperationApplicationStatus = 2
} else if approvalCooperationApplicationCommand.Action == 2 {
... ... @@ -346,7 +351,12 @@ func (cooperationApplicationService *CooperationApplicationService) BatchApprova
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
if count > 0 {
for i, _ := range cooperationApplications {
for i, cooperationApplication := range cooperationApplications {
// 校验共创申请是否已经审核过
if cooperationApplication.CooperationApplicationStatus != 1 {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "改申请已经审核过")
}
// 更新共创申请数据
cooperationApplications[i].CooperationApplicationVerifyDescription = batchApprovalCooperationApplicationCommand.CooperationApplicationVerifyDescription
if batchApprovalCooperationApplicationCommand.Action == 1 { // 同意
cooperationApplications[i].CooperationApplicationStatus = 2
... ... @@ -421,7 +431,12 @@ func (cooperationApplicationService *CooperationApplicationService) OneClickAppr
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
if count > 0 {
for i, _ := range cooperationApplications {
for i, cooperationApplication := range cooperationApplications {
// 校验共创申请是否已经审核过
if cooperationApplication.CooperationApplicationStatus != 1 {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "改申请已经审核过")
}
// 更新共创申请
if oneClickApprovalCooperationApplicationCommand.Action == 1 {
cooperationApplications[i].CooperationApplicationStatus = 2
} else if oneClickApprovalCooperationApplicationCommand.Action == 2 {
... ...