作者 陈志颖

fix:修复现金池判断

... ... @@ -1629,8 +1629,21 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc
continue
}
// 判断兑换活动的现金是否超过现金池未兑换现金
if activityUpdated.ExchangedSuMoney * updateExchangeCashActivityCommand.ExchangeRate > cashPoolFoundUnExchangeCash {
//// 判断兑换活动的现金是否超过现金池未兑换现金
//if activityUpdated.ExchangedSuMoney * updateExchangeCashActivityCommand.ExchangeRate > cashPoolFoundUnExchangeCash {
// row := []interface{}{
// createExchangeCashPersonCommand.PersonName,
// createExchangeCashPersonCommand.PersonAccount,
// createExchangeCashPersonCommand.ExchangedSuMoney,
// "已超过现金池未兑换现金",
// }
// failureDataList = append(failureDataList, row)
// continue
//}
// 判断是否超过平台未兑换现金
if activityUpdated.ExchangedSuMoney > activityFoundExchangedSuMoney {
if (activityUpdated.ExchangedSuMoney - activityFoundExchangedSuMoney) * activityUpdated.Rate > cashPoolFoundUnExchangeCash {
row := []interface{}{
createExchangeCashPersonCommand.PersonName,
createExchangeCashPersonCommand.PersonAccount,
... ... @@ -1640,6 +1653,7 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc
failureDataList = append(failureDataList, row)
continue
}
}
// 获取平台素币兑换情况
systemSuMoneyStatistics, err := employeeDao.CalculateSystemSuMoney(activityFound.CompanyId)
... ... @@ -1839,8 +1853,21 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc
continue
}
// 判断兑换活动的现金是否超过现金池未兑换现金
if activityUpdated.ExchangedSuMoney * updateExchangeCashActivityCommand.ExchangeRate > cashPoolFoundUnExchangeCash {
//// 判断兑换活动的现金是否超过现金池未兑换现金
//if activityUpdated.ExchangedSuMoney * updateExchangeCashActivityCommand.ExchangeRate > cashPoolFoundUnExchangeCash {
// row := []interface{}{
// createExchangeCashPersonCommand.PersonName,
// createExchangeCashPersonCommand.PersonAccount,
// createExchangeCashPersonCommand.ExchangedSuMoney,
// "已超过现金池未兑换现金",
// }
// failureDataList = append(failureDataList, row)
// continue
//}
// 判断是否超过平台未兑换现金
if activityUpdated.ExchangedSuMoney > activityFoundExchangedSuMoney {
if (activityUpdated.ExchangedSuMoney - activityFoundExchangedSuMoney) * activityUpdated.Rate > cashPoolFoundUnExchangeCash {
row := []interface{}{
createExchangeCashPersonCommand.PersonName,
createExchangeCashPersonCommand.PersonAccount,
... ... @@ -1850,6 +1877,7 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc
failureDataList = append(failureDataList, row)
continue
}
}
// 获取平台素币兑换情况
systemSuMoneyStatistics, err := employeeDao.CalculateSystemSuMoney(activityFound.CompanyId)
... ... @@ -2038,8 +2066,9 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc
continue
}
// 判断兑换活动的现金是否超过现金池未兑换现金
if activityUpdated.ExchangedSuMoney * updateExchangeCashActivityCommand.ExchangeRate > cashPoolFoundUnExchangeCash {
// 判断是否超过平台未兑换现金
if activityUpdated.ExchangedSuMoney > activityFoundExchangedSuMoney {
if (activityUpdated.ExchangedSuMoney - activityFoundExchangedSuMoney) * activityUpdated.Rate > cashPoolFoundUnExchangeCash {
row := []interface{}{
createExchangeCashPersonCommand.PersonName,
createExchangeCashPersonCommand.PersonAccount,
... ... @@ -2049,6 +2078,19 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc
failureDataList = append(failureDataList, row)
continue
}
}
//// 判断兑换活动的现金是否超过现金池未兑换现金
//if activityUpdated.ExchangedSuMoney * updateExchangeCashActivityCommand.ExchangeRate > cashPoolFoundUnExchangeCash {
// row := []interface{}{
// createExchangeCashPersonCommand.PersonName,
// createExchangeCashPersonCommand.PersonAccount,
// createExchangeCashPersonCommand.ExchangedSuMoney,
// "已超过现金池未兑换现金",
// }
// failureDataList = append(failureDataList, row)
// continue
//}
// 获取平台素币兑换情况
systemSuMoneyStatistics, err := employeeDao.CalculateSystemSuMoney(activityFound.CompanyId)
... ...