| @@ -80,13 +80,13 @@ public class WxCardPayController extends BaseController { | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData cardSpendlist(@ModelAttribute WxCardSpend wxCardSpend, Integer pageNum, Integer pageSize) { | |||
| public ResultData cardSpendlist(@ModelAttribute WxCardSpendVo wxCardSpendVo, Integer pageNum, Integer pageSize) { | |||
| String ipStr = getIpAddr(); | |||
| logger.info("cardSpendlist: " + ipStr); | |||
| if (wxCardSpend == null) wxCardSpend = new WxCardSpend(); | |||
| if (wxCardSpendVo == null) wxCardSpendVo = new WxCardSpendVo(); | |||
| MallUserInfo user = getUser(); | |||
| wxCardSpend.setTenantId(user.getTenantId()); | |||
| final PageInfo<WxCardSpendVo> page = wxCardSpendService.listAsPage(wxCardSpend, pageNum, pageSize); | |||
| wxCardSpendVo.setTenantId(user.getTenantId()); | |||
| final PageInfo<WxCardSpendVo> page = wxCardSpendService.listAsPage(wxCardSpendVo, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| } | |||
| @@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.*; | |||
| */ | |||
| @RestController | |||
| @Api(description = "C端扫B端商户码储值卡支付") | |||
| @RequestMapping("/api/carday") | |||
| @RequestMapping("/api/cardPay") | |||
| public class WxCardPayController extends BaseController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @@ -40,14 +40,14 @@ public class WxCardPayController extends BaseController { | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData cardSpendlist(@ModelAttribute WxCardSpend wxCardSpend, Integer pageNum, Integer pageSize) { | |||
| public ResultData cardSpendlist(@ModelAttribute WxCardSpendVo wxCardSpendVo, Integer pageNum, Integer pageSize) { | |||
| String ipStr = getIpAddr(); | |||
| logger.info("cardSpendlist: " + ipStr + " :" + wxCardSpend.toString()); | |||
| if (wxCardSpend == null) wxCardSpend = new WxCardSpend(); | |||
| logger.info("cardSpendlist: " + ipStr + " :" + wxCardSpendVo.toString()); | |||
| if (wxCardSpendVo == null) wxCardSpendVo = new WxCardSpendVo(); | |||
| WxMerchantBUser user = getUser(); | |||
| wxCardSpend.setTenantId(user.getTenantId()); | |||
| wxCardSpend.setMerchantId(user.getMerchantId()); | |||
| final PageInfo<WxCardSpendVo> page = wxCardSpendService.listAsPage(wxCardSpend, pageNum, pageSize); | |||
| wxCardSpendVo.setTenantId(user.getTenantId()); | |||
| wxCardSpendVo.setMerchantId(user.getMerchantId()); | |||
| final PageInfo<WxCardSpendVo> page = wxCardSpendService.listAsPage(wxCardSpendVo, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| } | |||
| @@ -142,10 +142,10 @@ public class WxCardPayController extends BaseController { | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData cardOrderList(@ModelAttribute WxCardSpend wxCardSpend, Integer pageNum, Integer pageSize) { | |||
| public ResultData cardOrderList(@ModelAttribute WxCardSpendVo wxCardSpend, Integer pageNum, Integer pageSize) { | |||
| String ipStr = getIpAddr(); | |||
| logger.info("saveCardPayOrder: " + ipStr + " :" + wxCardSpend.toString()); | |||
| if (wxCardSpend == null) wxCardSpend = new WxCardSpend(); | |||
| if (wxCardSpend == null) wxCardSpend = new WxCardSpendVo(); | |||
| WxCUser user = getUser(); | |||
| wxCardSpend.setTenantId(user.getTenantId()); | |||
| final PageInfo<WxCardSpendVo> page = wxCardSpendService.listAsPage(wxCardSpend, pageNum, pageSize); | |||
| @@ -67,12 +67,6 @@ public class WxCardSpend implements Serializable { | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| private Date updateDate; | |||
| @Transient | |||
| private Date startdate; | |||
| @Transient | |||
| private Date enddate; | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| @@ -1,7 +1,16 @@ | |||
| package com.iformall.domain.vo; | |||
| import com.iformall.domain.po.WxCardSpend; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| import javax.persistence.Transient; | |||
| import java.util.Date; | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxCardSpendVo extends WxCardSpend { | |||
| /**卡信息*/ | |||
| @@ -10,7 +19,7 @@ public class WxCardSpendVo extends WxCardSpend { | |||
| private String title; | |||
| /**使用商户名**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户名",name="name") | |||
| @io.swagger.annotations.ApiModelProperty(value="商户名",name="merchantName") | |||
| private String merchantName; | |||
| /**补贴额(包含通道费)*/ | |||
| @@ -23,43 +32,19 @@ public class WxCardSpendVo extends WxCardSpend { | |||
| @io.swagger.annotations.ApiModelProperty(value="状态(0:未补贴, 1:已补贴)",name="status") | |||
| private Integer status; | |||
| public String getTitle() { | |||
| return title; | |||
| } | |||
| public void setTitle(String title) { | |||
| this.title = title; | |||
| } | |||
| public String getMerchantName() { | |||
| return merchantName; | |||
| } | |||
| public void setMerchantName(String merchantName) { | |||
| this.merchantName = merchantName; | |||
| } | |||
| public Integer getSubsidy() { | |||
| return subsidy; | |||
| } | |||
| public void setSubsidy(Integer subsidy) { | |||
| this.subsidy = subsidy; | |||
| } | |||
| public Integer getRealSubsidy() { | |||
| return realSubsidy; | |||
| } | |||
| /**持有人昵称*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="持有人昵称",name="ouNickName") | |||
| private String ouNickName; | |||
| public void setRealSubsidy(Integer realSubsidy) { | |||
| this.realSubsidy = realSubsidy; | |||
| } | |||
| /**持有人绑定的手机号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="持有人绑定的手机号",name="ouPhone") | |||
| private String ouPhone; | |||
| public Integer getStatus() { | |||
| return status; | |||
| } | |||
| @Transient | |||
| @io.swagger.annotations.ApiModelProperty(value="开始时间",name="startdate") | |||
| private Date startdate; | |||
| public void setStatus(Integer status) { | |||
| this.status = status; | |||
| } | |||
| @Transient | |||
| @io.swagger.annotations.ApiModelProperty(value="结束时间",name="enddate") | |||
| private Date enddate; | |||
| } | |||
| @@ -59,15 +59,15 @@ public class WxCardVo extends WxCardInfo { | |||
| /**购买人昵称*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="购买人昵称",name="cNickName") | |||
| private String cNickName; | |||
| @io.swagger.annotations.ApiModelProperty(value="购买人昵称",name="cuNickName") | |||
| private String cuNickName; | |||
| /**持有人昵称*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="持有人昵称",name="oNickName") | |||
| private String oNickName; | |||
| @io.swagger.annotations.ApiModelProperty(value="持有人昵称",name="ouNickName") | |||
| private String ouNickName; | |||
| /**持有人绑定的手机号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="持有人绑定的手机号",name="oPhone") | |||
| private String oPhone; | |||
| @io.swagger.annotations.ApiModelProperty(value="持有人绑定的手机号",name="ouPhone") | |||
| private String ouPhone; | |||
| @Transient | |||
| protected List<Integer> statusS; | |||
| @@ -76,8 +76,10 @@ public class WxCardVo extends WxCardInfo { | |||
| protected String statusStr; | |||
| @Transient | |||
| @io.swagger.annotations.ApiModelProperty(value="开始时间",name="startdate") | |||
| private Date startdate; | |||
| @Transient | |||
| @io.swagger.annotations.ApiModelProperty(value="结束时间",name="enddate") | |||
| private Date enddate; | |||
| } | |||
| @@ -28,7 +28,7 @@ public interface WxCardSpendService { | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxCardSpendVo> listAsPage(WxCardSpend record, Integer pageIndex, Integer pageSize); | |||
| PageInfo<WxCardSpendVo> listAsPage(WxCardSpendVo record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据Id获得实体 | |||
| @@ -209,7 +209,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| @Override | |||
| public PageInfo<WxCardSpendVo> listAsPage(WxCardSpend record, Integer pageIndex, Integer pageSize) { | |||
| public PageInfo<WxCardSpendVo> listAsPage(WxCardSpendVo record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCardSpendMapper.findCardSpendVoList(record)); | |||
| } | |||
| @@ -103,9 +103,9 @@ | |||
| <result column="expired_time" jdbcType="TIMESTAMP" property="expiredTime" /> | |||
| <result column="status" jdbcType="INTEGER" property="status"/> | |||
| <result column="c_nick_name" jdbcType="VARCHAR" property="cNickName"/> | |||
| <result column="o_nick_name" jdbcType="VARCHAR" property="oNickName"/> | |||
| <result column="o_phone" jdbcType="VARCHAR" property="oPhone"/> | |||
| <result column="c_nick_name" jdbcType="VARCHAR" property="cuNickName"/> | |||
| <result column="o_nick_name" jdbcType="VARCHAR" property="ouNickName"/> | |||
| <result column="ou_phone" jdbcType="VARCHAR" property="ouPhone"/> | |||
| </resultMap> | |||
| @@ -114,7 +114,7 @@ | |||
| ci.`create_date`,ci.`update_date`, | |||
| c.`cover_img`, c.`title`, c.`sub_title`, c.`detail`, c.`unit`, c.`remark`, c.`sale_price`, c.`price`, | |||
| co.`c_user_id`, co.`owner_id`, co.`expired_time`, co.`coupon_order_status` as status, | |||
| cu.`nick_name` as c_nick_name, ou.`nick_name` as o_nick_name, ou.`phone` as o_phone | |||
| cu.`nick_name` as cu_nick_name, ou.`nick_name` as ou_nick_name, ou.`phone` as ou_phone | |||
| </sql> | |||
| <sql id="dynamicVoWhereConditions"> | |||
| @@ -158,8 +158,8 @@ | |||
| <if test=" null != status "> | |||
| and status = #{status} | |||
| </if> | |||
| <if test=" null != oPhone "> | |||
| and o_phone = #{oPhone} | |||
| <if test=" null != ouPhone "> | |||
| and ou_phone = #{ouPhone} | |||
| </if> | |||
| <if test=" null != startdate and null!=enddate"> | |||
| and ci.`create_date` between #{startdate} and #{enddate} | |||
| @@ -113,13 +113,17 @@ | |||
| <result column="subsidy" jdbcType="INTEGER" property="subsidy" /> | |||
| <result column="real_subsidy" jdbcType="INTEGER" property="realSubsidy" /> | |||
| <result column="status" jdbcType="INTEGER" property="status" /> | |||
| <result column="ou_nick_name" jdbcType="VARCHAR" property="ouNickName"/> | |||
| <result column="ou_phone" jdbcType="VARCHAR" property="ouPhone"/> | |||
| </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`, c.`title`, | |||
| ms.`subsidy`,ms.`real_subsidy`,ms.`status` | |||
| ms.`subsidy`,ms.`real_subsidy`,ms.`status`, | |||
| ou.`nick_name` as ou_nick_name, ou.`phone` as ou_phone | |||
| </sql> | |||
| <sql id="dynamicVoWhereConditions"> | |||
| @@ -169,6 +173,9 @@ | |||
| <if test=" null != updateDate "> | |||
| and cs.`update_date` = #{updateDate} | |||
| </if> | |||
| <if test=" null != oPhone "> | |||
| and ou_phone = #{oPhone} | |||
| </if> | |||
| <if test=" null != startdate and null!=enddate"> | |||
| and cs.`create_date` between #{startdate} and #{enddate} | |||
| </if> | |||
| @@ -180,7 +187,7 @@ | |||
| </if> | |||
| </sql> | |||
| <select id="findCardSpendVoList" parameterType="java.util.Map" resultMap="VoResultMap"> | |||
| <select id="findCardSpendVoList" parameterType="com.iformall.domain.vo.WxCardSpendVo" resultMap="VoResultMap"> | |||
| select | |||
| <include refid="allVoColumns"/> | |||
| from wx_card_spend cs | |||
| @@ -188,6 +195,7 @@ | |||
| left join wx_coupon c on c.id = co.coupon_id | |||
| left join wx_merchant m on m.id = cs.merchant_id | |||
| left join wx_merchant_subsidy ms on ms.order_id = cs.order_id | |||
| left join wx_c_user ou on ou.id = co.owner_id | |||
| <include refid="dynamicVoWhereConditions" /> | |||
| </select> | |||