Merge branch 'master' into dev-cui

# Conflicts:
#	runstart/src/main/resources/application-dev.yml
pull/1/head
DELL 2 years ago
commit ff01c25373

@ -120,6 +120,10 @@
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
</dependencies>
</project>

@ -295,7 +295,7 @@ public class FlowTaskController extends BaseController {
//如果assigneeId 为空查询发起流程,否则查询待办流程
if(StringUtils.isNotBlank(assigneeId) && assigneeId.equals(user.getId().toString())){
searchQuery.addEqual("assignee",user.getLoginname());
// searchQuery.addEqual("states",SystemConstantsOa.OA_STATUS_TYPE_ING.toString());
searchQuery.addEqual("states",SystemConstantsOa.OA_STATUS_TYPE_ING.toString());
}else{
searchQuery.addEqual("createuser",user.getLoginname());
}
@ -318,7 +318,52 @@ public class FlowTaskController extends BaseController {
}
return ResultVoUtil.success(pageUtils);
}
/**
*
*
* @return
*/
@ApiOperation(value="我的任务", notes="查询我的待办、已经办理任务")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true),
})
@GetMapping("/listalldata")
@ResponseBody
public ResultVo listAlldata(PageUtils pageUtils, HttpServletRequest request){
SearchQuery searchQuery = this.getParametersStartingWithToSearchJson(request,"search_");
//租户主键,由前端页面传送
String tenantId = request.getHeader("X-Tenant-Id");
if(org.apache.commons.lang3.StringUtils.isBlank(tenantId)){
return ResultVoUtil.error("租户主键不能为空");
}
User user = this.userService.getSessionUser(request);
if(user.isUserIsSys(xiaoyaoConfig.getWebconfig().getSysLoginUser().split(","))){
flowTaskService.getMyProcessInstances(searchQuery.getQuery(),pageUtils);
}else{
flowTaskService.getMyProcessInstances(user,tenantId,searchQuery.getQuery(),pageUtils);
//待办信息,增加是否查看标记
// if(StringUtils.isNotBlank(assigneeId) && assigneeId.equals(user.getId().toString())){
//
// List list = pageUtils.getList();
// if(null != list && !list.isEmpty()){
// int count = list.size();
// for(int i = 0;i < count;i++){
// FlowUnionVo flowUnionVo = (FlowUnionVo) list.get(i);
// //flowUnionVo.setView(userViewApproeService.haveByFromid(flowUnionVo.getFormid().toString()));
// }
// }
//
// }
}
return ResultVoUtil.success(pageUtils);
}
/**
*
* @return
@ -501,4 +546,18 @@ public class FlowTaskController extends BaseController {
//return ResultVoUtil.success();
}
/**
*
* @return
*/
@ApiOperation(value="重复流程", notes="重复流程")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true),
})
@GetMapping("/repetitionTask")
@ResponseBody
public ResultVo repetitionTask(HttpServletRequest request){
return flowTaskService.repetitionTask();
}
}

@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.sql.Blob;
import java.sql.Date;
import java.time.LocalDateTime;
@TableName("act_de_model")
public class DeModel implements Serializable {

@ -6,6 +6,7 @@ import cn.jyjz.flowable.domain.vo.FlowTaskCompleteVO;
import cn.jyjz.flowable.domain.vo.FlowTaskVO;
import cn.jyjz.flowable.domain.vo.WorkFlowNodeVO;
import cn.jyjz.flowable.utils.PageUtils;
import cn.jyjz.xiaoyao.admin.dataobject.User;
import cn.jyjz.xiaoyao.common.base.param.ParamterPage;
import cn.jyjz.xiaoyao.common.base.vo.ResultVo;
import cn.jyjz.xiaoyao.common.base.vo.UserToken;
@ -27,11 +28,11 @@ public interface IFlowTaskService {
InputStream diagram(String processId);
InputStream myDiagram(String processId,HttpServletRequest request);
InputStream myDiagram(String processId, HttpServletRequest request);
Category viewForm(String processId, HttpServletRequest request);
Boolean complete(FlowTaskVO taskVO,HttpServletRequest request);
Boolean complete(FlowTaskVO taskVO, HttpServletRequest request);
/**
* 退
@ -43,12 +44,14 @@ public interface IFlowTaskService {
/**
*
*
* @param
* @param processDefinition
*/
public void updateAssignee(String processInstanceId,String processDefinitionId, ProcessDefinition processDefinition);
public void updateAssignee(String processInstanceId, String processDefinitionId, ProcessDefinition processDefinition);
void finishedList(PageUtils pageUtils, HttpServletRequest request);
void finishedList(PageUtils pageUtils,HttpServletRequest request);
/**
*
*
@ -56,7 +59,16 @@ public interface IFlowTaskService {
* @param pageUtils
* @return
*/
public void getMyProcessInstances( Map<String, Object> query, PageUtils<FlowUnionVo> pageUtils);
public void getMyProcessInstances(Map<String, Object> query, PageUtils<FlowUnionVo> pageUtils);
/**
*
*
* @param user
* @param tenantId
* @param pageUtils
*/
public void getMyProcessInstances(User user,String tenantId, Map<String, Object> query,PageUtils pageUtils);
/**
*
@ -65,41 +77,50 @@ public interface IFlowTaskService {
* @param pageUtils
* @return
*/
public void getFinalProcessInstances( Map<String, Object> query, PageUtils<OcrTaskchildPicture> pageUtils);
public void getFinalProcessInstances(Map<String, Object> query, PageUtils<OcrTaskchildPicture> pageUtils);
/**
*
*
*
* @param query
* @return
*/
public List<FlowUnionVo> getMyProcessInstances(Map<String, Object> query);
/**
*
*
* @return
*/
public IPage<FlowUnionVo> getMyListCc(Map<String, Object> query, UserToken userToken, ParamterPage paramterPage);
/**
*
*
* @return
*/
public List<HistoricTaskInstanceDto> listHistoriceTask(String processInstanceId);
/**
*
*
* @param processInstanceId
* @return
*/
public List<String> listTask(String processInstanceId);
/**
*
*
*
* @param processInstanceId
*/
public FlowTaskCompleteVO updateNowTaskAssignee(String processInstanceId, String processDefinitionId);
/**
*
*
* @param processInstanceId
* @return
*/
@ -109,8 +130,10 @@ public interface IFlowTaskService {
*
*/
public List<Task> nowRunTask(String processInstanceId, String processDefinitionId);
/**
*
*
* @param taskId
* @param reason
*/
@ -118,7 +141,15 @@ public interface IFlowTaskService {
/**
*
*
* @param fromid
*/
public ResultVo removeTask(String fromid,String taskid );
public ResultVo removeTask(String fromid, String taskid);
/**
*
*
* @return
*/
ResultVo repetitionTask();
}

@ -15,19 +15,14 @@ import cn.jyjz.xiaoyao.common.base.util.RequestBaseUtil;
import cn.jyjz.xiaoyao.common.base.util.SpringUtils;
import cn.jyjz.xiaoyao.common.base.util.StringUtils;
import cn.jyjz.xiaoyao.common.base.vo.UserToken;
import cn.jyjz.xiaoyao.framework.security.model.AdminUserModel;
import cn.jyjz.xiaoyao.framework.security.service.FlowableUserLoginService;
import cn.jyjz.xiaoyao.oa.from.service.UserViewapproeService;
import lombok.extern.slf4j.Slf4j;
import org.flowable.bpmn.model.*;
import org.flowable.engine.RepositoryService;
import org.flowable.engine.impl.bpmn.behavior.ParallelMultiInstanceBehavior;
import org.flowable.engine.repository.ProcessDefinition;
import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.task.api.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.context.request.RequestContextHolder;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@ -48,148 +43,154 @@ public class FlowInstanceServiceImpl extends FlowServiceFactory implements IFlow
private IFlowTaskService flowTaskService;
@Resource
private UserViewapproeService userViewApproeService;
@Override
public boolean startProcessInstanceById(String procDefId, Map<String, Object> variables, HttpServletRequest request,String formid,String servicename) {
public boolean startProcessInstanceById(String procDefId, Map<String, Object> variables, HttpServletRequest request, String formid, String servicename) {
IFormCustomService iFormCustomService = null;
if(StringUtils.isNotBlank(servicename)){
if (StringUtils.isNotBlank(servicename)) {
iFormCustomService = SpringUtils.getBean(servicename);
}
if(StringUtils.isBlank(formid) ){
if (StringUtils.isBlank(formid)) {
//表单主键
formid = iFormCustomService.saveForm(request);
}
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
String userName = userToken.getLoginname();
String token = RequestBaseUtil.getToken(request);
String userName = "";
if (StringUtils.isBlank(token)) {
userName = "admin";
} else {
UserToken userToken = this.userTokenService.getUserToken(token);
userName = userToken.getLoginname();
}
// 绑定当前认证的账号 我们的认证系统如果使用的是 SpringSecurity的话默认就会设置当前登录的账号
//identityService.setAuthenticatedUserId(userName);
if(null == variables){
if (null == variables) {
variables = new HashMap<>();
}
variables.put("loginUser",userName);
variables.put("loginUser", userName);
//根据流程定义信息
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(procDefId).singleResult();
//业务key 用于待办已办 扩展字段 展示使用
//我这里以 流程定义key(oa_category_t定义的关键字逻辑唯一) + 业务表主键(请假表、调岗表等) + 业务表对应的servicename
String businessKey= userToken.getLoginname() + SystemConstantsOa.OA_BUSSINESS_KEY_SPLIT+ formid + SystemConstantsOa.OA_BUSSINESS_KEY_SPLIT+ servicename;
String businessKey = userName + SystemConstantsOa.OA_BUSSINESS_KEY_SPLIT + formid + SystemConstantsOa.OA_BUSSINESS_KEY_SPLIT + servicename;
ProcessInstance processInstance = null;
//启动了一个流程实例
try {
variables.put("businessKey",businessKey);
processInstance = runtimeService.startProcessInstanceById(procDefId,businessKey,variables) ;
variables.put("businessKey", businessKey);
processInstance = runtimeService.startProcessInstanceById(procDefId, businessKey, variables);
if(null != iFormCustomService){
FlowTaskCompleteVO flowTaskCompleteVO = flowTaskService.updateNowTaskAssignee(processInstance.getProcessInstanceId(),processInstance.getProcessDefinitionId());
if (null != iFormCustomService) {
FlowTaskCompleteVO flowTaskCompleteVO = flowTaskService.updateNowTaskAssignee(processInstance.getProcessInstanceId(), processInstance.getProcessDefinitionId());
if(null == flowTaskCompleteVO){
if (null == flowTaskCompleteVO) {
throw new ServiceException("没有审批人,请联系管理员,流程定义:" + businessKey);
}
List<Task> list = this.flowTaskService.nowRunTask(processInstance.getProcessInstanceId(),processInstance.getProcessDefinitionId());
List<Task> list = this.flowTaskService.nowRunTask(processInstance.getProcessInstanceId(), processInstance.getProcessDefinitionId());
String taskname = "";
if(null != list && !list.isEmpty()){
if (null != list && !list.isEmpty()) {
taskname = list.get(0).getName();
}
//保存instanceId到数据库需要根据流程分类进行判断更新
boolean isupdate = iFormCustomService.updateForm(formid,processDefinition.getDeploymentId(),processDefinition.getId(),flowTaskCompleteVO.getAssignee(),flowTaskCompleteVO.getTaskId(),processInstance.getProcessInstanceId(),taskname);
if(isupdate){
boolean isupdate = iFormCustomService.updateForm(formid, processDefinition.getDeploymentId(), processDefinition.getId(), flowTaskCompleteVO.getAssignee(), flowTaskCompleteVO.getTaskId(), processInstance.getProcessInstanceId(), taskname);
if (isupdate) {
FlowModelVO flowModelVO = iFormCustomService.getForm(formid);
//增加未查看记录
userViewApproeService.saveUserViewApproe(flowTaskCompleteVO.getAssignee(),formid,flowModelVO.getTenantid().toString());
userViewApproeService.saveUserViewApproe(flowTaskCompleteVO.getAssignee(), formid, flowModelVO.getTenantid().toString());
}
}
log.info("流程启动成功:procDefId:{}",procDefId);
log.info("流程启动成功:procDefId:{}", procDefId);
return true;
}catch (Exception e){
log.error("流程启动失败:procDefId:{}",procDefId);
log.error("流程启动失败:e:{}",e);
} catch (Exception e) {
log.error("流程启动失败:procDefId:{}", procDefId);
log.error("流程启动失败:e:{}", e);
//删除流程
if(null != processInstance){
if (null != processInstance) {
runtimeService.deleteProcessInstance(processInstance.getProcessInstanceId(), SystemMessage.SYS_OA_START_ERROR);
historyService.deleteHistoricProcessInstance(processInstance.getProcessInstanceId());
}
if(StringUtils.isNotBlank(servicename) && StringUtils.isNotBlank(formid)){
if (StringUtils.isNotBlank(servicename) && StringUtils.isNotBlank(formid)) {
iFormCustomService.delForm(formid);
}
}finally {
RequestContextHolder.resetRequestAttributes();
}
return false;
}
@Override
public boolean startProcessInstanceById(String procDefId, String userName,String createuser, String formid,String servicename) {
public boolean startProcessInstanceById(String procDefId, String userName, String createuser, String formid, String servicename) {
IFormCustomService iFormCustomService = null;
if(StringUtils.isNotBlank(servicename)){
if (StringUtils.isNotBlank(servicename)) {
iFormCustomService = SpringUtils.getBean(servicename);
}
if(StringUtils.isBlank(formid) ){
if (StringUtils.isBlank(formid)) {
//表单主键
return false;
}
Map<String, Object> variables = new HashMap<>();
variables.put("loginUser",userName);
variables.put("loginUser", userName);
//根据流程定义信息
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(procDefId).singleResult();
//业务key 用于待办已办 扩展字段 展示使用
//我这里以 流程定义key(oa_category_t定义的关键字逻辑唯一) + 业务表主键(请假表、调岗表等) + 业务表对应的servicename
String businessKey= createuser + SystemConstantsOa.OA_BUSSINESS_KEY_SPLIT+ formid + SystemConstantsOa.OA_BUSSINESS_KEY_SPLIT+ servicename;
String businessKey = createuser + SystemConstantsOa.OA_BUSSINESS_KEY_SPLIT + formid + SystemConstantsOa.OA_BUSSINESS_KEY_SPLIT + servicename;
ProcessInstance processInstance = null;
//启动了一个流程实例
try {
variables.put("businessKey",businessKey);
processInstance = runtimeService.startProcessInstanceById(procDefId,businessKey,variables) ;
variables.put("businessKey", businessKey);
processInstance = runtimeService.startProcessInstanceById(procDefId, businessKey, variables);
if(null != iFormCustomService){
FlowTaskCompleteVO flowTaskCompleteVO = flowTaskService.updateNowTaskAssignee(processInstance.getProcessInstanceId(),processInstance.getProcessDefinitionId());
if (null != iFormCustomService) {
FlowTaskCompleteVO flowTaskCompleteVO = flowTaskService.updateNowTaskAssignee(processInstance.getProcessInstanceId(), processInstance.getProcessDefinitionId());
if(null == flowTaskCompleteVO){
if (null == flowTaskCompleteVO) {
throw new ServiceException("没有审批人,请联系管理员,流程定义:" + businessKey);
}
List<Task> list = this.flowTaskService.nowRunTask(processInstance.getProcessInstanceId(),processInstance.getProcessDefinitionId());
List<Task> list = this.flowTaskService.nowRunTask(processInstance.getProcessInstanceId(), processInstance.getProcessDefinitionId());
String taskname = "";
if(null != list && !list.isEmpty()){
if (null != list && !list.isEmpty()) {
taskname = list.get(0).getName();
}
//保存instanceId到数据库需要根据流程分类进行判断更新
boolean isupdate = iFormCustomService.updateForm(formid,processDefinition.getDeploymentId(),processDefinition.getId(),flowTaskCompleteVO.getAssignee(),flowTaskCompleteVO.getTaskId(),processInstance.getProcessInstanceId(),taskname);
if(isupdate){
boolean isupdate = iFormCustomService.updateForm(formid, processDefinition.getDeploymentId(), processDefinition.getId(), flowTaskCompleteVO.getAssignee(), flowTaskCompleteVO.getTaskId(), processInstance.getProcessInstanceId(), taskname);
if (isupdate) {
FlowModelVO flowModelVO = iFormCustomService.getForm(formid);
//增加未查看记录
userViewApproeService.saveUserViewApproe(flowTaskCompleteVO.getAssignee(),formid,flowModelVO.getTenantid().toString());
userViewApproeService.saveUserViewApproe(flowTaskCompleteVO.getAssignee(), formid, flowModelVO.getTenantid().toString());
}
}
log.info("流程启动成功:procDefId:{}",procDefId);
log.info("流程启动成功:procDefId:{}", procDefId);
return true;
}catch (Exception e){
log.error("流程启动失败:procDefId:{}",procDefId);
log.error("流程启动失败:e:{}",e);
} catch (Exception e) {
log.error("流程启动失败:procDefId:{}", procDefId);
log.error("流程启动失败:e:{}", e);
//删除流程
if(null != processInstance){
if (null != processInstance) {
runtimeService.deleteProcessInstance(processInstance.getProcessInstanceId(), SystemMessage.SYS_OA_START_ERROR);
historyService.deleteHistoricProcessInstance(processInstance.getProcessInstanceId());
}
if(StringUtils.isNotBlank(servicename) && StringUtils.isNotBlank(formid)){
if (StringUtils.isNotBlank(servicename) && StringUtils.isNotBlank(formid)) {
iFormCustomService.delForm(formid);
}
}

@ -32,6 +32,7 @@ import cn.jyjz.xiaoyao.oa.from.service.*;
import cn.jyjz.xiaoyao.oa.from.vo.FlowUnionVo;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPictureAppro;
import cn.jyjz.xiaoyao.ocr.service.OcrTaskchildPictureService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -1122,6 +1123,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
HistoricTaskInstanceDto dto = new HistoricTaskInstanceDto();
dto.setTaskId(taskHiInstance.getId());
dto.setTaskName(taskHiInstance.getName());
flowUnionVo.setNodeName(taskHiInstance.getName());
dto.setFinishTime(taskHiInstance.getEndTime());
if(taskHiInstance.getDurationInMillis() != null){
dto.setDuration(taskHiInstance.getDurationInMillis()/1000 + "秒");
@ -1177,6 +1179,134 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
}
/**
*
*
* @param user
* @param tenantId
* @param pageUtils
*/
public void getMyProcessInstances(User user,String tenantId,Map<String, Object> searchQuery, PageUtils pageUtils){
ParamterPage paramterPage = new ParamterPage();
paramterPage.setStart((pageUtils.getCurrPage() - 1) * pageUtils.getPageSize());
paramterPage.setPagesize(pageUtils.getPageSize());
if(StringUtils.isNotBlank(pageUtils.getSortname())){
paramterPage.setSortname(pageUtils.getSortname());
}else{
paramterPage.setSortname("CREATEDATE");
}
if(StringUtils.isNotBlank(pageUtils.getSortorder())){
paramterPage.setSortorder(pageUtils.getSortorder());
}else{
paramterPage.setSortorder("DESC");
}
Map<String, Object> query = new HashMap<>();
query.put("page",paramterPage);
query.put("thisLoginUserid",user.getId().toString());
query.put("searchtenantid",tenantId);
//我的待办数据
query.put("searchassignee",user.getLoginname());
query.putAll(searchQuery);
Long count = ocrTaskchildPictureService.listmytaskCount(query);
query.put("page",paramterPage);
List<OcrTaskchildPictureAppro> list = ocrTaskchildPictureService.listmytask(query);
for(OcrTaskchildPictureAppro taskchildPicture:list){
//查询对应的流程分类
Category category = categoryService.selectDtoById(taskchildPicture.getCategoryid());
taskchildPicture.setCategoryDto(category);
if(StringUtils.isNotBlank(taskchildPicture.getProcessdefinitionid())){
List<Task> taskList = this.nowRunTask(taskchildPicture.getProcessinstanceid(),taskchildPicture.getProcessdefinitionid());
if(null != taskList && !taskList.isEmpty()){
taskchildPicture.setTaskId(taskList.get(0).getId());
Task tasknow =taskService.createTaskQuery().taskId(taskchildPicture.getTaskId()).singleResult();
BpmnModel bpmnModel = repositoryService.getBpmnModel(tasknow.getProcessDefinitionId());
// 获取节点定义id
String taskDefinitionKey = tasknow.getTaskDefinitionKey();
// 根据节点定义id获取节点元素
FlowElement flowElement = bpmnModel.getFlowElement(taskDefinitionKey);
if (flowElement instanceof UserTask) {
UserTask userTask = (UserTask) flowElement;
taskchildPicture.setDocumentation(userTask.getDocumentation());
}
}
//查询历史
List<HistoricTaskInstanceDto> historicTaskInstanceDtos = new ArrayList<>();
// 查询当前任务的流转信息
List<HistoricTaskInstance> taskHiInstances = historyService.createHistoricTaskInstanceQuery()
.processInstanceId(taskchildPicture.getProcessinstanceid())
.includeProcessVariables()
.orderByHistoricTaskInstanceStartTime()
.asc()
.list();
for (HistoricTaskInstance taskHiInstance : taskHiInstances) {
HistoricTaskInstanceDto dto = new HistoricTaskInstanceDto();
dto.setTaskId(taskHiInstance.getId());
dto.setTaskName(taskHiInstance.getName());
dto.setFinishTime(taskHiInstance.getEndTime());
if(taskHiInstance.getDurationInMillis() != null){
dto.setDuration(taskHiInstance.getDurationInMillis()/1000 + "秒");
}
dto.setTaskDefKey(taskHiInstance.getTaskDefinitionKey());
//Map<String,Object> variables = taskHiInstance.getTaskLocalVariables();
Map<String,Object> variables = taskHiInstance.getProcessVariables();
if(null != variables && null != variables.get("approvd")){
dto.setState(variables.get("approvd").toString());
}
if(StringUtils.isNotBlank(taskHiInstance.getAssignee())){
if(SystemConstantsOa.OA_TASK_SKIP_ASSIGINE.equals(taskHiInstance.getAssignee())){
dto.setAssigneeName(taskHiInstance.getAssignee());
}else{
User user1 = userService.findByLoginname(taskHiInstance.getAssignee());
dto.setAssigneeName(user1.getUsername());
}
}
BpmnModel bpmnModel = repositoryService.getBpmnModel(taskchildPicture.getProcessdefinitionid());
// // 根据节点定义id获取节点元素
FlowElement flowElement = bpmnModel.getFlowElement(taskHiInstance.getTaskDefinitionKey());
if (flowElement instanceof UserTask) {
UserTask userTask = (UserTask) flowElement;
taskchildPicture.setDocumentation(userTask.getDocumentation());
}
// 还需要根据 HistoricTaskInstance 找到对应的 审批意见
List<Comment> processInstanceComments = taskService.getProcessInstanceComments(taskchildPicture.getProcessinstanceid());
for (Comment comment : processInstanceComments) {
if(comment.getTaskId().equals(taskHiInstance.getId())){
// 审批意见
String fullMessage = comment.getFullMessage();
dto.setComment(fullMessage);
}
}
historicTaskInstanceDtos.add(dto);
}
taskchildPicture.setTransferRecords(historicTaskInstanceDtos);
}
}
pageUtils.setTotalCount(count.intValue());
pageUtils.setList(list);
}
/**
*
*
@ -1458,4 +1588,9 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
return ResultVoUtil.success();
}
@Override
public ResultVo repetitionTask() {
return ResultVoUtil.success(flowableccMybatisDao.repetitionTask());
}
}

@ -35,4 +35,6 @@ public interface FlowableccMybatisDao extends BaseMapper<Flowablecc> {
* @return
*/
List<UserDistionaryVo> selectUserByFromid(String fromid);
List<Map<String,Object>> repetitionTask();
}

@ -7,13 +7,10 @@ import cn.jyjz.xiaoyao.ocr.api.entity.PictureSourceParameter;
import cn.jyjz.xiaoyao.ocr.api.entity.PictureSourceResult;
import cn.jyjz.xiaoyao.ocr.api.utils.ApiPage;
import cn.jyjz.xiaoyao.ocr.thread.TaskQueue;
import org.apache.commons.lang.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.time.Instant;
import java.util.Date;
@ -64,7 +61,7 @@ public class ApiTestController {
}
size++;
//将可以处理数据放入处理队列中
TaskQueue.pictureDownloadPushData(pictureSourceResult);
TaskQueue.pictureDisposePushData(pictureSourceResult);
}
return "当前区间内图片总数:"+count+"条,本次获取:"+localCount+"条,可处理数据:"+size+"条";
} catch (Exception e) {

@ -2,31 +2,24 @@ package cn.jyjz.xiaoyao.ocr.controller;
import cn.jyjz.xiaoyao.common.base.service.UserTokenService;
import cn.jyjz.xiaoyao.common.base.util.RequestBaseUtil;
import cn.jyjz.xiaoyao.common.base.util.StringUtils;
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.oa.from.dataobject.Candidateuser;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrMsg;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrMsgRead;
import cn.jyjz.xiaoyao.ocr.service.IOcrMsgService;
import cn.jyjz.xiaoyao.ocr.util.PageRequest;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletRequest;
import cn.jyjz.xiaoyao.ocr.service.IOcrMsgReadService;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -54,11 +47,12 @@ public class OcrMsgReadController {
/**
*
*
* @return
*/
@ApiOperation(value = "系统消息分页", notes = "系统消息分页")
@RequestMapping(value = "/systemPage", method = RequestMethod.GET)
public ResponseEntity<?> systemPage(HttpServletRequest request,
public ResultVo systemPage(HttpServletRequest request,
@RequestParam(value = "pageNo", required = false, defaultValue = "1") int pageNo,
@RequestParam(value = "pageSize", required = false, defaultValue = "10") int pageSize,
@RequestParam(value = "msgCategory", required = false) String msgCategory) {
@ -76,7 +70,8 @@ public class OcrMsgReadController {
PageInfo<List<Map<Object, String>>> findPage = iocrmsgservice.selectPage(pageQuery,userToken.getUserid(),msgCategory);
//执行查询方法
return new ResponseEntity<Object>(findPage, HttpStatus.OK);
// return new ResponseEntity<Object>(findPage, HttpStatus.OK);
return ResultVoUtil.success(findPage);
}
@ -90,30 +85,32 @@ public class OcrMsgReadController {
*/
@ApiOperation(value = "消息详情", notes = "消息详情")
@RequestMapping(value = "/msgOne", method = RequestMethod.GET)
public ResponseEntity<?> msgOne(@RequestParam(value = "id", required = false)String id) {
public ResultVo msgOne(@RequestParam(value = "id", required = false)String id) {
QueryWrapper<OcrMsg> wrapper = new QueryWrapper<>();
wrapper.select("titile","msg_content as msgContent","sender","msg_category as msgCategory","send_time as sendTime");
wrapper.eq("id", id);
//执行查询方法
OcrMsg one = iocrmsgservice.getOne(wrapper);
// QueryWrapper<OcrMsg> wrapper = new QueryWrapper<>();
// wrapper.select("titile","msg_content as msgContent","'系统管理员' as qweqwe","sender","msg_category as msgCategory","send_time as sendTime");
// wrapper.eq("id", id);
// //执行查询方法
// OcrMsg one = iocrmsgservice.getOne(wrapper);
return new ResponseEntity<Object>(one,HttpStatus.OK);
Map<Object, String> selectone = iocrmsgservice.selectone(id);
return ResultVoUtil.success(selectone);
}
/**
*
*
* @return
*/
@ApiOperation(value = "消除未读所有", notes = "消除未读所有")
@RequestMapping(value = "eliminateUnreadfull", method = RequestMethod.POST)
public ResponseEntity<?> eliminateUnreadfull(HttpServletRequest request,@RequestParam(value = "msgCategory", required = false)String msgCategory) {
public ResultVo eliminateUnreadfull(HttpServletRequest request, @RequestParam(value = "msgCategory", required = false)String msgCategory) {
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
QueryWrapper<OcrMsg> wrapperlist = new QueryWrapper<>();
wrapperlist.select("id").eq("msg_category",msgCategory).eq("send_status","1").apply("FIND_IN_SET('"+userToken.getUserid()+"',receive_user_ids)");
wrapperlist.select("id").eq("msg_category",msgCategory).eq("send_status","1").apply(" FIND_IN_SET('"+userToken.getUserid()+"',receive_user_ids)");
QueryWrapper<OcrMsgRead> wrapperone = new QueryWrapper<>();
@ -134,12 +131,13 @@ public class OcrMsgReadController {
}
}
//此处需要手工处理 返回需要将修改后的数据返回
return new ResponseEntity<Object>("true",HttpStatus.OK);
// return new ResponseEntity<Object>("true",HttpStatus.OK);
return ResultVoUtil.success(ResultVo.SUCCESS);
}
@ApiOperation(value = "消除未读单个", notes = "消除未读单个")
@RequestMapping(value = "eliminateUnreadone", method = RequestMethod.POST)
public ResponseEntity<?> eliminateUnreadone(HttpServletRequest request,@RequestParam(value = "msgid", required = false)String msgid) {
public ResultVo eliminateUnreadone(HttpServletRequest request, @RequestParam(value = "msgid", required = false)String msgid) {
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
@ -156,7 +154,8 @@ public class OcrMsgReadController {
boolean save = ocrMsgReadService.save(ocrmsgread);
//此处需要手工处理 返回需要将修改后的数据返回
return new ResponseEntity<Object>(save,HttpStatus.OK);
// return new ResponseEntity<Object>(save,HttpStatus.OK);
return ResultVoUtil.success(save);
}
}

@ -212,16 +212,9 @@ public class OcrPictureController extends BaseController{
QueryWrapper<OcrPicture> queryWrapper = new QueryWrapper<>();
//是否查询历史记录
String search_history = req.getParameter("search_history");
//判断是否需要查询历史记录
if(search_history.equals("0")){
queryWrapper.eq("taskstatus", search_history);
}
String search_month = req.getParameter("search_month");
if(StringUtils.isNotBlank(search_month) && Integer.parseInt(search_month) <= 12 && Integer.parseInt(search_month) > 0){
queryWrapper.le("create_time",DataUtil.afterDateByMonth(Integer.parseInt(search_month)));
queryWrapper.ge("create_time",DataUtil.afterDateByMonth(Integer.parseInt(search_month)));
}
//根据参数枚举获取检索参数并映射为数据库的字段的key-v map

@ -1,18 +1,13 @@
package cn.jyjz.xiaoyao.ocr.controller;
import cn.jyjz.xiaoyao.admin.dataobject.Tenant;
import cn.jyjz.xiaoyao.admin.dataobject.User;
import cn.jyjz.xiaoyao.admin.service.TenantService;
import cn.jyjz.xiaoyao.common.base.controller.BaseController;
import cn.jyjz.xiaoyao.common.base.vo.ResultVo;
import cn.jyjz.xiaoyao.common.base.vo.ResultVoUtil;
import cn.jyjz.xiaoyao.common.redis.cache.ICacheManager;
import cn.jyjz.xiaoyao.common.redis.cache.constants.CacheConstants;
import cn.jyjz.xiaoyao.framework.security.service.SmsLoginService;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrMsg;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrSUserT;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrSearchHistory;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture;
import cn.jyjz.xiaoyao.ocr.service.OcrISUserTService;
import cn.jyjz.xiaoyao.ocr.service.OcrTaskchildPictureService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -21,19 +16,11 @@ import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestParam;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@ -62,11 +49,12 @@ public class OcrSUserTController {
@Autowired
OcrTaskchildPictureService ocrtaskchildpictureservice;
/**
/**
*
*/
@ApiOperation(value = "重置密码", notes = "重置密码")
@RequestMapping(value = "/updateSUser", method = RequestMethod.POST)
public ResponseEntity<?> updateSUser(@RequestBody Map<String,String> map) {
public ResultVo updateSUser(@RequestBody Map<String,String> map) {
// System.out.println(map);
// Map<String, String> map=new HashMap<String,String>();
@ -82,34 +70,39 @@ public class OcrSUserTController {
boolean update = sUserTService.update(updatewrapper);
if(update){
return new ResponseEntity<Object>("密码重设成功!",HttpStatus.OK);
// return new ResponseEntity<Object>("密码重设成功!",HttpStatus.OK);
return ResultVoUtil.error(ResultVo.SUCCESS,"密码重设成功!");
}
}else{
return new ResponseEntity<Object>("两次密码输入不一致!",HttpStatus.OK);
// return new ResponseEntity<Object>("两次密码输入不一致!",HttpStatus.OK);
return ResultVoUtil.error(ResultVo.SUCCESS,"两次密码输入不一致!");
}
}else{
return new ResponseEntity<Object>("请再次输入新密码!",HttpStatus.OK);
// return new ResponseEntity<Object>("请再次输入新密码!",HttpStatus.OK);
return ResultVoUtil.error(ResultVo.SUCCESS,"请再次输入新密码!");
}
}else{
return new ResponseEntity<Object>("请输入新密码!",HttpStatus.OK);
// return new ResponseEntity<Object>("请输入新密码!",HttpStatus.OK);
return ResultVoUtil.error(ResultVo.SUCCESS,"请输入新密码!");
}
}else {
return new ResponseEntity<Object>("请输入同时包含英文、数字的8~16位密码",HttpStatus.OK);
// return new ResponseEntity<Object>("请输入同时包含英文、数字的8~16位密码",HttpStatus.OK);
return ResultVoUtil.error(ResultVo.SUCCESS,"请输入同时包含英文、数字的8~16位密码");
}
return new ResponseEntity<Object>(HttpStatus.OK);
return ResultVoUtil.error(ResultVo.SUCCESS);
}
@ApiOperation(value = "忘记密码", notes = "忘记密码")
@RequestMapping(value = "/selectSUser", method = RequestMethod.POST)
public ResponseEntity<?> selectSUser(@RequestBody Map<String,Object> map) {
public ResultVo selectSUser(@RequestBody Map<String,Object> map) {
if(null!=map.get("loginname")){
if(null!=map.get("phone")){
@ -134,35 +127,44 @@ public class OcrSUserTController {
if(!StringUtils.isBlank(sysCode) && !sysCode.equals(map.get("phone").toString())){
Map<Object, String> list = new HashMap<>();
list.put("loginname",map.get("loginname").toString());
return new ResponseEntity<Map<Object, String>>(list, HttpStatus.OK);
// return new ResponseEntity<Map<Object, String>>(list, HttpStatus.OK);
return ResultVoUtil.success(ResultVo.SUCCESS,list);
}else {
return new ResponseEntity<Object>("验证码错误!",HttpStatus.OK);
// return new ResponseEntity<Object>("验证码错误!",HttpStatus.OK);
return ResultVoUtil.error(ResultVo.SUCCESS,"验证码错误!");
}
}else {
return new ResponseEntity<Object>("手机号错误!",HttpStatus.OK);
// return new ResponseEntity<Object>("手机号错误!",HttpStatus.OK);
return ResultVoUtil.error(ResultVo.SUCCESS,"手机号错误!");
}
}else {
return new ResponseEntity<Object>("账号不存在!",HttpStatus.OK);
// return new ResponseEntity<Object>("账号不存在!",HttpStatus.OK);
return ResultVoUtil.error(ResultVo.SUCCESS,"账号不存在!");
}
}else {
return new ResponseEntity<Object>("企业编码错误!",HttpStatus.OK);
// return new ResponseEntity<Object>("企业编码错误!",HttpStatus.OK);
return ResultVoUtil.error(ResultVo.SUCCESS,"企业编码错误!");
}
}else {
return new ResponseEntity<Object>("请输入企业编码!",HttpStatus.OK);
// return new ResponseEntity<Object>("请输入企业编码!",HttpStatus.OK);
return ResultVoUtil.error(ResultVo.SUCCESS,"请输入企业编码!");
}
}else {
return new ResponseEntity<Object>("请输入验证码!",HttpStatus.OK);
// return new ResponseEntity<Object>("请输入验证码!",HttpStatus.OK);
return ResultVoUtil.error(ResultVo.SUCCESS,"请输入验证码!");
}
}else {
return new ResponseEntity<Object>("请输入手机号!",HttpStatus.OK);
// return new ResponseEntity<Object>("请输入手机号!",HttpStatus.OK);
return ResultVoUtil.error(ResultVo.SUCCESS,"请输入手机号!");
}
}else {
return new ResponseEntity<Object>("请输入账号!",HttpStatus.OK);
// return new ResponseEntity<Object>("请输入账号!",HttpStatus.OK);
return ResultVoUtil.error(ResultVo.SUCCESS,"请输入账号!");
}

@ -2,17 +2,14 @@ package cn.jyjz.xiaoyao.ocr.controller;
import cn.jyjz.xiaoyao.common.base.service.UserTokenService;
import cn.jyjz.xiaoyao.common.base.util.RequestBaseUtil;
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.ocr.dataobject.OcrMsgRead;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrSearchHistory;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletRequest;
import cn.jyjz.xiaoyao.ocr.service.IOcrSearchHistoryService;
@ -39,11 +36,12 @@ public class OcrSearchHistoryController {
/**
*
*
* @param request
* @return
*/
@RequestMapping(value = "/searchList", method = RequestMethod.GET)
public ResponseEntity<?> searchList(HttpServletRequest request,
public ResultVo searchList(HttpServletRequest request,
@RequestParam(value = "search", required = false) String search) {
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
//执行查询方法
@ -55,23 +53,27 @@ public class OcrSearchHistoryController {
ocrsearchhistory.setCreatedate(System.currentTimeMillis());
ocrSearchHistoryService.save(ocrsearchhistory);
return new ResponseEntity<Object>(selectsearch, HttpStatus.OK);
// return new ResponseEntity<Object>(selectsearch, HttpStatus.OK);
return ResultVoUtil.success(selectsearch);
}
/**
*
*
* @param request
* @return
*/
@RequestMapping(value = "/searchdelete", method = RequestMethod.DELETE)
public ResponseEntity<?> searchdelete(HttpServletRequest request) {
public ResultVo searchdelete(HttpServletRequest request) {
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
QueryWrapper<OcrSearchHistory> wrapper = new QueryWrapper<>();
wrapper.eq("userid",userToken.getUserid());
//根据具体情况 判断 是否需要 进行数据返回, 默认不返回数据
ocrSearchHistoryService.remove(wrapper);
return new ResponseEntity<Object>("true",HttpStatus.OK);
// return new ResponseEntity<Object>("true",HttpStatus.OK);
return ResultVoUtil.success(ResultVo.SUCCESS);
}
/**
@ -81,14 +83,15 @@ public class OcrSearchHistoryController {
* @return
*/
@RequestMapping(value = "/historySearch", method = RequestMethod.GET)
public ResponseEntity<?> historySearch(HttpServletRequest request) {
public ResultVo historySearch(HttpServletRequest request) {
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
QueryWrapper<OcrSearchHistory> wrapper = new QueryWrapper<>();
wrapper.select("historyname","createdate").eq("userid",userToken.getUserid()).orderByDesc("createdate").last("limit 8");
List<OcrSearchHistory> list = ocrSearchHistoryService.list(wrapper);
return new ResponseEntity<List<OcrSearchHistory>>(list, HttpStatus.OK);
// return new ResponseEntity<List<OcrSearchHistory>>(list, HttpStatus.OK);
return ResultVoUtil.success(list);
}
}

@ -20,4 +20,6 @@ import java.util.Map;
@Mapper
public interface OcrMsgMapper extends BaseMapper<OcrMsg> {
List<List<Map<Object, String>>> selectPage(@Param("userid")String userid,@Param("msgCategory")String msgCategory);
Map<Object, String> selectone(@Param("id")String id);
}

@ -2,6 +2,7 @@ package cn.jyjz.xiaoyao.ocr.dataDao;
import cn.jyjz.xiaoyao.oa.from.vo.FlowUnionVo;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPictureAppro;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
@ -27,4 +28,17 @@ public interface OcrTaskchildPictureMybatisDao extends BaseMapper<OcrTaskchildPi
* @return
*/
Long listFinalCount(Map<String, Object> query);
/**
*
* @param query
* @return
*/
public List<OcrTaskchildPictureAppro> listmytask(Map<String, Object> query);
/**
*
* @param query
* @return
*/
Long listmytaskCount(Map<String, Object> query);
}

@ -0,0 +1,172 @@
package cn.jyjz.xiaoyao.ocr.dataobject;
import cn.jyjz.flowable.domain.dto.HistoricTaskInstanceDto;
import cn.jyjz.flowable.domain.vo.FlowModelVO;
import cn.jyjz.xiaoyao.common.base.util.requestFormat.SearchQuery;
import cn.jyjz.xiaoyao.common.mybatisplus.dto.BaseDto;
import cn.jyjz.xiaoyao.oa.from.dataobject.Category;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.AbstractMap.SimpleEntry;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value="任务信息", description="任务信息")
public class OcrTaskchildPictureAppro implements java.io.Serializable {
private static final long serialVersionUID = -8018660053527763810L;
@ApiModelProperty(value = "主键")
private Long id;
@ApiModelProperty(value = "比对图片主键,多个数据使用英文逗号分隔")
private String ocpictureid;
@ApiModelProperty(value = "图片比对结果,与图片主键一一对应记录比对结果使用英文逗号分隔例如99.6,98.1,97.2")
private String pictureresult;
@ApiModelProperty(value = "只记录主图,如果存在历史图片,不在这里记录")
private String picturecompare;
@ApiModelProperty(value = "所属部门")
private String deptid;
@ApiModelProperty(value = "租户ID")
private Long tenantid;
@ApiModelProperty(value = "任务包主键")
private Long packageid;
@ApiModelProperty(value = "原图片主键")
private Long pictureid;
@ApiModelProperty(value = "类型名称")
private String category;
@ApiModelProperty(value = "项目ID")
private Long categoryid;
@ApiModelProperty(value = "明细单")
private String specification;
@ApiModelProperty(value = "业务编码")
private String buessinessno;
@ApiModelProperty(value = "状态,审批状态 1:未提交 2:审批中 3:审批通过 5拒绝")
private Integer states;
@ApiModelProperty(value = "流程实例IdprocessInstanceId")
private String processinstanceid;
@ApiModelProperty(value = "流程定义id")
private String processdefinitionid;
@ApiModelProperty(value = "流程部署id")
private String deploymentid;
@ApiModelProperty(value = "审批人姓名")
private String assigneename;
@ApiModelProperty(value = "审批人")
private String assignee;
@ApiModelProperty(value = "修改人,记录创建人的帐号")
private String updateuser;
@ApiModelProperty(value = "更新时间")
private Long updatetime;
@ApiModelProperty(value = "附件")
private String fileannex;
@ApiModelProperty(value = "是否归档0未归档1归档")
private Integer guidang;
@ApiModelProperty(value = "创建人")
private String createuser;
@ApiModelProperty(value = "创建人姓名")
private String createusername;
@ApiModelProperty(value = "创建时间")
private Long createdate;
@ApiModelProperty(value = "员工主键")
private Long userid;
@ApiModelProperty(value = "员工姓名")
private String username;
@ApiModelProperty(value = "任务id,来源于图片表")
private String fromtaskid;
@ApiModelProperty(value = "任务名称,来源于图片表")
private String fromtaskname;
@ApiModelProperty(value = "提报人")
private String fromuserid;
@ApiModelProperty(value = "所属项目")
private String fromprojectid;
@ApiModelProperty(value = "所属计划")
private String fromplanid;
@ApiModelProperty(value = "提报时间")
private Long fromuptime;
@ApiModelProperty(value = "任务来源")
private String fromsourceid;
@ApiModelProperty(value = "是否为相似图片与其他图片对比为百分百的记录为10不相似1相似")
private Integer havepoints;
@ApiModelProperty(value = "当前节点名称")
private String taskname;
@ApiModelProperty(value = "历史-审批节点名称")
private String tasknamehis;
@ApiModelProperty(value = "历史-审批状态记录当前节点审批状态1.待审批 (只针对前端返回 库中逻辑上不存在) 2.通过 3.不通过")
private Integer statshis;
@ApiModelProperty(value = "历史-审批意见")
private String commenthis;
@ApiModelProperty(value = "历史-节点位置,待定字段,")
private Integer taskindex;
@ApiModelProperty(value = "历史-节点编号")
private String taskno;
@ApiModelProperty(value = "项目对象")
private Category categoryDto;
@ApiModelProperty(value = "节点主键")
private String taskId;
@ApiModelProperty(value = "节点描述")
private String documentation;
@ApiModelProperty(value = "审批记录")
private List<HistoricTaskInstanceDto> transferRecords;
}

@ -5,6 +5,7 @@ import cn.jyjz.xiaoyao.ocr.dataobject.OcrMsg;
import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import cn.jyjz.xiaoyao.ocr.util.PageRequest;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
@ -28,4 +29,7 @@ public interface IOcrMsgService extends IService<OcrMsg> {
* @return PageResult
*/
PageInfo<List<Map<Object,String>>> selectPage(PageRequest pageRequest,String userid, String msgCategory);
Map<Object, String> selectone(String id);
}

@ -33,6 +33,8 @@ public interface OcrPictureService extends BaseService<OcrPicture> {
public ResultVo createTaskChild(List<OcrPicture> ocrPictureList, String tenantId , UserToken sysUser, String search_month, HttpServletRequest req, String buessinessno);
public ResultVo createTaskChild(List<OcrPicture> ocrPictureList, String tenantId);
/**
*
* @param tenantId

@ -9,6 +9,7 @@ import cn.jyjz.xiaoyao.common.base.vo.UserToken;
import cn.jyjz.xiaoyao.common.mybatisplus.base.BaseService;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrPicture;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPictureAppro;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.RequestParam;
@ -116,4 +117,14 @@ public interface OcrTaskchildPictureService extends BaseService<OcrTaskchildPict
* @return
*/
Long listFinalCount(Map<String, Object> query);
/**
*
* @param query
* @return
*/
public List<OcrTaskchildPictureAppro> listmytask(Map<String, Object> query);
public Long listmytaskCount(Map<String, Object> query);
}

@ -38,4 +38,9 @@ public class OcrMsgServiceImpl extends ServiceImpl<OcrMsgMapper, OcrMsg> impleme
return new PageInfo<List<Map<Object,String>>>(selectPage);
}
@Override
public Map<Object, String> selectone(String id) {
return ocrmsgmapper.selectone(id);
}
}

@ -2,7 +2,6 @@ package cn.jyjz.xiaoyao.ocr.service.impl;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.jyjz.flowable.domain.vo.FlowInstanceVo;
import cn.jyjz.flowable.service.IFlowInstanceService;
import cn.jyjz.xiaoyao.abase.service.SeqManageService;
import cn.jyjz.xiaoyao.admin.service.LogService;
@ -18,39 +17,34 @@ import cn.jyjz.xiaoyao.ocr.util.DataDictionaryUtil;
import cn.jyjz.xiaoyao.ocr.util.ImageClassUtil;
import cn.jyjz.xiaoyao.ocr.util.SearchEnum;
import cn.jyjz.xiaoyao.ocr.util.SearchParaFormatting;
import cn.jyjz.xiaoyao.ocr.util.httputil.HttpClient;
import cn.jyjz.xiaoyao.ocr.util.httputil.HttpHeader;
import cn.jyjz.xiaoyao.ocr.util.httputil.HttpParamers;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.time.DateFormatUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hpsf.Decimal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.core.parameters.P;
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.transaction.annotation.Transactional;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.Serializable;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
/**
*
*/
*
*/
@Service("ocrPictureService")
@Slf4j
public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao, OcrPicture> implements OcrPictureService {
@ -94,7 +88,8 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
*/
@Autowired
DataDictionaryUtil dataDictionaryUtil;
public ResultVo createTaskChild(List<OcrPicture> ocrPictureList, String tenantId , UserToken sysUser, String search_month, HttpServletRequest request, String buessinessno){
public ResultVo createTaskChild(List<OcrPicture> ocrPictureList, String tenantId, UserToken sysUser, String search_month, HttpServletRequest request, String buessinessno) {
//图片错误信息
StringBuffer error = new StringBuffer();
@ -106,26 +101,26 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
//记录任务相似度为百分百的任务主键
List<Long> pointsList = new ArrayList<>();
//图片信息不能为空
if(null != ocrPictureList && !ocrPictureList.isEmpty()){
if (null != ocrPictureList && !ocrPictureList.isEmpty()) {
//生成任务包
//String packageName = seqManageService.getSeqNextNo("AI任务包");
//TODO 相似度、图片查询时间未传
//创建任务包
OcrPackagetask ocrPackagetask = this.ocrPackagetaskService.create(buessinessno,tenantId,sysUser);
OcrPackagetask ocrPackagetask = this.ocrPackagetaskService.create(buessinessno, tenantId, sysUser);
if(null == ocrPackagetask){
if (null == ocrPackagetask) {
return ResultVoUtil.error("失败。");
}
//用于标记相似度是否存在百分百的情况
List<OcrPicture> newList = new ArrayList<>();
for(OcrPicture ocrPicture:ocrPictureList){
for (OcrPicture ocrPicture : ocrPictureList) {
//如果当前图片已经生成任务包,直接跳过
if(ocrPicture.getTaskstatus().equals("1")){
if (ocrPicture.getTaskstatus().equals("1")) {
continue;
}
@ -138,15 +133,15 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
boolean havePoint = false;
//二次遍历进行比对
for(OcrPicture ocrPictureNext:ocrPictureList){
for (OcrPicture ocrPictureNext : ocrPictureList) {
if(ocrPictureNext.getId().longValue() == ocrPicture.getId().longValue()){
if (ocrPictureNext.getId().longValue() == ocrPicture.getId().longValue()) {
continue;
}
//TODO 接口请求判断重复情况
logService.addLog(103,"AI获取图片相似度接口", sysUser, "sendParams");
logService.addLog(103, "AI获取图片相似度接口", sysUser, "sendParams");
JSONObject jsonObjectSimi = ImageClassUtil.getSimilarity(ocrPicture.getImgurl(),
@ -158,11 +153,11 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
String resultValue = "";
//返回内容为零,表示成功,否则表示失败
if(null != jsonObjectSimi && jsonObjectSimi.getString("code").equals("0")){
if (null != jsonObjectSimi && jsonObjectSimi.getString("code").equals("0")) {
resultValue = jsonObjectSimi.getString("similarity");
ocrPictureNext.setResult(resultValue);
}else{
} else {
resultValue = "0";
ocrPictureNext.setResult(resultValue);
}
@ -170,12 +165,12 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
BigDecimal b1 = new BigDecimal(resultValue);
BigDecimal b2 = new BigDecimal("100");
int val = b1.compareTo(b2);
if(val == 0){
if (val == 0) {
havePoint = true;
}
//如果当前图片未生成任务需要临时保存
if(ocrPictureNext.getTaskstatus().equals("0")){
if (ocrPictureNext.getTaskstatus().equals("0")) {
picturecompareList.add(ocrPictureNext.getId().toString());
}
@ -189,35 +184,35 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
ocrPicture.setPicturecompareList(picturecompareList);
//查询项目对象
if(null == ocrPicture.getCategoryid()){
if (null == ocrPicture.getCategoryid()) {
//TODO 没有对应项目,返回提示信息
if(null != error && error.length() > 1){
if (null != error && error.length() > 1) {
error.append("," + ocrPicture.getImgname());
}else{
} else {
error.append(ocrPicture.getImgname());
}
continue;
}
Category category = categoryService.getById(ocrPicture.getCategoryid());
if(null == category){
if(null != errorProject && errorProject.length() > 1){
if (null == category) {
if (null != errorProject && errorProject.length() > 1) {
errorProject.append("," + ocrPicture.getImgname());
}else {
} else {
errorProject.append(ocrPicture.getImgname());
}
continue;
}else if(StringUtils.isBlank(category.getProcessdefinitionid())){
if(null != errorFlow && errorFlow.length() > 1){
} else if (StringUtils.isBlank(category.getProcessdefinitionid())) {
if (null != errorFlow && errorFlow.length() > 1) {
errorFlow.append("," + category.getCategoryname());
}else {
} else {
errorFlow.append(category.getCategoryname());
}
continue;
}
//创建工单,如果创建成功,增加标志,用于过滤条件使用
OcrTaskchildPicture ocrTaskchildPicture = this.ocrTaskchildPictureService.create(ocrPicture,tenantId,sysUser,ocrPackagetask.getId(),buessinessno);
if(null != ocrTaskchildPicture){
OcrTaskchildPicture ocrTaskchildPicture = this.ocrTaskchildPictureService.create(ocrPicture, tenantId, sysUser, ocrPackagetask.getId(), buessinessno);
if (null != ocrTaskchildPicture) {
//发起流程
flowInstanceService.startProcessInstanceById(
@ -228,7 +223,7 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
category.getServicename()
);
if(havePoint){
if (havePoint) {
pointsList.add(ocrTaskchildPicture.getId());
}
@ -242,16 +237,16 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
}
//批量更新 pointsList 主键相似度为百分百的数据
if(null != pointsList && !pointsList.isEmpty()){
if (null != pointsList && !pointsList.isEmpty()) {
this.ocrTaskchildPictureService.markPoint(pointsList);
}
if(StringUtils.isNotBlank(search_month)){
if(StringUtils.isNotBlank(search_month) && Integer.parseInt(search_month) <= 12 && Integer.parseInt(search_month) > 0){
if (StringUtils.isNotBlank(search_month)) {
if (StringUtils.isNotBlank(search_month) && Integer.parseInt(search_month) <= 12 && Integer.parseInt(search_month) > 0) {
ocrPackagetask.setSearchtimes(SearchEnum.getName(Integer.parseInt(search_month)));
}else if(StringUtils.isNotBlank(search_month) && Integer.parseInt(search_month) > 20){
} else if (StringUtils.isNotBlank(search_month) && Integer.parseInt(search_month) > 20) {
ocrPackagetask.setSearchtimes(SearchEnum.getName((Integer.parseInt(search_month) - 20)));
}
}
@ -259,18 +254,171 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
this.ocrPackagetaskService.updateById(ocrPackagetask);
//原主图设置为任务包已经生成
for(OcrPicture ocrPicture:newList){
for (OcrPicture ocrPicture : newList) {
ocrPicture.setTaskstatus("1");
this.updateById(ocrPicture);
}
if (StringUtils.isBlank(error) && StringUtils.isBlank(errorProject) && StringUtils.isBlank(errorFlow)) {
return ResultVoUtil.success();
} else {
String msg = (StringUtils.isBlank(error)) ? "" : error.toString() + ",图片没有对应项目,无法查重。";
msg = msg + ((StringUtils.isBlank(errorProject)) ? "" : errorProject.toString() + ",图片没有对应项目,无法查重。");
msg = msg + ((StringUtils.isBlank(errorFlow)) ? "" : errorFlow.toString() + ",项目没有配置审批流程,无法查重。");
return ResultVoUtil.success(msg);
}
}
return ResultVoUtil.error("失败。");
}
public ResultVo createTaskChild(List<OcrPicture> ocrPictureList, String tenantId) {
//图片错误信息
StringBuffer error = new StringBuffer();
//项目错误信息
StringBuffer errorProject = new StringBuffer();
//流程错误信息
StringBuffer errorFlow = new StringBuffer();
//记录任务相似度为百分百的任务主键
List<Long> pointsList = new ArrayList<>();
//图片信息不能为空
if (null != ocrPictureList && !ocrPictureList.isEmpty()) {
//生成任务包
//String packageName = seqManageService.getSeqNextNo("AI任务包");
//用于标记相似度是否存在百分百的情况
List<OcrPicture> newList = new ArrayList<>();
for (OcrPicture ocrPicture : ocrPictureList) {
//图片查重的比对图片集合
List<OcrPicture> compareList = new ArrayList<>();
//非历史图片主键集合
List<String> picturecompareList = new ArrayList<>();
boolean havePoint = false;
//二次遍历进行比对
for (OcrPicture ocrPictureNext : ocrPictureList) {
if (ocrPictureNext.getId().longValue() == ocrPicture.getId().longValue()) {
continue;
}
//TODO 接口请求判断重复情况
JSONObject jsonObjectSimi = ImageClassUtil.getSimilarity(ocrPicture.getImgurl(),
ocrPictureNext.getImgurl(),
null);
System.out.println("responseDataXs--code = [" + jsonObjectSimi.get("code") + "]");
System.out.println("responseDataXs--similarity = [" + jsonObjectSimi.get("similarity") + "]");
String resultValue = "";
//返回内容为零,表示成功,否则表示失败
if (null != jsonObjectSimi && jsonObjectSimi.getString("code").equals("0")) {
resultValue = jsonObjectSimi.getString("similarity");
ocrPictureNext.setResult(resultValue);
} else {
resultValue = "0";
ocrPictureNext.setResult(resultValue);
}
BigDecimal b1 = new BigDecimal(resultValue);
BigDecimal b2 = new BigDecimal("100");
int val = b1.compareTo(b2);
if (val == 0) {
havePoint = true;
}
//如果当前图片未生成任务需要临时保存
if (ocrPictureNext.getTaskstatus().equals("0")) {
picturecompareList.add(ocrPictureNext.getId().toString());
}
compareList.add(ocrPictureNext);
}
bubbleSortOpt(compareList);
//从大到小进行排序
ocrPicture.setListCom(compareList);
//非历史图片主键集合
ocrPicture.setPicturecompareList(picturecompareList);
//查询项目对象
if (null == ocrPicture.getCategoryid()) {
//TODO 没有对应项目,返回提示信息
if (null != error && error.length() > 1) {
error.append("," + ocrPicture.getImgname());
} else {
error.append(ocrPicture.getImgname());
}
continue;
}
Category category = categoryService.getById(ocrPicture.getCategoryid());
if (null == category) {
if (null != errorProject && errorProject.length() > 1) {
errorProject.append("," + ocrPicture.getImgname());
} else {
errorProject.append(ocrPicture.getImgname());
}
continue;
} else if (StringUtils.isBlank(category.getProcessdefinitionid())) {
if (null != errorFlow && errorFlow.length() > 1) {
errorFlow.append("," + category.getCategoryname());
} else {
errorFlow.append(category.getCategoryname());
}
continue;
}
UserToken userToken = new UserToken();
userToken.setLoginname("admin");
userToken.setUsername("admin");
//创建工单,如果创建成功,增加标志,用于过滤条件使用
OcrTaskchildPicture ocrTaskchildPicture = this.ocrTaskchildPictureService.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()
);
if (havePoint) {
pointsList.add(ocrTaskchildPicture.getId());
}
//TODO 需要测试
ocrPicture.setTaskchildpictureid(ocrTaskchildPicture.getId().toString());
ocrPicture.setWorkStatus("1");
this.updateById(ocrPicture);
}
newList.add(ocrPicture);
}
//批量更新 pointsList 主键相似度为百分百的数据
if (null != pointsList && !pointsList.isEmpty()) {
this.ocrTaskchildPictureService.markPoint(pointsList);
}
//原主图设置为任务包已经生成
for (OcrPicture ocrPicture : newList) {
ocrPicture.setTaskstatus("1");
this.updateById(ocrPicture);
}
if(StringUtils.isBlank(error) && StringUtils.isBlank(errorProject) && StringUtils.isBlank(errorFlow)){
if (StringUtils.isBlank(error) && StringUtils.isBlank(errorProject) && StringUtils.isBlank(errorFlow)) {
return ResultVoUtil.success();
}else{
} else {
String msg = (StringUtils.isBlank(error))?"":error.toString() + ",图片没有对应项目,无法查重。";
msg = msg + ((StringUtils.isBlank(errorProject))?"":errorProject.toString() + ",图片没有对应项目,无法查重。");
msg = msg + ((StringUtils.isBlank(errorFlow))?"":errorFlow.toString() + ",项目没有配置审批流程,无法查重。");
String msg = (StringUtils.isBlank(error)) ? "" : error.toString() + ",图片没有对应项目,无法查重。";
msg = msg + ((StringUtils.isBlank(errorProject)) ? "" : errorProject.toString() + ",图片没有对应项目,无法查重。");
msg = msg + ((StringUtils.isBlank(errorFlow)) ? "" : errorFlow.toString() + ",项目没有配置审批流程,无法查重。");
return ResultVoUtil.success(msg);
}
@ -278,71 +426,75 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
}
return ResultVoUtil.error("失败。");
}
public void bubbleSortOpt(List<OcrPicture> compareList) {
if(null == compareList) {
if (null == compareList) {
return;
}
OcrPicture temp = null;
for(int i = 0; i < compareList.size() - 1; i++) {
for(int j = 0; j < compareList.size() - i - 1; j++) {
if(Double.parseDouble(compareList.get(j).getResult()) < Double.parseDouble(compareList.get(j + 1).getResult())) {
for (int i = 0; i < compareList.size() - 1; i++) {
for (int j = 0; j < compareList.size() - i - 1; j++) {
if (Double.parseDouble(compareList.get(j).getResult()) < Double.parseDouble(compareList.get(j + 1).getResult())) {
temp = compareList.get(j);
compareList.set(j,compareList.get(j + 1));
compareList.set((j + 1),temp);
compareList.set(j, compareList.get(j + 1));
compareList.set((j + 1), temp);
}
}
}
}
/**
* json
*
* @param jsonArray
* @return
*/
public List<OcrPicture> savePicture(JSONObject jsonArray){
public List<OcrPicture> savePicture(JSONObject jsonArray) {
List<OcrPicture> list = new ArrayList<>();
return list;
}
public List<OcrPicture> listPage( Wrapper<OcrPicture> queryWrapper){
public List<OcrPicture> listPage(Wrapper<OcrPicture> queryWrapper) {
long count = this.count(queryWrapper);
Page<OcrPicture> ocrPicturePage = new Page<>(1,count);
Page<OcrPicture> ocrPicturePage = new Page<>(1, count);
ocrPicturePage.setMaxLimit(count);
IPage<OcrPicture> iPage = this.page(ocrPicturePage,queryWrapper);
IPage<OcrPicture> iPage = this.page(ocrPicturePage, queryWrapper);
return iPage.getRecords();
}
public List<OcrPicture> listByTaskChild(String tenantId,String createuser,String isclose,String tasktype,String packageid){
public List<OcrPicture> listByTaskChild(String tenantId, String createuser, String isclose, String tasktype, String packageid) {
List<OcrPicture> resultPicture = new ArrayList<>();
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("TENANTID",tenantId);
if(StringUtils.isNotBlank(createuser)){
queryWrapper.eq("CREATEUSER",createuser);
queryWrapper.eq("TENANTID", tenantId);
if (StringUtils.isNotBlank(createuser)) {
queryWrapper.eq("CREATEUSER", createuser);
}
if(StringUtils.isNotBlank(isclose)){
queryWrapper.eq("IZCLOSE",isclose);
if (StringUtils.isNotBlank(isclose)) {
queryWrapper.eq("IZCLOSE", isclose);
}
if(StringUtils.isNotBlank(tasktype)){
queryWrapper.eq("TASKTYPE",tasktype);
if (StringUtils.isNotBlank(tasktype)) {
queryWrapper.eq("TASKTYPE", tasktype);
}
if(StringUtils.isNotBlank(packageid)){
queryWrapper.eq("PACKAGEID",packageid);
if (StringUtils.isNotBlank(packageid)) {
queryWrapper.eq("PACKAGEID", packageid);
}
//查询工单/任务集合
List<OcrTaskchildPicture> list = ocrTaskchildPictureService.listAll(tenantId,createuser,queryWrapper);
for(OcrTaskchildPicture ocrTaskchildPicture:list){
List<OcrTaskchildPicture> list = ocrTaskchildPictureService.listAll(tenantId, createuser, queryWrapper);
for (OcrTaskchildPicture ocrTaskchildPicture : list) {
OcrPicture ocrPicture = view(ocrTaskchildPicture);
if(null != ocrPicture){
if (null != ocrPicture) {
resultPicture.add(view(ocrTaskchildPicture));
}
}
@ -353,25 +505,26 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
/**
*
*
* @return
*/
public List<OcrPicture> listByTaskChild(List<String> pictureidlist){
public List<OcrPicture> listByTaskChild(List<String> pictureidlist) {
List<OcrPicture> resultPicture = new ArrayList<>();
//查询工单集合
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.in("pictureid",pictureidlist);
queryWrapper.in("pictureid", pictureidlist);
long count = this.ocrTaskchildPictureService.count(queryWrapper);
Page<OcrTaskchildPicture> page = new Page<>(1, count);
page.setMaxLimit(count);
IPage<OcrTaskchildPicture> iPage = this.ocrTaskchildPictureService.page(page,queryWrapper);
IPage<OcrTaskchildPicture> iPage = this.ocrTaskchildPictureService.page(page, queryWrapper);
List<OcrTaskchildPicture> list = iPage.getRecords();
for(OcrTaskchildPicture ocrTaskchildPicture:list){
for (OcrTaskchildPicture ocrTaskchildPicture : list) {
OcrPicture ocrPicture = view(ocrTaskchildPicture);
if(null != ocrPicture){
if (null != ocrPicture) {
resultPicture.add(view(ocrTaskchildPicture));
}
}
@ -381,10 +534,11 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
/**
*
*
* @param ocrTaskchildPicture
* @return
*/
public OcrPicture view(OcrTaskchildPicture ocrTaskchildPicture){
public OcrPicture view(OcrTaskchildPicture ocrTaskchildPicture) {
//参照图
OcrPicture ocrPicture = this.getById(ocrTaskchildPicture.getPictureid());
@ -399,24 +553,24 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
List<OcrPicture> listCom = null;
//判断查重图片是否为空
if(StringUtils.isNotBlank(ocrTaskchildPicture.getOcpictureid())){
if (StringUtils.isNotBlank(ocrTaskchildPicture.getOcpictureid())) {
//图片比较数量不确定
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.in("id",ocrTaskchildPicture.getOcpictureid().split(","));
queryWrapper.in("id", ocrTaskchildPicture.getOcpictureid().split(","));
long count = this.count(queryWrapper);
Page<OcrPicture> ocrPicturePage = new Page<>(1,count);
Page<OcrPicture> ocrPicturePage = new Page<>(1, count);
ocrPicturePage.setMaxLimit(count);
IPage<OcrPicture> iPage = this.page(ocrPicturePage,queryWrapper);
IPage<OcrPicture> iPage = this.page(ocrPicturePage, queryWrapper);
int tempco = 0;
for(OcrPicture ocrPicture1:iPage.getRecords()){
for (OcrPicture ocrPicture1 : iPage.getRecords()) {
//比对结果
if(null != comResult && comResult.length > 0){
if (null != comResult && comResult.length > 0) {
ocrPicture1.setResult(comResult[tempco]);
}
tempco++;
@ -437,15 +591,15 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
@Transactional(rollbackFor = Exception.class)
public void saveMain(OcrPicture ocrPicture, List<OcrPicturejob> ocrPicturejobList, List<OcrPictureNotes> ocrPictureNotesList) {
ocrpicturemybatisdao.insert(ocrPicture);
if(ocrPicturejobList!=null && ocrPicturejobList.size()>0) {
for(OcrPicturejob entity:ocrPicturejobList) {
if (ocrPicturejobList != null && ocrPicturejobList.size() > 0) {
for (OcrPicturejob entity : ocrPicturejobList) {
//外键设置
entity.setPictureid(ocrPicture.getId());
ocrPicturejobService.save(entity);
}
}
if(ocrPictureNotesList!=null && ocrPictureNotesList.size()>0) {
for(OcrPictureNotes entity:ocrPictureNotesList) {
if (ocrPictureNotesList != null && ocrPictureNotesList.size() > 0) {
for (OcrPictureNotes entity : ocrPictureNotesList) {
//外键设置
entity.setPictureid(ocrPicture.getId());
ocrPictureNotesService.save(entity);
@ -455,23 +609,23 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
@Override
@Transactional(rollbackFor = Exception.class)
public void updateMain(OcrPicture ocrPicture,List<OcrPicturejob> ocrPicturejobList,List<OcrPictureNotes> ocrPictureNotesList) {
public void updateMain(OcrPicture ocrPicture, List<OcrPicturejob> ocrPicturejobList, List<OcrPictureNotes> ocrPictureNotesList) {
ocrpicturemybatisdao.updateById(ocrPicture);
//1.先删除子表数据
ocrPicturejobService .deleteByMainId(ocrPicture.getId().toString());
ocrPicturejobService.deleteByMainId(ocrPicture.getId().toString());
ocrPictureNotesService.deleteByMainId(ocrPicture.getId().toString());
//2.子表数据重新插入
if(ocrPicturejobList!=null && ocrPicturejobList.size()>0) {
for(OcrPicturejob entity:ocrPicturejobList) {
if (ocrPicturejobList != null && ocrPicturejobList.size() > 0) {
for (OcrPicturejob entity : ocrPicturejobList) {
//外键设置
entity.setPictureid(ocrPicture.getId());
ocrPicturejobService.save(entity);
}
}
if(ocrPictureNotesList!=null && ocrPictureNotesList.size()>0) {
for(OcrPictureNotes entity:ocrPictureNotesList) {
if (ocrPictureNotesList != null && ocrPictureNotesList.size() > 0) {
for (OcrPictureNotes entity : ocrPictureNotesList) {
//外键设置
entity.setPictureid(ocrPicture.getId());
ocrPictureNotesService.save(entity);
@ -490,7 +644,7 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
@Override
@Transactional(rollbackFor = Exception.class)
public void delBatchMain(Collection<? extends Serializable> idList) {
for(Serializable id:idList) {
for (Serializable id : idList) {
ocrPicturejobService.deleteByMainId(id.toString());
ocrPictureNotesService.deleteByMainId(id.toString());
ocrpicturemybatisdao.deleteById(id);
@ -499,20 +653,20 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
@Override
public IPage<OcrPicture> queryPageByUserSearchId(Integer pageNo, Integer pageSize, String userSearchId) {
OcrUsersearch ocrUsersearch= ocrUsersearchService.selectByUserSearchId(userSearchId);
OcrUsersearch ocrUsersearch = ocrUsersearchService.selectByUserSearchId(userSearchId);
QueryWrapper<OcrPicture> queryWrapper = new QueryWrapper();
for (OcrUsersearchchild usersearchchild : ocrUsersearch.getOcrUsersearchchildList()) {
this.formattingSearchChild(queryWrapper,usersearchchild);
this.formattingSearchChild(queryWrapper, usersearchchild);
}
//分页查询并组装子集数据
Page<OcrPicture> page = new Page<OcrPicture>(pageNo, pageSize);
IPage<OcrPicture> pageList = this.page(page, queryWrapper);
for(OcrPicture ocrPicture1:pageList.getRecords()){
if(StringUtils.isNotBlank(ocrPicture1.getPictureclassid())){
for (OcrPicture ocrPicture1 : pageList.getRecords()) {
if (StringUtils.isNotBlank(ocrPicture1.getPictureclassid())) {
OcrPictureclass ocrPictureclass = ocrPictureclassService.getById(ocrPicture1.getPictureclassid());
ocrPicture1.setOcrPictureclass(ocrPictureclass);
}
@ -530,12 +684,15 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
//2.调整图片地址,补齐域名
for (OcrPicture picture : ocrPictureList) {
picture.setCreateTime(System.currentTimeMillis()); //获取创建时间戳
picture.setImgurl(interfaceDomain+picture.getImgurl());
picture.setImgurl(interfaceDomain + picture.getImgurl());
}
//3.添加图片信息
if(this.saveBatch(ocrPictureList)){
if (this.saveBatch(ocrPictureList)) {
this.createTaskChild(ocrPictureList, ocrPictureList.get(0).getTenantId().toString());
return ocrPictureList.size();
}
@ -544,20 +701,21 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
/**
*
*
* @param queryWrapper
* @param usersearchchild
* @return
*/
private QueryWrapper<OcrPicture> formattingSearchChild(QueryWrapper<OcrPicture> queryWrapper,OcrUsersearchchild usersearchchild ){
switch (usersearchchild.getSearchRelationType()){
private QueryWrapper<OcrPicture> formattingSearchChild(QueryWrapper<OcrPicture> queryWrapper, OcrUsersearchchild usersearchchild) {
switch (usersearchchild.getSearchRelationType()) {
case "where":
this.formattingSearchType(queryWrapper,usersearchchild);
this.formattingSearchType(queryWrapper, usersearchchild);
break;
case "and":
queryWrapper.and(wrapper->this.formattingSearchType(wrapper,usersearchchild));
queryWrapper.and(wrapper -> this.formattingSearchType(wrapper, usersearchchild));
break;
case "or":
queryWrapper.or(wrapper->this.formattingSearchType(wrapper,usersearchchild));
queryWrapper.or(wrapper -> this.formattingSearchType(wrapper, usersearchchild));
break;
default:
return queryWrapper;
@ -567,98 +725,99 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
/**
*
*
* @param queryWrapper
* @param usersearchchild
* @return
*/
private QueryWrapper<OcrPicture> formattingSearchType(QueryWrapper<OcrPicture> queryWrapper,OcrUsersearchchild usersearchchild){
private QueryWrapper<OcrPicture> formattingSearchType(QueryWrapper<OcrPicture> queryWrapper, OcrUsersearchchild usersearchchild) {
//查询类型 相等true 不相等fase
boolean queryType = "eq".equals(usersearchchild.getSearchtype());
//1.获取检查数据,确定数据类型
String valueType = SearchParaFormatting.clickSearchValue(usersearchchild.getSearchvalue());
List<String> arrayData = null; //集合型数据
List<Integer> sectionInts =null; //纯数字区间型数据
String[] sections =null; //字符串区间型数据
DateTime beginTime =null; //日期时间区间型数据
DateTime endTime=null; //日期时间区间型数据
List<Integer> sectionInts = null; //纯数字区间型数据
String[] sections = null; //字符串区间型数据
DateTime beginTime = null; //日期时间区间型数据
DateTime endTime = null; //日期时间区间型数据
//2.根据数据类型,解构数据
switch (valueType){
switch (valueType) {
case "array":
//处理多文件
String [] datas =usersearchchild.getSearchvalue().split(",");
String[] datas = usersearchchild.getSearchvalue().split(",");
arrayData = Arrays.asList(datas);
break;
case "section":
//格式化数据,仅在做区间的时候去除空格,其他地方不进行空格去除.
sections =usersearchchild.getSearchvalue().trim().replaceAll("\\s+", "").split("-");
sections = usersearchchild.getSearchvalue().trim().replaceAll("\\s+", "").split("-");
//校验是否纯数字,纯数字的话要转成int,否则比对时会有问题
sectionInts= new ArrayList<>();
sectionInts = new ArrayList<>();
for (String data : sections) {
if(data.matches("\\d+")){
if (data.matches("\\d+")) {
sectionInts.add(Integer.parseInt(data));
}
}
break;
case "time":
//格式化时间数据
String[] times =usersearchchild.getSearchvalue().trim().replaceAll("\\s+", "").split("-");
beginTime = DateUtil.parse(times[0],"yyyy/MM/dd");
endTime = DateUtil.parse(times[1],"yyyy/MM/dd");
String[] times = usersearchchild.getSearchvalue().trim().replaceAll("\\s+", "").split("-");
beginTime = DateUtil.parse(times[0], "yyyy/MM/dd");
endTime = DateUtil.parse(times[1], "yyyy/MM/dd");
break;
default:
}
//3.根据查询类型 组装查询条件 相等
switch (valueType){
switch (valueType) {
case "array":
//集合数据
//相等
if(queryType){
queryWrapper.in(usersearchchild.getSearchfield(),arrayData);
if (queryType) {
queryWrapper.in(usersearchchild.getSearchfield(), arrayData);
break;
}
//不相等
queryWrapper.notIn(usersearchchild.getSearchfield(),arrayData);
queryWrapper.notIn(usersearchchild.getSearchfield(), arrayData);
break;
case "section":
//数字区间查询
if(sectionInts!=null && sectionInts.size()==2){
if(queryType) {
if (sectionInts != null && sectionInts.size() == 2) {
if (queryType) {
//相等
queryWrapper.between(usersearchchild.getSearchfield(),sectionInts.get(0),sectionInts.get(1));
queryWrapper.between(usersearchchild.getSearchfield(), sectionInts.get(0), sectionInts.get(1));
break;
}
//不相等
queryWrapper.notBetween(usersearchchild.getSearchfield(),sectionInts.get(0),sectionInts.get(1));
queryWrapper.notBetween(usersearchchild.getSearchfield(), sectionInts.get(0), sectionInts.get(1));
break;
}
//字符串区间查询
if(queryType) {
if (queryType) {
//相等
queryWrapper.between(usersearchchild.getSearchfield(),sections[0],sections[1]);
queryWrapper.between(usersearchchild.getSearchfield(), sections[0], sections[1]);
break;
}
//不相等
queryWrapper.notBetween(usersearchchild.getSearchfield(),sections[0],sections[1]);
queryWrapper.notBetween(usersearchchild.getSearchfield(), sections[0], sections[1]);
break;
case "time":
//时间区间数据
//相等
if(queryType) {
queryWrapper.between(usersearchchild.getSearchfield(),beginTime.getTime(),endTime.getTime());
if (queryType) {
queryWrapper.between(usersearchchild.getSearchfield(), beginTime.getTime(), endTime.getTime());
break;
}
//不相等
queryWrapper.notBetween(usersearchchild.getSearchfield(),beginTime.getTime(),endTime.getTime());
queryWrapper.notBetween(usersearchchild.getSearchfield(), beginTime.getTime(), endTime.getTime());
break;
default:
if(queryType) {
if (queryType) {
queryWrapper.eq(usersearchchild.getSearchfield(), usersearchchild.getSearchvalue());
break;
}

@ -10,6 +10,7 @@ import cn.jyjz.xiaoyao.common.mybatisplus.util.SearchQueryFormat;
import cn.jyjz.xiaoyao.ocr.dataDao.OcrTaskchildPictureMybatisDao;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrPicture;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPictureAppro;
import cn.jyjz.xiaoyao.ocr.service.OcrPictureService;
import cn.jyjz.xiaoyao.ocr.service.OcrTaskchildPictureService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -29,8 +30,8 @@ import java.util.*;
import java.util.stream.Collectors;
/**
*
*/
*
*/
@Service("ocrTaskchildPictureService")
@Slf4j
public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchildPictureMybatisDao, OcrTaskchildPicture> implements OcrTaskchildPictureService {
@ -42,40 +43,38 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
@Resource
IFlowTaskService iFlowTaskService;
/**
*
*
* @param childpictureids
* @return
*/
public ResultVo trueorfalse(String childpictureids, String packageid, String iztrueorfalse, String judgeid, String judgedesc) {
public ResultVo trueorfalse(String childpictureids, String packageid, String iztrueorfalse, String judgeid, String judgedesc){
String[] cps = childpictureids.split(",");
List<OcrPicture> saveList = new ArrayList<>();
List<OcrPicture> saveList =new ArrayList<>();
StringBuffer historyPname = new StringBuffer();
StringBuffer taskType = new StringBuffer();
for (String childpictureid : cps) {
OcrTaskchildPicture old = this.listPicturePackageId(childpictureid, Long.parseLong(packageid));
for(String childpictureid:cps){
OcrTaskchildPicture old = this.listPicturePackageId(childpictureid,Long.parseLong(packageid));
//如果是历史图片,不允许进行设置
if (old.isIzHistory()) {
if (historyPname.length() > 0) {
historyPname.append("," + old.getOcrPicture().getImgname());
} else {
historyPname.append(old.getOcrPicture().getImgname());
}
}
if (old.getStates().intValue() == 3 || old.getStates().intValue() == 5) {
if (taskType.length() > 0) {
taskType.append("," + old.getOcrPicture().getImgname());
} else {
taskType.append(old.getOcrPicture().getImgname());
}
}
// if(old.isIzHistory()){
// if(historyPname.length() > 0){
// historyPname.append("," + old.getOcrPicture().getImgname());
// }else{
// historyPname.append(old.getOcrPicture().getImgname());
// }
// }
// if(old.getStates().intValue() == 3 || old.getStates().intValue() == 5) {
// if(taskType.length() > 0){
// taskType.append("," + old.getOcrPicture().getImgname());
// }else{
// taskType.append(old.getOcrPicture().getImgname());
// }
// }
OcrPicture ocrPicture = old.getOcrPicture();
ocrPicture.setJudgeid(Long.parseLong(judgeid));
@ -86,41 +85,42 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
saveList.add(ocrPicture);
}
if (StringUtils.isNotBlank(historyPname.toString())) {
return ResultVoUtil.error(historyPname.toString() + "为历史数据,不能标记。");
} else if (StringUtils.isNotBlank(taskType.toString())) {
return ResultVoUtil.error(taskType.toString() + "已经审批,不能标记。");
}
// if(StringUtils.isNotBlank(historyPname.toString())){
// return ResultVoUtil.error(historyPname.toString() + "为历史数据,不能标记。");
// }
// else if(StringUtils.isNotBlank(taskType.toString())){
// return ResultVoUtil.error( taskType.toString() + "已经审批,不能标记。");
// }
return this.ocrPictureService.updateBatchById(saveList) ? ResultVoUtil.success() : ResultVoUtil.error();
return this.ocrPictureService.updateBatchById(saveList)?ResultVoUtil.success():ResultVoUtil.error();
}
public ResultVo clearmark(String childpictureids, String packageid) {
public ResultVo clearmark(String childpictureids, String packageid){
String[] cps = childpictureids.split(",");
List<OcrPicture> saveList = new ArrayList<>();
List<OcrPicture> saveList =new ArrayList<>();
StringBuffer historyPname = new StringBuffer();
StringBuffer taskType = new StringBuffer();
for (String childpictureid : cps) {
OcrTaskchildPicture old = this.listPicturePackageId(childpictureid, Long.parseLong(packageid));
for(String childpictureid:cps){
OcrTaskchildPicture old = this.listPicturePackageId(childpictureid,Long.parseLong(packageid));
//如果是历史图片,不允许进行设置
if (old.isIzHistory()) {
if (historyPname.length() > 0) {
historyPname.append("," + old.getOcrPicture().getImgname());
} else {
historyPname.append(old.getOcrPicture().getImgname());
}
}
if (old.getStates().intValue() == 3 || old.getStates().intValue() == 5) {
if (taskType.length() > 0) {
taskType.append("," + old.getOcrPicture().getImgname());
} else {
taskType.append(old.getOcrPicture().getImgname());
}
}
// if(old.isIzHistory()){
// if(historyPname.length() > 0){
// historyPname.append("," + old.getOcrPicture().getImgname());
// }else{
// historyPname.append(old.getOcrPicture().getImgname());
// }
// }
// if(old.getStates().intValue() == 3 || old.getStates().intValue() == 5) {
// if(taskType.length() > 0){
// taskType.append("," + old.getOcrPicture().getImgname());
// }else{
// taskType.append(old.getOcrPicture().getImgname());
// }
// }
OcrPicture ocrPicture = old.getOcrPicture();
ocrPicture.setJudgeid(null);
@ -131,26 +131,26 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
saveList.add(ocrPicture);
}
if (StringUtils.isNotBlank(historyPname.toString())) {
return ResultVoUtil.error(historyPname.toString() + "为历史数据,不能清除标记。");
} else if (StringUtils.isNotBlank(taskType.toString())) {
return ResultVoUtil.error(taskType.toString() + "已经审批,不能清除标记。");
}
// if(StringUtils.isNotBlank(historyPname.toString())){
// return ResultVoUtil.error(historyPname.toString() + "为历史数据,不能清除标记。");
// }
// else if(StringUtils.isNotBlank(taskType.toString())){
// return ResultVoUtil.error( taskType.toString() + "已经审批,不能清除标记。");
// }
return this.ocrPictureService.updateBatchById(saveList) ? ResultVoUtil.success() : ResultVoUtil.error();
return this.ocrPictureService.updateBatchById(saveList)?ResultVoUtil.success():ResultVoUtil.error();
}
/**
*
*
* @param childpictureid
* @return
*/
public boolean pass(String childpictureid, OcrTaskchildPicture ocrTaskchildPicture) {
public boolean pass(String childpictureid,OcrTaskchildPicture ocrTaskchildPicture){
OcrTaskchildPicture old = this.getById(childpictureid);
//判断当前图片是否在任务包中,如果不在任务保重,不允许设置图片真假
if (!old.getPackageid().equals(ocrTaskchildPicture.getPackageid())) {
if(!old.getPackageid().equals(ocrTaskchildPicture.getPackageid())){
return false;
}
//
@ -172,22 +172,21 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
/**
*
*
* @param formid
* @param userToken
* @return
*/
public boolean validateAssignee(String[] formid, UserToken userToken) {
public boolean validateAssignee(String[] formid,UserToken userToken){
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.in("ID", formid);
queryWrapper.in("ID",formid);
List<OcrTaskchildPicture> list = this.ocrtaskchildpicturemybatisdao.selectList(queryWrapper);
//目前没有做其他信息返回,如果需要再做修改
for (OcrTaskchildPicture ocrTaskchildPicture : list) {
for(OcrTaskchildPicture ocrTaskchildPicture:list){
//判断审批人是否为当前登录用户
if (userToken.getLoginname().equals(ocrTaskchildPicture.getAssignee())) {
if(userToken.getLoginname().equals(ocrTaskchildPicture.getAssignee())){
} else {
}else{
return false;
}
}
@ -196,28 +195,28 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
/**
*
*
* @param formid
* @return
*/
public boolean validateApprove(String[] formid) {
public boolean validateApprove(String[] formid){
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.in("ID", formid);
queryWrapper.in("ID",formid);
List<OcrTaskchildPicture> list = this.ocrtaskchildpicturemybatisdao.selectList(queryWrapper);
//目前没有做其他信息返回,如果需要再做修改
for (OcrTaskchildPicture ocrTaskchildPicture : list) {
for(OcrTaskchildPicture ocrTaskchildPicture:list){
//判断当前审批状态为拒绝或者通过的,不允许再做审批
if (ocrTaskchildPicture.getStates().intValue() == SystemConstantsOa.OA_STATUS_TYPE_END
|| ocrTaskchildPicture.getStates().intValue() == SystemConstantsOa.OA_STATUS_TYPE_REFUSE) {
if(ocrTaskchildPicture.getStates().intValue() == SystemConstantsOa.OA_STATUS_TYPE_END
|| ocrTaskchildPicture.getStates().intValue() == SystemConstantsOa.OA_STATUS_TYPE_REFUSE ){
return false;
} else {
}else{
}
}
return true;
}
/**
*
*
@ -236,7 +235,7 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
}
@Override
public List<OcrTaskchildPicture> listAll(String tenantId, String createUser, QueryWrapper queryWrapper) {
public List<OcrTaskchildPicture> listAll(String tenantId, String createUser, QueryWrapper queryWrapper){
long count = this.count(queryWrapper);
@ -244,49 +243,46 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
Page<OcrTaskchildPicture> page = new Page<>(1, count);
page.setMaxLimit(count);
IPage<OcrTaskchildPicture> iPage = this.page(page, queryWrapper);
IPage<OcrTaskchildPicture> iPage = this.page(page,queryWrapper);
return iPage.getRecords();
}
/**
*
*
* @param taskids
* @return
*/
public boolean markPoint(List<Long> taskids) {
public boolean markPoint(List<Long> taskids){
UpdateWrapper updateWrapper = new UpdateWrapper();
updateWrapper.set("HAVEPOINTS", 1);
updateWrapper.in("ID", taskids);
updateWrapper.set("HAVEPOINTS",1);
updateWrapper.in("ID",taskids);
return this.update(updateWrapper);
}
/**
*
*
* @param packageid
* @return
*/
public List<OcrTaskchildPicture> markpoint(String packageid) {
public List<OcrTaskchildPicture> markpoint(String packageid){
QueryWrapper<OcrTaskchildPicture> queryWrapperNew = new QueryWrapper<>();
queryWrapperNew.eq("HAVEPOINTS", "1");
queryWrapperNew.eq("PACKAGEID", packageid);
queryWrapperNew.eq("HAVEPOINTS","1");
queryWrapperNew.eq("PACKAGEID",packageid);
List<OcrTaskchildPicture> list = this.ocrtaskchildpicturemybatisdao.selectList(queryWrapperNew);
this.formatTask(list, packageid);
this.formatTask(list,packageid);
return list;
}
/**
*
*
* @param fromid
* @return
*/
public OcrTaskchildPicture listPicturePackageId(String fromid, Long packageid) {
public OcrTaskchildPicture listPicturePackageId(String fromid,Long packageid){
OcrTaskchildPicture ocrTaskchildPicture = this.getById(fromid);
//查询图片对象
OcrPicture ocrPicture = this.ocrPictureService.selectDtoById(ocrTaskchildPicture.getPictureid());
@ -298,15 +294,15 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
// ocrTaskchildPicture.setIzHistory(listPictureids.contains(ocrPicture.getPictureid())?false:true);
//如果当前任务的任务包主键一致,说明不是历史数据,如果不一致,说明是历史数据
if (packageid.toString().equals(ocrTaskchildPicture.getPackageid().toString())) {
if(packageid.toString().equals(ocrTaskchildPicture.getPackageid().toString())){
ocrTaskchildPicture.setIzHistory(false);
} else {
}else{
ocrTaskchildPicture.setIzHistory(true);
}
//查询审批流节点信息
List<Task> taskList = iFlowTaskService.nowRunTask(ocrTaskchildPicture.getProcessinstanceid(), ocrTaskchildPicture.getProcessdefinitionid());
if (null != taskList && !taskList.isEmpty()) {
List<Task> taskList = iFlowTaskService.nowRunTask(ocrTaskchildPicture.getProcessinstanceid(),ocrTaskchildPicture.getProcessdefinitionid());
if(null != taskList && !taskList.isEmpty()) {
ocrTaskchildPicture.setTaskId(taskList.get(0).getId());
}
@ -320,63 +316,62 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
return ocrTaskchildPicture;
}
/**
*
*
* @param taskchildpictureid
* @param queryWrapper
* @return
*/
public IPage<OcrTaskchildPicture> listByPackageId(String taskchildpictureid, ParamterPage paramterPage, QueryWrapper queryWrapper, String orderbyname, String orderbyvalue, String packageid, String tenantId) {
public IPage<OcrTaskchildPicture> listByPackageId(String taskchildpictureid, ParamterPage paramterPage,QueryWrapper queryWrapper,String orderbyname,String orderbyvalue,String packageid,String tenantId ){
Page<OcrTaskchildPicture> page = new Page<>(paramterPage.getStart(), paramterPage.getPagesize());
//当前显示的任务对象
OcrTaskchildPicture mainOcrTaskchildPicture = this.getById(taskchildpictureid);
//判断当前图片是否为历史图片
if (!packageid.equals(mainOcrTaskchildPicture.getPackageid().toString())) {
if(!packageid.equals(mainOcrTaskchildPicture.getPackageid().toString())){
QueryWrapper<OcrTaskchildPicture> queryWrapperNew = new QueryWrapper<>();
queryWrapperNew.eq("TENANTID", tenantId);
queryWrapperNew.eq("PACKAGEID", packageid);
queryWrapperNew.eq("TENANTID",tenantId);
queryWrapperNew.eq("PACKAGEID",packageid);
//查询非历史图片存在的集合
IPage<OcrTaskchildPicture> pageNew = this.selectSearchListPage(paramterPage, queryWrapperNew);
IPage<OcrTaskchildPicture> pageNew = this.selectSearchListPage(paramterPage,queryWrapperNew);
//如果是历史图片,从非历史图片存在的集合中随机选取一个
if (!pageNew.getRecords().isEmpty()) {
if(!pageNew.getRecords().isEmpty()){
mainOcrTaskchildPicture = pageNew.getRecords().get(0);
}
}
//不包含当前选中的图片
queryWrapper.ne("ID", taskchildpictureid);
queryWrapper.ne("ID",taskchildpictureid);
queryWrapper.eq("TENANTID", tenantId);
if (StringUtils.isNotBlank(orderbyname) && orderbyname.equals("asc")) {
if (StringUtils.isNotBlank(orderbyvalue) && orderbyvalue.equals("pictureResult")) {
queryWrapper.orderByAsc("FIELD(PICTUREID," + mainOcrTaskchildPicture.getOcpictureid() + ")");
} else if (StringUtils.isNotBlank(orderbyvalue) && orderbyvalue.equals("fromuptime")) {
queryWrapper.eq("TENANTID",tenantId);
if(StringUtils.isNotBlank(orderbyname) && orderbyname.equals("asc")){
if(StringUtils.isNotBlank(orderbyvalue) && orderbyvalue.equals("pictureResult")){
queryWrapper.orderByAsc("FIELD(PICTUREID,"+ mainOcrTaskchildPicture.getOcpictureid() +")");
}else if(StringUtils.isNotBlank(orderbyvalue) && orderbyvalue.equals("fromuptime")){
queryWrapper.orderByAsc("FROMUPTIME");
}
} else if (StringUtils.isNotBlank(orderbyname) && orderbyname.equals("desc")) {
}else if(StringUtils.isNotBlank(orderbyname) && orderbyname.equals("desc")){
if (StringUtils.isNotBlank(orderbyvalue) && orderbyvalue.equals("pictureResult")) {
queryWrapper.orderByDesc("FIELD(PICTUREID," + mainOcrTaskchildPicture.getOcpictureid() + ")");
} else if (StringUtils.isNotBlank(orderbyvalue) && orderbyvalue.equals("fromuptime")) {
if(StringUtils.isNotBlank(orderbyvalue) && orderbyvalue.equals("pictureResult")){
queryWrapper.orderByDesc("FIELD(PICTUREID,"+ mainOcrTaskchildPicture.getOcpictureid() +")");
}else if(StringUtils.isNotBlank(orderbyvalue) && orderbyvalue.equals("fromuptime")){
queryWrapper.orderByDesc("FROMUPTIME");
}
}
queryWrapper.in("PICTUREID", mainOcrTaskchildPicture.getOcpictureid().split(","));
queryWrapper.in("PICTUREID",mainOcrTaskchildPicture.getOcpictureid().split(","));
IPage<OcrTaskchildPicture> iPage = this.page(page, queryWrapper);
this.formatTask(iPage.getRecords(), packageid);
IPage<OcrTaskchildPicture> iPage = this.page(page,queryWrapper);
this.formatTask(iPage.getRecords(),packageid);
return iPage;
@ -384,16 +379,15 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
/**
*
*
* @param list
* @param packageid
*/
private void formatTask(List<OcrTaskchildPicture> list, String packageid) {
for (OcrTaskchildPicture ocrTaskchildPicture : list) {
private void formatTask(List<OcrTaskchildPicture> list,String packageid){
for(OcrTaskchildPicture ocrTaskchildPicture:list){
//查询审批流节点信息
List<Task> taskList = iFlowTaskService.nowRunTask(ocrTaskchildPicture.getProcessinstanceid(), ocrTaskchildPicture.getProcessdefinitionid());
if (null != taskList && !taskList.isEmpty()) {
List<Task> taskList = iFlowTaskService.nowRunTask(ocrTaskchildPicture.getProcessinstanceid(),ocrTaskchildPicture.getProcessdefinitionid());
if(null != taskList && !taskList.isEmpty()) {
ocrTaskchildPicture.setTaskId(taskList.get(0).getId());
}
// //非历史图片主键集合
@ -404,9 +398,9 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
// ocrTaskchildPicture.setIzHistory(listPictureids.contains(ocrTaskchildPicture.getPictureid())?false:true);
//如果当前任务的任务包主键一致,说明不是历史数据,如果不一致,说明是历史数据
if (packageid.equals(ocrTaskchildPicture.getPackageid().toString())) {
if(packageid.equals(ocrTaskchildPicture.getPackageid().toString())){
ocrTaskchildPicture.setIzHistory(false);
} else {
}else{
ocrTaskchildPicture.setIzHistory(true);
}
@ -423,13 +417,12 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
/**
*
*
* @param id
* @return
*/
public boolean closeOrder(String id) {
public boolean closeOrder(String id){
OcrTaskchildPicture ocrTaskchildPicture = this.getById(id);
if (null != ocrTaskchildPicture) {
if(null != ocrTaskchildPicture){
// ocrTaskchildPicture.setIzclose("0");
return this.updateById(ocrTaskchildPicture);
}
@ -438,12 +431,11 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
/**
*
*
* @param ocrPicture
* @param tenantId
* @param sysUser
*/
public OcrTaskchildPicture create(OcrPicture ocrPicture, String tenantId, UserToken sysUser, Long packageid, String buessinessno) {
public OcrTaskchildPicture create(OcrPicture ocrPicture, String tenantId , UserToken sysUser, Long packageid,String buessinessno){
OcrTaskchildPicture ocrTaskchildPicture = new OcrTaskchildPicture();
ocrTaskchildPicture.setBuessinessno(buessinessno);
@ -465,11 +457,11 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
StringBuffer pcid = new StringBuffer();
StringBuffer result = new StringBuffer();
for (OcrPicture comp : ocrPicture.getListCom()) {
if (null == pcid || pcid.toString().length() < 1) {
for(OcrPicture comp:ocrPicture.getListCom()){
if(null == pcid || pcid.toString().length() < 1){
pcid.append(comp.getId());
result.append(comp.getResult());
} else {
}else{
pcid.append("," + comp.getId());
result.append("," + comp.getResult());
}
@ -477,18 +469,17 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
ocrTaskchildPicture.setOcpictureid(pcid.toString());
ocrTaskchildPicture.setPictureresult(result.toString());
ocrTaskchildPicture.setPicturecompare(String.join(",", ocrPicture.getPicturecompareList()));
ocrTaskchildPicture.setPicturecompare(String.join(",",ocrPicture.getPicturecompareList()));
return this.save(ocrTaskchildPicture) ? ocrTaskchildPicture : null;
return this.save(ocrTaskchildPicture)?ocrTaskchildPicture:null;
}
/**
*
*
* @param query
* @return
*/
public List<OcrTaskchildPicture> listFinal(Map<String, Object> query) {
public List<OcrTaskchildPicture> listFinal(Map<String, Object> query){
return this.ocrtaskchildpicturemybatisdao.listFinal(query);
}
@ -496,14 +487,13 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
/**
* \
*
* @param taskchildid
* @return
*/
public OcrPicture findOcrPictureByTaskchildid(String taskchildid) {
public OcrPicture findOcrPictureByTaskchildid(String taskchildid){
OcrTaskchildPicture ocrTaskchildPicture = this.ocrtaskchildpicturemybatisdao.selectById(taskchildid);
if (null == ocrTaskchildPicture) {
if(null == ocrTaskchildPicture){
return null;
}
@ -514,11 +504,23 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
/**
*
*
* @param query
* @return
*/
public Long listFinalCount(Map<String, Object> query) {
public Long listFinalCount(Map<String, Object> query){
return this.ocrtaskchildpicturemybatisdao.listFinalCount(query);
}
/**
*
* @param query
* @return
*/
public List<OcrTaskchildPictureAppro> listmytask(Map<String, Object> query){
return this.ocrtaskchildpicturemybatisdao.listmytask(query);
}
public Long listmytaskCount(Map<String, Object> query){
return this.ocrtaskchildpicturemybatisdao.listmytaskCount(query);
}
}

@ -1,6 +1,7 @@
package cn.jyjz.xiaoyao.ocr.thread;
import cn.jyjz.xiaoyao.ocr.api.entity.PictureSourceResult;
import cn.jyjz.xiaoyao.ocr.thread.entity.PictureImgToLocalEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -16,20 +17,25 @@ import java.util.concurrent.LinkedBlockingQueue;
public class TaskQueue {
private static Logger logger = LoggerFactory.getLogger(TaskQueue.class);
/**
*
*/
public static LinkedBlockingQueue pictureDisposeQueue = new LinkedBlockingQueue();
/**
*
* picture
*/
public static LinkedBlockingQueue pictureDownloadQueue = new LinkedBlockingQueue();
public static LinkedBlockingQueue pictureImgToLocalQueue = new LinkedBlockingQueue();
/**
* push
* push
* @return
* @param pictureSourceResult //三方拉取 获取到的图片对象
*/
public static boolean pictureDownloadPushData(PictureSourceResult pictureSourceResult){
public static boolean pictureDisposePushData(PictureSourceResult pictureSourceResult){
try {
pictureDownloadQueue.put(pictureSourceResult);
pictureDisposeQueue.put(pictureSourceResult);
} catch (InterruptedException e) {
logger.error("任务队列添加异常:{}",e.getMessage());
return false;
@ -38,11 +44,34 @@ public class TaskQueue {
}
/**
*
*
* @return
*/
public static PictureSourceResult pictureDisposePullData(){
return (PictureSourceResult) pictureDisposeQueue.poll();
}
/**
* push
* @return
* @param pictureImgToLocalEntity //图片下载对象
*/
public static PictureSourceResult pictureDownloadPullData(){
return (PictureSourceResult) pictureDownloadQueue.poll();
public static boolean pictureImgToLocalPushData(PictureImgToLocalEntity pictureImgToLocalEntity){
try {
pictureImgToLocalQueue.put(pictureImgToLocalEntity);
} catch (InterruptedException e) {
logger.error("图片下载任务队列添加异常:{}",e.getMessage());
return false;
}
return true;
}
/**
*
* @return
*/
public static PictureImgToLocalEntity pictureImgToLocalPullData(){
return (PictureImgToLocalEntity) pictureDisposeQueue.poll();
}
}

@ -15,6 +15,7 @@ public class TaskRunner implements CommandLineRunner {
@Override
public void run(String... args) throws Exception {
TaskThreadPool taskThreadPool = new TaskThreadPool();
taskThreadPool.startControllerPull();
taskThreadPool.startPictureDisposePull();
taskThreadPool.startPictureImgToLocalPull();
}
}

@ -1,6 +1,8 @@
package cn.jyjz.xiaoyao.ocr.thread;
import cn.jyjz.xiaoyao.ocr.api.entity.PictureSourceResult;
import cn.jyjz.xiaoyao.ocr.thread.tasks.PictureDownloadTask;
import cn.jyjz.xiaoyao.ocr.thread.entity.PictureImgToLocalEntity;
import cn.jyjz.xiaoyao.ocr.thread.tasks.PictureDisposeTask;
import cn.jyjz.xiaoyao.ocr.thread.tasks.PictureImgToLocalTask;
import lombok.SneakyThrows;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -23,7 +25,7 @@ public class TaskThreadPool {
if(threadPool ==null){
threadPool = new ThreadPoolExecutor(
10,
20,
40,
3,
TimeUnit.SECONDS,
new LinkedBlockingDeque<>(),
@ -36,16 +38,41 @@ public class TaskThreadPool {
*
* @return
*/
public boolean startControllerPull(){
public boolean startPictureDisposePull(){
Runnable runnable = new Runnable() {
@SneakyThrows
@Override
public void run() {
logger.info("图片下载任务线程检查中...");
logger.debug("无量云接口数据处理消费线程检测中...");
while (true){
PictureSourceResult pictureSourceResult = TaskQueue.pictureDownloadPullData();
PictureSourceResult pictureSourceResult = TaskQueue.pictureDisposePullData();
if(pictureSourceResult!=null){
threadPool.execute(new PictureDownloadTask(pictureSourceResult));
threadPool.execute(new PictureDisposeTask(pictureSourceResult));
}else{
Thread.sleep(5000);
}
}
}
};
Thread thread=new Thread(runnable);
thread.start();
return true;
}
/**
*
* @return
*/
public boolean startPictureImgToLocalPull(){
Runnable runnable = new Runnable() {
@SneakyThrows
@Override
public void run() {
logger.debug("图片下载消费线程检测中...");
while (true){
PictureImgToLocalEntity pictureImgToLocalEntity = TaskQueue.pictureImgToLocalPullData();
if(pictureImgToLocalEntity!=null){
threadPool.execute(new PictureImgToLocalTask(pictureImgToLocalEntity));
}else{
Thread.sleep(5000);
}

@ -0,0 +1,31 @@
package cn.jyjz.xiaoyao.ocr.thread.entity;
import lombok.Data;
/**
*
*
* @author hugh(shuli.yao) 1397940314@qq.com
* @version 1.0
* @date 2024/3/16 17:11
*/
@Data
public class PictureImgToLocalEntity {
/**
* id
*/
private Long pictureId;
/**
*
*/
private String ImgUrl;
/**
*
*/
private String localPath;
}

@ -13,18 +13,18 @@ import java.util.List;
import java.util.Map;
/**
*
*
*
* @author hugh(shuli.yao) 1397940314@qq.com
* @version 1.0
* @date 2024/3/14 11:15
*/
public class PictureDownloadTask implements Runnable{
public class PictureDisposeTask implements Runnable{
protected Logger logger = LoggerFactory.getLogger(getClass());
private PictureSourceResult pictureSourceResult;
public PictureDownloadTask(PictureSourceResult pictureSourceResult){
public PictureDisposeTask(PictureSourceResult pictureSourceResult){
this.pictureSourceResult = pictureSourceResult;
}
@ -63,6 +63,9 @@ public class PictureDownloadTask implements Runnable{
if(pictureSourceResult.getProjectNo()!=null){
picture.setProjectid(pictureSourceResult.getProjectNo().toString());
}
//项目id
picture.setCategoryid(251374070600303007L);
//项目名称
picture.setPicturename(pictureSourceResult.getProjectName());
//项目状态

@ -0,0 +1,40 @@
package cn.jyjz.xiaoyao.ocr.thread.tasks;
import cn.jyjz.xiaoyao.common.base.util.SpringUtils;
import cn.jyjz.xiaoyao.common.base.util.StringUtils;
import cn.jyjz.xiaoyao.ocr.api.entity.PictureSourceResult;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrPicture;
import cn.jyjz.xiaoyao.ocr.service.OcrPictureService;
import cn.jyjz.xiaoyao.ocr.thread.entity.PictureImgToLocalEntity;
import cn.jyjz.xiaoyao.ocr.util.DownloadImgUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
*
*
* @author hugh(shuli.yao) 1397940314@qq.com
* @version 1.0
* @date 2024/3/14 11:15
*/
public class PictureImgToLocalTask implements Runnable{
protected Logger logger = LoggerFactory.getLogger(getClass());
private PictureImgToLocalEntity pictureImgToLocal;
public PictureImgToLocalTask(PictureImgToLocalEntity pictureImgToLocal){
this.pictureImgToLocal = pictureImgToLocal;
}
@Override
public void run() {
//1.开始转储图片
DownloadImgUtil.downloadImage(pictureImgToLocal.getImgUrl(), pictureImgToLocal.getLocalPath());
}
}

@ -49,7 +49,7 @@ public class DataDictionaryUtil {
for (OcrPicture picture : ocrPictureList) {
//1.检查提报人字典是否包含数据
if(picture.getUpname()!=null && picture.getUpuserid()!=null){
OcrDictionaryGroup upNameDG = ocrDictionaryService.queryGroupByField("upName");
OcrDictionaryGroup upNameDG = ocrDictionaryService.queryGroupByField("person");
if(upNameDG!=null && ocrDictionaryService.isValueExists(upNameDG.getId(),picture.getUpname(),picture.getTenantId())){
OcrDictionary dictionary= new OcrDictionary();
dictionary.setLable(picture.getUpname());
@ -68,7 +68,7 @@ public class DataDictionaryUtil {
//2.任务计划
if(picture.getPlanname()!=null && picture.getPlanid()!=null) {
OcrDictionaryGroup planNameDG = ocrDictionaryService.queryGroupByField("planName");
OcrDictionaryGroup planNameDG = ocrDictionaryService.queryGroupByField("plan");
if (planNameDG!=null && ocrDictionaryService.isValueExists(planNameDG.getId(), picture.getPlanname(), picture.getTenantId())) {
OcrDictionary dictionary = new OcrDictionary();
dictionary.setLable(picture.getPlanname());
@ -84,7 +84,7 @@ public class DataDictionaryUtil {
}
//3.拜访客户类型
if(picture.getField2()!=null) {
OcrDictionaryGroup field2DG = ocrDictionaryService.queryGroupByField("field2");
OcrDictionaryGroup field2DG = ocrDictionaryService.queryGroupByField("izcustomtype");
if (field2DG!=null && ocrDictionaryService.isValueExists(field2DG.getId(), picture.getField2(), picture.getTenantId())) {
OcrDictionary dictionary = new OcrDictionary();
dictionary.setLable(picture.getField2());
@ -101,7 +101,7 @@ public class DataDictionaryUtil {
//4.拜访客户名称
if(picture.getField3()!=null) {
OcrDictionaryGroup field3DG = ocrDictionaryService.queryGroupByField("field3");
OcrDictionaryGroup field3DG = ocrDictionaryService.queryGroupByField("izcustomname");
if (field3DG!=null && ocrDictionaryService.isValueExists(field3DG.getId(), picture.getField3(), picture.getTenantId())) {
OcrDictionary dictionary = new OcrDictionary();
dictionary.setLable(picture.getField3());
@ -118,7 +118,7 @@ public class DataDictionaryUtil {
//5.任务来源
if(picture.getField4()!=null) {
OcrDictionaryGroup field4DG = ocrDictionaryService.queryGroupByField("field4");
OcrDictionaryGroup field4DG = ocrDictionaryService.queryGroupByField("iztaskrrom");
if (field4DG!=null && ocrDictionaryService.isValueExists(field4DG.getId(), picture.getField4(), picture.getTenantId())) {
OcrDictionary dictionary = new OcrDictionary();
dictionary.setLable(picture.getField4());
@ -134,7 +134,7 @@ public class DataDictionaryUtil {
}
//6.厂商
if(picture.getField5()!=null) {
OcrDictionaryGroup field5DG = ocrDictionaryService.queryGroupByField("field5");
OcrDictionaryGroup field5DG = ocrDictionaryService.queryGroupByField("izfirm");
if (field5DG!=null && ocrDictionaryService.isValueExists(field5DG.getId(), picture.getField5(), picture.getTenantId())) {
OcrDictionary dictionary = new OcrDictionary();
dictionary.setLable(picture.getField5());
@ -150,7 +150,7 @@ public class DataDictionaryUtil {
}
//7.拜访客户级别
if(picture.getField6()!=null) {
OcrDictionaryGroup field6DG = ocrDictionaryService.queryGroupByField("field6");
OcrDictionaryGroup field6DG = ocrDictionaryService.queryGroupByField("izcustomlevel");
if (field6DG!=null && ocrDictionaryService.isValueExists(field6DG.getId(), picture.getField6(), picture.getTenantId())) {
OcrDictionary dictionary = new OcrDictionary();
dictionary.setLable(picture.getField6());
@ -166,7 +166,7 @@ public class DataDictionaryUtil {
}
//8.拜访项目类别
if(picture.getField17()!=null) {
OcrDictionaryGroup field17DG = ocrDictionaryService.queryGroupByField("field17");
OcrDictionaryGroup field17DG = ocrDictionaryService.queryGroupByField("izprojecttype");
if (field17DG!=null && ocrDictionaryService.isValueExists(field17DG.getId(), picture.getField17(), picture.getTenantId())) {
OcrDictionary dictionary = new OcrDictionary();
dictionary.setLable(picture.getField17());
@ -183,7 +183,7 @@ public class DataDictionaryUtil {
//9.任务状态
if(picture.getTaskstatus()!=null) {
OcrDictionaryGroup taskStatusDG = ocrDictionaryService.queryGroupByField("taskStatus");
OcrDictionaryGroup taskStatusDG = ocrDictionaryService.queryGroupByField("iztaskstatus");
if (taskStatusDG!=null && ocrDictionaryService.isValueExists(taskStatusDG.getId(), picture.getTaskstatus(), picture.getTenantId())) {
OcrDictionary dictionary = new OcrDictionary();
dictionary.setLable(picture.getTaskstatus());
@ -200,7 +200,7 @@ public class DataDictionaryUtil {
//10.产品名称
if(picture.getField9()!=null) {
OcrDictionaryGroup field9DG = ocrDictionaryService.queryGroupByField("field9");
OcrDictionaryGroup field9DG = ocrDictionaryService.queryGroupByField("izproductname");
if (field9DG!=null && ocrDictionaryService.isValueExists(field9DG.getId(), picture.getField9(), picture.getTenantId())) {
OcrDictionary dictionary = new OcrDictionary();
dictionary.setLable(picture.getField9());
@ -217,7 +217,7 @@ public class DataDictionaryUtil {
//11.地区(城市信息)
if(picture.getReleasearea()!=null) {
OcrDictionaryGroup releaseAreaDG = ocrDictionaryService.queryGroupByField("releaseArea");
OcrDictionaryGroup releaseAreaDG = ocrDictionaryService.queryGroupByField("izvisitcity");
if (releaseAreaDG!=null && ocrDictionaryService.isValueExists(releaseAreaDG.getId(), picture.getReleasearea(), picture.getTenantId())) {
OcrDictionary dictionary = new OcrDictionary();
dictionary.setLable(picture.getReleasearea());
@ -234,7 +234,7 @@ public class DataDictionaryUtil {
//12.地区(省信息)
if(picture.getReleaseprovince()!=null) {
OcrDictionaryGroup releaseProvinceDG = ocrDictionaryService.queryGroupByField("releaseProvince");
OcrDictionaryGroup releaseProvinceDG = ocrDictionaryService.queryGroupByField("izvisitpro");
if (releaseProvinceDG!=null && ocrDictionaryService.isValueExists(releaseProvinceDG.getId(), picture.getReleaseprovince(), picture.getTenantId())) {
OcrDictionary dictionary = new OcrDictionary();
dictionary.setLable(picture.getReleaseprovince());
@ -251,7 +251,7 @@ public class DataDictionaryUtil {
//13.项目信息
if(picture.getProjectidname()!=null) {
OcrDictionaryGroup projectNameDG = ocrDictionaryService.queryGroupByField("projectName");
OcrDictionaryGroup projectNameDG = ocrDictionaryService.queryGroupByField("project");
if (projectNameDG!=null && ocrDictionaryService.isValueExists(projectNameDG.getId(), picture.getProjectidname(), picture.getTenantId())) {
OcrDictionary dictionary = new OcrDictionary();
dictionary.setLable(picture.getProjectidname());

@ -0,0 +1,40 @@
package cn.jyjz.xiaoyao.ocr.util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.URL;
/**
*
*
* @author hugh(shuli.yao) 1397940314@qq.com
* @version 1.0
* @date 2024/3/16 18:37
*/
public class DownloadImgUtil {
private static Logger logger = LoggerFactory.getLogger(DownloadImgUtil.class);
/**
*
* @param imageUrl
* @param destinationFile
*/
public static void downloadImage(String imageUrl, String destinationFile) {
try (InputStream in = new URL(imageUrl).openStream();
FileOutputStream out = new FileOutputStream(destinationFile)) {
byte[] buffer = new byte[4096];
int n;
while ((n = in.read(buffer)) != -1) {
out.write(buffer, 0, n);
}
} catch (Exception e) {
logger.error(e.getMessage());
}
}
}

@ -33,11 +33,11 @@ public enum SearchConfigEnum {
//所属项目、拜访客户类型、拜访客户级别、拜访客户名称、拜访项目类别、任务来源、任务状态、拜访省份/直辖市、、厂商、产品名称、
//提报人
UPUSERSEARCH("izupuser","upName"),
UPUSERSEARCH("izupuser","upuserid"),
//所属计划
PLANSEARCH("izplan","planName"),
//相似度
SIMISEARCH("izsimilarity","pictureresult"),
// SIMISEARCH("izsimilarity","pictureresult"),
//分类搜索
CLASSISEARCH("izshow","classificationid"),

@ -181,4 +181,13 @@
from OA_SUMMARY_VIEW
<include refid="Base_Where_union"></include>
</select>
<select id="repetitionTask" resultType="java.util.Map">
SELECT REPETITION,count(1) count
FROM
OA_SUMMARY_VIEW
GROUP BY REPETITION
HAVING count(1)>1
</select>
</mapper>

@ -34,7 +34,7 @@
SELECT
m.id as id,
m.titile as titile,
"系统管理员" AS userNcame,
"系统管理员" AS userName,
m.bus_json AS busJson,
r.read_flag as readFlag,
m.send_time AS sendTime
@ -42,23 +42,9 @@
ocr_msg m LEFT JOIN ocr_msg_read r ON m.id = r.msg_id
WHERE
m.msg_category = '2'
AND m.receive_user_type = '1'
AND FIND_IN_SET( ""#{userid}"", m.receive_user_ids )
UNION ALL
SELECT
m.id as id,
m.titile as titile,
"系统管理员" AS userNcame,
m.bus_json AS busJson,
r.read_flag as readFlag,
m.send_time AS sendTime
FROM
ocr_msg m LEFT JOIN ocr_msg_read r ON m.id = r.msg_id
WHERE
m.msg_category = '2'
AND m.receive_user_type = '2'
AND m.receive_user_type IN(1,2)
AND m.send_status = '1'
AND FIND_IN_SET( '${userid}', m.receive_user_ids )
</if>
<if test='msgCategory == "1" '>
@ -75,27 +61,26 @@
WHERE
m.msg_category = '1'
AND
m.receive_user_type = '1'
AND FIND_IN_SET( ""#{userid}"", m.receive_user_ids )
m.receive_user_type IN(1,2)
AND m.send_status = '1'
AND FIND_IN_SET( '${userid}', m.receive_user_ids )
</if>
UNION ALL
</select>
<select id="selectone" resultType="map">
SELECT
m.id as id,
m.titile as titile,
u.USERNAME as userName,
m.bus_json as busJson,
r.read_flag as readFlag,
m.send_time as sendTime
titile,
msg_content AS msgContent,
'系统管理员' AS userNcame,
sender,
msg_category AS msgCategory,
send_time AS sendTime
FROM
ocr_msg m LEFT JOIN s_user_t u ON m.sender=u.ID
LEFT JOIN ocr_msg_read r ON m.id = r.msg_id
ocr_msg
WHERE
m.msg_category = '1'
AND
m.receive_user_type = '2'
</if>
id = #{id}
</select>
</mapper>

@ -205,4 +205,42 @@ select tcp.* from (
) as tcp
<include refid="Base_Where_union"></include>
</select>
<select id="listmytask" resultType="cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPictureAppro" parameterType="java.util.Map">
select tcp.* from (
select
tc.*,uf.COMMENTHIS,uf.TASKNAME as TASKNAMEHIS,uf.STATSHIS,uf.TASKINDEX,uf.TASKNO
from ocr_taskchild_picture tc
LEFT JOIN OA_USERAPPROVE_T uf ON tc.ID = uf.ID
where tc.ASSIGNEE = #{searchassignee} and tc.TENANTID=#{searchtenantid}
UNION
select
tc.*,uf.COMMENTHIS,uf.TASKNAME as TASKNAMEHIS,uf.STATSHIS,uf.TASKINDEX,uf.TASKNO
from ocr_taskchild_picture tc,OA_USERAPPROVE_T uf
where tc.ID = uf.FORMID and tc.TENANTID=#{searchtenantid}
<if test="thisLoginUserid != null"> and uf.USERID = #{thisLoginUserid}</if>
) as tcp
<include refid="Base_Where_union"></include>
<if test="page != null">
<if test="page.sortname != null"> order by tcp.${page.sortname} ${page.sortorder}</if>
limit ${page.start}, ${page.Pagesize}
</if>
</select>
<select id="listmytaskCount" resultType="java.lang.Long" parameterType="java.util.Map">
select count(tcp.ID) from (
select
tc.*
from ocr_taskchild_picture tc
where tc.ASSIGNEE = #{searchassignee} and tc.TENANTID=#{searchtenantid}
UNION
select
tc.*
from ocr_taskchild_picture tc,OA_USERAPPROVE_T uf
where tc.ID = uf.FORMID and tc.TENANTID=#{searchtenantid}
<if test="thisLoginUserid != null"> and uf.USERID = #{thisLoginUserid}</if>
) as tcp
<include refid="Base_Where_union"></include>
</select>
</mapper>

@ -187,3 +187,6 @@ ALTER TABLE OA_USERAPPROVE_T ADD COLUMN STATSHIS int comment '审批状态,
ALTER TABLE OA_USERAPPROVE_T ADD COLUMN COMMENTHIS varchar(190) comment '审批意见';
ALTER TABLE OA_USERAPPROVE_T ADD COLUMN TASKINDEX int comment '节点位置,待定字段';
ALTER TABLE OA_USERAPPROVE_T ADD COLUMN TASKNO varchar(64) comment '节点编号,待定字段';
INSERT INTO S_BACKSTAGEOPENURL_T(ID,URL,REMARK) VALUES(1196092352600928301, '/flow/task/listalldata', '查询我的待审批、审批历史');

@ -1,4 +1,3 @@
server:
compression:
enabled: true
@ -29,10 +28,10 @@ spring:
password: ysltest2024.
type: com.alibaba.druid.pool.DruidDataSource
slave:
url: jdbc:mysql://47.93.59.251:3306/ocrnew?useUnicode=true&nullCatalogMeansCurrent=true&characterEncoding=UTF-8&characterSetResults=utf8&serverTimezone=Asia/Shanghai&useSSL=false
url: jdbc:mysql://127.0.0.1:3306/ocr?useUnicode=true&nullCatalogMeansCurrent=true&characterEncoding=UTF-8&characterSetResults=utf8&serverTimezone=Asia/Shanghai&useSSL=false
driver-class-name: com.mysql.cj.jdbc.Driver
username: ysltest
password: ysltest2024.
username: jyjz
password: jyjz
type: com.alibaba.druid.pool.DruidDataSource
druid:
# 初始连接数
@ -95,9 +94,39 @@ spring:
session:
store-type: none
cache:
type: ehcache
ehcache:
config: classpath:/myehcache.xml
type: ehcache
# type: redis
# redis:
# #Redis服务器地址
# #host: 192.168.0.198
# host: 127.0.0.1
# # Redis服务器连接端口
# port: 6379
# # 链接超时时间 单位 ms毫秒
# timeout: 20000
# # cluster:
# # nodes:
# # 192.168.0.191:7001,
# # 192.168.0.192:7001,
# # 192.168.0.193:7001,
# # 192.168.0.201:7001,
# # 192.168.0.202:7001,
# # 192.168.0.203:7001
# # #跨集群执行命令时要遵循的最大重定向数量
# # max-redirects: 18
# #lettuce:
# jedis:
# pool:
# #连接池最大连接数(使用负值表示没有限制) 默认 8
# max-active: 20
# #连接池中的最大空闲连接 默认 8
# max-idle: 10
# #连接池中的最小空闲连接 默认 0
# min-idle: 10
# #连接池最大阻塞等待时间(使用负值表示没有限制) 默认 -1
# max-wait: 10000
flowable:
modeler:
app:
@ -105,7 +134,7 @@ flowable:
#关闭定时任务JOB
async-executor-activate: false
database-schema-update: false
#
# cache:
# type: redis
# redis:
@ -140,7 +169,7 @@ flowable:
mybatis:
mapper-locations:
- classpath*:mapper/**/*.xml
# - classpath*:/META-INF/modeler-mybatis-mappings/*.xml
# - classpath*:/META-INF/modeler-mybatis-mappings/*.xml
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
configuration-properties:
@ -161,15 +190,15 @@ mybatis-plus:
xiaoyao:
web:
#上传文件路径
uploadPath: D:/Code/ocr/htmlweb/upload
uploadPath: D:/ideaWork/jeecg/ocrproject/htmlweb/upload
#页面根路径
frontPath: D:/Code/ocr/htmlweb
frontPath: D:/ideaWork/jeecg/ocrproject/htmlweb
#js、css、图片存放路径
staticPath: D:/Code/ocr/htmlweb/static
staticPath: D:/ideaWork/jeecg/ocrproject/htmlweb/static
#页面模版路径
webPath: D:/Code/ocr/htmlweb/web
webPath: D:/ideaWork/jeecg/ocrproject/htmlweb/web
#Lucene索引路径
lucenePath: D:/Code/ocr/htmlweb/lucene/indexDir
lucenePath: D:/ideaWork/jeecg/ocrproject/htmlweb/lucene/indexDir
#是否开启flowable
haveFlowable: true
webconfig:
@ -262,7 +291,7 @@ xiaoyao:
#缓存默认名称
managerName: cacheMgrGps
#有效时长(秒)目前登录用户、session使用
tokenExpire: 18000
tokenExpire: 360000
#缓存名称分隔符
cacheNamePrix: "_"
#存放缓存刷新时间是,使用临时缓存名称前缀
@ -273,6 +302,7 @@ springfox:
enabled: true
# 是否启用swagger,postman调试
debugger_tools: true
#无量云api配置信息
ocr:
api:

Loading…
Cancel
Save