作者 yangfu
正在显示 29 个修改的文件 包含 1389 行增加38 行删除
package command
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
)
type CreateCooperationContractCommand struct {
CooperationContract struct {
CooperationContractId int `json:"cooperationContractId,string"`
// 共创合约描述
Description string `json:"Description"`
// 共创合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 共创项目编号,
CooperationProjectNumber string `json:"cooperationProjectNumber"`
// 共创合约发起部门编码
DepartmentId string `json:"departmentId"`
// 共创合约承接对象,1员工,2共创用户,3公开
CooperationContractUndertakerType []int `json:"cooperationContractUndertakerType"`
// 共创合约名称
CooperationContractName string `json:"cooperationContractName"`
// 共创模式编码,手动输入,唯一确定
CooperationModeNumber string `json:"cooperationModeNumber"`
// 共创合约发起人uid
SponsorUserId string `json:"sponsorUserId"`
} `json:"cooperationContract"`
// 业绩分红激励规则列表
DividendsIncentivesRules []struct {
// 关联的项目合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 推荐人抽成比例
ReferrerPercentage float64 `json:"referrerPercentage"`
// 业务员抽成比例
SalesmanPercentage float64 `json:"salesmanPercentage"`
// 分红规则激励百分点
DividendsIncentivesPercentage float64 `json:"dividendsIncentivesPercentage"`
// 分红规则激励阶段,
DividendsIncentivesStage int64 `json:"dividendsIncentivesStage,string,"`
// 分红规则激励阶段结束
DividendsIncentivesStageEnd int `json:"dividendsIncentivesStageEnd"`
// 分红规则激励阶段开始
DividendsIncentivesStageStart int `json:"dividendsIncentivesStageStart"`
} `json:"dividendsIncentivesRules"`
// 金额激励规则列表
MoneyIncentivesRules []struct {
// 金额激励规则ID
MoneyIncentivesRuleId int64 `json:"moneyIncentivesRuleId,string,"`
// 关联的共创合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 激励金额
MoneyIncentivesAmount float64 `json:"moneyIncentivesAmount"`
// 金额激励阶段,
MoneyIncentivesStage int64 `json:"moneyIncentivesStage,string,"`
// 金额激励规则时间
MoneyIncentivesTime int `json:"moneyIncentivesTime"`
// 推荐人抽成比例
ReferrerPercentage float64 `json:"referrerPercentage"`
// 业务员抽成比例
SalesmanPercentage float64 `json:"salesmanPercentage"`
} `json:"moneyIncentivesRules"`
// 关联用户id
RelationUser []int `json:"relationUser"`
//承接人列表
ContractUndertaker []struct {
HasReferrer bool `json:"hasReferrer"`
HasSalesman bool `json:"hasSalesman"`
UsersId int `json:"usersId,string,"`
ReferrerUser struct {
UserId int `json:"userId,string,"`
} `json:"referrerUser"`
SalesmanUser struct {
UserId int `json:"userId"`
} `json:"salesmanUser"`
Attachment []struct {
Name string `json:"name"`
Type string `json:"type"`
Url string `json:"url"`
FileSize int `json:"fileSize"`
} `json:"attachment"`
} `json:"contractUndertaker"`
}
func (createCooperationContractCommand *CreateCooperationContractCommand) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (createCooperationContractCommand *CreateCooperationContractCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(createCooperationContractCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
package command
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
)
type EnableCooperationContractCommand struct {
// 共创合约ID
CooperationContractId []string `json:"cooperationContractId" valid:"Required"`
// 暂停和恢复的状态
Status int `json:"status,omitempty"`
}
func (enableCooperationContractCommand *EnableCooperationContractCommand) Valid(validation *validation.Validation) {
}
func (enableCooperationContractCommand *EnableCooperationContractCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(enableCooperationContractCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
package command
import (
"fmt"
"time"
"github.com/beego/beego/v2/core/validation"
)
type UpdateCooperationContractCommand struct {
CooperationContract struct {
CooperationContractId int `json:"cooperationContractId,string"`
// 共创合约描述
Description string `json:"Description"`
// 共创合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 共创项目编号,
CooperationProjectNumber string `json:"cooperationProjectNumber"`
// 共创合约发起部门编码
DepartmentId string `json:"departmentId"`
// 共创合约承接对象,1员工,2共创用户,3公开
CooperationContractUndertakerType []int `json:"cooperationContractUndertakerType"`
// 共创合约名称
CooperationContractName string `json:"cooperationContractName"`
// 共创模式编码,手动输入,唯一确定
CooperationModeNumber string `json:"cooperationModeNumber"`
// 共创合约发起人uid
SponsorUserId string `json:"sponsorUserId"`
} `json:"cooperationContract"`
// 业绩分红激励规则列表
DividendsIncentivesRules []struct {
// 关联的项目合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 推荐人抽成比例
ReferrerPercentage float64 `json:"referrerPercentage"`
// 业务员抽成比例
SalesmanPercentage float64 `json:"salesmanPercentage"`
// 分红规则激励百分点
DividendsIncentivesPercentage float64 `json:"dividendsIncentivesPercentage"`
// 分红规则激励阶段,
DividendsIncentivesStage int64 `json:"dividendsIncentivesStage,string,"`
// 分红规则激励阶段结束
DividendsIncentivesStageEnd time.Time `json:"dividendsIncentivesStageEnd"`
// 分红规则激励阶段开始
DividendsIncentivesStageStart time.Time `json:"dividendsIncentivesStageStart"`
} `json:"dividendsIncentivesRules"`
// 金额激励规则列表
MoneyIncentivesRules []struct {
// 金额激励规则ID
MoneyIncentivesRuleId int64 `json:"moneyIncentivesRuleId,string,"`
// 关联的共创合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 激励金额
MoneyIncentivesAmount float64 `json:"moneyIncentivesAmount"`
// 金额激励阶段,
MoneyIncentivesStage int64 `json:"moneyIncentivesStage,string,"`
// 金额激励规则时间
MoneyIncentivesTime time.Time `json:"moneyIncentivesTime"`
// 推荐人抽成比例
ReferrerPercentage float64 `json:"referrerPercentage"`
// 业务员抽成比例
SalesmanPercentage float64 `json:"salesmanPercentage"`
} `json:"moneyIncentivesRules"`
// 关联用户id
RelationUser []int `json:"relationUser"`
//承接人列表
ContractUndertaker []struct {
HasReferrer bool `json:"hasReferrer"`
HasSalesman bool `json:"hasSalesman"`
UsersId int `json:"usersId,string,"`
ReferrerUser struct {
UserId int `json:"userId,string,"`
} `json:"referrerUser"`
SalesmanUser struct {
UserId int `json:"userId"`
} `json:"salesmanUser"`
Attachment []struct {
Name string `json:"name"`
Type string `json:"type"`
Url string `json:"url"`
FileSize int `json:"fileSize"`
} `json:"attachment"`
} `json:"contractUndertaker"`
}
func (updateCooperationContractCommand *UpdateCooperationContractCommand) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (updateCooperationContractCommand *UpdateCooperationContractCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(updateCooperationContractCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
package query
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
)
type GetCooperationContractQuery struct {
// 共创合约ID
CooperationContractId int64 `json:"cooperationContractId" valid:"Required"`
}
func (getCooperationContractQuery *GetCooperationContractQuery) Valid(validation *validation.Validation) {
}
func (getCooperationContractQuery *GetCooperationContractQuery) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(getCooperationContractQuery)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
package query
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
)
type ListCooperationContractQuery struct {
// 查询偏离量
PageNumber int `json:"pageNumber"`
// 查询限制
PageSize int `json:"pageSize" valid:"Required"`
}
func (listCooperationContractQuery *ListCooperationContractQuery) Valid(validation *validation.Validation) {
}
func (listCooperationContractQuery *ListCooperationContractQuery) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(listCooperationContractQuery)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
package service
import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationContract/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationContract/query"
)
// 共创合约管理
type CooperationContractService struct {
}
// 创建共创合约管理
func (cooperationContractService *CooperationContractService) CreateCooperationContract(createCooperationContractCommand *command.CreateCooperationContractCommand) (interface{}, error) {
if err := createCooperationContractCommand.ValidateCommand(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
return nil, nil
}
// 暂停恢复共创合约
func (cooperationContractService *CooperationContractService) EnableCooperationContract(enableCooperationContractCommand *command.EnableCooperationContractCommand) (interface{}, error) {
if err := enableCooperationContractCommand.ValidateCommand(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
return nil, nil
}
// 返回共创合约管理
func (cooperationContractService *CooperationContractService) GetCooperationContract(getCooperationContractQuery *query.GetCooperationContractQuery) (interface{}, error) {
if err := getCooperationContractQuery.ValidateQuery(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
return nil, nil
}
// 返回共创合约管理列表
func (cooperationContractService *CooperationContractService) ListCooperationContract(listCooperationContractQuery *query.ListCooperationContractQuery) (interface{}, error) {
if err := listCooperationContractQuery.ValidateQuery(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
return nil, nil
}
// 更新共创合约管理
func (cooperationContractService *CooperationContractService) UpdateCooperationContract(updateCooperationContractCommand *command.UpdateCooperationContractCommand) (interface{}, error) {
if err := updateCooperationContractCommand.ValidateCommand(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
return nil, nil
}
func NewCooperationContractService(options map[string]interface{}) *CooperationContractService {
newCooperationContractService := &CooperationContractService{}
return newCooperationContractService
}
... ...
... ... @@ -15,7 +15,7 @@ type EndCooperationProjectCommand struct {
}
func (endCooperationProjectCommand *EndCooperationProjectCommand) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (endCooperationProjectCommand *EndCooperationProjectCommand) ValidateCommand() error {
... ...
... ... @@ -15,7 +15,7 @@ type RemoveCooperationProjectCommand struct {
}
func (removeCooperationProjectCommand *RemoveCooperationProjectCommand) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (removeCooperationProjectCommand *RemoveCooperationProjectCommand) ValidateCommand() error {
... ...
... ... @@ -29,7 +29,7 @@ type UpdateCooperationProjectCommand struct {
}
func (updateCooperationProjectCommand *UpdateCooperationProjectCommand) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (updateCooperationProjectCommand *UpdateCooperationProjectCommand) ValidateCommand() error {
... ...
... ... @@ -47,7 +47,7 @@ func (cooperationProjectService *CooperationProjectService) EndCooperationProjec
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
//creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(endCooperationProjectCommand.Operator)
//TODO
//TODO 等待接口
return nil, nil
}
... ... @@ -64,7 +64,6 @@ func (cooperationProjectService *CooperationProjectService) GetCooperationProjec
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return result, nil
}
// 返回共创项目管理列表
... ...
package command
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
)
type CreateDividendsOrderCommand struct {
//操作人
Operator domain.Operator `json:"-"`
//客户名称
CustomerName string `json:"customerName" valid:"Required"`
//分红订单金额
DividendsOrderAmount float64 `json:"dividendsOrderAmount" valid:"Required"`
//分红订单号
DividendsOrderNumber string `json:"dividendsOrderNumber" valid:"Required"`
//分红订单原单号
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum" valid:"Required"`
//订单产生时间 时间戳 秒
OrderTime int64 `json:"orderTime" valid:"Required"`
//备注
Remarks string `json:"remarks" valid:"Required"`
//订单业务员uid
SalesmanUid string `json:"salesmanUid"`
//订单操作人uid
OperatorUid string `json:"operatorUid"`
//区域名称
RegionName string `json:"regionName"`
//订单产品列表
OrderGoods []struct {
CooperationContractNumber string `json:"cooperationContractNumber"` //关联的共创合约编号
DividendsOrderNumber string `json:"dividendsOrderNumber"` //关联分红订单号
OrderGoodAmount float64 `json:"orderGoodAmount"` //订单产品金额
OrderGoodExpense float64 `json:"orderGoodExpense"` //订单产品费用
OrderGoodName string `json:"orderGoodName"` //订单产品名称
OrderGoodPrice float64 `json:"orderGoodPrice"` //订单产品单价
OrderGoodQuantity int `json:"orderGoodQuantity"` //订单产品数量
} `json:"orderGoods"`
}
func (createDividendsOrderCommand *CreateDividendsOrderCommand) Valid(validation *validation.Validation) {
}
func (createDividendsOrderCommand *CreateDividendsOrderCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(createDividendsOrderCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
... ... @@ -7,42 +7,20 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
)
type ReleaseCooperationProjectCommand struct {
type RemoveDividendsOrderCommand struct {
//操作人
Operator domain.Operator `json:"-"`
// 共创项目名称
CooperationProjectName string `json:"cooperationProjectName" valid:"Required"`
// 共创模式ID
CooperationModeId int64 `json:"cooperationModeId" valid:"Required"`
// 手机号码
Phone string `json:"phone" valid:"Required"`
// 共创模式状态,1启用,2禁用
Status int32 `json:"status" valid:"Required"`
// 用户编号
UsersCode string `json:"usersCode" valid:"Required"`
// 用户编号
UsersId int64 `json:"usersId" valid:"Required"`
// 用户姓名
UsersName string `json:"usersName" valid:"Required"`
// 邮箱
Email string `json:"email" valid:"Required"`
// 共创公司
CooperationCompany string `json:"cooperationCompany" valid:"Required"`
// 共创公司到期时间
CooperationDeadline string `json:"cooperationDeadline" valid:"Required"`
// 共创项目承接对象,1员工,2共创用户,3公开,可以多选
CooperationProjectUndertakerType []int32 `json:"cooperationProjectUndertakerType" valid:"Required"`
// 共创项目描述
CooperationProjectDescription string `json:"cooperationProjectDescription" valid:"Required"`
// 分红订单ID
DividendsOrderId []string `json:"dividendsOrderId" valid:"Required"`
}
func (releaseCooperationProjectCommand *ReleaseCooperationProjectCommand) Valid(validation *validation.Validation) {
func (removeDividendsOrderCommand *RemoveDividendsOrderCommand) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (releaseCooperationProjectCommand *ReleaseCooperationProjectCommand) ValidateCommand() error {
func (removeDividendsOrderCommand *RemoveDividendsOrderCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(releaseCooperationProjectCommand)
b, err := valid.Valid(removeDividendsOrderCommand)
if err != nil {
return err
}
... ...
package command
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
)
type UpdateDividendsOrderCommand struct {
//操作人
Operator domain.Operator `json:"-"`
//分红订单
DividendsOrderID int `json:"dividendsOrderId"`
//客户名称
CustomerName string `json:"customerName" valid:"Required"`
//分红订单金额
DividendsOrderAmount float64 `json:"dividendsOrderAmount" valid:"Required"`
//分红订单号
DividendsOrderNumber string `json:"dividendsOrderNumber" valid:"Required"`
//分红订单原单号
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum" valid:"Required"`
//订单产生时间
OrderTime int64 `json:"orderTime" valid:"Required"`
//备注
Remarks string `json:"remarks" valid:"Required"`
//订单业务员uid
SalesmanUid string `json:"salesmanUid"`
//订单操作人uid
OperatorUid string `json:"operatorUid"`
//区域名称
RegionName string `json:"regionName"`
//订单产品列表
OrderGoods []struct {
CooperationContractNumber string `json:"cooperationContractNumber"` //关联的共创合约编号
DividendsOrderNumber string `json:"dividendsOrderNumber"` //关联分红订单号
OrderGoodAmount float64 `json:"orderGoodAmount"` //订单产品金额
OrderGoodExpense float64 `json:"orderGoodExpense"` //订单产品费用
OrderGoodName string `json:"orderGoodName"` //订单产品名称
OrderGoodPrice float64 `json:"orderGoodPrice"` //订单产品单价
OrderGoodQuantity int `json:"orderGoodQuantity"` //订单产品数量
} `json:"orderGoods"`
}
func (updateDividendsOrderCommand *UpdateDividendsOrderCommand) Valid(validation *validation.Validation) {
}
func (updateDividendsOrderCommand *UpdateDividendsOrderCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(updateDividendsOrderCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
package query
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
)
type GetDividendsOrderQuery struct {
//操作人
Operator domain.Operator `json:"-"`
// 分红订单ID
DividendsOrderId int `json:"dividendsOrderId,string" valid:"Required"`
}
func (getDividendsOrderQuery *GetDividendsOrderQuery) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (getDividendsOrderQuery *GetDividendsOrderQuery) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(getDividendsOrderQuery)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
package query
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
)
type ListDividendsOrdersQuery struct {
// 页码
PageNumber int `json:"pageNumber"`
// 每页限制
PageSize int `json:"pageSize"`
}
func (listDividendsOrdersQuery *ListDividendsOrdersQuery) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (listDividendsOrdersQuery *ListDividendsOrdersQuery) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(listDividendsOrdersQuery)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
package query
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
)
type SearchDividendsOrderQuery struct {
//操作人
Operator domain.Operator `json:"-"`
// 分红订单号
DividendsOrderNumber string `json:"dividendsOrderNumber,omitempty"`
// 客户名称
CustomerName string `json:"customerName,omitempty"`
// 页码
PageNumber int `json:"pageNumber"`
// 每页限制
PageSize int `json:"pageSize"`
}
func (searchDividendsOrderQuery *SearchDividendsOrderQuery) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (searchDividendsOrderQuery *SearchDividendsOrderQuery) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(searchDividendsOrderQuery)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}
... ...
package service
import (
"strconv"
"time"
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsOrder/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsOrder/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
// 分红订单实体对象
type DividendsOrderService struct {
}
// 创建分红订单实体对象
func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createDividendsOrderCommand *command.CreateDividendsOrderCommand) (interface{}, error) {
if err := createDividendsOrderCommand.ValidateCommand(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
orderGoods := []allied_creation_cooperation.DividendsOrderGoods{}
for _, v := range createDividendsOrderCommand.OrderGoods {
good := allied_creation_cooperation.DividendsOrderGoods{
CooperationContractNumber: v.CooperationContractNumber,
DividendsOrderNumber: v.DividendsOrderNumber,
OrderGoodAmount: v.OrderGoodAmount,
OrderGoodExpense: v.OrderGoodExpense,
OrderGoodName: v.OrderGoodName,
OrderGoodPrice: v.OrderGoodPrice,
OrderGoodQuantity: v.OrderGoodQuantity,
}
orderGoods = append(orderGoods, good)
}
t := time.Unix(createDividendsOrderCommand.OrderTime, 0)
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createDividendsOrderCommand.Operator)
result, err := creationCooperationGateway.DividendsOrderAdd(allied_creation_cooperation.ReqDividendsOrderAdd{
CompanyId: int(createDividendsOrderCommand.Operator.CompanyId),
CustomerName: createDividendsOrderCommand.CustomerName,
DividendsOrderAmount: createDividendsOrderCommand.DividendsOrderAmount,
DividendsOrderNumber: createDividendsOrderCommand.DividendsOrderNumber,
DividendsOriginalOrderNum: createDividendsOrderCommand.DividendsOriginalOrderNum,
OperatorUid: int(createDividendsOrderCommand.Operator.UserId),
OrderTime: t,
Remarks: createDividendsOrderCommand.Remarks,
SalesmanUid: createDividendsOrderCommand.SalesmanUid,
RegionName: createDividendsOrderCommand.RegionName,
OrderGoods: orderGoods,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
data := struct {
DividendsOrderId int
command.CreateDividendsOrderCommand
}{
DividendsOrderId: result.DividendsOrderID,
CreateDividendsOrderCommand: *createDividendsOrderCommand,
}
return data, nil
}
// 返回分红订单实体对象
func (dividendsOrderService *DividendsOrderService) GetDividendsOrder(getDividendsOrderQuery *query.GetDividendsOrderQuery) (interface{}, error) {
if err := getDividendsOrderQuery.ValidateQuery(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(getDividendsOrderQuery.Operator)
result, err := creationCooperationGateway.DividendsOrderGet(allied_creation_cooperation.ReqDividendsOrderGet{
DividendsOrderId: getDividendsOrderQuery.DividendsOrderId,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return result, nil
}
// 移除分红订单实体对象
func (dividendsOrderService *DividendsOrderService) RemoveDividendsOrder(removeDividendsOrderCommand *command.RemoveDividendsOrderCommand) (interface{}, error) {
if err := removeDividendsOrderCommand.ValidateCommand(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
dividendsOrderId := []int{}
for _, v := range removeDividendsOrderCommand.DividendsOrderId {
id, _ := strconv.Atoi(v)
dividendsOrderId = append(dividendsOrderId, id)
}
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(removeDividendsOrderCommand.Operator)
creationCooperationGateway.DividendsOrderRemove(allied_creation_cooperation.ReqDividendsOrderRemove{
DividendsOrderId: 0, ///TODO 改换为批量删除
})
return nil, nil
}
// 查询分红订单方法
func (dividendsOrderService *DividendsOrderService) SearchDividendsOrder(searchDividendsOrderQuery *query.SearchDividendsOrderQuery) (int, interface{}, error) {
if err := searchDividendsOrderQuery.ValidateQuery(); err != nil {
return 0, nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(searchDividendsOrderQuery.Operator)
result, err := creationCooperationGateway.DividendsOrderSearch(allied_creation_cooperation.ReqDividendsOrderSearch{
PageNumber: searchDividendsOrderQuery.PageNumber,
PageSize: searchDividendsOrderQuery.PageSize,
CustomerName: searchDividendsOrderQuery.CustomerName,
DividendsOrderNumber: searchDividendsOrderQuery.DividendsOrderNumber,
})
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return result.Gride.Total, result.Gride.List, nil
}
// 更新分红订单实体对象
func (dividendsOrderService *DividendsOrderService) UpdateDividendsOrder(updateDividendsOrderCommand *command.UpdateDividendsOrderCommand) (interface{}, error) {
if err := updateDividendsOrderCommand.ValidateCommand(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
orderGoods := []allied_creation_cooperation.DividendsOrderGoods{}
for _, v := range updateDividendsOrderCommand.OrderGoods {
good := allied_creation_cooperation.DividendsOrderGoods{
CooperationContractNumber: v.CooperationContractNumber,
DividendsOrderNumber: v.DividendsOrderNumber,
OrderGoodAmount: v.OrderGoodAmount,
OrderGoodExpense: v.OrderGoodExpense,
OrderGoodName: v.OrderGoodName,
OrderGoodPrice: v.OrderGoodPrice,
OrderGoodQuantity: v.OrderGoodQuantity,
}
orderGoods = append(orderGoods, good)
}
t := time.Unix(updateDividendsOrderCommand.OrderTime, 0)
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateDividendsOrderCommand.Operator)
_, err := creationCooperationGateway.DividendsOrderUpdate(allied_creation_cooperation.ReqDividendsOrderUpdate{
DividendsOrderId: updateDividendsOrderCommand.DividendsOrderID,
CompanyId: int(updateDividendsOrderCommand.Operator.CompanyId),
CustomerName: updateDividendsOrderCommand.CustomerName,
DividendsOrderAmount: updateDividendsOrderCommand.DividendsOrderAmount,
DividendsOrderNumber: updateDividendsOrderCommand.DividendsOrderNumber,
DividendsOriginalOrderNum: updateDividendsOrderCommand.DividendsOriginalOrderNum,
OperatorUid: int(updateDividendsOrderCommand.Operator.UserId),
OrderTime: t,
Remarks: updateDividendsOrderCommand.Remarks,
SalesmanUid: updateDividendsOrderCommand.SalesmanUid,
RegionName: updateDividendsOrderCommand.RegionName,
OrderGoods: orderGoods,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return updateDividendsOrderCommand, nil
}
func NewDividendsOrderService(options map[string]interface{}) *DividendsOrderService {
newDividendsOrderService := &DividendsOrderService{}
return newDividendsOrderService
}
... ...
package command
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
type CreateDividendsReturnedOrderCommand struct {
//操作人
Operator domain.Operator `json:"-"`
allied_creation_cooperation.ReqDividendsReturnedOrderAdd
}
... ...
package command
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
type RemoveDividendsReturnedOrderCommand struct {
//操作人
Operator domain.Operator `json:"-"`
allied_creation_cooperation.ReqDividendsReturnedOrderRemove
}
... ...
package command
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
type UpdateDividendsReturnedOrderCommand struct {
//操作人
Operator domain.Operator `json:"-"`
allied_creation_cooperation.ReqDividendsReturnedOrderUpdate
}
... ...
package query
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
)
type GetDividendsReturnedOrderQuery struct {
//操作人
Operator domain.Operator `json:"-"`
DividendsReturnedOrderID int `json:"dividendsReturnedOrderId"` //分红退货单记录id
}
... ...
package query
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
)
type SearchDividendsReturnedOrderQuery struct {
//操作人
Operator domain.Operator `json:"-"`
// 退货客户姓名
DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName,omitempty"`
// 分红退货单号
DividendsReturnedOrderNumber string `json:"dividendsReturnedOrderNumber,omitempty"`
// 查询偏离量
PageNumber int `json:"pageNumber"`
// 每页
PageSize int `json:"pageSize"`
}
... ...
package service
import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
// 分红退货单服务
type DividendsReturnedOrderService struct {
}
// 创建分红退货单服务
func (dividendsReturnedOrderService *DividendsReturnedOrderService) CreateDividendsReturnedOrder(createDividendsReturnedOrderCommand *command.CreateDividendsReturnedOrderCommand) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createDividendsReturnedOrderCommand.Operator)
_, err := creationCooperationGateway.DividendsReturnedOrderAdd(createDividendsReturnedOrderCommand.ReqDividendsReturnedOrderAdd)
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return createDividendsReturnedOrderCommand, nil
}
// 返回分红退货单服务
func (dividendsReturnedOrderService *DividendsReturnedOrderService) GetDividendsReturnedOrder(getDividendsReturnedOrderQuery *query.GetDividendsReturnedOrderQuery) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(getDividendsReturnedOrderQuery.Operator)
result, err := creationCooperationGateway.DividendsReturnedOrderGet(allied_creation_cooperation.ReqDividendsReturnedOrderGet{
DividendsReturnedOrderId: getDividendsReturnedOrderQuery.DividendsReturnedOrderID,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return result, nil
}
// 移除分红退货单服务
func (dividendsReturnedOrderService *DividendsReturnedOrderService) RemoveDividendsReturnedOrder(removeDividendsReturnedOrderCommand *command.RemoveDividendsReturnedOrderCommand) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(removeDividendsReturnedOrderCommand.Operator)
_, err := creationCooperationGateway.DividendsReturnedOrderRemove(removeDividendsReturnedOrderCommand.ReqDividendsReturnedOrderRemove)
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return removeDividendsReturnedOrderCommand, nil
}
// 查找分红退货单
func (dividendsReturnedOrderService *DividendsReturnedOrderService) SearchDividendsReturnedOrder(searchDividendsReturnedOrderQuery *query.SearchDividendsReturnedOrderQuery) (int, interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(searchDividendsReturnedOrderQuery.Operator)
result, err := creationCooperationGateway.DividendsReturnedOrderSearch(allied_creation_cooperation.ReqDividendsReturnedOrderSearch{
PageNumber: searchDividendsReturnedOrderQuery.PageNumber,
PageSize: searchDividendsReturnedOrderQuery.PageSize,
DividendsReturnedOrderNumber: searchDividendsReturnedOrderQuery.DividendsReturnedOrderNumber,
DividendsReturnedCustomerName: searchDividendsReturnedOrderQuery.DividendsReturnedCustomerName,
})
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return result.Total, result.List, nil
}
// 更新分红退货单服务
func (dividendsReturnedOrderService *DividendsReturnedOrderService) UpdateDividendsReturnedOrder(updateDividendsReturnedOrderCommand *command.UpdateDividendsReturnedOrderCommand) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateDividendsReturnedOrderCommand.Operator)
_, err := creationCooperationGateway.DividendsReturnedOrderUpdate(updateDividendsReturnedOrderCommand.ReqDividendsReturnedOrderUpdate)
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return updateDividendsReturnedOrderCommand, nil
}
func NewDividendsReturnedOrderService(options map[string]interface{}) *DividendsReturnedOrderService {
newDividendsReturnedOrderService := &DividendsReturnedOrderService{}
return newDividendsReturnedOrderService
}
... ...
package allied_creation_cooperation
import (
"encoding/json"
"fmt"
"strconv"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
)
//DividendsReturnedOrderAdd 创建分红退货单
func (gateway HttplibAlliedCreationCooperation) DividendsReturnedOrderAdd(param ReqDividendsReturnedOrderAdd) (*DataDividendsReturnedOrderAdd, error) {
url := gateway.baseUrL + "/dividends-returned-orders"
method := "POST"
req := gateway.CreateRequest(url, method)
log.Logger.Debug("向业务模块请求数据:创建分红退货单。", map[string]interface{}{
"api": method + ":" + url,
"param": param,
})
req, err := req.JSONBody(param)
if err != nil {
return nil, fmt.Errorf("请求创建分红退货单失败:%w", err)
}
byteResult, err := req.Bytes()
if err != nil {
return nil, fmt.Errorf("获取创建分红退货单失败:%w", err)
}
log.Logger.Debug("获取业务模块请求数据:创建分红退货单。", map[string]interface{}{
"result": string(byteResult),
})
var result service_gateway.GatewayResponse
err = json.Unmarshal(byteResult, &result)
if err != nil {
return nil, fmt.Errorf("解析创建分红退货单:%w", err)
}
var data DataDividendsReturnedOrderAdd
err = gateway.GetResponseData(result, &data)
return &data, err
}
// DividendsReturnedOrderUpdate 更新分红退货单
func (gateway HttplibAlliedCreationCooperation) DividendsReturnedOrderUpdate(param ReqDividendsReturnedOrderUpdate) (
*DataDividendsReturnedOrderUpdate, error) {
url := gateway.baseUrL + "/dividends-returned-orders/" + strconv.Itoa(param.DividendsReturnedOrderID)
method := "PUT"
req := gateway.CreateRequest(url, method)
log.Logger.Debug("向业务模块请求数据:更新分红退货单。", map[string]interface{}{
"api": method + ":" + url,
"param": param,
})
req, err := req.JSONBody(param)
if err != nil {
return nil, fmt.Errorf("请求更新分红退货单失败:%w", err)
}
byteResult, err := req.Bytes()
if err != nil {
return nil, fmt.Errorf("获取更新分红退货单失败:%w", err)
}
log.Logger.Debug("获取业务模块请求数据:更新分红退货单。", map[string]interface{}{
"result": string(byteResult),
})
var result service_gateway.GatewayResponse
err = json.Unmarshal(byteResult, &result)
if err != nil {
return nil, fmt.Errorf("解析更新分红退货单:%w", err)
}
var data DataDividendsReturnedOrderUpdate
err = gateway.GetResponseData(result, &data)
return &data, err
}
// DividendsReturnedOrderSearch 查找分红退货单
func (gateway HttplibAlliedCreationCooperation) DividendsReturnedOrderSearch(param ReqDividendsReturnedOrderSearch) (*DataDividendsReturnedOrderSearch, error) {
url := gateway.baseUrL + "/dividends-returned-orders/search"
method := "POST"
req := gateway.CreateRequest(url, method)
log.Logger.Debug("向业务模块请求数据:查找分红退货单。", map[string]interface{}{
"api": method + ":" + url,
"param": param,
})
req, err := req.JSONBody(param)
if err != nil {
return nil, fmt.Errorf("请求查找分红退货单失败:%w", err)
}
byteResult, err := req.Bytes()
if err != nil {
return nil, fmt.Errorf("获取查找分红退货单失败:%w", err)
}
log.Logger.Debug("获取业务模块请求数据:查找分红退货单。", map[string]interface{}{
"result": string(byteResult),
})
var result service_gateway.GatewayResponse
err = json.Unmarshal(byteResult, &result)
if err != nil {
return nil, fmt.Errorf("解析查找分红退货单:%w", err)
}
var data DataDividendsReturnedOrderSearch
err = gateway.GetResponseData(result, &data)
return &data, err
}
// DividendsReturnedOrderRemove 移除分红退货单
func (gateway HttplibAlliedCreationCooperation) DividendsReturnedOrderRemove(param ReqDividendsReturnedOrderRemove) (
*DataDividendsReturnedOrderRemove, error) {
url := gateway.baseUrL + "/dividends-returned-orders/" + strconv.Itoa(param.DividendsReturnedOrderID)
method := "DELETE"
req := gateway.CreateRequest(url, method)
log.Logger.Debug("向业务模块请求数据:移除分红退货单。", map[string]interface{}{
"api": method + ":" + url,
"param": param,
})
req, err := req.JSONBody(param)
if err != nil {
return nil, fmt.Errorf("请求移除分红退货单失败:%w", err)
}
byteResult, err := req.Bytes()
if err != nil {
return nil, fmt.Errorf("获取移除分红退货单失败:%w", err)
}
log.Logger.Debug("获取业务模块请求数据:移除分红退货单。", map[string]interface{}{
"result": string(byteResult),
})
var result service_gateway.GatewayResponse
err = json.Unmarshal(byteResult, &result)
if err != nil {
return nil, fmt.Errorf("解析移除分红退货单:%w", err)
}
var data DataDividendsReturnedOrderRemove
err = gateway.GetResponseData(result, &data)
return &data, err
}
// DividendsReturnedOrders 返回分红退货单列表
func (gateway HttplibAlliedCreationCooperation) DividendsReturnedOrderList(param ReqDividendsReturnedOrderList) (*DataDividendsReturnedOrderList, error) {
url := gateway.baseUrL + "/dividends-returned-orders"
method := "GET"
req := gateway.CreateRequest(url, method)
log.Logger.Debug("向业务模块请求数据:返回分红退货单列表。", map[string]interface{}{
"api": method + ":" + url,
"param": param,
})
req, err := req.JSONBody(param)
if err != nil {
return nil, fmt.Errorf("请求返回分红退货单列表失败:%w", err)
}
byteResult, err := req.Bytes()
if err != nil {
return nil, fmt.Errorf("获取返回分红退货单列表失败:%w", err)
}
log.Logger.Debug("获取业务模块请求数据:返回分红退货单列表。", map[string]interface{}{
"result": string(byteResult),
})
var result service_gateway.GatewayResponse
err = json.Unmarshal(byteResult, &result)
if err != nil {
return nil, fmt.Errorf("解析返回分红退货单列表:%w", err)
}
var data DataDividendsReturnedOrderList
err = gateway.GetResponseData(result, &data)
return &data, err
}
// DividendsReturnedOrderGet 返回分红退货单详情
func (gateway HttplibAlliedCreationCooperation) DividendsReturnedOrderGet(param ReqDividendsReturnedOrderGet) (*DataDividendsReturnedOrderGet, error) {
url := gateway.baseUrL + "/dividends-returned-orders" + strconv.Itoa(param.DividendsReturnedOrderId)
method := "GET"
req := gateway.CreateRequest(url, method)
log.Logger.Debug("向业务模块请求数据:返回分红退货单详情。", map[string]interface{}{
"api": method + ":" + url,
"param": param,
})
req, err := req.JSONBody(param)
if err != nil {
return nil, fmt.Errorf("请求返回分红退货单详情失败:%w", err)
}
byteResult, err := req.Bytes()
if err != nil {
return nil, fmt.Errorf("获取返回分红退货单详情失败:%w", err)
}
log.Logger.Debug("获取业务模块请求数据:返回分红退货单详情。", map[string]interface{}{
"result": string(byteResult),
})
var result service_gateway.GatewayResponse
err = json.Unmarshal(byteResult, &result)
if err != nil {
return nil, fmt.Errorf("解析返回分红退货单详情:%w", err)
}
var data DataDividendsReturnedOrderGet
err = gateway.GetResponseData(result, &data)
return &data, err
}
... ...
package allied_creation_cooperation
import "time"
//创建共创合约
type (
ReqCooperationContractAdd struct {
// 共创合约描述
CooperationContractDescription string ` json:"cooperationContractDescription"`
// 共创合约编号
CooperationContractNumber string ` json:"cooperationContractNumber"`
// 共创项目编号,
CooperationProjectNumber string `json:"cooperationProjectNumber" `
// 共创合约发起部门编码
DepartmentNumber string `json:"departmentNumber"`
// 共创合约承接对象,1员工,2共创用户,3公开
CooperationContractUndertakerType []int ` json:"cooperationContractUndertakerType"`
// 共创合约名称
CooperationContractName string `json:"cooperationContractName"`
// 共创模式编码,手动输入,唯一确定
CooperationModeNumber string ` json:"cooperationModeNumber"`
// 共创合约发起人uid
SponsorUid string `json:"sponsorUid,omitempty"`
// 业绩分红激励规则列表
DividendsIncentivesRules []struct {
// 关联的项目合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 推荐人抽成比例
ReferrerPercentage float64 `json:"referrerPercentage"`
// 业务员抽成比例
SalesmanPercentage float64 `json:"salesmanPercentage"`
// 分红规则激励百分点
DividendsIncentivesPercentage float64 `json:"dividendsIncentivesPercentage"`
// 分红规则激励阶段,阶段返回时需要转换为中文数字
DividendsIncentivesStage int64 `json:"dividendsIncentivesStage,string"`
// 分红规则激励阶段结束
DividendsIncentivesStageEnd time.Time `json:"dividendsIncentivesStageEnd"`
// 分红规则激励阶段开始
DividendsIncentivesStageStart time.Time `json:"dividendsIncentivesStageStart"`
} `json:"dividendsIncentivesRules"`
// 金额激励规则列表
MoneyIncentivesRules []struct {
// 金额激励规则ID
MoneyIncentivesRuleId int64 `json:"moneyIncentivesRuleId,string"`
// 关联的共创合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 激励金额
MoneyIncentivesAmount float64 `json:"moneyIncentivesAmount"`
// 金额激励阶段,阶段返回时需要转换为中文数字
MoneyIncentivesStage int64 `json:"moneyIncentivesStage,string"`
// 金额激励阶段有效期结束
MoneyIncentivesStageEnd time.Time `json:"moneyIncentivesStageEnd"`
// 金额激励阶段有效期开始
MoneyIncentivesStageStart time.Time `json:"moneyIncentivesStageStart"`
// 金额激励规则时间
MoneyIncentivesTime time.Time `json:"moneyIncentivesTime"`
// 推荐人抽成比例
ReferrerPercentage float64 `json:"referrerPercentage"`
// 业务员抽成比例
SalesmanPercentage float64 `json:"salesmanPercentage"`
} `json:"moneyIncentivesRules"`
// 承接方列表
Undertakers []struct {
UserId int64 `json:"userId,string"`
// 用户基本id
UserBaseId int64 `json:"userBaseId,string"`
// 用户所属组织机构
Org struct {
// 组织机构ID
OrgId int64 `json:"orgId,string"`
// 组织名称
OrgName string `json:"orgName"`
}
} `json:"undertakers"`
}
DataCooperationContractAdd struct {
... ...
... ... @@ -178,8 +178,8 @@ type (
//判断当前勾选的承接对象是否存在用户
type (
ReqCooperationProjectsCheck struct {
CooperationProjectId int
CooperationProjectUndertakerTypes []int
CooperationProjectId int `json:"cooperationProjectId"`
CooperationProjectUndertakerTypes []int `json:"cooperationProjectUndertakerTypes"`
}
DataCooperationProjectsCheck struct {
... ...
package allied_creation_cooperation
import "time"
//创建分红订单
type DividendsOrder struct {
Company struct {
CompanyID int `json:"companyId"`
CompanyLogo string `json:"companyLogo"`
CompanyName string `json:"companyName"`
} `json:"company"`
CustomerName string `json:"customerName"` //客户名字
DividendStatus int `json:"dividendStatus"` //分红订单分红状态,1待分红,2已分红,3部分分红
DividendTime string `json:"dividendTime"` //分红订单分红时间
DividendsOrderAmount float64 `json:"dividendsOrderAmount"` //分红订单金额
DividendsOrderID int `json:"dividendsOrderId"` //分红订单
DividendsOrderNumber int `json:"dividendsOrderNumber"` //分红订单号
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号
OrderSalesman struct { //订单业务员
Department struct {
DepartmentID int `json:"departmentId"`
DepartmentName string `json:"departmentName"`
DepartmentNumber string `json:"departmentNumber"`
IsOrganization bool `json:"isOrganization"`
} `json:"department"`
Org struct {
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
} `json:"org"`
UserBaseID int `json:"userBaseId"`
UserID int `json:"userId"`
UserInfo struct {
UserAccount string `json:"userAccount"`
UserAvatar string `json:"userAvatar"`
UserEmail string `json:"userEmail"`
UserName string `json:"userName"`
UserPhone string `json:"userPhone"`
} `json:"userInfo"`
UserType int `json:"userType"`
} `json:"orderSalesman"`
OrderTime string `json:"orderTime"`
Org struct {
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
} `json:"org"`
Region struct {
RegionName string `json:"regionName"`
RegionNumber string `json:"regionNumber"`
}
}
type (
//订单产品
DividendsOrderGoods struct {
CooperationContractNumber string `json:"cooperationContractNumber"` //关联的共创合约编号
DividendsOrderNumber string `json:"dividendsOrderNumber"` //关联分红订单号
OrderGoodAmount float64 `json:"orderGoodAmount"` //订单产品金额
OrderGoodExpense float64 `json:"orderGoodExpense"` //订单产品费用
OrderGoodName string `json:"orderGoodName"` //订单产品名称
OrderGoodPrice float64 `json:"orderGoodPrice"` //订单产品单价
OrderGoodQuantity int `json:"orderGoodQuantity"` //订单产品数量
}
ReqDividendsOrderAdd struct {
CompanyId int `json:"companyId"`
CustomerName string `json:"customerName"` //客户名称
DividendsOrderAmount float64 `json:"dividendsOrderAmount"` //分红订单金额
DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红订单号
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号
OperatorUid int `json:"operatorUid"` //订单操作人id
OrderGoods []DividendsOrderGoods `json:"orderGoods"` //订单产品列表
OrderTime time.Time `json:"orderTime"` //订单产生时间
Remarks string `json:"remarks"` //备注
SalesmanUid string `json:"salesmanUid"` //订单业务员uid
UserId int `json:"userId"` //
RegionName string `json:"regionName"` //区域名称
}
DataDividendsOrderAdd struct {
DividendsOrderId int
DividendsOrder
}
)
//更新分红订单
type (
ReqDividendsOrderUpdate struct {
DividendsOrderId int
DividendsOrderId int `json:"dividendsOrderId"`
CompanyId int `json:"companyId"`
CustomerName string `json:"customerName"` //客户名称
DividendsOrderAmount float64 `json:"dividendsOrderAmount"` //分红订单金额
DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红订单号
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号
OperatorUid int `json:"operatorUid"` //订单操作人id
OrderGoods []DividendsOrderGoods `json:"orderGoods"` //订单产品列表
OrderTime time.Time `json:"orderTime"` //订单产生时间
Remarks string `json:"remarks"` //备注
SalesmanUid string `json:"salesmanUid"` //订单业务员uid
UserId int `json:"userId"` //
RegionName string `json:"regionName"` //区域名称
}
DataDividendsOrderUpdate struct {
DividendsOrder
}
)
//查询分红订单
type (
ReqDividendsOrderSearch struct {
CompanyId int `json:"companyId"`
CustomerName string `json:"customerName"`
DividendsOrderNumber string `json:"dividendsOrderNumber"`
OrgIds []int `json:"orgIds"`
PageNumber int `json:"pageNumber"`
PageSize int `json:"pageSize"`
UserId int `json:"userId"`
}
DataDividendsOrderSearch struct {
Gride struct {
Total int `json:"total"`
List []DividendsOrder `json:"list"`
} `json:"gride"`
}
)
... ... @@ -60,9 +155,10 @@ type (
//返回分红订单详情
type (
ReqDividendsOrderGet struct {
DividendsOrderId int
DividendsOrderId int `json:"dividendsOrderId"`
}
DataDividendsOrderGet struct {
DividendsOrder
}
)
... ...
package allied_creation_cooperation
import "time"
//创建分红退货单
type (
DividendsReturnedOrderGoods struct {
CooperationContractNumber string `json:"cooperationContractNumber"` //关联的共创合约编号
OrderGoodAmount float64 `json:"orderGoodAmount"` //订单产品金额
OrderGoodName string `json:"orderGoodName"` //订单产品名称
OrderGoodPrice float64 `json:"orderGoodPrice"` //订单产品单价
OrderGoodQuantity int `json:"orderGoodQuantity"` //订单产品数量
}
DividendsReturnedOrder struct {
// 公司
Company struct {
CompanyID int `json:"companyId"`
CompanyLogo string `json:"companyLogo"`
CompanyName string `json:"companyName"`
} `json:"company"`
CreatedAt time.Time `json:"createdAt"`
DividendStatus int `json:"dividendStatus"` // 分红订单分红状态,1待分红,2已分红,3部分分红
DividendTime time.Time `json:"dividendTime"` //分红订单分红时间
DividendsOrderNumber int `json:"dividendsOrderNumber"` //关联分红订单号
DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"` //退货客户姓名
DividendsReturnedDate time.Time `json:"dividendsReturnedDate"` //退货日期
DividendsReturnedOrderID string `json:"dividendsReturnedOrderId"` //分红退货单记录id
DividendsReturnedOrderNumber string `json:"dividendsReturnedOrderNumber"` //分红退货单号
DividendsReturnedOrderRefund float64 `json:"dividendsReturnedOrderRefund"` //退货金额
OperateTime string `json:"operateTime"` //操作时间
OriginalOrderNum string `json:"originalOrderNum"` //源单号(原始订单号)
Remarks string `json:"remarks"` //备注
UpdatedAt string `json:"updatedAt"`
//更新时间
Org struct {
OrgID int `json:"orgId"` //
OrgName string `json:"orgName"` //
} `json:"org"` //归属组织机构
Region struct {
RegionName string `json:"regionName"`
RegionNumber string `json:"regionNumber"` //区域编码
} `json:"region"` //区域信息
Goods []DividendsReturnedOrderGoods `json:"goods"` //货品
}
ReqDividendsReturnedOrderAdd struct {
CustomerName string `json:"customerName"`
DividendsOrderAmount string `json:"dividendsOrderAmount"`
DividendsOrderNumber string `json:"dividendsOrderNumber"`
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"`
OrderGoods []DividendsReturnedOrderGoods `json:"orderGoods"`
OrderTime time.Time `json:"orderTime"`
OrgId int `json:"orgId"`
Remarks string `json:"remarks"`
SalesmanUid string `json:"salesmanUid"`
RegionName string `json:"regionName"`
}
DataDividendsReturnedOrderAdd struct {
}
)
//更新分红退货单
type (
ReqDividendsReturnedOrderUpdate struct {
DividendsReturnedOrderID int `json:"dividendsReturnedOrderId"` //分红退货单记录id
CustomerName string `json:"customerName"`
DividendsOrderAmount string `json:"dividendsOrderAmount"`
DividendsOrderNumber string `json:"dividendsOrderNumber"`
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"`
OrderGoods []DividendsReturnedOrderGoods `json:"orderGoods"`
OrderTime time.Time `json:"orderTime"`
OrgId int `json:"orgId"`
Remarks string `json:"remarks"`
SalesmanUid string `json:"salesmanUid"`
RegionName string `json:"regionName"`
}
DataDividendsReturnedOrderUpdate struct {
}
)
//查找分红退货单
type (
ReqDividendsReturnedOrderSearch struct {
CompanyId int `json:"companyId"`
OrgId int `json:"orgId"`
PageNumber int `json:"pageNumber"`
PageSize int `json:"pageSize"`
DividendsReturnedOrderNumber string `json:"dividendsReturnedOrderNumber"`
DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"`
UserId int `json:"userId"`
}
DataDividendsReturnedOrderSearch struct {
Total int `json:"total"`
List []DividendsReturnedOrder `json:"list"`
}
)
//移除分红退货单
type (
ReqDividendsReturnedOrderRemove struct {
DividendsReturnedOrderID int `json:"dividendsReturnedOrderId"` //分红退货单记录id
}
DataDividendsReturnedOrderRemove struct {
}
)
//返回分红退货单列表
type (
ReqDividendsReturnedOrderList struct {
}
DataDividendsReturnedOrderList struct {
}
)
//返回分红退货单详情
type (
ReqDividendsReturnedOrderGet struct {
DividendsReturnedOrderId int `json:"dividendsReturnedOrderId"`
}
DataDividendsReturnedOrderGet struct {
DividendsReturnedOrder
}
)
... ...