diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/controller/FlowTaskController.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/controller/FlowTaskController.java index 79247cdd..a23fcd66 100644 --- a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/controller/FlowTaskController.java +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/controller/FlowTaskController.java @@ -23,6 +23,7 @@ import cn.jyjz.xiaoyao.oa.from.dataobject.Category; import cn.jyjz.xiaoyao.oa.from.dataobject.Userapprove; import cn.jyjz.xiaoyao.oa.from.service.UserapproveService; import cn.jyjz.xiaoyao.oa.from.vo.FlowUnionVo; +import cn.jyjz.xiaoyao.ocr.dataobject.OcrPicture; import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture; import cn.jyjz.xiaoyao.ocr.service.OcrTaskchildPictureService; import com.alanpoi.common.util.StringUtils; @@ -401,7 +402,7 @@ public class FlowTaskController extends BaseController { } //租户主键,由前端页面传送 String tenantId = request.getHeader("X-Tenant-Id"); - + if(org.apache.commons.lang3.StringUtils.isBlank(tenantId)){ return ResultVoUtil.error("租户主键不能为空"); } @@ -422,7 +423,38 @@ public class FlowTaskController extends BaseController { flowTaskService.getFinalProcessInstances(query,pageUtils); return ResultVoUtil.success(pageUtils); } - + + + /** + * 终审列表 + * @return + */ + @ApiOperation(value="图片分页列表查询-根据用户预设检索条件查询", notes="") + @ApiImplicitParams({ + @ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true), + @ApiImplicitParam(paramType = "path",name = "userSearchId", value = "预设检索条件id", required = true), + }) + @GetMapping(value = "/listfinal1") + public ResultVo> queryPageByUserSearchId( + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + + //租户主键,由前端页面传送 + String tenantId = req.getHeader("X-Tenant-Id"); + if(org.apache.commons.lang3.StringUtils.isBlank(tenantId)){ + return ResultVoUtil.error("租户主键不能为空"); + } + + //获取用户预设检索条件id + String userSearchId = req.getParameter("userSearchId"); + IPage pageList = flowTaskService.queryPageByUserSearchId(pageNo,pageSize,userSearchId); + return ResultVoUtil.success(pageList); + } + + + + /** * 我的发起 * 查询我发起的已经完成的任务 diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/service/IFlowTaskService.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/service/IFlowTaskService.java index c05bb614..9bbb04cf 100644 --- a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/service/IFlowTaskService.java +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/service/IFlowTaskService.java @@ -13,6 +13,7 @@ import cn.jyjz.xiaoyao.common.base.vo.UserToken; import cn.jyjz.xiaoyao.oa.from.dataobject.Category; import cn.jyjz.xiaoyao.oa.from.vo.FlowUnionVo; +import cn.jyjz.xiaoyao.ocr.dataobject.OcrPicture; import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture; import com.baomidou.mybatisplus.core.metadata.IPage; import org.flowable.engine.repository.ProcessDefinition; @@ -79,6 +80,17 @@ public interface IFlowTaskService { */ public void getFinalProcessInstances(Map query, PageUtils pageUtils); + + /** + * 根本预设检索条件id,分页查询任务信息 + * @param pageNo + * @param pageSize + * @param userSearchId + * @return + */ + IPage queryPageByUserSearchId(Integer pageNo, Integer pageSize, String userSearchId); + + /** * 查询我发起的流程实例 * 不做分类 diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/service/impl/FlowTaskServiceImpl.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/service/impl/FlowTaskServiceImpl.java index 3806414a..e9fefae0 100644 --- a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/service/impl/FlowTaskServiceImpl.java +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/service/impl/FlowTaskServiceImpl.java @@ -1,5 +1,7 @@ package cn.jyjz.flowable.service.impl; +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; import cn.jyjz.flowable.common.SystemConstantsOa; import cn.jyjz.flowable.config.CustomProcessDiagramGenerator; import cn.jyjz.flowable.domain.vo.*; @@ -31,9 +33,10 @@ import cn.jyjz.xiaoyao.oa.from.dataobject.UserFinal; 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.dataobject.*; import cn.jyjz.xiaoyao.ocr.service.OcrTaskchildPictureService; +import cn.jyjz.xiaoyao.ocr.service.OcrUsersearchService; +import cn.jyjz.xiaoyao.ocr.util.SearchParaFormatting; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.StringUtils; @@ -100,6 +103,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask private IRunFlowableActinstDao runFlowableActinstDao; @Resource private IHisFlowableActinstDao hisFlowableActinstDao; + + @Resource + private OcrUsersearchService ocrUsersearchService; + @Override public void myTodoTaskList(PageUtils vo, HttpServletRequest request) { @@ -1047,7 +1054,33 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask pageUtils.setTotalCount(count.intValue()); pageUtils.setList(list); } - + + + @Override + public IPage queryPageByUserSearchId(Integer pageNo, Integer pageSize, String userSearchId) { + OcrUsersearch ocrUsersearch = ocrUsersearchService.selectByUserSearchId(userSearchId); + + QueryWrapper queryWrapper = new QueryWrapper(); + + + for (OcrUsersearchchild usersearchchild : ocrUsersearch.getOcrUsersearchchildList()) { + this.formattingSearchChild(queryWrapper, usersearchchild); + + } + //分页查询并组装子集数据 + Page page = new Page<>(pageNo, pageSize); +// IPage pageList = this.page(page, queryWrapper); +// for (OcrTaskchildPicture ocrPicture1 : pageList.getRecords()) { +// if (org.apache.commons.lang3.StringUtils.isNotBlank(ocrPicture1.getPictureclassid())) { +// OcrPictureclass ocrPictureclass = ocrPictureclassService.getById(ocrPicture1.getPictureclassid()); +// ocrPicture1.setOcrPictureclass(ocrPictureclass); +// } +// } +// return pageList; + return null; + } + + /** * 查询我发起的流程实例 * @@ -1593,4 +1626,132 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask return ResultVoUtil.success(flowableccMybatisDao.repetitionTask()); } + /** + * 格式化筛选关系 + * + * @param queryWrapper + * @param usersearchchild + * @return + */ + private QueryWrapper formattingSearchChild(QueryWrapper queryWrapper, OcrUsersearchchild usersearchchild) { + switch (usersearchchild.getSearchRelationType()) { + case "where": + this.formattingSearchType(queryWrapper, usersearchchild); + break; + case "and": + queryWrapper.and(wrapper -> this.formattingSearchType(wrapper, usersearchchild)); + break; + case "or": + queryWrapper.or(wrapper -> this.formattingSearchType(wrapper, usersearchchild)); + break; + default: + return queryWrapper; + } + return queryWrapper; + } + + /** + * 格式化查询类型 + * + * @param queryWrapper + * @param usersearchchild + * @return + */ + private QueryWrapper formattingSearchType(QueryWrapper queryWrapper, OcrUsersearchchild usersearchchild) { + //查询类型 相等true 不相等fase + boolean queryType = "eq".equals(usersearchchild.getSearchtype()); + + //1.获取检查数据,确定数据类型 + String valueType = SearchParaFormatting.clickSearchValue(usersearchchild.getSearchvalue()); + List arrayData = null; //集合型数据 + List sectionInts = null; //纯数字区间型数据 + String[] sections = null; //字符串区间型数据 + DateTime beginTime = null; //日期时间区间型数据 + DateTime endTime = null; //日期时间区间型数据 + + //2.根据数据类型,解构数据 + switch (valueType) { + case "array": + //处理多文件 + String[] datas = usersearchchild.getSearchvalue().split(","); + arrayData = Arrays.asList(datas); + break; + case "section": + //格式化数据,仅在做区间的时候去除空格,其他地方不进行空格去除. + sections = usersearchchild.getSearchvalue().trim().replaceAll("\\s+", "").split("-"); + //校验是否纯数字,纯数字的话,要转成int,否则比对时会有问题 + sectionInts = new ArrayList<>(); + for (String data : sections) { + if (data.matches("\\d+")) { + sectionInts.add(Integer.parseInt(data)); + } + } + break; + case "time": + //格式化时间数据 + String[] times = usersearchchild.getSearchvalue().trim().replaceAll("\\s+", "").split("-"); + beginTime = DateUtil.parse(times[0], "yyyy/MM/dd"); + endTime = DateUtil.parse(times[1], "yyyy/MM/dd"); + break; + default: + } + + //3.根据查询类型 组装查询条件 相等 + switch (valueType) { + case "array": + //集合数据 + //相等 + if (queryType) { + queryWrapper.in(usersearchchild.getSearchfield(), arrayData); + break; + } + //不相等 + queryWrapper.notIn(usersearchchild.getSearchfield(), arrayData); + break; + + case "section": + //数字区间查询 + if (sectionInts != null && sectionInts.size() == 2) { + if (queryType) { + //相等 + queryWrapper.between(usersearchchild.getSearchfield(), sectionInts.get(0), sectionInts.get(1)); + break; + } + //不相等 + queryWrapper.notBetween(usersearchchild.getSearchfield(), sectionInts.get(0), sectionInts.get(1)); + break; + } + + //字符串区间查询 + if (queryType) { + //相等 + queryWrapper.between(usersearchchild.getSearchfield(), sections[0], sections[1]); + break; + } + //不相等 + queryWrapper.notBetween(usersearchchild.getSearchfield(), sections[0], sections[1]); + break; + + case "time": + //时间区间数据 + //相等 + if (queryType) { + queryWrapper.between(usersearchchild.getSearchfield(), beginTime.getTime(), endTime.getTime()); + break; + } + //不相等 + queryWrapper.notBetween(usersearchchild.getSearchfield(), beginTime.getTime(), endTime.getTime()); + break; + + default: + if (queryType) { + queryWrapper.eq(usersearchchild.getSearchfield(), usersearchchild.getSearchvalue()); + break; + } + queryWrapper.ne(usersearchchild.getSearchfield(), usersearchchild.getSearchvalue()); + } + return queryWrapper; + } + + } diff --git a/runstart/src/main/resources/application-dev.yml b/runstart/src/main/resources/application-dev.yml index 3da85b0f..35c3b111 100644 --- a/runstart/src/main/resources/application-dev.yml +++ b/runstart/src/main/resources/application-dev.yml @@ -1,3 +1,4 @@ + server: compression: enabled: true @@ -28,10 +29,10 @@ spring: password: ysltest2024. type: com.alibaba.druid.pool.DruidDataSource slave: - url: jdbc:mysql://127.0.0.1:3306/ocr?useUnicode=true&nullCatalogMeansCurrent=true&characterEncoding=UTF-8&characterSetResults=utf8&serverTimezone=Asia/Shanghai&useSSL=false + url: jdbc:mysql://47.93.59.251:3306/ocrnew?useUnicode=true&nullCatalogMeansCurrent=true&characterEncoding=UTF-8&characterSetResults=utf8&serverTimezone=Asia/Shanghai&useSSL=false driver-class-name: com.mysql.cj.jdbc.Driver - username: jyjz - password: jyjz + username: ysltest + password: ysltest2024. type: com.alibaba.druid.pool.DruidDataSource druid: # 初始连接数 @@ -94,39 +95,9 @@ 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: @@ -134,7 +105,7 @@ flowable: #关闭定时任务JOB async-executor-activate: false database-schema-update: false - +# # cache: # type: redis # redis: @@ -169,7 +140,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: @@ -190,15 +161,15 @@ mybatis-plus: xiaoyao: web: #上传文件路径 - uploadPath: D:/ideaWork/jeecg/ocrproject/htmlweb/upload + uploadPath: D:/Code/ocr/htmlweb/upload #页面根路径 - frontPath: D:/ideaWork/jeecg/ocrproject/htmlweb + frontPath: D:/Code/ocr/htmlweb #js、css、图片存放路径 - staticPath: D:/ideaWork/jeecg/ocrproject/htmlweb/static + staticPath: D:/Code/ocr/htmlweb/static #页面模版路径 - webPath: D:/ideaWork/jeecg/ocrproject/htmlweb/web + webPath: D:/Code/ocr/htmlweb/web #Lucene索引路径 - lucenePath: D:/ideaWork/jeecg/ocrproject/htmlweb/lucene/indexDir + lucenePath: D:/Code/ocr/htmlweb/lucene/indexDir #是否开启flowable haveFlowable: true webconfig: @@ -291,7 +262,7 @@ xiaoyao: #缓存默认名称 managerName: cacheMgrGps #有效时长(秒),目前登录用户、session使用 - tokenExpire: 360000 + tokenExpire: 18000 #缓存名称分隔符 cacheNamePrix: "_" #存放缓存刷新时间是,使用临时缓存名称前缀 @@ -302,7 +273,6 @@ springfox: enabled: true # 是否启用swagger,postman调试 debugger_tools: true - #无量云api配置信息 ocr: api: @@ -311,4 +281,4 @@ ocr: accessKey: 7390F0221A1A73D8E13F8C8BB96F33B0 #秘钥 accessCode: ED6F7B39768AF95E87AEA8ACCCC71A6F #秘钥编码 connectTimeout: 5000 #请求超时时间 毫秒 - readTimeout: 60000 #接收超时时间 毫秒 + readTimeout: 60000 #接收超时时间 毫秒 \ No newline at end of file