作者 陈志颖

fix:导入素币操作

... ... @@ -1435,7 +1435,7 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc
continue
}
cashPoolFoundUnExchangeCash := cashPoolsFound[0].UnExchangeCash
cashPoolFoundUnExchangeCash := cashPoolsFound[0].UnExchangeCash
cashPoolFoundExchangedCash := cashPoolsFound[0].ExchangedCash
// 获取员工查询条件
... ... @@ -1502,7 +1502,6 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc
}
}
if len(peopleFound) > 0 { // 当前导入员工在素币兑换清单中,判断追加素币兑换或撤回素币兑换
// 获取当前员工已兑换素币
personFoundExchangedSuMoney := peopleFound[0].ExchangedSuMoney
... ... @@ -1629,18 +1628,6 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc
continue
}
//// 判断兑换活动的现金是否超过现金池未兑换现金
//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 {
... ... @@ -1825,9 +1812,9 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc
operationSuMoneyCommand := &command.OperationSuMoneyCommand{
Uid: employeeFound.EmployeeInfo.Uid,
Operator: createExchangeCashPersonCommand.Operator,
SuMoney: createExchangeCashPersonCommand.ExchangedSuMoney,
SuMoney: suMoneyIncrement,
OperationType: 4,
OperationDescription: "参与" + activityFound.ExchangeActivityName,
OperationDescription: activityFound.ExchangeActivityName + "调整",
}
// 操作素币,生成素币流水
... ... @@ -1853,18 +1840,6 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc
continue
}
//// 判断兑换活动的现金是否超过现金池未兑换现金
//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 {
... ... @@ -2080,18 +2055,6 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc
}
}
//// 判断兑换活动的现金是否超过现金池未兑换现金
//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)
if err != nil {
... ...