From 3d4bd8d941da9783d38ed822af86e0f9abee1af7 Mon Sep 17 00:00:00 2001 From: Gitea Date: Tue, 29 Oct 2024 17:19:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E6=96=B0=E5=88=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InnovationVoucherController.java | 107 +++++++++++++++++- 1 file changed, 106 insertions(+), 1 deletion(-) diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/innovationvoucher/controller/InnovationVoucherController.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/innovationvoucher/controller/InnovationVoucherController.java index d04baa0..275e769 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/innovationvoucher/controller/InnovationVoucherController.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/innovationvoucher/controller/InnovationVoucherController.java @@ -121,6 +121,57 @@ public class InnovationVoucherController extends JeecgController> queryPageList2(InnovationVoucher innovationVoucher, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(innovationVoucher, req.getParameterMap()); + queryWrapper.eq("pro_dept",loginUser.getOrgId()); + queryWrapper.eq("state","3"); + Page page = new Page(pageNo, pageSize); + IPage pageList = innovationVoucherService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 分页列表查询 + * + * @param innovationVoucher + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "创新券表-分页列表查询") + @ApiOperation(value="创新券表-分页列表查询", notes="创新券表-分页列表查询") + @GetMapping(value = "/list3") + public Result> queryPageList3(InnovationVoucher innovationVoucher, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(innovationVoucher, req.getParameterMap()); + queryWrapper.eq("apply_dept",loginUser.getOrgId()); + queryWrapper.eq("state","3"); + queryWrapper.eq("use_state","1"); + Page page = new Page(pageNo, pageSize); + IPage pageList = innovationVoucherService.page(page, queryWrapper); + return Result.OK(pageList); + } + /** * 添加 * @@ -175,7 +226,7 @@ public class InnovationVoucherController extends JeecgController edit2(@RequestBody InnovationVoucher innovationVoucher) { + public Result edit1(@RequestBody InnovationVoucher innovationVoucher) { LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); if(sysDepartService.getById(loginUser.getOrgId()).getOrgCategory().equals("3")){ innovationVoucher.setFlag("1"); @@ -187,6 +238,23 @@ public class InnovationVoucherController extends JeecgController edit2(@RequestBody InnovationVoucher innovationVoucher) { + innovationVoucher.setUseState("1"); + innovationVoucher.setSfState(""); + innovationVoucherService.updateById(innovationVoucher); + return Result.OK("使用成功!"); + } + /** * 通过id删除 * @@ -287,6 +355,43 @@ public class InnovationVoucherController extends JeecgController tysy(@RequestParam(name="id",required=true) String id) { + InnovationVoucher innovationVoucher = innovationVoucherService.getById(id); + if(innovationVoucher==null) { + return Result.error("未找到对应数据"); + } + innovationVoucher.setSfState("0"); + innovationVoucherService.updateById(innovationVoucher); + return Result.OK("同意使用成功!"); + } + /** + * 拒绝使用 + * + * @param id + * @return + */ + @ApiOperation(value="拒绝使用", notes="拒绝使用") + @GetMapping(value = "/jjsy") + public Result jjsy(@RequestParam(name="id",required=true) String id) { + InnovationVoucher innovationVoucher = innovationVoucherService.getById(id); + if(innovationVoucher==null) { + return Result.error("未找到对应数据"); + } + innovationVoucher.setSfState("1"); + innovationVoucher.setUseState("0"); + innovationVoucherService.updateById(innovationVoucher); + return Result.OK("拒绝使用成功!"); + } + + /** * 导出excel *