作者 陈志颖

fix:修复分红预算缺失字段

@@ -91,7 +91,7 @@ func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) Crea @@ -91,7 +91,7 @@ func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) Crea
91 } 91 }
92 cooperationContract, err := cooperationContractRepository.FindOne(map[string]interface{}{"cooperationContractNumber": createContractUndertakerFeedbackCommand.CooperationContractNumber}) 92 cooperationContract, err := cooperationContractRepository.FindOne(map[string]interface{}{"cooperationContractNumber": createContractUndertakerFeedbackCommand.CooperationContractNumber})
93 if err != nil { 93 if err != nil {
94 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 94 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创合约不存在")
95 } 95 }
96 if cooperationContract == nil { 96 if cooperationContract == nil {
97 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", createContractUndertakerFeedbackCommand.CooperationContractNumber)) 97 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", createContractUndertakerFeedbackCommand.CooperationContractNumber))
@@ -153,7 +153,7 @@ func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) GetC @@ -153,7 +153,7 @@ func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) GetC
153 } 153 }
154 contractUndertakerFeedback, err := contractUndertakerFeedbackRepository.FindOne(map[string]interface{}{"contractUndertakerFeedbackId": getContractUndertakerFeedbackQuery.FeedbackId}) 154 contractUndertakerFeedback, err := contractUndertakerFeedbackRepository.FindOne(map[string]interface{}{"contractUndertakerFeedbackId": getContractUndertakerFeedbackQuery.FeedbackId})
155 if err != nil { 155 if err != nil {
156 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 156 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "合约反馈信息不存在")
157 } 157 }
158 if contractUndertakerFeedback == nil { 158 if contractUndertakerFeedback == nil {
159 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(getContractUndertakerFeedbackQuery.FeedbackId))) 159 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(getContractUndertakerFeedbackQuery.FeedbackId)))
@@ -228,7 +228,7 @@ func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) Remo @@ -228,7 +228,7 @@ func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) Remo
228 } 228 }
229 contractUndertakerFeedback, err := contractUndertakerFeedbackRepository.FindOne(map[string]interface{}{"contractUndertakerFeedbackId": removeContractUndertakerFeedbackCommand.FeedbackId}) 229 contractUndertakerFeedback, err := contractUndertakerFeedbackRepository.FindOne(map[string]interface{}{"contractUndertakerFeedbackId": removeContractUndertakerFeedbackCommand.FeedbackId})
230 if err != nil { 230 if err != nil {
231 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 231 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "反馈信息不存在")
232 } 232 }
233 if contractUndertakerFeedback == nil { 233 if contractUndertakerFeedback == nil {
234 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(removeContractUndertakerFeedbackCommand.FeedbackId))) 234 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(removeContractUndertakerFeedbackCommand.FeedbackId)))
@@ -306,7 +306,7 @@ func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) Upda @@ -306,7 +306,7 @@ func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) Upda
306 } 306 }
307 contractUndertakerFeedback, err := contractUndertakerFeedbackRepository.FindOne(map[string]interface{}{"contractUndertakerFeedbackId": updateContractUndertakerFeedbackCommand.FeedbackId}) 307 contractUndertakerFeedback, err := contractUndertakerFeedbackRepository.FindOne(map[string]interface{}{"contractUndertakerFeedbackId": updateContractUndertakerFeedbackCommand.FeedbackId})
308 if err != nil { 308 if err != nil {
309 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 309 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "反馈信息不存在")
310 } 310 }
311 if contractUndertakerFeedback == nil { 311 if contractUndertakerFeedback == nil {
312 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(updateContractUndertakerFeedbackCommand.FeedbackId))) 312 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(updateContractUndertakerFeedbackCommand.FeedbackId)))
@@ -48,7 +48,7 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop @@ -48,7 +48,7 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop
48 // 获取共创项目 48 // 获取共创项目
49 cooperationProject, err := cooperationProjectRepository.FindOne(map[string]interface{}{"cooperationProjectId": applyForCooperationCommand.CooperationProjectId}) 49 cooperationProject, err := cooperationProjectRepository.FindOne(map[string]interface{}{"cooperationProjectId": applyForCooperationCommand.CooperationProjectId})
50 if err != nil { 50 if err != nil {
51 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 51 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创项目不存在")
52 } 52 }
53 if cooperationProject == nil { 53 if cooperationProject == nil {
54 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(applyForCooperationCommand.CooperationProjectId, 10))) 54 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(applyForCooperationCommand.CooperationProjectId, 10)))
@@ -169,7 +169,7 @@ func (cooperationApplicationService *CooperationApplicationService) ApprovalCoop @@ -169,7 +169,7 @@ func (cooperationApplicationService *CooperationApplicationService) ApprovalCoop
169 // 获取共创申请 169 // 获取共创申请
170 cooperationApplication, err := cooperationApplicationRepository.FindOne(map[string]interface{}{"cooperationApplicationId": approvalCooperationApplicationCommand.CooperationApplicationId}) 170 cooperationApplication, err := cooperationApplicationRepository.FindOne(map[string]interface{}{"cooperationApplicationId": approvalCooperationApplicationCommand.CooperationApplicationId})
171 if err != nil { 171 if err != nil {
172 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 172 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创申请不存在")
173 } 173 }
174 if cooperationApplication == nil { 174 if cooperationApplication == nil {
175 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(cooperationApplicationId, 10))) 175 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(cooperationApplicationId, 10)))
@@ -330,7 +330,7 @@ func (cooperationApplicationService *CooperationApplicationService) CreateCooper @@ -330,7 +330,7 @@ func (cooperationApplicationService *CooperationApplicationService) CreateCooper
330 } 330 }
331 cooperationProject, err := cooperationProjectRepository.FindOne(map[string]interface{}{"cooperationProjectNumber": createCooperationApplicationCommand.CooperationProjectNumber}) 331 cooperationProject, err := cooperationProjectRepository.FindOne(map[string]interface{}{"cooperationProjectNumber": createCooperationApplicationCommand.CooperationProjectNumber})
332 if err != nil { 332 if err != nil {
333 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 333 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创项目不存在")
334 } 334 }
335 if cooperationProject == nil { 335 if cooperationProject == nil {
336 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", createCooperationApplicationCommand.CooperationProjectNumber)) 336 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", createCooperationApplicationCommand.CooperationProjectNumber))
@@ -445,7 +445,7 @@ func (cooperationApplicationService *CooperationApplicationService) GetCooperati @@ -445,7 +445,7 @@ func (cooperationApplicationService *CooperationApplicationService) GetCooperati
445 } 445 }
446 cooperationApplication, err := cooperationApplicationRepository.FindOne(map[string]interface{}{"cooperationApplicationId": getCooperationApplicationQuery.CooperationApplicationId}) 446 cooperationApplication, err := cooperationApplicationRepository.FindOne(map[string]interface{}{"cooperationApplicationId": getCooperationApplicationQuery.CooperationApplicationId})
447 if err != nil { 447 if err != nil {
448 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 448 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创申请不存在")
449 } 449 }
450 if cooperationApplication == nil { 450 if cooperationApplication == nil {
451 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(getCooperationApplicationQuery.CooperationApplicationId, 10))) 451 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(getCooperationApplicationQuery.CooperationApplicationId, 10)))
@@ -523,7 +523,7 @@ func (cooperationApplicationService *CooperationApplicationService) RemoveCooper @@ -523,7 +523,7 @@ func (cooperationApplicationService *CooperationApplicationService) RemoveCooper
523 } 523 }
524 cooperationApplication, err := cooperationApplicationRepository.FindOne(map[string]interface{}{"cooperationApplicationId": removeCooperationApplicationCommand.CooperationApplicationId}) 524 cooperationApplication, err := cooperationApplicationRepository.FindOne(map[string]interface{}{"cooperationApplicationId": removeCooperationApplicationCommand.CooperationApplicationId})
525 if err != nil { 525 if err != nil {
526 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 526 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创申请不存在")
527 } 527 }
528 if cooperationApplication == nil { 528 if cooperationApplication == nil {
529 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(removeCooperationApplicationCommand.CooperationApplicationId, 10))) 529 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(removeCooperationApplicationCommand.CooperationApplicationId, 10)))
@@ -608,7 +608,7 @@ func (cooperationApplicationService *CooperationApplicationService) UpdateCooper @@ -608,7 +608,7 @@ func (cooperationApplicationService *CooperationApplicationService) UpdateCooper
608 } 608 }
609 cooperationApplication, err := cooperationApplicationRepository.FindOne(map[string]interface{}{"cooperationApplicationId": updateCooperationApplicationCommand.CooperationApplicationId}) 609 cooperationApplication, err := cooperationApplicationRepository.FindOne(map[string]interface{}{"cooperationApplicationId": updateCooperationApplicationCommand.CooperationApplicationId})
610 if err != nil { 610 if err != nil {
611 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 611 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创申请不存在")
612 } 612 }
613 if cooperationApplication == nil { 613 if cooperationApplication == nil {
614 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(updateCooperationApplicationCommand.CooperationApplicationId, 10))) 614 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(updateCooperationApplicationCommand.CooperationApplicationId, 10)))
@@ -658,7 +658,7 @@ func (cooperationApplicationService *CooperationApplicationService) CancelCooper @@ -658,7 +658,7 @@ func (cooperationApplicationService *CooperationApplicationService) CancelCooper
658 } 658 }
659 cooperationApplication, err := cooperationApplicationRepository.FindOne(map[string]interface{}{"cooperationApplicationId": cooperationApplicationId}) 659 cooperationApplication, err := cooperationApplicationRepository.FindOne(map[string]interface{}{"cooperationApplicationId": cooperationApplicationId})
660 if err != nil { 660 if err != nil {
661 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 661 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创申请不存在")
662 } 662 }
663 if cooperationApplication == nil { 663 if cooperationApplication == nil {
664 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(cooperationApplicationId, 10))) 664 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(cooperationApplicationId, 10)))
@@ -368,7 +368,7 @@ func (cooperationContractService *CooperationContractService) GetCooperationCont @@ -368,7 +368,7 @@ func (cooperationContractService *CooperationContractService) GetCooperationCont
368 } 368 }
369 cooperationContract, err := cooperationContractRepository.FindOne(map[string]interface{}{"cooperationContractId": getCooperationContractQuery.CooperationContractId}) 369 cooperationContract, err := cooperationContractRepository.FindOne(map[string]interface{}{"cooperationContractId": getCooperationContractQuery.CooperationContractId})
370 if err != nil { 370 if err != nil {
371 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 371 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创合约不存在")
372 } 372 }
373 if cooperationContract == nil { 373 if cooperationContract == nil {
374 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(getCooperationContractQuery.CooperationContractId, 10))) 374 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(getCooperationContractQuery.CooperationContractId, 10)))
@@ -489,7 +489,7 @@ func (cooperationContractService *CooperationContractService) RemoveCooperationC @@ -489,7 +489,7 @@ func (cooperationContractService *CooperationContractService) RemoveCooperationC
489 } 489 }
490 cooperationContract, err := cooperationContractRepository.FindOne(map[string]interface{}{"cooperationContractId": removeCooperationContractCommand.CooperationContractId}) 490 cooperationContract, err := cooperationContractRepository.FindOne(map[string]interface{}{"cooperationContractId": removeCooperationContractCommand.CooperationContractId})
491 if err != nil { 491 if err != nil {
492 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 492 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创合约不存在")
493 } 493 }
494 if cooperationContract == nil { 494 if cooperationContract == nil {
495 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(removeCooperationContractCommand.CooperationContractId, 10))) 495 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(removeCooperationContractCommand.CooperationContractId, 10)))
@@ -603,7 +603,7 @@ func (cooperationContractService *CooperationContractService) OperateCooperation @@ -603,7 +603,7 @@ func (cooperationContractService *CooperationContractService) OperateCooperation
603 // 获取共创合约 603 // 获取共创合约
604 cooperationContract, err := cooperationContractRepository.FindOne(map[string]interface{}{"cooperationContractId": operateCooperationContractCommand.CooperationContractId}) 604 cooperationContract, err := cooperationContractRepository.FindOne(map[string]interface{}{"cooperationContractId": operateCooperationContractCommand.CooperationContractId})
605 if err != nil { 605 if err != nil {
606 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 606 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创合约不存在")
607 } 607 }
608 if cooperationContract == nil { 608 if cooperationContract == nil {
609 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(operateCooperationContractCommand.CooperationContractId))) 609 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(operateCooperationContractCommand.CooperationContractId)))
@@ -883,7 +883,7 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC @@ -883,7 +883,7 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC
883 // 获取待更新的共创合约 883 // 获取待更新的共创合约
884 cooperationContract, err8 := cooperationContractRepository.FindOne(map[string]interface{}{"cooperationContractId": updateCooperationContractCommand.CooperationContractId}) 884 cooperationContract, err8 := cooperationContractRepository.FindOne(map[string]interface{}{"cooperationContractId": updateCooperationContractCommand.CooperationContractId})
885 if err8 != nil { 885 if err8 != nil {
886 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err8.Error()) 886 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创合约不存在")
887 } 887 }
888 if cooperationContract == nil { 888 if cooperationContract == nil {
889 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(updateCooperationContractCommand.CooperationContractId))) 889 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(updateCooperationContractCommand.CooperationContractId)))
@@ -140,7 +140,7 @@ func (cooperationContractChangeLogService *CooperationContractChangeLogService) @@ -140,7 +140,7 @@ func (cooperationContractChangeLogService *CooperationContractChangeLogService)
140 } 140 }
141 cooperationContractChangeLog, err := cooperationContractChangeLogRepository.FindOne(map[string]interface{}{"cooperationContractChangeLogId": getCooperationContractChangeLogQuery.CooperationContractChangeLogId}) 141 cooperationContractChangeLog, err := cooperationContractChangeLogRepository.FindOne(map[string]interface{}{"cooperationContractChangeLogId": getCooperationContractChangeLogQuery.CooperationContractChangeLogId})
142 if err != nil { 142 if err != nil {
143 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 143 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创合约变更记录不存在")
144 } 144 }
145 if cooperationContractChangeLog == nil { 145 if cooperationContractChangeLog == nil {
146 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(getCooperationContractChangeLogQuery.CooperationContractChangeLogId, 10))) 146 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(getCooperationContractChangeLogQuery.CooperationContractChangeLogId, 10)))
@@ -215,7 +215,7 @@ func (cooperationContractChangeLogService *CooperationContractChangeLogService) @@ -215,7 +215,7 @@ func (cooperationContractChangeLogService *CooperationContractChangeLogService)
215 } 215 }
216 cooperationContractChangeLog, err := cooperationContractChangeLogRepository.FindOne(map[string]interface{}{"cooperationContractChangeLogId": removeCooperationContractChangeLogCommand.CooperationContractChangeLogId}) 216 cooperationContractChangeLog, err := cooperationContractChangeLogRepository.FindOne(map[string]interface{}{"cooperationContractChangeLogId": removeCooperationContractChangeLogCommand.CooperationContractChangeLogId})
217 if err != nil { 217 if err != nil {
218 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 218 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创合约变更记录不存在")
219 } 219 }
220 if cooperationContractChangeLog == nil { 220 if cooperationContractChangeLog == nil {
221 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(removeCooperationContractChangeLogCommand.CooperationContractChangeLogId, 10))) 221 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(removeCooperationContractChangeLogCommand.CooperationContractChangeLogId, 10)))
@@ -293,7 +293,7 @@ func (cooperationContractChangeLogService *CooperationContractChangeLogService) @@ -293,7 +293,7 @@ func (cooperationContractChangeLogService *CooperationContractChangeLogService)
293 } 293 }
294 cooperationContractChangeLog, err := cooperationContractChangeLogRepository.FindOne(map[string]interface{}{"cooperationContractChangeLogId": updateCooperationContractChangeLogCommand.CooperationContractChangeLogId}) 294 cooperationContractChangeLog, err := cooperationContractChangeLogRepository.FindOne(map[string]interface{}{"cooperationContractChangeLogId": updateCooperationContractChangeLogCommand.CooperationContractChangeLogId})
295 if err != nil { 295 if err != nil {
296 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 296 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创合约变更记录不存在")
297 } 297 }
298 if cooperationContractChangeLog == nil { 298 if cooperationContractChangeLog == nil {
299 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(updateCooperationContractChangeLogCommand.CooperationContractChangeLogId, 10))) 299 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(updateCooperationContractChangeLogCommand.CooperationContractChangeLogId, 10)))
@@ -168,7 +168,7 @@ func (cooperationModeService *CooperationModeService) GetCooperationMode(getCoop @@ -168,7 +168,7 @@ func (cooperationModeService *CooperationModeService) GetCooperationMode(getCoop
168 } 168 }
169 cooperationMode, err := cooperationModeRepository.FindOne(map[string]interface{}{"cooperationModeId": getCooperationModeQuery.CooperationModeId}) 169 cooperationMode, err := cooperationModeRepository.FindOne(map[string]interface{}{"cooperationModeId": getCooperationModeQuery.CooperationModeId})
170 if err != nil { 170 if err != nil {
171 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 171 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创模式不存在")
172 } 172 }
173 if cooperationMode == nil { 173 if cooperationMode == nil {
174 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(getCooperationModeQuery.CooperationModeId, 10))) 174 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(getCooperationModeQuery.CooperationModeId, 10)))
@@ -241,7 +241,7 @@ func (cooperationModeService *CooperationModeService) RemoveCooperationMode(remo @@ -241,7 +241,7 @@ func (cooperationModeService *CooperationModeService) RemoveCooperationMode(remo
241 } 241 }
242 cooperationMode, err := cooperationModeRepository.FindOne(map[string]interface{}{"cooperationModeId": removeCooperationModeCommand.CooperationModeId}) 242 cooperationMode, err := cooperationModeRepository.FindOne(map[string]interface{}{"cooperationModeId": removeCooperationModeCommand.CooperationModeId})
243 if err != nil { 243 if err != nil {
244 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 244 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创模式不存在")
245 } 245 }
246 if cooperationMode == nil { 246 if cooperationMode == nil {
247 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(removeCooperationModeCommand.CooperationModeId, 10))) 247 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(removeCooperationModeCommand.CooperationModeId, 10)))
@@ -379,7 +379,7 @@ func (cooperationModeService *CooperationModeService) UpdateCooperationMode(upda @@ -379,7 +379,7 @@ func (cooperationModeService *CooperationModeService) UpdateCooperationMode(upda
379 379
380 cooperationMode, err := cooperationModeRepository.FindOne(map[string]interface{}{"cooperationModeId": updateCooperationModeCommand.CooperationModeId}) 380 cooperationMode, err := cooperationModeRepository.FindOne(map[string]interface{}{"cooperationModeId": updateCooperationModeCommand.CooperationModeId})
381 if err != nil { 381 if err != nil {
382 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 382 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创模式不存在")
383 } 383 }
384 if cooperationMode == nil { 384 if cooperationMode == nil {
385 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(updateCooperationModeCommand.CooperationModeId, 10))) 385 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(updateCooperationModeCommand.CooperationModeId, 10)))
@@ -423,7 +423,7 @@ func (cooperationModeService *CooperationModeService) OperateCooperationMode(ope @@ -423,7 +423,7 @@ func (cooperationModeService *CooperationModeService) OperateCooperationMode(ope
423 cooperationModeId, _ := strconv.ParseInt(operateCooperationModeCommand.CooperationModeId, 10, 64) 423 cooperationModeId, _ := strconv.ParseInt(operateCooperationModeCommand.CooperationModeId, 10, 64)
424 cooperationMode, err := cooperationModeRepository.FindOne(map[string]interface{}{"cooperationModeId": cooperationModeId}) 424 cooperationMode, err := cooperationModeRepository.FindOne(map[string]interface{}{"cooperationModeId": cooperationModeId})
425 if err != nil { 425 if err != nil {
426 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 426 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创模式不存在")
427 } 427 }
428 if cooperationMode == nil { 428 if cooperationMode == nil {
429 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(cooperationModeId, 10))) 429 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(cooperationModeId, 10)))
@@ -456,6 +456,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent @@ -456,6 +456,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
456 _ = transactionContext.RollbackTransaction() 456 _ = transactionContext.RollbackTransaction()
457 }() 457 }()
458 458
  459 + // 订单产品ID类型转换
459 orderGoodIds, err := utils.SliceAtoi(confirmDividendsIncentivesEstimateCommand.OrderGoodIds) 460 orderGoodIds, err := utils.SliceAtoi(confirmDividendsIncentivesEstimateCommand.OrderGoodIds)
460 if err != nil { 461 if err != nil {
461 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 462 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
@@ -493,6 +494,22 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent @@ -493,6 +494,22 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
493 organization = data 494 organization = data
494 } 495 }
495 496
  497 + // 用户REST服务初始化
  498 + var userService service.UserService
  499 + if value, err := factory.CreateUserService(map[string]interface{}{}); err != nil {
  500 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  501 + } else {
  502 + userService = value
  503 + }
  504 +
  505 + // 获取操作人
  506 + var operator *domain.User
  507 + if data, err := userService.OperatorFrom(confirmDividendsIncentivesEstimateCommand.CompanyId, confirmDividendsIncentivesEstimateCommand.OrgId, confirmDividendsIncentivesEstimateCommand.UserId); err != nil {
  508 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  509 + } else {
  510 + operator = data
  511 + }
  512 +
496 // 分红订单仓储初始化 513 // 分红订单仓储初始化
497 var dividendsOrderRepository domain.DividendsOrderRepository 514 var dividendsOrderRepository domain.DividendsOrderRepository
498 if value, err := factory.CreateDividendsOrderRepository(map[string]interface{}{ 515 if value, err := factory.CreateDividendsOrderRepository(map[string]interface{}{
@@ -566,9 +583,9 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent @@ -566,9 +583,9 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
566 for _, orderGood := range orderGoods { 583 for _, orderGood := range orderGoods {
567 dividendsEstimate := &domain.DividendsEstimate{} 584 dividendsEstimate := &domain.DividendsEstimate{}
568 if orderGood.DividendsOrderNumber != "" { // 查询分红订单 585 if orderGood.DividendsOrderNumber != "" { // 查询分红订单
569 - dividendsOrder, err := dividendsOrderRepository.FindOne(map[string]interface{}{"dividendsOrderNumber": orderGood.DividendsOrderNumber})  
570 - if err != nil {  
571 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 586 + dividendsOrder, err3 := dividendsOrderRepository.FindOne(map[string]interface{}{"dividendsOrderNumber": orderGood.DividendsOrderNumber})
  587 + if err3 != nil {
  588 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "分红订单不存在")
572 } 589 }
573 if dividendsOrder == nil { 590 if dividendsOrder == nil {
574 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", orderGood.DividendsOrderNumber)) 591 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", orderGood.DividendsOrderNumber))
@@ -598,7 +615,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent @@ -598,7 +615,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
598 DividendsStage: dividendsEstimateDetail.DividendsStage, 615 DividendsStage: dividendsEstimateDetail.DividendsStage,
599 Org: organization, 616 Org: organization,
600 Company: company, 617 Company: company,
601 - Operator: nil, 618 + Operator: operator,
602 OperateTime: time.Time{}, 619 OperateTime: time.Time{},
603 IsCanceled: false, 620 IsCanceled: false,
604 CreatedAt: time.Now(), 621 CreatedAt: time.Now(),
@@ -641,7 +658,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent @@ -641,7 +658,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
641 DividendsStage: dividendsReturnedEstimateDetail.DividendsStage, 658 DividendsStage: dividendsReturnedEstimateDetail.DividendsStage,
642 Org: organization, 659 Org: organization,
643 Company: company, 660 Company: company,
644 - Operator: nil, 661 + Operator: operator,
645 OperateTime: time.Time{}, 662 OperateTime: time.Time{},
646 IsCanceled: false, 663 IsCanceled: false,
647 CreatedAt: time.Now(), 664 CreatedAt: time.Now(),
@@ -5,6 +5,7 @@ import ( @@ -5,6 +5,7 @@ import (
5 "github.com/beego/beego/v2/core/validation" 5 "github.com/beego/beego/v2/core/validation"
6 "reflect" 6 "reflect"
7 "strings" 7 "strings"
  8 + "time"
8 ) 9 )
9 10
10 type OrderGoods struct { 11 type OrderGoods struct {
@@ -30,7 +31,7 @@ type CreateDividendsOrderCommand struct { @@ -30,7 +31,7 @@ type CreateDividendsOrderCommand struct {
30 // 分红订单原单号 31 // 分红订单原单号
31 DividendsOriginalOrderNum string `cname:"源单号" json:"dividendsOriginalOrderNum" valid:"Required"` 32 DividendsOriginalOrderNum string `cname:"源单号" json:"dividendsOriginalOrderNum" valid:"Required"`
32 // 订单时间 33 // 订单时间
33 - OrderTime string `cname:"订单时间" json:"orderTime" valid:"Required"` 34 + OrderTime time.Time `cname:"订单时间" json:"orderTime" valid:"Required"`
34 // 备注 35 // 备注
35 Remarks string `cname:"备注" json:"remarks" valid:"Required"` 36 Remarks string `cname:"备注" json:"remarks" valid:"Required"`
36 // 订单区域名称 37 // 订单区域名称
@@ -136,9 +136,9 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD @@ -136,9 +136,9 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD
136 dividendsOrderAmount = dividendsOrderAmount + orderGood.OrderGoodAmount 136 dividendsOrderAmount = dividendsOrderAmount + orderGood.OrderGoodAmount
137 } 137 }
138 138
139 - // 订单时间转换  
140 - orderTimeInt, _ := strconv.ParseInt(createDividendsOrderCommand.OrderTime, 10, 64)  
141 - orderTime := utils.TransformTimestampToTime(orderTimeInt) 139 + //// 订单时间转换
  140 + //orderTimeInt, _ := strconv.ParseInt(createDividendsOrderCommand.OrderTime, 10, 64)
  141 + //orderTime := utils.TransformTimestampToTime(orderTimeInt)
142 142
143 // 新增分红订单 143 // 新增分红订单
144 newDividendsOrder := &domain.DividendsOrder{ 144 newDividendsOrder := &domain.DividendsOrder{
@@ -146,7 +146,7 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD @@ -146,7 +146,7 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD
146 DividendsOrderNumber: dividendsOrderNumber, 146 DividendsOrderNumber: dividendsOrderNumber,
147 DividendsOriginalOrderNum: createDividendsOrderCommand.DividendsOriginalOrderNum, 147 DividendsOriginalOrderNum: createDividendsOrderCommand.DividendsOriginalOrderNum,
148 DividendsOrderAmount: dividendsOrderAmount, 148 DividendsOrderAmount: dividendsOrderAmount,
149 - OrderTime: orderTime, 149 + OrderTime: createDividendsOrderCommand.OrderTime,
150 DividendTime: time.Time{}, 150 DividendTime: time.Time{},
151 DividendStatus: domain.TO_BE_DIVIDEND, 151 DividendStatus: domain.TO_BE_DIVIDEND,
152 Region: &domain.RegionInfo{ 152 Region: &domain.RegionInfo{
@@ -44,7 +44,7 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo @@ -44,7 +44,7 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo
44 // 获取合约 44 // 获取合约
45 cooperationContract, err := cooperationContractRepository.FindOne(map[string]interface{}{"cooperationContractNumber": orderGood.CooperationContractNumber}) 45 cooperationContract, err := cooperationContractRepository.FindOne(map[string]interface{}{"cooperationContractNumber": orderGood.CooperationContractNumber})
46 if err != nil { 46 if err != nil {
47 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 47 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创合约不存在")
48 } 48 }
49 if cooperationContract == nil { 49 if cooperationContract == nil {
50 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", orderGood.CooperationContractNumber)) 50 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", orderGood.CooperationContractNumber))
@@ -55,7 +55,7 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo @@ -55,7 +55,7 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo
55 "dividendsOrderNumber": orderGood.DividendsOrderNumber, 55 "dividendsOrderNumber": orderGood.DividendsOrderNumber,
56 }) 56 })
57 if err2 != nil { 57 if err2 != nil {
58 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 58 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "分红订单不存在")
59 } 59 }
60 if dividendsOrder == nil { 60 if dividendsOrder == nil {
61 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", orderGood.DividendsOrderNumber)) 61 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", orderGood.DividendsOrderNumber))
@@ -68,6 +68,10 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo @@ -68,6 +68,10 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo
68 break 68 break
69 } 69 }
70 } 70 }
  71 + if dividendsIncentivesRuleMatched == nil {
  72 + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, "未匹配到分红规则")
  73 + }
  74 +
71 // 计算分红 75 // 计算分红
72 if dividendsIncentivesRuleMatched != nil { 76 if dividendsIncentivesRuleMatched != nil {
73 for _, undertaker := range cooperationContract.Undertakers { 77 for _, undertaker := range cooperationContract.Undertakers {
@@ -143,7 +147,7 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo @@ -143,7 +147,7 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo
143 "dividendsReturnedOrderNumber": orderGood.DividendsReturnedOrderNumber, 147 "dividendsReturnedOrderNumber": orderGood.DividendsReturnedOrderNumber,
144 }) 148 })
145 if err3 != nil { 149 if err3 != nil {
146 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 150 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "分红退货单不存在")
147 } 151 }
148 if dividendsReturnedOrder == nil { 152 if dividendsReturnedOrder == nil {
149 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", orderGood.DividendsReturnedOrderNumber)) 153 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", orderGood.DividendsReturnedOrderNumber))
@@ -23,7 +23,7 @@ type CooperationContractChangeLog struct { @@ -23,7 +23,7 @@ type CooperationContractChangeLog struct {
23 Company *domain.Company `comment:"公司"` 23 Company *domain.Company `comment:"公司"`
24 // 组织机构 24 // 组织机构
25 Org *domain.Org `comment:"组织"` 25 Org *domain.Org `comment:"组织"`
26 - // 操作人 26 + //
27 Operator *domain.User `comment:"操作人"` 27 Operator *domain.User `comment:"操作人"`
28 // 操作时间 28 // 操作时间
29 OperatorTime time.Time `comment:"操作时间"` 29 OperatorTime time.Time `comment:"操作时间"`
@@ -56,12 +56,12 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di @@ -56,12 +56,12 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di
56 updateFieldsSnippet := sqlbuilder.SqlUpdateFieldsSnippet(updateFields) 56 updateFieldsSnippet := sqlbuilder.SqlUpdateFieldsSnippet(updateFields)
57 tx := repository.transactionContext.PgTx 57 tx := repository.transactionContext.PgTx
58 if dividendsEstimate.Identify() == nil { 58 if dividendsEstimate.Identify() == nil {
59 - //dividendsEstimateId, err := repository.nextIdentify()  
60 - //if err != nil {  
61 - // return dividendsEstimate, err  
62 - //} else {  
63 - // dividendsEstimate.DividendsEstimateId = dividendsEstimateId  
64 - //} 59 + dividendsEstimateId, err := repository.nextIdentify()
  60 + if err != nil {
  61 + return dividendsEstimate, err
  62 + } else {
  63 + dividendsEstimate.DividendsEstimateId = dividendsEstimateId
  64 + }
65 if _, err := tx.QueryOne( 65 if _, err := tx.QueryOne(
66 pg.Scan( 66 pg.Scan(
67 &dividendsEstimate.DividendsEstimateId, 67 &dividendsEstimate.DividendsEstimateId,