From 1f6ff03df42388413846fb4b2571d6b010ef3306 Mon Sep 17 00:00:00 2001
From: liriming <1343021927@qq.com>
Date: 星期一, 23 九月 2024 08:35:12 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/MpkFileServiceImpl.java |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/MpkFileServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/MpkFileServiceImpl.java
index a8aa81a..6ef8959 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/MpkFileServiceImpl.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/MpkFileServiceImpl.java
@@ -25,6 +25,7 @@
 import org.apache.velocity.VelocityContext;
 import org.apache.velocity.app.Velocity;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
@@ -67,12 +68,13 @@
     @Autowired
     private ConfigApi configApi;
 
+    @Value("${mpk.bakFilePath}")
     private String mpkBakFilePath;
 
-    @PostConstruct
+    /*@PostConstruct
     public void init() {
         mpkBakFilePath = configApi.getConfigValueByKey("mpkBakFilePath").getCheckedData();
-    }
+    }*/
 
     @Override
     public PageData<MpkFileDTO> page(Map<String, Object> params) {
@@ -296,6 +298,13 @@
         prop.put("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
         Velocity.init(prop);
 
+        //生成menu.xml文件
+        Map<String, Map<String, List<MpkFileDTO>>> collect = entities.stream().collect(Collectors.groupingBy(MpkFileDTO::getMenuName, Collectors.groupingBy(e -> StringUtils.isNotBlank(e.getGroupName()) ? e.getGroupName() : "default_group")));
+        Map<String, Object> map1 = new HashMap<>();
+        map1.put("collects",collect);
+        File xmlFile = new File(dirPath.getAbsolutePath() + File.separator + "menu.xml");
+        GenUtils.drawTemplate("menu.xml.vm",new VelocityContext(map1),xmlFile);
+
         //生成cpp文件
         File cppFile = new File(dirPath.getAbsolutePath() + File.separator + UUID.randomUUID() + ".cpp");
         GenUtils.drawTemplate("pkg.cpp.vm",context,cppFile);
@@ -382,6 +391,7 @@
             entity.setProjectId(projectId);
             entity.setPackageHistoryId(historyId);
             entity.setPyName(e.getPyName());
+            entity.setPyChineseName(e.getPyChineseName());
             entity.setPkgName(e.getPkgName());
             entity.setPyModule(e.getPyModule());
             entity.setRemark(e.getRemark());

--
Gitblit v1.9.3