作者 yangfu

共创合约反馈修改

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