significative 4 months ago
commit 041a978c46
  1. 9
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/service/impl/AnnualCompPointServiceImpl.java
  2. 15
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java

@ -47,6 +47,9 @@ public class AnnualCompPointServiceImpl extends ServiceImpl<AnnualCompPointMappe
@Autowired
private AnnualCompPointMapper annualCompPointMapper;
@Autowired
private IAnnualCompPointService annualCompPointService;
//奖项
@Autowired
private AnnualCompAwardMapper annualCompAwardMapper;
@ -83,6 +86,12 @@ public class AnnualCompPointServiceImpl extends ServiceImpl<AnnualCompPointMappe
if (annualComp == null) {
return Result.error("年度比赛错误");
}
//校验同一年度比赛下项目名称不可重复
List<AnnualCompPoint> annualCompPointListzbc = annualCompPointService.query().eq("annual_comp_id",annualCompPoint.getAnnualCompId()).eq("obj_name",annualCompPoint.getObjName()).list();
if (annualCompPointListzbc.size()>0){
return Result.error("同一年度比赛下项目名称不可重复");
}
if (annualComp.getIsopen().equals("0")) {
return Result.error("请先启动年度比赛");

@ -494,6 +494,21 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
List<AwardPersion> list = ExcelImportUtil.importExcel(file.getInputStream(), AwardPersion.class, params);
List<AwardPersion> listsave = new ArrayList<>();
for(int i = 0 ; i < list.size() ; i++){
if(list.get(i).getAnnualid()==null||list.get(i).getAnnualid().equals("")){
return Result.error("文件导入失败:第"+(i+1)+"行年度为空");
}
if(list.get(i).getAnnalComp()==null||list.get(i).getAnnalComp().equals("")){
return Result.error("文件导入失败:第"+(i+1)+"行年度比赛为空");
}
if(list.get(i).getAnnualCompP()==null||list.get(i).getAnnualCompP().equals("")){
return Result.error("文件导入失败:第"+(i+1)+"行年度比赛项目为空");
}
if(list.get(i).getEnrollCode()==null||list.get(i).getEnrollCode().equals("")){
return Result.error("文件导入失败:第"+(i+1)+"行报名编号为空");
}
if(list.get(i).getAwardname()==null||list.get(i).getAwardname().equals("")){
return Result.error("文件导入失败:第"+(i+1)+"行奖项名称为空");
}
AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration = new AnnualCompetitionProjectRegistration();
QueryWrapper<AnnualCompetitionProjectRegistration> queryWrappera = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, request.getParameterMap());
queryWrappera.eq("annual_compid",list.get(i).getAnnualCompP());

Loading…
Cancel
Save