正在显示
1 个修改的文件
包含
21 行增加
和
2 行删除
@@ -1768,8 +1768,15 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc | @@ -1768,8 +1768,15 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc | ||
1768 | cashIncrement := suMoneyIncrement * activityFound.Rate | 1768 | cashIncrement := suMoneyIncrement * activityFound.Rate |
1769 | 1769 | ||
1770 | // 判断该员工兑换的素币是否超过本人持有的素币 | 1770 | // 判断该员工兑换的素币是否超过本人持有的素币 |
1771 | - if employeeFoundSuMoney < createExchangeCashPersonCommand.ExchangedSuMoney { | ||
1772 | - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "当前兑换素币超过本人持有的素币值") | 1771 | + if employeeFoundSuMoney < (createExchangeCashPersonCommand.ExchangedSuMoney - employeeFoundSuMoney) { |
1772 | + row := []interface{}{ | ||
1773 | + createExchangeCashPersonCommand.PersonName, | ||
1774 | + createExchangeCashPersonCommand.PersonAccount, | ||
1775 | + createExchangeCashPersonCommand.ExchangedSuMoney, | ||
1776 | + "当前兑换素币超过本人持有的素币值", | ||
1777 | + } | ||
1778 | + failureDataList = append(failureDataList, row) | ||
1779 | + continue | ||
1773 | } | 1780 | } |
1774 | 1781 | ||
1775 | // 更新兑换素币清单命令 | 1782 | // 更新兑换素币清单命令 |
@@ -1991,6 +1998,18 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc | @@ -1991,6 +1998,18 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc | ||
1991 | } | 1998 | } |
1992 | } | 1999 | } |
1993 | } else if len(peopleFound) == 0 { // 导入兑换素币清单员工不存在兑换素币清单中,新增兑换素币清单 | 2000 | } else if len(peopleFound) == 0 { // 导入兑换素币清单员工不存在兑换素币清单中,新增兑换素币清单 |
2001 | + // 判断该员工兑换的素币是否超过本人持有的素币 | ||
2002 | + if employeeFoundSuMoney < (createExchangeCashPersonCommand.ExchangedSuMoney - employeeFoundSuMoney) { | ||
2003 | + row := []interface{}{ | ||
2004 | + createExchangeCashPersonCommand.PersonName, | ||
2005 | + createExchangeCashPersonCommand.PersonAccount, | ||
2006 | + createExchangeCashPersonCommand.ExchangedSuMoney, | ||
2007 | + "当前兑换素币超过本人持有的素币值", | ||
2008 | + } | ||
2009 | + failureDataList = append(failureDataList, row) | ||
2010 | + continue | ||
2011 | + } | ||
2012 | + | ||
1994 | // 新增兑换素币清单命令 | 2013 | // 新增兑换素币清单命令 |
1995 | newPersonExchangedCash, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", createExchangeCashPersonCommand.ExchangedSuMoney * activityFound.Rate), 64) | 2014 | newPersonExchangedCash, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", createExchangeCashPersonCommand.ExchangedSuMoney * activityFound.Rate), 64) |
1996 | newPerson := &domain.ExchangeCashPersonList{ | 2015 | newPerson := &domain.ExchangeCashPersonList{ |
-
请 注册 或 登录 后发表评论