Przeglądaj źródła

Merge branch 'release_toaliyun_real_20230228' of https://git.malls.iformall.com/server/formallProject into release_toaliyun_real_20230228

release_toaliyun_real
xhxu 3 lat temu
rodzic
commit
e2d6dee4f5
23 zmienionych plików z 536 dodań i 166 usunięć
  1. +1
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCardInfoController.java
  2. +14
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponPasswordController.java
  3. +17
    -0
      mallinkAdmin/src/main/resources/db/migration/V2023022800001__card.sql
  4. +9
    -5
      mallinkBApi/src/main/java/com/iformall/controller/WxCardPayController.java
  5. +0
    -1
      mallinkCApi/src/main/java/com/iformall/controller/WxCouponPasswordController.java
  6. +14
    -2
      mallinkService/src/main/java/com/iformall/domain/po/WxCardInfo.java
  7. +2
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxCouponOrder.java
  8. +3
    -0
      mallinkService/src/main/java/com/iformall/domain/vo/WxCardCVo.java
  9. +62
    -0
      mallinkService/src/main/java/com/iformall/domain/vo/WxCouponPasswordVo.java
  10. +36
    -0
      mallinkService/src/main/java/com/iformall/enums/EnumCardInfoStatus.java
  11. +1
    -2
      mallinkService/src/main/java/com/iformall/enums/EnumCouponPasswordStatus.java
  12. +1
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxCardInfoMapper.java
  13. +1
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxCouponOrderMapper.java
  14. +1
    -0
      mallinkService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java
  15. +3
    -0
      mallinkService/src/main/java/com/iformall/service/WxCouponPasswordService.java
  16. +5
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java
  17. +188
    -5
      mallinkService/src/main/java/com/iformall/service/impl/WxCardInfoServiceImpl.java
  18. +11
    -3
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java
  19. +116
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponPasswordServiceImpl.java
  20. +2
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java
  21. +5
    -0
      mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml
  22. +32
    -144
      mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml
  23. +12
    -0
      mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml

+ 1
- 1
mallinkAdmin/src/main/java/com/iformall/controller/market/WxCardInfoController.java Wyświetl plik

@@ -54,7 +54,7 @@ public class WxCardInfoController extends BaseController {
@Autowired
WxCardSpendService wxCardSpendService;

@ApiOperation("批次消费卡的卡列表")
@ApiOperation("批次消费卡(已激活电子卡电子卡)的卡列表")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),


+ 14
- 0
mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponPasswordController.java Wyświetl plik

@@ -8,6 +8,7 @@ import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.base.BaseEntity;
import com.iformall.domain.po.WxCouponPassword;
import com.iformall.domain.vo.WxCouponPasswordCountInfoVO;
import com.iformall.domain.vo.WxCouponPasswordVo;
import com.iformall.service.WxCouponPasswordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -78,6 +79,19 @@ public class WxCouponPasswordController extends BaseController {
}
return new ResultData();
}
@ApiOperation("批次卡密分页列表接口")
@GetMapping("/batchVoList")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
public ResultData batchList(@ModelAttribute WxCouponPassword wxCouponPassword, Integer pageNum, Integer pageSize) {
wxCouponPassword.updateTenantInfo(getTenantInfo());
wxCouponPassword.setSortColumns(BaseEntity.SortField.CreateDate_DESC, BaseEntity.SortField.Id_DESC);
final PageInfo<WxCouponPasswordVo> page = wxCouponPasswordService.listVoAsPage(wxCouponPassword, pageNum, pageSize);
return new ResultData(page);
}


}

+ 17
- 0
mallinkAdmin/src/main/resources/db/migration/V2023022800001__card.sql Wyświetl plik

@@ -1,3 +1,20 @@
alter table wx_card_info add column coupon_password varchar(50) comment '卡密';
alter table wx_card_info add column c_user_id bigint(20) comment '购买用户编码';
alter table wx_card_info add column owner_user_id bigint(20) comment '持有用户编码';
alter table wx_card_info add column status int(1) not null default 0 comment '状态';

###待做#######
##coupon_password_id,coupon_password,c_user_id,owner_user_id 刷数据,后两者不能为空
# 转赠验证wx_coupon_order的c_user_id不变

#select * from wx_card_info where (c_user_id is null or owner_user_id is null)
#and tenant_id = 789 order by create_date desc

#update wx_card_info ci left join wx_coupon_order_89 co on ci.id = co.id
#set ci.c_user_id = co.c_user_id, ci.owner_user_id = co.owner_id







+ 9
- 5
mallinkBApi/src/main/java/com/iformall/controller/WxCardPayController.java Wyświetl plik

@@ -173,11 +173,15 @@ public class WxCardPayController extends BaseController {
}

//查看所有者与扫码者是否为一致
WxCouponOrder couponOrder = wxCouponOrderService.getById(cardInfo.getId(),cardInfo.getTenantId());
if (!couponOrder.getOwnerId().equals(cUserId)) {
logger.error("卡已被领取: " + cardInfo.getId());
return new ResultData(ErrorCode.CARD_TRANSFERED);
}
if (!cardInfo.getOwnerUserId().equals(cUserId)) {
logger.error("卡已被领取: " + cardInfo.getId());
return new ResultData(ErrorCode.CARD_TRANSFERED);
}
// WxCouponOrder couponOrder = wxCouponOrderService.getById(cardInfo.getId(),cardInfo.getTenantId());
// if (!couponOrder.getOwnerId().equals(cUserId)) {
// logger.error("卡已被领取: " + cardInfo.getId());
// return new ResultData(ErrorCode.CARD_TRANSFERED);
// }

WxCouponMerchant couponMerchant = wxCardSpendService.checkMerchantInCoupon(cardInfo, merchantId);
if(couponMerchant == null) {


+ 0
- 1
mallinkCApi/src/main/java/com/iformall/controller/WxCouponPasswordController.java Wyświetl plik

@@ -77,7 +77,6 @@ public class WxCouponPasswordController extends BaseController {
logger.error(e.getMessage());
return new ResultData(500, e.getMessage());
}

WxCUserBasicInfo member = userService.getById(memberId,getFinalTenantId());
if(member == null) {


+ 14
- 2
mallinkService/src/main/java/com/iformall/domain/po/WxCardInfo.java Wyświetl plik

@@ -24,14 +24,24 @@ public class WxCardInfo extends TenantEntity {
protected Long id;
@io.swagger.annotations.ApiModelProperty(value="卡密编码",name="couponPasswordId")
protected Long couponPasswordId;
@io.swagger.annotations.ApiModelProperty(value="卡密",name="couponPassword")
protected String couponPassword;
@TableField(exist = false)
protected Long couponPasswordIdLike;
@TableField(exist = false)
protected List<Long> couponPasswordIdList;
@io.swagger.annotations.ApiModelProperty(value="卡密",name="couponPassword")
protected String couponPassword;
@io.swagger.annotations.ApiModelProperty(value="卡类型EnumCardInfoType",name="type")
protected Integer type;
@io.swagger.annotations.ApiModelProperty(value = "券ID", name = "couponId")
private Long couponId;
@io.swagger.annotations.ApiModelProperty(value = "购买用户ID", name = "cUserId")
private Long cUserId;
@TableField(exist = false)
private List<Long> cUserIdList;
@io.swagger.annotations.ApiModelProperty(value = "持有用户ID", name = "cUserId")
private Long ownerUserId;
@TableField(exist = false)
private List<Long> ownerUserIdList;
@io.swagger.annotations.ApiModelProperty(value="微信订单号-购买类储值卡时的订单号",name="transactionId")
private String transactionId;
@io.swagger.annotations.ApiModelProperty(value="面额总金额",name="amount")
@@ -63,6 +73,8 @@ public class WxCardInfo extends TenantEntity {
private Date updateDate;
@io.swagger.annotations.ApiModelProperty(value = "是否支持转送(0:不支持,1支持)", name = "supportTransfer")
private Integer supportTransfer;
@io.swagger.annotations.ApiModelProperty(value = "状态EnumCardInfoStatus", name = "status")
private Integer status;
@TableField(exist = false)
@io.swagger.annotations.ApiModelProperty(value="查询-开始时间",name="startdate")
protected Date startdate;


+ 2
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxCouponOrder.java Wyświetl plik

@@ -54,6 +54,8 @@ public class WxCouponOrder extends TenantEntity {
private Date expiredTime;
@io.swagger.annotations.ApiModelProperty(value = "状态:0-待使用 1-已核销 2-已过期 3-已作废 4-卡使用中 5-卡已过期 6-卡已用完 7-卡已线下退款 100-预核销", name = "couponOrderStatus")
private Integer couponOrderStatus;
@TableField(exist = false)
private List<Integer> couponOrderStatusList;
@io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createDate")
private Date createDate;
@io.swagger.annotations.ApiModelProperty(value = "创建时间数值,供查询优化用", name = "createDateTimes")


+ 3
- 0
mallinkService/src/main/java/com/iformall/domain/vo/WxCardCVo.java Wyświetl plik

@@ -2,6 +2,7 @@ package com.iformall.domain.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.iformall.domain.po.WxCardInfo;
import com.iformall.domain.po.WxCouponOrder;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -58,6 +59,8 @@ public class WxCardCVo extends WxCouponOrder {

@TableField(exist = false)
protected String statusStr;
private WxCardInfo wxCardInfo;


}

+ 62
- 0
mallinkService/src/main/java/com/iformall/domain/vo/WxCouponPasswordVo.java Wyświetl plik

@@ -0,0 +1,62 @@
package com.iformall.domain.vo;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.iformall.domain.po.WxCouponOrder;
import com.iformall.domain.po.base.TenantEntity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.Date;
import java.util.List;
@JsonIgnoreProperties(value = {"handler"})
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class WxCouponPasswordVo extends TenantEntity {

private static final long serialVersionUID = 6687954932922444531L;

@Excel(name = "卡号", width = 20, orderNum = "1", prefix = "`")
protected Long id;
@Excel(name = "卡密", width = 20, orderNum = "2", prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "卡密", name = "couponPassword")
private String couponPassword;
@Excel(name = "创建时间", width = 20, exportFormat = "yyyy-MM-dd HH:mm:ss", orderNum = "3")
@io.swagger.annotations.ApiModelProperty(value = "", name = "createDate")
private Date createDate;
@Excel(name = "卡密状态", width = 20, orderNum = "4", 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 = "`")
@io.swagger.annotations.ApiModelProperty(value = "卡激活状态EnumYesOrNo", name = "used")
private Integer used;
@Excel(name = "激活时间", width = 20, exportFormat = "yyyy-MM-dd HH:mm:ss", orderNum = "6")
@io.swagger.annotations.ApiModelProperty(value = "", name = "activeDate")
private Date activeDate;
@Excel(name = "激活手机号", width = 20, orderNum = "7", prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "激活手机号", name = "phone")
private String phone;
@Excel(name = "激活会员", width = 20, orderNum = "8", prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "激活会员", name = "userName")
private String userName;
@Excel(name = "电子卡卡号", width = 20, orderNum = "9", prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "电子卡卡号", name = "cardId")
private Long cardId;
@Excel(name = "面额(元)", width = 20, orderNum = "10", prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "面额(元)", name = "price")
private Double price;
@Excel(name = "余额(元)", width = 20, orderNum = "11", prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "余额(元)", name = "remainPrice")
private Double remainPrice;
@Excel(name = "激活卡状态", width = 20, orderNum = "12",replace = {"正常_0", "已禁用_1"}, prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "激活卡状态EnumYesOrNo", name = "used")
private Integer cardStatus;

}

+ 36
- 0
mallinkService/src/main/java/com/iformall/enums/EnumCardInfoStatus.java Wyświetl plik

@@ -0,0 +1,36 @@
package com.iformall.enums;

/**
* Created by Stormeye on 2019/09/17.
*/
public enum EnumCardInfoStatus {


NORMAL(0, "正常"),
STOP(1, "已禁用");

public static EnumCardInfoStatus getEnum(Integer code) {
for (EnumCardInfoStatus value : values()) {
if (value.getCode().equals(code)) {
return value;
}
}
return null;
}

private Integer code;
private String message;

EnumCardInfoStatus(Integer code, String message) {
this.code = code;
this.message = message;
}

public Integer getCode() {
return code;
}

public String getMessage() {
return message;
}
}

+ 1
- 2
mallinkService/src/main/java/com/iformall/enums/EnumCouponPasswordStatus.java Wyświetl plik

@@ -10,8 +10,7 @@ public enum EnumCouponPasswordStatus {
MSG_SENDING(1, "消息发送中"),
MSG_SENDED(2, "消息已发送"),
USED(3, "已兑换"),
CANCEL(4, "已作废"),
PAID(5, "已支付过"),;
CANCEL(4, "已作废");

public static EnumCouponPasswordStatus getEnum(Integer code) {
for (EnumCouponPasswordStatus value : values()) {


+ 1
- 1
mallinkService/src/main/java/com/iformall/mapper/WxCardInfoMapper.java Wyświetl plik

@@ -8,7 +8,7 @@ import java.util.List;

public interface WxCardInfoMapper extends CommonMapper<WxCardInfo, Long> {

List<WxCardVo> findVoList(WxCardVo wxCardVo);
//List<WxCardVo> findVoList(WxCardVo wxCardVo);

void updateTransferStatusByCouponId(Long couponId);


+ 1
- 0
mallinkService/src/main/java/com/iformall/mapper/WxCouponOrderMapper.java Wyświetl plik

@@ -17,6 +17,7 @@ public interface WxCouponOrderMapper extends CommonMapper<WxCouponOrder, Long> {
WxCouponOrder selectById(@Param("id")Long id,@Param("tenantId")String tenantId);
List<WxCouponOrder> findList(WxCouponOrder wxCouponOrder);
List<Long> findIdList(WxCouponOrder wxCouponOrder);

List<WxCouponOrder> findListOfOrderedByDate(Map dateMap);
List<WxCouponOrder> findListOfVerifiedByDate(Map dateMap);


+ 1
- 0
mallinkService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java Wyświetl plik

@@ -46,6 +46,7 @@ public interface WxCUserBasicInfoService {
PageInfo<WxCUserBasicInfo> listAsPage(WxCUserBasicInfo record, Integer pageIndex, Integer pageSize);
List<WxCUserBasicInfo> listPhoneAndNameByIds(WxCUserBasicInfo record);
List<Long> findIdList(WxCUserBasicInfo record);

Map<Long,WxCUserBasicInfo> getUserMap(TenantEntity tenantEntity, List<Long> cUserIdList);
/**


+ 3
- 0
mallinkService/src/main/java/com/iformall/service/WxCouponPasswordService.java Wyświetl plik

@@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo;
import com.iformall.domain.po.WxCouponPassword;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.WxCouponPasswordCountInfoVO;
import com.iformall.domain.vo.WxCouponPasswordVo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -21,6 +22,8 @@ public interface WxCouponPasswordService {
*/
PageInfo<WxCouponPassword> listAsPage(WxCouponPassword record, Integer pageIndex, Integer pageSize);
PageInfo<WxCouponPasswordVo> listVoAsPage(WxCouponPassword record, Integer pageIndex, Integer pageSize);
/**
* 根据Id获得实体
*


+ 5
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java Wyświetl plik

@@ -1333,5 +1333,10 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc
}
return null;
}

@Override
public List<Long> findIdList(WxCUserBasicInfo record) {
return wxCUserBasicInfoMapper.findIdList(record);
}
}


+ 188
- 5
mallinkService/src/main/java/com/iformall/service/impl/WxCardInfoServiceImpl.java Wyświetl plik

@@ -1,24 +1,38 @@
package com.iformall.service.impl;

import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.iformall.common.IdWorker;
import com.iformall.domain.po.WxCUserBasicInfo;
import com.iformall.domain.po.WxCardInfo;
import com.iformall.domain.po.WxCoupon;
import com.iformall.domain.po.WxCouponChannel;
import com.iformall.domain.po.WxCouponOrder;
import com.iformall.domain.po.WxCouponPassword;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.WxCardVo;
import com.iformall.domain.vo.WxCouponOrderBVo;
import com.iformall.domain.vo.WxCouponPasswordVo;
import com.iformall.enums.EnumCardInfoType;
import com.iformall.enums.EnumCouponPasswordStatus;
import com.iformall.enums.EnumCouponPasswordSupport;
import com.iformall.enums.EnumCouponType;
import com.iformall.enums.EnumYesOrNo;
import com.iformall.mapper.WxCardInfoMapper;
import com.iformall.mapper.WxCouponChannelMapper;
import com.iformall.mapper.WxCouponMapper;
import com.iformall.mapper.WxCouponOrderMapper;
import com.iformall.mapper.WxCouponPasswordMapper;
import com.iformall.service.ExcelService;
import com.iformall.service.WxCUserBasicInfoService;
import com.iformall.service.WxCardInfoService;
import com.iformall.utils.Constant;
import com.iformall.utils.RedisLock;

import org.apache.commons.beanutils.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@@ -26,8 +40,12 @@ import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class WxCardInfoServiceImpl implements WxCardInfoService {
@@ -46,11 +64,146 @@ public class WxCardInfoServiceImpl implements WxCardInfoService {
@Autowired
WxCouponPasswordMapper couponPasswordMapper;
@Autowired
WxCouponMapper wxCouponMapper;
@Lazy
@Autowired
WxCUserBasicInfoService wxCUserBasicInfoService;
@Autowired
WxCouponOrderMapper wxCouponOrderMapper;

@Override
public PageInfo<WxCardVo> listAsPage(WxCardVo record, Integer pageIndex, Integer pageSize) {
handleCouponOnlineEndDate(record);
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCardInfoMapper.findVoList(record));
handleQueryParam(record);
PageInfo<WxCardInfo> cardInfoPage = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCardInfoMapper.findList(record));
PageInfo<WxCardVo> pageInfo = new PageInfo<WxCardVo>();
pageInfo.setList(handleToCardVoList(cardInfoPage.getList(),record));
pageInfo.setPageNum(cardInfoPage.getPageNum());
pageInfo.setPageSize(cardInfoPage.getPageSize());
pageInfo.setPages(cardInfoPage.getPages());
pageInfo.setTotal(cardInfoPage.getTotal());
return pageInfo;
}
private List<WxCardVo> handleToCardVoList(List<WxCardInfo> list,WxCardVo record) {
if (null != list && list.size() > 0) {
List<Long> couponIdList = new ArrayList<Long>();
List<Long> userIdList = new ArrayList<Long>();
List<Long> cardIdList = new ArrayList<Long>();
for (int i = 0 ; i < list.size() ; i ++ ) {
WxCardInfo bo = list.get(i);
if (null != bo.getId() && (!cardIdList.contains(bo.getId()))) {
cardIdList.add(bo.getId());
}
if (null != bo.getCouponId() && (!couponIdList.contains(bo.getCouponId()))) {
couponIdList.add(bo.getCouponId());
}
if (null != bo.getCUserId() && (!userIdList.contains(bo.getCUserId()))) {
userIdList.add(bo.getCUserId());
}
if (null != bo.getOwnerUserId() && (!userIdList.contains(bo.getOwnerUserId()))) {
userIdList.add(bo.getOwnerUserId());
}
}

Map<Long,WxCoupon> couponMap = new HashMap<Long,WxCoupon>();
if (couponIdList.size() > 0 ) {
WxCoupon couponQ = new WxCoupon();
couponQ.updateTenantInfo(record);
couponQ.setIds(couponIdList);
List<WxCoupon> couponList = wxCouponMapper.findList(couponQ);
if (null != couponList && couponList.size() > 0) {
for (int i = 0 ; i < couponList.size(); i++) {
WxCoupon ci = couponList.get(i);
couponMap.put(ci.getId(), ci);
}
}
}
Map<Long,WxCUserBasicInfo> cUserMap = new HashMap<Long,WxCUserBasicInfo>();
if (userIdList.size() > 0) {
WxCUserBasicInfo cUserBasicInfoQ = new WxCUserBasicInfo();
cUserBasicInfoQ.setIds(userIdList);
cUserBasicInfoQ.setFinalTenantId(record.getFinalTenantId());
List<WxCUserBasicInfo> cuserList = wxCUserBasicInfoService.listPhoneAndNameByIds(cUserBasicInfoQ);
if (null != cuserList) {
for (int i = 0 ; i < cuserList.size() ; i++) {
WxCUserBasicInfo cbi = cuserList.get(i);
cUserMap.put(cbi.getId(), cbi);
}
}
}
Map<Long,WxCouponOrder> couponOrderMap = new HashMap<Long,WxCouponOrder>();
if (cardIdList.size() > 0 ) {
WxCouponOrder couponOrderQ = new WxCouponOrder();
couponOrderQ.updateTenantInfo(record);
couponOrderQ.setIds(cardIdList);
List<WxCouponOrder> couponOrderList = wxCouponOrderMapper.findList(couponOrderQ);
if (null != couponOrderList) {
for (int i = 0 ; i < couponOrderList.size(); i ++) {
WxCouponOrder co = couponOrderList.get(i);
couponOrderMap.put(co.getId(), co);
}
}
}
List<WxCardVo> retList = new ArrayList<WxCardVo>();
for (int i = 0 ; i < list.size() ; i ++) {
WxCardInfo coo = list.get(i);
WxCardVo co = new WxCardVo();
try {
BeanUtils.copyProperties(co, coo);
//coupon
WxCoupon coupon = couponMap.get(coo.getCouponId());
if (null != coupon) {
co.setCoverImg(coupon.getCoverImg());
co.setCoverPicture(coupon.getCoverPicture());
co.setDetailPicture(coupon.getDetailPicture());
co.setTitle(coupon.getTitle());
co.setSubTitle(coupon.getSubTitle());
co.setDetail(coupon.getDetail());
co.setUnit(coupon.getUnit());
co.setRemark(coupon.getRemark());
co.setSalePrice(coupon.getSalePrice());
co.setPrice(coupon.getPrice());
co.setSubsidyType(coupon.getSubsidyType());
co.setSubsidyNum(coupon.getSubsidyNum());
}
//couponOrder
WxCouponOrder couponOrder = couponOrderMap.get(coo.getId());
if (null != couponOrder) {
//co.setCuserId();
//co.setOwnerId();
co.setExpiredTime(couponOrder.getExpiredTime());
co.setStatus(couponOrder.getCouponOrderStatus());
}
//user
WxCUserBasicInfo buyUser = cUserMap.get(coo.getCUserId());
if (null != buyUser) {
co.setCnickName(buyUser.getNickName());
}
WxCUserBasicInfo owner = cUserMap.get(coo.getCUserId());
if (null != owner) {
co.setOnickName(owner.getNickName());
co.setOuPhone(owner.getPhone());
}
retList.add(co);
}catch(Exception e) {
}
}
return retList;
}
return new ArrayList<WxCardVo>();
}

@Override
@@ -77,13 +230,14 @@ public class WxCardInfoServiceImpl implements WxCardInfoService {

@Override
public void exportData(WxCardVo record, HttpServletRequest request, HttpServletResponse response) {
handleCouponOnlineEndDate(record);
List<WxCardVo> list = wxCardInfoMapper.findVoList(record);
handleQueryParam(record);
List<WxCardInfo> cardInfoList = wxCardInfoMapper.findList(record);
List<WxCardVo> list = this.handleToCardVoList(cardInfoList,record);
excelService.exportExcel(list, null, "卡订单", WxCardVo.class, "卡订单.xlsx", response, false);

}

private void handleCouponOnlineEndDate(WxCardVo record){
private void handleQueryParam(WxCardVo record){
if (null != record.getCouponOnlineStartDate() || null != record.getCouponOnlineEndDate() ) {
WxCouponChannel wxCouponChannelQ = new WxCouponChannel();
wxCouponChannelQ.updateTenantInfo(record);
@@ -96,6 +250,33 @@ public class WxCardInfoServiceImpl implements WxCardInfoService {
record.setCouponIdList(ccIds);
}
}
if ((null != record.getStatusS() && record.getStatusS().size() > 0 ) || null != record.getStatus()) {
WxCouponOrder couponOrderQ = new WxCouponOrder();
couponOrderQ.updateTenantInfo(record);
couponOrderQ.setCouponOrderStatusList(record.getStatusS());
couponOrderQ.setCouponOrderStatus(record.getStatus());
couponOrderQ.setCouponType(EnumCouponType.CARD_MULTIMCH.getCode());
List<Long> orderIdList = wxCouponOrderMapper.findIdList(couponOrderQ);
if (null != orderIdList && orderIdList.size() > 0 ) {
record.setIds(orderIdList);
}else {
record.setId(-999L);
}
}
if (StringUtils.isNotBlank(record.getOuPhone()) || StringUtils.isNotBlank(record.getOnickName())) {
WxCUserBasicInfo userQ = new WxCUserBasicInfo();
userQ.setFinalTenantId(record.getFinalTenantId());
userQ.setPhone(StringUtils.trimToNull(record.getOuPhone()));
userQ.setNickName(StringUtils.trimToNull(record.getOnickName()));
List<Long> userIdList = wxCUserBasicInfoService.findIdList(userQ);
if (null != userIdList && userIdList.size() > 0 ) {
record.setOwnerUserIdList(userIdList);
}else {
record.setId(-999L);
}
}
}

@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class})
@@ -127,6 +308,8 @@ public class WxCardInfoServiceImpl implements WxCardInfoService {
updateCPwd.setStatus(EnumCouponPasswordStatus.USED.getCode());
couponPasswordMapper.updateById(updateCPwd);
}
cardInfo.setCUserId(Constant.defaultCUserId);
cardInfo.setOwnerUserId(Constant.defaultCUserId);
cardInfo.setServiceFeeAmount(0);
cardInfo.setCreateDate(new Date());
cardInfo.setUpdateDate(new Date());


+ 11
- 3
mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java Wyświetl plik

@@ -2482,6 +2482,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
cvo.setRemainingAmount(cardInfo.getRemainingAmount());
cvo.setSupportTransfer(cardInfo.getSupportTransfer());
}
cvo.setWxCardInfo(cardInfo);
return cvo;
} catch (IllegalAccessException | InvocationTargetException e) {
logger.error("getCouponOrderCardCVo error.",e);
@@ -2521,15 +2522,18 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
//卡券是否存在
WxCardCVo cardCVo = findCardDetailOfCUser(record.getId(),record.getTenantId());
if (cardCVo == null) {
logger.info("卡券不存在" + record.getId());
return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL);
}
WxCardInfo cardInfo = cardCVo.getWxCardInfo();
if (null == cardInfo) {
return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL.getCode(),"cardInfo未查询到");
}
//转赠人是否存在
Long cUserId = record.getCUserId();

WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(cUserId,cardCVo.getFinalTenantId());
if (wxCUserBasicInfo == null) {
logger.info("转赠人不存在:" + cUserId);
return new ResultData(ErrorCode.USER_IS_EMPTY.getCode(), "转赠人不存在");
}

@@ -2560,9 +2564,13 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
}
//更新卡拥有者
try {
record.setCUserId(null);
record.setUpdateDate(new Date());
wxCouponOrderMapper.updateById(record);
cardInfo.setCUserId(record.getOwnerId());
cardInfo.setUpdateDate(new Date());
wxCardInfoMapper.updateById(cardInfo);
} catch (Exception e) {
logger.info("更新卡拥有者信息失败");
throw new MallinkException(ErrorCode.CARD_TRANSFER_INVALID);


+ 116
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCouponPasswordServiceImpl.java Wyświetl plik

@@ -3,25 +3,49 @@ package com.iformall.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.iformall.common.IdWorker;
import com.iformall.domain.po.WxCUserBasicInfo;
import com.iformall.domain.po.WxCardInfo;
import com.iformall.domain.po.WxCoupon;
import com.iformall.domain.po.WxCouponOrder;
import com.iformall.domain.po.WxCouponPassword;
import com.iformall.domain.po.WxMall;
import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.WxMerchantBUser;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.enums.EnumCouponOrderStatus;
import com.iformall.enums.EnumCouponPasswordStatus;
import com.iformall.enums.EnumYesOrNo;
import com.iformall.domain.vo.WxCouponOrderBVo;
import com.iformall.domain.vo.WxCouponPasswordCountInfoVO;
import com.iformall.domain.vo.WxCouponPasswordVo;
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.WxCouponPasswordMapper;
import com.iformall.service.ExcelService;
import com.iformall.service.WxCUserBasicInfoService;
import com.iformall.service.WxCouponPasswordService;

import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import java.lang.reflect.InvocationTargetException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;

@Service
@@ -30,6 +54,11 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService {
@Autowired
WxCouponPasswordMapper wxCouponPasswordMapper;
@Autowired
WxCardInfoMapper wxCardInfoMapper;
@Lazy
@Autowired
WxCUserBasicInfoService wxCUserBasicInfoService;

@Autowired
ExcelService excelService;
@@ -38,6 +67,93 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService {
public PageInfo<WxCouponPassword> listAsPage(WxCouponPassword record, Integer pageIndex, Integer pageSize) {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponPasswordMapper.findList(record));
}
@Override
public PageInfo<WxCouponPasswordVo> listVoAsPage(WxCouponPassword record, Integer pageIndex, Integer pageSize) {
PageInfo<WxCouponPassword> passwordPage = listAsPage(record,pageIndex,pageSize);
PageInfo<WxCouponPasswordVo> retPageInfo = new PageInfo();
retPageInfo.setPageNum(pageIndex);
retPageInfo.setPageSize(pageSize);
retPageInfo.setPages(passwordPage.getPages());
retPageInfo.setTotal(passwordPage.getTotal());
retPageInfo.setList(handleQueryResult(passwordPage.getList(), record));
return retPageInfo;
}
private List<WxCouponPasswordVo> handleQueryResult(List<WxCouponPassword> list,TenantEntity tenantEntity) {
if (null != list && list.size() > 0) {
List<Long> couponPasswordIdList = 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());
}
}

List<Long> cUserIdList = new ArrayList<Long>();
Map<Long,WxCardInfo> passwordCardInfoMap = new HashMap<Long,WxCardInfo>();
if (couponPasswordIdList.size() > 0 ) {
WxCardInfo cardInfoQ = new WxCardInfo();
cardInfoQ.updateTenantInfo(tenantEntity);
cardInfoQ.setCouponPasswordIdList(couponPasswordIdList);
List<WxCardInfo> cardList = wxCardInfoMapper.findList(cardInfoQ);
if (null != cardList && cardList.size() > 0) {
for (int i = 0 ; i < cardList.size(); i++) {
WxCardInfo ci = cardList.get(i);
passwordCardInfoMap.put(ci.getCouponPasswordId(), ci);
if (null != ci.getCUserId() && (!cUserIdList.contains(ci.getCUserId()))) {
cUserIdList.add(ci.getCUserId());
}
}
}
}
Map<Long,WxCUserBasicInfo> cUserMap = new HashMap<Long,WxCUserBasicInfo>();
if (cUserIdList.size() > 0) {
WxCUserBasicInfo cUserBasicInfoQ = new WxCUserBasicInfo();
cUserBasicInfoQ.setIds(cUserIdList);
cUserBasicInfoQ.setFinalTenantId(tenantEntity.getFinalTenantId());
List<WxCUserBasicInfo> cuserList = wxCUserBasicInfoService.listPhoneAndNameByIds(cUserBasicInfoQ);
if (null != cuserList) {
for (int i = 0 ; i < cuserList.size() ; i++) {
WxCUserBasicInfo cbi = cuserList.get(i);
cUserMap.put(cbi.getId(), cbi);
}
}
}
List<WxCouponPasswordVo> retList = new ArrayList<WxCouponPasswordVo>();
for (int i = 0 ; i < list.size() ; i ++) {
WxCouponPassword coo = list.get(i);
WxCouponPasswordVo co = new WxCouponPasswordVo();
WxCardInfo cardInfo = passwordCardInfoMap.get(coo.getId());
co.setId(coo.getId());
co.setCouponPassword(coo.getPassword());
if (null != cardInfo) {
co.setUsed(EnumYesOrNo.YES.getCode());
co.setPrice(new BigDecimal(cardInfo.getAmount()).divide(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
co.setRemainPrice(new BigDecimal(cardInfo.getRateAmount()).divide(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
co.setActiveDate(cardInfo.getCreateDate());
WxCUserBasicInfo basicInfo = cUserMap.get(cardInfo.getCUserId());
if (null != basicInfo) {
co.setPhone(basicInfo.getPhone());
co.setUserName(basicInfo.getName());
}
co.setCardStatus(cardInfo.getStatus());
co.setCardId(cardInfo.getId());
}else {
co.setUsed(EnumYesOrNo.NO.getCode());
}
co.setStatus(coo.getStatus());
co.setCreateDate(coo.getCreateDate());
retList.add(co);
}
return retList;
}
return new ArrayList<WxCouponPasswordVo>();
}

@Override
public WxCouponPassword getById(Long id) {


+ 2
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java Wyświetl plik

@@ -1456,7 +1456,8 @@ public class WxOrderServiceImpl implements WxOrderService {
cardInfo.setAmount(coupon.getPrice());
cardInfo.setSaleAmount(coupon.getSalePrice());
cardInfo.setCouponPasswordId(couponPassWord.getId());
cardInfo.setCouponPassword(couponPassWord.getPassword());
cardInfo.setCouponPassword(couponPassWord.getPassword());
cardInfo.setCUserId(user.getId());
cardInfo.setRemainingAmount(coupon.getPrice());
if (!coupon.checkIsFree()) {
//判断该transctionId是否已经存在,如果存在,则不添加
@@ -1501,7 +1502,6 @@ public class WxOrderServiceImpl implements WxOrderService {
cardInfo.setCreateDate(curr);
cardInfo.setUpdateDate(curr);
cardInfo.setSupportTransfer(coupon.getSupportTransfer());

//检查卡是否下架,如果是,不可转赠
WxCouponChannel wxCouponChannel = wxCouponChannelMapper.selectById(order.getCouponChannelId(),order.getTenantId());
if (wxCouponChannel != null && wxCouponChannel.getStatus().equals(EnumCouponChannelStatus.STATUS_TAKE_OFFF.getCode())) {


+ 5
- 0
mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml Wyświetl plik

@@ -101,6 +101,11 @@
<if test=" null != name ">
and wcubi.`name` like concat('%', #{name},'%')
</if>
<if test=" null != nickName ">
and wcubi.`nick_name` like concat('%', #{nickName},'%')
</if>
<if test=" null != startTime and null != endTime">
and wcubi.`create_date` between #{startTime} and #{endTime}
</if>


+ 32
- 144
mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml Wyświetl plik

@@ -6,6 +6,8 @@
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="coupon_id" jdbcType="BIGINT" property="couponId" />
<result column="c_user_id" jdbcType="BIGINT" property="cUserId" />
<result column="owner_user_id" jdbcType="BIGINT" property="ownerUserId" />
<result column="transaction_id" jdbcType="VARCHAR" property="transactionId" />
<result column="amount" jdbcType="INTEGER" property="amount" />
<result column="sale_amount" jdbcType="INTEGER" property="saleAmount" />
@@ -22,25 +24,28 @@
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`coupon_id`,`coupon_password_id`,`coupon_password`,`transaction_id`,
`id`,`tenant_id`,`parent_tenant_id`,`coupon_id`,`c_user_id`,`owner_user_id`,`coupon_password_id`,`coupon_password`,`transaction_id`,
`amount`,`sale_amount`,`remaining_amount`,`service_fee_amount`,`share_fee_amount`,`remaining_share_fee_amount`,
`rate_amount`,`create_date`,`update_date`,`support_transfer`
</sql>
<sql id="dynamicWhereConditions">
where 1 = 1
where `tenant_id` = #{tenantId}
<if test=" null != id ">
and `id` = #{id}
</if>
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != couponId ">
and `coupon_id` = #{couponId}
</if>
<if test=" null != cUserId ">
and `c_user_id` = #{cUserId}
</if>
<if test=" null != ownerUserId ">
and `owner_user_id` = #{ownerUserId}
</if>
<if test=" null != transactionId ">
and `transaction_id` = #{transactionId}
</if>
@@ -80,8 +85,17 @@
<if test=" null != couponPassword">
and `coupon_password` like concat('%',#{couponPassword},'%')
</if>
<if test=" null != startdate and null!=enddate">
and `create_date` between #{startdate} and #{enddate}
<if test=" null != startdate ">
and `create_date` &gt;= #{startdate}
</if>
<if test=" null != enddate">
and `create_date` &lt;= #{enddate}
</if>
<if test=" null != couponPasswordIdList ">
and coupon_password_id in
<foreach collection="couponPasswordIdList" index="index" item="cpidItem" open="(" separator="," close=")">
#{cpidItem}
</foreach>
</if>
<if test=" null != couponIdList ">
and coupon_id in
@@ -89,153 +103,27 @@
#{cidItem}
</foreach>
</if>
<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
<if test=" null != cUserIdList ">
and c_user_id in
<foreach collection="cUserIdList" index="index" item="cuidItem" open="(" separator="," close=")">
#{cuidItem}
</foreach>
</if>
<if test=" null != sortColumns"> order by ${sortColumns} </if>
</sql>

<resultMap id="VoBaseResultMap" type="com.iformall.domain.vo.WxCardVo">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="coupon_id" jdbcType="BIGINT" property="couponId" />
<result column="transaction_id" jdbcType="VARCHAR" property="transactionId" />
<result column="amount" jdbcType="INTEGER" property="amount" />
<result column="sale_amount" jdbcType="INTEGER" property="saleAmount" />
<result column="remaining_amount" jdbcType="INTEGER" property="remainingAmount" />
<result column="service_fee_amount" jdbcType="INTEGER" property="serviceFeeAmount" />
<result column="share_fee_amount" jdbcType="INTEGER" property="shareFeeAmount" />
<result column="remaining_share_fee_amount" jdbcType="INTEGER" property="remainingShareFeeAmount" />
<result column="rate_amount" jdbcType="INTEGER" property="rateAmount" />
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />

<result column="cover_img" jdbcType="VARCHAR" property="coverImg" />
<result column="cover_picture" jdbcType="VARCHAR" property="coverPicture" />
<result column="detail_picture" jdbcType="VARCHAR" property="detailPicture" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="sub_title" jdbcType="VARCHAR" property="subTitle" />
<result column="detail" jdbcType="VARCHAR" property="detail" />
<result column="unit" jdbcType="INTEGER" property="unit" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="sale_price" jdbcType="INTEGER" property="salePrice"/>
<result column="price" jdbcType="INTEGER" property="price"/>
<result column="subsidy_type" jdbcType="INTEGER" property="subsidyType"/>
<result column="subsidy_num" jdbcType="INTEGER" property="subsidyNum"/>

<result column="c_user_id" jdbcType="BIGINT" property="cuserId" />
<result column="owner_id" jdbcType="BIGINT" property="ownerId" />
<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="ou_phone" jdbcType="VARCHAR" property="ouPhone"/>

</resultMap>

<sql id="allVoColumns">
ci.`id`,ci.`tenant_id`,ci.`parent_tenant_id`,ci.`coupon_id`,ci.`transaction_id`,
ci.`amount`,ci.`sale_amount`,ci.`remaining_amount`,ci.`service_fee_amount`,
ci.`share_fee_amount`,ci.`remaining_share_fee_amount`, ci.`rate_amount`,
ci.`create_date`,ci.`update_date`,
c.`cover_img`, c.`cover_picture`,c.`detail_picture`,c.`title`, c.`sub_title`, c.`detail`,
c.`unit`, c.`remark`, c.`sale_price`, c.`price`, c.`subsidy_type`, c.`subsidy_num`,
co.`c_user_id`, co.`owner_id`, co.`expired_time`, co.`coupon_order_status` as status,
ou.`nick_name` as c_nick_name, ou.`nick_name` as o_nick_name, ou.`phone` as ou_phone
</sql>

<sql id="dynamicVoWhereConditions">
where 1 = 1
<if test=" null != id ">
and ci.`id` = #{id}
</if>
<if test=" null != tenantId and '' != tenantId">
and ci.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and ci.`parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != couponId ">
and ci.`coupon_id` = #{couponId}
</if>
<if test=" null != transactionId ">
and ci.`transaction_id` = #{transactionId}
</if>
<if test=" null != amount ">
and ci.`amount` = #{amount}
</if>
<if test=" null != saleAmount ">
and ci.`sale_amount` = #{saleAmount}
</if>
<if test=" null != remainingAmount ">
and ci.`remaining_amount` = #{remainingAmount}
</if>
<if test=" null != serviceFeeAmount ">
and ci.`service_fee_amount` = #{serviceFeeAmount}
</if>
<if test=" null != shareFeeAmount ">
and ci.`share_fee_amount` = #{shareFeeAmount}
</if>
<if test=" null != remainingShareFeeAmount ">
and ci.`remaining_share_fee_amount` = #{remainingShareFeeAmount}
</if>
<if test=" null != rateAmount ">
and ci.`rate_amount` = #{rateAmount}
</if>
<if test=" null != createDate ">
and ci.`create_date` = #{createDate}
</if>
<if test=" null != updateDate ">
and ci.`update_date` = #{updateDate}
</if>
<if test=" null != status ">
and co.`coupon_order_status` = #{status}
</if>
<if test=" null != ouPhone and '' != ouPhone">
and ou.`phone` = #{ouPhone}
</if>
<if test=" null != startdate and null!=enddate">
and ci.`create_date` between #{startdate} and #{enddate}
</if>
<if test=" null != onickName and ''!=onickName">
and ou.`nick_name` like concat('%',#{onickName},'%')
</if>
<if test=" null != statusS ">
and co.`coupon_order_status` in
<foreach collection="statusS" index="index" item="sItem" open="(" separator="," close=")">
#{sItem}
</foreach>
</if>
<if test=" null != couponIdList ">
and ci.coupon_id in
<foreach collection="couponIdList" index="index" item="cidItem" open="(" separator="," close=")">
#{cidItem}
<if test=" null != ownerUserIdList ">
and owner_user_id in
<foreach collection="ownerUserIdList" index="index" item="ouidItem" open="(" separator="," close=")">
#{ouidItem}
</foreach>
</if>
<if test=" null != ids ">
and ci.id in
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
#{idItem}
</foreach>
</if>
order by ci.id desc
<if test=" null != sortColumns"> order by ${sortColumns} </if>
</sql>

<select id="findVoList" parameterType="com.iformall.domain.vo.WxCardVo" resultMap="VoBaseResultMap">
select <include refid="allVoColumns" />
<!--from (select ci.`id`, ci.`tenant_id`, ci.`coupon_id`, ci.`transaction_id`, ci.`amount`, ci.`sale_amount`, ci.`remaining_amount`, ci.`service_fee_amount`, ci.`share_fee_amount`, ci.`remaining_share_fee_amount`, ci.`rate_amount`, ci.`create_date`, ci.`update_date` from wx_card_info ci where ci.`tenant_id` = #{tenantId}) ci-->
from wx_card_info ci
left join wx_coupon c on c.id = ci.coupon_id
left join wx_coupon_order co on co.id = ci.id
left join wx_c_user_basic_info ou on ou.id = co.owner_id
<include refid="dynamicVoWhereConditions" />
</select>
<update id="updateTransferStatusByCouponId" parameterType="Long">
update wx_card_info set support_transfer=0,update_date=now() where support_transfer=1 and coupon_id=#{couponId}
</update>


+ 12
- 0
mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml Wyświetl plik

@@ -151,6 +151,13 @@
and `shipping_status` = #{shippingStatus}
</if>

<if test=" null != couponOrderStatusList ">
and coupon_order_status in
<foreach collection="couponOrderStatusList" index="index" item="cosidItem" open="(" separator="," close=")">
#{cosidItem}
</foreach>
</if>

<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
@@ -169,6 +176,11 @@
<include refid="dynamicWhereConditions" />
</select>
<select id="findIdList" parameterType="com.iformall.domain.po.WxCouponOrder" resultType="Long">
select id from wx_coupon_order
<include refid="dynamicWhereConditions" />
</select>
<select id="findListOfVerifiedByDateForBUser" parameterType="map" resultMap="BaseResultMap">
select co.id,co.tenant_id,co.parent_tenant_id,co.coupon_id,co.coupon_type,co.c_user_id,co.owner_id,co.b_user_id,co.b_merchant_id,co.b_tenant_id,co.order_id,co.expired_time,
co.coupon_order_status,co.create_date,co.update_date,co.coupon_price,co.verify_type,co.verify_remark,co.pay_vendor,co.pay_version,


Ładowanie…
Anuluj
Zapisz