...
|
...
|
@@ -296,7 +296,7 @@ func (cashPoolService *CashPoolService) GetExchangeCashActivity(getExchangeCashA |
|
|
} else {
|
|
|
exchangeCashActivityRepository = value
|
|
|
}
|
|
|
activity, err := exchangeCashActivityRepository.FindOne(map[string]interface{}{"activityId": getExchangeCashActivityQuery.ExchangeCashActivityId})
|
|
|
activity, err := exchangeCashActivityRepository.FindOne(map[string]interface{}{"exchangeCashActivityId": getExchangeCashActivityQuery.ExchangeCashActivityId})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
@@ -385,18 +385,20 @@ func (cashPoolService *CashPoolService) CreateExchangeCashPerson(createExchangeC |
|
|
transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
|
|
|
var exchangeCashActivityRepository domain.ExchangeActivityRepository
|
|
|
activity, err := exchangeCashActivityRepository.FindOne(map[string]interface{}{"activityId": createExchangeCashPersonCommand.ExchangeCashActivityId})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
if activity.Rate == 0 {
|
|
|
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string("请设置汇率")))
|
|
|
}
|
|
|
// TODO 获取兑换活动兑换汇率
|
|
|
//var exchangeCashActivityRepository domain.ExchangeActivityRepository
|
|
|
//activity, err := exchangeCashActivityRepository.FindOne(map[string]interface{}{"activityId": createExchangeCashPersonCommand.ExchangeCashActivityId})
|
|
|
//if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
//}
|
|
|
//if activity.Rate == 0 {
|
|
|
// return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string("请设置汇率")))
|
|
|
//}
|
|
|
|
|
|
// TODO 清单中现金总额超过现金池时创建失败,提示:“已超过投入现金池的未兑换现金”
|
|
|
|
|
|
|
|
|
|
|
|
// TODO 新增兑换人员时,判断成员是否存在,判断素币值是否超过本人持有的素币,以手机账号为判断依据
|
|
|
|
|
|
|
...
|
...
|
@@ -407,7 +409,8 @@ func (cashPoolService *CashPoolService) CreateExchangeCashPerson(createExchangeC |
|
|
},
|
|
|
ExchangeCashActivityId: createExchangeCashPersonCommand.ExchangeCashActivityId,
|
|
|
ExchangedSuMoney: createExchangeCashPersonCommand.ExchangedSuMoney,
|
|
|
ExchangedCash: createExchangeCashPersonCommand.ExchangedSuMoney * activity.Rate,
|
|
|
//ExchangedCash: createExchangeCashPersonCommand.ExchangedSuMoney * activity.Rate,
|
|
|
ExchangedCash: createExchangeCashPersonCommand.ExchangedSuMoney,
|
|
|
}
|
|
|
|
|
|
var exchangeCashPersonListRepository domain.ExchangeCashPersonListRepository
|
...
|
...
|
@@ -456,7 +459,7 @@ func (cashPoolService *CashPoolService) GetExchangeCashPerson(getExchangeCashPer |
|
|
} else {
|
|
|
exchangeCashPersonListRepository = value
|
|
|
}
|
|
|
person, err := exchangeCashPersonListRepository.FindOne(map[string]interface{}{"personId": getExchangeCashPersonQuery.ExchangeCashPersonId})
|
|
|
person, err := exchangeCashPersonListRepository.FindOne(map[string]interface{}{"exchangeCashListId": getExchangeCashPersonQuery.ExchangeCashPersonId})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
|