作者 yangfu
... ... @@ -9,7 +9,6 @@ type CooperationContractItem struct {
CooperationContractId int `json:"cooperationContractId,string,"`
CooperationContractNumber string `json:"cooperationContractNumber"` //合约编号
CooperationProjectNumber string `json:"cooperationProjectNumber"` //项目编号
CooperationProjectId string `json:"cooperationProjectId"` //项目编号
CooperationContractName string `json:"cooperationContractName"` //合约名称
Status int `json:"status"` //合约状态
CreateTime int `json:"createTime"`
... ... @@ -35,7 +34,6 @@ func ToCooperationContractItem(param *allied_creation_cooperation.CooperationCon
CooperationContractDescription: param.CooperationContractDescription,
CooperationContractId: param.CooperationContractId,
CooperationProjectNumber: param.CooperationProjectNumber,
CooperationProjectId: param.CooperationProjectNumber,
CooperationContractName: param.CooperationContractName,
CooperationContractNumber: param.CooperationContractNumber,
Status: param.Status,
... ... @@ -75,7 +73,7 @@ type DividendsIncentivesRule struct {
ReferrerPercentage float64 `json:"referrerPercentage"` // 推荐人抽成比例
SalesmanPercentage float64 `json:"salesmanPercentage"` // 业务员抽成比例
DividendsPercentage float64 `json:"dividendsPercentage"` // 分红规则激励百分点
DividendsStage int `json:"dividendsStage,string"` // 分红规则激励阶段,
DividendsStage int `json:"dividendsStage"` // 分红规则激励阶段,
DividendsStageEnd int64 `json:"dividendsStageEnd"` // 分红规则激励阶段结束
DividendsStageStart int64 `json:"dividendsStageStart"` // 分红规则激励阶段开始
}
... ... @@ -181,6 +179,7 @@ func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationCon
UsersName: v.UserInfo.UserName,
UsersId: v.UserId,
Phone: v.UserInfo.UserPhone,
UserCode: v.UserInfo.UserCode,
},
}
u.SalesmanUser.UserId = v.Salesman.UserId
... ...
... ... @@ -52,9 +52,9 @@ func ToCreditAccountItem(param *allied_creation_cooperation.CreditAccount) *Cred
ActuallyPaidAmount: param.ActuallyPaidAmount,
CreditAccountOrderNum: param.CreditAccountOrderNum,
PaymentStatus: param.PaymentStatus,
PaymentTime: param.PaymentTime.UnixNano() / 1e6,
PaymentTime: 0,
SettlementAmount: param.SettlementAmount,
SettlementTime: param.SettlementTime.UnixNano() / 1e6,
SettlementTime: 0,
CooperationContractNumber: param.CooperationContractNumber,
ParticipateType: param.ParticipateType, // 参与类型
PaymentDocumentAttachment: param.PaymentDocumentAttachment, // 支付凭证附件
... ... @@ -63,6 +63,12 @@ func ToCreditAccountItem(param *allied_creation_cooperation.CreditAccount) *Cred
UpdatedAt: param.UpdatedAt.UnixNano() / 1e6, // 更新时间
AccountDetail: param.AccountDetail,
}
if !param.PaymentTime.IsZero() {
data.PaymentTime = param.PaymentTime.UnixNano() / 1e6
}
if !param.SettlementTime.IsZero() {
data.SettlementTime = param.PaymentTime.UnixNano() / 1e6
}
data.Org.OrgID = param.Org.OrgID
data.Org.OrgName = param.Org.OrgName
data.Participator.UserName = param.Participator.UserName
... ...
... ... @@ -30,7 +30,7 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD
OrderGoodPrice: v.OrderGoodPrice,
OrderGoodQuantity: v.OrderGoodQuantity,
}
orderGoodAmount := v.OrderGoodPrice * float64(v.OrderGoodQuantity)
orderGoodAmount := v.OrderGoodPrice*float64(v.OrderGoodQuantity) - v.OrderGoodExpense
good.OrderGoodAmount = orderGoodAmount
orderGoods = append(orderGoods, good)
}
... ... @@ -120,7 +120,7 @@ func (dividendsOrderService *DividendsOrderService) UpdateDividendsOrder(updateD
OrderGoodPrice: v.OrderGoodPrice,
OrderGoodQuantity: v.OrderGoodQuantity,
}
orderGoodAmount := v.OrderGoodPrice * float64(v.OrderGoodQuantity)
orderGoodAmount := v.OrderGoodPrice*float64(v.OrderGoodQuantity) - v.OrderGoodExpense
good.OrderGoodAmount = orderGoodAmount
orderGoods = append(orderGoods, good)
}
... ...
... ... @@ -13,6 +13,7 @@ type CooperationApplication struct {
UserAvatar string `json:"userAvatar"`
UserEmail string `json:"userEmail"`
UserName string `json:"userName"`
UserCode string `json:"userCode"`
UserPhone string `json:"userPhone"`
UserAccount string `json:"userAccount"`
} `json:"userInfo"`
... ...
... ... @@ -63,6 +63,7 @@ type CooperationContract struct {
UserName string `json:"userName"` // 共创人员姓名
UserPhone string `json:"userPhone"` // 用户手机号
UserAccount string `json:"userAccount"` // 用户账号,区别于手机号,冗余字段
UserCode string `json:"userCode"`
} `json:"userInfo"`
Department struct {
DepartmentId int64 `json:"departmentId,string,"` // 部门ID
... ...
... ... @@ -74,6 +74,7 @@ func (controller *CooperationContractController) EnableCooperationContract() {
controller.Response(nil, err)
return
}
enableCooperationContractCommand.Operator = controller.GetOperator()
data, err := cooperationContractService.EnableCooperationContract(enableCooperationContractCommand)
controller.Response(data, err)
}
... ... @@ -101,6 +102,7 @@ func (controller *CooperationContractController) RemoveCooperationContract() {
controller.Response(nil, err)
return
}
removeCooperationContractCommand.Operator = controller.GetOperator()
data, err := cooperationContractService.RemoveCooperationContract(removeCooperationContractCommand)
controller.Response(data, err)
}
... ...