main
Gitea 12 months ago
parent fe0e4e41b2
commit 03f6700b0d
  1. 68
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expscore/controller/ExpScoreController.java
  2. 38
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scoresta/controller/ScoreStaController.java
  3. 27
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/topic/controller/TopicController.java

@ -106,34 +106,52 @@ public class ExpScoreController extends JeecgController<ExpScore, IExpScoreServi
queryWrapperlist.eq("topid",annComGroTop.getTopid());
List<ExpScore> listeslist = expScoreService.list(queryWrapperlist);
if(listeslist.size()==0){
for (int i = 0 ; i < listeg.size();i++){
AnnComGroTopP annComGroTopP = new AnnComGroTopP();
QueryWrapper<AnnComGroTopP> queryWrapperacgtp = QueryGenerator.initQueryWrapper(annComGroTopP, req.getParameterMap());
queryWrapperacgtp.eq("ann_com_gro_topid",xmtmid);
List<AnnComGroTopP> listacftp = annComGroTopPService.list(queryWrapperacgtp);
ExpScore expScore1 = new ExpScore();
expScore1.setAnnid(annComGroTop.getAnnid());
expScore1.setAnnComP(annComGroTop.getAnnComP());
expScore1.setAnnalComp(annualCompPointService.getById(annComGroTop.getAnnComP()).getAnnualCompId());
expScore1.setTopid(annComGroTop.getTopid());
expScore1.setBmcode(listacftp.get(0).getBmcode());
AnnComGroTopP annComGroTopP = new AnnComGroTopP();
QueryWrapper<AnnComGroTopP> queryWrapperacgtp = QueryGenerator.initQueryWrapper(annComGroTopP, req.getParameterMap());
queryWrapperacgtp.eq("ann_com_gro_topid",xmtmid);
List<AnnComGroTopP> listacftp = annComGroTopPService.list(queryWrapperacgtp);
if(listacftp.size()==0){
return Result.error("题目未绑定报名编号,请联系组委会");
}
for(int l = 0 ; l < listacftp.size() ; l++){
UpfilePersion upfilePersion = new UpfilePersion();
QueryWrapper<UpfilePersion> queryWrapperup = QueryGenerator.initQueryWrapper(upfilePersion, req.getParameterMap());
queryWrapperup.eq("apply_code",listacftp.get(0).getBmcode());
queryWrapperup.eq("apply_code",listacftp.get(l).getBmcode());
List<UpfilePersion> listup = upfilePersionService.list(queryWrapperup);
expScore1.setUpfilePersionId(listup.get(0).getId().toString());
ScoreSta scoreSta = new ScoreSta();
QueryWrapper<ScoreSta> queryWrapperss = QueryGenerator.initQueryWrapper(scoreSta, req.getParameterMap());
queryWrapperss.eq("annual_id",annComGroTop.getAnnid());
queryWrapperss.eq("annal_comp",annualCompPointService.getById(annComGroTop.getAnnComP()).getAnnualCompId());
queryWrapperss.eq("annual_compid",annComGroTop.getAnnComP());
queryWrapperss.eq("topicid",annComGroTop.getTopid());
List<ScoreSta> listss = scoreStaService.list(queryWrapperss);
expScore1.setScoreStaid(listss.get(0).getId());
expScore1.setScore(0);
expScore1.setUserid(expertService.getById(listeg.get(i).getGrouid()).getUserId());
expScore1.setIspf("0");
expScoreService.save(expScore1);
if(listup.size()==0){
return Result.error("报名编号为:"+listacftp.get(l).getBmcode()+"未上传作品,请联系组委会");
}
}
ScoreSta scoreSta = new ScoreSta();
QueryWrapper<ScoreSta> queryWrapperss = QueryGenerator.initQueryWrapper(scoreSta, req.getParameterMap());
queryWrapperss.eq("annual_id",annComGroTop.getAnnid());
queryWrapperss.eq("annal_comp",annualCompPointService.getById(annComGroTop.getAnnComP()).getAnnualCompId());
queryWrapperss.eq("annual_compid",annComGroTop.getAnnComP());
queryWrapperss.eq("topicid",annComGroTop.getTopid());
List<ScoreSta> listss = scoreStaService.list(queryWrapperss);
if(listss.size()==0){
return Result.error("未设置评分标准,请联系组委会");
}
for (int i = 0 ; i < listeg.size();i++){
for(int l = 0 ; l < listacftp.size() ; l++){
UpfilePersion upfilePersion = new UpfilePersion();
QueryWrapper<UpfilePersion> queryWrapperup = QueryGenerator.initQueryWrapper(upfilePersion, req.getParameterMap());
queryWrapperup.eq("apply_code",listacftp.get(l).getBmcode());
List<UpfilePersion> listup = upfilePersionService.list(queryWrapperup);
ExpScore expScore1 = new ExpScore();
expScore1.setAnnid(annComGroTop.getAnnid());
expScore1.setAnnComP(annComGroTop.getAnnComP());
expScore1.setAnnalComp(annualCompPointService.getById(annComGroTop.getAnnComP()).getAnnualCompId());
expScore1.setTopid(annComGroTop.getTopid());
expScore1.setBmcode(listacftp.get(l).getBmcode());
expScore1.setUpfilePersionId(listup.get(0).getId().toString());
expScore1.setScoreStaid(listss.get(0).getId());
expScore1.setScore(0);
expScore1.setUserid(expertService.getById(listeg.get(i).getGrouid()).getUserId());
expScore1.setIspf("0");
expScoreService.save(expScore1);
}
}
}

@ -9,9 +9,19 @@ import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils;
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.annualcompgroup.entity.AnnualCompGroup;
import org.jeecg.modules.demo.comp.entity.Comp;
import org.jeecg.modules.demo.comp.service.ICompService;
import org.jeecg.modules.demo.scoresta.entity.ScoreSta;
import org.jeecg.modules.demo.scoresta.service.IScoreStaService;
@ -50,6 +60,12 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
public class ScoreStaController extends JeecgController<ScoreSta, IScoreStaService> {
@Autowired
private IScoreStaService scoreStaService;
@Autowired
private ICompService compService;
@Autowired
private IAnnualCompService annualCompService;
@Autowired
private IAnnualCompPointService annualCompPointService;
/**
* 分页列表查询
@ -67,7 +83,29 @@ public class ScoreStaController extends JeecgController<ScoreSta, IScoreStaServi
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
Comp comp = new Comp();
QueryWrapper<Comp> queryWrappercomp = QueryGenerator.initQueryWrapper(comp, req.getParameterMap());
queryWrappercomp.like("comp_admin",user.getUsername());
List<Comp> list = compService.list(queryWrappercomp);
List<String> ids = list.stream().map(Comp::getId).collect(Collectors.toList());
QueryWrapper<AnnualComp> queryWrapperAnnual = new QueryWrapper<>();
queryWrapperAnnual.in(ids.size()!=0,"compid",ids);
List<AnnualComp> listAnnual = annualCompService.list(queryWrapperAnnual);
List<String> annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList());
QueryWrapper<ScoreSta> queryWrapper = QueryGenerator.initQueryWrapper(scoreSta, req.getParameterMap());
queryWrapper.in(annualIds.size()!=0,"annal_comp",annualIds);
AnnualCompPoint annualCompPoint = new AnnualCompPoint();
QueryWrapper<AnnualCompPoint> queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap());
queryWrapperacp.in(annualIds.size()!=0,"annual_comp_id",annualIds);
queryWrapperacp.eq("annual_comp_switch","Y"); // 比赛必须是开启的
List<AnnualCompPoint> listacp = annualCompPointService.list(queryWrapperacp);
List<String> acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList());
queryWrapper.in(acpIds.size()!=0,"annual_compid",acpIds);
Page<ScoreSta> page = new Page<ScoreSta>(pageNo, pageSize);
IPage<ScoreSta> pageList = scoreStaService.page(page, queryWrapper);
return Result.OK(pageList);

@ -102,18 +102,23 @@ public class TopicController extends JeecgController<Topic, ITopicService> {
queryWrapper.eq("annual_compid",annualCompGroup.getAnnCompP());
queryWrapper.eq("status",2);
queryWrapper.eq("isopen","Y");
AnnComGroTop annComGroTop = new AnnComGroTop();
QueryWrapper<AnnComGroTop> queryWrapper1 = QueryGenerator.initQueryWrapper(annComGroTop, req.getParameterMap());
queryWrapper1.eq("ann_com_p_g",ndbsxzid);
List<AnnComGroTop> listagt = annComGroTopService.list(queryWrapper1);
String str = "";
for(int i = 0 ; i<listagt.size();i++){
str = str+listagt.get(i).getTopid()+",";
queryWrapper.notIn("id",str.split(","));
if (topicService.list(queryWrapper).size()==0){
return Result.error("暂无年度比赛项目对应题目,请先去添加");
}else {
AnnComGroTop annComGroTop = new AnnComGroTop();
QueryWrapper<AnnComGroTop> queryWrapper1 = QueryGenerator.initQueryWrapper(annComGroTop, req.getParameterMap());
queryWrapper1.eq("ann_com_p_g",ndbsxzid);
List<AnnComGroTop> listagt = annComGroTopService.list(queryWrapper1);
String str = "";
for(int i = 0 ; i<listagt.size();i++){
str = str+listagt.get(i).getTopid()+",";
queryWrapper.notIn("id",str.split(","));
}
Page<Topic> page = new Page<Topic>(pageNo, pageSize);
IPage<Topic> pageList = topicService.page(page, queryWrapper);
return Result.OK(pageList);
}
Page<Topic> page = new Page<Topic>(pageNo, pageSize);
IPage<Topic> pageList = topicService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**

Loading…
Cancel
Save