dev
Gitea 12 months ago
parent fe0e4e41b2
commit 03f6700b0d
  1. 36
      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. 5
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/topic/controller/TopicController.java

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

@ -9,9 +9,19 @@ import java.io.UnsupportedEncodingException;
import java.net.URLDecoder; import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils; 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.entity.ScoreSta;
import org.jeecg.modules.demo.scoresta.service.IScoreStaService; 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> { public class ScoreStaController extends JeecgController<ScoreSta, IScoreStaService> {
@Autowired @Autowired
private IScoreStaService scoreStaService; 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="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) { 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<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); Page<ScoreSta> page = new Page<ScoreSta>(pageNo, pageSize);
IPage<ScoreSta> pageList = scoreStaService.page(page, queryWrapper); IPage<ScoreSta> pageList = scoreStaService.page(page, queryWrapper);
return Result.OK(pageList); return Result.OK(pageList);

@ -102,6 +102,9 @@ public class TopicController extends JeecgController<Topic, ITopicService> {
queryWrapper.eq("annual_compid",annualCompGroup.getAnnCompP()); queryWrapper.eq("annual_compid",annualCompGroup.getAnnCompP());
queryWrapper.eq("status",2); queryWrapper.eq("status",2);
queryWrapper.eq("isopen","Y"); queryWrapper.eq("isopen","Y");
if (topicService.list(queryWrapper).size()==0){
return Result.error("暂无年度比赛项目对应题目,请先去添加");
}else {
AnnComGroTop annComGroTop = new AnnComGroTop(); AnnComGroTop annComGroTop = new AnnComGroTop();
QueryWrapper<AnnComGroTop> queryWrapper1 = QueryGenerator.initQueryWrapper(annComGroTop, req.getParameterMap()); QueryWrapper<AnnComGroTop> queryWrapper1 = QueryGenerator.initQueryWrapper(annComGroTop, req.getParameterMap());
queryWrapper1.eq("ann_com_p_g",ndbsxzid); queryWrapper1.eq("ann_com_p_g",ndbsxzid);
@ -116,6 +119,8 @@ public class TopicController extends JeecgController<Topic, ITopicService> {
return Result.OK(pageList); return Result.OK(pageList);
} }
}
/** /**
* 添加 * 添加
* *

Loading…
Cancel
Save