@ -8,6 +8,8 @@ import cn.jyjz.flowable.entity.FlowApprove;
import cn.jyjz.flowable.service.IFlowInstanceService ;
import cn.jyjz.flowable.service.IFlowTaskService ;
import cn.jyjz.flowable.service.IFormCustomService ;
import cn.jyjz.xiaoyao.admin.dataobject.Department ;
import cn.jyjz.xiaoyao.admin.service.DepartmentService ;
import cn.jyjz.xiaoyao.common.base.param.ParamterPage ;
import cn.jyjz.xiaoyao.common.base.util.SpringUtils ;
import cn.jyjz.xiaoyao.common.base.vo.ResultVo ;
@ -41,6 +43,7 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils ;
import org.apache.commons.lang3.StringUtils ;
import org.flowable.task.api.Task ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.beans.factory.annotation.Value ;
import org.springframework.http.HttpStatus ;
import org.springframework.mock.web.MockHttpServletRequest ;
@ -94,6 +97,9 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
@Resource
private PrevailCloudApi prevailCloudApi ;
@Autowired
private DepartmentService departmentService ;
/ * *
* 图 片 真 假 设 置
*
@ -319,8 +325,8 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
//TODO 没有对应项目,返回提示信息
continue ;
}
Category category = categoryService . getById ( ocrPicture . getCategoryid ( ) ) ;
if ( null = = category | | StringUtils . isBlank ( category . getProcessdefinitionid ( ) ) ) {
Department department = departmentService . getOne ( new LambdaQueryWrapper < Department > ( ) . eq ( Department : : getDeptno , tenantId ) ) ;
if ( null = = department | | StringUtils . isBlank ( department . getProcessdefinitionid ( ) ) ) {
continue ;
}
//创建工单,如果创建成功,增加标志,用于过滤条件使用
@ -330,13 +336,13 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
RequestContextHolder . setRequestAttributes ( new ServletRequestAttributes ( request ) ) ;
//发起流程
flowInstanceService . startProcessInstanceById (
category . getProcessdefinitionid ( ) ,
department . getProcessdefinitionid ( ) ,
null ,
request ,
ocrTaskchildPicture . getId ( ) . toString ( ) ,
category . getServicename ( )
department . getServicename ( )
) ;
IFormCustomService iFormCustomService = SpringUtils . getBean ( category . getServicename ( ) ) ;
IFormCustomService iFormCustomService = SpringUtils . getBean ( department . getServicename ( ) ) ;
FlowModelVO formData = iFormCustomService . getForm ( ocrTaskchildPicture . getId ( ) . toString ( ) ) ;
List < Task > taskList = iFlowTaskService . nowRunTask ( formData . getProcessInstanceId ( ) , ocrTaskchildPicture . getProcessdefinitionid ( ) ) ;
Task taskData = null ;
@ -656,8 +662,8 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
}
@Override
public List < OcrTaskChildPictureVo > getPictureHistoryList ( List < String > pictureIds , String taskname ) {
return ocrtaskchildpicturemybatisdao . getPictureHistoryList ( pictureIds , taskname ) ;
public List < OcrTaskChildPictureVo > getPictureHistoryList ( List < String > pictureIds , String pictureId ) {
return ocrtaskchildpicturemybatisdao . getPictureHistoryList ( pictureIds , pictureId ) ;
}
@Override
@ -680,10 +686,9 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
OcrPictureDuplicateHis duplicateHis = pictureDuplicateHisService . getOne ( new LambdaQueryWrapper < OcrPictureDuplicateHis > ( ) . eq ( OcrPictureDuplicateHis : : getPictureId , pictureId ) ) ;
Page < OcrTaskChildPictureVo > objectPage = new Page < > ( ) ;
if ( ObjectUtils . isNotEmpty ( duplicateHis ) & & org . apache . commons . lang3 . StringUtils . isNotBlank ( duplicateHis . getCheckDuplicateResultHisJson ( ) ) ) {
String userNodeType = ProcessConstant . userNodeType . getOrDefault ( userToken . getNodeType ( ) , "一级审批" ) ;
JSONObject jsonObject = JSONObject . parseObject ( duplicateHis . getCheckDuplicateResultHisJson ( ) ) ;
Set < String > pictureIds = jsonObject . keySet ( ) ;
List < OcrTaskChildPictureVo > taskChildPicturesOld = this . getPictureHistoryList ( new ArrayList < > ( pictureIds ) , userNodeType ) ;
List < OcrTaskChildPictureVo > taskChildPicturesOld = this . getPictureHistoryList ( new ArrayList < > ( pictureIds ) , pictureId ) ;
List < OcrTaskChildPictureVo > taskChildPictures = new ArrayList < > ( ) ;
for ( OcrTaskChildPictureVo taskChildPicture : taskChildPicturesOld ) {
if ( taskChildPicture . getPictureId ( ) ! = null ) {