作者 陈志颖

fix:修复现金池判断

@@ -1629,16 +1629,30 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc @@ -1629,16 +1629,30 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc
1629 continue 1629 continue
1630 } 1630 }
1631 1631
1632 - // 判断兑换活动的现金是否超过现金池未兑换现金  
1633 - if activityUpdated.ExchangedSuMoney * updateExchangeCashActivityCommand.ExchangeRate > cashPoolFoundUnExchangeCash {  
1634 - row := []interface{}{  
1635 - createExchangeCashPersonCommand.PersonName,  
1636 - createExchangeCashPersonCommand.PersonAccount,  
1637 - createExchangeCashPersonCommand.ExchangedSuMoney,  
1638 - "已超过现金池未兑换现金", 1632 + //// 判断兑换活动的现金是否超过现金池未兑换现金
  1633 + //if activityUpdated.ExchangedSuMoney * updateExchangeCashActivityCommand.ExchangeRate > cashPoolFoundUnExchangeCash {
  1634 + // row := []interface{}{
  1635 + // createExchangeCashPersonCommand.PersonName,
  1636 + // createExchangeCashPersonCommand.PersonAccount,
  1637 + // createExchangeCashPersonCommand.ExchangedSuMoney,
  1638 + // "已超过现金池未兑换现金",
  1639 + // }
  1640 + // failureDataList = append(failureDataList, row)
  1641 + // continue
  1642 + //}
  1643 +
  1644 + // 判断是否超过平台未兑换现金
  1645 + if activityUpdated.ExchangedSuMoney > activityFoundExchangedSuMoney {
  1646 + if (activityUpdated.ExchangedSuMoney - activityFoundExchangedSuMoney) * activityUpdated.Rate > cashPoolFoundUnExchangeCash {
  1647 + row := []interface{}{
  1648 + createExchangeCashPersonCommand.PersonName,
  1649 + createExchangeCashPersonCommand.PersonAccount,
  1650 + createExchangeCashPersonCommand.ExchangedSuMoney,
  1651 + "已超过现金池未兑换现金",
  1652 + }
  1653 + failureDataList = append(failureDataList, row)
  1654 + continue
1639 } 1655 }
1640 - failureDataList = append(failureDataList, row)  
1641 - continue  
1642 } 1656 }
1643 1657
1644 // 获取平台素币兑换情况 1658 // 获取平台素币兑换情况
@@ -1839,16 +1853,30 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc @@ -1839,16 +1853,30 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc
1839 continue 1853 continue
1840 } 1854 }
1841 1855
1842 - // 判断兑换活动的现金是否超过现金池未兑换现金  
1843 - if activityUpdated.ExchangedSuMoney * updateExchangeCashActivityCommand.ExchangeRate > cashPoolFoundUnExchangeCash {  
1844 - row := []interface{}{  
1845 - createExchangeCashPersonCommand.PersonName,  
1846 - createExchangeCashPersonCommand.PersonAccount,  
1847 - createExchangeCashPersonCommand.ExchangedSuMoney,  
1848 - "已超过现金池未兑换现金", 1856 + //// 判断兑换活动的现金是否超过现金池未兑换现金
  1857 + //if activityUpdated.ExchangedSuMoney * updateExchangeCashActivityCommand.ExchangeRate > cashPoolFoundUnExchangeCash {
  1858 + // row := []interface{}{
  1859 + // createExchangeCashPersonCommand.PersonName,
  1860 + // createExchangeCashPersonCommand.PersonAccount,
  1861 + // createExchangeCashPersonCommand.ExchangedSuMoney,
  1862 + // "已超过现金池未兑换现金",
  1863 + // }
  1864 + // failureDataList = append(failureDataList, row)
  1865 + // continue
  1866 + //}
  1867 +
  1868 + // 判断是否超过平台未兑换现金
  1869 + if activityUpdated.ExchangedSuMoney > activityFoundExchangedSuMoney {
  1870 + if (activityUpdated.ExchangedSuMoney - activityFoundExchangedSuMoney) * activityUpdated.Rate > cashPoolFoundUnExchangeCash {
  1871 + row := []interface{}{
  1872 + createExchangeCashPersonCommand.PersonName,
  1873 + createExchangeCashPersonCommand.PersonAccount,
  1874 + createExchangeCashPersonCommand.ExchangedSuMoney,
  1875 + "已超过现金池未兑换现金",
  1876 + }
  1877 + failureDataList = append(failureDataList, row)
  1878 + continue
1849 } 1879 }
1850 - failureDataList = append(failureDataList, row)  
1851 - continue  
1852 } 1880 }
1853 1881
1854 // 获取平台素币兑换情况 1882 // 获取平台素币兑换情况
@@ -2038,18 +2066,32 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc @@ -2038,18 +2066,32 @@ func (cashPoolService *CashPoolService) ImportCreateExchangeCashPerson(createExc
2038 continue 2066 continue
2039 } 2067 }
2040 2068
2041 - // 判断兑换活动的现金是否超过现金池未兑换现金  
2042 - if activityUpdated.ExchangedSuMoney * updateExchangeCashActivityCommand.ExchangeRate > cashPoolFoundUnExchangeCash {  
2043 - row := []interface{}{  
2044 - createExchangeCashPersonCommand.PersonName,  
2045 - createExchangeCashPersonCommand.PersonAccount,  
2046 - createExchangeCashPersonCommand.ExchangedSuMoney,  
2047 - "已超过现金池未兑换现金", 2069 + // 判断是否超过平台未兑换现金
  2070 + if activityUpdated.ExchangedSuMoney > activityFoundExchangedSuMoney {
  2071 + if (activityUpdated.ExchangedSuMoney - activityFoundExchangedSuMoney) * activityUpdated.Rate > cashPoolFoundUnExchangeCash {
  2072 + row := []interface{}{
  2073 + createExchangeCashPersonCommand.PersonName,
  2074 + createExchangeCashPersonCommand.PersonAccount,
  2075 + createExchangeCashPersonCommand.ExchangedSuMoney,
  2076 + "已超过现金池未兑换现金",
  2077 + }
  2078 + failureDataList = append(failureDataList, row)
  2079 + continue
2048 } 2080 }
2049 - failureDataList = append(failureDataList, row)  
2050 - continue  
2051 } 2081 }
2052 2082
  2083 + //// 判断兑换活动的现金是否超过现金池未兑换现金
  2084 + //if activityUpdated.ExchangedSuMoney * updateExchangeCashActivityCommand.ExchangeRate > cashPoolFoundUnExchangeCash {
  2085 + // row := []interface{}{
  2086 + // createExchangeCashPersonCommand.PersonName,
  2087 + // createExchangeCashPersonCommand.PersonAccount,
  2088 + // createExchangeCashPersonCommand.ExchangedSuMoney,
  2089 + // "已超过现金池未兑换现金",
  2090 + // }
  2091 + // failureDataList = append(failureDataList, row)
  2092 + // continue
  2093 + //}
  2094 +
2053 // 获取平台素币兑换情况 2095 // 获取平台素币兑换情况
2054 systemSuMoneyStatistics, err := employeeDao.CalculateSystemSuMoney(activityFound.CompanyId) 2096 systemSuMoneyStatistics, err := employeeDao.CalculateSystemSuMoney(activityFound.CompanyId)
2055 if err != nil { 2097 if err != nil {