|
|
|
@ -26,11 +26,13 @@ import cn.jyjz.xiaoyao.ocr.service.IOcrSearchHistoryService;
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.service.OcrPictureService;
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.service.OcrTaskchildPictureService;
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.util.FrontMenuEnum;
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.vo.OaUserApproveVo;
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.vo.OcrTaskChildPictureVo;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
import liquibase.pro.packaged.S;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
@ -131,7 +133,7 @@ public class OcrSearchHistoryServiceImpl extends ServiceImpl<OcrSearchHistoryMap
|
|
|
|
|
}
|
|
|
|
|
User user = this.userService.getSessionUser(request);
|
|
|
|
|
PageUtils pageUtils = new PageUtils();
|
|
|
|
|
pageUtils.setPageSize(9999);
|
|
|
|
|
pageUtils.setPageSize(9999999);
|
|
|
|
|
pageUtils.setCurrPage(1);
|
|
|
|
|
List<OcrTaskchildPictureAppro> ocrTaskchildPictureApproList = flowTaskService.getMyProcessInstancesNew(user, tenantid, searchQuery.getQuery(), pageUtils);
|
|
|
|
|
resultVo = new ResultVo<>();
|
|
|
|
@ -178,9 +180,10 @@ public class OcrSearchHistoryServiceImpl extends ServiceImpl<OcrSearchHistoryMap
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ResultVo toolsTaskApprovalCount(String tenantid, String userId, HttpServletRequest request) {
|
|
|
|
|
public ResultVo toolsTaskApprovalCount(String tenantid, UserToken userToken, HttpServletRequest request) {
|
|
|
|
|
ResultVo<Map<String, Integer>> resultVo = null;
|
|
|
|
|
|
|
|
|
|
String userId = userToken.getUserid();
|
|
|
|
|
try {
|
|
|
|
|
//系统中记录的ai统计租户id
|
|
|
|
|
String counttenantid = iCacheManager.get(CacheConstants.TOOLSCOUNT_TENANTID_MODEL_NAME,tenantid+"_"+userId);
|
|
|
|
@ -191,46 +194,79 @@ public class OcrSearchHistoryServiceImpl extends ServiceImpl<OcrSearchHistoryMap
|
|
|
|
|
//用户登录信息写入缓存
|
|
|
|
|
iCacheManager.put(CacheConstants.TOOLSCOUNT_TENANTID_MODEL_NAME,tenantid+"_"+userId,"true",CacheConstants.TOOLSCOUNT_TENANTID_CACHE_TIME);
|
|
|
|
|
|
|
|
|
|
SearchQuery searchQuery = this.getParametersStartingWithToSearchJson(request, "search_");
|
|
|
|
|
String taskName = request.getParameter("keyword");
|
|
|
|
|
if (StringUtils.isNotBlank(taskName)) {
|
|
|
|
|
searchQuery.addLike("fromtaskname", taskName);
|
|
|
|
|
List<OaUserApproveVo> oaUserApproveVoList = taskchildPictureMybatisDao.queryApprovalNode(userId);
|
|
|
|
|
List<OcrTaskchildPictureAppro> ocrTaskchildPictureApproList = new ArrayList<>();
|
|
|
|
|
List<OcrTaskchildPictureAppro> ocrTaskchildPictureApproListNew1 = new ArrayList<>();
|
|
|
|
|
if (oaUserApproveVoList.size() > 0) {
|
|
|
|
|
Map<Long, OaUserApproveVo> formIdToVoMap = new HashMap<>();
|
|
|
|
|
for (OaUserApproveVo vo : oaUserApproveVoList) {
|
|
|
|
|
Long formId = vo.getFormId();
|
|
|
|
|
Integer taskNode = vo.getTaskNode();
|
|
|
|
|
if (!formIdToVoMap.containsKey(formId) || taskNode < formIdToVoMap.get(formId).getTaskNode()) {
|
|
|
|
|
formIdToVoMap.put(formId, vo);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ocrTaskchildPictureApproList = taskchildPictureMybatisDao.queryPendingApproval(userToken.getLoginname(),tenantid);
|
|
|
|
|
for (Long formId : formIdToVoMap.keySet()) {
|
|
|
|
|
// 判断 formId 是否在 ocrTaskchildPictureApproList 中存在
|
|
|
|
|
boolean containsFormId = false;
|
|
|
|
|
for (OcrTaskchildPictureAppro ocrTaskchildPictureAppro : ocrTaskchildPictureApproList) {
|
|
|
|
|
if (Long.parseLong(ocrTaskchildPictureAppro.getId()) == formId) {
|
|
|
|
|
containsFormId = true;
|
|
|
|
|
ocrTaskchildPictureApproListNew1.add(ocrTaskchildPictureAppro);
|
|
|
|
|
// 如果 formId 在 formIdToVoMap 中存在,则将 formId 对应的 STATSHIS 赋值给 ocrTaskchildPictureAppro 的 STATSHIS 字段
|
|
|
|
|
ocrTaskchildPictureAppro.setStatshis(formIdToVoMap.get(formId).getStatsHis());
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(!containsFormId){
|
|
|
|
|
List<OcrTaskchildPictureAppro> ocrTaskchildPictureApproListNew = taskchildPictureMybatisDao.queryExamineApprove(tenantid,formId);
|
|
|
|
|
if(ocrTaskchildPictureApproListNew.size()>0){
|
|
|
|
|
OcrTaskchildPictureAppro ocrTaskchildPictureAppro = ocrTaskchildPictureApproListNew.get(0);
|
|
|
|
|
ocrTaskchildPictureAppro.setStatshis(formIdToVoMap.get(formId).getStatsHis());
|
|
|
|
|
ocrTaskchildPictureApproList.add(ocrTaskchildPictureAppro);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
ocrTaskchildPictureApproList = taskchildPictureMybatisDao.queryPendingApproval(userToken.getLoginname(),tenantid);
|
|
|
|
|
for (OcrTaskchildPictureAppro ocrTaskchildPictureAppro : ocrTaskchildPictureApproList) {
|
|
|
|
|
ocrTaskchildPictureAppro.setStatshis(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
User user = this.userService.getSessionUser(request);
|
|
|
|
|
PageUtils pageUtils = new PageUtils();
|
|
|
|
|
pageUtils.setPageSize(9999);
|
|
|
|
|
pageUtils.setCurrPage(1);
|
|
|
|
|
List<OcrTaskchildPictureAppro> ocrTaskchildPictureApproList = flowTaskService.getMyProcessInstancesNew(user, tenantid, searchQuery.getQuery(), pageUtils);
|
|
|
|
|
System.out.println("ocrTaskchildPictureApproListNew"+ocrTaskchildPictureApproListNew1.size());
|
|
|
|
|
resultVo = new ResultVo<>();
|
|
|
|
|
int pendingApprovalCount = 0; // 待审批的数量
|
|
|
|
|
int approvedCount = 0; // 通过的数量
|
|
|
|
|
int notGoCount = 0; // 不通过的数量
|
|
|
|
|
int repeat = 0; // 重复数量
|
|
|
|
|
int repeatedNodulesCount = 0; //重复小结数
|
|
|
|
|
for (OcrTaskchildPictureAppro ocrTaskchildPictureAppro : ocrTaskchildPictureApproList) {
|
|
|
|
|
if(ocrTaskchildPictureAppro.getIsRepeat() != null && ocrTaskchildPictureAppro.getIsRepeat() == 1){
|
|
|
|
|
repeat++;
|
|
|
|
|
}
|
|
|
|
|
if(ocrTaskchildPictureAppro.getIsRepeatedNodules() !=null && ocrTaskchildPictureAppro.getIsRepeatedNodules() == 1){
|
|
|
|
|
repeatedNodulesCount++;
|
|
|
|
|
}
|
|
|
|
|
if (ocrTaskchildPictureAppro.getStatshis() != null) {
|
|
|
|
|
switch (ocrTaskchildPictureAppro.getStatshis()) {
|
|
|
|
|
case 1:
|
|
|
|
|
pendingApprovalCount++;
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
approvedCount++;
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
notGoCount++;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
if(ocrTaskchildPictureApproList.size()>0){
|
|
|
|
|
for (OcrTaskchildPictureAppro ocrTaskchildPictureAppro : ocrTaskchildPictureApproList) {
|
|
|
|
|
if(ocrTaskchildPictureAppro.getIsRepeat() != null && ocrTaskchildPictureAppro.getIsRepeat() == 1){
|
|
|
|
|
repeat++;
|
|
|
|
|
}
|
|
|
|
|
if(ocrTaskchildPictureAppro.getIsRepeatedNodules() !=null && ocrTaskchildPictureAppro.getIsRepeatedNodules() == 1){
|
|
|
|
|
repeatedNodulesCount++;
|
|
|
|
|
}
|
|
|
|
|
if (ocrTaskchildPictureAppro.getStatshis() != null) {
|
|
|
|
|
switch (ocrTaskchildPictureAppro.getStatshis()) {
|
|
|
|
|
case 1:
|
|
|
|
|
pendingApprovalCount++;
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
approvedCount++;
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
notGoCount++;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
//暂定,后期修改
|
|
|
|
|
pendingApprovalCount++;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
//暂定,后期修改
|
|
|
|
|
pendingApprovalCount++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|