|
@@ -2,6 +2,7 @@ package org.springblade.business.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
@@ -25,7 +26,7 @@ import org.springblade.system.user.entity.User;
|
|
|
import org.springblade.system.user.feign.IUserClient;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@RestController
|
|
@@ -99,11 +100,35 @@ public class EVisaTaskCheckController {
|
|
|
|
|
|
//因为是批量的,所以需要一一校验
|
|
|
List<String> queryIds = json.getJSONArray("queryIds").toJavaList(String.class);
|
|
|
- for(String queryId : queryIds){
|
|
|
- //先获取记录
|
|
|
- InformationQuery query = this.informationQueryService.getById(queryId);
|
|
|
+ //获取所选资料记录
|
|
|
+ List<InformationQuery> queryList = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getId, queryIds));
|
|
|
+ //获取节点
|
|
|
+ List<WbsTreeContract> contractTreeList = this.wbsTreeContractClient.queryContractTreeNodeByPKIds(queryList.stream().map(InformationQuery::getWbsId).distinct().collect(Collectors.toList()));
|
|
|
+ //做一一对应处理
|
|
|
+ Map<String, InformationQuery> queryMap = new HashMap<>();
|
|
|
+ Map<String, WbsTreeContract> queryToNodeMap = new HashMap<>();
|
|
|
+ for(InformationQuery query : queryList){
|
|
|
+ Iterator<WbsTreeContract> iterator = contractTreeList.iterator();
|
|
|
+ while (iterator.hasNext()){
|
|
|
+ WbsTreeContract next = iterator.next();
|
|
|
+ if(next.getPKeyId().equals(query.getWbsId())){
|
|
|
+ queryToNodeMap.put(query.getId().toString(), next);
|
|
|
+ iterator.remove();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ queryMap.put(query.getId().toString(), query);
|
|
|
+ }
|
|
|
+ //循环判断
|
|
|
+ Set<String> keys = queryMap.keySet();
|
|
|
+ for(String key : keys){
|
|
|
+ //获取记录
|
|
|
+ InformationQuery query = queryMap.get(key);
|
|
|
+ //获取节点
|
|
|
+ WbsTreeContract contractNode = queryToNodeMap.get(key);
|
|
|
+
|
|
|
//根据节点及具体类型做表格区分
|
|
|
- List<WbsTreeContract> tableList = this.wbsTreeContractClient.queryChildByParentId(this.wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(query.getWbsId()), "queryTable", String.valueOf(query.getClassify()));
|
|
|
+ List<WbsTreeContract> tableList = this.wbsTreeContractClient.queryChildByParentId(contractNode, "queryTable", String.valueOf(query.getClassify()));
|
|
|
//获取指向ID
|
|
|
List<Long> privateTablePrimaryKeyIds = tableList.stream().map(WbsTreeContract::getIsTypePrivatePid).distinct().collect(Collectors.toList());
|
|
|
|
|
@@ -124,6 +149,7 @@ public class EVisaTaskCheckController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
return R.data(200, true, "满足上报条件");
|
|
|
}
|
|
|
return R.data(300, false, "未找到对应流程,请重新选择");
|