|
@@ -9,6 +9,8 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.springblade.business.entity.ConstructionLedger;
|
|
|
+import org.springblade.business.entity.Task;
|
|
|
+import org.springblade.business.feign.TaskClient;
|
|
|
import org.springblade.business.service.IConstructionLedgerService;
|
|
|
import org.springblade.business.service.IInformationQueryService;
|
|
|
import org.springblade.business.vo.NeiYeLedgerVO;
|
|
@@ -42,6 +44,8 @@ public class NeiYeController {
|
|
|
|
|
|
private final ContractClient contractClient;
|
|
|
|
|
|
+ private final TaskClient taskClient;
|
|
|
+
|
|
|
/**
|
|
|
* 获取内业台账列表
|
|
|
* @return 内业台账列表
|
|
@@ -85,7 +89,20 @@ public class NeiYeController {
|
|
|
if (queryDataResult != null && queryDataResult.size() > 0) {
|
|
|
//删除掉首件
|
|
|
queryDataResult.removeIf(query -> StringUtils.isNotEmpty(query.getQueryType()) && "3".equals(query.getQueryType()));
|
|
|
-
|
|
|
+ //过滤Evaluate
|
|
|
+ queryDataResult.stream().forEach(qdr->{
|
|
|
+ if ("2".equals(qdr.getStatus()+"")){
|
|
|
+ qdr.setEvaluate("true");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ String isEvaluate = String.valueOf(queryVO.getIsEvaluate());
|
|
|
+ if (!"".equals(isEvaluate) && !"null".equals(isEvaluate) && isEvaluate != null) {
|
|
|
+ queryDataResult = queryDataResult.stream()
|
|
|
+ .filter(qdr->isEvaluate.equals(qdr.getEvaluate())).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ if (queryDataResult.size() <= 0){
|
|
|
+ return R.data(300, null, "未查询到数据");
|
|
|
+ }
|
|
|
//分组
|
|
|
List<List<QueryProcessDataVO>> groupList = CommonUtil.getBatchSize(queryDataResult, queryVO.getSize());
|
|
|
List<QueryProcessDataVO> groupQueryList = groupList.get(queryVO.getCurrent() == 0 ? 0 : queryVO.getCurrent() - 1);
|
|
@@ -120,6 +137,46 @@ public class NeiYeController {
|
|
|
}
|
|
|
}
|
|
|
//todo 当前缺少是否关联评定、是否关联试验 =================================
|
|
|
+ //过滤输入框条件
|
|
|
+ String queryStr = queryVO.getQueryStr();
|
|
|
+ if (!"".equals(queryStr) && !"null".equals(queryStr) && queryStr != null){
|
|
|
+ if (!map.get("unitProject").toUpperCase().contains(queryStr.toUpperCase())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //审批状态
|
|
|
+ String taskStatus = queryVO.getTaskStatus();
|
|
|
+ if (!"".equals(taskStatus) && !"null".equals(taskStatus) && taskStatus != null) {
|
|
|
+ String status = Integer.parseInt(taskStatus) - 1 + "";
|
|
|
+ if (vo.getStatus() == null){
|
|
|
+ vo.setStatus(0);
|
|
|
+ }
|
|
|
+ if (!status.equals(vo.getStatus()+"")){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //上报批次
|
|
|
+ if (vo.getInformationQueryId() != null){
|
|
|
+ List<Task> tasks = taskClient.queryTaskListByFormDataId(vo.getInformationQueryId());
|
|
|
+ Task task;
|
|
|
+ if (tasks == null || tasks.size() <= 0){
|
|
|
+ task = new Task();
|
|
|
+ task.setBatch(-1);
|
|
|
+ }else {
|
|
|
+ tasks = tasks.stream().sorted(Comparator.comparing(e -> e.getCreateTime())).collect(Collectors.toList());
|
|
|
+ task = tasks.get(tasks.size() - 1);
|
|
|
+ }
|
|
|
+ map.put("reportNumber",task.getBatch()+"");
|
|
|
+ String reportNumber = queryVO.getReportNumber();
|
|
|
+ if (!"".equals(reportNumber) && !"null".equals(reportNumber) && reportNumber != null) {
|
|
|
+ int anInt = Integer.parseInt(reportNumber);
|
|
|
+ if (task.getBatch() != anInt){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ map.put("reportNumber","-1");
|
|
|
+ }
|
|
|
//新增列表数据
|
|
|
neiYeLedgerVOList.add(new NeiYeLedgerVO(map.get("unitProject"),
|
|
|
map.get("partProject"),
|
|
@@ -131,7 +188,8 @@ public class NeiYeController {
|
|
|
map.get("detectionStartToEndTime"),
|
|
|
new Integer("1").equals(vo.getStatus()) ? "待审批" : new Integer("2").equals(vo.getStatus()) ? "已审批" : "未上报",
|
|
|
vo.getEvaluate(),
|
|
|
- "false"));
|
|
|
+ "false",
|
|
|
+ map.get("reportNumber")));
|
|
|
}
|
|
|
//转换为page信息
|
|
|
Query query = new Query();
|