作品分配逻辑重写

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. 42
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/chooseTopicPersion/controller/ChaoseTopicPersionController.java
  3. 11
      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,16 +152,20 @@ 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<AnnComGroTop> queryWrappertop = QueryGenerator.initQueryWrapper(annComGroTop, req.getParameterMap());
queryWrappertop.eq("ann_com_p_g",xmtmid);
List<AnnComGroTop> listtop = annComGroTopService.list(queryWrappertop);
if(listtop.size()>0){
QueryWrapper<UpfilePersion> queryWrapper = QueryGenerator.initQueryWrapper(upfilePersion, req.getParameterMap()); QueryWrapper<UpfilePersion> queryWrapper = QueryGenerator.initQueryWrapper(upfilePersion, req.getParameterMap());
queryWrapper.eq("annual_id",annComGroTop.getAnnid()); queryWrapper.eq("annual_id",listtop.get(0).getAnnid());
queryWrapper.eq("annual_comp_point_id",annComGroTop.getAnnComP()); queryWrapper.eq("annual_comp_point_id",listtop.get(0).getAnnComP());
queryWrapper.eq("status","0"); queryWrapper.eq("status","0");
AnnComGroTopP annComGroTopP = new AnnComGroTopP(); AnnComGroTopP annComGroTopP = new AnnComGroTopP();
QueryWrapper<AnnComGroTopP> queryWrapperagt = QueryGenerator.initQueryWrapper(annComGroTopP, req.getParameterMap()); QueryWrapper<AnnComGroTopP> queryWrapperagt = QueryGenerator.initQueryWrapper(annComGroTopP, req.getParameterMap());
//queryWrapperagt.eq("ann_com_gro_topid",xmtmid); //queryWrapperagt.eq("ann_com_gro_topid",xmtmid);
queryWrapperagt.eq("annid",annComGroTop.getAnnid()); queryWrapperagt.eq("annid",listtop.get(0).getAnnid());
queryWrapperagt.eq("ann_com_p",annComGroTop.getAnnComP()); queryWrapperagt.eq("ann_com_p",listtop.get(0).getAnnComP());
List<AnnComGroTopP> listact = annComGroTopPService.list(queryWrapperagt); List<AnnComGroTopP> listact = annComGroTopPService.list(queryWrapperagt);
String str = ""; String str = "";
for(int i = 0 ; i<listact.size();i++){ for(int i = 0 ; i<listact.size();i++){
@ -173,6 +177,10 @@ public class ChaoseTopicPersionController extends JeecgController<ChaoseTopicPer
Page<UpfilePersion> page = new Page<>(pageNo, pageSize); Page<UpfilePersion> page = new Page<>(pageNo, pageSize);
IPage<UpfilePersion> pageList = upfilePersionService.page(page, queryWrapper); IPage<UpfilePersion> pageList = upfilePersionService.page(page, queryWrapper);
return Result.OK(pageList); return Result.OK(pageList);
}else{
return Result.OK(null);
}
} }
/** /**
@ -185,20 +193,32 @@ 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++){
for (int k = 0 ; k < listtop.size() ;k++){
UpfilePersion upfilePersion = upfilePersionService.getById(strs[i]); UpfilePersion upfilePersion = upfilePersionService.getById(strs[i]);
ChaoseTopicPersion chaoseTopicPersion = new ChaoseTopicPersion();
QueryWrapper<ChaoseTopicPersion> queryWrapperctp = QueryGenerator.initQueryWrapper(chaoseTopicPersion, req.getParameterMap());
queryWrapperctp.eq("bmcode",upfilePersion.getApplyCode());
List<ChaoseTopicPersion> listctp = chaoseTopicPersionService.list(queryWrapperctp);
if(listtop.get(k).getTopid().equals(listctp.get(0).getTimul())){
AnnComGroTopP annComGroTopP = new AnnComGroTopP(); AnnComGroTopP annComGroTopP = new AnnComGroTopP();
annComGroTopP.setAnnComGroTopid(xmtmid); annComGroTopP.setAnnComGroTopid(listtop.get(k).getId());
annComGroTopP.setBmcode(upfilePersion.getApplyCode()); annComGroTopP.setBmcode(upfilePersion.getApplyCode());
annComGroTopP.setAnnid(annComGroTop.getAnnid()); annComGroTopP.setAnnid(listtop.get(k).getAnnid());
annComGroTopP.setAnnComP(annComGroTop.getAnnComP()); annComGroTopP.setAnnComP(listtop.get(k).getAnnComP());
annComGroTopP.setAnnComPG(annComGroTop.getAnnComPG()); annComGroTopP.setAnnComPG(listtop.get(k).getAnnComPG());
annComGroTopP.setTopicName(upfilePersion.getTopicName()); annComGroTopP.setTopicName(upfilePersion.getTopicName());
annComGroTopP.setTopid(listtop.get(k).getTopid());
annComGroTopPService.save(annComGroTopP); 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){
Topic topic = new Topic();
QueryWrapper<Topic> queryWrappertopic = QueryGenerator.initQueryWrapper(topic, req.getParameterMap());
queryWrappertopic.eq("annual_compid",annualCompGroup.getAnnCompP());
List<Topic> listTopic = topicService.list(queryWrappertopic);
for (int i = 0 ; i < listTopic.size() ;i++){
AnnComGroTop annComGroTop = new AnnComGroTop(); AnnComGroTop annComGroTop = new AnnComGroTop();
annComGroTop.setAnnid(annualCompGroup.getAnnal()); annComGroTop.setAnnid(annualCompGroup.getAnnal());
annComGroTop.setAnnComP(annualCompGroup.getAnnCompP()); annComGroTop.setAnnComP(annualCompGroup.getAnnCompP());
annComGroTop.setAnnComPG(ndbsxzid); annComGroTop.setAnnComPG(ndbsxzid);
annComGroTop.setTopid(listTopic.get(i).getId());
annComGroTopService.save(annComGroTop); annComGroTopService.save(annComGroTop);
return Result.OK(annComGroTop.getId()); }
return Result.OK(ndbsxzid);
}else{ }else{
return Result.OK(list.get(0).getId()); return Result.OK(ndbsxzid);
} }
} }

Loading…
Cancel
Save