作者 yangfu

共创合约反馈修改

@@ -15,13 +15,15 @@ type CreateContractUndertakerFeedbackCommand struct { @@ -15,13 +15,15 @@ type CreateContractUndertakerFeedbackCommand struct {
15 // 合约承接方反馈内容 15 // 合约承接方反馈内容
16 FeedbackContent string `cname:"合约承接方反馈内容" json:"feedbackContent" valid:"Required"` 16 FeedbackContent string `cname:"合约承接方反馈内容" json:"feedbackContent" valid:"Required"`
17 // 共创合约编号 17 // 共创合约编号
  18 + CooperationContractId int64 `cname:"共创合约编号" json:"cooperationContractId"`
  19 + // 共创合约编号
18 CooperationContractNumber string `cname:"共创合约编号" json:"cooperationContractNumber" valid:"Required"` 20 CooperationContractNumber string `cname:"共创合约编号" json:"cooperationContractNumber" valid:"Required"`
19 // 承接人uid 21 // 承接人uid
20 UnderTakerUid string `cname:"承接人uid" json:"underTakerUid,omitempty"` 22 UnderTakerUid string `cname:"承接人uid" json:"underTakerUid,omitempty"`
21 // 公司ID,通过集成REST上下文获取 23 // 公司ID,通过集成REST上下文获取
22 - CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"` 24 + CompanyId int64 `cname:"公司ID" json:"companyId" `
23 // 组织机构ID 25 // 组织机构ID
24 - OrgId int64 `cname:"组织机构ID" json:"orgId" valid:"Required"` 26 + OrgId int64 `cname:"组织机构ID" json:"orgId"`
25 // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 27 // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
26 UserId int64 `cname:"用户ID" json:"userId" valid:"Required"` 28 UserId int64 `cname:"用户ID" json:"userId" valid:"Required"`
27 // 用户基础数据id 29 // 用户基础数据id
@@ -3,12 +3,14 @@ package service @@ -3,12 +3,14 @@ package service
3 import ( 3 import (
4 "fmt" 4 "fmt"
5 "github.com/linmadan/egglib-go/core/application" 5 "github.com/linmadan/egglib-go/core/application"
  6 + "github.com/linmadan/egglib-go/transaction/pg"
6 "github.com/linmadan/egglib-go/utils/tool_funs" 7 "github.com/linmadan/egglib-go/utils/tool_funs"
7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/contractUndertakerFeedback/command" 8 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/contractUndertakerFeedback/command"
8 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/contractUndertakerFeedback/query" 9 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/contractUndertakerFeedback/query"
9 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/factory" 10 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/factory"
10 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain" 11 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
11 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain/service" 12 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain/service"
  13 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/dao"
12 "time" 14 "time"
13 ) 15 )
14 16
@@ -32,6 +34,15 @@ func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) Crea @@ -32,6 +34,15 @@ func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) Crea
32 _ = transactionContext.RollbackTransaction() 34 _ = transactionContext.RollbackTransaction()
33 }() 35 }()
34 36
  37 + contractDao, _ := dao.NewCooperationContractDao(transactionContext.(*pg.TransactionContext))
  38 + contract, err := contractDao.FindOne(map[string]interface{}{
  39 + "cooperationContractId": createContractUndertakerFeedbackCommand.CooperationContractId,
  40 + })
  41 + if err != nil {
  42 + return nil, application.ThrowError(application.TRANSACTION_ERROR, "合约不存在")
  43 + }
  44 + createContractUndertakerFeedbackCommand.CompanyId = contract.Company.CompanyId
  45 + createContractUndertakerFeedbackCommand.OrgId = contract.Org.OrgId
35 // 用户REST服务初始化 46 // 用户REST服务初始化
36 var userService service.UserService 47 var userService service.UserService
37 if value, err := factory.CreateUserService(map[string]interface{}{}); err != nil { 48 if value, err := factory.CreateUserService(map[string]interface{}{}); err != nil {