| @@ -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.WxBillDeposit; | |||||
| import com.iformall.domain.po.WxBillOtherDeposit; | import com.iformall.domain.po.WxBillOtherDeposit; | ||||
| import com.iformall.service.WxBillOtherDepositService; | import com.iformall.service.WxBillOtherDepositService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| @@ -76,5 +77,11 @@ public class WxBillOtherDepositController extends BaseController { | |||||
| return wxBillOtherDepositService.updatePaid(id); | return wxBillOtherDepositService.updatePaid(id); | ||||
| } | } | ||||
| @PostMapping("returnDeposit") | |||||
| public ResultData returnDeposit(@RequestBody WxBillDeposit wxBillDeposit) { | |||||
| logger.debug("[" + getIpAddr() + "] WxBillOtherDepositController::returnDeposit"); | |||||
| return wxBillOtherDepositService.returnDeposit(wxBillDeposit); | |||||
| } | |||||
| } | } | ||||
| @@ -122,6 +122,9 @@ public class WxBillOtherDeposit implements Serializable { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | ||||
| private Integer rentShopType; | private Integer rentShopType; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "退还金额", name = "returnPrice") | |||||
| private Integer returnPrice; | |||||
| public Integer getReceivePay() { | public Integer getReceivePay() { | ||||
| return receivePay; | return receivePay; | ||||
| } | } | ||||
| @@ -242,6 +245,14 @@ public class WxBillOtherDeposit implements Serializable { | |||||
| this.rentShopType = rentShopType; | this.rentShopType = rentShopType; | ||||
| } | } | ||||
| public Integer getReturnPrice() { | |||||
| return returnPrice; | |||||
| } | |||||
| public void setReturnPrice(Integer returnPrice) { | |||||
| this.returnPrice = returnPrice; | |||||
| } | |||||
| public static enum Field { | public static enum Field { | ||||
| Id_ASC("`id` ASC"), Id_DESC("`id` DESC"), ReceivePay_ASC("`receivePay` ASC"), ReceivePay_DESC("`receivePay` DESC"), Pay_ASC("`pay` ASC"), Pay_DESC("`pay` DESC"), ReceiveDate_ASC("`receiveDate` ASC"), ReceiveDate_DESC("`receiveDate` DESC"), PayDate_ASC("`payDate` ASC"), PayDate_DESC("`payDate` DESC"), Createtime_ASC("`createtime` ASC"), Createtime_DESC("`createtime` DESC"), ExpiredDay_ASC("`expiredDay` ASC"), ExpiredDay_DESC("`expiredDay` DESC"), TenantId_ASC("`tenantId` ASC"), TenantId_DESC("`tenantId` DESC"), Owe_ASC("`owe` ASC"), Owe_DESC("`owe` DESC"), Status_ASC("`status` ASC"), Status_DESC("`status` DESC"), IsDel_ASC("`isDel` ASC"), IsDel_DESC("`isDel` DESC"), MerchantId_ASC("`merchantId` ASC"), MerchantId_DESC("`merchantId` DESC"), UserId_ASC("`userId` ASC"), UserId_DESC("`userId` DESC"), ShopId_ASC("`shopId` ASC"), ShopId_DESC("`shopId` DESC"), Updatetime_ASC("`updatetime` ASC"), Updatetime_DESC("`updatetime` DESC"); | Id_ASC("`id` ASC"), Id_DESC("`id` DESC"), ReceivePay_ASC("`receivePay` ASC"), ReceivePay_DESC("`receivePay` DESC"), Pay_ASC("`pay` ASC"), Pay_DESC("`pay` DESC"), ReceiveDate_ASC("`receiveDate` ASC"), ReceiveDate_DESC("`receiveDate` DESC"), PayDate_ASC("`payDate` ASC"), PayDate_DESC("`payDate` DESC"), Createtime_ASC("`createtime` ASC"), Createtime_DESC("`createtime` DESC"), ExpiredDay_ASC("`expiredDay` ASC"), ExpiredDay_DESC("`expiredDay` DESC"), TenantId_ASC("`tenantId` ASC"), TenantId_DESC("`tenantId` DESC"), Owe_ASC("`owe` ASC"), Owe_DESC("`owe` DESC"), Status_ASC("`status` ASC"), Status_DESC("`status` DESC"), IsDel_ASC("`isDel` ASC"), IsDel_DESC("`isDel` DESC"), MerchantId_ASC("`merchantId` ASC"), MerchantId_DESC("`merchantId` DESC"), UserId_ASC("`userId` ASC"), UserId_DESC("`userId` DESC"), ShopId_ASC("`shopId` ASC"), ShopId_DESC("`shopId` DESC"), Updatetime_ASC("`updatetime` ASC"), Updatetime_DESC("`updatetime` DESC"); | ||||
| private String value; | private String value; | ||||
| @@ -2,6 +2,7 @@ package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxBillDeposit; | |||||
| import com.iformall.domain.po.WxBillOther; | import com.iformall.domain.po.WxBillOther; | ||||
| import com.iformall.domain.po.WxBillOtherDeposit; | import com.iformall.domain.po.WxBillOtherDeposit; | ||||
| @@ -49,4 +50,6 @@ public interface WxBillOtherDepositService { | |||||
| ResultData updatePaid(Long id); | ResultData updatePaid(Long id); | ||||
| ResultData returnDeposit(WxBillDeposit wxBillDeposit); | |||||
| } | } | ||||
| @@ -6,6 +6,7 @@ import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.IdWorker; | import com.iformall.common.IdWorker; | ||||
| 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.WxBillDeposit; | |||||
| import com.iformall.domain.po.WxBillOther; | import com.iformall.domain.po.WxBillOther; | ||||
| import com.iformall.domain.po.WxBillOtherDeposit; | import com.iformall.domain.po.WxBillOtherDeposit; | ||||
| import com.iformall.domain.po.WxShop; | import com.iformall.domain.po.WxShop; | ||||
| @@ -181,5 +182,24 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||||
| return new ResultData(Result.SUCCESS, "其他押金账单结单成功"); | return new ResultData(Result.SUCCESS, "其他押金账单结单成功"); | ||||
| } | } | ||||
| @Override | |||||
| public ResultData returnDeposit(WxBillDeposit record) { | |||||
| logger.info("租赁押金退还"); | |||||
| WxBillOtherDeposit wxBillDeposit = wxBillOtherDepositMapper.selectByPrimaryKey(record.getId()); | |||||
| if (wxBillDeposit == null) { | |||||
| return new ResultData(ErrorCode.BILL_RENT_DEPOSIT_IS_NOT_FOUND); | |||||
| } | |||||
| wxBillDeposit.setReturnPrice(record.getReturnPrice()); | |||||
| wxBillDeposit.setStatus(EnumBillRentStatus.RETURN.getCode()); | |||||
| 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); | |||||
| } | |||||
| } | } | ||||
| @@ -20,13 +20,14 @@ | |||||
| <result column="name" jdbcType="VARCHAR" property="name"/> | <result column="name" jdbcType="VARCHAR" property="name"/> | ||||
| <result column="comments" jdbcType="VARCHAR" property="comments"/> | <result column="comments" jdbcType="VARCHAR" property="comments"/> | ||||
| <result column="rent_shop_type" jdbcType="INTEGER" property="rentShopType"/> | <result column="rent_shop_type" jdbcType="INTEGER" property="rentShopType"/> | ||||
| <result column="return_price" jdbcType="INTEGER" property="returnPrice"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`, | `id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`, | ||||
| `tenant_id`,`owe`,`status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`updatetime`,`name`,`comments`, | `tenant_id`,`owe`,`status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`updatetime`,`name`,`comments`, | ||||
| `rent_shop_type` | |||||
| `rent_shop_type`,`return_price` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -68,7 +69,7 @@ | |||||
| <select id="queryBillList" parameterType="com.iformall.domain.po.WxBillOtherDeposit" resultType="hashmap"> | <select id="queryBillList" parameterType="com.iformall.domain.po.WxBillOtherDeposit" resultType="hashmap"> | ||||
| select br.`id`,br.`receive_pay` receivePay,br.`pay`,br.`receive_date` receiveDate, | select br.`id`,br.`receive_pay` receivePay,br.`pay`,br.`receive_date` receiveDate, | ||||
| br.`pay_date` payDate,br.`createtime`,br.`expired_day` expiredDay,br.`owe`,br.`status`, | br.`pay_date` payDate,br.`createtime`,br.`expired_day` expiredDay,br.`owe`,br.`status`, | ||||
| m.`name` merchantName,s.shop_number shopNumber,br.`updatetime`, | |||||
| m.`name` merchantName,s.shop_number shopNumber,br.`updatetime`,br.`return_price` returnPrice | |||||
| br.`merchant_id` merchantId,br.shop_id shopId,br.name,br.comments,br.`rent_shop_type` rentShopType | br.`merchant_id` merchantId,br.shop_id shopId,br.name,br.comments,br.`rent_shop_type` rentShopType | ||||
| from wx_bill_other_deposit br left join wx_merchant m on br.merchant_id=m.id | from wx_bill_other_deposit br left join wx_merchant m on br.merchant_id=m.id | ||||
| left join wx_shop s on br.shop_id=s.id | left join wx_shop s on br.shop_id=s.id | ||||