作者 陈志颖

fix:导入

... ... @@ -1768,8 +1768,15 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc
cashIncrement := suMoneyIncrement * activityFound.Rate
// 判断该员工兑换的素币是否超过本人持有的素币
if employeeFoundSuMoney < createExchangeCashPersonCommand.ExchangedSuMoney {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "当前兑换素币超过本人持有的素币值")
if employeeFoundSuMoney < (createExchangeCashPersonCommand.ExchangedSuMoney - employeeFoundSuMoney) {
row := []interface{}{
createExchangeCashPersonCommand.PersonName,
createExchangeCashPersonCommand.PersonAccount,
createExchangeCashPersonCommand.ExchangedSuMoney,
"当前兑换素币超过本人持有的素币值",
}
failureDataList = append(failureDataList, row)
continue
}
// 更新兑换素币清单命令
... ... @@ -1991,6 +1998,18 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc
}
}
} else if len(peopleFound) == 0 { // 导入兑换素币清单员工不存在兑换素币清单中,新增兑换素币清单
// 判断该员工兑换的素币是否超过本人持有的素币
if employeeFoundSuMoney < (createExchangeCashPersonCommand.ExchangedSuMoney - employeeFoundSuMoney) {
row := []interface{}{
createExchangeCashPersonCommand.PersonName,
createExchangeCashPersonCommand.PersonAccount,
createExchangeCashPersonCommand.ExchangedSuMoney,
"当前兑换素币超过本人持有的素币值",
}
failureDataList = append(failureDataList, row)
continue
}
// 新增兑换素币清单命令
newPersonExchangedCash, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", createExchangeCashPersonCommand.ExchangedSuMoney * activityFound.Rate), 64)
newPerson := &domain.ExchangeCashPersonList{
... ...