作品分配逻辑重写

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,
HttpServletRequest req,@RequestParam(name="xmtmid",required=true) String xmtmid) {
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);
IPage<AnnComGroTopP> pageList = annComGroTopPService.page(page, queryWrapper);
return Result.OK(pageList);

@ -152,27 +152,35 @@ public class ChaoseTopicPersionController extends JeecgController<ChaoseTopicPer
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req,@RequestParam(name="xmtmid",required=true) String xmtmid) {
AnnComGroTop annComGroTop = annComGroTopService.getById(xmtmid);
QueryWrapper<UpfilePersion> queryWrapper = QueryGenerator.initQueryWrapper(upfilePersion, req.getParameterMap());
queryWrapper.eq("annual_id",annComGroTop.getAnnid());
queryWrapper.eq("annual_comp_point_id",annComGroTop.getAnnComP());
queryWrapper.eq("status","0");
AnnComGroTopP annComGroTopP = new AnnComGroTopP();
QueryWrapper<AnnComGroTopP> queryWrapperagt = QueryGenerator.initQueryWrapper(annComGroTopP, req.getParameterMap());
//queryWrapperagt.eq("ann_com_gro_topid",xmtmid);
queryWrapperagt.eq("annid",annComGroTop.getAnnid());
queryWrapperagt.eq("ann_com_p",annComGroTop.getAnnComP());
List<AnnComGroTopP> listact = annComGroTopPService.list(queryWrapperagt);
String str = "";
for(int i = 0 ; i<listact.size();i++){
str = str+listact.get(i).getBmcode()+",";
}
if(str!=""){
queryWrapper.notIn("apply_code",str.split(","));
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.eq("annual_id",listtop.get(0).getAnnid());
queryWrapper.eq("annual_comp_point_id",listtop.get(0).getAnnComP());
queryWrapper.eq("status","0");
AnnComGroTopP annComGroTopP = new AnnComGroTopP();
QueryWrapper<AnnComGroTopP> queryWrapperagt = QueryGenerator.initQueryWrapper(annComGroTopP, req.getParameterMap());
//queryWrapperagt.eq("ann_com_gro_topid",xmtmid);
queryWrapperagt.eq("annid",listtop.get(0).getAnnid());
queryWrapperagt.eq("ann_com_p",listtop.get(0).getAnnComP());
List<AnnComGroTopP> listact = annComGroTopPService.list(queryWrapperagt);
String str = "";
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 = "报名编号-添加")
// @RequiresPermissions("chooseTopicPersion:chaose_topic_persion:add")
@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(",");
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++){
UpfilePersion upfilePersion = upfilePersionService.getById(strs[i]);
AnnComGroTopP annComGroTopP = new AnnComGroTopP();
annComGroTopP.setAnnComGroTopid(xmtmid);
annComGroTopP.setBmcode(upfilePersion.getApplyCode());
annComGroTopP.setAnnid(annComGroTop.getAnnid());
annComGroTopP.setAnnComP(annComGroTop.getAnnComP());
annComGroTopP.setAnnComPG(annComGroTop.getAnnComPG());
annComGroTopP.setTopicName(upfilePersion.getTopicName());
annComGroTopPService.save(annComGroTopP);
for (int k = 0 ; k < listtop.size() ;k++){
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.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("绑定成功!");
}

@ -148,14 +148,21 @@ public class TopicController extends JeecgController<Topic, ITopicService> {
queryWrapper.eq("ann_com_p_g",ndbsxzid);
List<AnnComGroTop> list = annComGroTopService.list(queryWrapper);
if(list.size()==0){
AnnComGroTop annComGroTop = new AnnComGroTop();
annComGroTop.setAnnid(annualCompGroup.getAnnal());
annComGroTop.setAnnComP(annualCompGroup.getAnnCompP());
annComGroTop.setAnnComPG(ndbsxzid);
annComGroTopService.save(annComGroTop);
return Result.OK(annComGroTop.getId());
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.setAnnid(annualCompGroup.getAnnal());
annComGroTop.setAnnComP(annualCompGroup.getAnnCompP());
annComGroTop.setAnnComPG(ndbsxzid);
annComGroTop.setTopid(listTopic.get(i).getId());
annComGroTopService.save(annComGroTop);
}
return Result.OK(ndbsxzid);
}else{
return Result.OK(list.get(0).getId());
return Result.OK(ndbsxzid);
}
}

Loading…
Cancel
Save