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 *