| @@ -5,17 +5,14 @@ import lombok.EqualsAndHashCode; | |||||
| import javax.persistence.*; | import javax.persistence.*; | ||||
| import java.util.*; | import java.util.*; | ||||
| import java.math.*; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.util.List; | import java.util.List; | ||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | |||||
| @Table(name = "wx_card_password") | |||||
| @Table(name = "wx_coupon_password") | |||||
| @Data | @Data | ||||
| @EqualsAndHashCode(callSuper = true) | @EqualsAndHashCode(callSuper = true) | ||||
| public class WxCardPassword extends BaseEntity { | |||||
| private static final long serialVersionUID = 1L; | |||||
| public class WxCouponPassword extends BaseEntity { | |||||
| @Id | @Id | ||||
| protected Long id; | protected Long id; | ||||
| @@ -33,7 +30,7 @@ public class WxCardPassword extends BaseEntity { | |||||
| private Integer status; | private Integer status; | ||||
| @io.swagger.annotations.ApiModelProperty(value="卡密发送到手机",name="sendedPhone") | @io.swagger.annotations.ApiModelProperty(value="卡密发送到手机",name="sendedPhone") | ||||
| private String sendedPhone; | private String sendedPhone; | ||||
| @io.swagger.annotations.ApiModelProperty(value="卡包ID",name="cardId") | |||||
| @io.swagger.annotations.ApiModelProperty(value="卡包ID(coupon_order_id/card_id)",name="cardId") | |||||
| private Long cardId; | private Long cardId; | ||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | ||||
| private Date createDate; | private Date createDate; | ||||
| @@ -1,17 +0,0 @@ | |||||
| package com.iformall.mapper; | |||||
| import java.util.*; | |||||
| import com.iformall.common.CommonMapper; | |||||
| import org.apache.ibatis.annotations.Param; | |||||
| import com.iformall.domain.po.WxCardPassword; | |||||
| public interface WxCardPasswordMapper extends CommonMapper<WxCardPassword, Long> { | |||||
| List<WxCardPassword> findList(WxCardPassword wxCardPassword); | |||||
| } | |||||
| @@ -0,0 +1,16 @@ | |||||
| package com.iformall.mapper; | |||||
| import java.util.*; | |||||
| import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.WxCouponPassword; | |||||
| public interface WxCouponPasswordMapper extends CommonMapper<WxCouponPassword, Long> { | |||||
| List<WxCouponPassword> findList(WxCouponPassword wxCouponPassword); | |||||
| } | |||||
| @@ -1,10 +1,9 @@ | |||||
| package com.iformall.service; | package com.iformall.service; | ||||
| import java.util.*; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.WxCardPassword; | |||||
| import com.iformall.domain.po.WxCouponPassword; | |||||
| public interface WxCardPasswordService { | |||||
| public interface WxCouponPasswordService { | |||||
| /** | /** | ||||
| * 根据实体查询分页列表 | * 根据实体查询分页列表 | ||||
| @@ -14,7 +13,7 @@ public interface WxCardPasswordService { | |||||
| * @param pageSize | * @param pageSize | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| PageInfo<WxCardPassword> listAsPage(WxCardPassword record, Integer pageIndex, Integer pageSize); | |||||
| PageInfo<WxCouponPassword> listAsPage(WxCouponPassword record, Integer pageIndex, Integer pageSize); | |||||
| /** | /** | ||||
| * 根据Id获得实体 | * 根据Id获得实体 | ||||
| @@ -22,14 +21,14 @@ public interface WxCardPasswordService { | |||||
| * @param id | * @param id | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| WxCardPassword getById(Long id); | |||||
| WxCouponPassword getById(Long id); | |||||
| /** | /** | ||||
| * 保存或更新实体 | * 保存或更新实体 | ||||
| * | * | ||||
| * @param record | * @param record | ||||
| */ | */ | ||||
| void saveOrUpdate(WxCardPassword record); | |||||
| void saveOrUpdate(WxCouponPassword record); | |||||
| /** | /** | ||||
| * 根据Id删除实体 | * 根据Id删除实体 | ||||
| @@ -1,54 +0,0 @@ | |||||
| package com.iformall.service.impl; | |||||
| import java.util.*; | |||||
| import com.github.pagehelper.PageHelper; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.domain.po.WxCardPassword; | |||||
| import com.iformall.mapper.WxCardPasswordMapper; | |||||
| import com.iformall.service.WxCardPasswordService; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import com.iformall.common.IdWorker; | |||||
| @Service | |||||
| public class WxCardPasswordServiceImpl implements WxCardPasswordService { | |||||
| @Autowired | |||||
| WxCardPasswordMapper wxCardPasswordMapper; | |||||
| @Override | |||||
| public PageInfo<WxCardPassword> listAsPage(WxCardPassword record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCardPasswordMapper.findList(record)); | |||||
| } | |||||
| @Override | |||||
| public WxCardPassword getById(Long id) { | |||||
| return wxCardPasswordMapper.selectByPrimaryKey(id); | |||||
| } | |||||
| @Override | |||||
| public void saveOrUpdate(WxCardPassword record) { | |||||
| if (record.getId() == null) { | |||||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| record.setId(idWorker.nextId()); | |||||
| wxCardPasswordMapper.insertSelective(record); | |||||
| } else { | |||||
| wxCardPasswordMapper.updateByPrimaryKeySelective(record); | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public void deleteById(Long id) { | |||||
| wxCardPasswordMapper.deleteByPrimaryKey(id); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,53 @@ | |||||
| package com.iformall.service.impl; | |||||
| import com.github.pagehelper.PageHelper; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.domain.po.WxCouponPassword; | |||||
| import com.iformall.mapper.WxCouponPasswordMapper; | |||||
| import com.iformall.service.WxCouponPasswordService; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import com.iformall.common.IdWorker; | |||||
| @Service | |||||
| public class WxCouponPasswordServiceImpl implements WxCouponPasswordService { | |||||
| @Autowired | |||||
| WxCouponPasswordMapper wxCouponPasswordMapper; | |||||
| @Override | |||||
| public PageInfo<WxCouponPassword> listAsPage(WxCouponPassword record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponPasswordMapper.findList(record)); | |||||
| } | |||||
| @Override | |||||
| public WxCouponPassword getById(Long id) { | |||||
| return wxCouponPasswordMapper.selectByPrimaryKey(id); | |||||
| } | |||||
| @Override | |||||
| public void saveOrUpdate(WxCouponPassword record) { | |||||
| if (record.getId() == null) { | |||||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| record.setId(idWorker.nextId()); | |||||
| wxCouponPasswordMapper.insertSelective(record); | |||||
| } else { | |||||
| wxCouponPasswordMapper.updateByPrimaryKeySelective(record); | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public void deleteById(Long id) { | |||||
| wxCouponPasswordMapper.deleteByPrimaryKey(id); | |||||
| } | |||||
| } | |||||
| @@ -64,6 +64,8 @@ import java.util.stream.Collectors; | |||||
| @Autowired | @Autowired | ||||
| WxCardInfoMapper wxCardInfoMapper; | WxCardInfoMapper wxCardInfoMapper; | ||||
| @Autowired | |||||
| @Override | @Override | ||||
| public ResultData list(WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { | public ResultData list(WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { | ||||
| if (null == wxCoupon) wxCoupon = new WxCoupon(); | if (null == wxCoupon) wxCoupon = new WxCoupon(); | ||||
| @@ -410,6 +412,8 @@ import java.util.stream.Collectors; | |||||
| wxOrderService.updateOrderGroupStatusByCouponId(record.getId(), record.getTenantId(), EnumOrderStatus.ORDER_STATUS_COOPERATING_CANCEL.getCode()); | wxOrderService.updateOrderGroupStatusByCouponId(record.getId(), record.getTenantId(), EnumOrderStatus.ORDER_STATUS_COOPERATING_CANCEL.getCode()); | ||||
| //修改卡状态 | //修改卡状态 | ||||
| wxCardInfoMapper.updateTransferStatusByCouponId(record.getId()); | wxCardInfoMapper.updateTransferStatusByCouponId(record.getId()); | ||||
| // 下架相关卡密 | |||||
| } | } | ||||
| record.setUpdateDate(new Date()); | record.setUpdateDate(new Date()); | ||||
| @@ -1,7 +1,7 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| <mapper namespace="com.iformall.mapper.WxCardPasswordMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCardPassword"> | |||||
| <mapper namespace="com.iformall.mapper.WxCouponPasswordMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCouponPassword"> | |||||
| <id column="id" jdbcType="BIGINT" property="id" /> | <id column="id" jdbcType="BIGINT" property="id" /> | ||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | ||||
| <result column="coupon_id" jdbcType="BIGINT" property="couponId" /> | <result column="coupon_id" jdbcType="BIGINT" property="couponId" /> | ||||
| @@ -55,7 +55,7 @@ | |||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | <if test=" null != sortColumns"> order by ${sortColumns} </if> | ||||
| </sql> | </sql> | ||||
| <select id="findList" parameterType="com.iformall.domain.po.WxCardPassword" resultMap="BaseResultMap"> | |||||
| <select id="findList" parameterType="com.iformall.domain.po.WxCouponPassword" resultMap="BaseResultMap"> | |||||
| select <include refid="allColumns" /> from wx_card_password | select <include refid="allColumns" /> from wx_card_password | ||||
| <include refid="dynamicWhereConditions" /> | <include refid="dynamicWhereConditions" /> | ||||
| </select> | </select> | ||||