Browse Source

增加记录点检人 点检时间

daili 3 years ago
parent
commit
628982b72e

+ 5 - 3
application-facade/src/main/java/com/factory/web/service/impl/fa/FirstArticleServiceImpl.java

@@ -13,6 +13,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Optional;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 import java.util.stream.IntStream;
@@ -1387,7 +1388,7 @@ public class FirstArticleServiceImpl extends ServiceImpl<FirstArticleMapper, Ben
         titleMap.put("iniCheckPrinciple", faCalendarList.stream().filter(item2 -> item2.getTypeFlag().equals(0)).findFirst().map(item3 -> item3.getCheckPerson()).orElse("无"));
         titleMap.put("twoCheckPrinciple", faCalendarList.stream().filter(item2 -> item2.getTypeFlag().equals(1)).findFirst().map(item3 -> item3.getCheckPerson()).orElse("无"));
         titleMap.put("breakCheckPrinciple", faCalendarList.stream().filter(item2 -> item2.getTypeFlag().equals(2)).findFirst().map(item3 -> item3.getCheckPerson()).orElse("无"));
-
+        AtomicReference<String> remarkStr = null;
 
         ArrayList<Map<String, String>> arrayList = new ArrayList<>();
 
@@ -1420,9 +1421,10 @@ public class FirstArticleServiceImpl extends ServiceImpl<FirstArticleMapper, Ben
                     frequencyList.add("首件");
                     Map<Integer, List<FirstArticleItemResult>> fisWorkMap = item1.getFirstItemResultList().stream().collect(Collectors.groupingBy(FirstArticleItemResult::getSno));
                     String greads = worksNumList.stream().map(work -> {
-                        return fisWorkMap.get(work) != null ? fisWorkMap.get(work).stream().map(result -> {
+                        return fisWorkMap.get(work) != null ? fisWorkMap.get(work).stream().map(result -> {//检查结果
                             //所有工位订单号相同  其实取一次就可以
                             beanMap.put("firOrder", Optional.ofNullable(result.getOrderNumber()).orElse(null));
+                            remarkStr.set(result.getToolDesc());
                             if (numType) {
                                 return result.getVal();
                             } else {
@@ -1497,7 +1499,7 @@ public class FirstArticleServiceImpl extends ServiceImpl<FirstArticleMapper, Ben
 
 
         });
-
+        titleMap.put("remark", remarkStr.get());
         // 模板注意 用{} 来表示你要用的变量 如果本来就有"{","}" 特殊字符 用"\{","\}"代替
         String templateFileName = "systemLib/template/首件计划表.xlsx";
         File tempFile = null;

+ 13 - 9
application-facade/src/main/java/com/factory/wx/service/impl/AbnormalStatisticsServiceImpl.java

@@ -153,7 +153,7 @@ public class AbnormalStatisticsServiceImpl implements AbnormalStatisticsService
             List<FirstArticleWorkshop> firstArticleWorkshopList = firstArticleWorkshopService.list(Wrappers.<FirstArticleWorkshop>lambdaQuery()
                     .eq(FirstArticleWorkshop::getBentelerPlanId, faInfo.getBentelerPlanId()));
 
-            List<AbnormalWorkshopRes> abnormalWorkshopList = new ArrayList<AbnormalWorkshopRes>();
+            List<AbnormalWorkshopRes> abnormalWorkshopList = new ArrayList<>();
             AbnormalWorkshopRes abnormalWorkshop = null;
             for (FirstArticleWorkshop workshop : firstArticleWorkshopList) {
                 abnormalWorkshop = new AbnormalWorkshopRes();
@@ -175,14 +175,18 @@ public class AbnormalStatisticsServiceImpl implements AbnormalStatisticsService
                         String userName = wxPlanService.getUserNameById(abnormalItemInfo.getItemResultUserId());
                         abnormalItemInfo.setItemResultUser(userName);
                     }
-                    List<AbnormalItemResultRes> firstItemResultList = this.getAbnormalItemResultList(faInfo.getTaskId(), abnormalItemInfo.getItemId(), 0);
-                    abnormalItemInfo.setFirstItemResultList(firstItemResultList);
-
-                    List<AbnormalItemResultRes> twoHundredItemResultList = this.getAbnormalItemResultList(faInfo.getTaskId(), abnormalItemInfo.getItemId(), 1);
-                    abnormalItemInfo.setTwoHundredItemResultList(twoHundredItemResultList);
-
-                    List<AbnormalItemResultRes> catchItemResultList = this.getAbnormalItemResultList(faInfo.getTaskId(), abnormalItemInfo.getItemId(), 2);
-                    abnormalItemInfo.setCatchItemResultList(catchItemResultList);
+                    if (faInfo.getTypeFlag().equals(0)) {
+                        List<AbnormalItemResultRes> firstItemResultList = this.getAbnormalItemResultList(faInfo.getTaskId(), abnormalItemInfo.getItemId(), 0);
+                        abnormalItemInfo.setFirstItemResultList(firstItemResultList);
+                    }
+                    if (faInfo.getTypeFlag().equals(1)) {
+                        List<AbnormalItemResultRes> twoHundredItemResultList = this.getAbnormalItemResultList(faInfo.getTaskId(), abnormalItemInfo.getItemId(), 1);
+                        abnormalItemInfo.setTwoHundredItemResultList(twoHundredItemResultList);
+                    }
+                    if (faInfo.getTypeFlag().equals(2)) {
+                        List<AbnormalItemResultRes> catchItemResultList = this.getAbnormalItemResultList(faInfo.getTaskId(), abnormalItemInfo.getItemId(), 2);
+                        abnormalItemInfo.setCatchItemResultList(catchItemResultList);
+                    }
                 }
 
                 abnormalWorkshopList.get(i).setAbnormalItemList(abnormalItemList);

+ 1 - 2
application-facade/src/main/resources/mapper/AbnormalStatisticsMapper.xml

@@ -194,8 +194,7 @@
         WHERE fat.id = r.first_article_task_id
           AND fat.first_article_calendar_id = fac.id
           AND fac.benteler_plan_id = bp.id
-          AND (fac.principal_one_id = uu.id
-            or fac.principal_two_id = uu.id)
+          AND (fac.principal_one_id = uu.id or fac.principal_two_id = uu.id)
           AND bp.id = #{planId}
     </select>
 

+ 1 - 0
application-facade/src/main/resources/mapper/PreventMistakeMapper.xml

@@ -565,6 +565,7 @@
         <if test="req.typeFlag == 2"> <!-- 中断 -->
             AND fai.catch_flag = 1
         </if>
+            AND
     </select>
 
     <!--取得PAD端工作站 -->