作者 陈志颖

Merge branch 'fix-bugs' into dev

@@ -1738,6 +1738,18 @@ func (cashPoolService *CashPoolService) CreateExchangeCashPerson(createExchangeC @@ -1738,6 +1738,18 @@ func (cashPoolService *CashPoolService) CreateExchangeCashPerson(createExchangeC
1738 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的员工") 1738 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的员工")
1739 } 1739 }
1740 1740
  1741 + // 判断当前员工是否已经存在兑换素币清单中
  1742 + if _, people, err := exchangeCashPersonListRepository.Find(map[string]interface{}{
  1743 + "exchangeCashActivityId": activityFound.ActivityId,
  1744 + "uid": employeeFound.EmployeeInfo.Uid,
  1745 + }); err != nil {
  1746 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  1747 + } else {
  1748 + if len(people) > 0 {
  1749 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "当前员工已存在素币兑换清单中")
  1750 + }
  1751 + }
  1752 +
1741 // 判断该员工兑换的素币是否超过本人持有的素币 1753 // 判断该员工兑换的素币是否超过本人持有的素币
1742 if employeeFound.SuMoney < createExchangeCashPersonCommand.ExchangedSuMoney { 1754 if employeeFound.SuMoney < createExchangeCashPersonCommand.ExchangedSuMoney {
1743 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "当前兑换素币超过本人持有的素币值") 1755 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "当前兑换素币超过本人持有的素币值")