| @@ -83,5 +83,12 @@ public class WxBillDepositController extends BaseController { | |||||
| } | } | ||||
| @PostMapping("adjustDeposit") | |||||
| public ResultData adjustDeposit(@RequestBody WxBillDeposit wxBillDeposit) { | |||||
| logger.debug("[" + getIpAddr() + "] WxBillDepositController::adjustDeposit"); | |||||
| return wxBillDepositService.adjustDeposit(wxBillDeposit); | |||||
| } | |||||
| } | } | ||||
| @@ -83,4 +83,11 @@ public class WxBillOtherDepositController extends BaseController { | |||||
| } | } | ||||
| @PostMapping("adjustDeposit") | |||||
| public ResultData adjustDeposit(@RequestBody WxBillOtherDeposit wxBillDeposit) { | |||||
| logger.debug("[" + getIpAddr() + "] WxBillOtherDepositController::adjustDeposit"); | |||||
| return wxBillOtherDepositService.adjustDeposit(wxBillDeposit); | |||||
| } | |||||
| } | } | ||||
| @@ -3,6 +3,7 @@ package com.iformall.controller; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxBillOtherDeposit; | |||||
| import com.iformall.domain.po.WxBillPropertyDeposit; | import com.iformall.domain.po.WxBillPropertyDeposit; | ||||
| import com.iformall.service.WxBillPropertyDepositService; | import com.iformall.service.WxBillPropertyDepositService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| @@ -84,6 +85,13 @@ public class WxBillPropertyDepositController extends BaseController | |||||
| } | } | ||||
| @PostMapping("adjustDeposit") | |||||
| public ResultData adjustDeposit(@RequestBody WxBillPropertyDeposit wxBillPropertyDeposit) { | |||||
| logger.debug("[" + getIpAddr() + "] WxBillPropertyDepositController::adjustDeposit"); | |||||
| return wxBillPropertyDepositService.adjustDeposit(wxBillPropertyDeposit); | |||||
| } | |||||
| } | } | ||||
| @@ -309,9 +309,10 @@ public enum ErrorCode{ | |||||
| /** | /** | ||||
| * 物业押金账单 | |||||
| * 押金账单 | |||||
| * */ | * */ | ||||
| BILL_PROPERTY_DEPOSIT_IS_NOT_FOUND(20000,"物业押金账单不存在"), | BILL_PROPERTY_DEPOSIT_IS_NOT_FOUND(20000,"物业押金账单不存在"), | ||||
| BILL_OTHER_DEPOSIT_IS_NOT_FOUND(200001, "其他押金账单不存在"), | |||||
| /** | /** | ||||
| * 日常费用账单 | * 日常费用账单 | ||||
| @@ -47,4 +47,5 @@ public interface WxBillDepositService { | |||||
| ResultData returnDeposit(WxBillDeposit wxBillDeposit); | ResultData returnDeposit(WxBillDeposit wxBillDeposit); | ||||
| ResultData adjustDeposit(WxBillDeposit wxBillDeposit); | |||||
| } | } | ||||
| @@ -52,4 +52,5 @@ public interface WxBillOtherDepositService { | |||||
| ResultData returnDeposit(WxBillOtherDeposit wxBillDeposit); | ResultData returnDeposit(WxBillOtherDeposit wxBillDeposit); | ||||
| ResultData adjustDeposit(WxBillOtherDeposit wxBillDeposit); | |||||
| } | } | ||||
| @@ -51,4 +51,6 @@ public interface WxBillPropertyDepositService { | |||||
| ResultData returnDeposit(WxBillPropertyDeposit wxBillPropertyDeposit); | ResultData returnDeposit(WxBillPropertyDeposit wxBillPropertyDeposit); | ||||
| ResultData adjustDeposit(WxBillPropertyDeposit wxBillPropertyDeposit); | |||||
| } | } | ||||
| @@ -96,7 +96,7 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { | |||||
| int receivepay = record.getReceivePay().intValue(); | int receivepay = record.getReceivePay().intValue(); | ||||
| int pay = record.getPay().intValue(); | int pay = record.getPay().intValue(); | ||||
| if(pay>receivepay){ | if(pay>receivepay){ | ||||
| return new ResultData(ErrorCode.BILL_PAY_ERROR,"实收金额不能大于实际应收金额"); | |||||
| return new ResultData(ErrorCode.BILL_PAY_ERROR.getCode(), "实收金额不能大于实际应收金额"); | |||||
| } | } | ||||
| if (record.getId() == null) { | if (record.getId() == null) { | ||||
| logger.info("新增租赁押金账单"); | logger.info("新增租赁押金账单"); | ||||
| @@ -181,5 +181,23 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { | |||||
| return new ResultData(Result.SUCCESS, "租赁押金退还成功", wxBillDeposit); | return new ResultData(Result.SUCCESS, "租赁押金退还成功", wxBillDeposit); | ||||
| } | } | ||||
| @Override | |||||
| public ResultData adjustDeposit(WxBillDeposit record) { | |||||
| logger.info("租赁押金调整"); | |||||
| WxBillDeposit wxBillDeposit = wxBillDepositMapper.selectByPrimaryKey(record.getId()); | |||||
| if (wxBillDeposit == null) { | |||||
| return new ResultData(ErrorCode.BILL_RENT_DEPOSIT_IS_NOT_FOUND); | |||||
| } | |||||
| wxBillDeposit.setReceivePay(record.getReceivePay()); | |||||
| wxBillDeposit.setUpdatetime(new Date()); | |||||
| try { | |||||
| wxBillDepositMapper.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); | |||||
| } | |||||
| } | } | ||||
| @@ -112,7 +112,7 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||||
| int receivepay = record.getReceivePay().intValue(); | int receivepay = record.getReceivePay().intValue(); | ||||
| int pay = record.getPay().intValue(); | int pay = record.getPay().intValue(); | ||||
| if (pay > receivepay) { | if (pay > receivepay) { | ||||
| return new ResultData(ErrorCode.BILL_PAY_ERROR, "实收金额不能大于实际应收金额"); | |||||
| return new ResultData(ErrorCode.BILL_PAY_ERROR.getCode(), "实收金额不能大于实际应收金额"); | |||||
| } | } | ||||
| if (record.getId() == null) { | if (record.getId() == null) { | ||||
| logger.info("新增其他账单"); | logger.info("新增其他账单"); | ||||
| @@ -182,10 +182,10 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||||
| @Override | @Override | ||||
| public ResultData returnDeposit(WxBillOtherDeposit record) { | public ResultData returnDeposit(WxBillOtherDeposit record) { | ||||
| logger.info("租赁押金退还"); | |||||
| logger.info("其他押金退还"); | |||||
| WxBillOtherDeposit wxBillDeposit = wxBillOtherDepositMapper.selectByPrimaryKey(record.getId()); | WxBillOtherDeposit wxBillDeposit = wxBillOtherDepositMapper.selectByPrimaryKey(record.getId()); | ||||
| if (wxBillDeposit == null) { | 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.setReturnPrice(record.getReturnPrice()); | ||||
| wxBillDeposit.setStatus(EnumBillRentStatus.RETURN.getCode()); | wxBillDeposit.setStatus(EnumBillRentStatus.RETURN.getCode()); | ||||
| @@ -199,5 +199,23 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||||
| return new ResultData(Result.SUCCESS, "租赁押金退还成功", wxBillDeposit); | 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); | |||||
| } | |||||
| } | } | ||||
| @@ -97,7 +97,7 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe | |||||
| int receivepay = record.getReceivePay().intValue(); | int receivepay = record.getReceivePay().intValue(); | ||||
| int pay = record.getPay().intValue(); | int pay = record.getPay().intValue(); | ||||
| if(pay>receivepay){ | if(pay>receivepay){ | ||||
| return new ResultData(ErrorCode.BILL_PAY_ERROR,"实收金额不能大于实际应收金额"); | |||||
| return new ResultData(ErrorCode.BILL_PAY_ERROR.getCode(), "实收金额不能大于实际应收金额"); | |||||
| } | } | ||||
| if (record.getId() == null) { | if (record.getId() == null) { | ||||
| logger.info("新增物业押金账单"); | logger.info("新增物业押金账单"); | ||||
| @@ -182,4 +182,23 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe | |||||
| } | } | ||||
| @Override | |||||
| public ResultData adjustDeposit(WxBillPropertyDeposit record) { | |||||
| logger.info("物业押金调整"); | |||||
| WxBillPropertyDeposit wxBillDeposit = wxBillPropertyDepositMapper.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 { | |||||
| wxBillPropertyDepositMapper.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); | |||||
| } | |||||
| } | } | ||||