|
|
|
@@ -210,7 +210,7 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData returnDeposit(WxBillOtherDeposit record) { |
|
|
|
public ResultData returnDeposit(WxBillOtherDeposit record, MallUserInfo user) { |
|
|
|
logger.info("其他押金退还"); |
|
|
|
WxBillOtherDeposit wxBillDeposit = wxBillOtherDepositMapper.selectByPrimaryKey(record.getId()); |
|
|
|
if (wxBillDeposit == null) { |
|
|
|
@@ -222,10 +222,29 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService |
|
|
|
try { |
|
|
|
wxBillOtherDepositMapper.updateByPrimaryKeySelective(wxBillDeposit); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("租赁押金退还失败,e:" + e.getMessage()); |
|
|
|
logger.error("押金退还失败,e:" + e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); |
|
|
|
} |
|
|
|
return new ResultData(Result.SUCCESS, "租赁押金退还成功", wxBillDeposit); |
|
|
|
|
|
|
|
//日志 |
|
|
|
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); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
|