Merge remote-tracking branch 'origin/test' into test

pull/165/head
Brian Lee 1 year ago
commit 7613e06cae

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>数据拉取日志</title> <title>数据拉取日志</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="${ctx}/static/js/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
<#include "/head/headlist.html" /> <#include "/head/headlist.html" />
</head> </head>
@ -141,6 +141,7 @@
}, },
{width: 80, valign: "middle", field: 'responseParam', title: '响应参数', sortable: true}, {width: 80, valign: "middle", field: 'responseParam', title: '响应参数', sortable: true},
{width: 80, valign: "middle", field: 'requestParam', title: '请求参数', sortable: true}, {width: 80, valign: "middle", field: 'requestParam', title: '请求参数', sortable: true},
{width: 80, valign: "middle", field: 'time', title: '重试次数', sortable: true},
{ {
width:200, width:200,
field: 'id', field: 'id',
@ -148,9 +149,8 @@
formatter:function(value,oData,index) { formatter:function(value,oData,index) {
var listOperation = ""; var listOperation = "";
$(jspOperation).each(function (i, toolbar) { $(jspOperation).each(function (i, toolbar) {
console.log(toolbar);
if (toolbar.text === '修改' && oData.status !== 100) { if (toolbar.text === '修改' && oData.status !== 100) {
listOperation = listOperation + "<a href=\"javascript:" + toolbar.actionmethod + "('${resourceid}','" + encodeURIComponent(oData.requestParam) + "');\" class=\"btn " + toolbar.img + " btn-xs\")><i class=\"fa " + "fa-refresh" + "\"></i> " + "重试" + " </a>&nbsp;&nbsp;"; listOperation = listOperation + "<a href=\"javascript:" + toolbar.actionmethod + "('${resourceid}','" + encodeURIComponent(oData.requestParam) + "','" + encodeURIComponent(oData.id) + "');\" class=\"btn " + toolbar.img + " btn-xs\")><i class=\"fa " + "fa-refresh" + "\"></i> " + "重试" + " </a>&nbsp;&nbsp;";
} }
}); });
return listOperation; return listOperation;
@ -167,7 +167,7 @@
_tableListPost.bootstrapTable('refreshOptions',{pageNumber:1}); _tableListPost.bootstrapTable('refreshOptions',{pageNumber:1});
} }
function updateData(jframeid,str){ function updateData(jframeid,str,id){
$(document).ready(function() { $(document).ready(function() {
// Encode the parameter string to be URL-safe // Encode the parameter string to be URL-safe
// Make an AJAX GET request // Make an AJAX GET request
@ -175,14 +175,17 @@
url: '${ctx}/test/api/pullPictureByParameter', // Replace with your server endpoint url: '${ctx}/test/api/pullPictureByParameter', // Replace with your server endpoint
type: 'GET', type: 'GET',
headers: {"logintoken": parent.getLoginToken()}, headers: {"logintoken": parent.getLoginToken()},
data: { parameterString: str }, data: { parameterString: str, id },
success: function(response) { success: function(response) {
console.log(response); if (response || "success" === response) {
toastr.success('Request was successful!'); refreshTable();
toastr.success('Request was successful!');
} else {
toastr.error('Request was failed!');
}
}, },
error: function(xhr, status, error) { error: function(xhr, status, error) {
console.log(error); toastr.error('Request has exception!');
toastr.error('Request was failed!');
} }
}); });
}); });

@ -20,8 +20,8 @@ import java.util.Map;
import java.util.AbstractMap.SimpleEntry; import java.util.AbstractMap.SimpleEntry;
import java.util.stream.Stream; import java.util.stream.Stream;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Data @Data
@Builder @Builder
@ -130,35 +130,35 @@ public class Department implements BaseDto,java.io.Serializable {
@Schema(description = "更新时间") @Schema(description = "更新时间")
@TableField(value="UPDATETIME") @TableField(value="UPDATETIME")
private Long updatetime; private Long updatetime;
@Schema(description = "对应的Service名主要是spring的service名") @Schema(description = "对应的Service名主要是spring的service名")
@TableField(value="SERVICENAME") @TableField(value="SERVICENAME")
private String servicename; private String servicename ="taskchildPictureService";
@Schema(description = "内置表单使用flowable表单0使用本地数据1使用flowable表单3:外置表单4其他自定义表单") @Schema(description = "内置表单使用flowable表单0使用本地数据1使用flowable表单3:外置表单4其他自定义表单")
@TableField(value="BUILTFORM") @TableField(value="BUILTFORM")
private Integer builtform; private Integer builtform;
@Schema(description = "表单地址,用户展示用户表单使用") @Schema(description = "表单地址,用户展示用户表单使用")
@TableField(value="FORMURL") @TableField(value="FORMURL")
private String formurl; private String formurl;
@Schema(description = "表单详情") @Schema(description = "表单详情")
@TableField(value="FORMDETAIL") @TableField(value="FORMDETAIL")
private String formdetail; private String formdetail;
@Schema(description = "表单分类") @Schema(description = "表单分类")
@TableField(value="FORMTYPE") @TableField(value="FORMTYPE")
private String formtype; private String formtype;
@Schema(description = "流程定义id") @Schema(description = "流程定义id")
@TableField(value="PROCESSDEFINITIONID") @TableField(value="PROCESSDEFINITIONID")
private String processdefinitionid; private String processdefinitionid;
@Schema(description = "公司类型0租户1主体") @Schema(description = "公司类型0租户1主体")
@TableField(value="TYPEDEPT") @TableField(value="TYPEDEPT")
private Integer typedept; private Integer typedept;
@Schema(description = "对应的工作流编码,与工作流中的命名空间对应") @Schema(description = "对应的工作流编码,与工作流中的命名空间对应")
@TableField(value="CATEGORY") @TableField(value="CATEGORY")
private String category; private String category;

@ -501,7 +501,7 @@ public class FlowTaskController extends BaseController {
Map<String, Object> query = searchQuery.getQuery(); Map<String, Object> query = searchQuery.getQuery();
flowTaskService.getFinalProcessInstances(query, pageUtils,user); flowTaskService.getFinalProcessInstances(query, pageUtils, user);
return ResultVoUtil.success(pageUtils); return ResultVoUtil.success(pageUtils);
} }
@ -682,9 +682,120 @@ public class FlowTaskController extends BaseController {
@GetMapping("/repetitionTask") @GetMapping("/repetitionTask")
@ResponseBody @ResponseBody
public ResultVo repetitionTask(HttpServletRequest request, public ResultVo repetitionTask(HttpServletRequest request,
@RequestParam(value = "type",required = false,defaultValue = "1") Integer type) { @RequestParam(value = "type", required = false, defaultValue = "0") Integer type,
@RequestParam(name = "izupuser", defaultValue = "", required = false) String izupuser,
@RequestParam(name = "taskName", defaultValue = "", required = false) String taskName,
@RequestParam(name = "izproject", defaultValue = "", required = false) String izproject,
@RequestParam(name = "izplan", defaultValue = "", required = false) String izplan,
@RequestParam(name = "izstatus", defaultValue = "", required = false) String izstatus,
@RequestParam(name = "iztaskrrom", defaultValue = "", required = false) String iztaskrrom,
@RequestParam(name = "izuptime", defaultValue = "", required = false) String izuptime,
@RequestParam(name = "isFail", defaultValue = "false", required = false) String isFail) {
SearchQuery searchQuery = new SearchQuery();
if (org.springframework.util.StringUtils.hasText(izupuser)) {
if (izupuser.contains(",")) {
String[] userIds = izupuser.split(",");
List<String> arrayData = Arrays.asList(userIds);
searchQuery.addIn("fromuserid", arrayData);
} else {
searchQuery.addEqual("fromuserid", izupuser);
}
}
if (StringUtils.isNotBlank(taskName)) {
searchQuery.addLike("fromtaskname", taskName);
}
if (org.springframework.util.StringUtils.hasText(izproject)) {
if (izproject.contains(",")) {
String[] projectIds = izproject.split(","); // 以逗号拆分字符串
List<String> arrayData = Arrays.asList(projectIds);
SearchQueryForm searchQueryForm = new SearchQueryForm();
searchQuery.addIn("fromprojectname", arrayData);
} else {
searchQuery.addEqual("fromprojectname", izproject);
}
}
if (org.springframework.util.StringUtils.hasText(izplan)) {
if (izplan.contains(",")) {
String[] planIds = izplan.split(","); // 以逗号拆分字符串
List<String> arrayData = Arrays.asList(planIds);
SearchQueryForm searchQueryForm = new SearchQueryForm();
searchQuery.addIn("fromplanid", arrayData);
} else {
searchQuery.addEqual("fromplanid", izplan);
}
}
if (org.springframework.util.StringUtils.hasText(izstatus)) {
if (izstatus.contains(",")) {
String[] statusIds = izstatus.split(","); // 以逗号拆分字符串
List<String> arrayData = Arrays.asList(statusIds);
searchQuery.addIn("states", arrayData);
} else {
searchQuery.addEqual("states", izstatus);
}
}
if (Boolean.parseBoolean(isFail)) {
searchQuery.addEqual("isFail", "1");
}
if (org.springframework.util.StringUtils.hasText(iztaskrrom)) {
if (iztaskrrom.contains(",")) {
String[] taskrromIds = iztaskrrom.split(","); // 以逗号拆分字符串
List<String> arrayData = Arrays.asList(taskrromIds);
searchQuery.addIn("fromsourceid", arrayData);
} else {
searchQuery.addEqual("fromsourceid", iztaskrrom);
}
}
if (org.springframework.util.StringUtils.hasText(izuptime)) {
String[] dateRange = izuptime.split("-");
if (dateRange.length == 2) {
try {
SimpleDateFormat sdfInput = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
// 解析开始时间
Long startTimeStamp = sdfInput.parse(dateRange[0].trim() + " 00:00:00").getTime();
// 解析结束时间
Long endTimeStamp = sdfInput.parse(dateRange[1].trim() + " 23:59:59").getTime();
// 如果开始时间不为空,则将其放入查询条件中
if (startTimeStamp != null) {
searchQuery.addGreater("fromuptimeStart", startTimeStamp);
}
// 如果结束时间不为空,则将其放入查询条件中
if (endTimeStamp != null) {
searchQuery.addLess("fromuptimeEnd", endTimeStamp);
}
} catch (ParseException e) {
// 处理日期解析异常
e.printStackTrace();
}
}
}
//租户主键,由前端页面传送
String tenantId = request.getHeader("X-Tenant-Id"); String tenantId = request.getHeader("X-Tenant-Id");
return flowTaskService.repetitionTask(type,tenantId);
if (org.apache.commons.lang3.StringUtils.isBlank(tenantId)) {
return ResultVoUtil.error("租户主键不能为空");
}
User user = this.userService.getSessionUser(request);
if (user.isUserIsSys(xiaoyaoConfig.getWebconfig().getSysLoginUser().split(","))) {
} else {
searchQuery.addEqual("thisLoginUserid", user.getLoginname());
}
searchQuery.addEqual("tenantid", tenantId);
String searchId = request.getParameter("searchId");
if (StringUtils.isNotBlank(searchId)) {
List<OcrUsersearchchild> list = usersearchchildService.list(new LambdaQueryWrapper<OcrUsersearchchild>().eq(OcrUsersearchchild::getUsersearchid, searchId).orderByAsc(OcrUsersearchchild::getOrderNum));
for (OcrUsersearchchild userSearch : list) {
disSearchQuery(searchQuery, userSearch);
}
}
Map<String, Object> query = searchQuery.getQuery();
return flowTaskService.repetitionTask(type, tenantId,query);
} }
/** /**
@ -701,9 +812,9 @@ public class FlowTaskController extends BaseController {
public ResultVo repetitionTaskList(HttpServletRequest request, public ResultVo repetitionTaskList(HttpServletRequest request,
@RequestParam(name = "pageNo") Integer pageNo, @RequestParam(name = "pageNo") Integer pageNo,
@RequestParam(name = "pageSize") Integer pageSize, @RequestParam(name = "pageSize") Integer pageSize,
@RequestParam(value = "type",required = false,defaultValue = "1") Integer type) { @RequestParam(value = "type", required = false, defaultValue = "1") Integer type) {
String tenantId = request.getHeader("X-Tenant-Id"); String tenantId = request.getHeader("X-Tenant-Id");
Page<OcrTaskchildPicture> result = flowTaskService.repetitionTaskList(pageNo, pageSize,type,tenantId); Page<OcrTaskchildPicture> result = flowTaskService.repetitionTaskList(pageNo, pageSize, type, tenantId);
return ResultVoUtil.success(result); return ResultVoUtil.success(result);
} }
@ -719,14 +830,14 @@ public class FlowTaskController extends BaseController {
@GetMapping("/retryPrevailCloud") @GetMapping("/retryPrevailCloud")
@ResponseBody @ResponseBody
public ResultVo retryPrevailCloud(HttpServletRequest request, public ResultVo retryPrevailCloud(HttpServletRequest request,
@RequestParam(name = "formId") String formId) { @RequestParam(name = "formId") String formId) {
String tenantId = request.getHeader("X-Tenant-Id"); String tenantId = request.getHeader("X-Tenant-Id");
Boolean result = null; Boolean result = null;
try { try {
result = flowTaskService.retryPrevailCloud(tenantId,formId); result = flowTaskService.retryPrevailCloud(tenantId, formId);
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage()); log.error(e.getMessage());
result =false; result = false;
} }
return ResultVoUtil.success(result); return ResultVoUtil.success(result);
} }

@ -193,7 +193,7 @@ public interface IFlowTaskService {
* *
* @return * @return
*/ */
ResultVo repetitionTask(Integer type, String tenantId); ResultVo repetitionTask(Integer type, String tenantId, Map<String, Object> query);
Page<OcrTaskchildPicture> repetitionTaskList(Integer pageNo, Integer pageSize, Integer type, String tenantId); Page<OcrTaskchildPicture> repetitionTaskList(Integer pageNo, Integer pageSize, Integer type, String tenantId);

@ -16,6 +16,9 @@ import cn.jyjz.xiaoyao.common.base.util.SpringUtils;
import cn.jyjz.xiaoyao.common.base.util.StringUtils; import cn.jyjz.xiaoyao.common.base.util.StringUtils;
import cn.jyjz.xiaoyao.common.base.vo.UserToken; import cn.jyjz.xiaoyao.common.base.vo.UserToken;
import cn.jyjz.xiaoyao.oa.from.service.UserViewapproeService; import cn.jyjz.xiaoyao.oa.from.service.UserViewapproeService;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture;
import cn.jyjz.xiaoyao.ocr.service.OcrPictureService;
import cn.jyjz.xiaoyao.ocr.service.OcrTaskchildPictureService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.flowable.bpmn.model.MultiInstanceLoopCharacteristics; import org.flowable.bpmn.model.MultiInstanceLoopCharacteristics;
import org.flowable.bpmn.model.UserTask; import org.flowable.bpmn.model.UserTask;
@ -46,15 +49,16 @@ public class FlowInstanceServiceImpl extends FlowServiceFactory implements IFlow
private IFlowTaskService flowTaskService; private IFlowTaskService flowTaskService;
@Resource @Resource
private UserViewapproeService userViewApproeService; private UserViewapproeService userViewApproeService;
@Resource
private OcrTaskchildPictureService ocrTaskchildPictureService;
@Override @Override
public boolean startProcessInstanceById(String procDefId, Map<String, Object> variables, HttpServletRequest request, String formid, String servicename,String deptid) { public boolean startProcessInstanceById(String procDefId, Map<String, Object> variables, HttpServletRequest request, String formid, String servicename, String deptid) {
IFormCustomService iFormCustomService = null; IFormCustomService iFormCustomService = null;
if (StringUtils.isNotBlank(servicename)) { if (StringUtils.isNotBlank(servicename)) {
iFormCustomService = SpringUtils.getBean(servicename); iFormCustomService = SpringUtils.getBean(servicename);
} }
if (StringUtils.isBlank(formid)) { if (StringUtils.isBlank(formid)) {
//表单主键 //表单主键
formid = iFormCustomService.saveForm(request); formid = iFormCustomService.saveForm(request);
@ -87,24 +91,27 @@ public class FlowInstanceServiceImpl extends FlowServiceFactory implements IFlow
try { try {
variables.put("businessKey", businessKey); variables.put("businessKey", businessKey);
//获取下一个节点 //获取下一个节点
UserTask userTask = this.flowTaskService.getNextTasks(procDefId); UserTask userTask = this.flowTaskService.getNextTasks(procDefId);
if(null != userTask){ if (null != userTask) {
MultiInstanceLoopCharacteristics multiInstance = userTask.getLoopCharacteristics(); MultiInstanceLoopCharacteristics multiInstance = userTask.getLoopCharacteristics();
// 会签节点 // 会签节点
if (Objects.nonNull(multiInstance)) { if (Objects.nonNull(multiInstance)) {
List<String> loginnames = flowTaskService.getAssignee(userTask,userName); List<String> loginnames = flowTaskService.getAssignee(userTask, userName);
if(null != loginnames && !loginnames.isEmpty()){ if (null != loginnames && !loginnames.isEmpty()) {
variables.put("persons",loginnames); variables.put("persons", loginnames);
} }
} }
} }
processInstance = runtimeService.startProcessInstanceById(procDefId, businessKey, variables);
processInstance = runtimeService.startProcessInstanceById(procDefId, businessKey, variables);
OcrTaskchildPicture taskchildPicture = ocrTaskchildPictureService.getById(formid);
taskchildPicture.setProcessdefinitionid(processInstance.getProcessDefinitionId());
taskchildPicture.setProcessinstanceid(processInstance.getProcessInstanceId());
ocrTaskchildPictureService.updateById(taskchildPicture);
if (null != iFormCustomService) { if (null != iFormCustomService) {
FlowTaskCompleteVO flowTaskCompleteVO = flowTaskService.updateNowTaskAssignee(processInstance.getProcessInstanceId(), processInstance.getProcessDefinitionId(),deptid); FlowTaskCompleteVO flowTaskCompleteVO = flowTaskService.updateNowTaskAssignee(processInstance.getProcessInstanceId(), processInstance.getProcessDefinitionId(), deptid);
if (null == flowTaskCompleteVO) { if (null == flowTaskCompleteVO) {
throw new ServiceException("没有审批人,请联系管理员,流程定义:" + businessKey); throw new ServiceException("没有审批人,请联系管理员,流程定义:" + businessKey);
@ -145,7 +152,7 @@ public class FlowInstanceServiceImpl extends FlowServiceFactory implements IFlow
} }
@Override @Override
public boolean startProcessInstanceById(String procDefId, String userName, String createuser, String formid, String servicename,String depti) { public boolean startProcessInstanceById(String procDefId, String userName, String createuser, String formid, String servicename, String depti) {
IFormCustomService iFormCustomService = null; IFormCustomService iFormCustomService = null;
if (StringUtils.isNotBlank(servicename)) { if (StringUtils.isNotBlank(servicename)) {
@ -173,24 +180,24 @@ public class FlowInstanceServiceImpl extends FlowServiceFactory implements IFlow
try { try {
variables.put("businessKey", businessKey); variables.put("businessKey", businessKey);
//获取下一个节点 //获取下一个节点
UserTask userTask = this.flowTaskService.getNextTasks(procDefId); UserTask userTask = this.flowTaskService.getNextTasks(procDefId);
if(null != userTask){ if (null != userTask) {
MultiInstanceLoopCharacteristics multiInstance = userTask.getLoopCharacteristics(); MultiInstanceLoopCharacteristics multiInstance = userTask.getLoopCharacteristics();
// 会签节点 // 会签节点
if (Objects.nonNull(multiInstance)) { if (Objects.nonNull(multiInstance)) {
List<String> loginnames = flowTaskService.getAssignee(userTask,userName); List<String> loginnames = flowTaskService.getAssignee(userTask, userName);
if(null != loginnames && !loginnames.isEmpty()){ if (null != loginnames && !loginnames.isEmpty()) {
variables.put("persons",loginnames); variables.put("persons", loginnames);
} }
} }
} }
processInstance = runtimeService.startProcessInstanceById(procDefId, businessKey, variables); processInstance = runtimeService.startProcessInstanceById(procDefId, businessKey, variables);
if (null != iFormCustomService) { if (null != iFormCustomService) {
FlowTaskCompleteVO flowTaskCompleteVO = flowTaskService.updateNowTaskAssignee(processInstance.getProcessInstanceId(), processInstance.getProcessDefinitionId(),depti); FlowTaskCompleteVO flowTaskCompleteVO = flowTaskService.updateNowTaskAssignee(processInstance.getProcessInstanceId(), processInstance.getProcessDefinitionId(), depti);
if (null == flowTaskCompleteVO) { if (null == flowTaskCompleteVO) {
throw new ServiceException("没有审批人,请联系管理员,流程定义:" + businessKey); throw new ServiceException("没有审批人,请联系管理员,流程定义:" + businessKey);

@ -40,7 +40,6 @@ import cn.jyjz.xiaoyao.ocr.dataobject.*;
import cn.jyjz.xiaoyao.ocr.service.*; import cn.jyjz.xiaoyao.ocr.service.*;
import cn.jyjz.xiaoyao.ocr.util.SearchParaFormatting; import cn.jyjz.xiaoyao.ocr.util.SearchParaFormatting;
import cn.jyjz.xiaoyao.ocr.vo.OcrTaskchildPictureApproVo; import cn.jyjz.xiaoyao.ocr.vo.OcrTaskchildPictureApproVo;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -49,6 +48,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.SneakyThrows;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.flowable.bpmn.constants.BpmnXMLConstants; import org.flowable.bpmn.constants.BpmnXMLConstants;
import org.flowable.bpmn.model.*; import org.flowable.bpmn.model.*;
@ -71,12 +71,14 @@ import org.flowable.task.api.history.HistoricTaskInstance;
import org.flowable.task.api.history.HistoricTaskInstanceQuery; import org.flowable.task.api.history.HistoricTaskInstanceQuery;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.InputStream; import java.io.InputStream;
import java.lang.reflect.Field;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -123,6 +125,8 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
private OcrPrevailCloudLogService prevailCloudLogService; private OcrPrevailCloudLogService prevailCloudLogService;
@Resource @Resource
private PrevailCloudApi prevailCloudApi; private PrevailCloudApi prevailCloudApi;
@Autowired
private OcrContractorTaskService contractorTaskService;
@Override @Override
public void myTodoTaskList(PageUtils vo, HttpServletRequest request) { public void myTodoTaskList(PageUtils vo, HttpServletRequest request) {
@ -838,6 +842,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
* *
* @param processInstanceId * @param processInstanceId
*/ */
@SneakyThrows
public FlowTaskCompleteVO updateNowTaskAssignee(String processInstanceId, String processDefinitionId, String deptid) { public FlowTaskCompleteVO updateNowTaskAssignee(String processInstanceId, String processDefinitionId, String deptid) {
FlowTaskCompleteVO flowTaskCompleteVO = null; FlowTaskCompleteVO flowTaskCompleteVO = null;
@ -902,7 +907,30 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
List<String> candidateUsers = userTask.getCandidateUsers(); List<String> candidateUsers = userTask.getCandidateUsers();
if (null != candidateUsers && !candidateUsers.isEmpty()) { if (null != candidateUsers && !candidateUsers.isEmpty()) {
Random rand = new Random(); Random rand = new Random();
taskService.claim(task.getId(), candidateUsers.get(rand.nextInt(candidateUsers.size()))); OcrTaskchildPicture taskchildPicture = ocrTaskchildPictureService.getOne(new LambdaQueryWrapper<OcrTaskchildPicture>().eq(OcrTaskchildPicture::getProcessinstanceid, processInstanceId).eq(OcrTaskchildPicture::getProcessdefinitionid, processDefinitionId));
OcrPicture first = ocrPictureService.getOne(new LambdaQueryWrapper<OcrPicture>().eq(OcrPicture::getId, taskchildPicture.getPictureid()));
List<OcrContractorTask> contractorList = contractorTaskService.list(new LambdaQueryWrapper<OcrContractorTask>().eq(OcrContractorTask::getTenantId, taskchildPicture.getTenantid()));
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(contractorList)) {
Class<? extends OcrPicture> aClass = first.getClass();
Field field = aClass.getDeclaredField(contractorList.get(0).getField());
field.setAccessible(true);
String fieldValue = (String) field.get(first);
log.info("厂商名称------{}",fieldValue);
List<String> collect = contractorList.stream().filter(contractorTask -> contractorTask.getContractor().equals(fieldValue)).map(OcrContractorTask::getTaskUserAssignee).collect(Collectors.toList());
List<String> assigneeList = new ArrayList<>();
for (String str : candidateUsers) {
if (collect.contains(str)) {
assigneeList.add(str);
}
}
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(assigneeList)) {
taskService.claim(task.getId(), assigneeList.get(rand.nextInt(assigneeList.size())));
}else {
taskService.claim(task.getId(), candidateUsers.get(rand.nextInt(candidateUsers.size())));
}
} else {
taskService.claim(task.getId(), candidateUsers.get(rand.nextInt(candidateUsers.size())));
}
} }
//得到候选组 //得到候选组
@ -1963,8 +1991,9 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
} }
@Override @Override
public ResultVo repetitionTask(Integer type, String tenantId) { public ResultVo repetitionTask(Integer type, String tenantId, Map<String, Object> query) {
List<RepeatedContentVo> repeatedContentVoList = flowableccMybatisDao.repetitionTask(type, tenantId); query.put("type", type);
List<RepeatedContentVo> repeatedContentVoList = flowableccMybatisDao.repetitionTaskNew(query);
List<String> formIdsToUpdate = new ArrayList<>(); List<String> formIdsToUpdate = new ArrayList<>();
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(repeatedContentVoList)) { if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(repeatedContentVoList)) {
List<OcrCheckDescribeHis> checkDescribeHis = new ArrayList<>(); List<OcrCheckDescribeHis> checkDescribeHis = new ArrayList<>();
@ -1998,15 +2027,16 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
} }
} }
ocrCheckDescribeHisService.saveOrUpdateBatch(checkDescribeHis); if (!CollectionUtils.isEmpty(checkDescribeHis)) {
UpdateWrapper<OcrTaskchildPicture> updateWrapper = new UpdateWrapper<>(); ocrCheckDescribeHisService.saveOrUpdateBatch(checkDescribeHis);
updateWrapper.in("PICTUREID", formIdsToUpdate) UpdateWrapper<OcrTaskchildPicture> updateWrapper = new UpdateWrapper<>();
.eq("is_repeated_nodules", 0); updateWrapper.in("PICTUREID", formIdsToUpdate)
OcrTaskchildPicture updateEntity = new OcrTaskchildPicture(); .eq("is_repeated_nodules", 0);
updateEntity.setIsRepeatedNodules(1); OcrTaskchildPicture updateEntity = new OcrTaskchildPicture();
ocrTaskchildPictureService.update(updateEntity, updateWrapper); updateEntity.setIsRepeatedNodules(1);
ocrTaskchildPictureService.update(updateEntity, updateWrapper);
}
} }
return ResultVoUtil.success(repeatedContentVoList); return ResultVoUtil.success(repeatedContentVoList);
} }

@ -40,7 +40,7 @@ public interface FlowableccMybatisDao extends BaseMapper<Flowablecc> {
*/ */
List<UserDistionaryVo> selectUserByFromid(String fromid); List<UserDistionaryVo> selectUserByFromid(String fromid);
List<RepeatedContentVo> repetitionTask(@Param("type") Integer type, @Param("tenantId") String tenantId); List<RepeatedContentVo> repetitionTaskNew(Map<String, Object> query);
Page<OcrTaskchildPicture> repetitionTaskList(Page<OcrTaskchildPicture> page, @Param("type") Integer type, @Param("tenantId") String tenantId); Page<OcrTaskchildPicture> repetitionTaskList(Page<OcrTaskchildPicture> page, @Param("type") Integer type, @Param("tenantId") String tenantId);
} }

@ -17,13 +17,15 @@ public interface PrevailCloudApi {
/** /**
* *
*
* @param pictureSourceParameter * @param pictureSourceParameter
* @return * @return
*/ */
ApiPage<PictureSourceResult> pullPictureSource(PictureSourceParameter pictureSourceParameter) throws Exception; ApiPage<PictureSourceResult> pullPictureSource(PictureSourceParameter pictureSourceParameter, boolean isRetry) throws Exception;
/** /**
* *
*
* @param pictureSourceParameter * @param pictureSourceParameter
* @return * @return
*/ */
@ -33,6 +35,7 @@ public interface PrevailCloudApi {
/** /**
* id * id
*
* @param tenantNo * @param tenantNo
*/ */
void pullAccountInfo(long tenantNo) throws Exception; void pullAccountInfo(long tenantNo) throws Exception;
@ -44,7 +47,7 @@ public interface PrevailCloudApi {
List<PictureSourceResult> getAllPictureSourceResultApiPage(PictureSourceParameter pictureSourceParameter); List<PictureSourceResult> getAllPictureSourceResultApiPage(PictureSourceParameter pictureSourceParameter);
List<PictureSourceResult> getPictureSourceResultApiPage(PictureSourceParameter pictureSourceParameter); List<PictureSourceResult> getPictureSourceResultApiPage(PictureSourceParameter pictureSourceParameter, boolean isRetry);
} }

@ -56,7 +56,7 @@ public class PrevailCloudApiImpl implements PrevailCloudApi {
private OcrPrevailCloudLogService prevailCloudLogService; private OcrPrevailCloudLogService prevailCloudLogService;
@Override @Override
public ApiPage<PictureSourceResult> pullPictureSource(PictureSourceParameter pictureSourceParameter) throws Exception { public ApiPage<PictureSourceResult> pullPictureSource(PictureSourceParameter pictureSourceParameter, boolean isRetry) throws Exception {
//1.检查api配置是否正常 //1.检查api配置是否正常
if (!apiConfig.checkConfig()) { if (!apiConfig.checkConfig()) {
return null; return null;
@ -105,7 +105,7 @@ public class PrevailCloudApiImpl implements PrevailCloudApi {
ApiPage<String> apiPage = JSONUtil.toBean(data, ApiPage.class); ApiPage<String> apiPage = JSONUtil.toBean(data, ApiPage.class);
//日志增加拉取数量 //日志增加拉取数量
prevailCloudLog.setResponseParam(prevailCloudLog.getResponseParam()+",拉取数量:"+apiPage.getTotal()); prevailCloudLog.setResponseParam(prevailCloudLog.getResponseParam()+",拉取数量:"+apiPage.getTotal());
if(apiPage.getTotal()==0){ if(!isRetry && apiPage.getTotal()==0){
prevailCloudLogService.save(prevailCloudLog); prevailCloudLogService.save(prevailCloudLog);
return null; return null;
} }
@ -116,7 +116,11 @@ public class PrevailCloudApiImpl implements PrevailCloudApi {
resultApiPage.setPageSize(apiPage.getPageSize()); resultApiPage.setPageSize(apiPage.getPageSize());
resultApiPage.setTotal(apiPage.getTotal()); resultApiPage.setTotal(apiPage.getTotal());
resultApiPage.setRecords(listResult); resultApiPage.setRecords(listResult);
prevailCloudLogService.save(prevailCloudLog);
if (!isRetry) {
prevailCloudLogService.save(prevailCloudLog);
}
return resultApiPage; return resultApiPage;
} else { } else {
logger.debug("请求图片接口数据失败,参数:{},返回值:{}", json, responseJsonStr); logger.debug("请求图片接口数据失败,参数:{},返回值:{}", json, responseJsonStr);
@ -307,7 +311,7 @@ public class PrevailCloudApiImpl implements PrevailCloudApi {
ApiPage<PictureSourceResult> apiPage = null; ApiPage<PictureSourceResult> apiPage = null;
List<PictureSourceResult> result = Lists.newArrayListWithCapacity(pictureSourceParameter.getPageSize()); List<PictureSourceResult> result = Lists.newArrayListWithCapacity(pictureSourceParameter.getPageSize());
try { try {
apiPage = this.pullPictureSource(pictureSourceParameter); apiPage = this.pullPictureSource(pictureSourceParameter, false);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -330,10 +334,10 @@ public class PrevailCloudApiImpl implements PrevailCloudApi {
} }
@Override @Override
public List<PictureSourceResult> getPictureSourceResultApiPage(PictureSourceParameter pictureSourceParameter) { public List<PictureSourceResult> getPictureSourceResultApiPage(PictureSourceParameter pictureSourceParameter, boolean isRetry) {
ApiPage<PictureSourceResult> apiPage = null; ApiPage<PictureSourceResult> apiPage = null;
try { try {
apiPage = this.pullPictureSource(pictureSourceParameter); apiPage = this.pullPictureSource(pictureSourceParameter, isRetry);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }

@ -13,22 +13,21 @@ import cn.jyjz.xiaoyao.ocr.api.entity.PictureSourceResult;
import cn.jyjz.xiaoyao.ocr.api.thread.PullAllPictureSourceThread; import cn.jyjz.xiaoyao.ocr.api.thread.PullAllPictureSourceThread;
import cn.jyjz.xiaoyao.ocr.api.utils.ApiConfig; import cn.jyjz.xiaoyao.ocr.api.utils.ApiConfig;
import cn.jyjz.xiaoyao.ocr.api.utils.ApiPage; import cn.jyjz.xiaoyao.ocr.api.utils.ApiPage;
import cn.jyjz.xiaoyao.ocr.common.PrevailCloudConstant;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrPrevailCloudLog;
import cn.jyjz.xiaoyao.ocr.service.OcrPictureService; import cn.jyjz.xiaoyao.ocr.service.OcrPictureService;
import cn.jyjz.xiaoyao.ocr.service.OcrPrevailCloudLogService; import cn.jyjz.xiaoyao.ocr.service.OcrPrevailCloudLogService;
import cn.jyjz.xiaoyao.ocr.thread.TaskQueue; import cn.jyjz.xiaoyao.ocr.thread.TaskQueue;
import cn.jyjz.xiaoyao.ocr.util.RequestParameterFormat; import cn.jyjz.xiaoyao.ocr.util.RequestParameterFormat;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import lombok.extern.flogger.Flogger;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.compress.utils.Lists; import org.apache.commons.compress.utils.Lists;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import sun.nio.ch.ThreadPool;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@ -38,7 +37,11 @@ import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.*; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
/** /**
* api * api
@ -70,7 +73,7 @@ public class PrevailCloudApiController {
/** /**
* 线 * 线
*/ */
private ExecutorService pictureSourceAllPool = new ThreadPoolExecutor( private ExecutorService pictureSourceAllPool = new ThreadPoolExecutor(
1, 1,
1, 1,
3, 3,
@ -87,32 +90,33 @@ public class PrevailCloudApiController {
/** /**
* *
*
* @param request * @param request
* @return * @return
*/ */
@GetMapping("pullPictureAllByAccountNo") @GetMapping("pullPictureAllByAccountNo")
public String pullPictureAllByAccountNo(HttpServletRequest request){ public String pullPictureAllByAccountNo(HttpServletRequest request) {
//检查是否已有全量拉取在执行 //检查是否已有全量拉取在执行
if(pictureSourceAllPullMsg.isLock()){ if (pictureSourceAllPullMsg.isLock()) {
return pictureSourceAllPullMsg.getMsg(); return pictureSourceAllPullMsg.getMsg();
} }
//1.定义参数 //1.定义参数
String beginStr = request.getParameter("beginStr"); String beginStr = request.getParameter("beginStr");
if(StringUtils.isBlank(beginStr)){ if (StringUtils.isBlank(beginStr)) {
return "开始时间不能为空"; return "开始时间不能为空";
} }
String endStr = request.getParameter("endStr"); String endStr = request.getParameter("endStr");
if(StringUtils.isBlank(endStr)){ if (StringUtils.isBlank(endStr)) {
return "结束时间不能为空"; return "结束时间不能为空";
} }
String tenantNoStr = request.getParameter("tenantNo"); String tenantNoStr = request.getParameter("tenantNo");
if(StringUtils.isBlank(tenantNoStr)){ if (StringUtils.isBlank(tenantNoStr)) {
return "租户不能为空"; return "租户不能为空";
} }
String accountNoStr = request.getParameter("accountNo"); String accountNoStr = request.getParameter("accountNo");
if(StringUtils.isBlank(accountNoStr)){ if (StringUtils.isBlank(accountNoStr)) {
return "业务主体不能为空"; return "业务主体不能为空";
} }
Long tenantNo = Long.parseLong(tenantNoStr); Long tenantNo = Long.parseLong(tenantNoStr);
@ -125,8 +129,8 @@ public class PrevailCloudApiController {
//3.调用线程 //3.调用线程
pictureSourceAllPool.execute( pictureSourceAllPool.execute(
new PullAllPictureSourceThread(tenantNo,accountNo,startDate new PullAllPictureSourceThread(tenantNo, accountNo, startDate
,endDate,pictureSourceAllPullMsg,prevailCloudApi,apiConfig) , endDate, pictureSourceAllPullMsg, prevailCloudApi, apiConfig)
); );
return "执行开始"; return "执行开始";
} }
@ -159,7 +163,7 @@ public class PrevailCloudApiController {
DateTime dateTime = DateUtil.parse(beginStr + " 00:00:00", "yyyy-MM-dd HH:mm:ss"); DateTime dateTime = DateUtil.parse(beginStr + " 00:00:00", "yyyy-MM-dd HH:mm:ss");
// DateTime dateTime = DateUtil.parse("2024-03-31 07:00:000","yyyy-MM-dd HH:mm:ss"); // DateTime dateTime = DateUtil.parse("2024-03-31 07:00:000","yyyy-MM-dd HH:mm:ss");
Instant binstant = dateTime.toInstant(); Instant binstant = dateTime.toInstant();
DateTime dateTime1 = DateUtil.parse(endStr+" 23:59:59","yyyy-MM-dd HH:mm:ss"); DateTime dateTime1 = DateUtil.parse(endStr + " 23:59:59", "yyyy-MM-dd HH:mm:ss");
// DateTime dateTime1 = DateUtil.parse("2024-03-31 09:00:00","yyyy-MM-dd HH:mm:ss"); // DateTime dateTime1 = DateUtil.parse("2024-03-31 09:00:00","yyyy-MM-dd HH:mm:ss");
Instant einstant = dateTime1.toInstant(); Instant einstant = dateTime1.toInstant();
pictureSourceParameter.setStartTime(Date.from(binstant)); pictureSourceParameter.setStartTime(Date.from(binstant));
@ -169,7 +173,7 @@ public class PrevailCloudApiController {
pictureSourceParameter.setTenantNo(tenantNo); pictureSourceParameter.setTenantNo(tenantNo);
pictureSourceParameter.setAccountNo(accountNo); pictureSourceParameter.setAccountNo(accountNo);
try { try {
ApiPage<PictureSourceResult> apiPage = prevailCloudApi.pullPictureSource(pictureSourceParameter); ApiPage<PictureSourceResult> apiPage = prevailCloudApi.pullPictureSource(pictureSourceParameter, false);
if (apiPage == null) { if (apiPage == null) {
return "获取数据为空!"; return "获取数据为空!";
} }
@ -251,7 +255,7 @@ public class PrevailCloudApiController {
pictureSourceParameter.setTenantNo(tenantNo); pictureSourceParameter.setTenantNo(tenantNo);
pictureSourceParameter.setAccountNo(accountNo); pictureSourceParameter.setAccountNo(accountNo);
List<PictureSourceResult> resultList = prevailCloudApi.getPictureSourceResultApiPage(pictureSourceParameter); List<PictureSourceResult> resultList = prevailCloudApi.getPictureSourceResultApiPage(pictureSourceParameter, false);
if (CollectionUtils.isEmpty(resultList)) { if (CollectionUtils.isEmpty(resultList)) {
continue; continue;
} }
@ -279,11 +283,23 @@ public class PrevailCloudApiController {
} }
@GetMapping("/pullPictureByParameter") @GetMapping("/pullPictureByParameter")
public Boolean pullPictureByParameter(String parameterString) { public Boolean pullPictureByParameter(String parameterString, Long id) {
OcrPrevailCloudLog byId = ocrPrevailCloudLogService.getById(id);
if (byId == null) {
return false;
}
PictureSourceParameter pictureSourceParameter = RequestParameterFormat.fromString(parameterString); PictureSourceParameter pictureSourceParameter = RequestParameterFormat.fromString(parameterString);
List<PictureSourceResult> resultList = prevailCloudApi.getPictureSourceResultApiPage(pictureSourceParameter); List<PictureSourceResult> resultList = prevailCloudApi.getPictureSourceResultApiPage(pictureSourceParameter, true);
if (CollectionUtils.isEmpty(resultList)) { if (CollectionUtils.isEmpty(resultList)) {
return false; //更新日志
OcrPrevailCloudLog ocrPrevailCloudLog = OcrPrevailCloudLog.builder()
.status(100)
.id(id)
.time(byId.getTime() + 1)
.build();
ocrPrevailCloudLogService.updateById(ocrPrevailCloudLog);
return true;
} }
for (PictureSourceResult pictureSourceResult : resultList) { for (PictureSourceResult pictureSourceResult : resultList) {
@ -299,7 +315,7 @@ public class PrevailCloudApiController {
//赋值默认参数 //赋值默认参数
pictureSourceResult.setRequestParam(pictureSourceParameter); pictureSourceResult.setRequestParam(pictureSourceParameter);
//将可以处理数据放入处理队列中 //将可以处理数据放入处理队列中
TaskQueue.pictureDisposePushData(pictureSourceResult, ocrPictureService, ocrPrevailCloudLogService); TaskQueue.pictureDisposePushDataUpdateLog(pictureSourceResult, id, ocrPictureService, ocrPrevailCloudLogService);
} }
return true; return true;

@ -0,0 +1,13 @@
package cn.jyjz.xiaoyao.ocr.dataDao;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrContractorTask;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* ClassName $className$.java
* Description:
* Author scl.
* Date 2024/6/23 11:20
*/
public interface OcrContractorTaskMapper extends BaseMapper<OcrContractorTask> {
}

@ -0,0 +1,60 @@
package cn.jyjz.xiaoyao.ocr.dataobject;
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 lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* ClassName $className$.java
* Description:
* Author scl.
* Date 2024/6/23 11:20
*/
/**
*
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "ocr_contractor_task")
public class OcrContractorTask {
/**
* id
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
*
*/
@TableField(value = "contractor")
private String contractor;
/**
* id
*/
@TableField(value = "tenant_id")
private Long tenantId;
/**
*
*/
@TableField(value = "task_user_assignee")
private String taskUserAssignee;
/**
*
*/
@TableField(value = "task_user_name")
private String taskUserName;
/**
*
*/
@TableField(value = "field")
private String field;
}

@ -113,4 +113,10 @@ public class OcrPrevailCloudLog {
*/ */
@TableField(value = "redundance") @TableField(value = "redundance")
private String redundance; private String redundance;
/**
*
*/
@TableField(value = "time")
private Integer time = 0;
} }

@ -0,0 +1,14 @@
package cn.jyjz.xiaoyao.ocr.service;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrContractorTask;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* ClassName $className$.java
* Description:
* Author scl.
* Date 2024/6/23 11:20
*/
public interface OcrContractorTaskService extends IService<OcrContractorTask>{
}

@ -0,0 +1,19 @@
package cn.jyjz.xiaoyao.ocr.service.impl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrContractorTask;
import cn.jyjz.xiaoyao.ocr.dataDao.OcrContractorTaskMapper;
import cn.jyjz.xiaoyao.ocr.service.OcrContractorTaskService;
/**
* ClassName $className$.java
* Description:
* Author scl.
* Date 2024/6/23 11:20
*/
@Service
public class OcrContractorTaskServiceImpl extends ServiceImpl<OcrContractorTaskMapper, OcrContractorTask> implements OcrContractorTaskService{
}

@ -19,18 +19,11 @@ import cn.jyjz.xiaoyao.oa.from.dataobject.Userapprove;
import cn.jyjz.xiaoyao.oa.from.service.UserapproveService; import cn.jyjz.xiaoyao.oa.from.service.UserapproveService;
import cn.jyjz.xiaoyao.ocr.api.PrevailCloudApi; import cn.jyjz.xiaoyao.ocr.api.PrevailCloudApi;
import cn.jyjz.xiaoyao.ocr.dataDao.OcrTaskchildPictureMybatisDao; import cn.jyjz.xiaoyao.ocr.dataDao.OcrTaskchildPictureMybatisDao;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrPicture; import cn.jyjz.xiaoyao.ocr.dataobject.*;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrPictureDuplicateHis;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrPictureInfo;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPictureAppro;
import cn.jyjz.xiaoyao.ocr.dto.ApproveNodeDto; import cn.jyjz.xiaoyao.ocr.dto.ApproveNodeDto;
import cn.jyjz.xiaoyao.ocr.dto.FlowResultDto; import cn.jyjz.xiaoyao.ocr.dto.FlowResultDto;
import cn.jyjz.xiaoyao.ocr.dto.UserapproveDto; import cn.jyjz.xiaoyao.ocr.dto.UserapproveDto;
import cn.jyjz.xiaoyao.ocr.service.IOcrPictureDuplicateHisService; import cn.jyjz.xiaoyao.ocr.service.*;
import cn.jyjz.xiaoyao.ocr.service.OcrPictureInfoService;
import cn.jyjz.xiaoyao.ocr.service.OcrPictureService;
import cn.jyjz.xiaoyao.ocr.service.OcrTaskchildPictureService;
import cn.jyjz.xiaoyao.ocr.vo.OaUserApproveVo; import cn.jyjz.xiaoyao.ocr.vo.OaUserApproveVo;
import cn.jyjz.xiaoyao.ocr.vo.OcrTaskChildPictureVo; import cn.jyjz.xiaoyao.ocr.vo.OcrTaskChildPictureVo;
import cn.jyjz.xiaoyao.ocr.vo.PictureDetailVo; import cn.jyjz.xiaoyao.ocr.vo.PictureDetailVo;
@ -97,6 +90,9 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
@Autowired @Autowired
private OcrPictureInfoService ocrPictureInfoService; private OcrPictureInfoService ocrPictureInfoService;
@Autowired
private OcrContractorTaskService contractorTaskService;
/** /**
* *
* *
@ -231,8 +227,10 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
QueryWrapper queryWrapper = new QueryWrapper(); QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.in("ID", formid); queryWrapper.in("ID", formid);
List<OcrTaskchildPicture> list = this.ocrtaskchildpicturemybatisdao.selectList(queryWrapper); List<OcrTaskchildPicture> list = this.ocrtaskchildpicturemybatisdao.selectList(queryWrapper);
List<OcrPicture> pictureList = ocrPictureService.listByIds(list.stream().map(OcrTaskchildPicture::getPictureid).collect(Collectors.toList()));
//目前没有做其他信息返回,如果需要再做修改 //目前没有做其他信息返回,如果需要再做修改
for (OcrTaskchildPicture ocrTaskchildPicture : list) { for (OcrTaskchildPicture ocrTaskchildPicture : list) {
//判断审批人是否为当前登录用户 //判断审批人是否为当前登录用户
if (ocrTaskchildPicture.getAssignee().contains(userToken.getLoginname()) && if (ocrTaskchildPicture.getAssignee().contains(userToken.getLoginname()) &&
(ocrTaskchildPicture.getStates().intValue() != SystemConstantsOa.OA_STATUS_TYPE_END (ocrTaskchildPicture.getStates().intValue() != SystemConstantsOa.OA_STATUS_TYPE_END
@ -346,7 +344,9 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
Task taskData = null; Task taskData = null;
if (null != taskList && !taskList.isEmpty()) { if (null != taskList && !taskList.isEmpty()) {
taskData = taskList.get(0); taskData = taskList.get(0);
ocrTaskchildPicture.setAssignee(taskData.getAssignee()); String assignee = taskData.getAssignee();
//todo
ocrTaskchildPicture.setAssignee(assignee);
} }
ocrPicture.setTaskchildpictureid(ocrTaskchildPicture.getId().toString()); ocrPicture.setTaskchildpictureid(ocrTaskchildPicture.getId().toString());
@ -741,12 +741,12 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
} }
} }
if((taskChildPictureVo.getStates()==3 || taskChildPictureVo.getStates()==5)&& if ((taskChildPictureVo.getStates() == 3 || taskChildPictureVo.getStates() == 5) &&
(taskChildPictureVo.getHistoryStates()==null || taskChildPictureVo.getHistoryStates()==1)){ (taskChildPictureVo.getHistoryStates() == null || taskChildPictureVo.getHistoryStates() == 1)) {
int historyStates = 1; int historyStates = 1;
if(taskChildPictureVo.getStates()==3){ if (taskChildPictureVo.getStates() == 3) {
historyStates = 2; historyStates = 2;
}else if(taskChildPictureVo.getStates()==5){ } else if (taskChildPictureVo.getStates() == 5) {
historyStates = 3; historyStates = 3;
} }
taskChildPictureVo.setHistoryStates(historyStates); taskChildPictureVo.setHistoryStates(historyStates);
@ -765,12 +765,12 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
Page<OcrTaskChildPictureVo> result = ocrtaskchildpicturemybatisdao.getPackageSimilarityList(page, checkDuplicateId, pictureId, oderType, oderName); Page<OcrTaskChildPictureVo> result = ocrtaskchildpicturemybatisdao.getPackageSimilarityList(page, checkDuplicateId, pictureId, oderType, oderName);
//历史数据,因为没有审核记录所以需要填补最终状态. //历史数据,因为没有审核记录所以需要填补最终状态.
for (OcrTaskChildPictureVo record : result.getRecords()) { for (OcrTaskChildPictureVo record : result.getRecords()) {
if((record.getStates()==3 || record.getStates()==5)&& if ((record.getStates() == 3 || record.getStates() == 5) &&
(record.getHistoryStates()==null || record.getHistoryStates()==1)){ (record.getHistoryStates() == null || record.getHistoryStates() == 1)) {
int historyStates = 1; int historyStates = 1;
if(record.getStates()==3){ if (record.getStates() == 3) {
historyStates = 2; historyStates = 2;
}else if(record.getStates()==5){ } else if (record.getStates() == 5) {
historyStates = 3; historyStates = 3;
} }
record.setHistoryStates(historyStates); record.setHistoryStates(historyStates);
@ -821,11 +821,11 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
taskchildPicture.setPictureid(picture.getId()); taskchildPicture.setPictureid(picture.getId());
taskchildPicture.setCategoryid(picture.getCategoryid()); taskchildPicture.setCategoryid(picture.getCategoryid());
int states = 0; int states = 0;
if("8".equals(picture.getTaskstatus())){ if ("8".equals(picture.getTaskstatus())) {
states = 3; states = 3;
}else if ("9".equals(picture.getTaskstatus()) || "10".equals(picture.getTaskstatus())){ } else if ("9".equals(picture.getTaskstatus()) || "10".equals(picture.getTaskstatus())) {
states= 5; states = 5;
}else{ } else {
return false; return false;
} }
taskchildPicture.setStates(states); taskchildPicture.setStates(states);
@ -848,7 +848,7 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
taskchildPicture.setTaskNode("finale_judgment"); taskchildPicture.setTaskNode("finale_judgment");
taskchildPicture.setIsRepeatedNodules(0); taskchildPicture.setIsRepeatedNodules(0);
taskchildPicture.setSendResult(0); taskchildPicture.setSendResult(0);
return this.save(taskchildPicture); return this.save(taskchildPicture);
} }
private static ApproveNodeDto getApproveNodeDto(Userapprove userApprove) { private static ApproveNodeDto getApproveNodeDto(Userapprove userApprove) {

@ -22,11 +22,17 @@ import cn.jyjz.xiaoyao.oa.from.service.CandidateuserService;
import cn.jyjz.xiaoyao.oa.from.service.CategoryService; import cn.jyjz.xiaoyao.oa.from.service.CategoryService;
import cn.jyjz.xiaoyao.ocr.dataDao.OcrTaskchildPictureMybatisDao; import cn.jyjz.xiaoyao.ocr.dataDao.OcrTaskchildPictureMybatisDao;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrContractorTask;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrPicture;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture; import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture;
import cn.jyjz.xiaoyao.ocr.service.OcrContractorTaskService;
import cn.jyjz.xiaoyao.ocr.service.OcrPictureService;
import cn.jyjz.xiaoyao.ocr.service.OcrTaskchildPictureService; import cn.jyjz.xiaoyao.ocr.service.OcrTaskchildPictureService;
import cn.jyjz.xiaoyao.upload.upload.UploadSpringUtil; import cn.jyjz.xiaoyao.upload.upload.UploadSpringUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.velocity.shaded.commons.io.FilenameUtils; import org.apache.velocity.shaded.commons.io.FilenameUtils;
import org.flowable.task.api.Task; import org.flowable.task.api.Task;
@ -40,9 +46,11 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* *
@ -71,6 +79,12 @@ public class TaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchildPic
@Autowired @Autowired
private IFlowFormMessageService iFlowFormMessageService; private IFlowFormMessageService iFlowFormMessageService;
@Autowired
private OcrPictureService pictureService;
@Autowired
private OcrContractorTaskService contractorTaskService;
@Override @Override
public String saveForm(HttpServletRequest request) { public String saveForm(HttpServletRequest request) {
OcrTaskchildPicture model = null; OcrTaskchildPicture model = null;
@ -228,18 +242,36 @@ public class TaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchildPic
@Override @Override
public boolean updateForm(String fromid, String deploymentid, String processdefinitionid, String assignee, String taskId, String processInstanceId, Task task) { public boolean updateForm(String fromid, String deploymentid, String processdefinitionid, String assignee, String taskId, String processInstanceId, Task task) {
if (StringUtils.isNotBlank(fromid) && StringUtils.isNotBlank(deploymentid) && StringUtils.isNotBlank(processdefinitionid)) { if (StringUtils.isNotBlank(fromid) && StringUtils.isNotBlank(deploymentid) && StringUtils.isNotBlank(processdefinitionid)) {
String[] assignees = assignee.split(",");
List<String> assigneeList = new ArrayList<>();
OcrTaskchildPicture model = this.ocrTaskchildPictureService.selectDtoById(Long.parseLong(fromid)); OcrTaskchildPicture model = this.ocrTaskchildPictureService.selectDtoById(Long.parseLong(fromid));
OcrPicture first = pictureService.getOne(new LambdaQueryWrapper<OcrPicture>().eq(OcrPicture::getId, model.getPictureid()));
if (org.apache.commons.lang3.StringUtils.isNotBlank(first.getField5())) {
List<OcrContractorTask> contractorList = contractorTaskService.list(new LambdaQueryWrapper<OcrContractorTask>().eq(OcrContractorTask::getContractor, first.getField5()).eq(OcrContractorTask::getTenantId, model.getTenantid()));
if (CollectionUtils.isNotEmpty(contractorList)) {
List<String> collect = contractorList.stream().map(OcrContractorTask::getTaskUserAssignee).collect(Collectors.toList());
for (String str : assignees) {
if (collect.contains(str)) {
assigneeList.add(str);
}
}
}
}
if (CollectionUtils.isNotEmpty(assigneeList)) {
assignee = String.join(",", assigneeList);
assignees = assignee.split(",");
}
model.setProcessinstanceid(processInstanceId); model.setProcessinstanceid(processInstanceId);
model.setProcessdefinitionid(processdefinitionid); model.setProcessdefinitionid(processdefinitionid);
model.setDeploymentid(deploymentid); model.setDeploymentid(deploymentid);
model.setAssignee(assignee); model.setAssignee(assignee);
if(ObjectUtils.isNotEmpty(task)){ if (ObjectUtils.isNotEmpty(task)) {
model.setTaskname(task.getName()); model.setTaskname(task.getName());
model.setTaskId(taskId); model.setTaskId(taskId);
} }
//todo
model.setStates(SystemConstantsOa.OA_STATUS_TYPE_ING); model.setStates(SystemConstantsOa.OA_STATUS_TYPE_ING);
//查询审批人姓名 //查询审批人姓名
String[] assignees = assignee.split(",");
StringBuffer stringBuffer = new StringBuffer(); StringBuffer stringBuffer = new StringBuffer();
for (String tempAssign : assignees) { for (String tempAssign : assignees) {
User user = userService.findByLoginname(tempAssign); User user = userService.findByLoginname(tempAssign);

@ -48,11 +48,11 @@ public class TaskQueue {
if (ocrPicture != null) { if (ocrPicture != null) {
OcrTaskchildPicture taskchildPicture = ocrPictureService.getOcrTaskChildPictureByPictureId(ocrPicture.getId().toString()); OcrTaskchildPicture taskchildPicture = ocrPictureService.getOcrTaskChildPictureByPictureId(ocrPicture.getId().toString());
if (taskchildPicture != null && pictureSourceResult.getTaskStatus() != null if (taskchildPicture != null && pictureSourceResult.getTaskStatus() != null
&& (pictureSourceResult.getTaskStatus() == 6 || pictureSourceResult.getTaskStatus() == 7) && (taskchildPicture.getStates() == 5 || taskchildPicture.getStates()==3)) { && (pictureSourceResult.getTaskStatus() == 6 || pictureSourceResult.getTaskStatus() == 7) && (taskchildPicture.getStates() == 5 || taskchildPicture.getStates() == 3)) {
if(taskchildPicture.getStates() == 5){ if (taskchildPicture.getStates() == 5) {
String result = ocrPictureService.getPictureApproveResult(ocrPicture.getId()); String result = ocrPictureService.getPictureApproveResult(ocrPicture.getId());
pictureSourceResult.setComment(result); pictureSourceResult.setComment(result);
}else{ } else {
pictureSourceResult.setComment("ocr审批全部通过由无量云发起了重置审批流程的操作。"); pictureSourceResult.setComment("ocr审批全部通过由无量云发起了重置审批流程的操作。");
} }
ocrPictureService.deletePictureInfo(ocrPicture.getId()); ocrPictureService.deletePictureInfo(ocrPicture.getId());
@ -68,6 +68,7 @@ public class TaskQueue {
.responseParam(pictureSourceResult.toString()) .responseParam(pictureSourceResult.toString())
.type(PrevailCloudConstant.DISPOSE_PICTURE_SOURCE) .type(PrevailCloudConstant.DISPOSE_PICTURE_SOURCE)
.status(100) .status(100)
.time(0)
.build(); .build();
ocrPrevailCloudLogService.save(ocrPrevailCloudLog); ocrPrevailCloudLogService.save(ocrPrevailCloudLog);
resultSet.add(String.valueOf(taskId)); resultSet.add(String.valueOf(taskId));
@ -79,6 +80,7 @@ public class TaskQueue {
.responseParam(pictureSourceResult.toString()) .responseParam(pictureSourceResult.toString())
.type(PrevailCloudConstant.DISPOSE_PICTURE_SOURCE) .type(PrevailCloudConstant.DISPOSE_PICTURE_SOURCE)
.status(500) .status(500)
.time(0)
.build(); .build();
ocrPrevailCloudLogService.save(ocrPrevailCloudLog); ocrPrevailCloudLogService.save(ocrPrevailCloudLog);
return false; return false;
@ -86,6 +88,67 @@ public class TaskQueue {
return true; return true;
} }
/**
* [] push bi
*
* @param pictureSourceResult //三方拉取 获取到的图片对象
* @return
*/
public static boolean pictureDisposePushDataUpdateLog(PictureSourceResult pictureSourceResult, Long id, OcrPictureService ocrPictureService, OcrPrevailCloudLogService ocrPrevailCloudLogService) {
OcrPrevailCloudLog byId = ocrPrevailCloudLogService.getById(id);
if (byId == null) {
return false;
}
try {
Long taskId = pictureSourceResult.getTaskId();
OcrPicture ocrPicture = ocrPictureService.selectByRemark(String.valueOf(taskId));
if (ocrPicture != null) {
OcrTaskchildPicture taskchildPicture = ocrPictureService.getOcrTaskChildPictureByPictureId(ocrPicture.getId().toString());
if (taskchildPicture != null && pictureSourceResult.getTaskStatus() != null
&& (pictureSourceResult.getTaskStatus() == 6 || pictureSourceResult.getTaskStatus() == 7) && (taskchildPicture.getStates() == 5 || taskchildPicture.getStates() == 3)) {
if (taskchildPicture.getStates() == 5) {
String result = ocrPictureService.getPictureApproveResult(ocrPicture.getId());
pictureSourceResult.setComment(result);
} else {
pictureSourceResult.setComment("ocr审批全部通过由无量云发起了重置审批流程的操作。");
}
ocrPictureService.deletePictureInfo(ocrPicture.getId());
pictureSourceResult.setId(ocrPicture.getId());
} else {
return true;
}
}
//更新日志
OcrPrevailCloudLog ocrPrevailCloudLog = OcrPrevailCloudLog.builder()
.formId(pictureSourceResult.getTaskId())
.requestParam(pictureSourceResult.getRequestParam().toString())
.responseParam(pictureSourceResult.toString())
.type(PrevailCloudConstant.DISPOSE_PICTURE_SOURCE)
.status(100)
.id(id)
.time(byId.getTime() + 1)
.build();
ocrPrevailCloudLogService.updateById(ocrPrevailCloudLog);
resultSet.add(String.valueOf(taskId));
pictureDisposeQueue.put(pictureSourceResult);
} catch (InterruptedException e) {
OcrPrevailCloudLog ocrPrevailCloudLog = OcrPrevailCloudLog.builder()
.formId(pictureSourceResult.getTaskId())
.requestParam(pictureSourceResult.getRequestParam().toString())
.responseParam(pictureSourceResult.toString())
.type(PrevailCloudConstant.DISPOSE_PICTURE_SOURCE)
.status(500)
.time(byId.getTime() + 1)
.id(id)
.build();
ocrPrevailCloudLogService.updateById(ocrPrevailCloudLog);
return false;
}
return true;
}
/** /**
* *
* *

@ -135,7 +135,7 @@ public class PictureSourceTimerJob {
pictureSourceParameter.setTenantNo(tenantNo); pictureSourceParameter.setTenantNo(tenantNo);
pictureSourceParameter.setAccountNo(accountNo); pictureSourceParameter.setAccountNo(accountNo);
List<PictureSourceResult> resultList = prevailCloudApi.getPictureSourceResultApiPage(pictureSourceParameter); List<PictureSourceResult> resultList = prevailCloudApi.getPictureSourceResultApiPage(pictureSourceParameter, false);
if (CollectionUtils.isEmpty(resultList)) { if (CollectionUtils.isEmpty(resultList)) {
continue; continue;
} }

@ -98,7 +98,7 @@ public class PullPictureDataJob {
pictureSourceParameter.setTenantNo(tenantNo); pictureSourceParameter.setTenantNo(tenantNo);
pictureSourceParameter.setAccountNo(accountNo); pictureSourceParameter.setAccountNo(accountNo);
List<PictureSourceResult> resultList = prevailCloudApi.getPictureSourceResultApiPage(pictureSourceParameter); List<PictureSourceResult> resultList = prevailCloudApi.getPictureSourceResultApiPage(pictureSourceParameter, false);
if (CollectionUtils.isEmpty(resultList)) { if (CollectionUtils.isEmpty(resultList)) {
continue; continue;
} }

@ -158,6 +158,187 @@
</trim> </trim>
</where> </where>
</sql> </sql>
<sql id="Base_Where_union_new">
<where>
<trim prefixOverrides="and|or">
<if test="id != null">
and tcp.ID ${id.dataOp} ${id.likestar}#{id.value}${id.likeend}
</if>
<if test="ocpictureid != null">
and tcp.OCPICTUREID ${ocpictureid.dataOp} ${ocpictureid.likestar}#{ocpictureid.value}${ocpictureid.likeend}
</if>
<if test="pictureresult != null">
and tcp.PICTURERESULT ${pictureresult.dataOp} ${pictureresult.likestar}#{pictureresult.value}${pictureresult.likeend}
</if>
<if test="picturecompare != null">
and tcp.PICTURECOMPARE ${picturecompare.dataOp} ${picturecompare.likestar}#{picturecompare.value}${picturecompare.likeend}
</if>
<if test="deptid != null">
and tcp.DEPTID ${deptid.dataOp} ${deptid.likestar}#{deptid.value}${deptid.likeend}
</if>
<if test="tenantid != null">
and tcp.TENANTID ${tenantid.dataOp} ${tenantid.likestar}#{tenantid.value}${tenantid.likeend}
</if>
<if test="packageid != null">
and tcp.PACKAGEID ${packageid.dataOp} ${packageid.likestar}#{packageid.value}${packageid.likeend}
</if>
<if test="pictureid != null">
and tcp.PICTUREID ${pictureid.dataOp} ${pictureid.likestar}#{pictureid.value}${pictureid.likeend}
</if>
<if test="category != null">
and tcp.CATEGORY ${category.dataOp} ${category.likestar}#{category.value}${category.likeend}
</if>
<if test="categoryid != null">
and tcp.CATEGORYID ${categoryid.dataOp} ${categoryid.likestar}#{categoryid.value}${categoryid.likeend}
</if>
<if test="specification != null">
and tcp.SPECIFICATION ${specification.dataOp} ${specification.likestar}#{specification.value}${specification.likeend}
</if>
<if test="buessinessno != null">
and tcp.BUESSINESSNO ${buessinessno.dataOp} ${buessinessno.likestar}#{buessinessno.value}${buessinessno.likeend}
</if>
<!-- <if test="states != null"> and tcp.STATES ${states.dataOp} ${states.likestar}#{states.value}${states.likeend}</if>-->
<if test="processinstanceid != null">
and tcp.PROCESSINSTANCEID ${processinstanceid.dataOp} ${processinstanceid.likestar}#{processinstanceid.value}${processinstanceid.likeend}
</if>
<if test="processdefinitionid != null">
and tcp.PROCESSDEFINITIONID ${processdefinitionid.dataOp} ${processdefinitionid.likestar}#{processdefinitionid.value}${processdefinitionid.likeend}
</if>
<if test="deploymentid != null">
and tcp.DEPLOYMENTID ${deploymentid.dataOp} ${deploymentid.likestar}#{deploymentid.value}${deploymentid.likeend}
</if>
<if test="assigneename != null">
and tcp.ASSIGNEENAME ${assigneename.dataOp} ${assigneename.likestar}#{assigneename.value}${assigneename.likeend}
</if>
<if test="assignee != null">
and tcp.ASSIGNEE ${assignee.dataOp} ${assignee.likestar}#{assignee.value}${assignee.likeend}
</if>
<if test="updateuser != null">
and tcp.UPDATEUSER ${updateuser.dataOp} ${updateuser.likestar}#{updateuser.value}${updateuser.likeend}
</if>
<if test="updatetime != null">
and tcp.UPDATETIME ${updatetime.dataOp} ${updatetime.likestar}#{updatetime.value}${updatetime.likeend}
</if>
<if test="fileannex != null">
and tcp.FILEANNEX ${fileannex.dataOp} ${fileannex.likestar}#{fileannex.value}${fileannex.likeend}
</if>
<if test="guidang != null">
and tcp.GUIDANG ${guidang.dataOp} ${guidang.likestar}#{guidang.value}${guidang.likeend}
</if>
<if test="createuser != null">
and tcp.CREATEUSER ${createuser.dataOp} ${createuser.likestar}#{createuser.value}${createuser.likeend}
</if>
<if test="createusername != null">
and tcp.CREATEUSERNAME ${createusername.dataOp} ${createusername.likestar}#{createusername.value}${createusername.likeend}
</if>
<if test="createdate != null">
and tcp.CREATEDATE ${createdate.dataOp} ${createdate.likestar}#{createdate.value}${createdate.likeend}
</if>
<if test="createdateStart != null">
and tcp.CREATEDATE ${createdateStart.dataOp} ${createdateStart.likestar}#{createdateStart.value}${createdateStart.likeend}
</if>
<if test="createdateEnd != null">
and tcp.CREATEDATE ${createdateEnd.dataOp} ${createdateEnd.likestar}#{createdateEnd.value}${createdateEnd.likeend}
</if>
<if test="username != null">
and tcp.USERNAME ${username.dataOp} ${username.likestar}#{username.value}${username.likeend}
</if>
<if test="fromtaskid != null">
and tcp.FROMTASKID ${fromtaskid.dataOp} ${fromtaskid.likestar}#{fromtaskid.value}${fromtaskid.likeend}
</if>
<if test="fromtaskname != null">
and tcp.FROMTASKNAME ${fromtaskname.dataOp} ${fromtaskname.likestar}#{fromtaskname.value}${fromtaskname.likeend}
</if>
<!-- <if test="fromuserid != null"> and tcp.FROMUSERID ${fromuserid.dataOp} ${fromuserid.likestar}#{fromuserid.value}${fromuserid.likeend}</if>-->
<!-- <if test="fromprojectid != null"> and tcp.FROMPROJECTID ${fromprojectid.dataOp} ${fromprojectid.likestar}#{fromprojectid.value}${fromprojectid.likeend}</if>-->
<!-- <if test="fromplanid != null"> and tcp.FROMPLANID ${fromplanid.dataOp} ${fromplanid.likestar}#{fromplanid.value}${fromplanid.likeend}</if>-->
<if test="fromuptime != null">
and tcp.FROMUPTIME ${fromuptime.dataOp} ${fromuptime.likestar}#{fromuptime.value}${fromuptime.likeend}
</if>
<if test="fromuserid != null">
and tcp.FROMUSERID ${fromuserid.dataOp} ${fromuserid.likestar}
<!-- #{fromuserid.value}-->
<if test="fromuserid.value instanceof java.util.List">
<foreach item="item" collection="fromuserid.value" open="" separator="," close="">
#{item}
</foreach>
</if>
<if test="!fromuserid.value instanceof java.util.List">
#{fromuserid.value}
</if>
${fromuserid.likeend}
</if>
<if test="fromprojectid != null">
and tcp.FROMPROJECTID ${fromprojectid.dataOp} ${fromprojectid.likestar}
<!-- #{fromuserid.value}-->
<if test="fromprojectid.value instanceof java.util.List">
<foreach item="item" collection="fromprojectid.value" open="" separator="," close="">
#{item}
</foreach>
</if>
<if test="!fromprojectid.value instanceof java.util.List">
#{fromprojectid.value}
</if>
${fromprojectid.likeend}
</if>
<if test="fromplanid != null">
and tcp.FROMPLANID ${fromplanid.dataOp} ${fromplanid.likestar}
<!-- #{fromuserid.value}-->
<if test="fromplanid.value instanceof java.util.List">
<foreach item="item" collection="fromplanid.value" open="" separator="," close="">
#{item}
</foreach>
</if>
<if test="!fromplanid.value instanceof java.util.List">
#{fromplanid.value}
</if>
${fromplanid.likeend}
</if>
<if test="states != null">
and tcp.STATES ${states.dataOp} ${states.likestar}
<!-- #{fromuserid.value}-->
<if test="states.value instanceof java.util.List">
<foreach item="item" collection="states.value" open="" separator="," close="">
#{item}
</foreach>
</if>
<if test="!states.value instanceof java.util.List">
#{states.value}
</if>
${states.likeend}
</if>
<if test="fromsourceid != null">
and tcp.FROMSOURCEID ${fromsourceid.dataOp} ${fromsourceid.likestar}
<!-- #{fromuserid.value}-->
<if test="fromsourceid.value instanceof java.util.List">
<foreach item="item" collection="fromsourceid.value" open="" separator="," close="">
#{item}
</foreach>
</if>
<if test="!fromsourceid.value instanceof java.util.List">
#{fromsourceid.value}
</if>
${fromsourceid.likeend}
</if>
<!-- <if test="fromuserid.value instanceof java.util.List"> and tcp.FROMUSERID-->
<!-- in-->
<!-- <foreach item="item" collection="fromuserid.value" open="(" separator="," close=")">-->
<!-- #{item}-->
<!-- </foreach>-->
<!-- </if>-->
<if test="havepoints != null">
and tcp.HAVEPOINTS ${havepoints.dataOp} ${havepoints.likestar}#{havepoints.value}${havepoints.likeend}
</if>
<if test="taskname != null">
and tcp.TASKNAME ${taskname.dataOp} ${taskname.likestar}#{taskname.value}${taskname.likeend}
</if>
<if test="userid != null">
and tcp.USERID ${userid.dataOp} ${userid.likestar}#{userid.value}${userid.likeend}
</if>
</trim>
</where>
</sql>
<select id="selectUserByFromid" resultMap="BaseResultUserMap" > <select id="selectUserByFromid" resultMap="BaseResultUserMap" >
select select
u.ID AS id, u.ID AS id,
@ -232,6 +413,55 @@
where t2.TENANTID = #{tenantId,jdbcType=VARCHAR} where t2.TENANTID = #{tenantId,jdbcType=VARCHAR}
</select> </select>
<select id="repetitionTaskNew" resultMap="resultMap">
SELECT t1.count,
t1.content,
t1.id,
t1.imgUrl,
pic.similarity_score similarityScore,
tcp.STATES,
pic.remark as fromTaskId,
pic.taskName,
tcp.TASKNAME nodeName,
tcp.FROMUPTIME fromTime,
tcp.UPDATETIME as updateTime,
tcp.TASKID as taskId,
tcp.ID as formId,
t1.pictureIds
from (select count(field8) count, field8 content, ID id, GROUP_CONCAT(id) pictureIds, imgUrl
FROM ocr_picture
where suspiciousfile = 0
and tenant_id = #{tenantid.value,jdbcType=VARCHAR}
GROUP BY field8
HAVING count(field8) > 1) t1
left JOIN ocr_picture pic on t1.content = pic.field8
left JOIN ocr_taskchild_picture tcp ON pic.ID = tcp.PICTUREID
<include refid="Base_Where_union_new"/>
<if test="type.value == 0">
and tcp.ISFINAIL = 1
</if>
<if test="type.value == 1">
and tcp.ISLAST = 1
</if>
<if test="thisLoginUserid != null and isFail == null">
and FIND_IN_SET(#{thisLoginUserid.value}
, tcp.ASSIGNEE)
</if>
<if test="thisLoginUserid != null and isFail != null">
and (FIND_IN_SET(#{thisLoginUserid.value}
, tcp.ASSIGNEE)
or tcp.STATES = 5)
</if>
<if test="fromuptimeStart != null">
and tcp.fromuptime &gt;= ${fromuptimeStart.value}
</if>
<if test="fromuptimeEnd != null">
and tcp.fromuptime &lt;= ${fromuptimeEnd.value}
</if>
</select>
<select id="repetitionTaskList" resultType="cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture"> <select id="repetitionTaskList" resultType="cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture">
SELECT t2.*, t3.similarity_score similarityScore SELECT t2.*, t3.similarity_score similarityScore
FROM ocr_taskchild_picture t2 FROM ocr_taskchild_picture t2

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.jyjz.xiaoyao.ocr.dataDao.OcrContractorTaskMapper">
<resultMap id="BaseResultMap" type="cn.jyjz.xiaoyao.ocr.dataobject.OcrContractorTask">
<!--@mbg.generated-->
<!--@Table ocr_contractor_task-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="contractor" jdbcType="VARCHAR" property="contractor" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
<result column="task_user_assignee" jdbcType="VARCHAR" property="taskUserAssignee" />
<result column="task_user_name" jdbcType="VARCHAR" property="taskUserName" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, contractor, tenant_id, task_user_assignee, task_user_name
</sql>
</mapper>
Loading…
Cancel
Save