作品分配逻辑重写

dev
Gitea 5 months ago
parent c608a6aef0
commit 9033513859
  1. 2
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/anncomgrotopp/controller/AnnComGroTopPController.java
  2. 82
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/chooseTopicPersion/controller/ChaoseTopicPersionController.java
  3. 21
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/topic/controller/TopicController.java

@ -68,7 +68,7 @@ public class AnnComGroTopPController extends JeecgController<AnnComGroTopP, IAnn
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req,@RequestParam(name="xmtmid",required=true) String xmtmid) { HttpServletRequest req,@RequestParam(name="xmtmid",required=true) String xmtmid) {
QueryWrapper<AnnComGroTopP> queryWrapper = QueryGenerator.initQueryWrapper(annComGroTopP, req.getParameterMap()); QueryWrapper<AnnComGroTopP> queryWrapper = QueryGenerator.initQueryWrapper(annComGroTopP, req.getParameterMap());
queryWrapper.eq("ann_com_gro_topid",xmtmid); queryWrapper.eq("ann_com_p_g",xmtmid);
Page<AnnComGroTopP> page = new Page<AnnComGroTopP>(pageNo, pageSize); Page<AnnComGroTopP> page = new Page<AnnComGroTopP>(pageNo, pageSize);
IPage<AnnComGroTopP> pageList = annComGroTopPService.page(page, queryWrapper); IPage<AnnComGroTopP> pageList = annComGroTopPService.page(page, queryWrapper);
return Result.OK(pageList); return Result.OK(pageList);

@ -152,27 +152,35 @@ public class ChaoseTopicPersionController extends JeecgController<ChaoseTopicPer
@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,@RequestParam(name="xmtmid",required=true) String xmtmid) { HttpServletRequest req,@RequestParam(name="xmtmid",required=true) String xmtmid) {
AnnComGroTop annComGroTop = annComGroTopService.getById(xmtmid); AnnComGroTop annComGroTop = new AnnComGroTop();
QueryWrapper<UpfilePersion> queryWrapper = QueryGenerator.initQueryWrapper(upfilePersion, req.getParameterMap()); QueryWrapper<AnnComGroTop> queryWrappertop = QueryGenerator.initQueryWrapper(annComGroTop, req.getParameterMap());
queryWrapper.eq("annual_id",annComGroTop.getAnnid()); queryWrappertop.eq("ann_com_p_g",xmtmid);
queryWrapper.eq("annual_comp_point_id",annComGroTop.getAnnComP()); List<AnnComGroTop> listtop = annComGroTopService.list(queryWrappertop);
queryWrapper.eq("status","0"); if(listtop.size()>0){
AnnComGroTopP annComGroTopP = new AnnComGroTopP(); QueryWrapper<UpfilePersion> queryWrapper = QueryGenerator.initQueryWrapper(upfilePersion, req.getParameterMap());
QueryWrapper<AnnComGroTopP> queryWrapperagt = QueryGenerator.initQueryWrapper(annComGroTopP, req.getParameterMap()); queryWrapper.eq("annual_id",listtop.get(0).getAnnid());
//queryWrapperagt.eq("ann_com_gro_topid",xmtmid); queryWrapper.eq("annual_comp_point_id",listtop.get(0).getAnnComP());
queryWrapperagt.eq("annid",annComGroTop.getAnnid()); queryWrapper.eq("status","0");
queryWrapperagt.eq("ann_com_p",annComGroTop.getAnnComP()); AnnComGroTopP annComGroTopP = new AnnComGroTopP();
List<AnnComGroTopP> listact = annComGroTopPService.list(queryWrapperagt); QueryWrapper<AnnComGroTopP> queryWrapperagt = QueryGenerator.initQueryWrapper(annComGroTopP, req.getParameterMap());
String str = ""; //queryWrapperagt.eq("ann_com_gro_topid",xmtmid);
for(int i = 0 ; i<listact.size();i++){ queryWrapperagt.eq("annid",listtop.get(0).getAnnid());
str = str+listact.get(i).getBmcode()+","; queryWrapperagt.eq("ann_com_p",listtop.get(0).getAnnComP());
} List<AnnComGroTopP> listact = annComGroTopPService.list(queryWrapperagt);
if(str!=""){ String str = "";
queryWrapper.notIn("apply_code",str.split(",")); for(int i = 0 ; i<listact.size();i++){
str = str+listact.get(i).getBmcode()+",";
}
if(str!=""){
queryWrapper.notIn("apply_code",str.split(","));
}
Page<UpfilePersion> page = new Page<>(pageNo, pageSize);
IPage<UpfilePersion> pageList = upfilePersionService.page(page, queryWrapper);
return Result.OK(pageList);
}else{
return Result.OK(null);
} }
Page<UpfilePersion> page = new Page<>(pageNo, pageSize);
IPage<UpfilePersion> pageList = upfilePersionService.page(page, queryWrapper);
return Result.OK(pageList);
} }
/** /**
@ -185,19 +193,31 @@ public class ChaoseTopicPersionController extends JeecgController<ChaoseTopicPer
@ApiOperation(value = "报名编号-添加", notes = "报名编号-添加") @ApiOperation(value = "报名编号-添加", notes = "报名编号-添加")
// @RequiresPermissions("chooseTopicPersion:chaose_topic_persion:add") // @RequiresPermissions("chooseTopicPersion:chaose_topic_persion:add")
@GetMapping(value = "/bmbhadd") @GetMapping(value = "/bmbhadd")
public Result<String> bmbhadd(@RequestParam(name="ids",required=true) String ids,@RequestParam(name="xmtmid",required=true) String xmtmid) { public Result<String> bmbhadd(@RequestParam(name="ids",required=true) String ids,@RequestParam(name="xmtmid",required=true) String xmtmid,HttpServletRequest req) {
String strs[] = ids.split(","); String strs[] = ids.split(",");
AnnComGroTop annComGroTop = annComGroTopService.getById(xmtmid); AnnComGroTop annComGroTop = new AnnComGroTop();
QueryWrapper<AnnComGroTop> queryWrapper = QueryGenerator.initQueryWrapper(annComGroTop, req.getParameterMap());
queryWrapper.eq("ann_com_p_g",xmtmid);
List<AnnComGroTop> listtop = annComGroTopService.list(queryWrapper);
for (int i = 0 ; i < strs.length ; i++){ for (int i = 0 ; i < strs.length ; i++){
UpfilePersion upfilePersion = upfilePersionService.getById(strs[i]); for (int k = 0 ; k < listtop.size() ;k++){
AnnComGroTopP annComGroTopP = new AnnComGroTopP(); UpfilePersion upfilePersion = upfilePersionService.getById(strs[i]);
annComGroTopP.setAnnComGroTopid(xmtmid); ChaoseTopicPersion chaoseTopicPersion = new ChaoseTopicPersion();
annComGroTopP.setBmcode(upfilePersion.getApplyCode()); QueryWrapper<ChaoseTopicPersion> queryWrapperctp = QueryGenerator.initQueryWrapper(chaoseTopicPersion, req.getParameterMap());
annComGroTopP.setAnnid(annComGroTop.getAnnid()); queryWrapperctp.eq("bmcode",upfilePersion.getApplyCode());
annComGroTopP.setAnnComP(annComGroTop.getAnnComP()); List<ChaoseTopicPersion> listctp = chaoseTopicPersionService.list(queryWrapperctp);
annComGroTopP.setAnnComPG(annComGroTop.getAnnComPG()); if(listtop.get(k).getTopid().equals(listctp.get(0).getTimul())){
annComGroTopP.setTopicName(upfilePersion.getTopicName()); AnnComGroTopP annComGroTopP = new AnnComGroTopP();
annComGroTopPService.save(annComGroTopP); annComGroTopP.setAnnComGroTopid(listtop.get(k).getId());
annComGroTopP.setBmcode(upfilePersion.getApplyCode());
annComGroTopP.setAnnid(listtop.get(k).getAnnid());
annComGroTopP.setAnnComP(listtop.get(k).getAnnComP());
annComGroTopP.setAnnComPG(listtop.get(k).getAnnComPG());
annComGroTopP.setTopicName(upfilePersion.getTopicName());
annComGroTopP.setTopid(listtop.get(k).getTopid());
annComGroTopPService.save(annComGroTopP);
}
}
} }
return Result.OK("绑定成功!"); return Result.OK("绑定成功!");
} }

@ -148,14 +148,21 @@ public class TopicController extends JeecgController<Topic, ITopicService> {
queryWrapper.eq("ann_com_p_g",ndbsxzid); queryWrapper.eq("ann_com_p_g",ndbsxzid);
List<AnnComGroTop> list = annComGroTopService.list(queryWrapper); List<AnnComGroTop> list = annComGroTopService.list(queryWrapper);
if(list.size()==0){ if(list.size()==0){
AnnComGroTop annComGroTop = new AnnComGroTop(); Topic topic = new Topic();
annComGroTop.setAnnid(annualCompGroup.getAnnal()); QueryWrapper<Topic> queryWrappertopic = QueryGenerator.initQueryWrapper(topic, req.getParameterMap());
annComGroTop.setAnnComP(annualCompGroup.getAnnCompP()); queryWrappertopic.eq("annual_compid",annualCompGroup.getAnnCompP());
annComGroTop.setAnnComPG(ndbsxzid); List<Topic> listTopic = topicService.list(queryWrappertopic);
annComGroTopService.save(annComGroTop); for (int i = 0 ; i < listTopic.size() ;i++){
return Result.OK(annComGroTop.getId()); AnnComGroTop annComGroTop = new AnnComGroTop();
annComGroTop.setAnnid(annualCompGroup.getAnnal());
annComGroTop.setAnnComP(annualCompGroup.getAnnCompP());
annComGroTop.setAnnComPG(ndbsxzid);
annComGroTop.setTopid(listTopic.get(i).getId());
annComGroTopService.save(annComGroTop);
}
return Result.OK(ndbsxzid);
}else{ }else{
return Result.OK(list.get(0).getId()); return Result.OK(ndbsxzid);
} }
} }

Loading…
Cancel
Save