wujian
2024-03-29 8241ddde076c3418f359e48009585a2d9aae7ed7
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanItemsProject/controller/EmInspectionPlanItemsProjectController.java
@@ -6,6 +6,7 @@
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jcdm.framework.websocket.WebSocketUsers;
@@ -66,11 +67,12 @@
        List<EmInspectionPlanItemsProject> list = emInspectionPlanItemsProjectService.list(new LambdaQueryWrapper<EmInspectionPlanItemsProject>()
                .eq(EmInspectionPlanItemsProject::getPlanTaskId, itemsProject.getPlanTaskId()));
        List<String> collect = list.stream().map(EmInspectionPlanItemsProject::getResults).collect(Collectors.toList());
        if(collect.stream().noneMatch(s -> s.equals("0"))){
        List<String> collect = list.stream()
                .map(EmInspectionPlanItemsProject::getResults)
                .filter(x-> !"1".equals(x)).collect(Collectors.toList());
        if(CollUtil.isEmpty(collect)){
            EmInspectionPlanTask planTaskById = emInspectionPlanTaskService.getById(itemsProject.getPlanTaskId());
            planTaskById.setResults("1");
            planTaskById.setState("1");
            emInspectionPlanTaskService.saveOrUpdate(planTaskById);
        }
        return AjaxResult.success();