|
|
|
@@ -112,7 +112,7 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService |
|
|
|
int receivepay = record.getReceivePay().intValue(); |
|
|
|
int pay = record.getPay().intValue(); |
|
|
|
if (pay > receivepay) { |
|
|
|
return new ResultData(ErrorCode.BILL_PAY_ERROR, "实收金额不能大于实际应收金额"); |
|
|
|
return new ResultData(ErrorCode.BILL_PAY_ERROR.getCode(), "实收金额不能大于实际应收金额"); |
|
|
|
} |
|
|
|
if (record.getId() == null) { |
|
|
|
logger.info("新增其他账单"); |
|
|
|
@@ -182,10 +182,10 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData returnDeposit(WxBillOtherDeposit record) { |
|
|
|
logger.info("租赁押金退还"); |
|
|
|
logger.info("其他押金退还"); |
|
|
|
WxBillOtherDeposit wxBillDeposit = wxBillOtherDepositMapper.selectByPrimaryKey(record.getId()); |
|
|
|
if (wxBillDeposit == null) { |
|
|
|
return new ResultData(ErrorCode.BILL_RENT_DEPOSIT_IS_NOT_FOUND); |
|
|
|
return new ResultData(ErrorCode.BILL_OTHER_DEPOSIT_IS_NOT_FOUND); |
|
|
|
} |
|
|
|
wxBillDeposit.setReturnPrice(record.getReturnPrice()); |
|
|
|
wxBillDeposit.setStatus(EnumBillRentStatus.RETURN.getCode()); |
|
|
|
@@ -199,5 +199,23 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService |
|
|
|
return new ResultData(Result.SUCCESS, "租赁押金退还成功", wxBillDeposit); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData adjustDeposit(WxBillOtherDeposit record) { |
|
|
|
logger.info("其他押金调整"); |
|
|
|
WxBillOtherDeposit wxBillDeposit = wxBillOtherDepositMapper.selectByPrimaryKey(record.getId()); |
|
|
|
if (wxBillDeposit == null) { |
|
|
|
return new ResultData(ErrorCode.BILL_OTHER_DEPOSIT_IS_NOT_FOUND); |
|
|
|
} |
|
|
|
wxBillDeposit.setReceivePay(record.getReceivePay()); |
|
|
|
wxBillDeposit.setUpdatetime(new Date()); |
|
|
|
try { |
|
|
|
wxBillOtherDepositMapper.updateByPrimaryKeySelective(wxBillDeposit); |
|
|
|
} 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); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |