|
|
|
@@ -189,7 +189,7 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { |
|
|
|
|
|
|
|
@Transactional(rollbackFor = {Exception.class}) |
|
|
|
@Override |
|
|
|
public ResultData returnDeposit(WxBillDeposit record) { |
|
|
|
public ResultData returnDeposit(WxBillDeposit record, MallUserInfo user) { |
|
|
|
logger.info("租赁押金退还"); |
|
|
|
WxBillDeposit wxBillDeposit = wxBillDepositMapper.selectByPrimaryKey(record.getId()); |
|
|
|
if (wxBillDeposit == null) { |
|
|
|
@@ -204,6 +204,23 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { |
|
|
|
logger.error("租赁押金退还失败,e:" + e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); |
|
|
|
} |
|
|
|
//日志 |
|
|
|
WxBillAction wxBillAction = new WxBillAction(); |
|
|
|
wxBillAction.setBillId(wxBillDeposit.getId()); |
|
|
|
String message = EnumBillPayWay.getEnum(record.getPayWay()).getMessage(); |
|
|
|
String price = new BigDecimal(record.getReturnPrice()).divide(new BigDecimal(100)).toPlainString(); |
|
|
|
wxBillAction.setDetails(message + price + "元"); |
|
|
|
wxBillAction.setAction(EnumBillAction.DEPOSIT_RETURN.getCode()); |
|
|
|
wxBillAction.setUserId(user.getId()); |
|
|
|
wxBillAction.setUserName(user.getName()); |
|
|
|
wxBillAction.setPhone(user.getPhone()); |
|
|
|
wxBillAction.setTenantId(wxBillDeposit.getTenantId()); |
|
|
|
try { |
|
|
|
wxBillActionService.save(wxBillAction); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("添加租赁押金账单行为日志,e:" + e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); |
|
|
|
} |
|
|
|
return new ResultData(Result.SUCCESS, "租赁押金退还成功", wxBillDeposit); |
|
|
|
} |
|
|
|
|
|
|
|
|