作者 陈志颖

fix:修复返回参数问题

@@ -101,6 +101,7 @@ func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) Crea @@ -101,6 +101,7 @@ func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) Crea
101 FeedbackContent: createContractUndertakerFeedbackCommand.FeedbackContent, 101 FeedbackContent: createContractUndertakerFeedbackCommand.FeedbackContent,
102 CooperationContractNumber: createContractUndertakerFeedbackCommand.CooperationContractNumber, 102 CooperationContractNumber: createContractUndertakerFeedbackCommand.CooperationContractNumber,
103 CooperationContractName: cooperationContract.CooperationContractName, 103 CooperationContractName: cooperationContract.CooperationContractName,
  104 + CooperationModeName: cooperationContract.CooperationMode.CooperationModeName,
104 ContractUndertaker: undertaker, 105 ContractUndertaker: undertaker,
105 Company: company, 106 Company: company,
106 Org: organization, 107 Org: organization,
@@ -121,9 +121,17 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro @@ -121,9 +121,17 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro
121 organization = data 121 organization = data
122 } 122 }
123 123
  124 + // 部门REST服务初始化
  125 + var departmentService service.DepartmentService
  126 + if value, err := factory.CreateDepartmentService(map[string]interface{}{}); err != nil {
  127 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  128 + } else {
  129 + departmentService = value
  130 + }
  131 +
124 // 获取部门信息 132 // 获取部门信息
125 - var department *domain.Org  
126 - if data, err := organizationService.OrgFrom(createCooperationProjectCommand.CompanyId, createCooperationProjectCommand.DepartmentId); err != nil { 133 + var department *domain.Department
  134 + if data, err := departmentService.DepartmentFrom(createCooperationProjectCommand.CompanyId, createCooperationProjectCommand.DepartmentId); err != nil {
127 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取部门信息失败") 135 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取部门信息失败")
128 } else { 136 } else {
129 department = data 137 department = data
@@ -179,7 +187,7 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro @@ -179,7 +187,7 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro
179 CooperationProjectPublishTime: time.Now(), 187 CooperationProjectPublishTime: time.Now(),
180 Attachment: createCooperationProjectCommand.Attachment, 188 Attachment: createCooperationProjectCommand.Attachment,
181 Company: company, 189 Company: company,
182 - Department: department.ToDepartment(), 190 + Department: department,
183 Org: organization, 191 Org: organization,
184 Operator: operator, 192 Operator: operator,
185 OperateTime: time.Now(), 193 OperateTime: time.Now(),
@@ -377,13 +385,13 @@ func (cooperationProjectService *CooperationProjectService) RemoveCooperationPro @@ -377,13 +385,13 @@ func (cooperationProjectService *CooperationProjectService) RemoveCooperationPro
377 if cooperationProject == nil { 385 if cooperationProject == nil {
378 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(removeCooperationProjectCommand.CooperationProjectId, 10))) 386 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(removeCooperationProjectCommand.CooperationProjectId, 10)))
379 } 387 }
380 - if cooperationProject, err := cooperationProjectRepository.Remove(cooperationProject); err != nil { 388 + if cooperationProjectRemoved, err := cooperationProjectRepository.Remove(cooperationProject); err != nil {
381 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 389 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
382 } else { 390 } else {
383 if err := transactionContext.CommitTransaction(); err != nil { 391 if err := transactionContext.CommitTransaction(); err != nil {
384 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 392 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
385 } 393 }
386 - return cooperationProject, nil 394 + return cooperationProjectRemoved, nil
387 } 395 }
388 } 396 }
389 397
@@ -417,10 +425,8 @@ func (cooperationProjectService *CooperationProjectService) SearchCooperationPro @@ -417,10 +425,8 @@ func (cooperationProjectService *CooperationProjectService) SearchCooperationPro
417 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 425 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
418 } 426 }
419 return map[string]interface{}{ 427 return map[string]interface{}{
420 - //"grid": map[string]interface{}{  
421 "total": count, 428 "total": count,
422 "list": cooperationProjects, 429 "list": cooperationProjects,
423 - //},  
424 }, nil 430 }, nil
425 } 431 }
426 } 432 }
@@ -507,13 +513,13 @@ func (cooperationProjectService *CooperationProjectService) EndCooperationProjec @@ -507,13 +513,13 @@ func (cooperationProjectService *CooperationProjectService) EndCooperationProjec
507 if err := cooperationProject.Update(tool_funs.SimpleStructToMap(updateCooperationProjectCommand)); err != nil { 513 if err := cooperationProject.Update(tool_funs.SimpleStructToMap(updateCooperationProjectCommand)); err != nil {
508 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 514 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
509 } 515 }
510 - if cooperationProject, err := cooperationProjectRepository.Save(cooperationProject); err != nil { 516 + if cooperationProjectSaved, err := cooperationProjectRepository.Save(cooperationProject); err != nil {
511 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 517 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
512 } else { 518 } else {
513 if err := transactionContext.CommitTransaction(); err != nil { 519 if err := transactionContext.CommitTransaction(); err != nil {
514 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 520 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
515 } 521 }
516 - return cooperationProject, nil 522 + return cooperationProjectSaved, nil
517 } 523 }
518 } 524 }
519 525
@@ -34,7 +34,7 @@ type CreateDividendsOrderCommand struct { @@ -34,7 +34,7 @@ type CreateDividendsOrderCommand struct {
34 // 订单时间 34 // 订单时间
35 OrderTime string `cname:"订单时间" json:"orderTime" valid:"Required"` 35 OrderTime string `cname:"订单时间" json:"orderTime" valid:"Required"`
36 // 备注 36 // 备注
37 - Remarks string `cname:"备注" json:"remarks" valid:"Required"` 37 + Remarks string `cname:"备注" json:"remarks,omitempty"`
38 // 订单区域名称 38 // 订单区域名称
39 RegionName string `cname:"订单区域名称" json:"regionName,omitempty"` 39 RegionName string `cname:"订单区域名称" json:"regionName,omitempty"`
40 // 订单操作人uid 40 // 订单操作人uid
@@ -14,6 +14,8 @@ type ContractUndertakerFeedback struct { @@ -14,6 +14,8 @@ type ContractUndertakerFeedback struct {
14 CooperationContractNumber string `json:"cooperationContractNumber"` 14 CooperationContractNumber string `json:"cooperationContractNumber"`
15 // 项目合约名称 15 // 项目合约名称
16 CooperationContractName string `json:"cooperationContractName"` 16 CooperationContractName string `json:"cooperationContractName"`
  17 + // 共创模式名称
  18 + CooperationModeName string `json:"cooperationModeName"`
17 // 共创合约承接人 19 // 共创合约承接人
18 ContractUndertaker *Undertaker `json:"contractUndertaker"` 20 ContractUndertaker *Undertaker `json:"contractUndertaker"`
19 // 数据所属组织机构 21 // 数据所属组织机构
@@ -12,4 +12,6 @@ type UserInfo struct { @@ -12,4 +12,6 @@ type UserInfo struct {
12 UserPhone string `json:"userPhone"` 12 UserPhone string `json:"userPhone"`
13 // 用户账号,区别于手机号,冗余字段 13 // 用户账号,区别于手机号,冗余字段
14 UserAccount string `json:"userAccount"` 14 UserAccount string `json:"userAccount"`
  15 + // 用户编码
  16 + UserCode string `json:"用户编码"`
15 } 17 }
@@ -207,6 +207,7 @@ func (translator *UserTranslator) ToUndertakerFromRepresentation(user *UserDetai @@ -207,6 +207,7 @@ func (translator *UserTranslator) ToUndertakerFromRepresentation(user *UserDetai
207 UserName: user.UserInfo.UserName, 207 UserName: user.UserInfo.UserName,
208 UserPhone: user.UserInfo.Phone, 208 UserPhone: user.UserInfo.Phone,
209 UserAccount: "", 209 UserAccount: "",
  210 + UserCode: user.UserCode,
210 }, 211 },
211 UserType: user.UserType, 212 UserType: user.UserType,
212 UserName: user.UserInfo.UserName, 213 UserName: user.UserInfo.UserName,