|
@@ -29,6 +29,8 @@ public class PropertyService extends ServiceImpl<PropertyItemDao, PropertyItem>
|
|
|
|
|
|
private static final String APP_VERSION_KEY = "com.qmth.solar.app-version";
|
|
private static final String APP_VERSION_KEY = "com.qmth.solar.app-version";
|
|
|
|
|
|
|
|
+ private static final String APP_CODE_KEY = "com.qmth.solar.app-code";
|
|
|
|
+
|
|
@Resource
|
|
@Resource
|
|
private EnvService envService;
|
|
private EnvService envService;
|
|
|
|
|
|
@@ -215,7 +217,7 @@ public class PropertyService extends ServiceImpl<PropertyItemDao, PropertyItem>
|
|
.eq(PropertyItem::getKey, key));
|
|
.eq(PropertyItem::getKey, key));
|
|
}
|
|
}
|
|
|
|
|
|
- public List<PropertyItem> mergePropertyList(Version version, Long moduleId, Long envId) {
|
|
|
|
|
|
+ public List<PropertyItem> mergePropertyList(String appCode, Version version, Long moduleId, Long envId) {
|
|
List<PropertyItem> list = listBaseline(version.getId(), moduleId);
|
|
List<PropertyItem> list = listBaseline(version.getId(), moduleId);
|
|
//获取环境定义配置项
|
|
//获取环境定义配置项
|
|
Map<String, PropertyItem> itemMap = listPropertyItem(version.getId(), moduleId, envId).stream()
|
|
Map<String, PropertyItem> itemMap = listPropertyItem(version.getId(), moduleId, envId).stream()
|
|
@@ -237,15 +239,24 @@ public class PropertyService extends ServiceImpl<PropertyItemDao, PropertyItem>
|
|
if (!itemMap.isEmpty()) {
|
|
if (!itemMap.isEmpty()) {
|
|
list.addAll(itemMap.values());
|
|
list.addAll(itemMap.values());
|
|
}
|
|
}
|
|
- //强制增加版本配置项,自动根据当前version填充
|
|
|
|
|
|
+ //强制增加appCode与appVersion配置项,自动根据当前app和version填充
|
|
|
|
+ boolean hasCode = false;
|
|
boolean hasVersion = false;
|
|
boolean hasVersion = false;
|
|
for (PropertyItem item : list) {
|
|
for (PropertyItem item : list) {
|
|
- if (item.getKey().equals(APP_VERSION_KEY)) {
|
|
|
|
|
|
+ if (item.getKey().equals(APP_CODE_KEY)) {
|
|
|
|
+ item.setValue(appCode);
|
|
|
|
+ hasCode = true;
|
|
|
|
+ } else if (item.getKey().equals(APP_VERSION_KEY)) {
|
|
item.setValue(version.getName());
|
|
item.setValue(version.getName());
|
|
hasVersion = true;
|
|
hasVersion = true;
|
|
- break;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if (!hasCode) {
|
|
|
|
+ PropertyItem item = new PropertyItem();
|
|
|
|
+ item.setKey(APP_CODE_KEY);
|
|
|
|
+ item.setValue(appCode);
|
|
|
|
+ list.add(item);
|
|
|
|
+ }
|
|
if (!hasVersion) {
|
|
if (!hasVersion) {
|
|
PropertyItem item = new PropertyItem();
|
|
PropertyItem item = new PropertyItem();
|
|
item.setKey(APP_VERSION_KEY);
|
|
item.setKey(APP_VERSION_KEY);
|