diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/business/AccWalletInfoBusiness.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/business/AccWalletInfoBusiness.java index a86f1e6..3028b0a 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/business/AccWalletInfoBusiness.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/business/AccWalletInfoBusiness.java @@ -171,7 +171,7 @@ public class AccWalletInfoBusiness { this.accTradeService.updateAccTrade(accountTrade); } log.error("修改钱包失败", ex); - throw new ServiceException("修改钱包失败"); + throw new ServiceException(ex.getMessage()); } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccTradeServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccTradeServiceImpl.java index 3c61d2f..e1db273 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccTradeServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccTradeServiceImpl.java @@ -14,6 +14,8 @@ import com.bonus.canteen.core.account.service.IAccTradeService; import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.utils.DateUtils; import com.bonus.common.houqin.utils.SM4EncryptUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -30,6 +32,8 @@ import java.util.List; */ @Service public class AccTradeServiceImpl implements IAccTradeService { + private static final Logger log = LoggerFactory.getLogger(AccTradeServiceImpl.class); + @Autowired private AccTradeMapper accTradeMapper; @@ -69,9 +73,14 @@ public class AccTradeServiceImpl implements IAccTradeService { @Override @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW) public int insertAccTrade(AccountTrade accountTrade) { - accountTrade.setCreateTime(DateUtils.getNowDate()); - accountTrade.setUpdateTime(DateUtils.getNowDate()); - return accTradeMapper.insertAccTrade(accountTrade); + try { + accountTrade.setCreateTime(DateUtils.getNowDate()); + accountTrade.setUpdateTime(DateUtils.getNowDate()); + return accTradeMapper.insertAccTrade(accountTrade); + } catch (Exception e) { + log.error("insertAccTrade 异常:", e); + throw new ServiceException("系统异常"); + } } @Override @@ -82,7 +91,8 @@ public class AccTradeServiceImpl implements IAccTradeService { BeanUtils.copyProperties(accTradeVo, accountTrade); return accTradeMapper.insertAccTrade(accountTrade); } catch (Exception e) { - throw new ServiceException("错误信息描述" + e.getMessage()); + log.error("insertAccTradeVo 异常:", e); + throw new ServiceException("系统异常"); } } @@ -99,7 +109,8 @@ public class AccTradeServiceImpl implements IAccTradeService { try { return accTradeMapper.updateAccTrade(accountTrade); } catch (Exception e) { - throw new ServiceException("错误信息描述" + e.getMessage()); + log.error("updateAccTrade 异常:", e); + throw new ServiceException("系统异常"); } } @@ -109,7 +120,8 @@ public class AccTradeServiceImpl implements IAccTradeService { try { return accTradeMapper.updateAccTradeVoByOrderNo(accTradeVo); } catch (Exception e) { - throw new ServiceException("错误信息描述" + e.getMessage()); + log.error("updateAccTradeVoByOrderNo 异常:", e); + throw new ServiceException("系统异常"); } }