Merge remote-tracking branch 'origin/master'

pull/1/head
lzCodeGarden 1 year ago
commit 542c9e10c1

File diff suppressed because it is too large Load Diff

@ -15,6 +15,7 @@ import javax.servlet.http.HttpServletRequest;
import cn.jyjz.xiaoyao.ocr.service.IOcrSearchHistoryService; import cn.jyjz.xiaoyao.ocr.service.IOcrSearchHistoryService;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* ocr * ocr
@ -42,10 +43,10 @@ public class OcrSearchHistoryController {
*/ */
@RequestMapping(value = "/searchList", method = RequestMethod.GET) @RequestMapping(value = "/searchList", method = RequestMethod.GET)
public ResultVo searchList(HttpServletRequest request, public ResultVo searchList(HttpServletRequest request,
@RequestParam(value = "search", required = false) String search) { @RequestParam(value = "search", required = true) String search) {
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request)); UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
//执行查询方法 //执行查询方法
List<String> selectsearch = ocrSearchHistoryService.selectsearch(search, userToken.getUsername()); List<List<Map<String, String>>> selectsearch = ocrSearchHistoryService.selectsearch(search, userToken.getLoginname());
OcrSearchHistory ocrsearchhistory =new OcrSearchHistory(); OcrSearchHistory ocrsearchhistory =new OcrSearchHistory();
ocrsearchhistory.setHistoryname(search); ocrsearchhistory.setHistoryname(search);

@ -2,6 +2,8 @@ package cn.jyjz.xiaoyao.ocr.controller;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -13,7 +15,9 @@ import cn.jyjz.xiaoyao.ocr.dataobject.OcrPicture;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture; import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture;
import cn.jyjz.xiaoyao.ocr.service.OcrPictureService; import cn.jyjz.xiaoyao.ocr.service.OcrPictureService;
import cn.jyjz.xiaoyao.ocr.service.OcrTaskchildPictureService; import cn.jyjz.xiaoyao.ocr.service.OcrTaskchildPictureService;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.beust.jcommander.Parameter; import com.beust.jcommander.Parameter;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
@ -21,7 +25,9 @@ import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -37,153 +43,165 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
@RestController @RestController
@RequestMapping("/backstage/jifen/ocrtaskchildpicture") @RequestMapping("/backstage/jifen/ocrtaskchildpicture")
public class OcrTaskchildPictureController extends BaseController{ public class OcrTaskchildPictureController extends BaseController {
private Logger log = LoggerFactory.getLogger(this.getClass()); private Logger log = LoggerFactory.getLogger(this.getClass());
@Resource @Resource
private OcrTaskchildPictureService ocrTaskchildPictureService; private OcrTaskchildPictureService ocrTaskchildPictureService;
@Resource @Resource
private OcrPictureService ocrPictureService; private OcrPictureService ocrPictureService;
@Resource @Resource
private UserTokenService userTokenService; private UserTokenService userTokenService;
@Resource @Resource
private UserService userService; private UserService userService;
/**
*jsondto /**
*mail.zhangyong@gmail.com * jsondto
*2024-01-14 10:27:01 * mail.zhangyong@gmail.com
**/ * 2024-01-14 10:27:01
@GetMapping("/list") **/
public ResultVo<IPage<OcrTaskchildPicture>> listOcrTaskchildPicture(ParamterPage paramterPage, HttpServletRequest request, HttpServletResponse response) throws IOException{ @GetMapping("/list")
SearchQuery searchQuery = this.getParametersStartingWithToSearchJson(request, "search_"); public ResultVo<IPage<OcrTaskchildPicture>> listOcrTaskchildPicture(ParamterPage paramterPage, HttpServletRequest request, HttpServletResponse response) throws IOException {
SearchQuery searchQuery = this.getParametersStartingWithToSearchJson(request, "search_");
OcrTaskchildPicture ocrtaskchildpicture = new OcrTaskchildPicture();
OcrTaskchildPicture ocrtaskchildpicture = new OcrTaskchildPicture();
QueryWrapper<OcrTaskchildPicture> queryWrapper = SearchQueryFormat.queryStringFormat(searchQuery,ocrtaskchildpicture);
IPage<OcrTaskchildPicture> page = this.ocrTaskchildPictureService.selectSearchListPage(paramterPage,queryWrapper);; QueryWrapper<OcrTaskchildPicture> queryWrapper = SearchQueryFormat.queryStringFormat(searchQuery, ocrtaskchildpicture);
return ResultVoUtil.success(page); IPage<OcrTaskchildPicture> page = this.ocrTaskchildPictureService.selectSearchListPage(paramterPage, queryWrapper);
} ;
return ResultVoUtil.success(page);
/** }
*jsondto
*mail.zhangyong@gmail.com /**
*2024-01-14 10:27:01 * jsondto
**/ * mail.zhangyong@gmail.com
@ApiOperation(value="ocr_任务包下的任务集合", notes="ocr_任务包下的任务集合") * 2024-01-14 10:27:01
@ApiImplicitParams({ **/
@ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true), @ApiOperation(value = "ocr_任务包下的任务集合", notes = "ocr_任务包下的任务集合")
@ApiImplicitParam(paramType = "path",name = "packageid", value = "任务包主键", required = true) @ApiImplicitParams({
}) @ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true),
@GetMapping("/listbypackageid/{packageid}") @ApiImplicitParam(paramType = "path", name = "packageid", value = "任务包主键", required = true)
public ResultVo<IPage<OcrTaskchildPicture>> listbypackageid(ParamterPage paramterPage, })
HttpServletRequest request, @GetMapping("/listbypackageid/{packageid}")
HttpServletResponse response, public ResultVo<IPage<OcrTaskchildPicture>> listbypackageid(ParamterPage paramterPage,
@PathVariable("packageid") String packageid) throws IOException{ HttpServletRequest request,
HttpServletResponse response,
//租户主键,由前端页面传送 @PathVariable("packageid") String packageid) throws IOException {
String tenantId = request.getHeader("X-Tenant-Id");
if(StringUtils.isBlank(tenantId)){ //租户主键,由前端页面传送
return ResultVoUtil.error("租户主键不能为空"); String tenantId = request.getHeader("X-Tenant-Id");
} if (StringUtils.isBlank(tenantId)) {
return ResultVoUtil.error("租户主键不能为空");
SearchQuery searchQuery = this.getParametersStartingWithToSearchJson(request, "search_"); }
OcrTaskchildPicture ocrtaskchildpicture = new OcrTaskchildPicture(); SearchQuery searchQuery = this.getParametersStartingWithToSearchJson(request, "search_");
QueryWrapper<OcrTaskchildPicture> queryWrapper = SearchQueryFormat.queryStringFormat(searchQuery,ocrtaskchildpicture);
OcrTaskchildPicture ocrtaskchildpicture = new OcrTaskchildPicture();
queryWrapper.eq("TENANTID",tenantId); QueryWrapper<OcrTaskchildPicture> queryWrapper = SearchQueryFormat.queryStringFormat(searchQuery, ocrtaskchildpicture);
if(StringUtils.isNotBlank(packageid)){
queryWrapper.eq("PACKAGEID",packageid); queryWrapper.eq("TENANTID", tenantId);
} if (StringUtils.isNotBlank(packageid)) {
IPage<OcrTaskchildPicture> page = this.ocrTaskchildPictureService.selectSearchListPage(paramterPage,queryWrapper); queryWrapper.eq("PACKAGEID", packageid);
}
QueryWrapper<OcrTaskchildPicture> queryWrapperNex = SearchQueryFormat.queryStringFormat(searchQuery,ocrtaskchildpicture); IPage<OcrTaskchildPicture> page = this.ocrTaskchildPictureService.selectSearchListPage(paramterPage, queryWrapper);
if(!page.getRecords().isEmpty()){ QueryWrapper<OcrTaskchildPicture> queryWrapperNex = SearchQueryFormat.queryStringFormat(searchQuery, ocrtaskchildpicture);
OcrTaskchildPicture ocrTaskchildPicture = page.getRecords().get(0);
queryWrapperNex.eq("TENANTID",tenantId); if (!page.getRecords().isEmpty()) {
queryWrapperNex.in("PICTUREID",ocrTaskchildPicture.getOcpictureid().split(",")); OcrTaskchildPicture ocrTaskchildPicture = page.getRecords().get(0);
queryWrapperNex.eq("TENANTID", tenantId);
page = this.ocrTaskchildPictureService.selectSearchListPage(paramterPage,queryWrapperNex); queryWrapperNex.in("PICTUREID", ocrTaskchildPicture.getOcpictureid().split(","));
}
page = this.ocrTaskchildPictureService.selectSearchListPage(paramterPage, queryWrapperNex);
return ResultVoUtil.success(page); }
}
return ResultVoUtil.success(page);
@ApiOperation(value="ocr_任务包下的当前图片比对的集合列表", notes="ocr_任务包下的当前图片比对的集合列表") }
@ApiImplicitParams({
@ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true), @ApiOperation(value = "ocr_任务包下的当前图片比对的集合列表", notes = "ocr_任务包下的当前图片比对的集合列表")
@ApiImplicitParam(paramType = "path",name = "packageid", value = "任务包主键"), @ApiImplicitParams({
@ApiImplicitParam(paramType = "path",name = "taskchildpictureid", value = "当前选中的任务主键", required = true) @ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true),
}) @ApiImplicitParam(paramType = "path", name = "packageid", value = "任务包主键"),
@GetMapping("/listbypictureid/{packageid}/{taskchildpictureid}") @ApiImplicitParam(paramType = "path", name = "taskchildpictureid", value = "当前选中的任务主键", required = true)
public ResultVo<IPage<OcrTaskchildPicture>> listbypackageidlistbypictureid(ParamterPage paramterPage, })
HttpServletRequest request, @GetMapping("/listbypictureid/{packageid}/{taskchildpictureid}")
HttpServletResponse response, public ResultVo<IPage<OcrTaskchildPicture>> listbypackageidlistbypictureid(ParamterPage paramterPage,
@PathVariable("packageid") String packageid, HttpServletRequest request,
@PathVariable("taskchildpictureid") String taskchildpictureid) throws IOException{ HttpServletResponse response,
@PathVariable("packageid") String packageid,
//租户主键,由前端页面传送 @PathVariable("taskchildpictureid") String taskchildpictureid) throws IOException {
String tenantId = request.getHeader("X-Tenant-Id");
if(StringUtils.isBlank(tenantId)){ //租户主键,由前端页面传送
return ResultVoUtil.error("租户主键不能为空"); String tenantId = request.getHeader("X-Tenant-Id");
} if (StringUtils.isBlank(tenantId)) {
return ResultVoUtil.error("租户主键不能为空");
//排序方式 }
String orderbyname = request.getParameter("orderbyname");
//排序字段 //排序方式
String orderbyvalue = request.getParameter("orderbyvalue"); String orderbyname = request.getParameter("orderbyname");
//排序字段
SearchQuery searchQuery = this.getParametersStartingWithToSearchJson(request, "search_"); String orderbyvalue = request.getParameter("orderbyvalue");
OcrTaskchildPicture ocrtaskchildpicture = new OcrTaskchildPicture(); SearchQuery searchQuery = this.getParametersStartingWithToSearchJson(request, "search_");
QueryWrapper<OcrTaskchildPicture> queryWrapper = SearchQueryFormat.queryStringFormat(searchQuery,ocrtaskchildpicture);
OcrTaskchildPicture ocrtaskchildpicture = new OcrTaskchildPicture();
//queryWrapper.eq("TENANTID",tenantId); QueryWrapper<OcrTaskchildPicture> queryWrapper = SearchQueryFormat.queryStringFormat(searchQuery, ocrtaskchildpicture);
//queryWrapper.eq("PACKAGEID",packageid);
//queryWrapper.eq("TENANTID",tenantId);
IPage<OcrTaskchildPicture> page = this.ocrTaskchildPictureService.listByPackageId(taskchildpictureid,paramterPage,queryWrapper,orderbyname,orderbyvalue, packageid,tenantId); //queryWrapper.eq("PACKAGEID",packageid);
return ResultVoUtil.success(page);
} IPage<OcrTaskchildPicture> page = this.ocrTaskchildPictureService.listByPackageId(taskchildpictureid, paramterPage, queryWrapper, orderbyname, orderbyvalue, packageid, tenantId);
List<JSONObject> collect = page.getRecords().stream().map(p -> {
/** JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(p));
* jsonObject.put("id", jsonObject.getOrDefault("id", null).toString());
* jsonObject.put("tenantid", jsonObject.getOrDefault("tenantid", null).toString());
* @param req jsonObject.put("packageid", jsonObject.getOrDefault("packageid", null).toString());
* @return return jsonObject;
*/ }).collect(Collectors.toList());
@ApiOperation(value="任务主图真假标记", notes="任务主图真假标记") IPage<JSONObject> objects = new Page<>();
@ApiImplicitParams({ BeanUtils.copyProperties(page, objects);
@ApiImplicitParam(paramType = "path",name = "taskchildpictureid", value = "任务主键", required = true), objects.setRecords(collect);
@ApiImplicitParam(paramType = "path",name = "izTrueorfalse", value = "主图片真假0:假1真", required = true), return ResultVoUtil.success(objects);
@ApiImplicitParam(paramType = "path",name = "judgeid", value = "主图判真假原因id,从字典表中获得", required = true), }
@ApiImplicitParam(paramType = "path",name = "judgedesc", value = "真假其他原因", required = false),
@ApiImplicitParam(paramType = "path",name = "packageid", value = "任务包主键", required = true) /**
}) *
@PostMapping(value = "/ordertrueorfalse") *
public ResultVo ordertrueorfalse(@RequestParam(name="taskchildpictureids",required=true) String taskchildpictureids, * @param req
@RequestParam(name="iztrueorfalse",required=true) String iztrueorfalse, * @return
@RequestParam(name="judgeid",required=true) String judgeid, */
@RequestParam(name="judgedesc",required=false) String judgedesc, @ApiOperation(value = "任务主图真假标记", notes = "任务主图真假标记")
@RequestParam(name="packageid",required=true) String packageid, @ApiImplicitParams({
HttpServletRequest req) { @ApiImplicitParam(paramType = "path", name = "taskchildpictureid", value = "任务主键", required = true),
//如果是历史图片,不允许进行设置 @ApiImplicitParam(paramType = "path", name = "izTrueorfalse", value = "主图片真假0:假1真", required = true),
//如果是已经审批完成的图片不允许是指 @ApiImplicitParam(paramType = "path", name = "judgeid", value = "主图判真假原因id,从字典表中获得", required = true),
@ApiImplicitParam(paramType = "path", name = "judgedesc", value = "真假其他原因", required = false),
OcrTaskchildPicture ocrTaskchildPicture = new OcrTaskchildPicture(); @ApiImplicitParam(paramType = "path", name = "packageid", value = "任务包主键", required = true)
})
ocrTaskchildPicture.setPackageid(Long.parseLong(packageid)); @PostMapping(value = "/ordertrueorfalse")
public ResultVo ordertrueorfalse(@RequestParam(name = "taskchildpictureids", required = true) String taskchildpictureids,
return ocrTaskchildPictureService.trueorfalse(taskchildpictureids,packageid,iztrueorfalse,judgeid,judgedesc); @RequestParam(name = "iztrueorfalse", required = true) String iztrueorfalse,
} @RequestParam(name = "judgeid", required = true) String judgeid,
@RequestParam(name = "judgedesc", required = false) String judgedesc,
/** @RequestParam(name = "packageid", required = true) String packageid,
* HttpServletRequest req) {
* //如果是历史图片,不允许进行设置
* @param req //如果是已经审批完成的图片不允许是指
* @return
*/ OcrTaskchildPicture ocrTaskchildPicture = new OcrTaskchildPicture();
ocrTaskchildPicture.setPackageid(Long.parseLong(packageid));
return ocrTaskchildPictureService.trueorfalse(taskchildpictureids, packageid, iztrueorfalse, judgeid, judgedesc);
}
/**
*
*
* @param req
* @return
*/
// @ApiOperation(value="任务清除标记", notes="任务清除标记") // @ApiOperation(value="任务清除标记", notes="任务清除标记")
// @ApiImplicitParams({ // @ApiImplicitParams({
// @ApiImplicitParam(paramType = "path",name = "taskchildpictureid", value = "任务主键", required = true), // @ApiImplicitParam(paramType = "path",name = "taskchildpictureid", value = "任务主键", required = true),
@ -202,135 +220,133 @@ public class OcrTaskchildPictureController extends BaseController{
// //
// return ocrTaskchildPictureService.clearmark(taskchildpictureid,packageid); // return ocrTaskchildPictureService.clearmark(taskchildpictureid,packageid);
// } // }
@ApiOperation(value = "任务清除标记", notes = "任务清除标记")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "path", name = "taskchildpictureid", value = "任务主键", required = true),
@ApiImplicitParam(paramType = "path", name = "packageid", value = "任务包主键", required = true)
})
@PostMapping(value = "/clearmark")
public ResultVo clearmark(@RequestParam(name = "taskchildpictureid", required = true) String taskchildpictureid,
@RequestParam(name = "packageid", required = true) String packageid,
HttpServletRequest request) {
//租户主键,由前端页面传送
String tenantId = request.getHeader("X-Tenant-Id");
if (StringUtils.isBlank(tenantId)) {
return ResultVoUtil.error("租户主键不能为空");
}
return ocrTaskchildPictureService.clearmark(tenantId, taskchildpictureid, packageid);
}
/**
*
*
* @param req
* @return
*/
@ApiOperation(value = "当前任务包智能识别", notes = "当前任务包智能识别")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "path", name = "packageid", value = "任务包主键", required = true)
})
@PostMapping(value = "/markpoint")
public ResultVo markpoint(@RequestParam(name = "packageid", required = true) String packageid,
HttpServletRequest req) {
//如果是历史图片,不允许进行设置
//如果是已经审批完成的图片不允许是指
OcrTaskchildPicture ocrTaskchildPicture = new OcrTaskchildPicture();
ocrTaskchildPicture.setPackageid(Long.parseLong(packageid));
List<OcrTaskchildPicture> list = ocrTaskchildPictureService.markpoint(packageid);
if (null != list && !list.isEmpty()) {
return ResultVoUtil.success(list);
}
return ResultVoUtil.error();
}
/**
*
* mail.zhangyong@gmail.com
* 2024-01-14 10:27:01
**/
@ApiOperation(value = "ocr_任务包下的当前展示的任务对象", notes = "ocr_任务包下的当前展示的任务对象")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "path", name = "id", value = "当前选中的任务主键", required = true),
@ApiImplicitParam(paramType = "path", name = "packageid", value = "任务包主键注意不是当前任务关联的packageid而是当前选中的任务包主键")
})
@GetMapping("/getdata/{id}/{packageid}")
@ResponseBody
public ResultVo getdateOcrTaskchildPicture(HttpServletResponse response, HttpServletRequest request,
@PathVariable("packageid") Long packageid,
@PathVariable("id") Long id) throws IOException {
OcrTaskchildPicture dto = this.ocrTaskchildPictureService.listPicturePackageId(id.toString(), packageid);
if (null != dto) {
return ResultVoUtil.success(dto);
} else {
return ResultVoUtil.error();
}
}
/**
*
* mail.zhangyong@gmail.com
* 2024-01-14 10:27:01
**/
@PostMapping("/save")
public ResultVo saveOcrTaskchildPicture(HttpServletResponse response, HttpServletRequest request, OcrTaskchildPicture tab) throws IOException {
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
this.ocrTaskchildPictureService.save(tab);
return ResultVoUtil.success();
}
/**
* form
* mail.zhangyong@gmail.com
* 2024-01-14 10:27:01
**/
@PostMapping("/edit")
public ResultVo editOcrTaskchildPicture(HttpServletResponse response, HttpServletRequest request, OcrTaskchildPicture tab) throws IOException {
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
this.ocrTaskchildPictureService.updateById(tab);
return ResultVoUtil.success();
}
/**
*
* mail.zhangyong@gmail.com
* 2024-01-14 10:27:01
**/
@ApiOperation(value = "根据任务或者工单主键查询图片对象", notes = "根据任务或者工单主键查询图片对象")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "path", name = "id", value = "任务审批中的formid或者id", required = true)
})
@GetMapping("/pictureinfo")
@ResponseBody
public ResultVo pictureinfo(HttpServletResponse response, HttpServletRequest request) throws IOException {
String id = request.getParameter("id");
OcrPicture dto = this.ocrTaskchildPictureService.findOcrPictureByTaskchildid(id);
if (null != dto) {
return ResultVoUtil.success(dto);
} else {
return ResultVoUtil.error();
}
}
@ApiOperation(value="任务清除标记", notes="任务清除标记") /**
@ApiImplicitParams({ * id1,2,3
@ApiImplicitParam(paramType = "path",name = "taskchildpictureid", value = "任务主键", required = true), * mail.zhangyong@gmail.com
@ApiImplicitParam(paramType = "path",name = "packageid", value = "任务包主键", required = true) * 2024-01-14 10:27:01
}) **/
@PostMapping(value = "/clearmark") @GetMapping("/delmore")
public ResultVo clearmark(@RequestParam(name="taskchildpictureid",required=true) String taskchildpictureid, @ResponseBody
@RequestParam(name="packageid",required=true) String packageid, public ResultVo delMoreOcrTaskchildPicture(HttpServletResponse response, HttpServletRequest request) throws IOException {
HttpServletRequest request) { String ids = request.getParameter("id");
//租户主键,由前端页面传送 this.ocrTaskchildPictureService.deleteByIdMore(ids);
String tenantId = request.getHeader("X-Tenant-Id"); return ResultVoUtil.success();
if(StringUtils.isBlank(tenantId)){ }
return ResultVoUtil.error("租户主键不能为空");
}
return ocrTaskchildPictureService.clearmark(tenantId,taskchildpictureid,packageid);
}
/**
*
*
* @param req
* @return
*/
@ApiOperation(value="当前任务包智能识别", notes="当前任务包智能识别")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "path",name = "packageid", value = "任务包主键", required = true)
})
@PostMapping(value = "/markpoint")
public ResultVo markpoint(@RequestParam(name="packageid",required=true) String packageid,
HttpServletRequest req) {
//如果是历史图片,不允许进行设置
//如果是已经审批完成的图片不允许是指
OcrTaskchildPicture ocrTaskchildPicture = new OcrTaskchildPicture();
ocrTaskchildPicture.setPackageid(Long.parseLong(packageid));
List<OcrTaskchildPicture> list = ocrTaskchildPictureService.markpoint(packageid);
if(null != list && !list.isEmpty()){
return ResultVoUtil.success(list);
}
return ResultVoUtil.error();
}
/**
*
*mail.zhangyong@gmail.com
*2024-01-14 10:27:01
**/
@ApiOperation(value="ocr_任务包下的当前展示的任务对象", notes="ocr_任务包下的当前展示的任务对象")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "path",name = "id", value = "当前选中的任务主键", required = true),
@ApiImplicitParam(paramType = "path",name = "packageid", value = "任务包主键注意不是当前任务关联的packageid而是当前选中的任务包主键")
})
@GetMapping("/getdata/{id}/{packageid}")
@ResponseBody
public ResultVo getdateOcrTaskchildPicture(HttpServletResponse response,HttpServletRequest request,
@PathVariable("packageid") Long packageid,
@PathVariable("id") Long id) throws IOException{
OcrTaskchildPicture dto = this.ocrTaskchildPictureService.listPicturePackageId(id.toString(),packageid);
if(null != dto){
return ResultVoUtil.success(dto);
}else{
return ResultVoUtil.error();
}
}
/**
*
*mail.zhangyong@gmail.com
*2024-01-14 10:27:01
**/
@PostMapping("/save")
public ResultVo saveOcrTaskchildPicture(HttpServletResponse response,HttpServletRequest request,OcrTaskchildPicture tab) throws IOException{
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
this.ocrTaskchildPictureService.save(tab);
return ResultVoUtil.success();
}
/**
*form
*mail.zhangyong@gmail.com
*2024-01-14 10:27:01
**/
@PostMapping("/edit")
public ResultVo editOcrTaskchildPicture(HttpServletResponse response,HttpServletRequest request,OcrTaskchildPicture tab) throws IOException{
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
this.ocrTaskchildPictureService.updateById(tab);
return ResultVoUtil.success();
}
/**
*
*mail.zhangyong@gmail.com
*2024-01-14 10:27:01
**/
@ApiOperation(value="根据任务或者工单主键查询图片对象", notes="根据任务或者工单主键查询图片对象")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "path",name = "id", value = "任务审批中的formid或者id", required = true)
})
@GetMapping("/pictureinfo")
@ResponseBody
public ResultVo pictureinfo(HttpServletResponse response,HttpServletRequest request) throws IOException{
String id = request.getParameter("id");
OcrPicture dto = this.ocrTaskchildPictureService.findOcrPictureByTaskchildid(id);
if(null != dto){
return ResultVoUtil.success(dto);
}else{
return ResultVoUtil.error();
}
}
/**
*id1,2,3
*mail.zhangyong@gmail.com
*2024-01-14 10:27:01
**/
@GetMapping("/delmore")
@ResponseBody
public ResultVo delMoreOcrTaskchildPicture(HttpServletResponse response,HttpServletRequest request) throws IOException{
String ids = request.getParameter("id");
this.ocrTaskchildPictureService.deleteByIdMore(ids);
return ResultVoUtil.success();
}
} }

@ -20,7 +20,11 @@ import java.util.Map;
*/ */
@Mapper @Mapper
public interface OcrSearchHistoryMapper extends BaseMapper<OcrSearchHistory> { public interface OcrSearchHistoryMapper extends BaseMapper<OcrSearchHistory> {
List<String> selectsearch(@Param("search")String search,@Param("assignee") String assignee); List<Map<String,String>> selectsearch1(@Param("search")String search,@Param("assignee") String assignee);
List<Map<String,String>> selectsearch2(@Param("search")String search,@Param("assignee") String assignee);
List<Map<String,String>> selectsearch3(@Param("search")String search,@Param("assignee") String assignee);

@ -221,6 +221,10 @@ public class OcrTaskchildPicture implements BaseDto,java.io.Serializable {
@TableField(exist = false) @TableField(exist = false)
private OcrPicture ocrPicture; private OcrPicture ocrPicture;
@ApiModelProperty(value ="提报时间")
@TableField(exist = false)
private String reporttime;
@ApiModelProperty(value ="审查日志") @ApiModelProperty(value ="审查日志")
@TableField(exist = false) @TableField(exist = false)
private List<Userapprove> userapproveList; private List<Userapprove> userapproveList;

@ -17,7 +17,7 @@ import java.util.Map;
* @since 2024-03-15 * @since 2024-03-15
*/ */
public interface IOcrSearchHistoryService extends IService<OcrSearchHistory> { public interface IOcrSearchHistoryService extends IService<OcrSearchHistory> {
List<String> selectsearch(String search,String assignee); List<List<Map<String,String>>> selectsearch(String search,String assignee);
Map<Object,Object> toolscount(String userid); Map<Object,Object> toolscount(String userid);
} }

@ -31,9 +31,10 @@ public class OcrFieldServiceImpl extends BaseServiceImpl<OcrFieldMybatisDao, Ocr
List<OcrFieldDto> ocrFieldDtoList = new ArrayList<>(); List<OcrFieldDto> ocrFieldDtoList = new ArrayList<>();
try { try {
LambdaQueryWrapper<OcrField> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<OcrField> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.and(qw -> qw.eq(OcrField::getIsrequired, 2) // 检查是否必选字段为 2 // queryWrapper.and(qw -> qw.eq(OcrField::getIsrequired, 2) // 检查是否必选字段为 2
.or() // .or()
.eq(OcrField::getReviewType, reviewType)); // 检查评审类型// 检查评审类型 // .eq(OcrField::getReviewType, reviewType)); // 检查评审类型// 检查评审类型
queryWrapper.eq(OcrField::getReviewType,reviewType);
queryWrapper.eq(OcrField::getDel, 0); queryWrapper.eq(OcrField::getDel, 0);
List<OcrField> ocrFieldList = this.list(queryWrapper); List<OcrField> ocrFieldList = this.list(queryWrapper);
if(ocrFieldList.size()>0){ if(ocrFieldList.size()>0){

@ -7,6 +7,7 @@ import org.springframework.stereotype.Service;
import cn.jyjz.xiaoyao.ocr.dataDao.OcrSearchHistoryMapper; import cn.jyjz.xiaoyao.ocr.dataDao.OcrSearchHistoryMapper;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -26,8 +27,19 @@ public class OcrSearchHistoryServiceImpl extends ServiceImpl<OcrSearchHistoryMap
OcrSearchHistoryMapper ocrsearchhistorymapper; OcrSearchHistoryMapper ocrsearchhistorymapper;
@Override @Override
public List<String> selectsearch(String search, String assignee) { public List<List<Map<String,String>>> selectsearch(String search, String assignee) {
return ocrsearchhistorymapper.selectsearch(search,assignee); List<Map<String,String>> strings1 = ocrsearchhistorymapper.selectsearch1(search, assignee);
List<Map<String,String>> strings2 = ocrsearchhistorymapper.selectsearch2(search, assignee);
List<Map<String,String>> strings3 = ocrsearchhistorymapper.selectsearch3(search, assignee);
List<List<Map<String,String>>> list = new ArrayList<>();
list.add(strings1);
list.add(strings2);
list.add(strings3);
return list;
} }
@Override @Override

@ -15,11 +15,15 @@ import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPictureAppro; import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPictureAppro;
import cn.jyjz.xiaoyao.ocr.service.OcrPictureService; import cn.jyjz.xiaoyao.ocr.service.OcrPictureService;
import cn.jyjz.xiaoyao.ocr.service.OcrTaskchildPictureService; import cn.jyjz.xiaoyao.ocr.service.OcrTaskchildPictureService;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.flowable.task.api.Task; import org.flowable.task.api.Task;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -102,10 +106,10 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
return this.ocrPictureService.updateBatchById(saveList) ? ResultVoUtil.success() : ResultVoUtil.error(); return this.ocrPictureService.updateBatchById(saveList) ? ResultVoUtil.success() : ResultVoUtil.error();
} }
public ResultVo clearmark(String tenantId,String childpictureids, String packageid) { public ResultVo clearmark(String tenantId, String childpictureids, String packageid) {
String selectocpicture = ocrtaskchildpicturemybatisdao.selectocpicture(tenantId, packageid ,childpictureids); String selectocpicture = ocrtaskchildpicturemybatisdao.selectocpicture(tenantId, packageid, childpictureids);
String[] cps = selectocpicture.split(","); String[] cps = selectocpicture.split(",");
@ -337,7 +341,7 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
OcrTaskchildPicture mainOcrTaskchildPicture = this.getById(taskchildpictureid); OcrTaskchildPicture mainOcrTaskchildPicture = this.getById(taskchildpictureid);
//判断当前图片是否为历史图片 //判断当前图片是否为历史图片
if (null != packageid && null != mainOcrTaskchildPicture.getPackageid() && !packageid.equals(mainOcrTaskchildPicture.getPackageid().toString())) { if (null != packageid && null != mainOcrTaskchildPicture && null != mainOcrTaskchildPicture.getPackageid() && !packageid.equals(mainOcrTaskchildPicture.getPackageid().toString())) {
QueryWrapper<OcrTaskchildPicture> queryWrapperNew = new QueryWrapper<>(); QueryWrapper<OcrTaskchildPicture> queryWrapperNew = new QueryWrapper<>();
queryWrapperNew.eq("TENANTID", tenantId); queryWrapperNew.eq("TENANTID", tenantId);
@ -381,7 +385,6 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
this.formatTask(iPage.getRecords(), packageid); this.formatTask(iPage.getRecords(), packageid);
return iPage; return iPage;
} }

@ -67,7 +67,7 @@ public class PictureDisposeTask implements Runnable{
picture.setCategoryid(251374070600303007L); picture.setCategoryid(251374070600303007L);
//项目名称 //项目名称
picture.setPicturename(pictureSourceResult.getProjectName()); picture.setProjectidname(pictureSourceResult.getProjectName());
//项目状态 //项目状态
if(pictureSourceResult.getProjectNo()!=null) { if(pictureSourceResult.getProjectNo()!=null) {
picture.setProjectstatus(pictureSourceResult.getProjectNo().toString()); picture.setProjectstatus(pictureSourceResult.getProjectNo().toString());
@ -152,8 +152,8 @@ public class PictureDisposeTask implements Runnable{
//拜访项目类别 //拜访项目类别
if(pictureSourceResult.getProjectType()!=null){ if(pictureSourceResult.getProjectType()!=null){
if(pictureSourceResult.getTerminalLevel().get("name")!=null){ if(pictureSourceResult.getProjectType().get("name")!=null){
picture.setField17(pictureSourceResult.getTerminalLevel().get("name").toString()); picture.setField17(pictureSourceResult.getProjectType().get("name").toString());
} }
} }
//拜访品种 //拜访品种

@ -15,27 +15,63 @@
id, historyname, userid, createdate id, historyname, userid, createdate
</sql> </sql>
<select id="selectsearch" resultType="map"> <select id="selectsearch1" resultType="map">
SELECT SELECT
r.ID,CONCAT_WS( "-", img.taskName, img.planName ) AS aiName
CONCAT_WS("-",r.FROMTASKNAME,t.planName) as name
FROM FROM
ocr_taskchild_picture r ocr_taskchild_picture r
LEFT JOIN ocr_picture t ON r.PICTUREID = t.ID LEFT JOIN ocr_packagetask t ON r.PACKAGEID = t.ID
LEFT JOIN ocr_picture img ON FIND_IN_SET(img.ID,r.OCPICTUREID)
WHERE WHERE
r.STATES='1' -- r.STATES = '1' AND
and r.ASSIGNEE = #{assignee}
r.ASSIGNEE=#{assignee} AND (r.PACKAGEID LIKE "%"#{search}"%"
AND OR img.taskName LIKE "%"#{search}"%"
r.FROMTASKID like "%"#{search}"%" OR img.field1 LIKE "%"#{search}"%"
OR r.FROMTASKNAME like "%"#{search}"%" OR img.field3 LIKE "%"#{search}"%")
OR t.field1 like "%"#{search}"%" ORDER BY
ORDER BY r.CREATEDATE DESC r.CREATEDATE DESC
LIMIT 3 LIMIT 3
</select>
<select id="selectsearch2" resultType="map">
SELECT
r.ID,CONCAT_WS( "-", img.taskName, img.planName ) AS preliminaryName
FROM
ocr_taskchild_picture r
LEFT JOIN ocr_packagetask t ON r.PACKAGEID = t.ID
LEFT JOIN ocr_picture img ON FIND_IN_SET(img.ID,r.OCPICTUREID)
WHERE
r.ASSIGNEE = #{assignee}
AND r.taskName IN ( '一级审批', '二级审批' )
AND (r.PACKAGEID LIKE "%"#{search}"%"
OR img.taskName LIKE "%"#{search}"%"
OR img.field1 LIKE "%"#{search}"%"
OR img.field3 LIKE "%"#{search}"%")
ORDER BY
r.CREATEDATE DESC
LIMIT 3
</select>
<select id="selectsearch3" resultType="map">
SELECT
r.ID,CONCAT_WS( "-", img.taskName, img.planName ) AS finalName
FROM
ocr_taskchild_picture r
LEFT JOIN ocr_packagetask t ON r.PACKAGEID = t.ID
LEFT JOIN ocr_picture img ON FIND_IN_SET(img.ID,r.OCPICTUREID)
WHERE
r.ASSIGNEE = #{assignee}
AND r.taskName = '三级审批'
AND (r.PACKAGEID LIKE "%"#{search}"%"
OR img.taskName LIKE "%"#{search}"%"
OR img.field1 LIKE "%"#{search}"%"
OR img.field3 LIKE "%"#{search}"%")
ORDER BY
r.CREATEDATE DESC
LIMIT 3
</select> </select>

@ -168,7 +168,7 @@
</sql> </sql>
<select id="listFinal" resultType="cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture" parameterType="java.util.Map"> <select id="listFinal" resultType="cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture" parameterType="java.util.Map">
select tcp.* from ( select tcp.*,pic.field11 reporttime from (
select select
tc.* tc.*
from ocr_taskchild_picture tc,OA_USERFINAL_T uf from ocr_taskchild_picture tc,OA_USERFINAL_T uf
@ -179,9 +179,8 @@ select tcp.* from (
tc.* tc.*
from ocr_taskchild_picture tc from ocr_taskchild_picture tc
where tc.STATES = 5 where tc.STATES = 5
) as tcp ) as tcp,ocr_picture pic
where tcp.PICTUREID = pic.ID
<include refid="Base_Where_union"></include> <include refid="Base_Where_union"></include>
<if test="fromuptimeStart != null"> and tcp.fromuptime &gt;= ${fromuptimeStart} </if> <if test="fromuptimeStart != null"> and tcp.fromuptime &gt;= ${fromuptimeStart} </if>
<if test="fromuptimeEnd != null"> and tcp.fromuptime &lt;= ${fromuptimeEnd} </if> <if test="fromuptimeEnd != null"> and tcp.fromuptime &lt;= ${fromuptimeEnd} </if>

@ -284,3 +284,4 @@ ocr:
localImagePath: /server/data/images #图片本地存储地址 localImagePath: /server/data/images #图片本地存储地址
image: image:
similarityPath: http://47.93.59.251/ai/api/similarity/ similarityPath: http://47.93.59.251/ai/api/similarity/
classifyPath: http://47.93.59.251/api/classify/

Loading…
Cancel
Save