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 e065df2f..790df9ba 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 @@ -37,6 +37,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.annotations.*; import org.apache.commons.collections4.CollectionUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.http.MediaType; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.*; @@ -54,6 +56,7 @@ import java.util.stream.Collectors; @RequestMapping("/flow/task") public class FlowTaskController extends BaseController { + private static final Logger log = LoggerFactory.getLogger(FlowTaskController.class); @Resource IFlowTaskService flowTaskService; @@ -676,8 +679,10 @@ public class FlowTaskController extends BaseController { }) @GetMapping("/repetitionTask") @ResponseBody - public ResultVo repetitionTask(@RequestParam(value = "type",required = false,defaultValue = "1") Integer type) { - return flowTaskService.repetitionTask(type); + public ResultVo repetitionTask(HttpServletRequest request, + @RequestParam(value = "type",required = false,defaultValue = "1") Integer type) { + String tenantId = request.getHeader("X-Tenant-Id"); + return flowTaskService.repetitionTask(type,tenantId); } /** @@ -691,10 +696,36 @@ public class FlowTaskController extends BaseController { }) @GetMapping("/repetitionTaskList") @ResponseBody - public ResultVo repetitionTaskList(@RequestParam(name = "pageNo") Integer pageNo, + public ResultVo repetitionTaskList(HttpServletRequest request, + @RequestParam(name = "pageNo") Integer pageNo, @RequestParam(name = "pageSize") Integer pageSize, @RequestParam(value = "type",required = false,defaultValue = "1") Integer type) { - Page result = flowTaskService.repetitionTaskList(pageNo, pageSize,type); + String tenantId = request.getHeader("X-Tenant-Id"); + Page result = flowTaskService.repetitionTaskList(pageNo, pageSize,type,tenantId); + return ResultVoUtil.success(result); + } + + /** + * 重复任务 + * + * @return + */ + @ApiOperation(value = "失败重试无量云", notes = "失败重试无量云") + @ApiImplicitParams({ + @ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true), + }) + @GetMapping("/retryPrevailCloud") + @ResponseBody + public ResultVo retryPrevailCloud(HttpServletRequest request, + @RequestParam(name = "formId") String formId) { + String tenantId = request.getHeader("X-Tenant-Id"); + Boolean result = null; + try { + result = flowTaskService.retryPrevailCloud(tenantId,formId); + } catch (Exception e) { + log.error(e.getMessage()); + result =false; + } return ResultVoUtil.success(result); } } 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 11e6a163..49d61f23 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 @@ -193,7 +193,9 @@ public interface IFlowTaskService { * * @return */ - ResultVo repetitionTask(Integer type); + ResultVo repetitionTask(Integer type, String tenantId); - Page repetitionTaskList(Integer pageNo, Integer pageSize,Integer type); + Page repetitionTaskList(Integer pageNo, Integer pageSize, Integer type, String tenantId); + + Boolean retryPrevailCloud(String tenantId, String formId) throws Exception; } 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 41502592..8e4abb0d 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 @@ -35,10 +35,12 @@ import cn.jyjz.xiaoyao.oa.from.service.*; import cn.jyjz.xiaoyao.oa.from.vo.FlowUnionVo; import cn.jyjz.xiaoyao.oa.from.vo.RepeatedContentVo; +import cn.jyjz.xiaoyao.ocr.api.PrevailCloudApi; import cn.jyjz.xiaoyao.ocr.dataobject.*; import cn.jyjz.xiaoyao.ocr.service.*; import cn.jyjz.xiaoyao.ocr.util.SearchParaFormatting; import cn.jyjz.xiaoyao.ocr.vo.OcrTaskchildPictureApproVo; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -117,6 +119,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask private IOcrMsgService ocrMsgService; @Resource private UserdistionaryService userdistionaryService; + @Resource + private OcrPrevailCloudLogService prevailCloudLogService; + @Resource + private PrevailCloudApi prevailCloudApi; @Override public void myTodoTaskList(PageUtils vo, HttpServletRequest request) { @@ -599,7 +605,8 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask model.setFinishtime(System.currentTimeMillis()); model.setStates(SystemConstantsOa.OA_STATUS_TYPE_END); OcrPicture picture = ocrPictureService.getById(model.getPictureid()); - ocrTaskchildPictureService.sendFlowTaskResult(childPicture, picture, approve); + Boolean result = ocrTaskchildPictureService.sendFlowTaskResult(childPicture, picture, approve); + model.setSendResult(result ? 1 : 0); } else { childPicture.setTaskNode(taskData.getDescription()); //判断节点上的描述字段,是否伟finale_judgment,如果是,记录到终审表中,如果终审表已经存在,不再重复记录 @@ -1565,7 +1572,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask //审批节点 当前如果没有历史操作,则将当前节点赋值到历史审批节点中. if (StringUtils.isBlank(ocrTaskchildPictureAppro.getTasknamehis())) { ocrTaskchildPictureAppro.setTasknamehis(ocrTaskchildPictureAppro.getTaskname()); - }else{ + } else { if (assignee.contains(",")) { String[] split = assignee.split(","); for (int i = 0; i < split.length; i++) { @@ -1955,8 +1962,8 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask } @Override - public ResultVo repetitionTask(Integer type) { - List repeatedContentVoList = flowableccMybatisDao.repetitionTask(type); + public ResultVo repetitionTask(Integer type, String tenantId) { + List repeatedContentVoList = flowableccMybatisDao.repetitionTask(type, tenantId); List formIdsToUpdate = new ArrayList<>(); if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(repeatedContentVoList)) { List checkDescribeHis = new ArrayList<>(); @@ -2004,12 +2011,18 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask } @Override - public Page repetitionTaskList(Integer pageNo, Integer pageSize, Integer type) { + public Page repetitionTaskList(Integer pageNo, Integer pageSize, Integer type, String tenantId) { Page page = new Page<>(pageNo, pageSize); - Page result = flowableccMybatisDao.repetitionTaskList(page, type); + Page result = flowableccMybatisDao.repetitionTaskList(page, type, tenantId); return result; } + @Override + public Boolean retryPrevailCloud(String tenantId, String formId) throws Exception { + OcrPrevailCloudLog one = prevailCloudLogService.getOne(new LambdaQueryWrapper().eq(OcrPrevailCloudLog::getFormId, formId)); + return prevailCloudApi.sendFlowTaskResult(formId, one.getRequestParam(), one.getPictureId(), one.getTaskId()); + } + /** * 格式化筛选关系 * diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/oa/from/dataDao/FlowableccMybatisDao.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/oa/from/dataDao/FlowableccMybatisDao.java index 94d1b523..7b2ef3c1 100644 --- a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/oa/from/dataDao/FlowableccMybatisDao.java +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/oa/from/dataDao/FlowableccMybatisDao.java @@ -40,7 +40,7 @@ public interface FlowableccMybatisDao extends BaseMapper { */ List selectUserByFromid(String fromid); - List repetitionTask(@Param("type") Integer type); + List repetitionTask(@Param("type") Integer type, @Param("tenantId") String tenantId); - Page repetitionTaskList(Page page, @Param("type") Integer type); + Page repetitionTaskList(Page page, @Param("type") Integer type, @Param("tenantId") String tenantId); } diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/api/PrevailCloudApi.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/api/PrevailCloudApi.java index 0adf75f6..63c900f4 100644 --- a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/api/PrevailCloudApi.java +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/api/PrevailCloudApi.java @@ -3,7 +3,6 @@ package cn.jyjz.xiaoyao.ocr.api; 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 org.apache.commons.compress.utils.Lists; import java.util.List; @@ -23,7 +22,7 @@ public interface PrevailCloudApi { */ ApiPage pullPictureSource(PictureSourceParameter pictureSourceParameter) throws Exception; - void sendFlowTaskResult(String tenantId,String data) throws Exception; + Boolean sendFlowTaskResult(String formId, String data, Long pictureId, String remark) throws Exception; /** * 根据租户id 拉取对应业务主体信息 diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/api/impl/PrevailCloudApiImpl.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/api/impl/PrevailCloudApiImpl.java index fc6cd967..2beafe0c 100644 --- a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/api/impl/PrevailCloudApiImpl.java +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/api/impl/PrevailCloudApiImpl.java @@ -11,8 +11,11 @@ import cn.jyjz.xiaoyao.ocr.api.utils.ApiHelper; import cn.jyjz.xiaoyao.ocr.api.utils.ApiPage; import cn.jyjz.xiaoyao.ocr.api.utils.RequestData; import cn.jyjz.xiaoyao.ocr.api.utils.ResultData; +import cn.jyjz.xiaoyao.ocr.common.PrevailCloudConstant; import cn.jyjz.xiaoyao.ocr.dataobject.OcrPicture; +import cn.jyjz.xiaoyao.ocr.dataobject.OcrPrevailCloudLog; import cn.jyjz.xiaoyao.ocr.service.OcrPictureService; +import cn.jyjz.xiaoyao.ocr.service.OcrPrevailCloudLogService; import cn.jyjz.xiaoyao.ocr.thread.TaskQueue; import cn.jyjz.xiaoyao.ocr.thread.entity.PictureImgToLocalEntity; import cn.jyjz.xiaoyao.ocr.util.httputil.HttpClient; @@ -28,6 +31,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -51,6 +55,9 @@ public class PrevailCloudApiImpl implements PrevailCloudApi { @Autowired private ApiConfig apiConfig; + @Resource + private OcrPrevailCloudLogService prevailCloudLogService; + /** * 拉取图片信息 */ @@ -78,7 +85,9 @@ public class PrevailCloudApiImpl implements PrevailCloudApi { if (!apiConfig.checkConfig()) { return null; } - + OcrPrevailCloudLog prevailCloudLog = new OcrPrevailCloudLog(); + prevailCloudLog.setType(PrevailCloudConstant.PULL_PICTURE_SOURCE); + prevailCloudLog.setRequestParam(JSONUtil.toJsonStr(pictureSourceParameter)); //2.对象转map Map queryParam = BeanUtil.beanToMap(pictureSourceParameter); Map queryParamStr = new HashMap<>(); @@ -108,6 +117,8 @@ public class PrevailCloudApiImpl implements PrevailCloudApi { String responseJsonStr = HttpClient.doPost(url, httpParamers, null, apiConfig.getConnectTimeout(), apiConfig.getReadTimeout()); System.out.println(responseJsonStr); ResultData resultData = JSONUtil.toBean(responseJsonStr, ResultData.class); + prevailCloudLog.setResponseParam(responseJsonStr); + prevailCloudLog.setStatus(resultData.getStatus()); //解密请求数据 if (resultData.getStatus() == 100) { @@ -126,11 +137,18 @@ public class PrevailCloudApiImpl implements PrevailCloudApi { logger.debug("请求图片接口数据失败,参数:{},返回值:{}", json, responseJsonStr); } + prevailCloudLogService.save(prevailCloudLog); return null; } @Override - public void sendFlowTaskResult(String tenantId, String data) throws Exception { + public Boolean sendFlowTaskResult(String formId, String data, Long pictureId, String remark) throws Exception { + OcrPrevailCloudLog prevailCloudLog = new OcrPrevailCloudLog(); + prevailCloudLog.setType(PrevailCloudConstant.SEND_FLOW_RESULT); + prevailCloudLog.setRequestParam(data); + prevailCloudLog.setFormId(Long.parseLong(formId)); + prevailCloudLog.setTaskId(remark); + prevailCloudLog.setPictureId(pictureId); ResultData stringResultData = ApiHelper.buildResponse(apiConfig.getAccessCode(), data); // RequestData requestData = ApiHelper.buildRequest(tenantId, apiConfig.getAccessKey(), apiConfig.getAccessCode(),data);//组装请求参数 String url = apiConfig.getInterfaceDomain() + sendResultUrl; @@ -141,11 +159,21 @@ public class PrevailCloudApiImpl implements PrevailCloudApi { httpParamers.setJsonParamer(requestBodyJson); //发起请求 String responseJsonStr = HttpClient.doPost(url, httpParamers, null, apiConfig.getConnectTimeout(), apiConfig.getReadTimeout()); - System.out.println(responseJsonStr); + prevailCloudLog.setResponseParam(responseJsonStr); + ResultData resultData = JSONUtil.toBean(responseJsonStr, ResultData.class); + prevailCloudLog.setStatus(resultData.getStatus()); + prevailCloudLogService.save(prevailCloudLog); + if (resultData.getStatus() == 100) { + return true; + } + return false; } @Override public void pullAccountInfo(long tenantNo) throws Exception { + OcrPrevailCloudLog prevailCloudLog = new OcrPrevailCloudLog(); + prevailCloudLog.setType(PrevailCloudConstant.PULL_ACCOUNT_INFO); + prevailCloudLog.setRequestParam(String.valueOf(tenantNo)); Map queryParam = new HashMap<>(); queryParam.put("tenantNo", tenantNo); String json = JSONObject.toJSONString(queryParam); @@ -159,8 +187,9 @@ public class PrevailCloudApiImpl implements PrevailCloudApi { String responseJsonStr = HttpClient.doPost(url, httpParamers, null, apiConfig.getConnectTimeout(), apiConfig.getReadTimeout()); System.out.println(responseJsonStr); ResultData resultData = JSONUtil.toBean(responseJsonStr, ResultData.class); + prevailCloudLog.setResponseParam(responseJsonStr); + prevailCloudLog.setStatus(resultData.getStatus()); if (resultData.getStatus() == 100) { - ; //解析基础数据 String data = ApiHelper.decryptResponse(apiConfig.getAccessCode(), resultData); ApiPage apiPage = JSONUtil.toBean(data, ApiPage.class); @@ -174,6 +203,8 @@ public class PrevailCloudApiImpl implements PrevailCloudApi { // resultApiPage.setRecords(listResult); // return resultApiPage; } + prevailCloudLogService.save(prevailCloudLog); + } /** diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/common/PrevailCloudConstant.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/common/PrevailCloudConstant.java new file mode 100644 index 00000000..241c3afd --- /dev/null +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/common/PrevailCloudConstant.java @@ -0,0 +1,19 @@ +package cn.jyjz.xiaoyao.ocr.common; + +/** + * ClassName: PrevailCloudConstant$.java + * Description: + * Author: scl. + * Date: 2024/4/25 下午8:36 + */ +public class PrevailCloudConstant { + + public static Integer PULL_PICTURE_SOURCE = 0; + + public static Integer SEND_FLOW_RESULT = 1; + + public static Integer PULL_ACCOUNT_INFO = 2; + + + +} diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/dataDao/OcrPrevailCloudLogMapper.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/dataDao/OcrPrevailCloudLogMapper.java new file mode 100644 index 00000000..af28b95b --- /dev/null +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/dataDao/OcrPrevailCloudLogMapper.java @@ -0,0 +1,13 @@ +package cn.jyjz.xiaoyao.ocr.dataDao; + +import cn.jyjz.xiaoyao.ocr.dataobject.OcrPrevailCloudLog; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * ClassName: $className$.java + * Description: + * Author: scl. + * Date: 2024/4/25 下午9:18 + */ +public interface OcrPrevailCloudLogMapper extends BaseMapper { +} \ No newline at end of file diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/dataobject/OcrPrevailCloudLog.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/dataobject/OcrPrevailCloudLog.java new file mode 100644 index 00000000..d98a16a9 --- /dev/null +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/dataobject/OcrPrevailCloudLog.java @@ -0,0 +1,110 @@ +package cn.jyjz.xiaoyao.ocr.dataobject; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.util.Date; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * ClassName: $className$.java + * Description: + * Author: scl. + * Date: 2024/4/25 下午9:18 + */ + +/** + * 无量云请求日志 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@TableName(value = "ocr_prevail_cloud_log") +public class OcrPrevailCloudLog { + /** + * ID主键自增 + */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 表单id + */ + @TableField(value = "form_id") + private Long formId; + + /** + * 请求参数 + */ + @TableField(value = "request_param") + private String requestParam; + + /** + * 返回参数 + */ + @TableField(value = "response_param") + private String responseParam; + + /** + * 返回参数 + */ + @TableField(value = "`status`") + private Integer status; + + /** + * 查询方法 + */ + @TableField(value = "`type`") + private Integer type; + + /** + * 创建人 + */ + @TableField(value = "create_by") + private String createBy; + + /** + * 创建时间 + */ + @TableField(value = "create_time") + private Date createTime; + + /** + * 修改人 + */ + @TableField(value = "update_by") + private String updateBy; + + /** + * 修改时间 + */ + @TableField(value = "update_time") + private Date updateTime; + + /** + * 任务id + */ + @TableField(value = "task_id") + private String taskId; + + /** + * 图片id + */ + @TableField(value = "picture_id") + private Long pictureId; + + /** + * 业务主体id + */ + @TableField(value = "tenant_id") + private String tenantId; + + /** + * 冗余字段 + */ + @TableField(value = "redundance") + private String redundance; +} \ No newline at end of file diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/dataobject/OcrTaskchildPicture.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/dataobject/OcrTaskchildPicture.java index 95428f9a..8e0b1348 100644 --- a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/dataobject/OcrTaskchildPicture.java +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/dataobject/OcrTaskchildPicture.java @@ -215,6 +215,12 @@ public class OcrTaskchildPicture implements BaseDto, java.io.Serializable { @TableField(value = "is_repeated_nodules") private Integer isRepeatedNodules; + @Schema(description = "无量云回调结果") + @TableField(value = "send_result") + private Integer sendResult; + + + @ApiModelProperty(value = "项目对象") @TableField(exist = false) private Category categoryDto; @@ -295,6 +301,7 @@ public class OcrTaskchildPicture implements BaseDto, java.io.Serializable { @TableField(exist = false) private String serverThumbnailUrl; + public FlowModelVO getFlowModelVO() { FlowModelVO flowModelVO = new FlowModelVO(); flowModelVO.setFormid(this.getId()); diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/OcrPrevailCloudLogService.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/OcrPrevailCloudLogService.java new file mode 100644 index 00000000..fb60c5e0 --- /dev/null +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/OcrPrevailCloudLogService.java @@ -0,0 +1,14 @@ +package cn.jyjz.xiaoyao.ocr.service; + +import cn.jyjz.xiaoyao.ocr.dataobject.OcrPrevailCloudLog; +import com.baomidou.mybatisplus.extension.service.IService; + /** + * ClassName: $className$.java + * Description: + * Author: scl. + * Date: 2024/4/25 上午12:52 + */ +public interface OcrPrevailCloudLogService extends IService{ + + +} diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/OcrTaskchildPictureService.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/OcrTaskchildPictureService.java index 8ac774e3..bd22b9ad 100644 --- a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/OcrTaskchildPictureService.java +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/OcrTaskchildPictureService.java @@ -149,7 +149,7 @@ public interface OcrTaskchildPictureService extends BaseService getPackageSimilarityList(Integer pageNo, Integer pageSize, String oderType, String oderName, String checkDuplicateId, String pictureId); - void sendFlowTaskResult(OcrTaskchildPicture taskchildPicture, OcrPicture picture, FlowApprove flowApprove) throws Exception; + Boolean sendFlowTaskResult(OcrTaskchildPicture taskchildPicture, OcrPicture picture, FlowApprove flowApprove) throws Exception; List getDubiousfileList(List pictureIds, String userNodeType); } diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/impl/OcrPrevailCloudLogServiceImpl.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/impl/OcrPrevailCloudLogServiceImpl.java new file mode 100644 index 00000000..f21adb83 --- /dev/null +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/impl/OcrPrevailCloudLogServiceImpl.java @@ -0,0 +1,19 @@ +package cn.jyjz.xiaoyao.ocr.service.impl; + +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import java.util.List; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import cn.jyjz.xiaoyao.ocr.dataobject.OcrPrevailCloudLog; +import cn.jyjz.xiaoyao.ocr.dataDao.OcrPrevailCloudLogMapper; +import cn.jyjz.xiaoyao.ocr.service.OcrPrevailCloudLogService; +/** + * ClassName: $className$.java + * Description: + * Author: scl. + * Date: 2024/4/25 上午12:52 + */ +@Service +public class OcrPrevailCloudLogServiceImpl extends ServiceImpl implements OcrPrevailCloudLogService{ + +} diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/impl/OcrTaskchildPictureServiceImpl.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/impl/OcrTaskchildPictureServiceImpl.java index 420a9989..96de3e44 100644 --- a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/impl/OcrTaskchildPictureServiceImpl.java +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/impl/OcrTaskchildPictureServiceImpl.java @@ -110,7 +110,7 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl ocrPictureList, String tenantId, UserToken userToken,String deptid) { + public void createTask(List ocrPictureList, String tenantId, UserToken userToken, String deptid) { if (null != ocrPictureList && !ocrPictureList.isEmpty()) { //用于标记相似度是否存在百分百的情况 for (OcrPicture ocrPicture : ocrPictureList) { @@ -380,7 +380,7 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl first = list.stream().filter(userapprove -> userapprove.getUserid().toString().equals(userToken.getUserid()) && userapprove.getTaskindex().equals(taskNode)).findFirst(); Userapprove userapprove = new Userapprove(); - userapprove.setStatshis(ocrTaskchildPicture.getStates()==3?2:ocrTaskchildPicture.getStates()==5?3:1); + userapprove.setStatshis(ocrTaskchildPicture.getStates() == 3 ? 2 : ocrTaskchildPicture.getStates() == 5 ? 3 : 1); ocrTaskchildPicture.setUserapprove(first.orElse(userapprove)); } //查询图片对象 @@ -420,13 +420,13 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl listFinal(Map query) { - return this.ocrtaskchildpicturemybatisdao.listFinalTask(query); + return this.ocrtaskchildpicturemybatisdao.listFinalTask(query); } @@ -667,8 +667,8 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl getPictureHistoryList(List pictureIds, String pictureId,String taskNode) { - return ocrtaskchildpicturemybatisdao.getPictureHistoryList(pictureIds, pictureId,taskNode); + public List getPictureHistoryList(List pictureIds, String pictureId, String taskNode) { + return ocrtaskchildpicturemybatisdao.getPictureHistoryList(pictureIds, pictureId, taskNode); } @Override @@ -693,18 +693,18 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl pictureIds = jsonObject.keySet(); - List taskChildPicturesOld = this.getPictureHistoryList(new ArrayList<>(pictureIds), pictureId,taskNode); + List taskChildPicturesOld = this.getPictureHistoryList(new ArrayList<>(pictureIds), pictureId, taskNode); List taskChildPictures = new ArrayList<>(); for (OcrTaskChildPictureVo taskChildPicture : taskChildPicturesOld) { - if(taskChildPicture.getPictureId()!=null){ + if (taskChildPicture.getPictureId() != null) { taskChildPictures.add(taskChildPicture); } } for (OcrTaskChildPictureVo taskChildPicture : taskChildPictures) { - if(jsonObject.getString(taskChildPicture.getPictureId())!=null){ + if (jsonObject.getString(taskChildPicture.getPictureId()) != null) { taskChildPicture.setSimilarityScore(Integer.parseInt(jsonObject.getString(taskChildPicture.getPictureId().toString()))); - }else{ + } else { taskChildPicture.setSimilarityScore(1); } @@ -737,14 +737,14 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl 1) t1 LEFT JOIN ocr_taskchild_picture t2 ON t1.ID = t2.PICTUREID LEFT JOIN ocr_picture t3 on t1.id = t3.ID + where t2.TENANTID = #{tenantId,jdbcType=VARCHAR}