Min 1 năm trước cách đây
mục cha
commit
b2ec24610b

+ 3 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/Plan.java

@@ -262,6 +262,9 @@ public class Plan extends Model<Plan> {
     @TableField(exist = false)
     private Integer hasAllocation;
 
+    @TableField(exist = false)
+    private Integer hasAllAllocation;
+
     @Override
     protected Serializable pkVal() {
         return this.id;

+ 10 - 9
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/PlanServiceImpl.java

@@ -2,13 +2,11 @@ package com.management.platform.service.impl;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.management.platform.entity.*;
-import com.management.platform.entity.vo.SysRichFunction;
 import com.management.platform.mapper.*;
 import com.management.platform.service.*;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -16,7 +14,6 @@ import com.management.platform.util.DateTimeUtil;
 import com.management.platform.util.ExcelUtil;
 import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.MessageUtils;
-import org.apache.commons.lang3.StringEscapeUtils;
 import org.apache.poi.EncryptedDocumentException;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.ss.usermodel.CellType;
@@ -27,10 +24,8 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 import org.springframework.util.StringUtils;
-import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
@@ -38,15 +33,12 @@ import javax.servlet.http.HttpServletRequest;
 import java.io.*;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
-import java.sql.Wrapper;
 import java.text.NumberFormat;
 import java.text.SimpleDateFormat;
-import java.time.Instant;
 import java.time.LocalDate;
-import java.time.LocalTime;
-import java.time.ZoneId;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
+import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.stream.Collectors;
 
 /**
@@ -227,6 +219,15 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
                     List<Integer> totalIds = totals.stream().map(PlanProcedureTotal::getId).collect(Collectors.toList());
                     boolean b = procedureTeams.stream().anyMatch(p -> totalIds.contains(p.getPlanProcedureId()));
                     rs.setHasAllocation(b?1:0);
+                    AtomicBoolean allAllocation= new AtomicBoolean(true);
+                    totals.forEach(t->{
+                        Optional<ProdProcedureTeam> team = procedureTeams.stream().filter(p -> p.getPlanProcedureId().equals(t.getId())).findFirst();
+                        if(!team.isPresent()){
+                            allAllocation.set(false);
+                        }
+                    });
+                    rs.setHasAllocation(b?1:0);
+                    rs.setHasAllAllocation(allAllocation.get()?1:0);
                 }
                 if(planType==2){
                     totals.forEach(ps->{