| @@ -1,2 +1,7 @@ | |||||
| ALTER TABLE `mallink`.`wx_card_spend` | ALTER TABLE `mallink`.`wx_card_spend` | ||||
| ADD COLUMN `pay_type` smallint(2) NOT NULL DEFAULT 0 AFTER `owner_id`; | |||||
| ADD COLUMN `pay_type` smallint(2) NOT NULL DEFAULT 0 AFTER `owner_id`; | |||||
| ALTER TABLE `mallink`.`wx_card_spend` | |||||
| ADD COLUMN `refund_status` smallint(2) NOT NULL DEFAULT 0 COMMENT '退款状态' AFTER `subsidy`, | |||||
| ADD COLUMN `refund_remark` varchar(255) AFTER `refund_status`; | |||||
| @@ -77,6 +77,12 @@ public class WxCardSpend extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="说明",name="remark") | @io.swagger.annotations.ApiModelProperty(value="说明",name="remark") | ||||
| private String remark; | private String remark; | ||||
| @io.swagger.annotations.ApiModelProperty(value="EnumRentContractAppStatus ",name="refundStatus") | |||||
| private Integer refundStatus; | |||||
| @io.swagger.annotations.ApiModelProperty(value="说明",name="refundRemark") | |||||
| private String refundRemark; | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @Excel(name = "消费金额(元)", width = 20, orderNum = "7") | @Excel(name = "消费金额(元)", width = 20, orderNum = "7") | ||||
| private String deductionAmountStr; | private String deductionAmountStr; | ||||
| @@ -12,7 +12,7 @@ public enum EnumCardSpendStatus { | |||||
| MANUAL_PAY(2, "已人工分账"), | MANUAL_PAY(2, "已人工分账"), | ||||
| PREV_PAY(10, "预支付(POS短期内占用)"), | PREV_PAY(10, "预支付(POS短期内占用)"), | ||||
| PENDING_REFUND(3, "待退款"),//占库存 | |||||
| PENDING_REFUND(3, "待退款"), | |||||
| REFUND_SUCCESS(4,"已退款"), | REFUND_SUCCESS(4,"已退款"), | ||||
| ; | ; | ||||
| @@ -1311,6 +1311,10 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService { | |||||
| cardSpendUpd.setId(cardSend.getId()); | cardSpendUpd.setId(cardSend.getId()); | ||||
| cardSpendUpd.updateTenantInfo(cardSend); | cardSpendUpd.updateTenantInfo(cardSend); | ||||
| cardSpendUpd.setPayStatus(EnumCardSpendStatus.REFUND_SUCCESS.getCode()); | cardSpendUpd.setPayStatus(EnumCardSpendStatus.REFUND_SUCCESS.getCode()); | ||||
| if(!EnumRentContractAppStatus.DEFAULT.equals(cardSend.getRefundStatus())){ | |||||
| cardSpendUpd.setRefundStatus(EnumRentContractAppStatus.FINISH.getCode()); | |||||
| } | |||||
| cardSpendUpd.setRefundRemark("success!"); | |||||
| cardSpendUpd.setUpdateDate(currentDate); | cardSpendUpd.setUpdateDate(currentDate); | ||||
| try { | try { | ||||
| wxCardSpendMapper.updateById(cardSpendUpd); | wxCardSpendMapper.updateById(cardSpendUpd); | ||||
| @@ -1469,6 +1473,8 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService { | |||||
| cardSpendUpd.setId(cardSend.getId()); | cardSpendUpd.setId(cardSend.getId()); | ||||
| cardSpendUpd.updateTenantInfo(cardSend); | cardSpendUpd.updateTenantInfo(cardSend); | ||||
| cardSpendUpd.setPayStatus(EnumCardSpendStatus.NOT_PAY.getCode()); | cardSpendUpd.setPayStatus(EnumCardSpendStatus.NOT_PAY.getCode()); | ||||
| cardSpendUpd.setRefundStatus(EnumRentContractAppStatus.REJECT.getCode()); | |||||
| cardSpendUpd.setRefundRemark(remark); | |||||
| cardSpendUpd.setUpdateDate(currentDate); | cardSpendUpd.setUpdateDate(currentDate); | ||||
| try { | try { | ||||
| wxCardSpendMapper.updateById(cardSpendUpd); | wxCardSpendMapper.updateById(cardSpendUpd); | ||||
| @@ -23,13 +23,15 @@ | |||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | ||||
| <result column="pay_status" jdbcType="INTEGER" property="payStatus"/> | <result column="pay_status" jdbcType="INTEGER" property="payStatus"/> | ||||
| <result column="pay_from" jdbcType="INTEGER" property="payFrom"/> | <result column="pay_from" jdbcType="INTEGER" property="payFrom"/> | ||||
| <result column="refund_status" jdbcType="INTEGER" property="refundStatus"/> | |||||
| <result column="refund_remark" jdbcType="VARCHAR" property="refundRemark"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`parent_tenant_id`,`card_id`,`owner_id`,`pay_type`,`merchant_id`,`order_id`,`pos_order_id`, | `id`,`tenant_id`,`parent_tenant_id`,`card_id`,`owner_id`,`pay_type`,`merchant_id`,`order_id`,`pos_order_id`, | ||||
| `deduction_amount`,`payment`,`real_payment`,`subsidy`, `card_remain_amount`, | `deduction_amount`,`payment`,`real_payment`,`subsidy`, `card_remain_amount`, | ||||
| `card_before_amount`,`card_remain_real_amount`,`card_before_real_amount`, | `card_before_amount`,`card_remain_real_amount`,`card_before_real_amount`, | ||||
| `create_date`, `update_date`, `pay_status`, `pay_from` | |||||
| `create_date`, `update_date`, `pay_status`, `pay_from`, `refund_status`, `refund_remark` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -94,6 +96,9 @@ | |||||
| <if test=" null != payFrom "> | <if test=" null != payFrom "> | ||||
| and `pay_from` = #{payFrom} | and `pay_from` = #{payFrom} | ||||
| </if> | </if> | ||||
| <if test=" null != refundStatus "> | |||||
| and `refund_status` = #{refundStatus} | |||||
| </if> | |||||
| <if test=" null != startdate"> | <if test=" null != startdate"> | ||||
| and `create_date` >= #{startdate} | and `create_date` >= #{startdate} | ||||