|
|
|
|
@ -2,6 +2,7 @@ package cn.jyjz.xiaoyao.ocr.service.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
import cn.jyjz.flowable.common.SystemConstantsOa;
|
|
|
|
|
import cn.jyjz.flowable.service.IFlowInstanceService;
|
|
|
|
|
import cn.jyjz.flowable.service.IFlowTaskService;
|
|
|
|
|
import cn.jyjz.xiaoyao.common.base.param.ParamterPage;
|
|
|
|
|
import cn.jyjz.xiaoyao.common.base.service.UserTokenService;
|
|
|
|
|
@ -10,7 +11,9 @@ import cn.jyjz.xiaoyao.common.base.vo.ResultVo;
|
|
|
|
|
import cn.jyjz.xiaoyao.common.base.vo.ResultVoUtil;
|
|
|
|
|
import cn.jyjz.xiaoyao.common.base.vo.UserToken;
|
|
|
|
|
import cn.jyjz.xiaoyao.common.mybatisplus.util.SearchQueryFormat;
|
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.dataobject.Category;
|
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.dataobject.Userapprove;
|
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.service.CategoryService;
|
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.service.UserapproveService;
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.dataDao.OcrTaskchildPictureMybatisDao;
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.dataobject.OcrPicture;
|
|
|
|
|
@ -33,9 +36,12 @@ import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.flowable.task.api.Task;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.mock.web.MockHttpServletRequest;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import cn.jyjz.xiaoyao.common.mybatisplus.base.BaseServiceImpl;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.web.context.request.RequestContextHolder;
|
|
|
|
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
@ -62,6 +68,12 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
|
|
|
|
|
@Resource
|
|
|
|
|
private OcrPictureInfoService pictureInfoService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
IFlowInstanceService flowInstanceService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private CategoryService categoryService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 图片真假设置
|
|
|
|
|
*
|
|
|
|
|
@ -278,6 +290,41 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
|
|
|
|
|
return this.update(updateWrapper);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void createTask(List<OcrPicture> ocrPictureList, String tenantId, UserToken userToken) {
|
|
|
|
|
if (null != ocrPictureList && !ocrPictureList.isEmpty()) {
|
|
|
|
|
//用于标记相似度是否存在百分百的情况
|
|
|
|
|
for (OcrPicture ocrPicture : ocrPictureList) {
|
|
|
|
|
//查询项目对象
|
|
|
|
|
if (null == ocrPicture.getCategoryid()) {
|
|
|
|
|
//TODO 没有对应项目,返回提示信息
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
Category category = categoryService.getById(ocrPicture.getCategoryid());
|
|
|
|
|
if (null == category || StringUtils.isBlank(category.getProcessdefinitionid())) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
//创建工单,如果创建成功,增加标志,用于过滤条件使用
|
|
|
|
|
OcrTaskchildPicture ocrTaskchildPicture = this.create(ocrPicture, tenantId, userToken, null, null);
|
|
|
|
|
if (null != ocrTaskchildPicture) {
|
|
|
|
|
MockHttpServletRequest request = new MockHttpServletRequest();
|
|
|
|
|
RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request));
|
|
|
|
|
//发起流程
|
|
|
|
|
flowInstanceService.startProcessInstanceById(
|
|
|
|
|
category.getProcessdefinitionid(),
|
|
|
|
|
null,
|
|
|
|
|
request,
|
|
|
|
|
ocrTaskchildPicture.getId().toString(),
|
|
|
|
|
category.getServicename()
|
|
|
|
|
);
|
|
|
|
|
//TODO 需要测试
|
|
|
|
|
ocrPicture.setTaskchildpictureid(ocrTaskchildPicture.getId().toString());
|
|
|
|
|
ocrPictureService.updateById(ocrPicture);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询智能识别
|
|
|
|
|
*
|
|
|
|
|
|