@ -15,6 +15,7 @@ import cn.jyjz.xiaoyao.common.base.param.ParamterPage;
import cn.jyjz.xiaoyao.common.base.service.UserTokenService ;
import cn.jyjz.xiaoyao.common.base.util.RequestBaseUtil ;
import cn.jyjz.xiaoyao.common.base.util.requestFormat.SearchQuery ;
import cn.jyjz.xiaoyao.common.base.util.requestFormat.SearchQueryForm ;
import cn.jyjz.xiaoyao.common.base.vo.ResultVo ;
import cn.jyjz.xiaoyao.common.base.vo.ResultVoUtil ;
import cn.jyjz.xiaoyao.common.base.vo.UserToken ;
@ -44,10 +45,8 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest ;
import java.io.InputStream ;
import java.math.BigDecimal ;
import java.util.Date ;
import java.util.HashMap ;
import java.util.List ;
import java.util.Map ;
import java.text.SimpleDateFormat ;
import java.util.* ;
import java.util.stream.Collectors ;
@Api ( tags = "ocr_流程接口" )
@ -365,6 +364,8 @@ public class FlowTaskController extends BaseController {
}
return ResultVoUtil . success ( pageUtils ) ;
}
/ * *
* 终 审 列 表
* @return
@ -376,30 +377,70 @@ public class FlowTaskController extends BaseController {
@GetMapping ( "/listfinal" )
@ResponseBody
public ResultVo < OcrTaskchildPicture > listFinalData ( PageUtils < OcrTaskchildPicture > pageUtils ,
@RequestParam ( name = "search_fromuserid" , defaultValue = "" , required = false ) String searchFromuserid ,
@RequestParam ( name = "search_fromprojectid" , defaultValue = "" , required = false ) String searchFromprojectid ,
@RequestParam ( name = "search_fromplanid" , defaultValue = "" , required = false ) String searchFromplanid ,
@RequestParam ( name = "search_states" , defaultValue = "" , required = false ) String searchStates ,
@RequestParam ( name = "search_fromsourceid" , defaultValue = "" , required = false ) String searchFromsourceid ,
@RequestParam ( name = "fromuptime_start" , defaultValue = "" , required = false ) BigDecimal fromuptimeStart ,
@RequestParam ( name = "fromuptime_end" , defaultValue = "" , required = false ) BigDecimal fromuptimeEnd ,
@RequestParam ( name = "izupuser" , defaultValue = "" , required = false ) String izupuser ,
@RequestParam ( name = "izproject" , defaultValue = "" , required = false ) String izproject ,
@RequestParam ( name = "izplan" , defaultValue = "" , required = false ) String izplan ,
@RequestParam ( name = "izstatus" , defaultValue = "" , required = false ) String izstatus ,
@RequestParam ( name = "iztaskrrom" , defaultValue = "" , required = false ) String iztaskrrom ,
@RequestParam ( name = "izuptime" , defaultValue = "" , required = false ) String izuptime ,
HttpServletRequest request ) {
SearchQuery searchQuery = new SearchQuery ( ) ;
if ( org . springframework . util . StringUtils . hasText ( searchFromuserid ) ) {
searchQuery . addEqual ( "fromuserid" , searchFromuserid ) ;
if ( org . springframework . util . StringUtils . hasText ( izupuser ) ) {
// searchQuery.addEqual("fromuserid",izupuser);
if ( izupuser . contains ( "," ) ) {
String [ ] userIds = izupuser . split ( "," ) ;
List < String > arrayData = Arrays . asList ( userIds ) ;
SearchQueryForm searchQueryForm = new SearchQueryForm ( ) ;
searchQuery . addIn ( "fromuserid" , arrayData ) ;
} else {
searchQuery . addEqual ( "fromuserid" , izupuser ) ;
}
}
if ( org . springframework . util . StringUtils . hasText ( izproject ) ) {
if ( izproject . contains ( "," ) ) {
String [ ] projectIds = izproject . split ( "," ) ; // 以逗号拆分字符串
searchQuery . addIn ( "fromprojectid" , projectIds ) ;
} else {
searchQuery . addEqual ( "fromprojectid" , izproject ) ;
}
}
if ( org . springframework . util . StringUtils . hasText ( izplan ) ) {
if ( izplan . contains ( "," ) ) {
String [ ] planIds = izplan . split ( "," ) ; // 以逗号拆分字符串
searchQuery . addIn ( "fromplanid" , planIds ) ;
} else {
searchQuery . addEqual ( "fromplanid" , izplan ) ;
}
if ( org . springframework . util . StringUtils . hasText ( searchFromprojectid ) ) {
searchQuery . addEqual ( "fromprojectid" , searchFromprojectid ) ;
}
if ( org . springframework . util . StringUtils . hasText ( searchFromplanid ) ) {
searchQuery . addEqual ( "fromplanid" , searchFromplanid ) ;
if ( org . springframework . util . StringUtils . hasText ( izstatus ) ) {
if ( izstatus . contains ( "," ) ) {
String [ ] statusIds = izstatus . split ( "," ) ; // 以逗号拆分字符串
searchQuery . addIn ( "states" , statusIds ) ;
} else {
searchQuery . addEqual ( "states" , izstatus ) ;
}
if ( org . springframework . util . StringUtils . hasText ( searchStates ) ) {
searchQuery . addEqual ( "states" , searchStates ) ;
}
if ( org . springframework . util . StringUtils . hasText ( searchFromsourceid ) ) {
searchQuery . addEqual ( "fromsourceid" , searchFromsourceid ) ;
if ( org . springframework . util . StringUtils . hasText ( iztaskrrom ) ) {
if ( iztaskrrom . contains ( "," ) ) {
String [ ] taskrromIds = iztaskrrom . split ( "," ) ; // 以逗号拆分字符串
searchQuery . addIn ( "fromsourceid" , taskrromIds ) ;
} else {
searchQuery . addEqual ( "fromsourceid" , iztaskrrom ) ;
}
}
//
// if(org.springframework.util.StringUtils.hasText(izproject)){
// searchQuery.addEqual("fromprojectid",izproject);
// }
// if(org.springframework.util.StringUtils.hasText(izplan)){
// searchQuery.addEqual("fromplanid",izplan);
// }
// if(org.springframework.util.StringUtils.hasText(izstatus)){
// searchQuery.addEqual("states",izstatus);
// }
// if(org.springframework.util.StringUtils.hasText(iztaskrrom)){
// searchQuery.addEqual("fromsourceid",iztaskrrom);
// }
//租户主键,由前端页面传送
String tenantId = request . getHeader ( "X-Tenant-Id" ) ;
@ -414,11 +455,48 @@ public class FlowTaskController extends BaseController {
}
Map < String , Object > query = searchQuery . getQuery ( ) ;
if ( fromuptimeStart ! = null ) {
query . put ( "fromuptimeStart" , fromuptimeStart ) ;
if ( org . springframework . util . StringUtils . hasText ( izuptime ) ) {
String [ ] dateRange = izuptime . split ( "-" ) ;
// if (dateRange.length == 2) {
// try {
// long startTimeStamp = Long.parseLong(dateRange[0].trim());
// long endTimeStamp = Long.parseLong(dateRange[1].trim());
// query.put("fromuptimeStart", startTimeStamp);
// query.put("fromuptimeEnd", endTimeStamp);
// } catch (NumberFormatException e) {
// e.printStackTrace();
// }
// }
if ( dateRange . length = = 2 ) {
try {
SimpleDateFormat sdf = new SimpleDateFormat ( "yyyy/MM/dd" ) ;
// 解析开始时间
long startTimeStamp = Long . parseLong ( dateRange [ 0 ] . trim ( ) ) ;
Date startDate = new Date ( startTimeStamp ) ;
String startDateString = sdf . format ( startDate ) ;
// 解析结束时间
long endTimeStamp = Long . parseLong ( dateRange [ 1 ] . trim ( ) ) ;
Date endDate = new Date ( endTimeStamp ) ;
String endDateString = sdf . format ( endDate ) ;
// 如果开始时间不为空,则将其放入查询条件中
if ( ! startDateString . isEmpty ( ) ) {
query . put ( "fromuptimeStart" , startDateString ) ;
}
// 如果结束时间不为空,则将其放入查询条件中
if ( ! endDateString . isEmpty ( ) ) {
query . put ( "fromuptimeEnd" , endDateString ) ;
}
} catch ( NumberFormatException e ) {
// 处理时间戳解析异常
e . printStackTrace ( ) ;
}
}
if ( fromuptimeEnd ! = null ) {
query . put ( "fromuptimeEnd" , fromuptimeEnd ) ;
}
flowTaskService . getFinalProcessInstances ( query , pageUtils ) ;
return ResultVoUtil . success ( pageUtils ) ;