作者 陈志颖

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

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