...
|
...
|
@@ -29,8 +29,7 @@ func (dividendsEstimateService *DividendsEstimateService) EstimateDividendsIncen |
|
|
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
|
|
|
estimateDividendsIncentivesCommand.Operator)
|
|
|
_, err := creationCooperationGateway.DividendsEstimateDividendsIncentives(allied_creation_cooperation.ReqDividendsEstimateDividendsIncentives{
|
|
|
CooperationContractNumber: estimateDividendsIncentivesCommand.CooperationContractNumber,
|
|
|
OrderOrReturnedOrderNum: estimateDividendsIncentivesCommand.OrderOrReturnedOrderNum,
|
|
|
OrderGoodIds: estimateDividendsIncentivesCommand.OrderGoodIds,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
...
|
...
|
@@ -43,14 +42,25 @@ func (dividendsEstimateService *DividendsEstimateService) EstimateMoneyIncentive |
|
|
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
|
|
|
estimateMoneyIncentivesCommand.Operator)
|
|
|
result, err := creationCooperationGateway.DividendsEstimatesEstimateMoneys(allied_creation_cooperation.ReqDividendsEstimateMoneyIncentives{
|
|
|
CooperationContractNumber: estimateMoneyIncentivesCommand.CooperationContractNumber,
|
|
|
DividendsIncentivesStage: estimateMoneyIncentivesCommand.DividendsIncentivesStage,
|
|
|
UndertakerUid: estimateMoneyIncentivesCommand.UndertakerUid,
|
|
|
CooperationContractId: estimateMoneyIncentivesCommand.CooperationContractId,
|
|
|
DividendsIncentivesStage: estimateMoneyIncentivesCommand.DividendsIncentivesStage,
|
|
|
UndertakerUids: estimateMoneyIncentivesCommand.UndertakerUids,
|
|
|
Action: estimateMoneyIncentivesCommand.CmdType,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
return result, nil
|
|
|
data := []map[string]interface{}{}
|
|
|
for i := range result {
|
|
|
item := map[string]interface{}{
|
|
|
"userId": result[i].DividendsUser.UserId,
|
|
|
"userName": result[i].DividendsUser.UserName,
|
|
|
"DividendsAmount": result[i].DividendsAmount,
|
|
|
}
|
|
|
data = append(data, item)
|
|
|
}
|
|
|
|
|
|
return data, nil
|
|
|
}
|
|
|
|
|
|
// 查询分红预算单列表
|
...
|
...
|
@@ -111,7 +121,7 @@ func NewDividendsEstimateService(options map[string]interface{}) *DividendsEstim |
|
|
return newDividendsEstimateService
|
|
|
}
|
|
|
|
|
|
func (dividendsEmmateService *DividendsEstimateService) MoneyIncentivesSelector(queryParam query.MoneyIncentiveSelectorQuery) (interface{}, error) {
|
|
|
func (dividendsEmmateService *DividendsEstimateService) MoneyIncentivesSelector(queryParam *query.MoneyIncentiveSelectorQuery) (interface{}, error) {
|
|
|
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
|
|
|
queryParam.Operator)
|
|
|
resultContract, err := creationCooperationGateway.CooperationContractSearch(allied_creation_cooperation.ReqCooperationContractSearch{
|
...
|
...
|
@@ -134,7 +144,7 @@ func (dividendsEmmateService *DividendsEstimateService) MoneyIncentivesSelector( |
|
|
for _, v := range contractData.MoneyIncentivesRules {
|
|
|
r := dto.MoneyIncentivesRule{
|
|
|
MoneyIncentivesStage: v.MoneyIncentivesStage,
|
|
|
MoneyIncentivesStageStart: int(v.MoneyIncentivesTime.Unix()),
|
|
|
MoneyIncentivesStageStart: int(v.MoneyIncentivesTime.UnixNano() / 1e6),
|
|
|
}
|
|
|
rules = append(rules, r)
|
|
|
}
|
...
|
...
|
|