作者 陈志颖

fix:导入新增素币兑换清单个人素币判断

... ... @@ -1481,7 +1481,7 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc
operationSuMoneyService = value
}
// 循环添加
// 循环添加素币兑换清单
for _, createExchangeCashPersonCommand := range createExchangeCashPersonCommands {
// 获取当前兑换清单兑换活动
activityFound, err := exchangeCashActivityRepository.FindOne(map[string]interface{}{"activityId": createExchangeCashPersonCommand.ExchangeCashActivityId})
... ... @@ -1570,7 +1570,7 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc
})
if personFound == nil { // 当前人员不在兑换素币清单中,新增兑换素币清单
// 判断该员工兑换的素币是否超过本人持有的素币
if (createExchangeCashPersonCommand.ExchangedSuMoney - employeeFoundSuMoney) > employeeFoundSuMoney {
if createExchangeCashPersonCommand.ExchangedSuMoney > employeeFoundSuMoney {
row := []interface{}{
createExchangeCashPersonCommand.PersonName,
createExchangeCashPersonCommand.PersonAccount,
... ...
... ... @@ -2,7 +2,7 @@ package constant
import "os"
var POSTGRESQL_DB_NAME = "mmm-worth"
var POSTGRESQL_DB_NAME = "mmm-worth-test"
var POSTGRESQL_USER = "postgres"
var POSTGRESQL_PASSWORD = "1993618jack"
var POSTGRESQL_HOST = "127.0.0.1"
... ...
... ... @@ -61,6 +61,7 @@ func (service *OperationSuMoneyService) Operation(uid int64, operatorUid int64,
}
var recordType int
var transferSuMoney float64
// 操作类型->记录类型对应:1->3: 增加 2->4: 扣除 3->1: 兑换物资 4->5: 兑换现金活动 41->6: 撤回兑换现金素币 5->2: 任务奖励
if operationType == 1 { // 增加
recordType = domain.SU_MONEY_TRANSACTION_RECORD_TYPE_INCREASE
transferSuMoney = suMoney
... ...
... ... @@ -490,7 +490,6 @@ func (controller *SuMoneyController) ImportExchangeList () {
}
}
}
if len(nullLine) > 0 {
ret = map[string]interface{}{
"successCount": 0,
... ...