Merge branch 'master' into dev-cui

# Conflicts:
#	runstart/src/main/resources/application-dev.yml
pull/1/head
DELL 1 year 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,63 +44,83 @@ 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);
/**
*
*
* @param query
* @param pageUtils
* @param query
* @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);
/**
*
*
* @param query
* @param pageUtils
* @param query
* @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,14 +47,15 @@ public class OcrMsgReadController {
/**
*
*
* @return
*/
@ApiOperation(value = "系统消息分页", notes = "系统消息分页")
@RequestMapping(value = "/systemPage", method = RequestMethod.GET)
public ResponseEntity<?> 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) {
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) {
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
@ -76,44 +70,47 @@ 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);
}
/**
*
*
*
* @param id
* @param id
* @param id
* @return
*/
@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,12 +36,13 @@ public class OcrSearchHistoryController {
/**
*
*
* @param request
* @return
*/
@RequestMapping(value = "/searchList", method = RequestMethod.GET)
public ResponseEntity<?> searchList(HttpServletRequest request,
@RequestParam(value = "search", required = false) String search) {
public ResultVo searchList(HttpServletRequest request,
@RequestParam(value = "search", required = false) String search) {
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
//执行查询方法
List<String> selectsearch = ocrSearchHistoryService.selectsearch(search, userToken.getUsername());
@ -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);
ocrSearchHistoryService.remove(wrapper);
// 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);
}
}

@ -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,130 +30,129 @@ import java.util.*;
import java.util.stream.Collectors;
/**
*
*/
*
*/
@Service("ocrTaskchildPictureService")
@Slf4j
public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchildPictureMybatisDao, OcrTaskchildPicture> implements OcrTaskchildPictureService {
@Resource
private OcrTaskchildPictureMybatisDao ocrtaskchildpicturemybatisdao;
@Resource
private OcrPictureService ocrPictureService;
@Resource
IFlowTaskService iFlowTaskService;
/**
*
*
* @param childpictureids
* @return
*/
public ResultVo trueorfalse(String childpictureids, String packageid, String iztrueorfalse, String judgeid, String judgedesc) {
String[] cps = childpictureids.split(",");
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));
//如果是历史图片,不允许进行设置
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));
ocrPicture.setJudgedesc(judgedesc);
ocrPicture.setIztrueorfalse(Integer.parseInt(iztrueorfalse));
ocrPicture.setUpdateTime(System.currentTimeMillis());
saveList.add(ocrPicture);
}
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();
}
public ResultVo clearmark(String childpictureids, String packageid) {
String[] cps = childpictureids.split(",");
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));
//如果是历史图片,不允许进行设置
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);
ocrPicture.setJudgedesc(null);
ocrPicture.setIztrueorfalse(null);
ocrPicture.setUpdateTime(System.currentTimeMillis());
saveList.add(ocrPicture);
}
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();
}
/**
*
*
* @param childpictureid
* @return
*/
public boolean pass(String childpictureid, OcrTaskchildPicture ocrTaskchildPicture) {
OcrTaskchildPicture old = this.getById(childpictureid);
//判断当前图片是否在任务包中,如果不在任务保重,不允许设置图片真假
if (!old.getPackageid().equals(ocrTaskchildPicture.getPackageid())) {
return false;
}
public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchildPictureMybatisDao, OcrTaskchildPicture> implements OcrTaskchildPictureService {
@Resource
private OcrTaskchildPictureMybatisDao ocrtaskchildpicturemybatisdao;
@Resource
private OcrPictureService ocrPictureService;
@Resource
IFlowTaskService iFlowTaskService;
/**
*
* @param childpictureids
* @return
*/
public ResultVo trueorfalse(String childpictureids, String packageid, String iztrueorfalse, String judgeid, String judgedesc){
String[] cps = childpictureids.split(",");
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));
//如果是历史图片,不允许进行设置
// 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));
ocrPicture.setJudgedesc(judgedesc);
ocrPicture.setIztrueorfalse(Integer.parseInt(iztrueorfalse));
ocrPicture.setUpdateTime(System.currentTimeMillis());
saveList.add(ocrPicture);
}
// 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();
}
public ResultVo clearmark(String childpictureids, String packageid){
String[] cps = childpictureids.split(",");
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));
//如果是历史图片,不允许进行设置
// 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);
ocrPicture.setJudgedesc(null);
ocrPicture.setIztrueorfalse(null);
ocrPicture.setUpdateTime(System.currentTimeMillis());
saveList.add(ocrPicture);
}
// 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();
}
/**
*
* @param childpictureid
* @return
*/
public boolean pass(String childpictureid,OcrTaskchildPicture ocrTaskchildPicture){
OcrTaskchildPicture old = this.getById(childpictureid);
//判断当前图片是否在任务包中,如果不在任务保重,不允许设置图片真假
if(!old.getPackageid().equals(ocrTaskchildPicture.getPackageid())){
return false;
}
//
// //更新图片真假
// if(StringUtils.isNotBlank(ocrTaskchildPicture.getIzpass())){
@ -165,131 +165,127 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
// old.setPicturecompare(ocrTaskchildPicture.getPicturecompare());
// }
old.setUpdatetime(System.currentTimeMillis());
return this.updateById(old);
}
/**
*
*
* @param formid
* @param userToken
* @return
*/
public boolean validateAssignee(String[] formid, UserToken userToken) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.in("ID", formid);
List<OcrTaskchildPicture> list = this.ocrtaskchildpicturemybatisdao.selectList(queryWrapper);
//目前没有做其他信息返回,如果需要再做修改
for (OcrTaskchildPicture ocrTaskchildPicture : list) {
//判断审批人是否为当前登录用户
if (userToken.getLoginname().equals(ocrTaskchildPicture.getAssignee())) {
} else {
return false;
}
}
return true;
}
/**
*
*
* @param formid
* @return
*/
public boolean validateApprove(String[] formid) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.in("ID", formid);
List<OcrTaskchildPicture> list = this.ocrtaskchildpicturemybatisdao.selectList(queryWrapper);
//目前没有做其他信息返回,如果需要再做修改
for (OcrTaskchildPicture ocrTaskchildPicture : list) {
//判断当前审批状态为拒绝或者通过的,不允许再做审批
if (ocrTaskchildPicture.getStates().intValue() == SystemConstantsOa.OA_STATUS_TYPE_END
|| ocrTaskchildPicture.getStates().intValue() == SystemConstantsOa.OA_STATUS_TYPE_REFUSE) {
return false;
} else {
}
}
return true;
}
/**
*
*
* @param formid
* @return
*/
public boolean validateBoole(String[] formid) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.in("ID", formid);
List<OcrTaskchildPicture> list = this.ocrtaskchildpicturemybatisdao.selectList(queryWrapper);
List<OcrPicture> pictures = ocrPictureService.list(new LambdaQueryWrapper<OcrPicture>().eq(OcrPicture::getId, list.stream().map(OcrTaskchildPicture::getPictureid).collect(Collectors.toList())).isNull(OcrPicture::getIztrueorfalse));
if (pictures.size() > 1) {
return false;
}
return true;
}
@Override
public List<OcrTaskchildPicture> listAll(String tenantId, String createUser, QueryWrapper queryWrapper) {
long count = this.count(queryWrapper);
Page<OcrTaskchildPicture> page = new Page<>(1, count);
page.setMaxLimit(count);
IPage<OcrTaskchildPicture> iPage = this.page(page, queryWrapper);
return iPage.getRecords();
}
/**
*
*
* @param taskids
* @return
*/
public boolean markPoint(List<Long> taskids) {
UpdateWrapper updateWrapper = new UpdateWrapper();
updateWrapper.set("HAVEPOINTS", 1);
updateWrapper.in("ID", taskids);
return this.update(updateWrapper);
}
/**
*
*
* @param packageid
* @return
*/
public List<OcrTaskchildPicture> markpoint(String packageid) {
QueryWrapper<OcrTaskchildPicture> queryWrapperNew = new QueryWrapper<>();
queryWrapperNew.eq("HAVEPOINTS", "1");
queryWrapperNew.eq("PACKAGEID", packageid);
List<OcrTaskchildPicture> list = this.ocrtaskchildpicturemybatisdao.selectList(queryWrapperNew);
this.formatTask(list, packageid);
return list;
}
/**
*
*
* @param fromid
* @return
*/
public OcrTaskchildPicture listPicturePackageId(String fromid, Long packageid) {
OcrTaskchildPicture ocrTaskchildPicture = this.getById(fromid);
//查询图片对象
OcrPicture ocrPicture = this.ocrPictureService.selectDtoById(ocrTaskchildPicture.getPictureid());
old.setUpdatetime(System.currentTimeMillis());
return this.updateById(old);
}
/**
*
* @param formid
* @param userToken
* @return
*/
public boolean validateAssignee(String[] formid,UserToken userToken){
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.in("ID",formid);
List<OcrTaskchildPicture> list = this.ocrtaskchildpicturemybatisdao.selectList(queryWrapper);
//目前没有做其他信息返回,如果需要再做修改
for(OcrTaskchildPicture ocrTaskchildPicture:list){
//判断审批人是否为当前登录用户
if(userToken.getLoginname().equals(ocrTaskchildPicture.getAssignee())){
}else{
return false;
}
}
return true;
}
/**
*
* @param formid
* @return
*/
public boolean validateApprove(String[] formid){
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.in("ID",formid);
List<OcrTaskchildPicture> list = this.ocrtaskchildpicturemybatisdao.selectList(queryWrapper);
//目前没有做其他信息返回,如果需要再做修改
for(OcrTaskchildPicture ocrTaskchildPicture:list){
//判断当前审批状态为拒绝或者通过的,不允许再做审批
if(ocrTaskchildPicture.getStates().intValue() == SystemConstantsOa.OA_STATUS_TYPE_END
|| ocrTaskchildPicture.getStates().intValue() == SystemConstantsOa.OA_STATUS_TYPE_REFUSE ){
return false;
}else{
}
}
return true;
}
/**
*
*
* @param formid
* @return
*/
public boolean validateBoole(String[] formid) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.in("ID", formid);
List<OcrTaskchildPicture> list = this.ocrtaskchildpicturemybatisdao.selectList(queryWrapper);
List<OcrPicture> pictures = ocrPictureService.list(new LambdaQueryWrapper<OcrPicture>().eq(OcrPicture::getId, list.stream().map(OcrTaskchildPicture::getPictureid).collect(Collectors.toList())).isNull(OcrPicture::getIztrueorfalse));
if (pictures.size() > 1) {
return false;
}
return true;
}
@Override
public List<OcrTaskchildPicture> listAll(String tenantId, String createUser, QueryWrapper queryWrapper){
long count = this.count(queryWrapper);
Page<OcrTaskchildPicture> page = new Page<>(1, count);
page.setMaxLimit(count);
IPage<OcrTaskchildPicture> iPage = this.page(page,queryWrapper);
return iPage.getRecords();
}
/**
*
* @param taskids
* @return
*/
public boolean markPoint(List<Long> taskids){
UpdateWrapper updateWrapper = new UpdateWrapper();
updateWrapper.set("HAVEPOINTS",1);
updateWrapper.in("ID",taskids);
return this.update(updateWrapper);
}
/**
*
* @param packageid
* @return
*/
public List<OcrTaskchildPicture> markpoint(String packageid){
QueryWrapper<OcrTaskchildPicture> queryWrapperNew = new QueryWrapper<>();
queryWrapperNew.eq("HAVEPOINTS","1");
queryWrapperNew.eq("PACKAGEID",packageid);
List<OcrTaskchildPicture> list = this.ocrtaskchildpicturemybatisdao.selectList(queryWrapperNew);
this.formatTask(list,packageid);
return list;
}
/**
*
* @param fromid
* @return
*/
public OcrTaskchildPicture listPicturePackageId(String fromid,Long packageid){
OcrTaskchildPicture ocrTaskchildPicture = this.getById(fromid);
//查询图片对象
OcrPicture ocrPicture = this.ocrPictureService.selectDtoById(ocrTaskchildPicture.getPictureid());
// String pictureids = ocrTaskchildPicture.getPicturecompare();
// String[] splitPictureids = pictureids.split(",");
@ -297,105 +293,103 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
// //设置是否为历史信息
// ocrTaskchildPicture.setIzHistory(listPictureids.contains(ocrPicture.getPictureid())?false:true);
//如果当前任务的任务包主键一致,说明不是历史数据,如果不一致,说明是历史数据
if (packageid.toString().equals(ocrTaskchildPicture.getPackageid().toString())) {
ocrTaskchildPicture.setIzHistory(false);
} else {
ocrTaskchildPicture.setIzHistory(true);
}
//如果当前任务的任务包主键一致,说明不是历史数据,如果不一致,说明是历史数据
if(packageid.toString().equals(ocrTaskchildPicture.getPackageid().toString())){
ocrTaskchildPicture.setIzHistory(false);
}else{
ocrTaskchildPicture.setIzHistory(true);
}
//查询审批流节点信息
List<Task> taskList = iFlowTaskService.nowRunTask(ocrTaskchildPicture.getProcessinstanceid(), ocrTaskchildPicture.getProcessdefinitionid());
if (null != taskList && !taskList.isEmpty()) {
ocrTaskchildPicture.setTaskId(taskList.get(0).getId());
}
//查询审批流节点信息
List<Task> taskList = iFlowTaskService.nowRunTask(ocrTaskchildPicture.getProcessinstanceid(),ocrTaskchildPicture.getProcessdefinitionid());
if(null != taskList && !taskList.isEmpty()) {
ocrTaskchildPicture.setTaskId(taskList.get(0).getId());
}
//获取当前真假标记
ocrTaskchildPicture.setIztrueorfalse(ocrPicture.getIztrueorfalse());
//是否已经审批
ocrTaskchildPicture.setWorkStatus(ocrPicture.getWorkStatus());
//获取当前真假标记
ocrTaskchildPicture.setIztrueorfalse(ocrPicture.getIztrueorfalse());
//是否已经审批
ocrTaskchildPicture.setWorkStatus(ocrPicture.getWorkStatus());
ocrTaskchildPicture.setOcrPicture(ocrPicture);
ocrTaskchildPicture.setOcrPicture(ocrPicture);
return ocrTaskchildPicture;
}
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 ){
Page<OcrTaskchildPicture> page = new Page<>(paramterPage.getStart(), paramterPage.getPagesize());
/**
*
*
* @param taskchildpictureid
* @param queryWrapper
* @return
*/
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);
//当前显示的任务对象
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);
QueryWrapper<OcrTaskchildPicture> queryWrapperNew = new QueryWrapper<>();
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()){
mainOcrTaskchildPicture = pageNew.getRecords().get(0);
}
//如果是历史图片,从非历史图片存在的集合中随机选取一个
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.orderByAsc("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")){
queryWrapper.orderByDesc("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);
IPage<OcrTaskchildPicture> iPage = this.page(page,queryWrapper);
this.formatTask(iPage.getRecords(), packageid);
this.formatTask(iPage.getRecords(),packageid);
return iPage;
}
return iPage;
}
/**
*
*
* @param list
* @param packageid
*/
private void formatTask(List<OcrTaskchildPicture> list, String packageid) {
for (OcrTaskchildPicture ocrTaskchildPicture : list) {
/**
*
* @param list
* @param packageid
*/
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()) {
ocrTaskchildPicture.setTaskId(taskList.get(0).getId());
}
//查询审批流节点信息
List<Task> taskList = iFlowTaskService.nowRunTask(ocrTaskchildPicture.getProcessinstanceid(),ocrTaskchildPicture.getProcessdefinitionid());
if(null != taskList && !taskList.isEmpty()) {
ocrTaskchildPicture.setTaskId(taskList.get(0).getId());
}
// //非历史图片主键集合
// String pictureids = ocrTaskchildPicture.getPicturecompare();
// String[] splitPictureids = pictureids.split(",");
@ -403,122 +397,130 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
// //设置是否为历史信息
// ocrTaskchildPicture.setIzHistory(listPictureids.contains(ocrTaskchildPicture.getPictureid())?false:true);
//如果当前任务的任务包主键一致,说明不是历史数据,如果不一致,说明是历史数据
if (packageid.equals(ocrTaskchildPicture.getPackageid().toString())) {
ocrTaskchildPicture.setIzHistory(false);
} else {
ocrTaskchildPicture.setIzHistory(true);
}
OcrPicture ocrPicture = this.ocrPictureService.selectDtoById(ocrTaskchildPicture.getPictureid());
//获取当前真假标记
ocrTaskchildPicture.setIztrueorfalse(ocrPicture.getIztrueorfalse());
//是否已经审批
ocrTaskchildPicture.setWorkStatus(ocrPicture.getWorkStatus());
ocrTaskchildPicture.setOcrPicture(ocrPicture);
}
}
/**
*
*
* @param id
* @return
*/
public boolean closeOrder(String id) {
OcrTaskchildPicture ocrTaskchildPicture = this.getById(id);
if (null != ocrTaskchildPicture) {
//如果当前任务的任务包主键一致,说明不是历史数据,如果不一致,说明是历史数据
if(packageid.equals(ocrTaskchildPicture.getPackageid().toString())){
ocrTaskchildPicture.setIzHistory(false);
}else{
ocrTaskchildPicture.setIzHistory(true);
}
OcrPicture ocrPicture = this.ocrPictureService.selectDtoById(ocrTaskchildPicture.getPictureid());
//获取当前真假标记
ocrTaskchildPicture.setIztrueorfalse(ocrPicture.getIztrueorfalse());
//是否已经审批
ocrTaskchildPicture.setWorkStatus(ocrPicture.getWorkStatus());
ocrTaskchildPicture.setOcrPicture(ocrPicture);
}
}
/**
*
* @param id
* @return
*/
public boolean closeOrder(String id){
OcrTaskchildPicture ocrTaskchildPicture = this.getById(id);
if(null != ocrTaskchildPicture){
// ocrTaskchildPicture.setIzclose("0");
return this.updateById(ocrTaskchildPicture);
}
return false;
}
/**
*
*
* @param ocrPicture
* @param tenantId
* @param sysUser
*/
public OcrTaskchildPicture create(OcrPicture ocrPicture, String tenantId, UserToken sysUser, Long packageid, String buessinessno) {
OcrTaskchildPicture ocrTaskchildPicture = new OcrTaskchildPicture();
ocrTaskchildPicture.setBuessinessno(buessinessno);
ocrTaskchildPicture.setFromtaskid(ocrPicture.getRemark());
ocrTaskchildPicture.setFromtaskname(ocrPicture.getTaskname());
ocrTaskchildPicture.setPictureid(ocrPicture.getId());
ocrTaskchildPicture.setTenantid(Long.parseLong(tenantId));
ocrTaskchildPicture.setCreateuser(sysUser.getLoginname());
ocrTaskchildPicture.setCreateusername(sysUser.getUsername());
ocrTaskchildPicture.setCreatedate(System.currentTimeMillis());
ocrTaskchildPicture.setPackageid(packageid);
ocrTaskchildPicture.setCategoryid(ocrPicture.getCategoryid());
ocrTaskchildPicture.setFromsourceid(ocrPicture.getField4());
ocrTaskchildPicture.setFromuptime(ocrPicture.getUptime());
ocrTaskchildPicture.setFromplanid(ocrPicture.getPlanid());
ocrTaskchildPicture.setFromprojectid(ocrPicture.getProjectid());
ocrTaskchildPicture.setFromuserid(ocrPicture.getUpuserid());
StringBuffer pcid = new StringBuffer();
StringBuffer result = new StringBuffer();
for (OcrPicture comp : ocrPicture.getListCom()) {
if (null == pcid || pcid.toString().length() < 1) {
pcid.append(comp.getId());
result.append(comp.getResult());
} else {
pcid.append("," + comp.getId());
result.append("," + comp.getResult());
}
}
ocrTaskchildPicture.setOcpictureid(pcid.toString());
ocrTaskchildPicture.setPictureresult(result.toString());
ocrTaskchildPicture.setPicturecompare(String.join(",", ocrPicture.getPicturecompareList()));
return this.save(ocrTaskchildPicture) ? ocrTaskchildPicture : null;
}
/**
*
*
* @param query
* @return
*/
public List<OcrTaskchildPicture> listFinal(Map<String, Object> query) {
return this.ocrtaskchildpicturemybatisdao.listFinal(query);
}
/**
* \
*
* @param taskchildid
* @return
*/
public OcrPicture findOcrPictureByTaskchildid(String taskchildid) {
OcrTaskchildPicture ocrTaskchildPicture = this.ocrtaskchildpicturemybatisdao.selectById(taskchildid);
if (null == ocrTaskchildPicture) {
return null;
}
OcrPicture ocrPicture = ocrPictureService.selectDtoById(ocrTaskchildPicture.getPictureid());
return ocrPicture;
}
/**
*
*
* @param query
* @return
*/
public Long listFinalCount(Map<String, Object> query) {
return this.ocrtaskchildpicturemybatisdao.listFinalCount(query);
}
return this.updateById(ocrTaskchildPicture);
}
return false;
}
/**
*
* @param ocrPicture
* @param tenantId
* @param sysUser
*/
public OcrTaskchildPicture create(OcrPicture ocrPicture, String tenantId , UserToken sysUser, Long packageid,String buessinessno){
OcrTaskchildPicture ocrTaskchildPicture = new OcrTaskchildPicture();
ocrTaskchildPicture.setBuessinessno(buessinessno);
ocrTaskchildPicture.setFromtaskid(ocrPicture.getRemark());
ocrTaskchildPicture.setFromtaskname(ocrPicture.getTaskname());
ocrTaskchildPicture.setPictureid(ocrPicture.getId());
ocrTaskchildPicture.setTenantid(Long.parseLong(tenantId));
ocrTaskchildPicture.setCreateuser(sysUser.getLoginname());
ocrTaskchildPicture.setCreateusername(sysUser.getUsername());
ocrTaskchildPicture.setCreatedate(System.currentTimeMillis());
ocrTaskchildPicture.setPackageid(packageid);
ocrTaskchildPicture.setCategoryid(ocrPicture.getCategoryid());
ocrTaskchildPicture.setFromsourceid(ocrPicture.getField4());
ocrTaskchildPicture.setFromuptime(ocrPicture.getUptime());
ocrTaskchildPicture.setFromplanid(ocrPicture.getPlanid());
ocrTaskchildPicture.setFromprojectid(ocrPicture.getProjectid());
ocrTaskchildPicture.setFromuserid(ocrPicture.getUpuserid());
StringBuffer pcid = new StringBuffer();
StringBuffer result = new StringBuffer();
for(OcrPicture comp:ocrPicture.getListCom()){
if(null == pcid || pcid.toString().length() < 1){
pcid.append(comp.getId());
result.append(comp.getResult());
}else{
pcid.append("," + comp.getId());
result.append("," + comp.getResult());
}
}
ocrTaskchildPicture.setOcpictureid(pcid.toString());
ocrTaskchildPicture.setPictureresult(result.toString());
ocrTaskchildPicture.setPicturecompare(String.join(",",ocrPicture.getPicturecompareList()));
return this.save(ocrTaskchildPicture)?ocrTaskchildPicture:null;
}
/**
*
* @param query
* @return
*/
public List<OcrTaskchildPicture> listFinal(Map<String, Object> query){
return this.ocrtaskchildpicturemybatisdao.listFinal(query);
}
/**
* \
* @param taskchildid
* @return
*/
public OcrPicture findOcrPictureByTaskchildid(String taskchildid){
OcrTaskchildPicture ocrTaskchildPicture = this.ocrtaskchildpicturemybatisdao.selectById(taskchildid);
if(null == ocrTaskchildPicture){
return null;
}
OcrPicture ocrPicture = ocrPictureService.selectDtoById(ocrTaskchildPicture.getPictureid());
return ocrPicture;
}
/**
*
* @param query
* @return
*/
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 )
UNION ALL
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
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
WHERE
m.msg_category = '1'
AND
m.receive_user_type = '2'
m.receive_user_type IN(1,2)
AND m.send_status = '1'
AND FIND_IN_SET( '${userid}', m.receive_user_ids )
</if>
</select>
<select id="selectone" resultType="map">
SELECT
titile,
msg_content AS msgContent,
'系统管理员' AS userNcame,
sender,
msg_category AS msgCategory,
send_time AS sendTime
FROM
ocr_msg
WHERE
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