作者 陈志颖

feat:分红订单和分红退货单应用服务开发

正在显示 40 个修改的文件 包含 422 行增加267 行删除
... ... @@ -2,67 +2,31 @@ package command
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
"reflect"
"strings"
"time"
"github.com/beego/beego/v2/core/validation"
)
type ApplyForCooperationCommand struct {
// 共创申请描述附件
CooperationApplicationAttachment []*domain.Attachment `cname:"共创申请描述附件" json:"cooperationApplicationAttachment" valid:"Required"`
// 共创申请描述
CooperationApplicationDescription string `cname:"共创申请描述" json:"cooperationApplicationDescription" valid:"Required"`
CooperationApplicationDescription string `cname:"共创申请描述" json:"cooperationApplicationDescription,omitempty"`
// 用户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:"用户基本id" json:"userBaseId,string" valid:"Required"`
UserBaseId int64 `cname:"用户基本数据ID" json:"userBaseId,string" valid:"Required"`
// 组织机构ID
OrgId int64 `cname:"组织机构ID" json:"orgId,string" valid:"Required"`
// 组织名称
OrgName string `cname:"组织名称" json:"orgName" valid:"Required"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID,通过集成REST上下文获取" json:"companyId,string" valid:"Required"`
// 公司logo
CompanyLogo string `cname:"公司logo" json:"companyLogo" valid:"Required"`
// 公司名称
CompanyName string `cname:"公司名称" json:"companyName" valid:"Required"`
// 用户关联的组织机构
Orgs []*domain.Org `cname:"用户关联的组织机构" json:"orgs" valid:"Required"`
CompanyId int64 `cname:"公司ID" json:"companyId,string" valid:"Required"`
// 部门ID,通过REST集成上下文获取
DepartmentId int64 `cname:"部门ID,通过REST集成上下文获取" json:"departmentId,string" valid:"Required"`
// 部门名称
DepartmentName string `cname:"部门名称" json:"departmentName" valid:"Required"`
// 部门编码
DepartmentNumber string `cname:"部门编码" json:"departmentNumber" valid:"Required"`
// 是否组织机构标识,1为是,2为否,默认为否
IsOrganization bool `cname:"是否组织机构标识,1为是,2为否,默认为否" json:"isOrganization" valid:"Required"`
// 角色ID
RoleId int64 `cname:"角色ID" json:"roleId,string" valid:"Required"`
// 角色名称
RoleName string `cname:"角色名称" json:"roleName" valid:"Required"`
// 用户头像
UserAvatar string `cname:"用户头像" json:"userAvatar" valid:"Required"`
// 用户邮箱
UserEmail string `cname:"用户邮箱" json:"userEmail" valid:"Required"`
// 共创人员姓名
UserName string `cname:"共创人员姓名" json:"userName" valid:"Required"`
// 用户手机号
UserPhone string `cname:"用户手机号" json:"userPhone" valid:"Required"`
// 用户账号,区别于手机号,冗余字段
UserAccount string `cname:"用户账号,区别于手机号,冗余字段" json:"userAccount" valid:"Required"`
// 用户类型
UserType int32 `cname:"用户类型" json:"userType" valid:"Required"`
// 状态
Status int32 `cname:"状态" json:"status" valid:"Required"`
DepartmentId int64 `cname:"部门ID" json:"departmentId,string" valid:"Required"`
// 共创申请ID
CooperationApplicationId int64 `cname:"共创申请ID" json:"cooperationApplicationId,string" valid:"Required"`
CooperationApplicationId string `cname:"共创申请ID" json:"cooperationApplicationId,string" valid:"Required"`
// 共创项目编号,自生成,生成规则:XM+6位年月日+#+3位流水,例XM210601#001
CooperationProjectNumber string `cname:"共创项目编号,自生成,生成规则:XM+6位年月日+#+3位流水,例XM210601#001" json:"cooperationProjectNumber" valid:"Required"`
// 共创申请时间
CooperationApplyTime time.Time `cname:"共创申请时间" json:"cooperationApplyTime" valid:"Required"`
CooperationProjectNumber string `cname:"共创项目编号" json:"cooperationProjectNumber" valid:"Required"`
}
func (applyForCooperationCommand *ApplyForCooperationCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -8,35 +8,37 @@ import (
"github.com/beego/beego/v2/core/validation"
)
type AgreeCooperationApplicationCommand struct {
type ApprovalCooperationApplicationCommand struct {
// 共创申请ID
CooperationApplicationId int64 `cname:"共创申请ID" json:"cooperationApplicationId,string" valid:"Required"`
// 共创申请审核描述
CooperationApplicationVerifyDescription string `cname:"共创申请审核描述" json:"cooperationApplicationVerifyDescription" valid:"Required"`
CooperationApplicationVerifyDescription string `cname:"共创申请审核描述" json:"cooperationApplicationVerifyDescription,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"`
OrgId int64 `cname:"组织机构ID" json:"orgId,string" valid:"Required"`
// 菜单编码,APP端必须
Code string `cname:"菜单编码,APP端必须" json:"code" valid:"Required"`
Code string `cname:"菜单编码" json:"code" 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"`
// 审核动作,1同意,2拒绝
Action int32 `cname:"审核动作" json:"action" valid:"Required"`
}
func (agreeCooperationApplicationCommand *AgreeCooperationApplicationCommand) Valid(validation *validation.Validation) {
func (approvalCooperationApplicationCommand *ApprovalCooperationApplicationCommand) Valid(validation *validation.Validation) {
//validation.SetError("CustomValid", "未实现的自定义认证")
}
func (agreeCooperationApplicationCommand *AgreeCooperationApplicationCommand) ValidateCommand() error {
func (approvalCooperationApplicationCommand *ApprovalCooperationApplicationCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(agreeCooperationApplicationCommand)
b, err := valid.Valid(approvalCooperationApplicationCommand)
if err != nil {
return err
}
if !b {
elem := reflect.TypeOf(agreeCooperationApplicationCommand).Elem()
elem := reflect.TypeOf(approvalCooperationApplicationCommand).Elem()
for _, validErr := range valid.Errors {
field, isExist := elem.FieldByName(validErr.Field)
if isExist {
... ...
... ... @@ -11,19 +11,19 @@ type BatchApprovalCooperationApplicationCommand struct {
// 共创申请ID数组
CooperationApplicationIds []string `cname:"共创申请ID" json:"cooperationApplicationIds" valid:"Required"`
// 共创申请审核描述
CooperationApplicationVerifyDescription string `cname:"共创申请审核描述" json:"cooperationApplicationVerifyDescription" valid:"Required"`
CooperationApplicationVerifyDescription string `cname:"共创申请审核描述" json:"cooperationApplicationVerifyDescription,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"`
OrgId int64 `cname:"组织机构ID" json:"orgId,string" valid:"Required"`
// 菜单编码,APP端必须
Code string `cname:"菜单编码,APP端必须" json:"code" valid:"Required"`
Code string `cname:"菜单编码" json:"code" 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"`
// 审核动作,1同意,2拒绝
Action int32 `cname:"审核动作,1同意,2拒绝" json:"action" valid:"Required"`
Action int32 `cname:"审核动作" json:"action" valid:"Required"`
}
func (batchApprovalCooperationApplicationCommand *BatchApprovalCooperationApplicationCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -19,13 +19,13 @@ type CreateCooperationApplicationCommand struct {
// 关联的共创项目编号
CooperationProjectNumber string `cname:"关联的共创项目编号" json:"cooperationProjectNumber" valid:"Required"`
// 公司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 (createCooperationApplicationCommand *CreateCooperationApplicationCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -2,41 +2,40 @@ package command
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
"reflect"
"strings"
"github.com/beego/beego/v2/core/validation"
)
type RejectCooperationApplicationCommand struct {
// 共创申请ID
CooperationApplicationId int64 `cname:"共创申请ID" json:"cooperationApplicationId,string" valid:"Required"`
type OneClickApprovalCooperationApplicationCommand struct {
// 共创申请审核描述
CooperationApplicationVerifyDescription string `cname:"共创申请审核描述" json:"cooperationApplicationVerifyDescription" valid:"Required"`
CooperationApplicationVerifyDescription string `cname:"共创申请审核描述" json:"cooperationApplicationVerifyDescription,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"`
// 菜单模块编码,APP端必须
Code string `cname:"菜单模块编码,APP端必须" json:"code" valid:"Required"`
OrgId int64 `cname:"组织机构ID" json:"orgId,string" valid:"Required"`
// 菜单编码,APP端必须
Code string `cname:"菜单编码" json:"code" 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"`
// 审核动作,1同意,2拒绝
Action int32 `cname:"审核动作" json:"action" valid:"Required"`
}
func (rejectCooperationApplicationCommand *RejectCooperationApplicationCommand) Valid(validation *validation.Validation) {
func (oneClickApprovalCooperationApplicationCommand *OneClickApprovalCooperationApplicationCommand) Valid(validation *validation.Validation) {
//validation.SetError("CustomValid", "未实现的自定义认证")
}
func (rejectCooperationApplicationCommand *RejectCooperationApplicationCommand) ValidateCommand() error {
func (oneClickApprovalCooperationApplicationCommand *OneClickApprovalCooperationApplicationCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(rejectCooperationApplicationCommand)
b, err := valid.Valid(oneClickApprovalCooperationApplicationCommand)
if err != nil {
return err
}
if !b {
elem := reflect.TypeOf(rejectCooperationApplicationCommand).Elem()
elem := reflect.TypeOf(oneClickApprovalCooperationApplicationCommand).Elem()
for _, validErr := range valid.Errors {
field, isExist := elem.FieldByName(validErr.Field)
if isExist {
... ...
... ... @@ -12,13 +12,13 @@ type RemoveCooperationApplicationCommand struct {
// 共创申请ID
CooperationApplicationId int64 `cname:"共创申请ID" json:"cooperationApplicationId,string" valid:"Required"`
// 公司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 (removeCooperationApplicationCommand *RemoveCooperationApplicationCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -11,9 +11,9 @@ import (
type UpdateCooperationApplicationCommand struct {
// 共创申请id
CooperationApplicationId string `cname:"共创申请id" json:"cooperationApplicationId" valid:"Required"`
CooperationApplicationId string `cname:"共创申请ID" json:"cooperationApplicationId" valid:"Required"`
// 共创申请人uid
ApplicantUid string `cname:"共创申请人uid" json:"applicantUid" valid:"Required"`
ApplicantUid string `cname:"共创申请人UID" json:"applicantUid" valid:"Required"`
// 共创申请描述
CooperationApplicationDescription string `cname:"共创申请描述" json:"cooperationApplicationDescription,omitempty"`
// 共创申请描述附件
... ... @@ -21,13 +21,13 @@ type UpdateCooperationApplicationCommand struct {
// 关联的共创项目编号
CooperationProjectNumber string `cname:"关联的共创项目编号" json:"cooperationProjectNumber" valid:"Required"`
// 公司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 (updateCooperationApplicationCommand *UpdateCooperationApplicationCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -12,13 +12,13 @@ type GetCooperationApplicationQuery struct {
// 共创申请ID
CooperationApplicationId int64 `cname:"共创申请ID" json:"cooperationApplicationId,string" valid:"Required"`
// 公司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 (getCooperationApplicationQuery *GetCooperationApplicationQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -10,17 +10,17 @@ import (
type ListCooperationApplicationQuery struct {
// 页面大小
PageNumber int64 `cname:"页面大小" json:"pageNumber,omitempty"`
PageNumber int64 `cname:"页" json:"pageNumber,omitempty"`
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,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 (listCooperationApplicationQuery *ListCooperationApplicationQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -16,19 +16,19 @@ type SearchCooperationApplicationQuery struct {
// 申请人姓名
ApplicantName string `cname:"申请人姓名" json:"applicantName,omitempty"`
// 共创申请审核状态,1待审核,2已同意,3已拒绝
CooperationApplicationStatus int32 `cname:"共创申请审核状态,1待审核,2已同意,3已拒绝" json:"cooperationApplicationStatus,omitempty"`
CooperationApplicationStatus int32 `cname:"共创申请审核状态" json:"cooperationApplicationStatus,omitempty"`
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
// 页面大小
PageNumber int64 `cname:"页面大小" json:"pageNumber,omitempty"`
PageNumber int64 `cname:"页" json:"pageNumber,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 (searchCooperationApplicationQuery *SearchCooperationApplicationQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -17,9 +17,9 @@ import (
type CooperationApplicationService struct {
}
// AgreeCooperationApplication 审核-同意共创申请
func (cooperationApplicationService *CooperationApplicationService) AgreeCooperationApplication(agreeCooperationApplicationCommand *command.AgreeCooperationApplicationCommand) (interface{}, error) {
if err := agreeCooperationApplicationCommand.ValidateCommand(); err != nil {
// ApprovalCooperationApplication 审核共创申请
func (cooperationApplicationService *CooperationApplicationService) ApprovalCooperationApplication(approvalCooperationApplicationCommand *command.ApprovalCooperationApplicationCommand) (interface{}, error) {
if err := approvalCooperationApplicationCommand.ValidateCommand(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
transactionContext, err := factory.CreateTransactionContext(nil)
... ... @@ -53,10 +53,106 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop
defer func() {
_ = transactionContext.RollbackTransaction()
}()
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
var cooperationProjectRepository domain.CooperationProjectRepository
if value, err := factory.CreateCooperationProjectRepository(map[string]interface{}{
"transactionContext": transactionContext,
}); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
cooperationProjectRepository = value
}
cooperationProject, err := cooperationProjectRepository.FindOne(map[string]interface{}{"cooperationProjectNumber": applyForCooperationCommand.CooperationProjectNumber})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
if cooperationProject == nil {
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", applyForCooperationCommand.CooperationProjectNumber))
} else {
}
// 用户REST服务初始化
var userService service.UserService
if value, err := factory.CreateUserService(map[string]interface{}{}); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
userService = value
}
// 获取申请人
var applicant *domain.User
if data, err := userService.UserFrom(applyForCooperationCommand.CompanyId, applyForCooperationCommand.OrgId, applyForCooperationCommand.UserId); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
applicant = data
}
// 公司REST服务初始化
var companyService service.CompanyService
if value, err := factory.CreateCompanyService(map[string]interface{}{}); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
companyService = value
}
// 获取公司信息
var company *domain.Company
if data, err := companyService.CompanyFrom(applyForCooperationCommand.CompanyId); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
company = data
}
// 组织机构REST服务初始化
var organizationService service.OrgService
if value, err := factory.CreateOrganizationService(map[string]interface{}{}); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
organizationService = value
}
// 获取组织机构信息
var organization *domain.Org
if data, err := organizationService.OrgFrom(applyForCooperationCommand.CompanyId, applyForCooperationCommand.OrgId); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
organization = data
}
newCooperationApplication := &domain.CooperationApplication{
CooperationApplicationApplicant: applicant,
CooperationApplicationAttachment: applyForCooperationCommand.CooperationApplicationAttachment,
CooperationApplicationDescription: applyForCooperationCommand.CooperationApplicationDescription,
CooperationApplicationStatus: 1,
CooperationApplicationVerifier: nil,
CooperationApplicationVerifyDescription: "",
CooperationApplicationVerifyTime: time.Time{},
CooperationApplyTime: time.Now(),
CooperationProject: cooperationProject,
Org: organization,
IsCanceled: false,
Company: company,
CreatedAt: time.Now(),
DeletedAt: time.Time{},
UpdatedAt: time.Time{},
}
var cooperationApplicationRepository domain.CooperationApplicationRepository
if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{
"transactionContext": transactionContext,
}); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
cooperationApplicationRepository = value
}
if cooperationApplication, err := cooperationApplicationRepository.Save(newCooperationApplication); 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 cooperationApplication, nil
}
return nil, nil
}
// BatchApprovalCooperationApplication 一键审核共创申请
... ... @@ -114,7 +210,6 @@ func (cooperationApplicationService *CooperationApplicationService) CreateCooper
}
//TODO 获取申请人
// 用户REST服务初始化
var userService service.UserService
if value, err := factory.CreateUserService(map[string]interface{}{}); err != nil {
... ... @@ -274,27 +369,6 @@ func (cooperationApplicationService *CooperationApplicationService) ListCooperat
}
}
// RejectCooperationApplication 审核-拒绝共创申请
func (cooperationApplicationService *CooperationApplicationService) RejectCooperationApplication(rejectCooperationApplicationCommand *command.RejectCooperationApplicationCommand) (interface{}, error) {
if err := rejectCooperationApplicationCommand.ValidateCommand(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
transactionContext, err := factory.CreateTransactionContext(nil)
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
if err := transactionContext.StartTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
defer func() {
_ = transactionContext.RollbackTransaction()
}()
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return nil, nil
}
// RemoveCooperationApplication 移除共创申请服务
func (cooperationApplicationService *CooperationApplicationService) RemoveCooperationApplication(removeCooperationApplicationCommand *command.RemoveCooperationApplicationCommand) (interface{}, error) {
if err := removeCooperationApplicationCommand.ValidateCommand(); err != nil {
... ...
... ... @@ -13,6 +13,8 @@ type CreateCooperationProjectCommand struct {
CooperationProjectName string `cname:"共创项目名称" json:"cooperationProjectName" valid:"Required"`
// 承接对象,1员工,2共创用户,3公开,可以多选
CooperationProjectUndertakerTypes []int32 `cname:"承接对象" json:"cooperationProjectUndertakerTypes" valid:"Required"`
// 共创模式编码
CooperationModeNumber string `cname:"共创模式编码" json:"cooperationModeNumber" valid:"Required"`
// 共创项目发起人uid
SponsorUid string `cname:"共创项目发起人UID" json:"sponsorUid" valid:"Required"`
// 共创项目发布人uid
... ...
... ... @@ -13,6 +13,8 @@ type UpdateCooperationProjectCommand struct {
CooperationProjectId string `cname:"共创项目ID" json:"cooperationProjectId" valid:"Required"`
// 共创项目名称
CooperationProjectName string `cname:"共创项目名称" json:"cooperationProjectName" valid:"Required"`
// 共创模式编码
CooperationModeNumber string `cname:"共创模式编码" json:"cooperationModeNumber" valid:"Required"`
// 承接对象,1员工,2共创用户,3公开,可以多选
CooperationProjectUndertakerType []int32 `cname:"承接对象,1员工,2共创用户,3公开,可以多选" json:"cooperationProjectUndertakerType" valid:"Required"`
// 共创项目发起人uid
... ...
... ... @@ -48,13 +48,13 @@ type CreateDividendsOrderCommand struct {
// 订单产品列表
OrderGoods []*OrderGoods `cname:"订单产品列表" json:"orderGoods,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:"用户基础数据id" json:"userBaseId" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"`
}
func (createDividendsOrderCommand *CreateDividendsOrderCommand) Valid(validation *validation.Validation) {
... ...
package command
import (
"fmt"
"reflect"
"strings"
"time"
"github.com/beego/beego/v2/core/validation"
)
type ImportDividendsOrderCommand struct {
// 客户名称
CustomerName string `cname:"客户名称" json:"customerName" valid:"Required"`
// 分红订单金额
DividendsOrderAmount float64 `cname:"分红订单金额" json:"dividendsOrderAmount" valid:"Required"`
// 分红订单号
DividendsOrderNumber string `cname:"分红订单号" json:"dividendsOrderNumber,string" valid:"Required"`
// 分红订单原单号
DividendsOriginalOrderNum string `cname:"分红订单原单号" json:"dividendsOriginalOrderNum" valid:"Required"`
// 订单产生时间
OrderTime time.Time `cname:"订单产生时间" json:"orderTime" valid:"Required"`
// 备注
Remarks string `cname:"备注" json:"remarks" valid:"Required"`
// 订单区域名称
RegionName string `cname:"订单区域名称" json:"regionName,omitempty"`
// 订单业务员uid
SalesmanUid string `cname:"订单业务员uid" json:"salesmanUid,omitempty"`
// 订单操作人uid
OperatorUid string `cname:"订单操作人uid" json:"operatorUid,omitempty"`
// 订单产品列表
OrderGoods []*OrderGoods `cname:"订单产品列表" json:"orderGoods,omitempty"`
// 公司ID,通过集成REST上下文获取
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" json:"userId,string" valid:"Required"`
// 用户基础信息id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId" valid:"Required"`
}
func (importDividendsOrderCommand *ImportDividendsOrderCommand) Valid(validation *validation.Validation) {
//validation.SetError("CustomValid", "未实现的自定义认证")
}
func (importDividendsOrderCommand *ImportDividendsOrderCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(importDividendsOrderCommand)
if err != nil {
return err
}
if !b {
elem := reflect.TypeOf(importDividendsOrderCommand).Elem()
for _, validErr := range valid.Errors {
field, isExist := elem.FieldByName(validErr.Field)
if isExist {
return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1))
} else {
return fmt.Errorf(validErr.Message)
}
}
}
return nil
}
... ...
... ... @@ -12,13 +12,13 @@ type RemoveDividendsOrderCommand struct {
// 分红订单ID
DividendsOrderId string `cname:"分红订单ID" json:"dividendsOrderId" valid:"Required"`
// 公司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:"用户基础数据id" json:"userBaseId,string" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"`
}
func (removeDividendsOrderCommand *RemoveDividendsOrderCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -25,17 +25,17 @@ type UpdateDividendsOrderCommand struct {
// 备注
Remarks string `cname:"备注" json:"remarks" valid:"Required"`
// 业务员uid
SalesmanUid string `cname:"业务员uid" json:"salesmanUid,omitempty"`
SalesmanUid string `cname:"业务员UID" json:"salesmanUid,omitempty"`
// 操作人uid
OperatorUid string `cname:"操作人uid" json:"operatorUid,omitempty"`
OperatorUid string `cname:"操作人UID" json:"operatorUid,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:"用户基础数据id" json:"userBaseId,string" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"`
}
func (updateDividendsOrderCommand *UpdateDividendsOrderCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -12,13 +12,13 @@ type GetDividendsOrderQuery struct {
// 分红订单ID
DividendsOrderId int64 `cname:"分红订单ID" json:"dividendsOrderId,string" valid:"Required"`
// 公司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 `canme:"用户基础数据id" json:"userBaseId,string" valid:"Required"`
UserBaseId int64 `canme:"用户基础数据ID" json:"userBaseId,string" valid:"Required"`
}
func (getDividendsOrderQuery *GetDividendsOrderQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -10,17 +10,17 @@ import (
type ListDividendsOrdersQuery struct {
// 页面大小
PageNumber int64 `cname:"页面大小" json:"pageNumber,omitempty"`
PageNumber int64 `cname:"页" json:"pageNumber,omitempty"`
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,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:"用户基础数据id" json:"userBaseId,string" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"`
}
func (listDividendsOrdersQuery *ListDividendsOrdersQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -16,15 +16,15 @@ type SearchDividendsOrderQuery struct {
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
// 页面大小
PageNumber int64 `cname:"页面大小" json:"pageNumber,omitempty"`
PageNumber int64 `cname:"页" json:"pageNumber,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:"用户基础数据id" json:"userBaseId,string" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"`
}
func (searchDividendsOrderQuery *SearchDividendsOrderQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -12,15 +12,15 @@ type SearchDividendsOrderNumberQuery struct {
// 分红订单号
DividendsOrderNumber string `cname:"分红订单号" json:"dividendsOrderNumber,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:"用户基础数据id" json:"userBaseId,string" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"`
// 页面大小
PageNumber int64 `cname:"页面大小" json:"pageNumber,omitempty"`
PageNumber int64 `cname:"页" json:"pageNumber,omitempty"`
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
}
... ...
... ... @@ -90,24 +90,49 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD
salesman = data
}
// 获取订单产品
var orderGoods []*domain.OrderGood
for _, orderGood := range createDividendsOrderCommand.OrderGoods {
orderGoods = append(orderGoods, &domain.OrderGood{
OrderGoodId: 0,
OrderGoodAmount: orderGood.OrderGoodAmount,
OrderGoodName: orderGood.OrderGoodName,
OrderGoodPrice: orderGood.OrderGoodPrice,
OrderGoodQuantity: orderGood.OrderGoodQuantity,
DividendsOrderNumber: "", //TODO 分红订单号,规则生成
DividendsReturnedOrderNumber: "",
CooperationContractNumber: orderGood.CooperationContractNumber,
OrderGoodExpense: 0,
OrgId: organization.OrgId,
CompanyId: company.CompanyId,
CreatedAt: time.Time{},
DeletedAt: time.Time{},
UpdatedAt: time.Time{},
})
}
newDividendsOrder := &domain.DividendsOrder{
DividendsOrderNumber: "",
DividendsOrderId: 0,
DividendsOrderNumber: "", // TODO 分红订单号,规则生成
DividendsOriginalOrderNum: createDividendsOrderCommand.DividendsOriginalOrderNum,
DividendsOrderAmount: createDividendsOrderCommand.DividendsOrderAmount,
OrderSalesman: salesman,
OrderTime: time.Time{},
OrderTime: createDividendsOrderCommand.OrderTime,
DividendTime: time.Time{},
DividendStatus: 0,
Region: nil,
CustomerName: "",
Goods: nil,
Org: organization,
Company: company,
CreatedAt: time.Now(),
DeletedAt: time.Time{},
UpdatedAt: time.Time{},
OperateTime: time.Time{},
Operator: operator,
Region: &domain.RegionInfo{
RegionNumber: "",
RegionName: createDividendsOrderCommand.RegionName,
},
CustomerName: createDividendsOrderCommand.CustomerName,
Goods: orderGoods,
Org: organization,
Company: company,
CreatedAt: time.Now(),
DeletedAt: time.Time{},
UpdatedAt: time.Time{},
OperateTime: time.Now(),
Operator: operator,
}
var dividendsOrderRepository domain.DividendsOrderRepository
... ...
... ... @@ -32,7 +32,9 @@ type CreateDividendsReturnedOrderCommand struct {
// 退货客户名称
DividendsReturnedCustomerName string `cname:"退货客户名称" json:"dividendsReturnedCustomerName" valid:"Required"`
// 来源单号,源单号,订单号
OriginalOrderNum string `cname:"来源单号,源单号,订单号" json:"originalOrderNum" valid:"Required"`
OriginalOrderNum string `cname:"来源单号" json:"originalOrderNum" valid:"Required"`
// 分红单号
DividendsOrderNumber string `cname:"订单号" json:"dividendsOrderNumber" valid:"Required"`
// 备注
Remarks string `cname:"备注" json:"remarks" valid:"Required"`
// 退货日期
... ... @@ -42,13 +44,13 @@ type CreateDividendsReturnedOrderCommand struct {
// 订单产品列表
OrderGoods []*OrderGoods `cname:"订单产品列表" json:"orderGoods,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:"用户基础数据id" json:"userBaseId,string" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"`
}
func (createDividendsReturnedOrderCommand *CreateDividendsReturnedOrderCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -4,23 +4,34 @@ import (
"fmt"
"reflect"
"strings"
"time"
"github.com/beego/beego/v2/core/validation"
)
type ImportDividendsReturnedOrderCommand struct {
// 导入文件
File string `cname:"导入文件" json:"file,omitempty"`
// 参数列表
Where string `cname:"参数列表" json:"where,omitempty"`
// 退货金额
DividendsReturnedOrderRefund float64 `cname:"退货金额" json:"dividendsReturnedOrderRefund" valid:"Required"`
// 退货客户名称
DividendsReturnedCustomerName string `cname:"退货客户名称" json:"dividendsReturnedCustomerName" valid:"Required"`
// 来源单号,源单号,订单号
OriginalOrderNum string `cname:"来源单号" json:"originalOrderNum" valid:"Required"`
// 备注
Remarks string `cname:"备注" json:"remarks" valid:"Required"`
// 退货日期
DividendsReturnedDate time.Time `cname:"退货日期" json:"dividendsReturnedDate" valid:"Required"`
// 退货区域名称
RegionName string `cname:"退货区域名称" json:"regionName,omitempty"`
// 订单产品列表
OrderGoods []*OrderGoods `cname:"订单产品列表" json:"orderGoods,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:"用户基础数据id" json:"userBaseId,string" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"`
}
func (importDividendsReturnedOrderCommand *ImportDividendsReturnedOrderCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -12,13 +12,13 @@ type RemoveDividendsReturnedOrderCommand struct {
// 分红退货单记录ID
DividendsReturnedOrderId string `cname:"分红退货单记录ID" json:"dividendsReturnedOrderId" valid:"Required"`
// 公司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:"用户基础数据id" json:"userBaseId,string" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"`
}
func (removeDividendsReturnedOrderCommand *RemoveDividendsReturnedOrderCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -17,7 +17,7 @@ type UpdateDividendsReturnedOrderCommand struct {
// 退货客户名称
DividendsReturnedCustomerName string `cname:"退货客户名称" json:"dividendsReturnedCustomerName" valid:"Required"`
// 来源单号,源单号,订单号
OriginalOrderNum string `cname:"来源单号,源单号,订单号" json:"originalOrderNum" valid:"Required"`
OriginalOrderNum string `cname:"来源单号" json:"originalOrderNum" valid:"Required"`
// 备注
Remarks string `cname:"备注" json:"remarks" valid:"Required"`
// 退货日期
... ... @@ -27,13 +27,13 @@ type UpdateDividendsReturnedOrderCommand struct {
// 订单产品列表
OrderGoods []*OrderGoods `cname:"订单产品列表" json:"orderGoods,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:"用户基础数据id" json:"userBaseId,string" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"`
}
func (updateDividendsReturnedOrderCommand *UpdateDividendsReturnedOrderCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -12,13 +12,13 @@ type GetDividendsReturnedOrderQuery struct {
// 分红退货单记录ID
DividendsReturnedOrderId string `cname:"分红退货单记录ID" json:"dividendsReturnedOrderId" valid:"Required"`
// 公司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:"用户基础数据id" json:"userBaseId,string" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"`
}
func (getDividendsReturnedOrderQuery *GetDividendsReturnedOrderQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -10,17 +10,17 @@ import (
type ListDividendsReturnedOrderQuery struct {
// 页面大小
PageNumber int64 `cname:"页面大小" json:"pageNumber,omitempty"`
PageNumber int64 `cname:"页" json:"pageNumber,omitempty"`
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,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:"用户基础数据id" json:"userBaseId,string" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"`
}
func (listDividendsReturnedOrderQuery *ListDividendsReturnedOrderQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -16,15 +16,15 @@ type SearchDividendsReturnedOrderQuery struct {
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
// 页面大小
PageNumber int64 `cname:"页面大小" json:"pageNumber,omitempty"`
PageNumber int64 `cname:"页" json:"pageNumber,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:"用户基础数据id" json:"userBaseId,string" valid:"Required"`
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"`
}
func (searchDividendsReturnedOrderQuery *SearchDividendsReturnedOrderQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -80,25 +80,49 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) CreateDivide
operator = data
}
// 获取分红退货单产品
var orderGoods []*domain.OrderGood
for _, orderGood := range createDividendsReturnedOrderCommand.OrderGoods {
orderGoods = append(orderGoods, &domain.OrderGood{
OrderGoodId: 0,
OrderGoodAmount: orderGood.OrderGoodAmount,
OrderGoodName: orderGood.OrderGoodName,
OrderGoodPrice: orderGood.OrderGoodPrice,
OrderGoodQuantity: orderGood.OrderGoodQuantity,
DividendsOrderNumber: "",
DividendsReturnedOrderNumber: "", // 分红退货单号,规则生成
CooperationContractNumber: orderGood.CooperationContractNumber,
OrderGoodExpense: 0,
OrgId: organization.OrgId,
CompanyId: company.CompanyId,
CreatedAt: time.Now(),
DeletedAt: time.Time{},
UpdatedAt: time.Time{},
})
}
newDividendsReturnedOrder := &domain.DividendsReturnedOrder{
DividendsReturnedOrderNumber: "",
DividendsReturnedOrderNumber: "", // 退货单号,生成
DividendsReturnedOrderRefund: 0,
OriginalOrderNum: "",
DividendsOrderNumber: 0,
DividendsReturnedCustomerName: "",
OriginalOrderNum: createDividendsReturnedOrderCommand.OriginalOrderNum,
DividendsOrderNumber: createDividendsReturnedOrderCommand.DividendsOrderNumber,
DividendsReturnedCustomerName: createDividendsReturnedOrderCommand.DividendsReturnedCustomerName,
DividendsReturnedDate: time.Time{},
Region: nil,
Goods: nil,
Remarks: "",
DividendStatus: 0,
DividendTime: time.Time{},
Org: organization,
Company: company,
CreatedAt: time.Now(),
DeletedAt: time.Time{},
UpdatedAt: time.Time{},
Operator: operator,
OperateTime: time.Time{},
Region: &domain.RegionInfo{
RegionNumber: "",
RegionName: createDividendsReturnedOrderCommand.RegionName,
},
Goods: orderGoods,
Remarks: createDividendsReturnedOrderCommand.Remarks,
DividendStatus: 1,
DividendTime: time.Time{},
Org: organization,
Company: company,
CreatedAt: time.Now(),
DeletedAt: time.Time{},
UpdatedAt: time.Time{},
Operator: operator,
OperateTime: time.Now(),
}
var dividendsReturnedOrderRepository domain.DividendsReturnedOrderRepository
... ...
... ... @@ -13,7 +13,7 @@ type DividendsReturnedOrder struct {
// 源单号(原始订单号)
OriginalOrderNum string `json:"originalOrderNum"`
// 关联分红订单号
DividendsOrderNumber int64 `json:"dividendsOrderNumber,string"`
DividendsOrderNumber string `json:"dividendsOrderNumber"`
// 退货客户姓名
DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"`
// 退货日期
... ... @@ -68,9 +68,6 @@ func (dividendsReturnedOrder *DividendsReturnedOrder) Update(data map[string]int
if originalOrderNum, ok := data["originalOrderNum"]; ok {
dividendsReturnedOrder.OriginalOrderNum = originalOrderNum.(string)
}
if dividendsOrderNumber, ok := data["dividendsOrderNumber"]; ok {
dividendsReturnedOrder.DividendsOrderNumber = dividendsOrderNumber.(int64)
}
if dividendsReturnedCustomerName, ok := data["dividendsReturnedCustomerName"]; ok {
dividendsReturnedOrder.DividendsReturnedCustomerName = dividendsReturnedCustomerName.(string)
}
... ... @@ -92,14 +89,5 @@ func (dividendsReturnedOrder *DividendsReturnedOrder) Update(data map[string]int
if dividendTime, ok := data["dividendTime"]; ok {
dividendsReturnedOrder.DividendTime = dividendTime.(time.Time)
}
if orgId, ok := data["orgId"]; ok {
dividendsReturnedOrder.Org.OrgId = orgId.(int64)
}
if userType, ok := data["userType"]; ok {
dividendsReturnedOrder.Operator.UserType = userType.(int32)
}
if status, ok := data["status"]; ok {
dividendsReturnedOrder.Operator.Status = status.(int32)
}
return nil
}
... ...
... ... @@ -22,6 +22,10 @@ type OrderGood struct {
CooperationContractNumber string `json:"cooperationContractNumber"`
// 订单产品费用
OrderGoodExpense float64 `json:"orderGoodExpense"`
// 组织机构ID
OrgId int64 `json:"orgId"`
// 公司ID
CompanyId int64 `json:"companyId"`
// 创建时间
CreatedAt time.Time `json:"createdAt"`
// 删除时间
... ...
... ... @@ -16,7 +16,7 @@ type DividendsReturnedOrder struct {
// 源单号(原始订单号)
OriginalOrderNum string `comment:"源单号(原始订单号)"`
// 关联分红订单号
DividendsOrderNumber int64 `comment:"关联分红订单号"`
DividendsOrderNumber string `comment:"关联分红订单号"`
// 退货客户姓名
DividendsReturnedCustomerName string `comment:"退货客户姓名"`
// 退货日期
... ...
... ... @@ -20,6 +20,10 @@ type OrderGood struct {
DividendsReturnedOrderNumber string `comment:"关联的分红退货单号"`
// 关联的共创合约编号
CooperationContractNumber string `comment:"关联的共创合约编号"`
// 组织机构ID
OrgId int64 `comment:"组织机构ID"`
// 公司ID
CompanyId int64 `comment:"公司ID"`
// 订单产品费用
OrderGoodExpense float64 `comment:"订单产品费用"`
// 创建时间
... ...
... ... @@ -15,6 +15,8 @@ func TransformToOrderGoodDomainModelFromPgModels(orderGoodModel *models.OrderGoo
DividendsOrderNumber: orderGoodModel.DividendsOrderNumber,
CooperationContractNumber: orderGoodModel.CooperationContractNumber,
OrderGoodExpense: orderGoodModel.OrderGoodExpense,
OrgId: orderGoodModel.OrgId,
CompanyId: orderGoodModel.CompanyId,
CreatedAt: orderGoodModel.CreatedAt,
DeletedAt: orderGoodModel.DeletedAt,
UpdatedAt: orderGoodModel.UpdatedAt,
... ...
... ... @@ -201,6 +201,8 @@ func (repository *DividendsOrderRepository) Save(dividendsOrder *domain.Dividend
DividendsReturnedOrderNumber: goodDomain.DividendsReturnedOrderNumber,
CooperationContractNumber: goodDomain.CooperationContractNumber,
OrderGoodExpense: goodDomain.OrderGoodExpense,
OrgId: goodDomain.OrgId,
CompanyId: goodDomain.CompanyId,
CreatedAt: time.Time{},
DeletedAt: time.Time{},
UpdatedAt: time.Now(),
... ...
... ... @@ -115,6 +115,8 @@ func (repository *DividendsReturnedOrderRepository) Save(dividendsReturnedOrder
DividendsReturnedOrderNumber: good.DividendsReturnedOrderNumber,
CooperationContractNumber: good.CooperationContractNumber,
OrderGoodExpense: good.OrderGoodExpense,
OrgId: good.OrgId,
CompanyId: good.CompanyId,
CreatedAt: time.Now(),
DeletedAt: time.Time{},
UpdatedAt: time.Time{},
... ... @@ -206,6 +208,8 @@ func (repository *DividendsReturnedOrderRepository) Save(dividendsReturnedOrder
DividendsReturnedOrderNumber: goodDomain.DividendsReturnedOrderNumber,
CooperationContractNumber: goodDomain.CooperationContractNumber,
OrderGoodExpense: goodDomain.OrderGoodExpense,
OrgId: goodDomain.OrgId,
CompanyId: goodDomain.CompanyId,
CreatedAt: time.Time{},
DeletedAt: time.Time{},
UpdatedAt: time.Now(),
... ...
... ... @@ -34,6 +34,8 @@ func (repository *OrderGoodRepository) Save(orderGood *domain.OrderGood) (*domai
"dividends_order_number",
"cooperation_contract_number",
"order_good_expense",
"org_id",
"company_id",
"created_at",
"deleted_at",
"updated_at",
... ... @@ -61,6 +63,8 @@ func (repository *OrderGoodRepository) Save(orderGood *domain.OrderGood) (*domai
&orderGood.DividendsOrderNumber,
&orderGood.CooperationContractNumber,
&orderGood.OrderGoodExpense,
&orderGood.OrgId,
&orderGood.CompanyId,
&orderGood.CreatedAt,
&orderGood.DeletedAt,
&orderGood.UpdatedAt,
... ... @@ -74,6 +78,8 @@ func (repository *OrderGoodRepository) Save(orderGood *domain.OrderGood) (*domai
orderGood.DividendsOrderNumber,
orderGood.CooperationContractNumber,
orderGood.OrderGoodExpense,
orderGood.OrgId,
orderGood.CompanyId,
orderGood.CreatedAt,
orderGood.DeletedAt,
orderGood.UpdatedAt,
... ... @@ -91,6 +97,8 @@ func (repository *OrderGoodRepository) Save(orderGood *domain.OrderGood) (*domai
&orderGood.DividendsOrderNumber,
&orderGood.CooperationContractNumber,
&orderGood.OrderGoodExpense,
&orderGood.OrgId,
&orderGood.CompanyId,
&orderGood.CreatedAt,
&orderGood.DeletedAt,
&orderGood.UpdatedAt,
... ... @@ -104,6 +112,8 @@ func (repository *OrderGoodRepository) Save(orderGood *domain.OrderGood) (*domai
orderGood.DividendsOrderNumber,
orderGood.CooperationContractNumber,
orderGood.OrderGoodExpense,
orderGood.OrgId,
orderGood.CompanyId,
orderGood.CreatedAt,
orderGood.DeletedAt,
orderGood.UpdatedAt,
... ...
... ... @@ -14,7 +14,6 @@ func (controller *CooperationApplicationController) ApplyForCooperation() {
cooperationApplicationService := service.NewCooperationApplicationService(nil)
applyForCooperationCommand := &command.ApplyForCooperationCommand{}
_ = controller.Unmarshal(applyForCooperationCommand)
// 解析头部信息
header := controller.GetRequestHeader(controller.Ctx)
applyForCooperationCommand.CompanyId = header.CompanyId
applyForCooperationCommand.OrgId = header.OrgId
... ... @@ -24,31 +23,16 @@ func (controller *CooperationApplicationController) ApplyForCooperation() {
controller.Response(data, err)
}
func (controller *CooperationApplicationController) AgreeCooperationApplication() {
func (controller *CooperationApplicationController) ApprovalCooperationApplication() {
cooperationApplicationService := service.NewCooperationApplicationService(nil)
agreeCooperationApplicationCommand := &command.AgreeCooperationApplicationCommand{}
agreeCooperationApplicationCommand := &command.ApprovalCooperationApplicationCommand{}
_ = controller.Unmarshal(agreeCooperationApplicationCommand)
// 解析头部信息
header := controller.GetRequestHeader(controller.Ctx)
agreeCooperationApplicationCommand.CompanyId = header.CompanyId
agreeCooperationApplicationCommand.OrgId = header.OrgId
agreeCooperationApplicationCommand.UserId = header.UserId
agreeCooperationApplicationCommand.UserBaseId = header.UserBaseId
data, err := cooperationApplicationService.AgreeCooperationApplication(agreeCooperationApplicationCommand)
controller.Response(data, err)
}
func (controller *CooperationApplicationController) RejectCooperationApplication() {
cooperationApplicationService := service.NewCooperationApplicationService(nil)
rejectCooperationApplicationCommand := &command.RejectCooperationApplicationCommand{}
_ = controller.Unmarshal(rejectCooperationApplicationCommand)
// 解析头部信息
header := controller.GetRequestHeader(controller.Ctx)
rejectCooperationApplicationCommand.CompanyId = header.CompanyId
rejectCooperationApplicationCommand.OrgId = header.OrgId
rejectCooperationApplicationCommand.UserId = header.UserId
rejectCooperationApplicationCommand.UserBaseId = header.UserBaseId
data, err := cooperationApplicationService.RejectCooperationApplication(rejectCooperationApplicationCommand)
data, err := cooperationApplicationService.ApprovalCooperationApplication(agreeCooperationApplicationCommand)
controller.Response(data, err)
}
... ... @@ -56,7 +40,6 @@ func (controller *CooperationContractController) BatchApprovalCooperationApplica
cooperationApplicationService := service.NewCooperationApplicationService(nil)
batchApprovalCooperationApplicationCommand := &command.BatchApprovalCooperationApplicationCommand{}
_ = controller.Unmarshal(batchApprovalCooperationApplicationCommand)
// 解析头部信息
header := controller.GetRequestHeader(controller.Ctx)
batchApprovalCooperationApplicationCommand.CompanyId = header.CompanyId
batchApprovalCooperationApplicationCommand.OrgId = header.OrgId
... ... @@ -70,7 +53,6 @@ func (controller *CooperationApplicationController) CreateCooperationApplication
cooperationApplicationService := service.NewCooperationApplicationService(nil)
createCooperationApplicationCommand := &command.CreateCooperationApplicationCommand{}
_ = controller.Unmarshal(createCooperationApplicationCommand)
// 解析头部信息
header := controller.GetRequestHeader(controller.Ctx)
createCooperationApplicationCommand.CompanyId = header.CompanyId
createCooperationApplicationCommand.OrgId = header.OrgId
... ... @@ -84,13 +66,11 @@ func (controller *CooperationApplicationController) UpdateCooperationApplication
cooperationApplicationService := service.NewCooperationApplicationService(nil)
updateCooperationApplicationCommand := &command.UpdateCooperationApplicationCommand{}
_ = controller.Unmarshal(updateCooperationApplicationCommand)
// 解析头部信息
header := controller.GetRequestHeader(controller.Ctx)
updateCooperationApplicationCommand.CompanyId = header.CompanyId
updateCooperationApplicationCommand.OrgId = header.OrgId
updateCooperationApplicationCommand.UserId = header.UserId
updateCooperationApplicationCommand.UserBaseId = header.UserBaseId
// 解析路径参数
cooperationApplicationId := controller.GetString(":cooperationApplicationId")
updateCooperationApplicationCommand.CooperationApplicationId = cooperationApplicationId
data, err := cooperationApplicationService.UpdateCooperationApplication(updateCooperationApplicationCommand)
... ... @@ -100,13 +80,11 @@ func (controller *CooperationApplicationController) UpdateCooperationApplication
func (controller *CooperationApplicationController) GetCooperationApplication() {
cooperationApplicationService := service.NewCooperationApplicationService(nil)
getCooperationApplicationQuery := &query.GetCooperationApplicationQuery{}
// 解析头部信息
header := controller.GetRequestHeader(controller.Ctx)
getCooperationApplicationQuery.CompanyId = header.CompanyId
getCooperationApplicationQuery.OrgId = header.OrgId
getCooperationApplicationQuery.UserId = header.UserId
getCooperationApplicationQuery.UserBaseId = header.UserBaseId
// 解析路劲参数
cooperationApplicationId, _ := controller.GetInt64(":cooperationApplicationId")
getCooperationApplicationQuery.CooperationApplicationId = cooperationApplicationId
data, err := cooperationApplicationService.GetCooperationApplication(getCooperationApplicationQuery)
... ... @@ -117,13 +95,11 @@ func (controller *CooperationApplicationController) RemoveCooperationApplication
cooperationApplicationService := service.NewCooperationApplicationService(nil)
removeCooperationApplicationCommand := &command.RemoveCooperationApplicationCommand{}
_ = controller.Unmarshal(removeCooperationApplicationCommand)
// 解析头部信息
header := controller.GetRequestHeader(controller.Ctx)
removeCooperationApplicationCommand.CompanyId = header.CompanyId
removeCooperationApplicationCommand.OrgId = header.OrgId
removeCooperationApplicationCommand.UserId = header.UserId
removeCooperationApplicationCommand.UserBaseId = header.UserBaseId
// 解析路径参数
cooperationApplicationId, _ := controller.GetInt64(":cooperationApplicationId")
removeCooperationApplicationCommand.CooperationApplicationId = cooperationApplicationId
data, err := cooperationApplicationService.RemoveCooperationApplication(removeCooperationApplicationCommand)
... ... @@ -133,13 +109,11 @@ func (controller *CooperationApplicationController) RemoveCooperationApplication
func (controller *CooperationApplicationController) SearchCooperationApplication() {
cooperationApplicationService := service.NewCooperationApplicationService(nil)
searchCooperationApplicationQuery := &query.SearchCooperationApplicationQuery{}
// 解析头部信息
header := controller.GetRequestHeader(controller.Ctx)
searchCooperationApplicationQuery.CompanyId = header.CompanyId
searchCooperationApplicationQuery.OrgId = header.OrgId
searchCooperationApplicationQuery.UserId = header.UserId
searchCooperationApplicationQuery.UserBaseId = header.UserBaseId
// 解析其他参数
pageSize, _ := controller.GetInt64("pageSize")
searchCooperationApplicationQuery.PageSize = pageSize
pageNumber, _ := controller.GetInt64("pageNumber")
... ... @@ -151,13 +125,11 @@ func (controller *CooperationApplicationController) SearchCooperationApplication
func (controller *CooperationApplicationController) ListCooperationApplication() {
cooperationApplicationService := service.NewCooperationApplicationService(nil)
listCooperationApplicationQuery := &query.ListCooperationApplicationQuery{}
// 解析头部信息
header := controller.GetRequestHeader(controller.Ctx)
listCooperationApplicationQuery.CompanyId = header.CompanyId
listCooperationApplicationQuery.OrgId = header.OrgId
listCooperationApplicationQuery.UserId = header.UserId
listCooperationApplicationQuery.UserBaseId = header.UserBaseId
// 解析其他参数
pageSize, _ := controller.GetInt64("pageSize")
listCooperationApplicationQuery.PageSize = pageSize
pageNumber, _ := controller.GetInt64("pageNumber")
... ...
... ... @@ -6,14 +6,13 @@ import (
)
func init() {
web.Router("/cooperation-applications/apply-for-cooperation", &controllers.CooperationApplicationController{}, "Post:ApplyForCooperation") // 申请共创
web.Router("/cooperation-applications/agree-cooperation-application", &controllers.CooperationApplicationController{}, "Post:AgreeCooperationApplication") // 同意共创申请
web.Router("/cooperation-applications/reject-cooperation-application", &controllers.CooperationApplicationController{}, "Post:RejectCooperationApplication") // 拒绝共创申请
web.Router("/cooperation-applications/batch-approval", &controllers.CooperationContractController{}, "Post:BatchApprovalCooperationApplication") // 一键审核
web.Router("/cooperation-applications/", &controllers.CooperationApplicationController{}, "Post:CreateCooperationApplication") // 新增共创申请
web.Router("/cooperation-applications/:cooperationApplicationId", &controllers.CooperationApplicationController{}, "Put:UpdateCooperationApplication") // 编辑共创申请
web.Router("/cooperation-applications/:cooperationApplicationId", &controllers.CooperationApplicationController{}, "Get:GetCooperationApplication") // 获取共创申请详情
web.Router("/cooperation-applications/:cooperationApplicationId", &controllers.CooperationApplicationController{}, "Delete:RemoveCooperationApplication") // 移除共创申请
web.Router("/cooperation-applications/search", &controllers.CooperationApplicationController{}, "Post:SearchCooperationApplication") // 搜索返回共创申请列表
web.Router("/cooperation-applications/", &controllers.CooperationApplicationController{}, "Get:ListCooperationApplication") // 返回共创申请列表
web.Router("/cooperation-applications/apply-for-cooperation", &controllers.CooperationApplicationController{}, "Post:ApplyForCooperation") // 申请共创
web.Router("/cooperation-applications/agree-cooperation-application", &controllers.CooperationApplicationController{}, "Post:ApprovalCooperationApplication") // 同意共创申请
web.Router("/cooperation-applications/batch-approval", &controllers.CooperationContractController{}, "Post:BatchApprovalCooperationApplication") // 一键审核
web.Router("/cooperation-applications/", &controllers.CooperationApplicationController{}, "Post:CreateCooperationApplication") // 新增共创申请
web.Router("/cooperation-applications/:cooperationApplicationId", &controllers.CooperationApplicationController{}, "Put:UpdateCooperationApplication") // 编辑共创申请
web.Router("/cooperation-applications/:cooperationApplicationId", &controllers.CooperationApplicationController{}, "Get:GetCooperationApplication") // 获取共创申请详情
web.Router("/cooperation-applications/:cooperationApplicationId", &controllers.CooperationApplicationController{}, "Delete:RemoveCooperationApplication") // 移除共创申请
web.Router("/cooperation-applications/search", &controllers.CooperationApplicationController{}, "Post:SearchCooperationApplication") // 搜索返回共创申请列表
web.Router("/cooperation-applications/", &controllers.CooperationApplicationController{}, "Get:ListCooperationApplication") // 返回共创申请列表
}
... ...