活动更改

main
rong.liu 12 months ago
parent 757cf777a5
commit 8cdbb5fa2b
  1. 1
      competition/src/main/java/com/huoran/competition/controller/CompetitionContentController.java
  2. 4
      competition/src/main/java/com/huoran/competition/entity/vo/CompetitionVO.java
  3. 12
      competition/src/main/java/com/huoran/competition/mapper/xml/CompetitionMapper.xml
  4. 27
      competition/src/main/java/com/huoran/competition/service/impl/CompetitionServiceImpl.java

@ -27,6 +27,7 @@ import org.springframework.web.bind.annotation.*;
@RequestMapping("/competition/content") @RequestMapping("/competition/content")
public class CompetitionContentController { public class CompetitionContentController {
@Autowired @Autowired
private CompetitionContentService competitionContentService; private CompetitionContentService competitionContentService;
@NoRepeatSubmit @NoRepeatSubmit

@ -44,8 +44,8 @@ public class CompetitionVO implements Serializable {
@ApiModelProperty(value = "发布状态(0未发布,1已发布)") @ApiModelProperty(value = "发布状态(0未发布,1已发布)")
private Integer publishStatus; private Integer publishStatus;
@ApiModelProperty(value = "中台是否开启(0开启 1未开启 默认0)", example = "0") /* @ApiModelProperty(value = "中台是否开启(0开启 1未开启 默认0)", example = "0")
private Integer ztOpen; private Integer ztOpen;*/
@ApiModelProperty(value = "是否开启(0开启 1未开启 默认0)", example = "0") @ApiModelProperty(value = "是否开启(0开启 1未开启 默认0)", example = "0")
private Integer isOpen; private Integer isOpen;

@ -641,6 +641,7 @@
<select id="foregroundAppletActivityList" resultType="com.huoran.competition.entity.vo.CompetitionVO"> <select id="foregroundAppletActivityList" resultType="com.huoran.competition.entity.vo.CompetitionVO">
SELECT SELECT
c.id, c.id,
c.cover_url,
c.NAME AS competitionName, c.NAME AS competitionName,
c.founder_name, c.founder_name,
c.competition_scope, c.competition_scope,
@ -649,13 +650,20 @@
c.play_start_time, c.play_start_time,
c.play_end_time, c.play_end_time,
c.create_time, c.create_time,
c.sponsor,
IFNULL( IFNULL(
( SELECT count( 1 ) FROM c_competition_registration WHERE competition_id = c.id GROUP BY competition_id HAVING count( 1 ) > 0 ), ( SELECT count( 1 ) FROM c_competition_registration WHERE competition_id = c.id GROUP BY competition_id HAVING count( 1 ) > 0 ),
0 0
) AS applicant_num, ) AS applicant_num,
c.is_open, c.is_open,
create_source, create_source,
( CASE create_source WHEN 0 THEN '平台创建' WHEN 1 THEN '组织创建' ELSE '无' end) as createSource ( CASE create_source WHEN 0 THEN '平台创建' WHEN 1 THEN '组织创建' ELSE '无' end) as createSource,
IF
(
( SELECT r.id FROM c_competition_registration r WHERE r.competition_id = c.id AND r.account_id = #{req.accountId} ) IS NULL,
1,
0
) AS whetherToSignUp
FROM FROM
c_competition c c_competition c
WHERE WHERE
@ -691,12 +699,14 @@
c.id, c.id,
c.NAME AS competitionName, c.NAME AS competitionName,
c.founder_name, c.founder_name,
c.cover_url,
c.competition_scope, c.competition_scope,
c.platform_source, c.platform_source,
c.publish_status, c.publish_status,
c.play_start_time, c.play_start_time,
c.play_end_time, c.play_end_time,
c.create_time, c.create_time,
c.sponsor,
IFNULL( IFNULL(
( SELECT count( 1 ) FROM c_competition_registration WHERE competition_id = c.id GROUP BY competition_id HAVING count( 1 ) > 0 ), ( SELECT count( 1 ) FROM c_competition_registration WHERE competition_id = c.id GROUP BY competition_id HAVING count( 1 ) > 0 ),
0 0

@ -10,7 +10,6 @@ import com.huoran.common.response.R;
import com.huoran.competition.entity.*; import com.huoran.competition.entity.*;
import com.huoran.competition.entity.req.*; import com.huoran.competition.entity.req.*;
import com.huoran.competition.entity.resp.ListOfStageResultsResp; import com.huoran.competition.entity.resp.ListOfStageResultsResp;
import com.huoran.competition.entity.vo.CompetitionDetailsVO;
import com.huoran.competition.entity.vo.CompetitionVO; import com.huoran.competition.entity.vo.CompetitionVO;
import com.huoran.competition.mapper.*; import com.huoran.competition.mapper.*;
import com.huoran.competition.service.CompetitionService; import com.huoran.competition.service.CompetitionService;
@ -173,10 +172,10 @@ public class CompetitionServiceImpl extends ServiceImpl<CompetitionMapper, Compe
Page<CompetitionVO> page = new Page<>(pageCompetitionListReq.getPageNum(), pageCompetitionListReq.getPageSize()); Page<CompetitionVO> page = new Page<>(pageCompetitionListReq.getPageNum(), pageCompetitionListReq.getPageSize());
IPage<CompetitionVO> pageList = baseMapper.backgroundActivityList(page, pageCompetitionListReq); IPage<CompetitionVO> pageList = baseMapper.backgroundActivityList(page, pageCompetitionListReq);
pageList.getRecords().forEach(c->{ pageList.getRecords().forEach(c -> {
if (c.getCompetitionScope().equals("1")){ if (c.getCompetitionScope().equals("1")) {
c.setCompetitionScope("全平台"); c.setCompetitionScope("全平台");
}else{ } else {
c.setCompetitionScope(baseMapper.obtainPlatformInformation(c.getCompetitionScope())); c.setCompetitionScope(baseMapper.obtainPlatformInformation(c.getCompetitionScope()));
} }
@ -217,8 +216,6 @@ public class CompetitionServiceImpl extends ServiceImpl<CompetitionMapper, Compe
} }
// @Override // @Override
// public R competitionAfterLogin1(AfterLoginPageCompetitionListReq pageCompetitionListReq) { // public R competitionAfterLogin1(AfterLoginPageCompetitionListReq pageCompetitionListReq) {
// Page<CompetitionVO> page = new Page<>(pageCompetitionListReq.getPageNum(), pageCompetitionListReq.getPageSize()); // Page<CompetitionVO> page = new Page<>(pageCompetitionListReq.getPageNum(), pageCompetitionListReq.getPageSize());
@ -262,16 +259,16 @@ public class CompetitionServiceImpl extends ServiceImpl<CompetitionMapper, Compe
public Future<IPage<CompetitionVO>> competitionAfterLogin(AfterLoginPageCompetitionListReq pageCompetitionListReq) { public Future<IPage<CompetitionVO>> competitionAfterLogin(AfterLoginPageCompetitionListReq pageCompetitionListReq) {
return CompletableFuture.supplyAsync(() -> { return CompletableFuture.supplyAsync(() -> {
Page<CompetitionVO> page = new Page<>(pageCompetitionListReq.getPageNum(), pageCompetitionListReq.getPageSize()); Page<CompetitionVO> page = new Page<>(pageCompetitionListReq.getPageNum(), pageCompetitionListReq.getPageSize());
IPage<CompetitionVO> pageList = null; IPage<CompetitionVO> pageList = null;
//读取的列表(0:首页活动/1.已报名活动) //读取的列表(0:首页活动/1.已报名活动)
switch (pageCompetitionListReq.getListType()){ switch (pageCompetitionListReq.getListType()) {
case 0: case 0:
//查询未删除且启用发布状态为发布后的 //查询未删除且启用发布状态为发布后的
baseMapper.foregroundAppletActivityList(page, pageCompetitionListReq); pageList = baseMapper.foregroundAppletActivityList(page, pageCompetitionListReq);
break; break;
case 1: case 1:
//查询我报名的列表 //查询我报名的列表
baseMapper.postRegistrationList(page, pageCompetitionListReq); pageList = baseMapper.postRegistrationList(page, pageCompetitionListReq);
break; break;
} }
@ -341,7 +338,7 @@ public class CompetitionServiceImpl extends ServiceImpl<CompetitionMapper, Compe
if (contentList.size() > 0) { if (contentList.size() > 0) {
for (CompetitionStage stage: stages) { for (CompetitionStage stage : stages) {
QueryWrapper<CompetitionStageContentSetting> queryWrapper1 = new QueryWrapper<>(); QueryWrapper<CompetitionStageContentSetting> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.eq("competition_id", contest.getId()); queryWrapper1.eq("competition_id", contest.getId());
queryWrapper1.eq("stage_id", stage.getStageId()); queryWrapper1.eq("stage_id", stage.getStageId());
@ -351,11 +348,11 @@ public class CompetitionServiceImpl extends ServiceImpl<CompetitionMapper, Compe
stage.setCompetitionStageContentSetting(stageContentSetting); stage.setCompetitionStageContentSetting(stageContentSetting);
QueryWrapper<CompetitionStageFile> queryWrapper2 = new QueryWrapper<>(); QueryWrapper<CompetitionStageFile> queryWrapper2 = new QueryWrapper<>();
queryWrapper2.eq("competition_id",contest.getId()); queryWrapper2.eq("competition_id", contest.getId());
queryWrapper2.eq("stage_id", stage.getStageId()); queryWrapper2.eq("stage_id", stage.getStageId());
queryWrapper2.eq("account_id", 0); queryWrapper2.eq("account_id", 0);
CompetitionStageFile myFile = stageFileService.getOne(queryWrapper2); CompetitionStageFile myFile = stageFileService.getOne(queryWrapper2);
if (!ObjectUtil.isEmpty(myFile)){ if (!ObjectUtil.isEmpty(myFile)) {
stage.setCompetitionStageFile(myFile); stage.setCompetitionStageFile(myFile);
} }

Loading…
Cancel
Save