Просмотр исходного кода

fix card

release_toaliyun_real
lin 3 лет назад
Родитель
Сommit
55e3e2a5c5
3 измененных файлов: 44 добавлений и 15 удалений
  1. +1
    -1
      mallinkAdmin/src/main/resources/db/migration/V2023030300001__card.sql
  2. +15
    -13
      mallinkService/src/main/java/com/iformall/domain/vo/WxCouponPasswordVo.java
  3. +28
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponPasswordServiceImpl.java

+ 1
- 1
mallinkAdmin/src/main/resources/db/migration/V2023030300001__card.sql Просмотреть файл

@@ -1,6 +1,6 @@
alter table wx_coupon_password add column price int(11) not null default 0 comment '面额';

update wx_coupon_password cp , wx_coupon_89 c on cp.coupon_id = c.id set cp.price = c.price where cp.price = 0 and c.price > 0 ;
update wx_coupon_password cp inner join wx_coupon_89 c on cp.coupon_id = c.id set cp.price = c.price where cp.price = 0 and c.price > 0 ;





+ 15
- 13
mallinkService/src/main/java/com/iformall/domain/vo/WxCouponPasswordVo.java Просмотреть файл

@@ -25,43 +25,45 @@ public class WxCouponPasswordVo extends TenantEntity {

@Excel(name = "卡号", width = 20, orderNum = "1", prefix = "`")
protected Long id;
@Excel(name = "卡密", width = 20, orderNum = "2", prefix = "`")
@Excel(name = "卡名称", width = 20, orderNum = "2", prefix = "`")
protected String couponTitile;
@Excel(name = "卡密", width = 20, orderNum = "3", prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "卡密", name = "couponPassword")
private String couponPassword;
@Excel(name = "卡密面额", width = 20, orderNum = "2", prefix = "`")
@Excel(name = "卡密面额(分)", width = 20, orderNum = "4", prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "卡密面额", name = "couponPasswordPrice")
private Integer couponPasswordPrice;
@Excel(name = "创建时间", width = 20, exportFormat = "yyyy-MM-dd HH:mm:ss", orderNum = "3")
@Excel(name = "创建时间", width = 20, exportFormat = "yyyy-MM-dd HH:mm:ss", orderNum = "5")
@io.swagger.annotations.ApiModelProperty(value = "", name = "createDate")
private Date createDate;
@Excel(name = "卡密状态", width = 20, orderNum = "4", replace = {"初始化_0", "消息发送中_1", "消息已发送_2", "已兑换_3","已作废_4"},prefix = "`")
@Excel(name = "卡密状态", width = 20, orderNum = "6", replace = {"初始化_0", "消息发送中_1", "消息已发送_2", "已兑换_3","已作废_4"},prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "卡密状态", name = "remainPrice")
private Integer status;
@Excel(name = "卡密是否停用", width = 20, orderNum = "5", replace = {"否_0", "是_1"},prefix = "`")
@Excel(name = "卡密是否停用", width = 20, orderNum = "7", replace = {"否_0", "是_1"},prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "卡密是否停用", name = "isStop")
private Integer isStop;
@Excel(name = "卡激活状态", width = 20, orderNum = "6",replace = {"未激活_0", "已激活_1"}, prefix = "`")
@Excel(name = "卡激活状态", width = 20, orderNum = "8",replace = {"未激活_0", "已激活_1"}, prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "卡激活状态EnumYesOrNo", name = "used")
private Integer used;
@Excel(name = "激活时间", width = 20, exportFormat = "yyyy-MM-dd HH:mm:ss", orderNum = "7")
@Excel(name = "激活时间", width = 20, exportFormat = "yyyy-MM-dd HH:mm:ss", orderNum = "9")
@io.swagger.annotations.ApiModelProperty(value = "", name = "activeDate")
private Date activeDate;
@Excel(name = "激活手机号", width = 20, orderNum = "8", prefix = "`")
@Excel(name = "激活手机号", width = 20, orderNum = "10", prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "激活手机号", name = "phone")
private String phone;
@Excel(name = "激活会员", width = 20, orderNum = "9", prefix = "`")
@Excel(name = "激活会员", width = 20, orderNum = "11", prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "激活会员", name = "userName")
private String userName;
@Excel(name = "电子卡卡号", width = 20, orderNum = "10", prefix = "`")
@Excel(name = "电子卡卡号", width = 20, orderNum = "12", prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "电子卡卡号", name = "cardId")
private Long cardId;
@Excel(name = "面额(元)", width = 20, orderNum = "11", prefix = "`")
@Excel(name = "面额(元)", width = 20, orderNum = "13", prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "面额(元)", name = "price")
private Double price;
@Excel(name = "余额(元)", width = 20, orderNum = "12", prefix = "`")
@Excel(name = "余额(元)", width = 20, orderNum = "14", prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "余额(元)", name = "remainPrice")
private Double remainPrice;
@Excel(name = "电子卡状态", width = 20, orderNum = "13",replace = {"正常_0", "已禁用_1"}, prefix = "`")
@Excel(name = "电子卡状态", width = 20, orderNum = "15",replace = {"正常_0", "已禁用_1"}, prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "电子卡状态EnumYesOrNo", name = "cardStatus")
private Integer cardStatus;



+ 28
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxCouponPasswordServiceImpl.java Просмотреть файл

@@ -22,6 +22,7 @@ import com.iformall.domain.vo.WxMerchantProductVo;
import com.iformall.common.ErrorCode;
import com.iformall.exception.MallinkException;
import com.iformall.mapper.WxCardInfoMapper;
import com.iformall.mapper.WxCouponMapper;
import com.iformall.mapper.WxCouponPasswordMapper;
import com.iformall.service.ExcelService;
import com.iformall.service.WxCUserBasicInfoService;
@@ -59,6 +60,8 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService {
@Lazy
@Autowired
WxCUserBasicInfoService wxCUserBasicInfoService;
@Autowired
WxCouponMapper wxCouponMapper;

@Autowired
ExcelService excelService;
@@ -83,13 +86,31 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService {
private List<WxCouponPasswordVo> handleQueryResult(List<WxCouponPassword> list,TenantEntity tenantEntity) {
if (null != list && list.size() > 0) {
List<Long> couponPasswordIdList = new ArrayList<Long>();
List<Long> couponIdList = new ArrayList<Long>();
for (int i = 0 ; i < list.size() ; i ++ ) {
WxCouponPassword bo = list.get(i);
if (null != bo.getId() && (!couponPasswordIdList.contains(bo.getId()))) {
couponPasswordIdList.add(bo.getId());
}
if (null != bo.getCouponId() && (!couponIdList.contains(bo.getCouponId()))) {
couponIdList.add(bo.getCouponId());
}
}

Map<Long,WxCoupon> couponMap = new HashMap<Long,WxCoupon>();
if (couponIdList.size() > 0 ) {
WxCoupon cQ = new WxCoupon();
cQ.updateTenantInfo(tenantEntity);
cQ.setIds(couponIdList);
List<WxCoupon> cList = wxCouponMapper.findList(cQ);
if (null != cList && cList.size() > 0) {
for (int i = 0 ; i < cList.size(); i++) {
WxCoupon c = cList.get(i);
couponMap.put(c.getId(), c);
}
}
}
List<Long> cUserIdList = new ArrayList<Long>();
Map<Long,WxCardInfo> passwordCardInfoMap = new HashMap<Long,WxCardInfo>();
if (couponPasswordIdList.size() > 0 ) {
@@ -129,6 +150,12 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService {
WxCouponPasswordVo co = new WxCouponPasswordVo();
WxCardInfo cardInfo = passwordCardInfoMap.get(coo.getId());
co.setId(coo.getId());
if (null != coo.getCouponId()) {
WxCoupon coupon = couponMap.get(coo.getCouponId());
if (null != coupon) {
co.setCouponTitile(coupon.getTitle());
}
}
co.setCouponPassword(coo.getPassword());
co.setCouponPasswordPrice(coo.getPrice());
if (null != cardInfo) {


Загрузка…
Отмена
Сохранить