瀏覽代碼

千机质检

oyq28 9 月之前
父節點
當前提交
dbe44a36ab

+ 1 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/mq/TaskWorkNode.java

@@ -1116,7 +1116,7 @@ public class TaskWorkNode {
                         locationMap.put("mode","256");
                         //String trayCategoryType = this.getTrayCategoryType(taskNode.getId());
                         locationMap.put("carryType","1");
-
+                        locationMap.put("qj",bom.getQj());
                         dataMap.put("data", locationMap);
                         dataMap.put("method", "RobotAction");
                         dataMap.put("result", true);

+ 40 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/MachineNodeServiceImpl.java

@@ -48,6 +48,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
+import java.io.IOException;
+import java.nio.file.*;
+import java.nio.file.attribute.BasicFileAttributes;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -315,6 +318,12 @@ public class MachineNodeServiceImpl implements NodeOperationService {
                         filePathList.addAll(subFileList);
 
                         data.put("subFileList", filePathList);
+                        List<String> toolFileList=new ArrayList<>();
+                        String ip = productionresource.getIp();
+                        //getSharedFilePath(toolFileList,ip);
+                        data.put("toolFileList", toolFileList);
+
+
                         map.put("data", data);
                         map.put("result", true);
                     }
@@ -515,4 +524,35 @@ public class MachineNodeServiceImpl implements NodeOperationService {
         return deviceList.get(0);
     }
 
+
+    public void getSharedFilePath(List<String> list,String ip){
+        String sharedFolderPath = "\\\\Win-b6h3n3fgd72\\"+ip;
+
+        try {
+            Path folderPath = Paths.get(sharedFolderPath);
+
+            if (!Files.exists(folderPath)) {
+                log.error("共享文件夹不存在:" + sharedFolderPath);
+                return;
+            }
+            // 遍历共享文件夹中的所有文件
+            Files.walkFileTree(folderPath, new SimpleFileVisitor<Path>() {
+                @Override
+                public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
+                    log.info("文件路径: " + file.toString().replace("/", "\\"));
+                    list.add(file.toString().replace("/", "\\"));
+                    return FileVisitResult.CONTINUE;
+                }
+
+                @Override
+                public FileVisitResult visitFileFailed(Path file, IOException exc) {
+                    log.error("无法访问文件: " + file.toString());
+                    return FileVisitResult.CONTINUE;
+                }
+            });
+        } catch (IOException e) {
+            log.error("上传对刀仪文件出错:",e);
+        }
+    }
+
 }

+ 3 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/RobotNodeServiceImpl.java

@@ -409,6 +409,8 @@ public class RobotNodeServiceImpl implements NodeOperationService {
     private Map<String, Object>  commandHandle(Map<String, Object> dataMap, Storge agvStartStationStorge,String functionName) throws InterruptedException {
         TaskNode taskNode = (TaskNode) dataMap.get("taskNode");
         TTask task = (TTask) dataMap.get("task");
+        BBom bom = bBomMapper.selectById(task.getBomId());
+
         BomProcedure bomProcedure = bomProcedureMapper.selectOne(Wraps.<BomProcedure>lbQ().eq(BomProcedure::getId,task.getProcedureId()));
 
         int count = Integer.parseInt(dataMap.get(taskNode.getId().toString() + "count") == null ? "0" : dataMap.get(taskNode.getId().toString() + "count").toString());
@@ -523,7 +525,7 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                                 locationMap.put("mode","256");
                                 //String trayCategoryType = this.getTrayCategoryType(taskNode.getId());
                                 locationMap.put("carryType","1");
-
+                                locationMap.put("qj",bom.getQj());
                                 dataMap.put("data", locationMap);
                                 dataMap.put("method", "RobotAction");
                                 dataMap.put("result", true);

+ 13 - 1
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/operationManagementCenter/OrderQualityMapper.xml

@@ -43,7 +43,9 @@
     </sql>
 
     <!-- 分页 -->
-    <select id="pageList" resultMap="BaseResultMap">
+    <select id="pageList" resultType="com.github.zuihou.business.operationManagementCenter.entity.OrderQuality">
+
+       <!-- 20241206用于成航发千机质检
         select
         <include refid="Base_Column_List"/>,org_id
         from (select w.*, o.order_name AS orderName,z.org_id, itw.unique_code AS uniqueCode
@@ -51,7 +53,17 @@
             left join imcs_o_order o on w.order_id = o.id
             left join imcs_t_workpiece itw on w.workpiece_id = itw.complete_batch_no
             left join imcs_z_zone z on o.zone_id = z.id
+        ) s ${ew.customSqlSegment}-->
+
+        select
+        s.*
+        from (select tw.*, oo.order_name AS orderName,tw.unique_code AS uniqueCode,bb.name as workpieceName,tw.test_result as okFlag
+        from imcs_t_workpiece tw
+        left join imcs_o_order oo on tw.order_id=oo.id
+        left join imcs_b_bom bb on tw.bom_id=bb.id
+        where bb.qj='1'
         ) s ${ew.customSqlSegment}
+
     </select>
 
 </mapper>

+ 5 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionReadyCenter/entity/BBom.java

@@ -264,6 +264,11 @@ public class BBom extends Entity<Long> {
     @Excel(name = "产线")
     private Long zoneId;
 
+    @ApiModelProperty(value = "qj")
+    @TableField("qj")
+    @Excel(name = "qj")
+    private String qj;
+
 
 
     @Builder