| @@ -5,6 +5,7 @@ import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| import com.iformall.domain.po.WxCardSpend; | import com.iformall.domain.po.WxCardSpend; | ||||
| import com.iformall.domain.vo.WxCardSpendVo; | |||||
| import com.iformall.service.WxCardSpendService; | import com.iformall.service.WxCardSpendService; | ||||
| import com.iformall.service.WxMerchantService; | import com.iformall.service.WxMerchantService; | ||||
| import com.iformall.service.WxOrderService; | import com.iformall.service.WxOrderService; | ||||
| @@ -38,6 +39,10 @@ public class WxCardPayController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| WxCardSpendService wxCardSpendService; | WxCardSpendService wxCardSpendService; | ||||
| // 售卡记录 | |||||
| // 消费记录 | |||||
| @ApiOperation("C端扫B端储值卡交易流水列表接口") | @ApiOperation("C端扫B端储值卡交易流水列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @@ -49,7 +54,7 @@ public class WxCardPayController extends BaseController { | |||||
| if (wxCardSpend == null) wxCardSpend = new WxCardSpend(); | if (wxCardSpend == null) wxCardSpend = new WxCardSpend(); | ||||
| MallUserInfo user = getUser(); | MallUserInfo user = getUser(); | ||||
| wxCardSpend.setTenantId(user.getTenantId()); | wxCardSpend.setTenantId(user.getTenantId()); | ||||
| final PageInfo<WxCardSpend> page = wxCardSpendService.listAsPage(wxCardSpend, pageNum, pageSize); | |||||
| final PageInfo<WxCardSpendVo> page = wxCardSpendService.listAsPage(wxCardSpend, pageNum, pageSize); | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| } | } | ||||
| @@ -4,6 +4,7 @@ package com.iformall.controller; | |||||
| 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.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.vo.WxCardSpendVo; | |||||
| import com.iformall.service.WxCardSpendService; | import com.iformall.service.WxCardSpendService; | ||||
| import com.iformall.service.WxMerchantService; | import com.iformall.service.WxMerchantService; | ||||
| import com.iformall.service.WxOrderService; | import com.iformall.service.WxOrderService; | ||||
| @@ -45,7 +46,7 @@ public class WxCardPayController extends BaseController { | |||||
| if (wxCardSpend == null) wxCardSpend = new WxCardSpend(); | if (wxCardSpend == null) wxCardSpend = new WxCardSpend(); | ||||
| WxMerchantBUser user = getUser(); | WxMerchantBUser user = getUser(); | ||||
| wxCardSpend.setTenantId(user.getTenantId()); | wxCardSpend.setTenantId(user.getTenantId()); | ||||
| final PageInfo<WxCardSpend> page = wxCardSpendService.listAsPage(wxCardSpend, pageNum, pageSize); | |||||
| final PageInfo<WxCardSpendVo> page = wxCardSpendService.listAsPage(wxCardSpend, pageNum, pageSize); | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| } | } | ||||
| @@ -5,6 +5,7 @@ import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.vo.WxCardSpendVo; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| @@ -147,7 +148,7 @@ public class WxCardPayController extends BaseController { | |||||
| if (wxCardSpend == null) wxCardSpend = new WxCardSpend(); | if (wxCardSpend == null) wxCardSpend = new WxCardSpend(); | ||||
| WxCUser user = getUser(); | WxCUser user = getUser(); | ||||
| wxCardSpend.setTenantId(user.getTenantId()); | wxCardSpend.setTenantId(user.getTenantId()); | ||||
| final PageInfo<WxCardSpend> page = wxCardSpendService.listAsPage(wxCardSpend, pageNum, pageSize); | |||||
| final PageInfo<WxCardSpendVo> page = wxCardSpendService.listAsPage(wxCardSpend, pageNum, pageSize); | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| } | } | ||||
| @@ -88,7 +88,7 @@ public class WxCardCVo extends WxCouponOrder { | |||||
| /**卡消费信息*/ | /**卡消费信息*/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="卡消费列表",name="cardSpendList") | @io.swagger.annotations.ApiModelProperty(value="卡消费列表",name="cardSpendList") | ||||
| private List<WxCardSpend> cardSpendList; | |||||
| private List<WxCardSpendVo> cardSpendList; | |||||
| public List<WxMerchantVo> getMerchantVoList() { | public List<WxMerchantVo> getMerchantVoList() { | ||||
| @@ -166,11 +166,11 @@ public class WxCardCVo extends WxCouponOrder { | |||||
| this.remainingAmount = remainingAmount; | this.remainingAmount = remainingAmount; | ||||
| } | } | ||||
| public List<WxCardSpend> getCardSpendList() { | |||||
| public List<WxCardSpendVo> getCardSpendList() { | |||||
| return cardSpendList; | return cardSpendList; | ||||
| } | } | ||||
| public void setCardSpendList(List<WxCardSpend> cardSpendList) { | |||||
| public void setCardSpendList(List<WxCardSpendVo> cardSpendList) { | |||||
| this.cardSpendList = cardSpendList; | this.cardSpendList = cardSpendList; | ||||
| } | } | ||||
| } | } | ||||
| @@ -0,0 +1,18 @@ | |||||
| package com.iformall.domain.vo; | |||||
| import com.iformall.domain.po.WxCardSpend; | |||||
| public class WxCardSpendVo extends WxCardSpend { | |||||
| /**使用商户名**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="商户名",name="name") | |||||
| private String merchantName; | |||||
| public String getMerchantName() { | |||||
| return merchantName; | |||||
| } | |||||
| public void setMerchantName(String merchantName) { | |||||
| this.merchantName = merchantName; | |||||
| } | |||||
| } | |||||
| @@ -3,10 +3,13 @@ package com.iformall.mapper; | |||||
| import java.util.*; | import java.util.*; | ||||
| import com.iformall.common.CommonMapper; | import com.iformall.common.CommonMapper; | ||||
| import com.iformall.domain.po.WxCardSpend; | import com.iformall.domain.po.WxCardSpend; | ||||
| import com.iformall.domain.vo.WxCardSpendVo; | |||||
| public interface WxCardSpendMapper extends CommonMapper<WxCardSpend, Long> { | public interface WxCardSpendMapper extends CommonMapper<WxCardSpend, Long> { | ||||
| List<WxCardSpend> findList(WxCardSpend wxCardSpend); | List<WxCardSpend> findList(WxCardSpend wxCardSpend); | ||||
| List<WxCardSpendVo> findCardSpendVoList(WxCardSpend wxCardSpend); | |||||
| @@ -3,6 +3,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.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.vo.WxCardSpendVo; | |||||
| public interface WxCardSpendService { | public interface WxCardSpendService { | ||||
| @@ -27,7 +28,7 @@ public interface WxCardSpendService { | |||||
| * @param pageSize | * @param pageSize | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| PageInfo<WxCardSpend> listAsPage(WxCardSpend record, Integer pageIndex, Integer pageSize); | |||||
| PageInfo<WxCardSpendVo> listAsPage(WxCardSpend record, Integer pageIndex, Integer pageSize); | |||||
| /** | /** | ||||
| * 根据Id获得实体 | * 根据Id获得实体 | ||||
| @@ -6,6 +6,7 @@ import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.dto.WxSharingOrderDto; | import com.iformall.domain.dto.WxSharingOrderDto; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.vo.WxCardSpendVo; | |||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.mapper.*; | import com.iformall.mapper.*; | ||||
| import com.iformall.service.WxCardSpendService; | import com.iformall.service.WxCardSpendService; | ||||
| @@ -201,8 +202,8 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||||
| @Override | @Override | ||||
| public PageInfo<WxCardSpend> listAsPage(WxCardSpend record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCardSpendMapper.findList(record)); | |||||
| public PageInfo<WxCardSpendVo> listAsPage(WxCardSpend record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCardSpendMapper.findCardSpendVoList(record)); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -84,6 +84,96 @@ | |||||
| select <include refid="allColumns" /> from wx_card_spend | select <include refid="allColumns" /> from wx_card_spend | ||||
| <include refid="dynamicWhereConditions" /> | <include refid="dynamicWhereConditions" /> | ||||
| </select> | </select> | ||||
| <resultMap id="VoResultMap" type="com.iformall.domain.po.WxCardSpendVo"> | |||||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||||
| <result column="card_id" jdbcType="BIGINT" property="cardId" /> | |||||
| <result column="owner_id" jdbcType="BIGINT" property="ownerId" /> | |||||
| <result column="merchant_id" jdbcType="BIGINT" property="merchantId" /> | |||||
| <result column="order_id" jdbcType="BIGINT" property="orderId" /> | |||||
| <result column="deduction_amount" jdbcType="INTEGER" property="deductionAmount" /> | |||||
| <result column="payment" jdbcType="INTEGER" property="payment" /> | |||||
| <result column="real_payment" jdbcType="INTEGER" property="realPayment" /> | |||||
| <result column="card_remain_amount" jdbcType="INTEGER" property="cardRemainAmount" /> | |||||
| <result column="card_before_amount" jdbcType="INTEGER" property="cardBeforeAmount" /> | |||||
| <result column="card_remain_real_amount" jdbcType="INTEGER" property="cardRemainRealAmount" /> | |||||
| <result column="card_before_real_amount" jdbcType="INTEGER" property="cardBeforeRealAmount" /> | |||||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||||
| <result column="name" jdbcType="VARCHAR" property="merchantName"/> | |||||
| </resultMap> | |||||
| <sql id="allVoColumns"> | |||||
| cs.`id`,cs.`tenant_id`,cs.`card_id`,cs.`owner_id`,cs.`merchant_id`,cs.`order_id`,cs.`deduction_amount`,cs.`payment`,cs.`real_payment`, | |||||
| cs.`card_remain_amount`,cs.`card_before_amount`,cs.`card_remain_real_amount`,cs.`card_before_real_amount`,cs.`create_date`,cs.`update_date`, | |||||
| m.`name` | |||||
| </sql> | |||||
| <sql id="dynamicVoWhereConditions"> | |||||
| where 1 = 1 | |||||
| <if test=" null != id "> | |||||
| and cs.`id` = #{id} | |||||
| </if> | |||||
| <if test=" null != tenantId "> | |||||
| and cs.`tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != cardId "> | |||||
| and cs.`card_id` = #{cardId} | |||||
| </if> | |||||
| <if test=" null != ownerId "> | |||||
| and cs.`owner_id` = #{ownerId} | |||||
| </if> | |||||
| <if test=" null != merchantId "> | |||||
| and cs.`merchant_id` = #{merchantId} | |||||
| </if> | |||||
| <if test=" null != orderId "> | |||||
| and cs.`order_id` = #{orderId} | |||||
| </if> | |||||
| <if test=" null != deductionAmount "> | |||||
| and cs.`deduction_amount` = #{deductionAmount} | |||||
| </if> | |||||
| <if test=" null != payment "> | |||||
| and cs.`payment` = #{payment} | |||||
| </if> | |||||
| <if test=" null != realPayment "> | |||||
| and cs.`real_payment` = #{realPayment} | |||||
| </if> | |||||
| <if test=" null != cardRemainAmount "> | |||||
| and cs.`card_remain_amount` = #{cardRemainAmount} | |||||
| </if> | |||||
| <if test=" null != cardBeforeAmount "> | |||||
| and cs.`card_before_amount` = #{cardBeforeAmount} | |||||
| </if> | |||||
| <if test=" null != cardRemainRealAmount "> | |||||
| and cs.`card_remain_real_amount` = #{cardRemainRealAmount} | |||||
| </if> | |||||
| <if test=" null != cardBeforeRealAmount "> | |||||
| and cs.`card_before_real_amount` = #{cardBeforeRealAmount} | |||||
| </if> | |||||
| <if test=" null != createDate "> | |||||
| and cs.`create_date` = #{createDate} | |||||
| </if> | |||||
| <if test=" null != updateDate "> | |||||
| and cs.`update_date` = #{updateDate} | |||||
| </if> | |||||
| <if test=" null != ids "> | |||||
| and cs.id in | |||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| </sql> | |||||
| <select id="findCardSpendVoList" parameterType="java.util.Map" resultMap="VoResultMap"> | |||||
| select | |||||
| <include refid="allVoColumns"/> | |||||
| from wx_card_spend cs | |||||
| left join wx_merchant m on m.id = cs.merchant_id | |||||
| <include refid="dynamicVoWhereConditions" /> | |||||
| </select> | |||||
| @@ -658,9 +658,9 @@ | |||||
| select="com.iformall.mapper.WxCouponMerchantMapper.findMerchantVoList" > | select="com.iformall.mapper.WxCouponMerchantMapper.findMerchantVoList" > | ||||
| </collection> | </collection> | ||||
| <collection column="{cardId=id}" property="cardSpendList" | <collection column="{cardId=id}" property="cardSpendList" | ||||
| ofType="com.iformall.domain.po.WxCardSpend" | |||||
| ofType="com.iformall.domain.po.WxCardSpendVo" | |||||
| javaType="java.util.List" | javaType="java.util.List" | ||||
| select="com.iformall.mapper.WxCardSpendMapper.findList" > | |||||
| select="com.iformall.mapper.WxCardSpendMapper.findCardSpendVoList" > | |||||
| </collection> | </collection> | ||||
| </resultMap> | </resultMap> | ||||