yangys
2025-08-11 291ef3947565e8a20889e04836c04a8b6e4369dd
blade-service/blade-mdm/src/main/java/org/springblade/mdm/program/service/NcProgramExportDNCService.java
@@ -89,7 +89,7 @@
            addProgramPackageToZip(zipOut,approved);
         }
         addDataJson(zipOut, programPackageNodeIdList);
         //addDataJson(zipOut, programPackageNodeIdList);
      }
      os.close();
@@ -152,7 +152,11 @@
    * @return
    */
   InputStream addSendDirAnnotation(InputStream inputStream,Machine machine,List<Dict> annotationList) throws IOException {
      return FileContentUtil.insertLine(inputStream,1,generateAnnotation(machine.getProgSendDir()==null? StringUtil.EMPTY:machine.getProgSendDir(),machine.getMachineGroupCode(),annotationList));
      //检测第二行是否是路径
      String annotationText = generateAnnotation(machine.getProgSendDir()==null? StringUtil.EMPTY:machine.getProgSendDir(),machine.getMachineGroupCode(),annotationList);
      //TODO 改判断行内容
      return FileContentUtil.insertLine(inputStream,1,annotationText);
   }
   /**
@@ -193,11 +197,12 @@
    * 导入数据文件
    * @param zipOut
    */
   /*
   void addDataJson(ZipOutputStream zipOut, List<Long> programPackageNodeIdList) throws IOException {
      addNodeDataJson(zipOut, programPackageNodeIdList);
      addApproveRecordDataJson(zipOut, programPackageNodeIdList);
   }
   */
   /**
    * zip保重加入节点的数据
@@ -205,6 +210,7 @@
    * @param pkgNodeIdList
    * @throws IOException
    */
   /*
   void  addNodeDataJson(ZipOutputStream zipOut,List<Long>  pkgNodeIdList) throws IOException {
      List<NcNode> pkgNodes =  this.ncNodeService.lambdaQuery().in(NcNode::getId, pkgNodeIdList).list();
@@ -229,7 +235,8 @@
      addInputStreamToZip(zipOut,new ByteArrayInputStream(jsonArray.toJSONString().getBytes(StandardCharsets.UTF_8)),NODE_JSON_FILE);
   }
   */
   /*
   @NotNull
   private static JSONObject getNodeJsonObject(NcNode node) {
      JSONObject recObj = new JSONObject();
@@ -253,17 +260,15 @@
      recObj.put("processInstanceId", node.getProcessInstanceId());
      return recObj;
   }
   */
   /**
    * 导入审批记录
    * @param zipOut
    * @param programPackageNodeIdList 程序包名的id列表
    */
   void addApproveRecordDataJson(ZipOutputStream zipOut, List<Long> programPackageNodeIdList) throws IOException {
      /*
      List<String> instanceIds = this.ncNodeService.lambdaQuery().in(NcNode::getId, programPackageNodeIdList)
         .list().stream().map(NcNode::getProcessInstanceId).toList();
*/
   void addApproveRecordDataJson(ZipOutputStream zipOut, List<Long> programPackageNodeIdList) throws IOException {
      //List<ApproveRecord> records = approveRecordService.lambdaQuery().in(ApproveRecord::getProcessInstanceId, instanceIds).list();
      List<ApproveRecord> records = approveRecordService.lambdaQuery().in(ApproveRecord::getNcNodeId, programPackageNodeIdList).list();
@@ -285,7 +290,7 @@
      }
      addInputStreamToZip(zipOut,new ByteArrayInputStream(jsonArray.toJSONString().getBytes(StandardCharsets.UTF_8)),"exp_mdm_approve_record.json");
   }
   }*/
   void addSuperProperties(JSONObject recObj, BizEntity entity){
      recObj.put("tenantId",entity.getTenantId());