yshop1.4版本发布,新增积分会员功能等,详细看文档介绍
This commit is contained in:
@ -12,6 +12,8 @@ import co.yixiang.modules.manage.web.param.OrderRemarkParam;
|
||||
import co.yixiang.modules.order.service.YxStoreOrderService;
|
||||
import co.yixiang.modules.order.web.dto.OrderCountDTO;
|
||||
import co.yixiang.modules.order.web.vo.YxStoreOrderQueryVo;
|
||||
import co.yixiang.modules.user.service.YxUserService;
|
||||
import co.yixiang.modules.user.web.vo.YxUserQueryVo;
|
||||
import co.yixiang.utils.SecurityUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@ -36,6 +38,7 @@ import java.util.Map;
|
||||
public class ShoperController extends BaseController {
|
||||
|
||||
private final YxStoreOrderService storeOrderService;
|
||||
//private final YxUserService yxUserService;
|
||||
|
||||
/**
|
||||
* 订单数据统计
|
||||
@ -43,7 +46,8 @@ public class ShoperController extends BaseController {
|
||||
@GetMapping("/admin/order/statistics")
|
||||
@ApiOperation(value = "订单数据统计",notes = "订单数据统计")
|
||||
public ApiResult<Object> statistics(){
|
||||
int uid = SecurityUtils.getUserId().intValue();
|
||||
//int uid = SecurityUtils.getUserId().intValue();
|
||||
|
||||
OrderCountDTO orderCountDTO = storeOrderService.orderData(0);
|
||||
OrderTimeDataDTO orderTimeDataDTO = storeOrderService.getOrderTimeData();
|
||||
|
||||
|
||||
@ -50,7 +50,6 @@ import co.yixiang.modules.user.web.vo.YxUserQueryVo;
|
||||
import co.yixiang.modules.user.web.vo.YxWechatUserQueryVo;
|
||||
//import co.yixiang.redisson.DelayJob;
|
||||
//import co.yixiang.redisson.DelayJobService;
|
||||
import co.yixiang.redisson.DelayJob;
|
||||
import co.yixiang.redisson.DelayJobService;
|
||||
import co.yixiang.utils.OrderUtil;
|
||||
import co.yixiang.utils.RedisUtil;
|
||||
@ -1155,10 +1154,12 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<YxStoreOrderMapper,
|
||||
|
||||
|
||||
// 添加订单支付超期延时任务
|
||||
DelayJob delayJob = new DelayJob();
|
||||
delayJob.setOderId(storeOrder.getId());
|
||||
delayJob.setAClass(CancelOrderService.class);
|
||||
// 添加订单支付超期延时任务
|
||||
Map<String,Object> delayJob = new HashMap<>();
|
||||
delayJob.put("delayJobName","CANCEL_ORVERTIME_ORDER");
|
||||
delayJob.put("orderId",storeOrder.getId());
|
||||
delayJobService.submitJob(delayJob, CommonConstant.ORDER_OUTTIME_UNPAY);
|
||||
log.info("添加定时任务成功 订单id: [{}]:", storeOrder.getId());
|
||||
return storeOrder;
|
||||
}
|
||||
|
||||
|
||||
@ -20,6 +20,7 @@ import java.util.List;
|
||||
*/
|
||||
public interface YxStoreProductService extends BaseService<YxStoreProduct> {
|
||||
|
||||
|
||||
void incProductStock(int num,int productId,String unique);
|
||||
|
||||
void decProductStock(int num,int productId,String unique);
|
||||
|
||||
@ -18,6 +18,7 @@ import co.yixiang.modules.shop.web.vo.YxStoreCartQueryVo;
|
||||
import co.yixiang.common.service.impl.BaseServiceImpl;
|
||||
import co.yixiang.common.web.vo.Paging;
|
||||
import co.yixiang.modules.shop.web.vo.YxStoreProductQueryVo;
|
||||
import co.yixiang.modules.user.service.YxUserService;
|
||||
import co.yixiang.utils.OrderUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.Builder;
|
||||
@ -69,6 +70,9 @@ public class YxStoreCartServiceImpl extends BaseServiceImpl<YxStoreCartMapper, Y
|
||||
@Autowired
|
||||
private YxStoreCombinationMapper storeCombinationMapper;
|
||||
|
||||
@Autowired
|
||||
private YxUserService userService;
|
||||
|
||||
@Autowired
|
||||
private CartMap cartMap;
|
||||
|
||||
@ -174,8 +178,10 @@ public class YxStoreCartServiceImpl extends BaseServiceImpl<YxStoreCartMapper, Y
|
||||
storeProduct.setAttrInfo(productAttrValue);
|
||||
|
||||
//todo 设置真实价格
|
||||
storeCartQueryVo.setTruePrice(productAttrValue.getPrice()
|
||||
.doubleValue());
|
||||
//设置VIP价格
|
||||
double vipPrice = userService.setLevelPrice(
|
||||
productAttrValue.getPrice().doubleValue(),uid);
|
||||
storeCartQueryVo.setTruePrice(vipPrice);
|
||||
//todo 设置会员价
|
||||
storeCartQueryVo.setVipTruePrice(productAttrValue.getPrice()
|
||||
.doubleValue());
|
||||
@ -186,9 +192,10 @@ public class YxStoreCartServiceImpl extends BaseServiceImpl<YxStoreCartMapper, Y
|
||||
valid.add(storeCartQueryVo);
|
||||
}
|
||||
}else{
|
||||
|
||||
storeCartQueryVo.setTruePrice(storeProduct.getPrice()
|
||||
.doubleValue());
|
||||
//设置VIP价格
|
||||
double vipPrice = userService.setLevelPrice(
|
||||
storeProduct.getPrice().doubleValue(),uid);
|
||||
storeCartQueryVo.setTruePrice(vipPrice);
|
||||
//todo 设置会员价
|
||||
storeCartQueryVo.setVipTruePrice(0d);
|
||||
storeCartQueryVo.setCostPrice(storeProduct.getCost()
|
||||
@ -245,6 +252,7 @@ public class YxStoreCartServiceImpl extends BaseServiceImpl<YxStoreCartMapper, Y
|
||||
|
||||
QueryWrapper<YxStoreCart> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("uid",uid).eq("type",type).eq("is_pay",0).eq("is_del",0)
|
||||
.eq("product_id",productId)
|
||||
.eq("is_new",isNew).eq("product_attr_unique",productAttrUnique)
|
||||
.eq("combination_id",combinationId).eq("bargain_id",bargainId)
|
||||
.eq("seckill_id",seckillId);
|
||||
|
||||
@ -16,6 +16,7 @@ import co.yixiang.modules.shop.web.vo.YxStoreProductAttrQueryVo;
|
||||
import co.yixiang.modules.shop.web.vo.YxStoreProductQueryVo;
|
||||
import co.yixiang.common.service.impl.BaseServiceImpl;
|
||||
import co.yixiang.common.web.vo.Paging;
|
||||
import co.yixiang.modules.user.service.YxUserService;
|
||||
import co.yixiang.utils.CateDTO;
|
||||
import co.yixiang.utils.TreeUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@ -28,6 +29,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -60,6 +62,10 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<YxStoreProductMap
|
||||
@Autowired
|
||||
private YxStoreProductReplyService replyService;
|
||||
|
||||
@Autowired
|
||||
private YxUserService userService;
|
||||
|
||||
|
||||
/**
|
||||
* 增加库存 减少销量
|
||||
* @param num
|
||||
@ -119,6 +125,10 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<YxStoreProductMap
|
||||
Map<String, Object> returnMap = storeProductAttrService.getProductAttrDetail(id,0,0);
|
||||
ProductDTO productDTO = new ProductDTO();
|
||||
YxStoreProductQueryVo storeProductQueryVo = storeProductMap.toDto(storeProduct);
|
||||
//设置VIP价格
|
||||
double vipPrice = userService.setLevelPrice(
|
||||
storeProductQueryVo.getPrice().doubleValue(),uid);
|
||||
storeProductQueryVo.setVipPrice(BigDecimal.valueOf(vipPrice));
|
||||
storeProductQueryVo.setUserCollect(relationService
|
||||
.isProductRelation(id,"product",uid,"collect"));
|
||||
productDTO.setStoreInfo(storeProductQueryVo);
|
||||
|
||||
@ -3,36 +3,40 @@ package co.yixiang.modules.task;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import co.yixiang.modules.order.entity.YxStoreOrder;
|
||||
import co.yixiang.modules.order.service.YxStoreOrderService;
|
||||
import co.yixiang.redisson.DelayJob;
|
||||
import co.yixiang.redisson.ExecuteJob;
|
||||
import co.yixiang.utils.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class CancelOrderService implements ExecuteJob {
|
||||
@Override
|
||||
public void execute(DelayJob job) {
|
||||
log.info("系统开始处理延时任务---订单超时未付款---" + job.getOderId());
|
||||
public void execute(Map<String,Object> job) {
|
||||
if(job.get("delayJobName").equals("CANCEL_ORVERTIME_ORDER")){
|
||||
log.info("系统开始处理延时任务---订单超时未付款---" + job.get("orderId"));
|
||||
|
||||
YxStoreOrderService yxorderService = BeanUtil.getBean(YxStoreOrderService.class);
|
||||
YxStoreOrderService yxorderService = BeanUtil.getBean(YxStoreOrderService.class);
|
||||
|
||||
YxStoreOrder order = null;
|
||||
try {
|
||||
order = yxorderService.getOne(new QueryWrapper<YxStoreOrder>().eq("id", job.getOderId()).eq("is_del",0));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
YxStoreOrder order = null;
|
||||
try {
|
||||
order = yxorderService.getOne(new QueryWrapper<YxStoreOrder>().eq("id", job.get("orderId")).eq("is_del",0));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if(ObjectUtil.isNull(order)) {
|
||||
return;
|
||||
}
|
||||
if(order.getPaid() != 0){
|
||||
return;
|
||||
}
|
||||
yxorderService.cancelOrderByTask((int)job.get("orderId"));
|
||||
log.info("系统结束处理延时任务---订单超时未付款取消---" + job.get("orderId"));
|
||||
}
|
||||
if(ObjectUtil.isNull(order)) {
|
||||
return;
|
||||
}
|
||||
if(order.getPaid() != 0){
|
||||
return;
|
||||
}
|
||||
yxorderService.cancelOrderByTask(job.getOderId());
|
||||
log.info("系统结束处理延时任务---订单超时未付款取消---" + job.getOderId());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,77 @@
|
||||
package co.yixiang.modules.user.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import co.yixiang.common.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 设置用户等级表
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-12-06
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "YxSystemUserLevel对象", description = "设置用户等级表")
|
||||
public class YxSystemUserLevel extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "商户id")
|
||||
private Integer merId;
|
||||
|
||||
@ApiModelProperty(value = "会员名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "购买金额")
|
||||
private BigDecimal money;
|
||||
|
||||
@ApiModelProperty(value = "有效时间")
|
||||
private Integer validDate;
|
||||
|
||||
@ApiModelProperty(value = "是否为永久会员")
|
||||
private Integer isForever;
|
||||
|
||||
@ApiModelProperty(value = "是否购买,1=购买,0=不购买")
|
||||
private Integer isPay;
|
||||
|
||||
@ApiModelProperty(value = "是否显示 1=显示,0=隐藏")
|
||||
private Integer isShow;
|
||||
|
||||
@ApiModelProperty(value = "会员等级")
|
||||
private Integer grade;
|
||||
|
||||
@ApiModelProperty(value = "享受折扣")
|
||||
private BigDecimal discount;
|
||||
|
||||
@ApiModelProperty(value = "会员卡背景")
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "会员图标")
|
||||
private String icon;
|
||||
|
||||
@ApiModelProperty(value = "说明")
|
||||
@TableField(value = "`explain`")
|
||||
private String explain;
|
||||
|
||||
@ApiModelProperty(value = "添加时间")
|
||||
private Integer addTime;
|
||||
|
||||
@ApiModelProperty(value = "是否删除.1=删除,0=未删除")
|
||||
private Integer isDel;
|
||||
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package co.yixiang.modules.user.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import co.yixiang.common.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 等级任务设置
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-12-06
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "YxSystemUserTask对象", description = "等级任务设置")
|
||||
public class YxSystemUserTask extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "任务名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "配置原名")
|
||||
private String realName;
|
||||
|
||||
@ApiModelProperty(value = "任务类型")
|
||||
private String taskType;
|
||||
|
||||
@ApiModelProperty(value = "限定数")
|
||||
private Integer number;
|
||||
|
||||
@ApiModelProperty(value = "等级id")
|
||||
private Integer levelId;
|
||||
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "是否显示")
|
||||
private Integer isShow;
|
||||
|
||||
@ApiModelProperty(value = "是否务必达成任务,1务必达成,0=满足其一")
|
||||
private Integer isMust;
|
||||
|
||||
@ApiModelProperty(value = "任务说明")
|
||||
private String illustrate;
|
||||
|
||||
@ApiModelProperty(value = "新增时间")
|
||||
private Integer addTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package co.yixiang.modules.user.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import co.yixiang.common.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户等级记录表
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-12-06
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "YxUserLevel对象", description = "用户等级记录表")
|
||||
public class YxUserLevel extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "用户uid")
|
||||
private Integer uid;
|
||||
|
||||
@ApiModelProperty(value = "等级vip")
|
||||
private Integer levelId;
|
||||
|
||||
@ApiModelProperty(value = "会员等级")
|
||||
private Integer grade;
|
||||
|
||||
@ApiModelProperty(value = "过期时间")
|
||||
private Integer validTime;
|
||||
|
||||
@ApiModelProperty(value = "是否永久")
|
||||
private Integer isForever;
|
||||
|
||||
@ApiModelProperty(value = "商户id")
|
||||
private Integer merId;
|
||||
|
||||
@ApiModelProperty(value = "0:禁止,1:正常")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String mark;
|
||||
|
||||
@ApiModelProperty(value = "是否已通知")
|
||||
private Integer remind;
|
||||
|
||||
@ApiModelProperty(value = "是否删除,0=未删除,1=删除")
|
||||
private Integer isDel;
|
||||
|
||||
@ApiModelProperty(value = "添加时间")
|
||||
private Integer addTime;
|
||||
|
||||
@ApiModelProperty(value = "享受折扣")
|
||||
private Integer discount;
|
||||
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
package co.yixiang.modules.user.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import co.yixiang.common.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 签到记录表
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-12-05
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "YxUserSign对象", description = "签到记录表")
|
||||
public class YxUserSign extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "用户uid")
|
||||
private Integer uid;
|
||||
|
||||
@ApiModelProperty(value = "签到说明")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty(value = "获得积分")
|
||||
private Integer number;
|
||||
|
||||
@ApiModelProperty(value = "剩余积分")
|
||||
private Integer balance;
|
||||
|
||||
@ApiModelProperty(value = "添加时间")
|
||||
private Integer addTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package co.yixiang.modules.user.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import co.yixiang.common.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户任务完成记录表
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-12-07
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "YxUserTaskFinish对象", description = "用户任务完成记录表")
|
||||
public class YxUserTaskFinish extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "任务id")
|
||||
private Integer taskId;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Integer uid;
|
||||
|
||||
@ApiModelProperty(value = "是否有效")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "添加时间")
|
||||
private Integer addTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package co.yixiang.modules.user.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import co.yixiang.modules.user.entity.YxSystemUserLevel;
|
||||
import co.yixiang.modules.user.web.param.YxSystemUserLevelQueryParam;
|
||||
import co.yixiang.modules.user.web.vo.YxSystemUserLevelQueryVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 设置用户等级表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-12-06
|
||||
*/
|
||||
@Repository
|
||||
public interface YxSystemUserLevelMapper extends BaseMapper<YxSystemUserLevel> {
|
||||
|
||||
/**
|
||||
* 根据ID获取查询对象
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
YxSystemUserLevelQueryVo getYxSystemUserLevelById(Serializable id);
|
||||
|
||||
/**
|
||||
* 获取分页对象
|
||||
* @param page
|
||||
* @param yxSystemUserLevelQueryParam
|
||||
* @return
|
||||
*/
|
||||
IPage<YxSystemUserLevelQueryVo> getYxSystemUserLevelPageList(@Param("page") Page page, @Param("param") YxSystemUserLevelQueryParam yxSystemUserLevelQueryParam);
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package co.yixiang.modules.user.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import co.yixiang.modules.user.entity.YxSystemUserTask;
|
||||
import co.yixiang.modules.user.web.param.YxSystemUserTaskQueryParam;
|
||||
import co.yixiang.modules.user.web.vo.YxSystemUserTaskQueryVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 等级任务设置 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-12-06
|
||||
*/
|
||||
@Repository
|
||||
public interface YxSystemUserTaskMapper extends BaseMapper<YxSystemUserTask> {
|
||||
|
||||
/**
|
||||
* 根据ID获取查询对象
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
YxSystemUserTaskQueryVo getYxSystemUserTaskById(Serializable id);
|
||||
|
||||
/**
|
||||
* 获取分页对象
|
||||
* @param page
|
||||
* @param yxSystemUserTaskQueryParam
|
||||
* @return
|
||||
*/
|
||||
IPage<YxSystemUserTaskQueryVo> getYxSystemUserTaskPageList(@Param("page") Page page, @Param("param") YxSystemUserTaskQueryParam yxSystemUserTaskQueryParam);
|
||||
|
||||
}
|
||||
@ -1,9 +1,6 @@
|
||||
package co.yixiang.modules.user.mapper;
|
||||
|
||||
import co.yixiang.modules.user.web.dto.BillDTO;
|
||||
import co.yixiang.modules.user.web.dto.BillOrderRecordDTO;
|
||||
import co.yixiang.modules.user.web.dto.PromUserDTO;
|
||||
import co.yixiang.modules.user.web.dto.UserBillDTO;
|
||||
import co.yixiang.modules.user.web.dto.*;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
@ -30,6 +27,17 @@ import java.util.List;
|
||||
@Repository
|
||||
public interface YxUserBillMapper extends BaseMapper<YxUserBill> {
|
||||
|
||||
@Select("select IFNULL(sum(number),0) from yx_user_bill " +
|
||||
"where status=1 and type='sign' and pm=1 and category='integral' " +
|
||||
"and uid=#{uid}")
|
||||
double sumIntegral(@Param("uid") int uid);
|
||||
|
||||
@Select("SELECT FROM_UNIXTIME(a.add_time,'%Y-%m-%d') as addTime,a.title,a.number " +
|
||||
"FROM yx_user_bill a INNER JOIN yx_user u ON u.uid=a.uid WHERE a.category = 'integral'" +
|
||||
" AND a.type = 'sign' AND a.status = 1 AND a.uid = #{uid} " +
|
||||
"ORDER BY a.add_time DESC")
|
||||
List<SignDTO> getSignList(@Param("uid") int uid, Page page);
|
||||
|
||||
@Select("SELECT o.order_id as orderId,FROM_UNIXTIME(b.add_time, '%Y-%m-%d %H:%i') as time," +
|
||||
"b.number,u.avatar,u.nickname FROM yx_user_bill b " +
|
||||
"INNER JOIN yx_store_order o ON o.id=b.link_id " +
|
||||
|
||||
@ -0,0 +1,47 @@
|
||||
package co.yixiang.modules.user.mapper;
|
||||
|
||||
import co.yixiang.modules.user.web.dto.UserLevelInfoDTO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import co.yixiang.modules.user.entity.YxUserLevel;
|
||||
import co.yixiang.modules.user.web.param.YxUserLevelQueryParam;
|
||||
import co.yixiang.modules.user.web.vo.YxUserLevelQueryVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户等级记录表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-12-06
|
||||
*/
|
||||
@Repository
|
||||
public interface YxUserLevelMapper extends BaseMapper<YxUserLevel> {
|
||||
|
||||
@Select("SELECT l.id,a.add_time as addTime,l.discount,a.level_id as levelId,l.name," +
|
||||
"l.icon,l.grade FROM yx_user_level a INNER JOIN yx_system_user_level l " +
|
||||
"ON l.id=a.level_id WHERE a.status = 1 AND a.is_del = 0 AND a.id = #{id} LIMIT 1")
|
||||
UserLevelInfoDTO getUserLevelInfo(int id);
|
||||
|
||||
/**
|
||||
* 根据ID获取查询对象
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
YxUserLevelQueryVo getYxUserLevelById(Serializable id);
|
||||
|
||||
/**
|
||||
* 获取分页对象
|
||||
* @param page
|
||||
* @param yxUserLevelQueryParam
|
||||
* @return
|
||||
*/
|
||||
IPage<YxUserLevelQueryVo> getYxUserLevelPageList(@Param("page") Page page, @Param("param") YxUserLevelQueryParam yxUserLevelQueryParam);
|
||||
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package co.yixiang.modules.user.mapper;
|
||||
|
||||
import co.yixiang.modules.user.entity.YxUserBill;
|
||||
import co.yixiang.modules.user.web.dto.BillDTO;
|
||||
import co.yixiang.modules.user.web.dto.SignDTO;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import co.yixiang.modules.user.entity.YxUserSign;
|
||||
import co.yixiang.modules.user.web.param.YxUserSignQueryParam;
|
||||
import co.yixiang.modules.user.web.vo.YxUserSignQueryVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 签到记录表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-12-05
|
||||
*/
|
||||
@Repository
|
||||
public interface YxUserSignMapper extends BaseMapper<YxUserSign> {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据ID获取查询对象
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
YxUserSignQueryVo getYxUserSignById(Serializable id);
|
||||
|
||||
/**
|
||||
* 获取分页对象
|
||||
* @param page
|
||||
* @param yxUserSignQueryParam
|
||||
* @return
|
||||
*/
|
||||
IPage<YxUserSignQueryVo> getYxUserSignPageList(@Param("page") Page page, @Param("param") YxUserSignQueryParam yxUserSignQueryParam);
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package co.yixiang.modules.user.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import co.yixiang.modules.user.entity.YxUserTaskFinish;
|
||||
import co.yixiang.modules.user.web.param.YxUserTaskFinishQueryParam;
|
||||
import co.yixiang.modules.user.web.vo.YxUserTaskFinishQueryVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户任务完成记录表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-12-07
|
||||
*/
|
||||
@Repository
|
||||
public interface YxUserTaskFinishMapper extends BaseMapper<YxUserTaskFinish> {
|
||||
|
||||
/**
|
||||
* 根据ID获取查询对象
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
YxUserTaskFinishQueryVo getYxUserTaskFinishById(Serializable id);
|
||||
|
||||
/**
|
||||
* 获取分页对象
|
||||
* @param page
|
||||
* @param yxUserTaskFinishQueryParam
|
||||
* @return
|
||||
*/
|
||||
IPage<YxUserTaskFinishQueryVo> getYxUserTaskFinishPageList(@Param("page") Page page, @Param("param") YxUserTaskFinishQueryParam yxUserTaskFinishQueryParam);
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package co.yixiang.modules.user.mapping;
|
||||
|
||||
import co.yixiang.mapper.EntityMapper;
|
||||
import co.yixiang.modules.user.entity.YxSystemUserLevel;
|
||||
import co.yixiang.modules.user.web.vo.YxSystemUserLevelQueryVo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2019-12-7
|
||||
*/
|
||||
@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface SystemUserLevelMap extends EntityMapper<YxSystemUserLevelQueryVo, YxSystemUserLevel> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package co.yixiang.modules.user.mapping;
|
||||
|
||||
import co.yixiang.mapper.EntityMapper;
|
||||
import co.yixiang.modules.user.entity.YxSystemUserTask;
|
||||
import co.yixiang.modules.user.web.vo.YxSystemUserTaskQueryVo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2019-12-7
|
||||
*/
|
||||
@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface SystemUserTaskMap extends EntityMapper<YxSystemUserTaskQueryVo, YxSystemUserTask> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
package co.yixiang.modules.user.service;
|
||||
|
||||
import co.yixiang.modules.user.entity.YxSystemUserLevel;
|
||||
import co.yixiang.common.service.BaseService;
|
||||
import co.yixiang.modules.user.web.dto.UserLevelDTO;
|
||||
import co.yixiang.modules.user.web.param.YxSystemUserLevelQueryParam;
|
||||
import co.yixiang.modules.user.web.vo.YxSystemUserLevelQueryVo;
|
||||
import co.yixiang.common.web.vo.Paging;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 设置用户等级表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-12-06
|
||||
*/
|
||||
public interface YxSystemUserLevelService extends BaseService<YxSystemUserLevel> {
|
||||
|
||||
int getNextLevelId(int levelId);
|
||||
|
||||
boolean getClear(int levelId);
|
||||
|
||||
List<YxSystemUserLevelQueryVo> getLevelListAndGrade(Integer levelId,boolean isTask);
|
||||
|
||||
UserLevelDTO getLevelInfo(int uid,boolean isTask);
|
||||
|
||||
/**
|
||||
* 根据ID获取查询对象
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
YxSystemUserLevelQueryVo getYxSystemUserLevelById(Serializable id);
|
||||
|
||||
/**
|
||||
* 获取分页对象
|
||||
* @param yxSystemUserLevelQueryParam
|
||||
* @return
|
||||
*/
|
||||
Paging<YxSystemUserLevelQueryVo> getYxSystemUserLevelPageList(YxSystemUserLevelQueryParam yxSystemUserLevelQueryParam) throws Exception;
|
||||
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package co.yixiang.modules.user.service;
|
||||
|
||||
import co.yixiang.modules.user.entity.YxSystemUserTask;
|
||||
import co.yixiang.common.service.BaseService;
|
||||
import co.yixiang.modules.user.web.dto.TaskDTO;
|
||||
import co.yixiang.modules.user.web.dto.UserLevelInfoDTO;
|
||||
import co.yixiang.modules.user.web.param.YxSystemUserTaskQueryParam;
|
||||
import co.yixiang.modules.user.web.vo.YxSystemUserTaskQueryVo;
|
||||
import co.yixiang.common.web.vo.Paging;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 等级任务设置 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-12-06
|
||||
*/
|
||||
public interface YxSystemUserTaskService extends BaseService<YxSystemUserTask> {
|
||||
|
||||
List<YxSystemUserTaskQueryVo> tidyTask(List<YxSystemUserTaskQueryVo> task,int uid);
|
||||
|
||||
int getTaskComplete(int levelId,int uid);
|
||||
|
||||
TaskDTO getTaskList(int levelId, int uid, UserLevelInfoDTO level);
|
||||
|
||||
/**
|
||||
* 根据ID获取查询对象
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
YxSystemUserTaskQueryVo getYxSystemUserTaskById(Serializable id) throws Exception;
|
||||
|
||||
/**
|
||||
* 获取分页对象
|
||||
* @param yxSystemUserTaskQueryParam
|
||||
* @return
|
||||
*/
|
||||
Paging<YxSystemUserTaskQueryVo> getYxSystemUserTaskPageList(YxSystemUserTaskQueryParam yxSystemUserTaskQueryParam) throws Exception;
|
||||
|
||||
}
|
||||
@ -22,6 +22,8 @@ import java.util.Map;
|
||||
*/
|
||||
public interface YxUserBillService extends BaseService<YxUserBill> {
|
||||
|
||||
int cumulativeAttendance(int uid);
|
||||
|
||||
Map<String,Object> spreadOrder(int uid,int page,int limit);
|
||||
|
||||
List<BillDTO> getUserBillList(int page, int limit, int uid, int type);
|
||||
|
||||
@ -0,0 +1,44 @@
|
||||
package co.yixiang.modules.user.service;
|
||||
|
||||
import co.yixiang.modules.user.entity.YxUserLevel;
|
||||
import co.yixiang.common.service.BaseService;
|
||||
import co.yixiang.modules.user.web.dto.UserLevelInfoDTO;
|
||||
import co.yixiang.modules.user.web.param.YxUserLevelQueryParam;
|
||||
import co.yixiang.modules.user.web.vo.YxUserLevelQueryVo;
|
||||
import co.yixiang.common.web.vo.Paging;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户等级记录表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-12-06
|
||||
*/
|
||||
public interface YxUserLevelService extends BaseService<YxUserLevel> {
|
||||
|
||||
void setUserLevel(int uid,int levelId);
|
||||
|
||||
void setLevelComplete(int uid);
|
||||
|
||||
UserLevelInfoDTO getUserLevelInfo(int id);
|
||||
|
||||
int getUserLevel(int uid,int grade);
|
||||
|
||||
/**
|
||||
* 根据ID获取查询对象
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
YxUserLevelQueryVo getYxUserLevelById(Serializable id) throws Exception;
|
||||
|
||||
/**
|
||||
* 获取分页对象
|
||||
* @param yxUserLevelQueryParam
|
||||
* @return
|
||||
*/
|
||||
Paging<YxUserLevelQueryVo> getYxUserLevelPageList(YxUserLevelQueryParam yxUserLevelQueryParam) throws Exception;
|
||||
|
||||
}
|
||||
@ -23,6 +23,8 @@ import java.util.List;
|
||||
*/
|
||||
public interface YxUserService extends BaseService<YxUser> {
|
||||
|
||||
double setLevelPrice(double price, int uid);
|
||||
|
||||
void incMoney(int uid,double price);
|
||||
|
||||
void incIntegral(int uid,double integral);
|
||||
|
||||
@ -0,0 +1,47 @@
|
||||
package co.yixiang.modules.user.service;
|
||||
|
||||
import co.yixiang.modules.user.entity.YxUserSign;
|
||||
import co.yixiang.common.service.BaseService;
|
||||
import co.yixiang.modules.user.web.dto.SignDTO;
|
||||
import co.yixiang.modules.user.web.param.YxUserSignQueryParam;
|
||||
import co.yixiang.modules.user.web.vo.YxUserSignQueryVo;
|
||||
import co.yixiang.common.web.vo.Paging;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 签到记录表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-12-05
|
||||
*/
|
||||
public interface YxUserSignService extends BaseService<YxUserSign> {
|
||||
|
||||
int sign(int uid);
|
||||
|
||||
List<SignDTO> getSignList(int uid,int page,int limit);
|
||||
|
||||
boolean getYesterDayIsSign(int uid);
|
||||
|
||||
boolean getToDayIsSign(int uid);
|
||||
|
||||
int getSignSumDay(int uid);
|
||||
|
||||
/**
|
||||
* 根据ID获取查询对象
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
YxUserSignQueryVo getYxUserSignById(Serializable id) throws Exception;
|
||||
|
||||
/**
|
||||
* 获取分页对象
|
||||
* @param yxUserSignQueryParam
|
||||
* @return
|
||||
*/
|
||||
Paging<YxUserSignQueryVo> getYxUserSignPageList(YxUserSignQueryParam yxUserSignQueryParam) throws Exception;
|
||||
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package co.yixiang.modules.user.service;
|
||||
|
||||
import co.yixiang.modules.user.entity.YxUserTaskFinish;
|
||||
import co.yixiang.common.service.BaseService;
|
||||
import co.yixiang.modules.user.web.param.YxUserTaskFinishQueryParam;
|
||||
import co.yixiang.modules.user.web.vo.YxUserTaskFinishQueryVo;
|
||||
import co.yixiang.common.web.vo.Paging;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户任务完成记录表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-12-07
|
||||
*/
|
||||
public interface YxUserTaskFinishService extends BaseService<YxUserTaskFinish> {
|
||||
|
||||
void setFinish(int uid,int taskId);
|
||||
|
||||
/**
|
||||
* 根据ID获取查询对象
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
YxUserTaskFinishQueryVo getYxUserTaskFinishById(Serializable id) throws Exception;
|
||||
|
||||
/**
|
||||
* 获取分页对象
|
||||
* @param yxUserTaskFinishQueryParam
|
||||
* @return
|
||||
*/
|
||||
Paging<YxUserTaskFinishQueryVo> getYxUserTaskFinishPageList(YxUserTaskFinishQueryParam yxUserTaskFinishQueryParam) throws Exception;
|
||||
|
||||
}
|
||||
@ -0,0 +1,156 @@
|
||||
package co.yixiang.modules.user.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import co.yixiang.modules.user.entity.YxSystemUserLevel;
|
||||
import co.yixiang.modules.user.mapper.YxSystemUserLevelMapper;
|
||||
import co.yixiang.modules.user.mapping.SystemUserLevelMap;
|
||||
import co.yixiang.modules.user.service.YxSystemUserLevelService;
|
||||
import co.yixiang.modules.user.service.YxSystemUserTaskService;
|
||||
import co.yixiang.modules.user.service.YxUserLevelService;
|
||||
import co.yixiang.modules.user.web.dto.TaskDTO;
|
||||
import co.yixiang.modules.user.web.dto.UserLevelDTO;
|
||||
import co.yixiang.modules.user.web.dto.UserLevelInfoDTO;
|
||||
import co.yixiang.modules.user.web.param.YxSystemUserLevelQueryParam;
|
||||
import co.yixiang.modules.user.web.vo.YxSystemUserLevelQueryVo;
|
||||
import co.yixiang.common.service.impl.BaseServiceImpl;
|
||||
import co.yixiang.common.web.vo.Paging;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 设置用户等级表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-12-06
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class YxSystemUserLevelServiceImpl extends BaseServiceImpl<YxSystemUserLevelMapper, YxSystemUserLevel> implements YxSystemUserLevelService {
|
||||
|
||||
@Autowired
|
||||
private YxSystemUserLevelMapper yxSystemUserLevelMapper;
|
||||
|
||||
@Autowired
|
||||
private YxUserLevelService userLevelService;
|
||||
|
||||
@Autowired
|
||||
private SystemUserLevelMap systemUserLevelMap;
|
||||
|
||||
@Autowired
|
||||
private YxSystemUserTaskService systemUserTaskService;
|
||||
|
||||
/**
|
||||
* 获取当前的下一个会员id
|
||||
* @param levelId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int getNextLevelId(int levelId) {
|
||||
QueryWrapper<YxSystemUserLevel> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("is_del",0).eq("is_show",1).orderByAsc("grade");
|
||||
List<YxSystemUserLevel> list = yxSystemUserLevelMapper.selectList(wrapper);
|
||||
int grade = 0;
|
||||
for (YxSystemUserLevel userLevel : list) {
|
||||
if(userLevel.getId() == levelId) grade = userLevel.getGrade();
|
||||
}
|
||||
|
||||
QueryWrapper<YxSystemUserLevel> wrapperT = new QueryWrapper<>();
|
||||
wrapperT.eq("is_del",0).eq("is_show",1).orderByAsc("grade")
|
||||
.gt("grade",grade).last("limit 1");
|
||||
YxSystemUserLevel userLevel = yxSystemUserLevelMapper.selectOne(wrapperT);
|
||||
if(ObjectUtil.isNull(userLevel)) return 0;
|
||||
return userLevel.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getClear(int levelId) {
|
||||
List<YxSystemUserLevelQueryVo> systemUserLevelQueryVos = getLevelListAndGrade(
|
||||
levelId,false);
|
||||
for (YxSystemUserLevelQueryVo userLevelQueryVo : systemUserLevelQueryVos) {
|
||||
if(userLevelQueryVo.getId() == levelId) return userLevelQueryVo.getIsClear();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取会员等级列表
|
||||
* @param levelId
|
||||
* @param isTask
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<YxSystemUserLevelQueryVo> getLevelListAndGrade(Integer levelId, boolean isTask) {
|
||||
int grade = 0;
|
||||
|
||||
// QueryWrapper<YxSystemUserLevel> wrapper = new QueryWrapper<>();
|
||||
// wrapper.eq("is_del",0).eq("is_show",1).orderByAsc("grade").last("LIMIT 1");
|
||||
|
||||
// if(levelId == 0){
|
||||
// //levelId = yxSystemUserLevelMapper.selectOne(wrapper).getId();
|
||||
// }else{
|
||||
// levelId = 0;
|
||||
// }
|
||||
|
||||
QueryWrapper<YxSystemUserLevel> wrapperT = new QueryWrapper<>();
|
||||
wrapperT.eq("is_del",0).eq("is_show",1).orderByAsc("grade");
|
||||
List<YxSystemUserLevel> list = yxSystemUserLevelMapper.selectList(wrapperT);
|
||||
List<YxSystemUserLevelQueryVo> newList = systemUserLevelMap.toDto(list);
|
||||
for (YxSystemUserLevelQueryVo userLevelQueryVo : newList) {
|
||||
if(userLevelQueryVo.getId() == levelId) grade = userLevelQueryVo.getGrade();
|
||||
|
||||
if(grade < userLevelQueryVo.getGrade()){
|
||||
userLevelQueryVo.setIsClear(true);
|
||||
}else{
|
||||
userLevelQueryVo.setIsClear(false);//开启会员解锁
|
||||
}
|
||||
}
|
||||
return newList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取会员等级列表
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public UserLevelDTO getLevelInfo(int uid,boolean isTask) {
|
||||
int id = userLevelService.getUserLevel(uid,0); //用户当前等级id
|
||||
UserLevelInfoDTO userLevelInfoDTO = null;
|
||||
if(id > 0) userLevelInfoDTO = userLevelService.getUserLevelInfo(id);
|
||||
int levelId = 0;
|
||||
if(ObjectUtil.isNotNull(userLevelInfoDTO)) levelId = userLevelInfoDTO.getId();
|
||||
List<YxSystemUserLevelQueryVo> list = getLevelListAndGrade(levelId,false);
|
||||
TaskDTO taskDTO = systemUserTaskService.getTaskList(list.get(0).getId(),uid,null);
|
||||
|
||||
UserLevelDTO userLevelDTO = new UserLevelDTO();
|
||||
userLevelDTO.setList(list);
|
||||
userLevelDTO.setTask(taskDTO);
|
||||
|
||||
return userLevelDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public YxSystemUserLevelQueryVo getYxSystemUserLevelById(Serializable id){
|
||||
return yxSystemUserLevelMapper.getYxSystemUserLevelById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Paging<YxSystemUserLevelQueryVo> getYxSystemUserLevelPageList(YxSystemUserLevelQueryParam yxSystemUserLevelQueryParam) throws Exception{
|
||||
Page page = setPageParam(yxSystemUserLevelQueryParam,OrderItem.desc("create_time"));
|
||||
IPage<YxSystemUserLevelQueryVo> iPage = yxSystemUserLevelMapper.getYxSystemUserLevelPageList(page,yxSystemUserLevelQueryParam);
|
||||
return new Paging(iPage);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,185 @@
|
||||
package co.yixiang.modules.user.service.impl;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import co.yixiang.modules.order.mapper.YxStoreOrderMapper;
|
||||
import co.yixiang.modules.user.entity.YxSystemUserTask;
|
||||
import co.yixiang.modules.user.entity.YxUserTaskFinish;
|
||||
import co.yixiang.modules.user.mapper.YxSystemUserTaskMapper;
|
||||
import co.yixiang.modules.user.mapper.YxUserBillMapper;
|
||||
import co.yixiang.modules.user.mapper.YxUserTaskFinishMapper;
|
||||
import co.yixiang.modules.user.mapping.SystemUserTaskMap;
|
||||
import co.yixiang.modules.user.service.YxSystemUserLevelService;
|
||||
import co.yixiang.modules.user.service.YxSystemUserTaskService;
|
||||
import co.yixiang.modules.user.service.YxUserBillService;
|
||||
import co.yixiang.modules.user.service.YxUserTaskFinishService;
|
||||
import co.yixiang.modules.user.web.dto.TaskDTO;
|
||||
import co.yixiang.modules.user.web.dto.UserLevelInfoDTO;
|
||||
import co.yixiang.modules.user.web.param.YxSystemUserTaskQueryParam;
|
||||
import co.yixiang.modules.user.web.vo.YxSystemUserTaskQueryVo;
|
||||
import co.yixiang.common.service.impl.BaseServiceImpl;
|
||||
import co.yixiang.common.web.vo.Paging;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import java.io.Serializable;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 等级任务设置 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-12-06
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class YxSystemUserTaskServiceImpl extends BaseServiceImpl<YxSystemUserTaskMapper, YxSystemUserTask> implements YxSystemUserTaskService {
|
||||
|
||||
@Autowired
|
||||
private YxSystemUserTaskMapper yxSystemUserTaskMapper;
|
||||
|
||||
@Autowired
|
||||
private SystemUserTaskMap systemUserTaskMap;
|
||||
|
||||
@Autowired
|
||||
private YxSystemUserLevelService systemUserLevelService;
|
||||
|
||||
@Autowired
|
||||
private YxUserTaskFinishMapper yxUserTaskFinishMapper;
|
||||
|
||||
@Autowired
|
||||
private YxUserBillMapper userBillMapper;
|
||||
|
||||
@Autowired
|
||||
private YxStoreOrderMapper storeOrderMapper;
|
||||
|
||||
@Autowired
|
||||
private YxUserTaskFinishService userTaskFinishService;
|
||||
|
||||
@Autowired
|
||||
private YxUserBillService userBillService;
|
||||
|
||||
/**
|
||||
* 设置任务内容完成情况
|
||||
* @param task
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<YxSystemUserTaskQueryVo> tidyTask(List<YxSystemUserTaskQueryVo> task,int uid) {
|
||||
QueryWrapper<YxUserTaskFinish> wrapper = new QueryWrapper<>();
|
||||
for (YxSystemUserTaskQueryVo taskQueryVo : task) {
|
||||
wrapper.in("task_id",taskQueryVo.getId()).eq("uid",uid);
|
||||
int count = yxUserTaskFinishMapper.selectCount(wrapper);
|
||||
if(count > 0){
|
||||
taskQueryVo.setNewNumber(taskQueryVo.getNumber());
|
||||
taskQueryVo.setSpeed(100);
|
||||
taskQueryVo.setFinish(1);
|
||||
taskQueryVo.setTaskTypeTitle("");
|
||||
}else{
|
||||
double sumNumber = 0d;
|
||||
String title = "";
|
||||
switch (taskQueryVo.getTaskType()){
|
||||
case "SatisfactionIntegral":
|
||||
sumNumber = userBillMapper.sumIntegral(uid);
|
||||
title = "还需要{0}经验";
|
||||
break;
|
||||
case "ConsumptionAmount":
|
||||
sumNumber = storeOrderMapper.sumPrice(uid);
|
||||
title = "还需消费{0}元";
|
||||
break;
|
||||
case "CumulativeAttendance":
|
||||
sumNumber = userBillService.cumulativeAttendance(uid);
|
||||
title = "还需签到{0}天";
|
||||
break;
|
||||
}
|
||||
|
||||
//System.out.println("sumNumber:"+sumNumber);
|
||||
//System.out.println("sumNumber2:"+taskQueryVo.getNumber());
|
||||
if(sumNumber >= taskQueryVo.getNumber()){
|
||||
userTaskFinishService.setFinish(uid,taskQueryVo.getId());
|
||||
taskQueryVo.setFinish(1);
|
||||
taskQueryVo.setSpeed(100);
|
||||
taskQueryVo.setTaskTypeTitle("");
|
||||
taskQueryVo.setNewNumber(taskQueryVo.getNumber());
|
||||
}else{
|
||||
double numdata = NumberUtil.sub(taskQueryVo.getNumber().doubleValue(),sumNumber);
|
||||
taskQueryVo.setTaskTypeTitle(MessageFormat.format(title,numdata));
|
||||
double speed = NumberUtil.div(sumNumber,taskQueryVo.getNumber().doubleValue());
|
||||
taskQueryVo.setSpeed(Double.valueOf(NumberUtil.mul(speed,100)).intValue());
|
||||
taskQueryVo.setFinish(0);
|
||||
taskQueryVo.setNewNumber(Double.valueOf(sumNumber).intValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return task;
|
||||
}
|
||||
|
||||
/**
|
||||
* 后去已经完成的任务数量
|
||||
* @param levelId
|
||||
* @param uid
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int getTaskComplete(int levelId, int uid) {
|
||||
QueryWrapper<YxSystemUserTask> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("level_id",levelId).eq("is_show",1);
|
||||
List<YxSystemUserTask> list = yxSystemUserTaskMapper.selectList(wrapper);
|
||||
List<Integer> taskIds = list.stream().map(YxSystemUserTask::getId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
QueryWrapper<YxUserTaskFinish> wrapperT = new QueryWrapper<>();
|
||||
wrapperT.in("task_id",taskIds).eq("uid",uid);
|
||||
int count = yxUserTaskFinishMapper.selectCount(wrapperT);
|
||||
//System.out.println("count:"+count);
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取等级会员任务列表
|
||||
* @param levelId
|
||||
* @param uid
|
||||
* @param level
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public TaskDTO getTaskList(int levelId, int uid, UserLevelInfoDTO level) {
|
||||
QueryWrapper<YxSystemUserTask> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("level_id",levelId).eq("is_show",1)
|
||||
.orderByDesc("sort");
|
||||
List<YxSystemUserTaskQueryVo> list = systemUserTaskMap.toDto(yxSystemUserTaskMapper
|
||||
.selectList(wrapper));
|
||||
|
||||
TaskDTO taskDTO = new TaskDTO();
|
||||
taskDTO.setList(list);
|
||||
taskDTO.setReachCount(getTaskComplete(levelId,uid));
|
||||
taskDTO.setTask(tidyTask(list,uid));
|
||||
|
||||
return taskDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public YxSystemUserTaskQueryVo getYxSystemUserTaskById(Serializable id) throws Exception{
|
||||
return yxSystemUserTaskMapper.getYxSystemUserTaskById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Paging<YxSystemUserTaskQueryVo> getYxSystemUserTaskPageList(YxSystemUserTaskQueryParam yxSystemUserTaskQueryParam) throws Exception{
|
||||
Page page = setPageParam(yxSystemUserTaskQueryParam,OrderItem.desc("create_time"));
|
||||
IPage<YxSystemUserTaskQueryVo> iPage = yxSystemUserTaskMapper.getYxSystemUserTaskPageList(page,yxSystemUserTaskQueryParam);
|
||||
return new Paging(iPage);
|
||||
}
|
||||
|
||||
}
|
||||
@ -46,6 +46,20 @@ public class YxUserBillServiceImpl extends BaseServiceImpl<YxUserBillMapper, YxU
|
||||
@Autowired
|
||||
private BiillMap biillMap;
|
||||
|
||||
|
||||
/**
|
||||
* 签到了多少次
|
||||
* @param uid
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int cumulativeAttendance(int uid) {
|
||||
QueryWrapper<YxUserBill> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("uid",uid).eq("category","integral")
|
||||
.eq("type","sign").eq("pm",1);
|
||||
return yxUserBillMapper.selectCount(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> spreadOrder(int uid, int page, int limit) {
|
||||
QueryWrapper<YxUserBill> wrapper = new QueryWrapper<>();
|
||||
@ -83,25 +97,33 @@ public class YxUserBillServiceImpl extends BaseServiceImpl<YxUserBillMapper, YxU
|
||||
@Override
|
||||
public List<BillDTO> getUserBillList(int page, int limit, int uid, int type) {
|
||||
QueryWrapper<YxUserBill> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("category","now_money").eq("uid",uid).
|
||||
orderByDesc("add_time").groupBy("time");
|
||||
wrapper.eq("uid",uid).orderByDesc("add_time").groupBy("time");
|
||||
switch (type){
|
||||
case 0:
|
||||
wrapper.eq("category","now_money");
|
||||
String str = "recharge,brokerage,pay_product,system_add,pay_product_refund,system_sub";
|
||||
wrapper.in("type",str.split(","));
|
||||
break;
|
||||
case 1:
|
||||
wrapper.eq("category","now_money");
|
||||
wrapper.eq("type","pay_product");
|
||||
break;
|
||||
case 2:
|
||||
wrapper.eq("category","now_money");
|
||||
wrapper.eq("type","recharge");
|
||||
break;
|
||||
case 3:
|
||||
wrapper.eq("category","now_money");
|
||||
wrapper.eq("type","brokerage");
|
||||
break;
|
||||
case 4:
|
||||
wrapper.eq("category","now_money");
|
||||
wrapper.eq("type","extract");
|
||||
break;
|
||||
case 5:
|
||||
wrapper.eq("category","integral");
|
||||
wrapper.eq("type","sign");
|
||||
break;
|
||||
}
|
||||
Page<YxUserBill> pageModel = new Page<>(page, limit);
|
||||
List<BillDTO> billDTOList = yxUserBillMapper.getBillList(wrapper,pageModel);
|
||||
|
||||
@ -0,0 +1,180 @@
|
||||
package co.yixiang.modules.user.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import co.yixiang.exception.ErrorRequestException;
|
||||
import co.yixiang.modules.user.entity.YxSystemUserTask;
|
||||
import co.yixiang.modules.user.entity.YxUser;
|
||||
import co.yixiang.modules.user.entity.YxUserLevel;
|
||||
import co.yixiang.modules.user.mapper.YxSystemUserTaskMapper;
|
||||
import co.yixiang.modules.user.mapper.YxUserLevelMapper;
|
||||
import co.yixiang.modules.user.service.YxSystemUserLevelService;
|
||||
import co.yixiang.modules.user.service.YxSystemUserTaskService;
|
||||
import co.yixiang.modules.user.service.YxUserLevelService;
|
||||
import co.yixiang.modules.user.service.YxUserService;
|
||||
import co.yixiang.modules.user.web.dto.UserLevelInfoDTO;
|
||||
import co.yixiang.modules.user.web.param.YxUserLevelQueryParam;
|
||||
import co.yixiang.modules.user.web.vo.YxSystemUserLevelQueryVo;
|
||||
import co.yixiang.modules.user.web.vo.YxUserLevelQueryVo;
|
||||
import co.yixiang.common.service.impl.BaseServiceImpl;
|
||||
import co.yixiang.common.web.vo.Paging;
|
||||
import co.yixiang.modules.user.web.vo.YxUserQueryVo;
|
||||
import co.yixiang.utils.OrderUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户等级记录表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-12-06
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class YxUserLevelServiceImpl extends BaseServiceImpl<YxUserLevelMapper, YxUserLevel> implements YxUserLevelService {
|
||||
|
||||
@Autowired
|
||||
private YxUserLevelMapper yxUserLevelMapper;
|
||||
|
||||
@Autowired
|
||||
private YxUserService userService;
|
||||
|
||||
@Autowired
|
||||
private YxSystemUserLevelService systemUserLevelService;
|
||||
|
||||
@Autowired
|
||||
private YxSystemUserTaskMapper yxSystemUserTaskMapper;
|
||||
|
||||
@Autowired
|
||||
private YxSystemUserTaskService systemUserTaskService;
|
||||
|
||||
/**
|
||||
* 设置会员等级
|
||||
* @param uid
|
||||
* @param levelId
|
||||
*/
|
||||
@Override
|
||||
public void setUserLevel(int uid, int levelId){
|
||||
YxSystemUserLevelQueryVo systemUserLevelQueryVo = systemUserLevelService
|
||||
.getYxSystemUserLevelById(levelId);
|
||||
if(ObjectUtil.isNull(systemUserLevelQueryVo)) return;
|
||||
|
||||
int validTime = systemUserLevelQueryVo.getValidDate() * 86400;
|
||||
|
||||
QueryWrapper<YxUserLevel> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("is_del",0).eq("status",1).eq("uid",uid)
|
||||
.eq("level_id",levelId).last("limit 1");
|
||||
YxUserLevel userLevel = yxUserLevelMapper.selectOne(wrapper);
|
||||
if(ObjectUtil.isNotNull(userLevel)){
|
||||
//todo
|
||||
}else{
|
||||
YxUserLevel yxUserLevel = new YxUserLevel();
|
||||
yxUserLevel.setIsForever(systemUserLevelQueryVo.getIsForever());
|
||||
yxUserLevel.setStatus(1);
|
||||
yxUserLevel.setIsDel(0);
|
||||
yxUserLevel.setGrade(systemUserLevelQueryVo.getGrade());
|
||||
yxUserLevel.setUid(uid);
|
||||
yxUserLevel.setAddTime(OrderUtil.getSecondTimestampTwo());
|
||||
yxUserLevel.setLevelId(levelId);
|
||||
yxUserLevel.setDiscount(systemUserLevelQueryVo.getDiscount().intValue());
|
||||
|
||||
if(systemUserLevelQueryVo.getIsForever() == 1){
|
||||
yxUserLevel.setValidTime(0);
|
||||
}else{
|
||||
yxUserLevel.setValidTime(validTime+OrderUtil.getSecondTimestampTwo());
|
||||
}
|
||||
|
||||
yxUserLevel.setMark("恭喜你成为了"+systemUserLevelQueryVo.getName());
|
||||
yxUserLevelMapper.insert(yxUserLevel);
|
||||
|
||||
YxUser yxUser = new YxUser();
|
||||
yxUser.setLevel(levelId);
|
||||
yxUser.setUid(uid);
|
||||
userService.updateById(yxUser);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否能成为会员
|
||||
* @param uid
|
||||
*/
|
||||
@Override
|
||||
public void setLevelComplete(int uid) {
|
||||
YxUserQueryVo userQueryVo = userService.getYxUserById(uid);
|
||||
if(ObjectUtil.isNull(userQueryVo)) return;
|
||||
|
||||
int levelId = getUserLevel(uid,9);
|
||||
|
||||
int nextLevelId = systemUserLevelService.getNextLevelId(levelId);
|
||||
if(nextLevelId == 0) return;
|
||||
|
||||
//QueryWrapper<YxSystemUserTask> wrapper = new QueryWrapper<>();
|
||||
//wrapper.eq("level_id",nextLevelId).eq("is_show",1);
|
||||
// List<YxSystemUserTask> taskList = yxSystemUserTaskMapper.selectList(wrapper);
|
||||
|
||||
int finishCount = systemUserTaskService.getTaskComplete(nextLevelId,uid);
|
||||
if(finishCount == 3){
|
||||
setUserLevel(uid,nextLevelId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserLevelInfoDTO getUserLevelInfo(int id) {
|
||||
return yxUserLevelMapper.getUserLevelInfo(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户会员等级返回当前用户等级id
|
||||
* @param uid
|
||||
* @param grade
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int getUserLevel(int uid, int grade) {
|
||||
QueryWrapper<YxUserLevel> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("is_del",0).eq("status",1)
|
||||
.eq("uid",uid).orderByDesc("grade");
|
||||
if(grade > 0) wrapper.lt("grade",grade);
|
||||
YxUserLevel userLevel = yxUserLevelMapper.selectOne(wrapper);
|
||||
if(ObjectUtil.isNull(userLevel)) return 0;
|
||||
if(userLevel.getIsForever() == 1) return userLevel.getId();
|
||||
int nowTime = OrderUtil.getSecondTimestampTwo();
|
||||
if(nowTime > userLevel.getValidTime()){
|
||||
if(userLevel.getStatus() == 1){
|
||||
userLevel.setStatus(0);
|
||||
yxUserLevelMapper.updateById(userLevel);
|
||||
}
|
||||
|
||||
return getUserLevel(uid,userLevel.getGrade());
|
||||
}
|
||||
return userLevel.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public YxUserLevelQueryVo getYxUserLevelById(Serializable id) throws Exception{
|
||||
return yxUserLevelMapper.getYxUserLevelById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Paging<YxUserLevelQueryVo> getYxUserLevelPageList(YxUserLevelQueryParam yxUserLevelQueryParam) throws Exception{
|
||||
Page page = setPageParam(yxUserLevelQueryParam,OrderItem.desc("create_time"));
|
||||
IPage<YxUserLevelQueryVo> iPage = yxUserLevelMapper.getYxUserLevelPageList(page,yxUserLevelQueryParam);
|
||||
return new Paging(iPage);
|
||||
}
|
||||
|
||||
}
|
||||
@ -9,8 +9,11 @@ import co.yixiang.modules.order.web.vo.YxStoreOrderQueryVo;
|
||||
import co.yixiang.modules.shop.service.YxSystemConfigService;
|
||||
import co.yixiang.modules.user.entity.YxUser;
|
||||
import co.yixiang.modules.user.entity.YxUserBill;
|
||||
import co.yixiang.modules.user.entity.YxUserLevel;
|
||||
import co.yixiang.modules.user.mapper.YxUserMapper;
|
||||
import co.yixiang.modules.user.service.YxSystemUserLevelService;
|
||||
import co.yixiang.modules.user.service.YxUserBillService;
|
||||
import co.yixiang.modules.user.service.YxUserLevelService;
|
||||
import co.yixiang.modules.user.service.YxUserService;
|
||||
import co.yixiang.modules.user.web.dto.PromUserDTO;
|
||||
import co.yixiang.modules.user.web.dto.UserRankDTO;
|
||||
@ -61,6 +64,27 @@ public class YxUserServiceImpl extends BaseServiceImpl<YxUserMapper, YxUser> imp
|
||||
@Autowired
|
||||
private YxUserBillService billService;
|
||||
|
||||
@Autowired
|
||||
private YxUserLevelService userLevelService;
|
||||
|
||||
/**
|
||||
* 返回会员价
|
||||
* @param price
|
||||
* @param uid
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public double setLevelPrice(double price, int uid) {
|
||||
QueryWrapper<YxUserLevel> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("is_del",0).eq("status",1)
|
||||
.eq("uid",uid).orderByDesc("grade").last("limit 1");
|
||||
YxUserLevel userLevel = userLevelService.getOne(wrapper);
|
||||
int discount = 100;
|
||||
if(ObjectUtil.isNotNull(userLevel)) discount = userLevel.getDiscount();
|
||||
return NumberUtil.mul(NumberUtil.div(discount,100),price);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 更新用户余额
|
||||
@ -399,6 +423,8 @@ public class YxUserServiceImpl extends BaseServiceImpl<YxUserMapper, YxUser> imp
|
||||
}else{
|
||||
userQueryVo.setStatu(0);
|
||||
}
|
||||
//todo 测试环境设置所有人是管理员,生成环境记得去掉
|
||||
userQueryVo.setAdminid(1);
|
||||
return userQueryVo;
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,210 @@
|
||||
package co.yixiang.modules.user.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import co.yixiang.exception.ErrorRequestException;
|
||||
import co.yixiang.modules.shop.service.YxSystemGroupDataService;
|
||||
import co.yixiang.modules.user.entity.YxUser;
|
||||
import co.yixiang.modules.user.entity.YxUserBill;
|
||||
import co.yixiang.modules.user.entity.YxUserSign;
|
||||
import co.yixiang.modules.user.mapper.YxUserBillMapper;
|
||||
import co.yixiang.modules.user.mapper.YxUserSignMapper;
|
||||
import co.yixiang.modules.user.service.YxUserBillService;
|
||||
import co.yixiang.modules.user.service.YxUserService;
|
||||
import co.yixiang.modules.user.service.YxUserSignService;
|
||||
import co.yixiang.modules.user.web.dto.SignDTO;
|
||||
import co.yixiang.modules.user.web.param.YxUserSignQueryParam;
|
||||
import co.yixiang.modules.user.web.vo.YxUserQueryVo;
|
||||
import co.yixiang.modules.user.web.vo.YxUserSignQueryVo;
|
||||
import co.yixiang.common.service.impl.BaseServiceImpl;
|
||||
import co.yixiang.common.web.vo.Paging;
|
||||
import co.yixiang.utils.OrderUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 签到记录表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-12-05
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class YxUserSignServiceImpl extends BaseServiceImpl<YxUserSignMapper, YxUserSign> implements YxUserSignService {
|
||||
|
||||
@Autowired
|
||||
private YxUserSignMapper yxUserSignMapper;
|
||||
|
||||
@Autowired
|
||||
private YxSystemGroupDataService systemGroupDataService;
|
||||
|
||||
@Autowired
|
||||
private YxUserService yxUserService;
|
||||
|
||||
@Autowired
|
||||
private YxUserBillService billService;
|
||||
|
||||
@Autowired
|
||||
private YxUserBillMapper userBillMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 用户签到
|
||||
* @param uid
|
||||
*/
|
||||
@Override
|
||||
public int sign(int uid) {
|
||||
List<Map<String,Object>> list = systemGroupDataService.getDatas("sign_day_num");
|
||||
if(ObjectUtil.isNull(list)) throw new ErrorRequestException("请先配置签到天数");
|
||||
|
||||
YxUserQueryVo userQueryVo = yxUserService.getYxUserById(uid);
|
||||
int signNumber = 0; //积分
|
||||
int userSignNum = userQueryVo.getSignNum(); //签到次数
|
||||
if(getYesterDayIsSign(uid)){
|
||||
if(userQueryVo.getSignNum() > (list.size() - 1)){
|
||||
userSignNum = 0;
|
||||
}
|
||||
}else{
|
||||
userSignNum = 0;
|
||||
}
|
||||
int index = 0;
|
||||
for (Map<String,Object> map : list) {
|
||||
if(index == userSignNum){
|
||||
signNumber = Integer.valueOf(map.get("sign_num").toString());
|
||||
break;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
|
||||
userSignNum += 1;
|
||||
|
||||
YxUserSign userSign = new YxUserSign();
|
||||
userSign.setUid(uid);
|
||||
String title = "签到奖励";
|
||||
if(userSignNum == list.size()){
|
||||
title = "连续签到奖励";
|
||||
}
|
||||
userSign.setTitle(title);
|
||||
userSign.setNumber(signNumber);
|
||||
userSign.setBalance(userQueryVo.getIntegral().intValueExact());
|
||||
userSign.setAddTime(OrderUtil.getSecondTimestampTwo());
|
||||
yxUserSignMapper.insert(userSign);
|
||||
|
||||
//用户积分增加
|
||||
YxUser yxUser = new YxUser();
|
||||
yxUser.setIntegral(NumberUtil.add(userQueryVo.getIntegral(),signNumber));
|
||||
yxUser.setUid(uid);
|
||||
yxUser.setSignNum(userSignNum);
|
||||
yxUserService.updateById(yxUser);
|
||||
|
||||
//插入流水
|
||||
YxUserBill userBill = new YxUserBill();
|
||||
userBill.setUid(uid);
|
||||
userBill.setTitle(title);
|
||||
userBill.setLinkId("0");
|
||||
userBill.setCategory("integral");
|
||||
userBill.setType("sign");
|
||||
userBill.setNumber(BigDecimal.valueOf(signNumber));
|
||||
userBill.setBalance(userQueryVo.getIntegral());
|
||||
userBill.setMark("");
|
||||
userBill.setStatus(1);
|
||||
userBill.setPm(1);
|
||||
userBill.setAddTime(OrderUtil.getSecondTimestampTwo());
|
||||
billService.save(userBill);
|
||||
|
||||
return signNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页获取用户签到数据
|
||||
* @param uid
|
||||
* @param page
|
||||
* @param limit
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SignDTO> getSignList(int uid, int page, int limit) {
|
||||
Page<YxUserBill> pageModel = new Page<>(page, limit);
|
||||
return userBillMapper.getSignList(uid,pageModel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户昨天是否签到
|
||||
* @param uid
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean getYesterDayIsSign(int uid) {
|
||||
int today = OrderUtil.dateToTimestampT(DateUtil.beginOfDay(new Date()));
|
||||
int yesterday = OrderUtil.dateToTimestampT(DateUtil.beginOfDay(DateUtil.
|
||||
yesterday()));
|
||||
|
||||
QueryWrapper<YxUserSign> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("uid",uid).lt("add_time",today).ge("add_time",yesterday);
|
||||
int count = yxUserSignMapper.selectCount(wrapper);
|
||||
if(count > 0) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户今天是否签到
|
||||
* @param uid
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean getToDayIsSign(int uid) {
|
||||
int today = OrderUtil.dateToTimestampT(DateUtil.beginOfDay(new Date()));
|
||||
int yesterday = OrderUtil.dateToTimestampT(DateUtil.beginOfDay(DateUtil.
|
||||
yesterday()));
|
||||
|
||||
QueryWrapper<YxUserSign> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("uid",uid).ge("add_time",today);
|
||||
int count = yxUserSignMapper.selectCount(wrapper);
|
||||
if(count > 0) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户累计签到次数
|
||||
* @param uid
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int getSignSumDay(int uid) {
|
||||
QueryWrapper<YxUserSign> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("uid",uid);
|
||||
int count = yxUserSignMapper.selectCount(wrapper);
|
||||
return count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public YxUserSignQueryVo getYxUserSignById(Serializable id) throws Exception{
|
||||
return yxUserSignMapper.getYxUserSignById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Paging<YxUserSignQueryVo> getYxUserSignPageList(YxUserSignQueryParam yxUserSignQueryParam) throws Exception{
|
||||
Page page = setPageParam(yxUserSignQueryParam,OrderItem.desc("create_time"));
|
||||
IPage<YxUserSignQueryVo> iPage = yxUserSignMapper.getYxUserSignPageList(page,yxUserSignQueryParam);
|
||||
return new Paging(iPage);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,74 @@
|
||||
package co.yixiang.modules.user.service.impl;
|
||||
|
||||
import co.yixiang.modules.user.entity.YxUserTaskFinish;
|
||||
import co.yixiang.modules.user.mapper.YxUserTaskFinishMapper;
|
||||
import co.yixiang.modules.user.service.YxUserTaskFinishService;
|
||||
import co.yixiang.modules.user.web.param.YxUserTaskFinishQueryParam;
|
||||
import co.yixiang.modules.user.web.vo.YxUserTaskFinishQueryVo;
|
||||
import co.yixiang.common.service.impl.BaseServiceImpl;
|
||||
import co.yixiang.common.web.vo.Paging;
|
||||
import co.yixiang.utils.OrderUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户任务完成记录表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-12-07
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class YxUserTaskFinishServiceImpl extends BaseServiceImpl<YxUserTaskFinishMapper, YxUserTaskFinish> implements YxUserTaskFinishService {
|
||||
|
||||
@Autowired
|
||||
private YxUserTaskFinishMapper yxUserTaskFinishMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 设置任务完成
|
||||
* @param uid
|
||||
* @param taskId
|
||||
*/
|
||||
@Override
|
||||
public void setFinish(int uid, int taskId) {
|
||||
QueryWrapper<YxUserTaskFinish> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("uid",uid).eq("task_id",taskId);
|
||||
int count = yxUserTaskFinishMapper.selectCount(wrapper);
|
||||
if(count == 0){
|
||||
YxUserTaskFinish userTaskFinish = new YxUserTaskFinish();
|
||||
userTaskFinish.setAddTime(OrderUtil.getSecondTimestampTwo());
|
||||
userTaskFinish.setUid(uid);
|
||||
userTaskFinish.setTaskId(taskId);
|
||||
userTaskFinish.setStatus(0);
|
||||
|
||||
yxUserTaskFinishMapper.insert(userTaskFinish);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public YxUserTaskFinishQueryVo getYxUserTaskFinishById(Serializable id) throws Exception{
|
||||
return yxUserTaskFinishMapper.getYxUserTaskFinishById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Paging<YxUserTaskFinishQueryVo> getYxUserTaskFinishPageList(YxUserTaskFinishQueryParam yxUserTaskFinishQueryParam) throws Exception{
|
||||
Page page = setPageParam(yxUserTaskFinishQueryParam,OrderItem.desc("create_time"));
|
||||
IPage<YxUserTaskFinishQueryVo> iPage = yxUserTaskFinishMapper.getYxUserTaskFinishPageList(page,yxUserTaskFinishQueryParam);
|
||||
return new Paging(iPage);
|
||||
}
|
||||
|
||||
}
|
||||
@ -8,14 +8,18 @@ import co.yixiang.modules.order.service.YxStoreOrderService;
|
||||
import co.yixiang.modules.shop.service.YxStoreProductRelationService;
|
||||
import co.yixiang.modules.shop.service.YxSystemGroupDataService;
|
||||
import co.yixiang.modules.user.entity.YxUser;
|
||||
import co.yixiang.modules.user.service.YxUserService;
|
||||
import co.yixiang.modules.user.service.*;
|
||||
import co.yixiang.modules.user.web.param.YxUserQueryParam;
|
||||
import co.yixiang.modules.user.web.vo.YxSystemUserLevelQueryVo;
|
||||
import co.yixiang.modules.user.web.vo.YxUserQueryVo;
|
||||
import co.yixiang.utils.SecurityUtils;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.omg.CORBA.PRIVATE_MEMBER;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -41,6 +45,9 @@ public class UserController extends BaseController {
|
||||
private final YxSystemGroupDataService systemGroupDataService;
|
||||
private final YxStoreOrderService orderService;
|
||||
private final YxStoreProductRelationService relationService;
|
||||
private final YxUserSignService userSignService;
|
||||
private final YxUserBillService userBillService;
|
||||
private final YxSystemUserLevelService systemUserLevelService;
|
||||
|
||||
|
||||
|
||||
@ -74,7 +81,18 @@ public class UserController extends BaseController {
|
||||
@ApiOperation(value = "个人中心",notes = "个人中心")
|
||||
public ApiResult<Object> user(){
|
||||
int uid = SecurityUtils.getUserId().intValue();
|
||||
return ApiResult.ok(yxUserService.getNewYxUserById(uid));
|
||||
YxUserQueryVo yxUserQueryVo = yxUserService.getNewYxUserById(uid);
|
||||
|
||||
|
||||
if(yxUserQueryVo.getLevel() > 0) {
|
||||
yxUserQueryVo.setVip(true);
|
||||
YxSystemUserLevelQueryVo systemUserLevelQueryVo = systemUserLevelService
|
||||
.getYxSystemUserLevelById(yxUserQueryVo.getLevel());
|
||||
yxUserQueryVo.setVipIcon(systemUserLevelQueryVo.getIcon());
|
||||
yxUserQueryVo.setVipId(yxUserQueryVo.getLevel());
|
||||
yxUserQueryVo.setVipName(systemUserLevelQueryVo.getName());
|
||||
}
|
||||
return ApiResult.ok(yxUserQueryVo);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -126,13 +144,68 @@ public class UserController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取活动状态
|
||||
* 签到用户信息
|
||||
*/
|
||||
@PostMapping("/sign/user")
|
||||
@ApiOperation(value = "获取活动状态",notes = "获取活动状态")
|
||||
public ApiResult<Object> sign(){
|
||||
@ApiOperation(value = "签到用户信息",notes = "签到用户信息")
|
||||
public ApiResult<Object> sign(@RequestBody String jsonStr){
|
||||
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
||||
int uid = SecurityUtils.getUserId().intValue();
|
||||
return ApiResult.ok(yxUserService.getYxUserById(uid));
|
||||
YxUserQueryVo userQueryVo = yxUserService.getYxUserById(uid);
|
||||
int sumSignDay = userSignService.getSignSumDay(uid);
|
||||
boolean isDaySign = userSignService.getToDayIsSign(uid);
|
||||
boolean isYesterDaySign = userSignService.getYesterDayIsSign(uid);
|
||||
userQueryVo.setSumSignDay(sumSignDay);
|
||||
userQueryVo.setIsDaySign(isDaySign);
|
||||
userQueryVo.setIsYesterDaySign(isYesterDaySign);
|
||||
if(!isDaySign && !isYesterDaySign) userQueryVo.setSignNum(0);
|
||||
return ApiResult.ok(userQueryVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 签到配置
|
||||
*/
|
||||
@GetMapping("/sign/config")
|
||||
@ApiOperation(value = "签到配置",notes = "签到配置")
|
||||
public ApiResult<Object> signConfig(){
|
||||
return ApiResult.ok(systemGroupDataService.getDatas("sign_day_num"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 签到列表
|
||||
*/
|
||||
@GetMapping("/sign/list")
|
||||
@ApiOperation(value = "签到列表",notes = "签到列表")
|
||||
public ApiResult<Object> signList(@RequestParam(value = "page",defaultValue = "1") int page,
|
||||
@RequestParam(value = "limit",defaultValue = "10") int limit){
|
||||
int uid = SecurityUtils.getUserId().intValue();
|
||||
return ApiResult.ok(userSignService.getSignList(uid,page,limit));
|
||||
}
|
||||
|
||||
/**
|
||||
* 签到列表(年月)
|
||||
*/
|
||||
@GetMapping("/sign/month")
|
||||
@ApiOperation(value = "签到列表(年月)",notes = "签到列表(年月)")
|
||||
public ApiResult<Object> signMonthList(@RequestParam(value = "page",defaultValue = "1") int page,
|
||||
@RequestParam(value = "limit",defaultValue = "10") int limit){
|
||||
int uid = SecurityUtils.getUserId().intValue();
|
||||
return ApiResult.ok(userBillService.getUserBillList(page,limit,uid,5));
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始签到
|
||||
*/
|
||||
@PostMapping("/sign/integral")
|
||||
@ApiOperation(value = "开始签到",notes = "开始签到")
|
||||
public ApiResult<Object> signIntegral(){
|
||||
int uid = SecurityUtils.getUserId().intValue();
|
||||
boolean isDaySign = userSignService.getToDayIsSign(uid);
|
||||
if(isDaySign) return ApiResult.fail("已签到");
|
||||
int integral = userSignService.sign(uid);
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("integral",integral);
|
||||
return ApiResult.ok(map,"签到获得" + integral + "积分");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,76 @@
|
||||
package co.yixiang.modules.user.web.controller;
|
||||
|
||||
import co.yixiang.common.api.ApiResult;
|
||||
import co.yixiang.common.web.controller.BaseController;
|
||||
import co.yixiang.common.web.param.IdParam;
|
||||
import co.yixiang.common.web.vo.Paging;
|
||||
import co.yixiang.modules.user.entity.YxUserLevel;
|
||||
import co.yixiang.modules.user.service.YxSystemUserLevelService;
|
||||
import co.yixiang.modules.user.service.YxSystemUserTaskService;
|
||||
import co.yixiang.modules.user.service.YxUserLevelService;
|
||||
import co.yixiang.modules.user.web.param.YxUserLevelQueryParam;
|
||||
import co.yixiang.modules.user.web.vo.YxUserLevelQueryVo;
|
||||
import co.yixiang.utils.SecurityUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户等级 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-12-06
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
@Api(value = "用户等级", tags = "用户等级", description = "用户等级")
|
||||
public class UserLevelController extends BaseController {
|
||||
|
||||
|
||||
private final YxUserLevelService userLevelService;
|
||||
private final YxSystemUserLevelService systemUserLevelService;
|
||||
private final YxSystemUserTaskService systemUserTaskService;
|
||||
|
||||
/**
|
||||
* 会员等级列表
|
||||
*/
|
||||
@GetMapping("/user/level/grade")
|
||||
@ApiOperation(value = "会员等级列表",notes = "会员等级列表")
|
||||
public ApiResult<Object> getLevelInfo(){
|
||||
int uid = SecurityUtils.getUserId().intValue();
|
||||
return ApiResult.ok(systemUserLevelService.getLevelInfo(uid,true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取等级任务
|
||||
*/
|
||||
@GetMapping("/user/level/task/{id}")
|
||||
@ApiOperation(value = "获取等级任务",notes = "获取等级任务")
|
||||
public ApiResult<Object> getTask(@PathVariable Integer id){
|
||||
int uid = SecurityUtils.getUserId().intValue();
|
||||
return ApiResult.ok(systemUserTaskService.getTaskList(id,uid,null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测用户是否可以成为会员
|
||||
*/
|
||||
@GetMapping("/user/level/detection")
|
||||
@ApiOperation(value = "检测用户是否可以成为会员",notes = "检测用户是否可以成为会员")
|
||||
public ApiResult<Object> detection(){
|
||||
int uid = SecurityUtils.getUserId().intValue();
|
||||
userLevelService.setLevelComplete(uid);
|
||||
return ApiResult.ok("ok");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,91 +0,0 @@
|
||||
package co.yixiang.modules.user.web.controller;
|
||||
|
||||
import co.yixiang.modules.user.entity.YxUserExtract;
|
||||
import co.yixiang.modules.user.service.YxUserExtractService;
|
||||
import co.yixiang.modules.user.web.param.YxUserExtractQueryParam;
|
||||
import co.yixiang.modules.user.web.vo.YxUserExtractQueryVo;
|
||||
import co.yixiang.common.web.controller.BaseController;
|
||||
import co.yixiang.common.api.ApiResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import co.yixiang.common.web.vo.Paging;
|
||||
import co.yixiang.common.web.param.IdParam;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户提现表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @since 2019-11-11
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/yxUserExtract")
|
||||
@Api("用户提现表 API")
|
||||
public class YxUserExtractController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private YxUserExtractService yxUserExtractService;
|
||||
|
||||
/**
|
||||
* 添加用户提现表
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
@ApiOperation(value = "添加YxUserExtract对象",notes = "添加用户提现表",response = ApiResult.class)
|
||||
public ApiResult<Boolean> addYxUserExtract(@Valid @RequestBody YxUserExtract yxUserExtract) throws Exception{
|
||||
boolean flag = yxUserExtractService.save(yxUserExtract);
|
||||
return ApiResult.result(flag);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户提现表
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperation(value = "修改YxUserExtract对象",notes = "修改用户提现表",response = ApiResult.class)
|
||||
public ApiResult<Boolean> updateYxUserExtract(@Valid @RequestBody YxUserExtract yxUserExtract) throws Exception{
|
||||
boolean flag = yxUserExtractService.updateById(yxUserExtract);
|
||||
return ApiResult.result(flag);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户提现表
|
||||
*/
|
||||
@PostMapping("/delete")
|
||||
@ApiOperation(value = "删除YxUserExtract对象",notes = "删除用户提现表",response = ApiResult.class)
|
||||
public ApiResult<Boolean> deleteYxUserExtract(@Valid @RequestBody IdParam idParam) throws Exception{
|
||||
boolean flag = yxUserExtractService.removeById(idParam.getId());
|
||||
return ApiResult.result(flag);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户提现表
|
||||
*/
|
||||
@PostMapping("/info")
|
||||
@ApiOperation(value = "获取YxUserExtract对象详情",notes = "查看用户提现表",response = YxUserExtractQueryVo.class)
|
||||
public ApiResult<YxUserExtractQueryVo> getYxUserExtract(@Valid @RequestBody IdParam idParam) throws Exception{
|
||||
YxUserExtractQueryVo yxUserExtractQueryVo = yxUserExtractService.getYxUserExtractById(idParam.getId());
|
||||
return ApiResult.ok(yxUserExtractQueryVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户提现表分页列表
|
||||
*/
|
||||
@PostMapping("/getPageList")
|
||||
@ApiOperation(value = "获取YxUserExtract分页列表",notes = "用户提现表分页列表",response = YxUserExtractQueryVo.class)
|
||||
public ApiResult<Paging<YxUserExtractQueryVo>> getYxUserExtractPageList(@Valid @RequestBody(required = false) YxUserExtractQueryParam yxUserExtractQueryParam) throws Exception{
|
||||
Paging<YxUserExtractQueryVo> paging = yxUserExtractService.getYxUserExtractPageList(yxUserExtractQueryParam);
|
||||
return ApiResult.ok(paging);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
package co.yixiang.modules.user.web.dto;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName SignDTO
|
||||
* @Author hupeng <610796224@qq.com>
|
||||
* @Date 2019/12/5
|
||||
**/
|
||||
@Data
|
||||
public class SignDTO implements Serializable {
|
||||
private String addTime;
|
||||
private String title;
|
||||
private Integer number;
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package co.yixiang.modules.user.web.dto;
|
||||
|
||||
import co.yixiang.modules.user.web.vo.YxSystemUserTaskQueryVo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName TaskDTO
|
||||
* @Author hupeng <610796224@qq.com>
|
||||
* @Date 2019/12/6
|
||||
**/
|
||||
@Data
|
||||
public class TaskDTO implements Serializable {
|
||||
private List<YxSystemUserTaskQueryVo> list;
|
||||
private Integer reachCount;
|
||||
private List<YxSystemUserTaskQueryVo> task;
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package co.yixiang.modules.user.web.dto;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName TaskFinishDTO
|
||||
* @Author hupeng <610796224@qq.com>
|
||||
* @Date 2019/12/6
|
||||
**/
|
||||
@Data
|
||||
public class TaskFinishDTO implements Serializable {
|
||||
private String addTime;
|
||||
private String title;
|
||||
private Integer number;
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package co.yixiang.modules.user.web.dto;
|
||||
|
||||
import co.yixiang.modules.user.entity.YxSystemUserLevel;
|
||||
import co.yixiang.modules.user.web.vo.YxSystemUserLevelQueryVo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName UserLevelDTO
|
||||
* @Author hupeng <610796224@qq.com>
|
||||
* @Date 2019/12/6
|
||||
**/
|
||||
@Data
|
||||
public class UserLevelDTO implements Serializable {
|
||||
private List<YxSystemUserLevelQueryVo> list;
|
||||
private TaskDTO task;
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package co.yixiang.modules.user.web.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName UserLevelInfoDTO
|
||||
* @Author hupeng <610796224@qq.com>
|
||||
* @Date 2019/12/7
|
||||
**/
|
||||
@Data
|
||||
public class UserLevelInfoDTO implements Serializable {
|
||||
private Integer id;
|
||||
private Integer addTime;
|
||||
private Double discount;
|
||||
private Integer levelId;
|
||||
private String name;
|
||||
private String icon;
|
||||
private Integer grade;
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package co.yixiang.modules.user.web.param;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import co.yixiang.common.web.param.QueryParam;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 设置用户等级表 查询参数对象
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @date 2019-12-06
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value="YxSystemUserLevelQueryParam对象", description="设置用户等级表查询参数")
|
||||
public class YxSystemUserLevelQueryParam extends QueryParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package co.yixiang.modules.user.web.param;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import co.yixiang.common.web.param.QueryParam;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 等级任务设置 查询参数对象
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @date 2019-12-06
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value="YxSystemUserTaskQueryParam对象", description="等级任务设置查询参数")
|
||||
public class YxSystemUserTaskQueryParam extends QueryParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package co.yixiang.modules.user.web.param;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import co.yixiang.common.web.param.QueryParam;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户等级记录表 查询参数对象
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @date 2019-12-06
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value="YxUserLevelQueryParam对象", description="用户等级记录表查询参数")
|
||||
public class YxUserLevelQueryParam extends QueryParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package co.yixiang.modules.user.web.param;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import co.yixiang.common.web.param.QueryParam;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 签到记录表 查询参数对象
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @date 2019-12-05
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value="YxUserSignQueryParam对象", description="签到记录表查询参数")
|
||||
public class YxUserSignQueryParam extends QueryParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package co.yixiang.modules.user.web.param;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import co.yixiang.common.web.param.QueryParam;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户任务完成记录表 查询参数对象
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @date 2019-12-07
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value="YxUserTaskFinishQueryParam对象", description="用户任务完成记录表查询参数")
|
||||
public class YxUserTaskFinishQueryParam extends QueryParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package co.yixiang.modules.user.web.vo;
|
||||
|
||||
import co.yixiang.modules.user.web.dto.TaskDTO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 设置用户等级表 查询结果对象
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @date 2019-12-06
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "YxSystemUserLevelQueryVo对象", description = "设置用户等级表查询参数")
|
||||
public class YxSystemUserLevelQueryVo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "商户id")
|
||||
private Integer merId;
|
||||
|
||||
@ApiModelProperty(value = "会员名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "购买金额")
|
||||
private BigDecimal money;
|
||||
|
||||
@ApiModelProperty(value = "有效时间")
|
||||
private Integer validDate;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "会员等级")
|
||||
private Integer grade;
|
||||
|
||||
@ApiModelProperty(value = "享受折扣")
|
||||
private BigDecimal discount;
|
||||
|
||||
@ApiModelProperty(value = "会员卡背景")
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "会员图标")
|
||||
private String icon;
|
||||
|
||||
@ApiModelProperty(value = "说明")
|
||||
private String explain;
|
||||
|
||||
@ApiModelProperty(value = "添加时间")
|
||||
private Integer addTime;
|
||||
|
||||
private TaskDTO taskList;
|
||||
|
||||
private Boolean isClear;
|
||||
|
||||
private Integer isForever;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package co.yixiang.modules.user.web.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 等级任务设置 查询结果对象
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @date 2019-12-06
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "YxSystemUserTaskQueryVo对象", description = "等级任务设置查询参数")
|
||||
public class YxSystemUserTaskQueryVo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "任务名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "配置原名")
|
||||
private String realName;
|
||||
|
||||
@ApiModelProperty(value = "任务类型")
|
||||
private String taskType;
|
||||
|
||||
@ApiModelProperty(value = "限定数")
|
||||
private Integer number;
|
||||
|
||||
@ApiModelProperty(value = "等级id")
|
||||
private Integer levelId;
|
||||
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "是否显示")
|
||||
private Integer isShow;
|
||||
|
||||
@ApiModelProperty(value = "是否务必达成任务,1务必达成,0=满足其一")
|
||||
private Integer isMust;
|
||||
|
||||
@ApiModelProperty(value = "任务说明")
|
||||
private String illustrate;
|
||||
|
||||
@ApiModelProperty(value = "新增时间")
|
||||
private Integer addTime;
|
||||
|
||||
private Integer newNumber;//已经完成了多少
|
||||
|
||||
private Integer speed;//进度比例
|
||||
|
||||
private Integer finish;//是否完成
|
||||
|
||||
private String taskTypeTitle;//任务类型标题
|
||||
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package co.yixiang.modules.user.web.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户等级记录表 查询结果对象
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @date 2019-12-06
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value="YxUserLevelQueryVo对象", description="用户等级记录表查询参数")
|
||||
public class YxUserLevelQueryVo implements Serializable{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "用户uid")
|
||||
private Integer uid;
|
||||
|
||||
@ApiModelProperty(value = "等级vip")
|
||||
private Integer levelId;
|
||||
|
||||
@ApiModelProperty(value = "会员等级")
|
||||
private Integer grade;
|
||||
|
||||
@ApiModelProperty(value = "过期时间")
|
||||
private Integer validTime;
|
||||
|
||||
@ApiModelProperty(value = "是否永久")
|
||||
private Boolean isForever;
|
||||
|
||||
@ApiModelProperty(value = "商户id")
|
||||
private Integer merId;
|
||||
|
||||
@ApiModelProperty(value = "0:禁止,1:正常")
|
||||
private Boolean status;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String mark;
|
||||
|
||||
@ApiModelProperty(value = "是否已通知")
|
||||
private Boolean remind;
|
||||
|
||||
@ApiModelProperty(value = "是否删除,0=未删除,1=删除")
|
||||
private Boolean isDel;
|
||||
|
||||
@ApiModelProperty(value = "添加时间")
|
||||
private Integer addTime;
|
||||
|
||||
@ApiModelProperty(value = "享受折扣")
|
||||
private Integer discount;
|
||||
|
||||
}
|
||||
@ -39,6 +39,12 @@ public class YxUserQueryVo implements Serializable {
|
||||
|
||||
private Integer statu;
|
||||
|
||||
private Integer sumSignDay;
|
||||
|
||||
private Boolean isDaySign;
|
||||
|
||||
private Boolean isYesterDaySign;
|
||||
|
||||
|
||||
|
||||
// @ApiModelProperty(value = "用户密码(跟pwd)")
|
||||
@ -139,4 +145,12 @@ public class YxUserQueryVo implements Serializable {
|
||||
@ApiModelProperty(value = "用户登陆类型,h5,wechat,routine")
|
||||
private String loginType;
|
||||
|
||||
private Boolean vip;
|
||||
|
||||
private Integer vipId;
|
||||
|
||||
private String vipIcon;
|
||||
|
||||
private String vipName;
|
||||
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package co.yixiang.modules.user.web.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 签到记录表 查询结果对象
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @date 2019-12-05
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "YxUserSignQueryVo对象", description = "签到记录表查询参数")
|
||||
public class YxUserSignQueryVo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "用户uid")
|
||||
private Integer uid;
|
||||
|
||||
@ApiModelProperty(value = "签到说明")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty(value = "获得积分")
|
||||
private Integer number;
|
||||
|
||||
@ApiModelProperty(value = "剩余积分")
|
||||
private Integer balance;
|
||||
|
||||
@ApiModelProperty(value = "添加时间")
|
||||
private Integer addTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package co.yixiang.modules.user.web.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户任务完成记录表 查询结果对象
|
||||
* </p>
|
||||
*
|
||||
* @author hupeng
|
||||
* @date 2019-12-07
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value="YxUserTaskFinishQueryVo对象", description="用户任务完成记录表查询参数")
|
||||
public class YxUserTaskFinishQueryVo implements Serializable{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "任务id")
|
||||
private Integer taskId;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Integer uid;
|
||||
|
||||
@ApiModelProperty(value = "是否有效")
|
||||
private Boolean status;
|
||||
|
||||
@ApiModelProperty(value = "添加时间")
|
||||
private Integer addTime;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user