From 9033513859159743a21c19dfe2b43c92cb5f31eb Mon Sep 17 00:00:00 2001 From: Gitea Date: Sat, 6 Jul 2024 18:20:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=86=E9=85=8D=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E9=87=8D=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AnnComGroTopPController.java | 2 +- .../ChaoseTopicPersionController.java | 82 ++++++++++++------- .../topic/controller/TopicController.java | 21 +++-- 3 files changed, 66 insertions(+), 39 deletions(-) diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/anncomgrotopp/controller/AnnComGroTopPController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/anncomgrotopp/controller/AnnComGroTopPController.java index a4fb4e30..da4c4505 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/anncomgrotopp/controller/AnnComGroTopPController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/anncomgrotopp/controller/AnnComGroTopPController.java @@ -68,7 +68,7 @@ public class AnnComGroTopPController extends JeecgController queryWrapper = QueryGenerator.initQueryWrapper(annComGroTopP, req.getParameterMap()); - queryWrapper.eq("ann_com_gro_topid",xmtmid); + queryWrapper.eq("ann_com_p_g",xmtmid); Page page = new Page(pageNo, pageSize); IPage pageList = annComGroTopPService.page(page, queryWrapper); return Result.OK(pageList); diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/chooseTopicPersion/controller/ChaoseTopicPersionController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/chooseTopicPersion/controller/ChaoseTopicPersionController.java index 78759840..ff587ece 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/chooseTopicPersion/controller/ChaoseTopicPersionController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/chooseTopicPersion/controller/ChaoseTopicPersionController.java @@ -152,27 +152,35 @@ public class ChaoseTopicPersionController extends JeecgController 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 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 listact = annComGroTopPService.list(queryWrapperagt); - String str = ""; - for(int i = 0 ; i queryWrappertop = QueryGenerator.initQueryWrapper(annComGroTop, req.getParameterMap()); + queryWrappertop.eq("ann_com_p_g",xmtmid); + List listtop = annComGroTopService.list(queryWrappertop); + if(listtop.size()>0){ + QueryWrapper 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 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 listact = annComGroTopPService.list(queryWrapperagt); + String str = ""; + for(int i = 0 ; i page = new Page<>(pageNo, pageSize); + IPage pageList = upfilePersionService.page(page, queryWrapper); + return Result.OK(pageList); + }else{ + return Result.OK(null); } - Page page = new Page<>(pageNo, pageSize); - IPage pageList = upfilePersionService.page(page, queryWrapper); - return Result.OK(pageList); + } /** @@ -185,19 +193,31 @@ public class ChaoseTopicPersionController extends JeecgController bmbhadd(@RequestParam(name="ids",required=true) String ids,@RequestParam(name="xmtmid",required=true) String xmtmid) { + public Result 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 queryWrapper = QueryGenerator.initQueryWrapper(annComGroTop, req.getParameterMap()); + queryWrapper.eq("ann_com_p_g",xmtmid); + List 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 queryWrapperctp = QueryGenerator.initQueryWrapper(chaoseTopicPersion, req.getParameterMap()); + queryWrapperctp.eq("bmcode",upfilePersion.getApplyCode()); + List 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("绑定成功!"); } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/topic/controller/TopicController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/topic/controller/TopicController.java index c0a66441..749523b7 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/topic/controller/TopicController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/topic/controller/TopicController.java @@ -148,14 +148,21 @@ public class TopicController extends JeecgController { queryWrapper.eq("ann_com_p_g",ndbsxzid); List 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 queryWrappertopic = QueryGenerator.initQueryWrapper(topic, req.getParameterMap()); + queryWrappertopic.eq("annual_compid",annualCompGroup.getAnnCompP()); + List 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); } }