Browse Source

Merge remote-tracking branch 'origin/master'

linhuili 3 years ago
parent
commit
6528c92b5a

+ 34 - 12
dmp-dic/pom.xml

@@ -117,10 +117,32 @@
                     </execution>
                 </executions>
             </plugin>
-
+            <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-resources</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <resources>
+                                <resource>
+                                    <directory>src/main/resources/</directory>
+                                    <includes>
+                                        <include>**/*.yml</include>
+                                    </includes>
+                                </resource>
+                            </resources>
+                            <outputDirectory>${project.build.directory}/config</outputDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
             <!-- 按照测试要求打成zip需要的配置 -->
             <!--获取git信息-->
-            <plugin>
+            <!--<plugin>
                 <groupId>pl.project13.maven</groupId>
                 <artifactId>git-commit-id-plugin</artifactId>
                 <executions>
@@ -134,7 +156,7 @@
                     <verbose>true</verbose>
                     <dateFormat>yyyyMMddHHmm</dateFormat>
                     <generateGitPropertiesFile>true</generateGitPropertiesFile>
-                    <!--<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>-->
+                    &lt;!&ndash;<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>&ndash;&gt;
                     <generateGitPropertiesFilename>target/git.properties</generateGitPropertiesFilename>
                 </configuration>
             </plugin>
@@ -150,13 +172,13 @@
                             <goal>rename</goal>
                         </goals>
                         <configuration>
-<!--                            <sourceFile>${project.build.directory}/git.properties</sourceFile>-->
+&lt;!&ndash;                            <sourceFile>${project.build.directory}/git.properties</sourceFile>&ndash;&gt;
                             <destinationFile>${project.build.directory}/version.txt</destinationFile>
                         </configuration>
                     </execution>
                 </executions>
             </plugin>
-            <!--拷贝资源文件 copy-resources-->
+            &lt;!&ndash;拷贝资源文件 copy-resources&ndash;&gt;
             <plugin>
                 <artifactId>maven-resources-plugin</artifactId>
                 <executions>
@@ -184,7 +206,7 @@
                             <outputDirectory>${project.build.directory}/config</outputDirectory>
                         </configuration>
                     </execution>
-                    <!--拷贝启动脚本-->
+                    &lt;!&ndash;拷贝启动脚本&ndash;&gt;
                     <execution>
                         <id>copy-version</id>
                         <phase>package</phase>
@@ -203,14 +225,14 @@
                 </executions>
             </plugin>
 
-            <!-- 打包压缩 -->
+            &lt;!&ndash; 打包压缩 &ndash;&gt;
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-assembly-plugin</artifactId>
                 <executions>
                     <execution>
                         <id>make-assembly</id>
-                        <!-- 当执行mvn package时才会打包 -->
+                        &lt;!&ndash; 当执行mvn package时才会打包 &ndash;&gt;
                         <phase>package</phase>
                         <goals>
                             <goal>single</goal>
@@ -219,17 +241,17 @@
                             <finalName>
                                 ${project.artifactId}_${git.commit.time}_git_${git.branch}_${git.commit.id.abbrev}
                             </finalName>
-                            <!--不包含assembly id-->
+                            &lt;!&ndash;不包含assembly id&ndash;&gt;
                             <appendAssemblyId>false</appendAssemblyId>
-                            <!--输出路径-->
-                            <!--<outputDirectory>../target/co_search-${project.version}</outputDirectory>-->
+                            &lt;!&ndash;输出路径&ndash;&gt;
+                            &lt;!&ndash;<outputDirectory>../target/co_search-${project.version}</outputDirectory>&ndash;&gt;
                             <descriptors>
                                 <descriptor>src/script/zip.xml</descriptor>
                             </descriptors>
                         </configuration>
                     </execution>
                 </executions>
-            </plugin>
+            </plugin>-->
         </plugins>
     </build>
 

+ 34 - 11
dmp-org/pom.xml

@@ -119,8 +119,31 @@
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-resources</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <resources>
+                                <resource>
+                                    <directory>src/main/resources/</directory>
+                                    <includes>
+                                        <include>**/*.yml</include>
+                                    </includes>
+                                </resource>
+                            </resources>
+                            <outputDirectory>${project.build.directory}/config</outputDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
 
-            <!--拷贝资源文件 copy-resources-->
+            <!--&lt;!&ndash;拷贝资源文件 copy-resources&ndash;&gt;
             <plugin>
                 <artifactId>maven-resources-plugin</artifactId>
                 <executions>
@@ -148,7 +171,7 @@
                             <outputDirectory>${project.build.directory}/config</outputDirectory>
                         </configuration>
                     </execution>
-                    <!--拷贝启动脚本-->
+                    &lt;!&ndash;拷贝启动脚本&ndash;&gt;
                     <execution>
                         <id>copy-version</id>
                         <phase>package</phase>
@@ -167,8 +190,8 @@
                 </executions>
             </plugin>
 
-            <!-- 按照测试要求打成zip需要的配置 -->
-            <!--获取git信息-->
+            &lt;!&ndash; 按照测试要求打成zip需要的配置 &ndash;&gt;
+            &lt;!&ndash;获取git信息&ndash;&gt;
             <plugin>
                 <groupId>pl.project13.maven</groupId>
                 <artifactId>git-commit-id-plugin</artifactId>
@@ -183,19 +206,19 @@
                     <verbose>true</verbose>
                     <dateFormat>yyyyMMddHHmm</dateFormat>
                     <generateGitPropertiesFile>true</generateGitPropertiesFile>
-                    <!--<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>-->
+                    &lt;!&ndash;<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>&ndash;&gt;
                     <generateGitPropertiesFilename>target/git.properties</generateGitPropertiesFilename>
                 </configuration>
             </plugin>
 
-            <!-- 打包压缩 -->
+            &lt;!&ndash; 打包压缩 &ndash;&gt;
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-assembly-plugin</artifactId>
                 <executions>
                     <execution>
                         <id>make-assembly</id>
-                        <!-- 当执行mvn package时才会打包 -->
+                        &lt;!&ndash; 当执行mvn package时才会打包 &ndash;&gt;
                         <phase>package</phase>
                         <goals>
                             <goal>single</goal>
@@ -204,17 +227,17 @@
                             <finalName>
                                 ${project.artifactId}_${git.commit.time}_git_${git.branch}_${git.commit.id.abbrev}
                             </finalName>
-                            <!--不包含assembly id-->
+                            &lt;!&ndash;不包含assembly id&ndash;&gt;
                             <appendAssemblyId>false</appendAssemblyId>
-                            <!--输出路径-->
-                            <!--<outputDirectory>../target/co_search-${project.version}</outputDirectory>-->
+                            &lt;!&ndash;输出路径&ndash;&gt;
+                            &lt;!&ndash;<outputDirectory>../target/co_search-${project.version}</outputDirectory>&ndash;&gt;
                             <descriptors>
                                 <descriptor>src/script/zip.xml</descriptor>
                             </descriptors>
                         </configuration>
                     </execution>
                 </executions>
-            </plugin>
+            </plugin>-->
         </plugins>
     </build>
 

File diff suppressed because it is too large
+ 1075 - 527
dmp-rwd-datautils/src/test/java/com/persagy/dmp/rwd/datautils/ImportFuncidForRwdEdit.java


+ 26 - 3
dmp-rwd-datautils/src/test/java/com/persagy/dmp/rwd/dic/ExcelUtilsForEdit.java

@@ -1,5 +1,6 @@
 package com.persagy.dmp.rwd.dic;
 
+import cn.hutool.core.io.FileUtil;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.CellType;
 import org.apache.poi.ss.usermodel.Sheet;
@@ -93,7 +94,8 @@ public class ExcelUtilsForEdit {
                         String key = item.getKey();
                         String value = item.getValue();
                         if (name.contains(value)) {
-                            System.out.println("analysisSheetDataAndWriteToFile(\"" + key + sheetName.substring(0, 2) + "\", \"/附表7-系统类对象分类属性点表/" + name + "\", \"" + sheetName + "\",\"2\");");
+                            System.out.println("analysisSheetDataAndWriteToFile(\"" + key + sheetName.substring(0, 2) + "\", \"/附表7-系统类对象分类属性点表/" + name + "\", \"" + sheetName + "\",\"2\",systemCommonSeq);");
+                            System.out.println("systemCommonSeq = new AtomicInteger(this.systemCommonSeq.intValue());");
                         }
                     });
                 }
@@ -127,7 +129,8 @@ public class ExcelUtilsForEdit {
                     Sheet sheet = workbook.getSheetAt(i);
                     String sheetName = sheet.getSheetName();
                     // funcids.addAll(readSheet("FFFA", "/2.2-设备设施类对象/2.2.3-系统/50-消防专业系统.xlsx", "FA火灾报警系统"));
-                    System.out.println("analysisSheetDataAndWriteToFile(\"" + key + sheetName.substring(0, 4) + "\", \"" + pathName + "/" + name + "\", \"" + sheetName + "\",\"2\");");
+                    System.out.println("analysisSheetDataAndWriteToFile(\"" + key + sheetName.substring(0, 4) + "\", \"" + pathName + "/" + name + "\", \"" + sheetName + "\",\"2\",equipCommonSeq);");
+                    System.out.println("equipCommonSeq = new AtomicInteger(this.equipCommonSeq.intValue());");
                 }
             }
         }
@@ -165,13 +168,28 @@ public class ExcelUtilsForEdit {
                         String key = item.getKey();
                         String value = item.getValue();
                         if (name.contains(value)) {
-                            System.out.println("analysisSheetDataAndWriteToFile(\"" + key + sheetName.substring(0, 6) + "\", \"/附表9-部件类对象分类属性点表/" + name + "\", \"" + sheetName + "\",\"2\");");
+                            System.out.println("analysisSheetDataAndWriteToFile(\"" + key + sheetName.substring(0, 6) + "\", \"/附表9-部件类对象分类属性点表/" + name + "\", \"" + sheetName + "\",\"2\",componentCommonSeq);");
+                            System.out.println("componentCommonSeq = new AtomicInteger(this.componentCommonSeq.intValue());");
                         }
                     });
                 }
             }
         }
     }
+    @Test
+    public void test4() throws Exception {
+        showPathForTool(basepath + "/附表12-工具类对象分类属性点表");
+    }
+
+    public void showPathForTool(String path) throws Exception {
+        List<File> files = listFiles(path);
+        for (File file : files) {
+            String absolutePath = file.getAbsolutePath();
+            System.out.println(absolutePath);
+
+
+        }
+    }
 
 
     private List<String> listFile(String path) {
@@ -180,4 +198,9 @@ public class ExcelUtilsForEdit {
         return Arrays.stream(files).map(File::getName).filter(item -> !item.startsWith("~")).collect(Collectors.toList());
     }
 
+    private List<File> listFiles(String path) {
+        List<File> files = FileUtil.loopFiles(path);
+        return files.stream().filter(file -> !file.getName().startsWith("~")).collect(Collectors.toList());
+    }
+
 }

+ 23 - 0
dmp-rwd-edit/pom.xml

@@ -177,6 +177,29 @@
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-resources</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <resources>
+                                <resource>
+                                    <directory>src/main/resources/</directory>
+                                    <includes>
+                                        <include>**/*.yml</include>
+                                    </includes>
+                                </resource>
+                            </resources>
+                            <outputDirectory>${project.build.directory}/config</outputDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
         <resources>
             <resource>

+ 38 - 0
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/enumeration/FuncidShareTypeEnum.java

@@ -0,0 +1,38 @@
+package com.persagy.dmp.rwd.edit.enumeration;
+
+import lombok.Getter;
+
+/**
+ * @author sagadev
+ */
+
+public enum FuncidShareTypeEnum {
+
+    /**
+     * 通用信息点
+     */
+    COMMON("1", "通用信息点"),
+    /**
+     * 特有信息点
+     */
+    SELF("2", "特有信息点");
+
+    @Getter
+    private String value;
+    @Getter
+    private String desc;
+
+    FuncidShareTypeEnum(String value, String desc) {
+        this.value = value;
+        this.desc = desc;
+    }
+
+    public static FuncidShareTypeEnum getByValue(Integer value) {
+        for (FuncidShareTypeEnum state : FuncidShareTypeEnum.values()) {
+            if (state.getValue().equals(value)) {
+                return state;
+            }
+        }
+        return null;
+    }
+}

+ 102 - 15
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/service/FuncidDefChangeRecordService.java

@@ -1,6 +1,7 @@
 package com.persagy.dmp.rwd.edit.service;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.fasterxml.jackson.databind.JsonNode;
@@ -18,6 +19,7 @@ import com.persagy.dmp.rwd.edit.entity.*;
 import com.persagy.dmp.rwd.edit.entity.dto.FuncidDefChangeRecordDTO;
 import com.persagy.dmp.rwd.edit.enumeration.EnumOperationType;
 import com.persagy.dmp.rwd.edit.enumeration.EnumVersionState;
+import com.persagy.dmp.rwd.edit.enumeration.FuncidShareTypeEnum;
 import com.persagy.dmp.rwd.edit.model.DtDataModel;
 import com.persagy.dmp.rwd.edit.repository.FuncidDefChangeRecordRepository;
 import com.persagy.dmp.rwd.edit.repository.FuncidDefRepository;
@@ -560,34 +562,57 @@ public class FuncidDefChangeRecordService {
             funcidDef.setNote(item.getNote());
             funcidDef.setSubFlag(item.getSubFlag());
             funcidDef.setWeakPoint(item.getWeakPoint());
-//            if (!FuncidDataType.REFENUM.equals(item.getDataType())) {
             funcidDef.setDataType(item.getDataType());
             funcidDef.setDataSource(item.getDataSource());
-//            } else {
-//                funcidDef.setDataType(FuncidDataType.ENUM);
-//                ArrayNode dataSource = item.getDataSource();
-//                String refKey = dataSource.get(0).get("refKey").asText();
-//                JacksonCriteria queryRef = JacksonCriteria.newInstance();
-//                queryRef.add("refKey", refKey);
-//                List<RwdeditRefTypeInfos> refInfos = rwdeditRefTypeInfosService.query(queryRef).getData();
-//                funcidDef.setDataSource(JacksonMapper.toObject(JacksonMapper.toSimpleJson(refInfos), ArrayNode.class));
-//            }
             funcidDef.setIsUsed(1);//状态 0.历史版本 1.使用中
             funcidDef.setVersion(version);//版本
             funcidDef.setLastUpdateTime(new Date());//发布时间
             funcidDef.setOrderSeq(item.getOrderSeq());
+            JacksonCriteria jacksonCriteria = JacksonCriteria.newInstance();
+            ObjectNode criteria =jacksonCriteria.getCriteria();
+            criteria.put("classCode",item.getClassCode());
+            ListResponse<FuncidDefModel> response = funcidDefService.queryFuncid(jacksonCriteria);
+            // 查询信息点是否存在,如果存在则将旧的设置为不可用
             List<FuncidDefModel> funcidDefModelList = queryFuncidDef(item.getCode(), item.getClassCode(), null);
+            String oldFuncId = "";
             if (funcidDefModelList != null) {
                 FuncidDefModel funcidDefModel = funcidDefModelList.get(0);
                 funcidDefModel.setIsUsed(0);
                 funcidDefModel.setLastUpdateTime(new Date());
                 funcidDefList.add(FuncidDef.fromModel(funcidDefModel));
-
+                oldFuncId = funcidDefModel.getId();
                 funcidDef.setShareType(funcidDefModel.getShareType());
                 funcidDef.setOrderSeq(funcidDefModel.getOrderSeq());
-            }else{
-                //修改信息点位置
-                updateFuncidOrderSeq(funcidDef);
+                funcidDef.setClassCode(funcidDefModel.getClassCode());
+            }
+            List<FuncidDefModel> funcidDefModels = response.getData();
+            if (CollUtil.isNotEmpty(funcidDefModels)){
+                // 获得所有通用信息点
+                List<FuncidDefModel> commonFuncidModels = funcidDefModels
+                        .stream()
+                        .filter(funcidDefModel -> FuncidShareTypeEnum.COMMON.getValue().equals(funcidDefModel.getShareType()))
+                        .sorted(Comparator.comparing(FuncidDefModel::getOrderSeq))
+                        .collect(Collectors.toList());
+                // 获得所有特有信息点
+                List<FuncidDefModel> selfFuncidModels = funcidDefModels
+                        .stream()
+                        .filter(funcidDefModel -> FuncidShareTypeEnum.SELF.getValue().equals(funcidDefModel.getShareType()))
+                        .sorted(Comparator.comparing(FuncidDefModel::getOrderSeq))
+                        .collect(Collectors.toList());
+
+                // 当排序序号为负或0时,代表通用信息点
+                if (item.getOrderSeq()<=0){
+                    if (CollUtil.isEmpty(commonFuncidModels)){
+                        // 错误情况,根据特有信息点重置该信息点排序
+                        resetSelfFuncidSeq(selfFuncidModels,funcidDef,funcidDefList,item.getOrderSeq(),oldFuncId);
+                    }else {
+                        // 根据通用信息点重置该信息点排序
+                        resetCommonFuncidSeq(commonFuncidModels,funcidDef,funcidDefList,item.getOrderSeq(),oldFuncId);
+                    }
+                }else {
+                    // 当排序序号为正时,代表自定义信息点
+                    resetSelfFuncidSeq(selfFuncidModels,funcidDef,funcidDefList,item.getOrderSeq(),oldFuncId);
+                }
             }
             if(StringUtils.isEmpty(funcidDef.getShareType())){
                 //默认自定义信息点
@@ -595,11 +620,73 @@ public class FuncidDefChangeRecordService {
             }else{
                 funcidDef.setShareType(funcidDef.getShareType());
             }
-            funcidDef.setOrderSeq(funcidDef.getOrderSeq()+1);
             funcidDefList.add(funcidDef);
         });
         funcidDefRepository.saveAll(funcidDefList);
     }
+    /***
+     * Description: 重置通用信息点的排序序号
+     * @param commonFuncidModels : 通用信息点的数据
+     * @param funcidDef : 需要修改的信息点
+     * @param funcidDefList : 保存信息点的列表
+     * @return : void
+     * @author : lijie
+     * @date :2021/7/7 13:52
+     * Update By lijie 2021/7/7 13:52
+     */
+    private void resetCommonFuncidSeq(List<FuncidDefModel> commonFuncidModels,
+                                      FuncidDef funcidDef,
+                                      List<FuncidDef> funcidDefList,
+                                      Integer orderSeq,
+                                      String oldFuncId) {
+        if (CollUtil.isEmpty(commonFuncidModels)){
+            funcidDef.setOrderSeq(-1);
+            return;
+        }
+        int compareSeq = orderSeq+1;
+        if (orderSeq>=0){
+            compareSeq = -commonFuncidModels.size();
+        }
+        funcidDef.setOrderSeq(compareSeq-1);
+        for (FuncidDefModel defModel : commonFuncidModels) {
+            if (defModel.getOrderSeq()<compareSeq
+                    && (StrUtil.isNotBlank(oldFuncId) && !oldFuncId.equals(defModel.getId()))){
+                defModel.setOrderSeq(defModel.getOrderSeq()-1);
+                funcidDefList.add(FuncidDef.fromModel(defModel));
+            }
+        }
+    }
+
+    /***
+     * Description: 重置特有信息点的排序序号
+     * @param selfFuncidModels : 特有信息点的数据
+     * @param funcidDef : 需要修改的信息点
+     * @param funcidDefList : 保存信息点的列表
+     * @return : void
+     * @author : lijie
+     * @date :2021/7/7 13:52
+     * Update By lijie 2021/7/7 13:52
+     */
+    private void resetSelfFuncidSeq(List<FuncidDefModel> selfFuncidModels, FuncidDef funcidDef,
+                                    List<FuncidDef> funcidDefList, Integer orderSeq,String oldFuncId) {
+        if (CollUtil.isEmpty(selfFuncidModels)){
+            // 当特有信息点为空时,设置序号为1
+            funcidDef.setOrderSeq(1);
+            return;
+        }
+        int compareSeq = orderSeq;
+        if (orderSeq<=0){
+            compareSeq = 0;
+        }
+        funcidDef.setOrderSeq(compareSeq+1);
+        for (FuncidDefModel defModel : selfFuncidModels) {
+            if (defModel.getOrderSeq()>compareSeq
+                    && (StrUtil.isNotBlank(oldFuncId) && !oldFuncId.equals(defModel.getId()))){
+                defModel.setOrderSeq(defModel.getOrderSeq()+1);
+                funcidDefList.add(FuncidDef.fromModel(defModel));
+            }
+        }
+    }
 
     /**
      * 修改信息点位置

+ 1 - 1
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/service/FuncidDefService.java

@@ -148,7 +148,7 @@ public class FuncidDefService {
                     funcidCriteria.add("classCode", classDefModel.getCode());
                 }
                 List<FuncidDefModel> funcidDefModels = queryWithoutClassCode(funcidCriteria);
-                funcidDefModels.forEach(model -> model.setClassCode(classDefModel.getCode()));
+                //funcidDefModels.forEach(model -> model.setClassCode(classDefModel.getCode()));
                 list.addAll(funcidDefModels);
             }
         }

+ 38 - 14
dmp-rwd/pom.xml

@@ -158,8 +158,32 @@
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-resources</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <resources>
+                                <resource>
+                                    <directory>src/main/resources/</directory>
+                                    <includes>
+                                        <include>**/*.yml</include>
+                                    </includes>
+                                </resource>
+                            </resources>
+                            <outputDirectory>${project.build.directory}/config</outputDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
 
-            <!--拷贝资源文件 copy-resources-->
+            <!--拷贝资源文件 copy-resources
             <plugin>
                 <artifactId>maven-resources-plugin</artifactId>
                 <executions>
@@ -187,7 +211,7 @@
                             <outputDirectory>${project.build.directory}/config</outputDirectory>
                         </configuration>
                     </execution>
-                    <!--拷贝启动脚本-->
+                    &lt;!&ndash;&lt;!&ndash;拷贝启动脚本&ndash;&gt;
                     <execution>
                         <id>copy-version</id>
                         <phase>package</phase>
@@ -202,12 +226,12 @@
                             </resources>
                             <outputDirectory>${project.build.directory}</outputDirectory>
                         </configuration>
-                    </execution>
+                    </execution>&ndash;&gt;
                 </executions>
-            </plugin>
+            </plugin>-->
 
-            <!-- 按照测试要求打成zip需要的配置 -->
-            <!--获取git信息-->
+            <!--&lt;!&ndash; 按照测试要求打成zip需要的配置 &ndash;&gt;
+            &lt;!&ndash;获取git信息&ndash;&gt;
             <plugin>
                 <groupId>pl.project13.maven</groupId>
                 <artifactId>git-commit-id-plugin</artifactId>
@@ -222,19 +246,19 @@
                     <verbose>true</verbose>
                     <dateFormat>yyyyMMddHHmm</dateFormat>
                     <generateGitPropertiesFile>true</generateGitPropertiesFile>
-                    <!--<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>-->
+                    &lt;!&ndash;<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>&ndash;&gt;
                     <generateGitPropertiesFilename>target/git.properties</generateGitPropertiesFilename>
                 </configuration>
             </plugin>
 
-            <!-- 打包压缩 -->
+            &lt;!&ndash; 打包压缩 &ndash;&gt;
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-assembly-plugin</artifactId>
                 <executions>
                     <execution>
                         <id>make-assembly</id>
-                        <!-- 当执行mvn package时才会打包 -->
+                        &lt;!&ndash; 当执行mvn package时才会打包 &ndash;&gt;
                         <phase>package</phase>
                         <goals>
                             <goal>single</goal>
@@ -243,17 +267,17 @@
                             <finalName>
                                 ${project.artifactId}_${git.commit.time}_git_${git.branch}_${git.commit.id.abbrev}
                             </finalName>
-                            <!--不包含assembly id-->
+                            &lt;!&ndash;不包含assembly id&ndash;&gt;
                             <appendAssemblyId>false</appendAssemblyId>
-                            <!--输出路径-->
-                            <!--<outputDirectory>../target/co_search-${project.version}</outputDirectory>-->
+                            &lt;!&ndash;输出路径&ndash;&gt;
+                            &lt;!&ndash;<outputDirectory>../target/co_search-${project.version}</outputDirectory>&ndash;&gt;
                             <descriptors>
-                                <descriptor>src/script/zip.xml</descriptor>
+                                <descriptor>../script/zip.xml</descriptor>
                             </descriptors>
                         </configuration>
                     </execution>
                 </executions>
-            </plugin>
+            </plugin>-->
         </plugins>
     </build>
 

+ 36 - 0
docker/dockerfiles/dmp-rwd/Dockerfile

@@ -0,0 +1,36 @@
+#构建此镜像的基础镜像
+FROM java:8-jre
+#指定作者名称
+MAINTAINER lijie<lijie@persagy.com>
+
+#定义标签属性
+LABEL tier=backend
+LABEL product=dmp
+LABEL project=dmp-rwd
+LABEL name=数据中台-rwd
+
+#设置环境变量
+ENV JAVA_OPTS -Dfile.encoding=UTF-8 -Xms2048m -Xmx2048m
+ENV TZ Asia/Shanghai
+#ARG 可以接收docker build命令中以--build-arg 指定的参数
+ARG WORKER_HOME
+
+#执行的命令
+RUN apt-get install -y --no-install-recommends tzdata && rm -rf /var/lib/apt/lists/*
+RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime	&& echo 'Asia/Shanghai' > /etc/timezone
+
+RUN mkdir -p $WORKER_HOME/config
+
+#复制文件到容器内
+COPY *.jar $WORKER_HOME/app.jar
+COPY entrypoint.sh $WORKER_HOME/
+COPY version.txt $WORKER_HOME/
+COPY config/* $WORKER_HOME/config/
+#设置工作目录
+WORKDIR $WORKER_HOME
+
+#查看上述复制的文件,是否复制成功
+RUN ls
+
+#启动执行
+ENTRYPOINT ["sh","./entrypoint.sh"]

+ 3 - 0
docker/dockerfiles/dmp-rwd/entrypoint.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+echo "entrypoint run..."
+java -jar $JAVA_OPTS -Dcsp.sentinel.dashboard.server=$SENTINEL_DASHBOARD_SERVER -Dcsp.sentinel.api.port=$SENTINEL_LOCAL_API_PORT -Dcsp.sentinel.heartbeat.client.ip=$SENTINEL_HEARTBEAT_CLIENT_IP app.jar

+ 67 - 0
docker/k8sfiles/dmp-rwd.yml

@@ -0,0 +1,67 @@
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: dmp-rwd
+  labels:
+    app: dmp-rwd
+spec:
+  selector:
+    app: dmp-rwd
+  ports:
+  - port: 8832
+    targetPort: 8832
+    name: server-port
+
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: dmp-rwd
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      app: dmp-rwd
+  template:
+    metadata:
+      labels:
+        app: dmp-rwd
+    spec:
+      containers:
+      - name: dmp-rwd
+        image: labisenlin.persagy.com/library/dmp-rwd:4.0.12
+        imagePullPolicy: Always
+        ports:
+        - containerPort: 8832
+          name: server-port
+        env:
+        - name: TZ
+          value: Asia/Shanghai
+        - name: SERVER_PORT
+          value: "8832"
+        - name: SENTINEL_HEARTBEAT_CLIENT_IP
+          valueFrom:
+            configMapKeyRef:
+              name: dmp-rwd
+              key: sentinel.heartbeat.client.ip
+        - name: SENTINEL_DASHBOARD_SERVER
+          valueFrom:
+            configMapKeyRef:
+              name: dmp-rwd
+              key: sentinel.dashboard.server
+        - name: SENTINEL_LOCAL_API_PORT
+          valueFrom:
+            configMapKeyRef:
+              name: dmp-rwd
+              key: sentinel.local.api.port
+        - name: EUREKA_CLIENT_DEFAULT_ZONE
+          valueFrom:
+            configMapKeyRef:
+              name: dmp-rwd
+              key: eureka.client.default.zone
+        - name: EUREKA_INSTANCE_IP_ADDRESS
+          valueFrom:
+            configMapKeyRef:
+              name: dmp-rwd
+              key: eureka.instance.ip.address