|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
package cn.jyjz.xiaoyao.ocr.controller;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import cn.jyjz.xiaoyao.admin.dataobject.Post;
|
|
|
|
|
import cn.jyjz.xiaoyao.admin.service.UserService;
|
|
|
|
|
import cn.jyjz.xiaoyao.common.base.controller.BaseController;
|
|
|
|
|
import cn.jyjz.xiaoyao.common.base.param.ParamterPage;
|
|
|
|
|
import cn.jyjz.xiaoyao.common.base.util.RequestBaseUtil;
|
|
|
|
@ -30,6 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
@ -42,21 +45,30 @@ public class OcrFieldController extends BaseController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private OcrFieldService ocrFieldService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private UserService userService;
|
|
|
|
|
/**
|
|
|
|
|
* 自定义筛选字段列表查询
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value="根据评审类型查询字段列表", notes="根据评审类型查询字段列表")
|
|
|
|
|
@GetMapping(value = "/list")
|
|
|
|
|
public ResultVo<IPage<OcrField>> list(@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
|
|
|
@RequestParam(name="reviewType") @ApiParam(value = "字段类型(终审:0,工单:1、一审二审:2、审核填报:3)") Integer reviewType,
|
|
|
|
|
@RequestParam(name="name") @ApiParam(value = "字段名称") String name) {
|
|
|
|
|
public ResultVo<IPage<OcrField>> list(@RequestParam(name="start", defaultValue="1") Integer start,
|
|
|
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
|
|
|
HttpServletRequest request) {
|
|
|
|
|
|
|
|
|
|
SearchQuery searchQuery = this.getParametersStartingWithToSearchJson(request, "search_");
|
|
|
|
|
|
|
|
|
|
cn.jyjz.xiaoyao.admin.dataobject.User user = this.userService.getSessionUser(request);
|
|
|
|
|
OcrField ocrField = new OcrField();
|
|
|
|
|
ocrField.setSearchQueryrolesShowleave(user.getSearchQueryrolesShowleave());
|
|
|
|
|
QueryWrapper<OcrField> queryWrapper = SearchQueryFormat.queryStringFormat(searchQuery,ocrField);
|
|
|
|
|
ResultVo<IPage<OcrField>> resultVo = new ResultVo<>();
|
|
|
|
|
ParamterPage paramterPage = new ParamterPage();
|
|
|
|
|
paramterPage.setPagesize(pageSize);
|
|
|
|
|
paramterPage.setStart(pageNo);
|
|
|
|
|
IPage<OcrField> ocrFieldIPage = ocrFieldService.list(paramterPage,reviewType,name);
|
|
|
|
|
paramterPage.setStart(start);
|
|
|
|
|
IPage<OcrField> ocrFieldIPage = ocrFieldService.list(paramterPage,queryWrapper);
|
|
|
|
|
resultVo.setData(ocrFieldIPage);
|
|
|
|
|
resultVo.addOK("查询成功");
|
|
|
|
|
return resultVo;
|
|
|
|
@ -92,9 +104,9 @@ public class OcrFieldController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value="删除筛选字段", notes="删除筛选字段")
|
|
|
|
|
@GetMapping(value = "/getData")
|
|
|
|
|
public ResultVo getData(@RequestParam(name="id") @ApiParam(value = "字段ID", required = true) Long id) {
|
|
|
|
|
@ApiOperation(value="详情", notes="详情")
|
|
|
|
|
@GetMapping(value = "/getData/{id}")
|
|
|
|
|
public ResultVo getData(@PathVariable(name="id") @ApiParam(value = "字段ID", required = true) Long id) {
|
|
|
|
|
return ResultVoUtil.success(ocrFieldService.getById(id));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -104,9 +116,9 @@ public class OcrFieldController extends BaseController {
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value="字段新增和修改", notes="字段新增和修改")
|
|
|
|
|
@PostMapping(value = "/saveOrUpdate")
|
|
|
|
|
public ResultVo saveOrUpdate(@ApiParam(value = "字段信息", required = true) @RequestBody OcrFieldVo ocrFieldVo) {
|
|
|
|
|
public ResultVo saveOrUpdate(@ApiParam(value = "字段信息", required = true) OcrFieldVo ocrFieldVo) {
|
|
|
|
|
try {
|
|
|
|
|
ocrFieldService.saveData(BeanUtil.copyProperties(ocrFieldVo,OcrField.class));
|
|
|
|
|
return ocrFieldService.saveData(BeanUtil.copyProperties(ocrFieldVo,OcrField.class));
|
|
|
|
|
} catch (BeansException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|