Преглед на файлове

志愿者活动查询(分页) 接口

tags/V1.8.0^2
wanghaoran преди 1 година
родител
ревизия
61ee1cff07
променени са 22 файла, в които са добавени 449 реда и са изтрити 32 реда
  1. +36
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/controller/WestreamActivityController.java
  2. +6
    -6
      tuoheng-api/src/main/java/com/tuoheng/api/controller/WestreamMessageController.java
  3. +2
    -3
      tuoheng-api/src/main/java/com/tuoheng/api/controller/WestreamTiktokController.java
  4. +0
    -3
      tuoheng-api/src/main/java/com/tuoheng/api/controller/WestreamVideoController.java
  5. +74
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/entity/domain/WestreamActivity.java
  6. +59
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/entity/domain/WestreamActivityApply.java
  7. +29
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/entity/domain/WestreamActivityUser.java
  8. +22
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/entity/request/WestreamActivityQuery.java
  9. +1
    -1
      tuoheng-api/src/main/java/com/tuoheng/api/entity/request/WestreamMessageQuery.java
  10. +24
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/entity/vo/WestreamActivityVo.java
  11. +22
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/enums/ActivityStatusEnum.java
  12. +18
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/mapper/WestreamActivityApplyMapper.java
  13. +18
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/mapper/WestreamActivityMapper.java
  14. +18
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/mapper/WestreamActivityUserMapper.java
  15. +10
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/service/IWestreamActivityService.java
  16. +5
    -5
      tuoheng-api/src/main/java/com/tuoheng/api/service/IWestreamMessageService.java
  17. +1
    -1
      tuoheng-api/src/main/java/com/tuoheng/api/service/IWestreamTiktokService.java
  18. +6
    -6
      tuoheng-api/src/main/java/com/tuoheng/api/service/impl/ThWestreamMessageServiceImpl.java
  19. +2
    -2
      tuoheng-api/src/main/java/com/tuoheng/api/service/impl/ThWestreamTiktokServiceImpl.java
  20. +81
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/service/impl/WestreamActivityServiceImpl.java
  21. +1
    -3
      tuoheng-api/src/main/java/com/tuoheng/api/service/impl/WestreamVideoServiceImpl.java
  22. +14
    -2
      tuoheng-common/src/main/java/com/tuoheng/common/common/BaseQuery.java

+ 36
- 0
tuoheng-api/src/main/java/com/tuoheng/api/controller/WestreamActivityController.java Целия файл

@@ -0,0 +1,36 @@
package com.tuoheng.api.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.tuoheng.api.entity.request.WestreamActivityQuery;
import com.tuoheng.api.service.IWestreamActivityService;
import com.tuoheng.common.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* 全民护河志愿者活动 前端控制器
*
* @author WangHaoran
* @since 2023-06-07
*/
@RestController
@RequestMapping("/westreamActivity")
public class WestreamActivityController {

@Autowired
IWestreamActivityService westreamActivityService;


/**
* 志愿者活动查询(分页)
*
* @return
*/
@GetMapping("/index")
public JsonResult index(WestreamActivityQuery query) {
return westreamActivityService.index(query);
}

}

+ 6
- 6
tuoheng-api/src/main/java/com/tuoheng/api/controller/WestreamMessageController.java Целия файл

@@ -1,7 +1,7 @@
package com.tuoheng.api.controller;

import com.tuoheng.api.entity.request.ThWestreamMessageQuery;
import com.tuoheng.api.service.ThWestreamMessageService;
import com.tuoheng.api.entity.request.WestreamMessageQuery;
import com.tuoheng.api.service.IWestreamMessageService;
import com.tuoheng.common.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.*;
public class WestreamMessageController {

@Autowired
private ThWestreamMessageService westreamMessageService;
private IWestreamMessageService westreamMessageService;

/**
* 查询用户对应消息记录通知
@@ -23,7 +23,7 @@ public class WestreamMessageController {
* @return
*/
@GetMapping("/list")
private JsonResult getList(ThWestreamMessageQuery query) {
private JsonResult getList(WestreamMessageQuery query) {
return westreamMessageService.getList(query);
}

@@ -32,7 +32,7 @@ public class WestreamMessageController {
* @return
*/
@GetMapping("/deail")
private JsonResult deail(ThWestreamMessageQuery query) {
private JsonResult deail(WestreamMessageQuery query) {
return westreamMessageService.deail(query);
}

@@ -41,7 +41,7 @@ public class WestreamMessageController {
* @return
*/
@PutMapping("/read")
private JsonResult read(@RequestBody ThWestreamMessageQuery query) {
private JsonResult read(@RequestBody WestreamMessageQuery query) {
return westreamMessageService.read(query);
}


+ 2
- 3
tuoheng-api/src/main/java/com/tuoheng/api/controller/WestreamTiktokController.java Целия файл

@@ -1,9 +1,8 @@
package com.tuoheng.api.controller;

import com.tuoheng.api.entity.domain.ThWestreamTiktok;
import com.tuoheng.api.entity.request.OnlineNumQuery;
import com.tuoheng.api.entity.request.WestreamTiktokQuery;
import com.tuoheng.api.service.ThWestreamTiktokService;
import com.tuoheng.api.service.IWestreamTiktokService;
import com.tuoheng.common.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -19,7 +18,7 @@ import org.springframework.web.bind.annotation.*;
public class WestreamTiktokController {

@Autowired
private ThWestreamTiktokService thWestreamTiktokService;
private IWestreamTiktokService thWestreamTiktokService;

/**
* 添加抖音关注审核

+ 0
- 3
tuoheng-api/src/main/java/com/tuoheng/api/controller/WestreamVideoController.java Целия файл

@@ -1,9 +1,6 @@
package com.tuoheng.api.controller;

import com.tuoheng.api.entity.domain.WestreamVideo;
import com.tuoheng.api.entity.request.StreamQuery;
import com.tuoheng.api.entity.request.WestreamVideoQuery;
import com.tuoheng.api.service.IWestreamUserService;
import com.tuoheng.api.service.IWestreamVideoService;
import com.tuoheng.common.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;

+ 74
- 0
tuoheng-api/src/main/java/com/tuoheng/api/entity/domain/WestreamActivity.java Целия файл

@@ -0,0 +1,74 @@
package com.tuoheng.api.entity.domain;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tuoheng.common.common.BaseEntity;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
* 全民护河志愿者活动表
* @TableName th_westream_activity
*/
@TableName(value ="th_westream_activity")
@Data
public class WestreamActivity extends BaseEntity {

/**
* 租户id
*/
private Integer tenantId;

/**
* 活动主题
*/
@NotBlank(message = "活动主题不能为空")
private String activityTitle;

/**
* 封面图片地址
*/
@NotBlank(message = "封面图片地址不能为空")
private String imageUrl;

/**
* 报名开始时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@NotNull(message = "报名开始时间不能为空")
private Date applyBeginTime;

/**
* 报名结束时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@NotNull(message = "报名结束时间不能为空")
private Date applyEndTime;

/**
* 活动开始时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@NotNull(message = "活动开始时间不能为空")
private Date activityBeginTime;
/**
* 活动结束时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@NotNull(message = "活动结束时间不能为空")
private Date activityEndTime;

/**
* 活动介绍
*/
@NotBlank(message = "活动介绍不能为空")
private String intro;
}

+ 59
- 0
tuoheng-api/src/main/java/com/tuoheng/api/entity/domain/WestreamActivityApply.java Целия файл

@@ -0,0 +1,59 @@
package com.tuoheng.api.entity.domain;

import com.baomidou.mybatisplus.annotation.TableName;
import com.tuoheng.common.common.BaseEntity;
import lombok.Data;

/**
* 全民护河志愿者活动审核表
* @TableName th_westream_activity_apply
*/
@TableName(value ="th_westream_activity_apply")
@Data
public class WestreamActivityApply extends BaseEntity {

/**
* 租户id
*/
private Integer tenantId;

/**
* 活动id
*/
private Integer activityId;

/**
* 活动主题
*/
private String activityTitle;

/**
* openid
*/
private String openid;

/**
* 用户昵称
*/
private String nickname;

/**
* 申请姓名
*/
private String applyName;

/**
* 申请电话
*/
private String applyPhone;

/**
* 审核状态:1待审核 2通过 3驳回
*/
private Integer status;

/**
* 审核备注
*/
private String remark;
}

+ 29
- 0
tuoheng-api/src/main/java/com/tuoheng/api/entity/domain/WestreamActivityUser.java Целия файл

@@ -0,0 +1,29 @@
package com.tuoheng.api.entity.domain;

import com.baomidou.mybatisplus.annotation.TableName;
import com.tuoheng.common.common.BaseEntity;
import lombok.Data;

/**
* 全民护河志愿者活动用户表
* @TableName th_westream_activity_user
*/
@TableName(value ="th_westream_activity_user")
@Data
public class WestreamActivityUser extends BaseEntity {

/**
* 租户id
*/
private Integer tenantId;

/**
* 活动id
*/
private Integer activityId;

/**
* openid
*/
private String openid;
}

+ 22
- 0
tuoheng-api/src/main/java/com/tuoheng/api/entity/request/WestreamActivityQuery.java Целия файл

@@ -0,0 +1,22 @@
package com.tuoheng.api.entity.request;

import com.tuoheng.common.common.BaseQuery;
import lombok.Data;

/**
* @Author xiaoying
* @Date 2023/6/6 14:24
*/
@Data
public class WestreamActivityQuery extends BaseQuery {
/**
* 活动主题
*/
private String activityTitle;

/**
* 租户ID
*/
private Integer tenantId;

}

tuoheng-api/src/main/java/com/tuoheng/api/entity/request/ThWestreamMessageQuery.java → tuoheng-api/src/main/java/com/tuoheng/api/entity/request/WestreamMessageQuery.java Целия файл

@@ -8,7 +8,7 @@ import lombok.Data;
* @Date 2023/6/6 15:32
*/
@Data
public class ThWestreamMessageQuery extends BaseQuery {
public class WestreamMessageQuery extends BaseQuery {
/**
* 信息id
*/

+ 24
- 0
tuoheng-api/src/main/java/com/tuoheng/api/entity/vo/WestreamActivityVo.java Целия файл

@@ -0,0 +1,24 @@
package com.tuoheng.api.entity.vo;

import com.tuoheng.api.entity.domain.WestreamActivity;
import lombok.Data;

/**
* @Author xiaoying
* @Date 2023/6/6 14:41
*/
@Data
public class WestreamActivityVo extends WestreamActivity {
/**
* 报名时间
*/
private String applyTime;
/**
* 活动时间
*/
private String acticityTime;
/**
* 活动状态 1 活动未开始 2活动进行中 3活动已结束
*/
private Integer status;
}

+ 22
- 0
tuoheng-api/src/main/java/com/tuoheng/api/enums/ActivityStatusEnum.java Целия файл

@@ -0,0 +1,22 @@
package com.tuoheng.api.enums;

import lombok.Getter;

public enum ActivityStatusEnum {


NO_STARTED(1, "报名未开始"),
IN_PROGRESS(2, "报名进行中"),
END(3, "报名已结束");

ActivityStatusEnum(int code, String description) {
this.code = code;
this.description = description;
}

@Getter
private int code;

@Getter
private String description;
}

+ 18
- 0
tuoheng-api/src/main/java/com/tuoheng/api/mapper/WestreamActivityApplyMapper.java Целия файл

@@ -0,0 +1,18 @@
package com.tuoheng.api.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tuoheng.api.entity.domain.WestreamActivityApply;

/**
* @author 小影
* @description 针对表【th_westream_activity_apply(全民护河志愿者活动审核表)】的数据库操作Mapper
* @createDate 2023-06-06 14:22:11
* @Entity com.tuoheng.admin.entity.domain.ThWestreamActivityApply
*/
public interface WestreamActivityApplyMapper extends BaseMapper<WestreamActivityApply> {

}





+ 18
- 0
tuoheng-api/src/main/java/com/tuoheng/api/mapper/WestreamActivityMapper.java Целия файл

@@ -0,0 +1,18 @@
package com.tuoheng.api.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tuoheng.api.entity.domain.WestreamActivity;

/**
* @author 小影
* @description 针对表【th_westream_activity(全民护河志愿者活动表)】的数据库操作Mapper
* @createDate 2023-06-06 14:22:00
* @Entity com.tuoheng.admin.entity.domain.ThWestreamActivity
*/
public interface WestreamActivityMapper extends BaseMapper<WestreamActivity> {

}





+ 18
- 0
tuoheng-api/src/main/java/com/tuoheng/api/mapper/WestreamActivityUserMapper.java Целия файл

@@ -0,0 +1,18 @@
package com.tuoheng.api.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tuoheng.api.entity.domain.WestreamActivityUser;

/**
* @author 小影
* @description 针对表【th_westream_activity_user(全民护河志愿者活动用户表)】的数据库操作Mapper
* @createDate 2023-06-06 14:22:14
* @Entity com.tuoheng.admin.entity.domain.ThWestreamActivityUser
*/
public interface WestreamActivityUserMapper extends BaseMapper<WestreamActivityUser> {

}





+ 10
- 0
tuoheng-api/src/main/java/com/tuoheng/api/service/IWestreamActivityService.java Целия файл

@@ -0,0 +1,10 @@
package com.tuoheng.api.service;

import com.tuoheng.api.entity.domain.WestreamActivity;
import com.tuoheng.api.entity.request.WestreamActivityQuery;
import com.tuoheng.common.common.IBaseService;
import com.tuoheng.common.utils.JsonResult;

public interface IWestreamActivityService extends IBaseService<WestreamActivity> {
JsonResult index(WestreamActivityQuery query);
}

tuoheng-api/src/main/java/com/tuoheng/api/service/ThWestreamMessageService.java → tuoheng-api/src/main/java/com/tuoheng/api/service/IWestreamMessageService.java Целия файл

@@ -2,7 +2,7 @@ package com.tuoheng.api.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tuoheng.api.entity.domain.ThWestreamMessage;
import com.tuoheng.api.entity.request.ThWestreamMessageQuery;
import com.tuoheng.api.entity.request.WestreamMessageQuery;
import com.tuoheng.common.utils.JsonResult;

/**
@@ -10,11 +10,11 @@ import com.tuoheng.common.utils.JsonResult;
* @description 针对表【th_westream_message(全民护河消息表)】的数据库操作Service
* @createDate 2023-06-06 11:30:05
*/
public interface ThWestreamMessageService extends IService<ThWestreamMessage> {
public interface IWestreamMessageService extends IService<ThWestreamMessage> {

JsonResult getList(ThWestreamMessageQuery query);
JsonResult getList(WestreamMessageQuery query);

JsonResult read(ThWestreamMessageQuery query);
JsonResult read(WestreamMessageQuery query);

JsonResult deail(ThWestreamMessageQuery query);
JsonResult deail(WestreamMessageQuery query);
}

tuoheng-api/src/main/java/com/tuoheng/api/service/ThWestreamTiktokService.java → tuoheng-api/src/main/java/com/tuoheng/api/service/IWestreamTiktokService.java Целия файл

@@ -10,7 +10,7 @@ import com.tuoheng.common.utils.JsonResult;
* @description 针对表【th_westream_tiktok(全民护河抖音关注审核表)】的数据库操作Service
* @createDate 2023-06-06 09:46:18
*/
public interface ThWestreamTiktokService extends IService<ThWestreamTiktok> {
public interface IWestreamTiktokService extends IService<ThWestreamTiktok> {

JsonResult add(ThWestreamTiktok entity);


+ 6
- 6
tuoheng-api/src/main/java/com/tuoheng/api/service/impl/ThWestreamMessageServiceImpl.java Целия файл

@@ -3,9 +3,9 @@ package com.tuoheng.api.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tuoheng.api.entity.domain.ThWestreamMessage;
import com.tuoheng.api.entity.request.ThWestreamMessageQuery;
import com.tuoheng.api.entity.request.WestreamMessageQuery;
import com.tuoheng.api.mapper.ThWestreamMessageMapper;
import com.tuoheng.api.service.ThWestreamMessageService;
import com.tuoheng.api.service.IWestreamMessageService;
import com.tuoheng.common.common.BaseEntity;
import com.tuoheng.common.utils.JsonResult;
import com.tuoheng.common.utils.StringUtils;
@@ -20,7 +20,7 @@ import java.util.List;
*/
@Service
public class ThWestreamMessageServiceImpl extends ServiceImpl<ThWestreamMessageMapper, ThWestreamMessage>
implements ThWestreamMessageService {
implements IWestreamMessageService {


/**
@@ -29,7 +29,7 @@ public class ThWestreamMessageServiceImpl extends ServiceImpl<ThWestreamMessageM
* @return
*/
@Override
public JsonResult getList(ThWestreamMessageQuery query) {
public JsonResult getList(WestreamMessageQuery query) {
if (StringUtils.isEmpty(query.getOpenId())) {
return JsonResult.error("openid为空");
}
@@ -48,7 +48,7 @@ public class ThWestreamMessageServiceImpl extends ServiceImpl<ThWestreamMessageM
* @return
*/
@Override
public JsonResult deail(ThWestreamMessageQuery query) {
public JsonResult deail(WestreamMessageQuery query) {
if (StringUtils.isEmpty(query.getMsgId())) {
return JsonResult.error("msgId为空");
}
@@ -60,7 +60,7 @@ public class ThWestreamMessageServiceImpl extends ServiceImpl<ThWestreamMessageM
}

@Override
public JsonResult read(ThWestreamMessageQuery query) {
public JsonResult read(WestreamMessageQuery query) {
if (StringUtils.isEmpty(query.getOpenId())) {
return JsonResult.error("openid为空");
}

+ 2
- 2
tuoheng-api/src/main/java/com/tuoheng/api/service/impl/ThWestreamTiktokServiceImpl.java Целия файл

@@ -11,7 +11,7 @@ import com.tuoheng.api.entity.request.WestreamTiktokQuery;
import com.tuoheng.api.mapper.IdentityMapper;
import com.tuoheng.api.mapper.ThWestreamTiktokMapper;
import com.tuoheng.api.mapper.WestreamUserMapper;
import com.tuoheng.api.service.ThWestreamTiktokService;
import com.tuoheng.api.service.IWestreamTiktokService;
import com.tuoheng.common.common.BaseEntity;
import com.tuoheng.common.utils.JsonResult;
import com.tuoheng.common.utils.StringUtils;
@@ -25,7 +25,7 @@ import org.springframework.stereotype.Service;
*/
@Service
public class ThWestreamTiktokServiceImpl extends ServiceImpl<ThWestreamTiktokMapper, ThWestreamTiktok>
implements ThWestreamTiktokService {
implements IWestreamTiktokService {

@Autowired
private ThWestreamTiktokMapper westreamTiktokMapper;

+ 81
- 0
tuoheng-api/src/main/java/com/tuoheng/api/service/impl/WestreamActivityServiceImpl.java Целия файл

@@ -0,0 +1,81 @@
package com.tuoheng.api.service.impl;

import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tuoheng.api.entity.domain.WestreamActivity;
import com.tuoheng.api.entity.request.WestreamActivityQuery;
import com.tuoheng.api.entity.vo.WestreamActivityVo;
import com.tuoheng.api.enums.ActivityStatusEnum;
import com.tuoheng.api.mapper.WestreamActivityMapper;
import com.tuoheng.api.service.IWestreamActivityService;
import com.tuoheng.common.common.BaseEntity;
import com.tuoheng.common.common.BaseServiceImpl;
import com.tuoheng.common.utils.CommonUtils;
import com.tuoheng.common.utils.JsonResult;
import com.tuoheng.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class WestreamActivityServiceImpl extends BaseServiceImpl<WestreamActivityMapper, WestreamActivity> implements IWestreamActivityService {

@Autowired
private WestreamActivityMapper westreamActivityMapper;

@Override
public JsonResult index(WestreamActivityQuery query) {
if(null == query.getTenantId()){
return JsonResult.error("租户ID为空!");
}
query.checkParam();
//开启分页
IPage<WestreamActivity> page = new Page<>(query.getPage(), query.getLimit());

IPage<WestreamActivity> pageDate = westreamActivityMapper.selectPage(page, Wrappers.<WestreamActivity>lambdaQuery()
.eq(WestreamActivity::getTenantId, query.getTenantId())
.orderByDesc(WestreamActivity::getCreateTime));
//返回图片地址匹配路径前缀
IPage<WestreamActivityVo> result = pageDate.convert(item -> {
WestreamActivityVo vo = Convert.convert(WestreamActivityVo.class, item);
vo.setApplyTime(DateUtil.formatDateTime(vo.getApplyBeginTime()) + "-" + DateUtil.formatDateTime(vo.getApplyEndTime()));
vo.setActicityTime(DateUtil.formatDateTime(vo.getActivityBeginTime()) + "-" + DateUtil.formatDateTime(vo.getActivityEndTime()));
if (StringUtils.isNotEmpty(vo.getImageUrl())) {
vo.setImageUrl(CommonUtils.getImageURL(vo.getImageUrl()));
}
Integer status = getVoStatus(vo.getApplyBeginTime(), vo.getApplyEndTime());
vo.setStatus(status);
return vo;
});

return JsonResult.success(result);
}

/**
* 获取活动状态
*
* @param applyBeginTime
* @param applyEndTime
* @return
*/
private Integer getVoStatus(Date applyBeginTime, Date applyEndTime) {
DateTime nowTime = DateUtil.date();
boolean flag = DateUtil.isIn(nowTime, applyBeginTime, applyEndTime);
boolean flag2 = nowTime.after(applyBeginTime);
if (flag) {
//进行中
return ActivityStatusEnum.IN_PROGRESS.getCode();
}
if (flag2) {
return ActivityStatusEnum.END.getCode();
} else {
return ActivityStatusEnum.NO_STARTED.getCode();
}
}

}

+ 1
- 3
tuoheng-api/src/main/java/com/tuoheng/api/service/impl/WestreamVideoServiceImpl.java Целия файл

@@ -55,6 +55,7 @@ public class WestreamVideoServiceImpl extends BaseServiceImpl<WestreamVideoMappe
if(null == query.getTenantId() || StringUtils.isEmpty(query.getOpenid())){
return JsonResult.error("参数为空!");
}
query.checkParam();

// 获取分页数据
IPage<WestreamVideo> page = new Page<>(query.getPage(), query.getLimit());
@@ -88,12 +89,10 @@ public class WestreamVideoServiceImpl extends BaseServiceImpl<WestreamVideoMappe
if(null == query.getTenantId() || StringUtils.isEmpty(query.getOpenid())){
return JsonResult.error("参数为空!");
}

if(null == query.getVideoId()){
return JsonResult.error("视频ID为空!");
}


WestreamVideoUser westreamVideoUser = westreamVideoUserMapper.selectOne(new LambdaQueryWrapper<WestreamVideoUser>()
.eq(WestreamVideoUser::getTenantId, query.getTenantId())
.eq(WestreamVideoUser::getOpenid, query.getOpenid())
@@ -113,7 +112,6 @@ public class WestreamVideoServiceImpl extends BaseServiceImpl<WestreamVideoMappe
if(2 == query.getStatus()){

//查询学习视频 积分设置
//发送短信
ThDict thDict = thDictMapper.selectOne(new LambdaQueryWrapper<ThDict>()
.eq(ThDict::getTenantId, query.getTenantId())
.eq(ThDict::getCode, DictConstants.POINTS_RULE_CODE)

+ 14
- 2
tuoheng-common/src/main/java/com/tuoheng/common/common/BaseQuery.java Целия файл

@@ -10,10 +10,22 @@ public class BaseQuery {
/**
* 页码(默认1)
*/
private Integer page = 1;
private Integer page;

/**
* 每页数(默认10)
*/
private Integer limit = 10;
private Integer limit;

/**
* 不传参的时候默认1,10
*/
public void checkParam() {
if (this.page == null || this.page < 0) {
setPage(1);
}
if (this.limit == null || this.limit < 0 || this.limit > 100) {
setLimit(10);
}
}
}

Loading…
Отказ
Запис