作者 yangfu

Merge branch 'dev' of http://gitlab.fjmaimaimai.com/allied-creation/allied-creat…

…ion-cooperation into dev
... ... @@ -19,13 +19,13 @@ type CreateContractUndertakerFeedbackCommand struct {
// 承接人uid
UnderTakerUid string `cname:"承接人uid" json:"underTakerUid,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID,通过集成REST上下文获取" json:"companyId,string" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId,string" valid:"Required"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId,string" valid:"Required"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员" json:"userId,string" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId,string" valid:"Required"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据is" json:"userBaseId,string" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"`
}
func (createContractUndertakerFeedbackCommand *CreateContractUndertakerFeedbackCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -12,15 +12,15 @@ type RemoveContractUndertakerFeedbackCommand struct {
// 合约承接方反馈记录ID
FeedbackId string `cname:"合约承接方反馈记录ID" json:"feedbackId" valid:"Required"`
// 承接人uid
UnderTakerUid string `cname:"承接人uid" json:"underTakerUid,omitempty"`
UnderTakerUid string `cname:"承接人UID" json:"underTakerUid,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID,通过集成REST上下文获取" json:"companyId,string" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId,string" valid:"Required"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId,string" valid:"Required"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员" json:"userId,string" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId,string" valid:"Required"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据is" json:"userBaseId,string" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据" json:"userBaseId,string" valid:"Required"`
}
func (removeContractUndertakerFeedbackCommand *RemoveContractUndertakerFeedbackCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -11,7 +11,7 @@ import (
type UpdateContractUndertakerFeedbackCommand struct {
// 合约承接方信息反馈id
FeedbackId string `cname:"合约承接方反馈信息id" json:"feedbackId" valid:"Required"`
FeedbackId string `cname:"合约承接方反馈信息ID" json:"feedbackId" valid:"Required"`
// 合约承接方反馈内容附件
FeedbackAttachment []*domain.Attachment `cname:"合约承接方反馈内容附件" json:"feedbackAttachment" valid:"Required"`
// 合约承接方反馈内容
... ... @@ -19,15 +19,15 @@ type UpdateContractUndertakerFeedbackCommand struct {
// 共创合约编号
CooperationContractNumber string `cname:"共创合约编号" json:"cooperationContractNumber" valid:"Required"`
// 承接人用户uid
UnderTakerUid string `cname:"承接人用户uid" json:"underTakerUid,omitempty"`
UnderTakerUid string `cname:"承接人用户UID" json:"underTakerUid,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID,通过集成REST上下文获取" json:"companyId,string" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId,string" valid:"Required"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId,string" valid:"Required"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员" json:"userId,string" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId,string" valid:"Required"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据is" json:"userBaseId,string" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"`
}
func (updateContractUndertakerFeedbackCommand *UpdateContractUndertakerFeedbackCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -12,15 +12,15 @@ type GetContractUndertakerFeedbackQuery struct {
// 合约承接方反馈记录ID
FeedbackId string `cname:"合约承接方反馈记录ID" json:"feedbackId" valid:"Required"`
// 承接人uid
UnderTakerUid string `cname:"承接人uid" json:"underTakerUid,omitempty"`
UnderTakerUid string `cname:"承接人UID" json:"underTakerUid,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID,通过集成REST上下文获取" json:"companyId,string" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId,string" valid:"Required"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId,string" valid:"Required"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员" json:"userId,string" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId,string" valid:"Required"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据is" json:"userBaseId,string" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"`
}
func (getContractUndertakerFeedbackQuery *GetContractUndertakerFeedbackQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -10,19 +10,19 @@ import (
type ListContractUndertakerFeedbackQuery struct {
// 页面大小
PageNumber int64 `cname:"页面大小" json:"pageNumber,omitempty"`
PageNumber int64 `cname:"页" json:"pageNumber,omitempty"`
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
// 承接人uid
UnderTakerUid string `cname:"承接人uid" json:"underTakerUid" valid:"Required"`
UnderTakerUid string `cname:"承接人UID" json:"underTakerUid,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID,通过集成REST上下文获取" json:"companyId,string" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId,string" valid:"Required"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId,string" valid:"Required"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员" json:"userId,string" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId,string" valid:"Required"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据is" json:"userBaseId,string" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"`
}
func (listContractUndertakerFeedbackQuery *ListContractUndertakerFeedbackQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -10,21 +10,21 @@ import (
type SearchContractUndertakerFeedbackQuery struct {
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID,通过集成REST上下文获取" json:"companyId,string" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId,string" valid:"Required"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId,string" valid:"Required"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
UserId int64 `cname:"用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员" json:"userId,string" valid:"Required"`
UserId int64 `cname:"用户ID" json:"userId,string" valid:"Required"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据is" json:"userBaseId,string" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"`
// 共创合约名称
CooperationContractName string `cname:"共创合约名称" json:"cooperationContractName" valid:"Required"`
CooperationContractName string `cname:"共创合约名称" json:"cooperationContractName,omitempty"`
// 承接人姓名
UndertakerName string `cname:"承接人姓名" json:"undertakerName,omitempty"`
// 查询关键词
MatchWord string `cname:"查询关键词" json:"matchWord,omitempty"`
// 页面大小
PageNumber int64 `cname:"页面大小" json:"pageNumber,omitempty"`
PageNumber int64 `cname:"页" json:"pageNumber,omitempty"`
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
}
... ...
... ... @@ -240,10 +240,27 @@ func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) Sear
defer func() {
_ = transactionContext.RollbackTransaction()
}()
var contractUndertakerFeedbackRepository domain.ContractUndertakerFeedbackRepository
if value, err := factory.CreateContractUndertakerFeedbackRepository(map[string]interface{}{
"transactionContext": transactionContext,
}); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
contractUndertakerFeedbackRepository = value
}
if count, contractUndertakerFeedbacks, err := contractUndertakerFeedbackRepository.Find(tool_funs.SimpleStructToMap(searchContractUndertakerFeedbackQuery)); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return nil, nil
return map[string]interface{}{
"grid": map[string]interface{}{
"total": count,
"list": contractUndertakerFeedbacks,
},
}, nil
}
}
// UpdateContractUndertakerFeedback 更新共创合约反馈服务
... ...
... ... @@ -14,8 +14,6 @@ type ContractUndertakerFeedback struct {
CooperationContractNumber string `json:"cooperationContractNumber"`
// 共创合约承接人
ContractUndertaker *Undertaker `json:"contractUndertaker"`
// 共创模式
CooperationMode *CooperationMode `json:"cooperationMode"`
// 数据所属组织机构
Org *Org `json:"org"`
// 公司
... ... @@ -52,11 +50,5 @@ func (contractUndertakerFeedback *ContractUndertakerFeedback) Update(data map[st
if cooperationContractNumber, ok := data["cooperationContractNumber"]; ok {
contractUndertakerFeedback.CooperationContractNumber = cooperationContractNumber.(string)
}
if status, ok := data["status"]; ok {
contractUndertakerFeedback.CooperationMode.Status = status.(int32)
}
if remarks, ok := data["remarks"]; ok {
contractUndertakerFeedback.CooperationMode.Remarks = remarks.(string)
}
return nil
}
... ...
... ... @@ -17,8 +17,6 @@ type ContractUndertakerFeedback struct {
CooperationContractNumber string `comment:"共创合约编号"`
// 共创合约承接人
ContractUndertaker *domain.Undertaker `comment:"共创合约承接人"`
// 共创模式编号
CooperationModeNumber string `comment:"共创模式编号"`
// 数据所属组织机构
Org *domain.Org `comment:"数据所属组织机构"`
// 公司
... ...
... ... @@ -6,28 +6,27 @@ import (
)
func TransformToContractUndertakerFeedbackDomainModelFromPgModels(
contractUndertakerFeedbackModel *models.ContractUndertakerFeedback,
cooperationMode *models.CooperationMode) (*domain.ContractUndertakerFeedback, error) {
contractUndertakerFeedbackModel *models.ContractUndertakerFeedback) (*domain.ContractUndertakerFeedback, error) {
return &domain.ContractUndertakerFeedback{
FeedbackId: contractUndertakerFeedbackModel.FeedbackId,
FeedbackAttachment: contractUndertakerFeedbackModel.FeedbackAttachment,
FeedbackContent: contractUndertakerFeedbackModel.FeedbackContent,
CooperationContractNumber: contractUndertakerFeedbackModel.CooperationContractNumber,
ContractUndertaker: contractUndertakerFeedbackModel.ContractUndertaker,
CooperationMode: &domain.CooperationMode{
CooperationModeId: cooperationMode.CooperationModeId,
CooperationModeNumber: cooperationMode.CooperationModeNumber,
CooperationModeName: cooperationMode.CooperationModeName,
Status: cooperationMode.Status,
Org: cooperationMode.Org,
Company: cooperationMode.Company,
Remarks: cooperationMode.Remarks,
Operator: cooperationMode.Operator,
OperateTime: cooperationMode.OperateTime,
UpdatedAt: cooperationMode.UpdatedAt,
DeletedAt: cooperationMode.DeletedAt,
CreatedAt: cooperationMode.CreatedAt,
},
//CooperationMode: &domain.CooperationMode{
// CooperationModeId: cooperationMode.CooperationModeId,
// CooperationModeNumber: cooperationMode.CooperationModeNumber,
// CooperationModeName: cooperationMode.CooperationModeName,
// Status: cooperationMode.Status,
// Org: cooperationMode.Org,
// Company: cooperationMode.Company,
// Remarks: cooperationMode.Remarks,
// Operator: cooperationMode.Operator,
// OperateTime: cooperationMode.OperateTime,
// UpdatedAt: cooperationMode.UpdatedAt,
// DeletedAt: cooperationMode.DeletedAt,
// CreatedAt: cooperationMode.CreatedAt,
//},
Org: contractUndertakerFeedbackModel.Org,
Company: contractUndertakerFeedbackModel.Company,
UpdatedAt: contractUndertakerFeedbackModel.UpdatedAt,
... ...
... ... @@ -24,6 +24,7 @@ func (repository *ContractUndertakerFeedbackRepository) nextIdentify() (int64, e
id, err := IdWorker.NextId()
return id, err
}
func (repository *ContractUndertakerFeedbackRepository) Save(contractUndertakerFeedback *domain.ContractUndertakerFeedback) (*domain.ContractUndertakerFeedback, error) {
sqlBuildFields := []string{
"feedback_id",
... ... @@ -31,7 +32,6 @@ func (repository *ContractUndertakerFeedbackRepository) Save(contractUndertakerF
"feedback_content",
"cooperation_contract_number",
"contract_undertaker",
"cooperation_mode",
"org",
"company",
"updated_at",
... ... @@ -58,7 +58,6 @@ func (repository *ContractUndertakerFeedbackRepository) Save(contractUndertakerF
&contractUndertakerFeedback.FeedbackContent,
&contractUndertakerFeedback.CooperationContractNumber,
&contractUndertakerFeedback.ContractUndertaker,
&contractUndertakerFeedback.CooperationMode,
&contractUndertakerFeedback.Org,
&contractUndertakerFeedback.Company,
&contractUndertakerFeedback.UpdatedAt,
... ... @@ -71,11 +70,10 @@ func (repository *ContractUndertakerFeedbackRepository) Save(contractUndertakerF
contractUndertakerFeedback.FeedbackContent,
contractUndertakerFeedback.CooperationContractNumber,
contractUndertakerFeedback.ContractUndertaker,
contractUndertakerFeedback.CooperationMode,
contractUndertakerFeedback.Org,
contractUndertakerFeedback.Company,
contractUndertakerFeedback.UpdatedAt,
contractUndertakerFeedback.DeletedAt,
nil,
contractUndertakerFeedback.CreatedAt,
); err != nil {
return contractUndertakerFeedback, err
... ... @@ -88,7 +86,6 @@ func (repository *ContractUndertakerFeedbackRepository) Save(contractUndertakerF
&contractUndertakerFeedback.FeedbackContent,
&contractUndertakerFeedback.CooperationContractNumber,
&contractUndertakerFeedback.ContractUndertaker,
&contractUndertakerFeedback.CooperationMode,
&contractUndertakerFeedback.Org,
&contractUndertakerFeedback.Company,
&contractUndertakerFeedback.UpdatedAt,
... ... @@ -101,11 +98,10 @@ func (repository *ContractUndertakerFeedbackRepository) Save(contractUndertakerF
contractUndertakerFeedback.FeedbackContent,
contractUndertakerFeedback.CooperationContractNumber,
contractUndertakerFeedback.ContractUndertaker,
contractUndertakerFeedback.CooperationMode,
contractUndertakerFeedback.Org,
contractUndertakerFeedback.Company,
contractUndertakerFeedback.UpdatedAt,
contractUndertakerFeedback.DeletedAt,
nil,
contractUndertakerFeedback.CreatedAt,
contractUndertakerFeedback.Identify(),
); err != nil {
... ... @@ -114,6 +110,7 @@ func (repository *ContractUndertakerFeedbackRepository) Save(contractUndertakerF
}
return contractUndertakerFeedback, nil
}
func (repository *ContractUndertakerFeedbackRepository) Remove(contractUndertakerFeedback *domain.ContractUndertakerFeedback) (*domain.ContractUndertakerFeedback, error) {
tx := repository.transactionContext.PgTx
contractUndertakerFeedbackModel := new(models.ContractUndertakerFeedback)
... ... @@ -123,11 +120,12 @@ func (repository *ContractUndertakerFeedbackRepository) Remove(contractUndertake
}
return contractUndertakerFeedback, nil
}
func (repository *ContractUndertakerFeedbackRepository) FindOne(queryOptions map[string]interface{}) (*domain.ContractUndertakerFeedback, error) {
tx := repository.transactionContext.PgTx
contractUndertakerFeedbackModel := new(models.ContractUndertakerFeedback)
query := sqlbuilder.BuildQuery(tx.Model(contractUndertakerFeedbackModel), queryOptions)
query.SetWhereByQueryOption("contract_undertaker_feedback.contract_undertaker_feedback_id = ?", "contractUndertakerFeedbackId")
query.SetWhereByQueryOption("contract_undertaker_feedback.feedback_id = ?", "contractUndertakerFeedbackId")
if err := query.First(); err != nil {
if err.Error() == "pg: no rows in result set" {
return nil, fmt.Errorf("没有此资源")
... ... @@ -138,41 +136,43 @@ func (repository *ContractUndertakerFeedbackRepository) FindOne(queryOptions map
if contractUndertakerFeedbackModel.FeedbackId == 0 {
return nil, nil
} else {
// 获取共创模式
cooperationModeModel := new(models.CooperationMode)
cooperationModeQuery := tx.Model(cooperationModeModel)
if err := cooperationModeQuery.Where("cooperation_mode_number = ?", contractUndertakerFeedbackModel.CooperationModeNumber).First(); err != nil {
return nil, err
}
return transform.TransformToContractUndertakerFeedbackDomainModelFromPgModels(contractUndertakerFeedbackModel, cooperationModeModel)
//// 获取共创模式
//cooperationModeModel := new(models.CooperationMode)
//cooperationModeQuery := tx.Model(cooperationModeModel)
//if err := cooperationModeQuery.Where("cooperation_mode_number = ?", contractUndertakerFeedbackModel.CooperationModeNumber).First(); err != nil {
// return nil, err
//}
return transform.TransformToContractUndertakerFeedbackDomainModelFromPgModels(contractUndertakerFeedbackModel)
}
}
func (repository *ContractUndertakerFeedbackRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.ContractUndertakerFeedback, error) {
tx := repository.transactionContext.PgTx
var contractUndertakerFeedbackModels []*models.ContractUndertakerFeedback
contractUndertakerFeedbacks := make([]*domain.ContractUndertakerFeedback, 0)
query := sqlbuilder.BuildQuery(tx.Model(&contractUndertakerFeedbackModels), queryOptions)
query.SetOffsetAndLimit(20)
query.SetOrderDirect("contract_undertaker_feedback_id", "DESC")
query.SetOrderDirect("feedback_id", "DESC")
if count, err := query.SelectAndCount(); err != nil {
return 0, contractUndertakerFeedbacks, err
} else {
for _, contractUndertakerFeedbackModel := range contractUndertakerFeedbackModels {
// 获取共创模式
cooperationModeModel := new(models.CooperationMode)
cooperationModeQuery := tx.Model(cooperationModeModel)
if err := cooperationModeQuery.Where("cooperation_mode_number = ?", contractUndertakerFeedbackModel.CooperationModeNumber).First(); err != nil {
return 0, nil, err
}
if contractUndertakerFeedback, err := transform.TransformToContractUndertakerFeedbackDomainModelFromPgModels(contractUndertakerFeedbackModel, cooperationModeModel); err != nil {
return 0, contractUndertakerFeedbacks, err
} else {
contractUndertakerFeedbacks = append(contractUndertakerFeedbacks, contractUndertakerFeedback)
}
}
//for _, contractUndertakerFeedbackModel := range contractUndertakerFeedbackModels {
// // 获取共创模式
// cooperationModeModel := new(models.CooperationMode)
// cooperationModeQuery := tx.Model(cooperationModeModel)
// if err := cooperationModeQuery.Where("cooperation_mode_number = ?", contractUndertakerFeedbackModel.CooperationModeNumber).First(); err != nil {
// return 0, nil, err
// }
// if contractUndertakerFeedback, err := transform.TransformToContractUndertakerFeedbackDomainModelFromPgModels(contractUndertakerFeedbackModel, cooperationModeModel); err != nil {
// return 0, contractUndertakerFeedbacks, err
// } else {
// contractUndertakerFeedbacks = append(contractUndertakerFeedbacks, contractUndertakerFeedback)
// }
//}
return int64(count), contractUndertakerFeedbacks, nil
}
}
func NewContractUndertakerFeedbackRepository(transactionContext *pgTransaction.TransactionContext) (*ContractUndertakerFeedbackRepository, error) {
if transactionContext == nil {
return nil, fmt.Errorf("transactionContext参数不能为nil")
... ...
... ... @@ -14,7 +14,6 @@ func (controller *ContractUndertakerFeedbackController) CreateContractUndertaker
contractUndertakerFeedbackService := service.NewContractUndertakerFeedbackService(nil)
createContractUndertakerFeedbackCommand := &command.CreateContractUndertakerFeedbackCommand{}
_ = controller.Unmarshal(createContractUndertakerFeedbackCommand)
// 解析头部信息
header := controller.GetRequestHeader(controller.Ctx)
createContractUndertakerFeedbackCommand.CompanyId = header.CompanyId
createContractUndertakerFeedbackCommand.OrgId = header.OrgId
... ... @@ -28,13 +27,11 @@ func (controller *ContractUndertakerFeedbackController) UpdateContractUndertaker
contractUndertakerFeedbackService := service.NewContractUndertakerFeedbackService(nil)
updateContractUndertakerFeedbackCommand := &command.UpdateContractUndertakerFeedbackCommand{}
_ = controller.Unmarshal(updateContractUndertakerFeedbackCommand)
// 解析头部信息
header := controller.GetRequestHeader(controller.Ctx)
updateContractUndertakerFeedbackCommand.CompanyId = header.CompanyId
updateContractUndertakerFeedbackCommand.OrgId = header.OrgId
updateContractUndertakerFeedbackCommand.UserId = header.UserId
updateContractUndertakerFeedbackCommand.UserBaseId = header.UserBaseId
// 解析路径参数
contractUndertakerFeedbackId := controller.GetString(":contractUndertakerFeedbackId")
updateContractUndertakerFeedbackCommand.FeedbackId = contractUndertakerFeedbackId
data, err := contractUndertakerFeedbackService.UpdateContractUndertakerFeedback(updateContractUndertakerFeedbackCommand)
... ... @@ -44,13 +41,11 @@ func (controller *ContractUndertakerFeedbackController) UpdateContractUndertaker
func (controller *ContractUndertakerFeedbackController) GetContractUndertakerFeedback() {
contractUndertakerFeedbackService := service.NewContractUndertakerFeedbackService(nil)
getContractUndertakerFeedbackQuery := &query.GetContractUndertakerFeedbackQuery{}
// 解析头部信息
header := controller.GetRequestHeader(controller.Ctx)
getContractUndertakerFeedbackQuery.CompanyId = header.CompanyId
getContractUndertakerFeedbackQuery.OrgId = header.OrgId
getContractUndertakerFeedbackQuery.UserId = header.UserId
getContractUndertakerFeedbackQuery.UserBaseId = header.UserBaseId
// 解析路径参数
contractUndertakerFeedbackId := controller.GetString(":contractUndertakerFeedbackId")
getContractUndertakerFeedbackQuery.FeedbackId = contractUndertakerFeedbackId
data, err := contractUndertakerFeedbackService.GetContractUndertakerFeedback(getContractUndertakerFeedbackQuery)
... ... @@ -61,13 +56,11 @@ func (controller *ContractUndertakerFeedbackController) RemoveContractUndertaker
contractUndertakerFeedbackService := service.NewContractUndertakerFeedbackService(nil)
removeContractUndertakerFeedbackCommand := &command.RemoveContractUndertakerFeedbackCommand{}
_ = controller.Unmarshal(removeContractUndertakerFeedbackCommand)
// 解析头部信息
header := controller.GetRequestHeader(controller.Ctx)
removeContractUndertakerFeedbackCommand.CompanyId = header.CompanyId
removeContractUndertakerFeedbackCommand.OrgId = header.OrgId
removeContractUndertakerFeedbackCommand.UserId = header.UserId
removeContractUndertakerFeedbackCommand.UserBaseId = header.UserBaseId
// 解析路径参数
contractUndertakerFeedbackId := controller.GetString(":contractUndertakerFeedbackId")
removeContractUndertakerFeedbackCommand.FeedbackId = contractUndertakerFeedbackId
data, err := contractUndertakerFeedbackService.RemoveContractUndertakerFeedback(removeContractUndertakerFeedbackCommand)
... ... @@ -77,17 +70,12 @@ func (controller *ContractUndertakerFeedbackController) RemoveContractUndertaker
func (controller *ContractUndertakerFeedbackController) SearchContractUndertakerFeedback() {
contractUndertakerFeedbackService := service.NewContractUndertakerFeedbackService(nil)
searchContractUndertakerFeedbackQuery := &query.SearchContractUndertakerFeedbackQuery{}
// 解析头部信息
_ = controller.Unmarshal(searchContractUndertakerFeedbackQuery)
header := controller.GetRequestHeader(controller.Ctx)
searchContractUndertakerFeedbackQuery.CompanyId = header.CompanyId
searchContractUndertakerFeedbackQuery.OrgId = header.OrgId
searchContractUndertakerFeedbackQuery.UserId = header.UserId
searchContractUndertakerFeedbackQuery.UserBaseId = header.UserBaseId
// 获取路径参数
pageSize, _ := controller.GetInt64("pageSize")
searchContractUndertakerFeedbackQuery.PageSize = pageSize
pageNumber, _ := controller.GetInt64("pageNumber")
searchContractUndertakerFeedbackQuery.PageNumber = pageNumber
data, err := contractUndertakerFeedbackService.SearchContractUndertakerFeedback(searchContractUndertakerFeedbackQuery)
controller.Response(data, err)
}
... ... @@ -95,17 +83,17 @@ func (controller *ContractUndertakerFeedbackController) SearchContractUndertaker
func (controller *ContractUndertakerFeedbackController) ListContractUndertakerFeedback() {
contractUndertakerFeedbackService := service.NewContractUndertakerFeedbackService(nil)
listContractUndertakerFeedbackQuery := &query.ListContractUndertakerFeedbackQuery{}
// 解析头部信息
header := controller.GetRequestHeader(controller.Ctx)
listContractUndertakerFeedbackQuery.CompanyId = header.CompanyId
listContractUndertakerFeedbackQuery.OrgId = header.OrgId
listContractUndertakerFeedbackQuery.UserId = header.UserId
listContractUndertakerFeedbackQuery.UserBaseId = header.UserBaseId
// 获取路径参数
pageSize, _ := controller.GetInt64("pageSize")
listContractUndertakerFeedbackQuery.PageSize = pageSize
pageNumber, _ := controller.GetInt64("pageNumber")
listContractUndertakerFeedbackQuery.PageNumber = pageNumber
underTakerUid := controller.GetString(":underTakerUid")
listContractUndertakerFeedbackQuery.UnderTakerUid = underTakerUid
data, err := contractUndertakerFeedbackService.ListContractUndertakerFeedback(listContractUndertakerFeedbackQuery)
controller.Response(data, err)
}
... ...