...
|
...
|
@@ -940,24 +940,16 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC |
|
|
}
|
|
|
|
|
|
// 获取待更新的共创合约
|
|
|
cooperationContract, err8 := cooperationContractRepository.FindOne(map[string]interface{}{
|
|
|
cooperationContractFound, err8 := cooperationContractRepository.FindOne(map[string]interface{}{
|
|
|
"cooperationContractId": updateCooperationContractCommand.CooperationContractId,
|
|
|
})
|
|
|
if err8 != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创合约不存在")
|
|
|
}
|
|
|
if cooperationContract == nil {
|
|
|
if cooperationContractFound == nil {
|
|
|
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(updateCooperationContractCommand.CooperationContractId)))
|
|
|
}
|
|
|
|
|
|
// 缓存共创合约
|
|
|
cooperationContractFound := cooperationContract
|
|
|
|
|
|
// 更新合约基础信息
|
|
|
if err9 := cooperationContract.Update(tool_funs.SimpleStructToMap(updateCooperationContractCommand)); err9 != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err9.Error())
|
|
|
}
|
|
|
|
|
|
// 用户REST服务初始化
|
|
|
var userService service.UserService
|
|
|
if value, err10 := factory.CreateUserService(map[string]interface{}{}); err10 != nil {
|
...
|
...
|
@@ -986,6 +978,22 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC |
|
|
operator = data
|
|
|
}
|
|
|
|
|
|
// 获取待更新的共创合约
|
|
|
cooperationContract, err8 := cooperationContractRepository.FindOne(map[string]interface{}{
|
|
|
"cooperationContractId": updateCooperationContractCommand.CooperationContractId,
|
|
|
})
|
|
|
if err8 != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创合约不存在")
|
|
|
}
|
|
|
if cooperationContract == nil {
|
|
|
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(updateCooperationContractCommand.CooperationContractId)))
|
|
|
}
|
|
|
|
|
|
// 更新合约基础信息
|
|
|
if err9 := cooperationContract.Update(tool_funs.SimpleStructToMap(updateCooperationContractCommand)); err9 != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err9.Error())
|
|
|
}
|
|
|
|
|
|
// 更新发起人
|
|
|
cooperationContract.CooperationContractSponsor = sponsor
|
|
|
|
...
|
...
|
|