This commit is contained in:
齐天大圣 2024-03-15 10:48:49 +08:00
parent b4a01817ca
commit aa07c3f617

View File

@ -4,12 +4,15 @@ package com.fuint.business.marketingActivity.activeNewlyweds.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.api.ApiController;
import com.baomidou.mybatisplus.extension.api.R;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.activeNewlyweds.controller.vo.ActiveNewlywedsVO;
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlyweds;
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlywedsRecords;
import com.fuint.business.marketingActivity.activeNewlyweds.service.ActiveNewlywedsRecordsService;
import com.fuint.business.marketingActivity.activeNewlyweds.service.ActiveNewlywedsService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.fuint.framework.web.BaseController;
@ -35,6 +38,8 @@ public class ActiveNewlywedsRecordsController extends BaseController {
*/
@Resource
private ActiveNewlywedsRecordsService activeNewlywedsRecordsService;
@Resource
private ActiveNewlywedsService activeNewlywedsService;
/**
* 分页查询所有数据
@ -58,8 +63,19 @@ public class ActiveNewlywedsRecordsController extends BaseController {
*/
@GetMapping("applet")
public ResponseObject isJoined(@Param("activeNewlywedsRecords") ActiveNewlywedsRecords activeNewlywedsRecords) {
//在线活动
LambdaQueryWrapper<ActiveNewlyweds> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(ActiveNewlyweds::getStoreId,activeNewlywedsRecords.getStoreId());
queryWrapper1.eq(ActiveNewlyweds::getStatus,0);
ActiveNewlyweds activeNewlyweds = activeNewlywedsService.getOne(queryWrapper1);
if (ObjectUtils.isEmpty(activeNewlyweds)){
return getFailureResult("0");
}
//活动记录
LambdaQueryWrapper<ActiveNewlywedsRecords> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActiveNewlywedsRecords::getUserId,TokenUtil.getNowAccountInfo().getId());
queryWrapper.eq(ActiveNewlywedsRecords::getActiveNewlywedsId,activeNewlyweds.getId());
List<ActiveNewlywedsRecords> list = this.activeNewlywedsRecordsService.list(queryWrapper);
if (list.size() == 0){
return getSuccessResult("1");