作者 tangxuhui

数据结构调整

... ... @@ -29,37 +29,26 @@ type CreateCooperationContractCommand struct {
} `json:"cooperationContract"`
// 业绩分红激励规则列表
DividendsIncentivesRules []struct {
// 关联的项目合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 推荐人抽成比例
ReferrerPercentage float64 `json:"referrerPercentage"`
// 业务员抽成比例
SalesmanPercentage float64 `json:"salesmanPercentage"`
// 分红规则激励百分点
DividendsPercentage float64 `json:"dividendsPercentage"`
// 分红规则激励阶段,
DividendsStage int `json:"dividendsStage"`
// 分红规则激励阶段结束
DividendsStageEnd int `json:"dividendsStageEnd"`
// 分红规则激励阶段开始
DividendsStageStart int `json:"dividendsStageStart"`
} `json:"dividendsIncentivesRules"`
// 金额激励规则列表
CooperationContractNumber string `json:"cooperationContractNumber"` // 关联的项目合约编号
ReferrerPercentage float64 `json:"referrerPercentage"` // 推荐人抽成比例
SalesmanPercentage float64 `json:"salesmanPercentage"` // 业务员抽成比例
DividendsPercentage float64 `json:"dividendsPercentage"` // 分红规则激励百分点
DividendsStage int `json:"dividendsStage"` // 分红规则激励阶段,
DividendsStageEnd int `json:"dividendsStageEnd"` // 分红规则激励阶段结束
DividendsStageStart int `json:"dividendsStageStart"` // 分红规则激励阶段开始
Remarks string `json:"remarks"`
} `json:"dividendsIncentivesRules"` // 金额激励规则列表
MoneyIncentivesRules []struct {
// 金额激励规则ID
// MoneyIncentivesRuleId int64 `json:"moneyIncentivesRuleId,string,"`
// 关联的共创合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 激励金额
MoneyIncentivesAmount float64 `json:"moneyIncentivesAmount"`
// 金额激励阶段
MoneyIncentivesStage int `json:"moneyIncentivesStage"`
// 金额激励规则时间
MoneyIncentivesTime int `json:"moneyIncentivesTime"`
// 推荐人抽成比例
ReferrerPercentage float64 `json:"referrerPercentage"`
// 业务员抽成比例
SalesmanPercentage float64 `json:"salesmanPercentage"`
CooperationContractNumber string `json:"cooperationContractNumber"` // 关联的共创合约编号
MoneyIncentivesAmount float64 `json:"moneyIncentivesAmount"` // 激励金额
MoneyIncentivesStage int `json:"moneyIncentivesStage"` // 金额激励阶段
MoneyIncentivesTime int `json:"moneyIncentivesTime"` // 金额激励规则时间
ReferrerPercentage float64 `json:"referrerPercentage"` // 推荐人抽成比例
SalesmanPercentage float64 `json:"salesmanPercentage"` // 业务员抽成比例
Remarks string `json:"remarks"`
} `json:"moneyIncentivesRules"`
// 承接方列表
Undertakers []struct {
... ...
... ... @@ -45,7 +45,8 @@ type UpdateCooperationContractCommand struct {
// 分红规则激励阶段结束
DividendsStageEnd int `json:"dividendsStageEnd"`
// 分红规则激励阶段开始
DividendsStageStart int `json:"dividendsStageStart"`
DividendsStageStart int `json:"dividendsStageStart"`
Remarks string `json:"remarks"`
} `json:"dividendsIncentivesRules"`
// 金额激励规则列表
MoneyIncentivesRules []struct {
... ... @@ -63,6 +64,7 @@ type UpdateCooperationContractCommand struct {
ReferrerPercentage float64 `json:"referrerPercentage"`
// 业务员抽成比例
SalesmanPercentage float64 `json:"salesmanPercentage"`
Remarks string `json:"remarks"`
} `json:"moneyIncentivesRules"`
// 承接方列表
Undertakers []struct {
... ...
... ... @@ -65,6 +65,7 @@ type MoneyIncentivesRule struct {
MoneyIncentivesTime int64 `json:"moneyIncentivesTime"` // 金额激励规则时间
ReferrerPercentage float64 `json:"referrerPercentage"` // 推荐人抽成比例
SalesmanPercentage float64 `json:"salesmanPercentage"` // 业务员抽成比例
Remarks string `json:"remarks"`
}
type DividendsIncentivesRule struct {
... ... @@ -76,6 +77,7 @@ type DividendsIncentivesRule struct {
DividendsStage int `json:"dividendsStage"` // 分红规则激励阶段,
DividendsStageEnd int64 `json:"dividendsStageEnd"` // 分红规则激励阶段结束
DividendsStageStart int64 `json:"dividendsStageStart"` // 分红规则激励阶段开始
Remarks string `json:"remarks"`
}
type Relevant struct {
... ... @@ -142,6 +144,7 @@ func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationCon
DividendsStage: v.DividendsIncentivesStage,
DividendsStageEnd: v.DividendsIncentivesStageEnd.UnixNano() / 1e6,
DividendsStageStart: v.DividendsIncentivesStageStart.UnixNano() / 1e6,
Remarks: v.Remarks,
}
dividendsIncentivesRules = append(dividendsIncentivesRules, r)
}
... ... @@ -155,6 +158,7 @@ func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationCon
MoneyIncentivesTime: v.MoneyIncentivesTime.UnixNano() / 1e6,
ReferrerPercentage: v.ReferrerPercentage,
SalesmanPercentage: v.SalesmanPercentage,
Remarks: v.Remarks,
}
moneyIncentivesRules = append(moneyIncentivesRules, r)
}
... ...
... ... @@ -30,6 +30,7 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC
DividendsIncentivesStage: v.DividendsStage,
DividendsIncentivesStageEnd: time.Unix(int64(v.DividendsStageEnd/1e3), 0),
DividendsIncentivesStageStart: time.Unix(int64(v.DividendsStageStart/1e3), 0),
Remarks: v.Remarks,
}
rules1 = append(rules1, r)
}
... ... @@ -43,6 +44,7 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC
MoneyIncentivesTime: time.Unix(int64(v.MoneyIncentivesTime/1e3), 0),
ReferrerPercentage: v.ReferrerPercentage,
SalesmanPercentage: v.SalesmanPercentage,
Remarks: v.Remarks,
}
rules2 = append(rules2, r)
}
... ...
... ... @@ -19,7 +19,7 @@ type CreateDividendsReturnedOrderCommand struct {
OrderGoodQuantity int `json:"orderGoodQuantity"` //订单产品数量
} `json:"orderGoods"` //货品
DividendsReturnedDate int64 `json:"dividendsReturnedDate"` //退货日期
OrderDate int64 `json:"orderDate"` //订单日期
OrderTime int64 `json:"orderTime"` //订单日期
Remarks string `json:"remarks"` //
RegionName string `json:"regionName"`
}
... ...
... ... @@ -20,7 +20,7 @@ type UpdateDividendsReturnedOrderCommand struct {
OrderGoodQuantity int `json:"orderGoodQuantity"` //订单产品数量
} `json:"orderGoods"` //货品
DividendsReturnedDate int64 `json:"dividendsReturnedDate"` //退货日期
OrderDate int64 `json:"orderDate"` //订单日期
OrderTime int64 `json:"orderTime"` //订单日期
Remarks string `json:"remarks"` //
RegionName string `json:"regionName"`
... ...
... ... @@ -19,7 +19,7 @@ type DividendsReturnedOrderService struct {
func (dividendsReturnedOrderService *DividendsReturnedOrderService) CreateDividendsReturnedOrder(createDividendsReturnedOrderCommand *command.CreateDividendsReturnedOrderCommand) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createDividendsReturnedOrderCommand.Operator)
dividendsReturnedDate := time.Unix(createDividendsReturnedOrderCommand.DividendsReturnedDate/1e3, 0)
orderDate := time.Unix(createDividendsReturnedOrderCommand.OrderDate/1e3, 0)
orderDate := time.Unix(createDividendsReturnedOrderCommand.OrderTime/1e3, 0)
var orderGooods []allied_creation_cooperation.ReqDividendsReturnedOrderGood
for _, v := range createDividendsReturnedOrderCommand.OrderGoods {
good := allied_creation_cooperation.ReqDividendsReturnedOrderGood{
... ... @@ -38,7 +38,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) CreateDivide
OriginalOrderNum: createDividendsReturnedOrderCommand.OriginalOrderNum,
OrderGoods: orderGooods,
DividendsReturnedDate: dividendsReturnedDate,
OrderData: orderDate,
OrderTime: orderDate,
OrgId: int(createDividendsReturnedOrderCommand.Operator.OrgId),
Remarks: createDividendsReturnedOrderCommand.Remarks,
RegionName: createDividendsReturnedOrderCommand.RegionName,
... ... @@ -97,7 +97,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) SearchDivide
func (dividendsReturnedOrderService *DividendsReturnedOrderService) UpdateDividendsReturnedOrder(updateDividendsReturnedOrderCommand *command.UpdateDividendsReturnedOrderCommand) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateDividendsReturnedOrderCommand.Operator)
dividendsReturnedDate := time.Unix(updateDividendsReturnedOrderCommand.DividendsReturnedDate/1e3, 0)
orderDate := time.Unix(updateDividendsReturnedOrderCommand.OrderDate/1e3, 0)
orderDate := time.Unix(updateDividendsReturnedOrderCommand.OrderTime/1e3, 0)
var orderGooods []allied_creation_cooperation.ReqDividendsReturnedOrderGood
for _, v := range updateDividendsReturnedOrderCommand.OrderGoods {
good := allied_creation_cooperation.ReqDividendsReturnedOrderGood{
... ... @@ -117,7 +117,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) UpdateDivide
OriginalOrderNum: updateDividendsReturnedOrderCommand.OriginalOrderNum,
OrderGoods: orderGooods,
DividendsReturnedDate: dividendsReturnedDate,
OrderData: orderDate,
OrderTime: orderDate,
OrgId: int(updateDividendsReturnedOrderCommand.Operator.OrgId),
Remarks: updateDividendsReturnedOrderCommand.Remarks,
RegionName: updateDividendsReturnedOrderCommand.RegionName,
... ...
... ... @@ -138,6 +138,7 @@ type (
DividendsIncentivesStage int `json:"dividendsIncentivesStage"` // 分红规则激励阶段,
DividendsIncentivesStageEnd time.Time `json:"dividendsIncentivesStageEnd"` // 分红规则激励阶段结束
DividendsIncentivesStageStart time.Time `json:"dividendsIncentivesStageStart"` // 分红规则激励阶段开始
Remarks string `json:"remarks"`
}
//金额激励规则
MoneyIncentivesRule struct {
... ... @@ -148,6 +149,7 @@ type (
MoneyIncentivesTime time.Time `json:"moneyIncentivesTime"` // 金额激励规则时间
ReferrerPercentage float64 `json:"referrerPercentage"` // 推荐人抽成比例
SalesmanPercentage float64 `json:"salesmanPercentage"` // 业务员抽成比例
Remarks string `json:"remarks"`
}
//合约承接方
... ...
... ... @@ -62,7 +62,7 @@ type (
OriginalOrderNum string `json:"originalOrderNum"`
OrderGoods []ReqDividendsReturnedOrderGood `json:"orderGoods"`
DividendsReturnedDate time.Time `json:"dividendsReturnedDate"`
OrderData time.Time `json:"orderData"`
OrderTime time.Time `json:"orderTime"`
OrgId int `json:"orgId"`
Remarks string `json:"remarks"`
RegionName string `json:"regionName"`
... ... @@ -82,7 +82,7 @@ type (
OriginalOrderNum string `json:"originalOrderNum"`
OrderGoods []ReqDividendsReturnedOrderGood `json:"orderGoods"`
DividendsReturnedDate time.Time `json:"dividendsReturnedDate"`
OrderData time.Time `json:"orderData"`
OrderTime time.Time `json:"orderTime"`
OrgId int `json:"orgId"`
Remarks string `json:"remarks"`
RegionName string `json:"regionName"`
... ...