parent
d856f5ab46
commit
b58d68081f
14 changed files with 308 additions and 100 deletions
@ -0,0 +1,34 @@ |
||||
package org.jeecg.modules.demo.annualCompIntface.controller; |
||||
|
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.apache.shiro.SecurityUtils; |
||||
import org.jeecg.common.api.vo.Result; |
||||
import org.jeecg.common.system.vo.LoginUser; |
||||
import org.jeecg.modules.demo.annualCompIntface.service.AnnconalCompService; |
||||
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; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
import java.util.Map; |
||||
|
||||
@Api(tags = "组委会首页") |
||||
@RestController |
||||
@RequestMapping("/admin/inde") |
||||
@Slf4j |
||||
public class AnnconalCompController |
||||
{ |
||||
@Autowired |
||||
private AnnconalCompService annconalCompService; |
||||
|
||||
|
||||
@ApiOperation(value = "管理员首页", notes = "管理员首页") |
||||
@GetMapping(value = "/inde") |
||||
public Result adminind(HttpServletRequest req) { |
||||
Map<String, Object> result = annconalCompService.inde(); |
||||
return Result.ok(result); |
||||
} |
||||
} |
@ -0,0 +1,7 @@ |
||||
package org.jeecg.modules.demo.annualCompIntface.service; |
||||
|
||||
import java.util.Map; |
||||
|
||||
public interface AnnconalCompService { |
||||
Map<String, Object> inde(); |
||||
} |
@ -0,0 +1,111 @@ |
||||
package org.jeecg.modules.demo.annualCompIntface.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import org.apache.shiro.SecurityUtils; |
||||
import org.jeecg.common.system.vo.LoginUser; |
||||
import org.jeecg.modules.demo.annual.entity.Annual; |
||||
import org.jeecg.modules.demo.annual.service.IAnnualService; |
||||
import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint; |
||||
import org.jeecg.modules.demo.annualCompPoint.service.IAnnualCompPointService; |
||||
import org.jeecg.modules.demo.annualcomp.entity.AnnualComp; |
||||
import org.jeecg.modules.demo.annualcomp.service.IAnnualCompService; |
||||
import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.AnnualCompetitionProjectRegistration; |
||||
import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.IAnnualCompetitionProjectRegistrationService; |
||||
import org.jeecg.modules.demo.awardpersion.entity.AwardPersion; |
||||
import org.jeecg.modules.demo.comp.entity.Comp; |
||||
import org.jeecg.modules.demo.comp.service.ICompService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.time.LocalDate; |
||||
import java.util.Calendar; |
||||
import java.util.LinkedHashMap; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
|
||||
@Service |
||||
public class AnnconalCompServiceImpl implements AnnconalCompService{ |
||||
@Autowired |
||||
private ICompService compService; |
||||
|
||||
@Autowired |
||||
private IAnnualCompService annualCompService; |
||||
|
||||
@Autowired |
||||
private IAnnualService annualService; |
||||
|
||||
@Autowired |
||||
private IAnnualCompPointService annualCompPointService; |
||||
|
||||
@Autowired |
||||
private IAnnualCompetitionProjectRegistrationService annualCompetitionProjectRegistrationService; |
||||
|
||||
|
||||
|
||||
@Override |
||||
public Map<String, Object> inde() { |
||||
Map<String, Object> resultMap = new LinkedHashMap<>(); |
||||
LocalDate currentDate = LocalDate.now(); |
||||
Calendar calendar = Calendar.getInstance(); |
||||
int currentYear = calendar.get(Calendar.YEAR); |
||||
String thisyear =String.valueOf(currentYear); |
||||
//本年度已展开比赛数=============================开始====================
|
||||
String annualId = annualService.getannualthisid(thisyear); |
||||
List<AnnualComp> annualCompList = annualCompService.list(new LambdaQueryWrapper<AnnualComp>().eq(AnnualComp::getAnnualid,annualId)); |
||||
resultMap.put("num01",annualCompList.size()); |
||||
//本年度已展开比赛数=============================结束====================
|
||||
|
||||
//本年度参加比赛队伍数=============================开始====================
|
||||
List<String> annualCompidsList = annualCompList.stream().map(AnnualComp::getId).collect(Collectors.toList()); |
||||
List<AnnualCompPoint> annualCompPointList =annualCompPointService.list(new LambdaQueryWrapper<AnnualCompPoint>().in(AnnualCompPoint::getAnnualCompId,annualCompidsList)); |
||||
List<String> annualCompPointidsList = annualCompPointList.stream().map(AnnualCompPoint::getId).collect(Collectors.toList()); |
||||
List<AnnualCompetitionProjectRegistration> annualCompetitionProjectRegistrationList = annualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>().in(AnnualCompetitionProjectRegistration::getAnnualCompid,annualCompPointidsList)); |
||||
resultMap.put("num02",annualCompetitionProjectRegistrationList.size()); |
||||
//本年度参加比赛队伍数=============================结束====================
|
||||
|
||||
|
||||
//管理比赛数=============================开始====================
|
||||
List<Comp> compList = compService.list(); |
||||
resultMap.put("num03",compList.size()); |
||||
//管理比赛数=============================结束====================
|
||||
|
||||
//专家总数=============================开始====================
|
||||
int zjint = compService.getzjint(); |
||||
resultMap.put("num04",zjint); |
||||
//专家总数=============================结束====================
|
||||
|
||||
|
||||
//正在进行的项目=============================开始====================
|
||||
List<AnnualCompPoint> annualCompPointList1 = annualCompPointService.getAnnualCompbet(currentDate); |
||||
resultMap.put("num05",annualCompPointList1.size()); |
||||
//正在进行的项目=============================结束====================
|
||||
|
||||
|
||||
//已完成的项目数=============================开始====================
|
||||
List<AnnualCompPoint> annualCompPointList2 = annualCompPointService.getAnnualCompbet1(currentDate); |
||||
resultMap.put("num06",annualCompPointList2.size()); |
||||
//已完成的项目数=============================结束====================
|
||||
|
||||
|
||||
//比赛列表=============================开始====================
|
||||
List<Comp> compList1 =compService.list(new LambdaQueryWrapper<Comp>().last("limit 3")); |
||||
resultMap.put("data01",compList1); |
||||
//比赛列表=============================结束====================
|
||||
|
||||
|
||||
//年度比赛列表=============================开始====================
|
||||
List<AnnualComp> AnnualComplist1 =annualCompService.list(new LambdaQueryWrapper<AnnualComp>().last("limit 3")); |
||||
resultMap.put("data02",AnnualComplist1); |
||||
//年度比赛列表=============================结束====================
|
||||
|
||||
//年度比赛列表=============================开始====================
|
||||
List<AnnualCompPoint> AnnualComppointlist1 =annualCompPointService.list(new LambdaQueryWrapper<AnnualCompPoint>().last("limit 3")); |
||||
resultMap.put("data03",AnnualComppointlist1); |
||||
//年度比赛列表=============================结束====================
|
||||
|
||||
|
||||
return resultMap; |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue