作者 tangxuhui

日常存档

... ... @@ -62,7 +62,7 @@ func (srv UserService) ChangePassword(changePasswordCommand *command.ChangePassw
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return struct{}{}, nil
return changePasswordCommand, nil
}
//ChangePhone 修改手机号
... ... @@ -82,7 +82,7 @@ func (srv UserService) ChangePhone(resetPhoneCommand *command.ResetPhoneCommand)
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return struct{}{}, nil
return resetPhoneCommand, nil
}
//UpdateUserBaseInfo 更新用户信息
... ...
... ... @@ -5,13 +5,70 @@ import (
"github.com/beego/beego/v2/core/validation"
"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 CreateCooperationContractCommand struct {
//操作人
Operator domain.Operator `json:"-"`
allied_creation_cooperation.ReqCooperationContractAdd
// 共创合约描述
CooperationContractDescription string `json:"cooperationContractDescription"`
// 共创合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 共创项目编号,
CooperationProjectNumber string `json:"cooperationProjectNumber"`
// 共创合约发起部门id
DepartmentId string `json:"departmentId"`
// 共创合约承接对象,1员工,2共创用户,3公开
CooperationContractUndertakerType []int `json:"cooperationContractUndertakerType"`
// 共创合约名称
CooperationContractName string `json:"cooperationContractName"`
// 共创模式编码,
CooperationModeNumber string `json:"cooperationModeNumber"`
// 共创合约发起人uid
SponsorUid string `json:"sponsorUid"`
// 业绩分红激励规则列表
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 int `json:"moneyIncentivesStage"`
// 金额激励规则时间
MoneyIncentivesTime int `json:"moneyIncentivesTime"`
// 推荐人抽成比例
ReferrerPercentage float64 `json:"referrerPercentage"`
// 业务员抽成比例
SalesmanPercentage float64 `json:"salesmanPercentage"`
} `json:"moneyIncentivesRules"`
// 承接方列表
Undertakers []struct {
UndertakerId string `json:"undertakerId"` //承接人用户id
RerferrerId string `json:"rerferrerId"` //推荐人用户id
SalesmanId string `json:"salesmanId"` //关联业务员id
Attachment domain.Attachment `json:"attachment"`
} `json:"undertakers"`
//关联业务员
RelevantIds []string `json:"relevantIds"`
}
func (createCooperationContractCommand *CreateCooperationContractCommand) Valid(validation *validation.Validation) {
... ...
package service
import (
"time"
"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"
... ... @@ -17,7 +19,23 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createCooperationContractCommand.Operator)
_, err := creationCooperationGateway.CooperationContractAdd(createCooperationContractCommand.ReqCooperationContractAdd)
rules1 := []allied_creation_cooperation.DividendsIncentivesRule{}
for _, v := range createCooperationContractCommand.DividendsIncentivesRules {
r := allied_creation_cooperation.DividendsIncentivesRule{
CooperationContractNumber: v.CooperationContractNumber,
ReferrerPercentage: v.ReferrerPercentage,
SalesmanPercentage: v.SalesmanPercentage,
DividendsIncentivesPercentage: v.DividendsIncentivesPercentage,
DividendsIncentivesStage: v.DividendsIncentivesStage,
DividendsIncentivesStageEnd: time.Unix(int64(v.DividendsIncentivesStageEnd), 0),
DividendsIncentivesStageStart: time.Unix(int64(v.DividendsIncentivesStageStart), 0),
}
rules1 = append(rules1, r)
}
// rules2 := []allied_creation_cooperation.MoneyIncentivesRule{}
_, err := creationCooperationGateway.CooperationContractAdd(allied_creation_cooperation.ReqCooperationContractAdd{})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
... ...
... ... @@ -16,18 +16,12 @@ type UpdateDividendsOrderCommand struct {
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"`
//订单产品列表
... ...
... ... @@ -131,12 +131,10 @@ func (dividendsOrderService *DividendsOrderService) UpdateDividendsOrder(updateD
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,
})
... ...