master
Gitea 4 weeks ago
parent 94cd876c7c
commit 3d4bd8d941
  1. 107
      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<InnovationVouch
return Result.OK(null);
}
/**
* 分页列表查询
*
* @param innovationVoucher
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "创新券表-分页列表查询")
@ApiOperation(value="创新券表-分页列表查询", notes="创新券表-分页列表查询")
@GetMapping(value = "/list2")
public Result<IPage<InnovationVoucher>> 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<InnovationVoucher> queryWrapper = QueryGenerator.initQueryWrapper(innovationVoucher, req.getParameterMap());
queryWrapper.eq("pro_dept",loginUser.getOrgId());
queryWrapper.eq("state","3");
Page<InnovationVoucher> page = new Page<InnovationVoucher>(pageNo, pageSize);
IPage<InnovationVoucher> 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<IPage<InnovationVoucher>> 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<InnovationVoucher> queryWrapper = QueryGenerator.initQueryWrapper(innovationVoucher, req.getParameterMap());
queryWrapper.eq("apply_dept",loginUser.getOrgId());
queryWrapper.eq("state","3");
queryWrapper.eq("use_state","1");
Page<InnovationVoucher> page = new Page<InnovationVoucher>(pageNo, pageSize);
IPage<InnovationVoucher> pageList = innovationVoucherService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
@ -175,7 +226,7 @@ public class InnovationVoucherController extends JeecgController<InnovationVouch
@ApiOperation(value="仪器信息表-编辑", notes="仪器信息表-编辑")
//@RequiresPermissions("instrument:instrument:edit")
@RequestMapping(value = "/edit1", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit2(@RequestBody InnovationVoucher innovationVoucher) {
public Result<String> 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<InnovationVouch
return Result.OK("驳回成功!");
}
/**
* 编辑
*
* @param innovationVoucher
* @return
*/
@AutoLog(value = "仪器信息表-编辑")
@ApiOperation(value="仪器信息表-编辑", notes="仪器信息表-编辑")
//@RequiresPermissions("instrument:instrument:edit")
@RequestMapping(value = "/edit2", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> 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<InnovationVouch
return Result.OK("审核通过成功!");
}
/**
* 同意使用
*
* @param id
* @return
*/
@ApiOperation(value="同意使用", notes="同意使用")
@GetMapping(value = "/tysy")
public Result<InnovationVoucher> 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<InnovationVoucher> 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
*

Loading…
Cancel
Save