Commit 55d41ffd authored by xj's avatar xj
parents 6294bedf 38604704
......@@ -43,5 +43,6 @@ public interface ParamService extends ICRUDCacheService<ParamEntity, Long>, IPar
* @return
*/
Map<String, String> getParamBySecondOrganize(String firstOrganize,String secondOrganize, String... excludeParamKeys);
Map<String, String> getParamBySecondOrganizeOrder(String firstOrganize,String secondOrganize, String... excludeParamKeys);
}
\ No newline at end of file
......@@ -12,9 +12,7 @@ import com.mortals.xhx.base.system.param.model.ParamEntity;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -76,6 +74,18 @@ public class ParamServiceImpl extends AbstractCRUDCacheServiceImpl<ParamDao, Par
}
public Map<String, String> getParamBySecondOrganizeOrder(String firstOrganize, String secondOrganize, String... excludeParamKeys) {
List<ParamEntity> list = this.getCacheList();
return list.stream()
.filter(f -> firstOrganize.equals(f.getFirstOrganize()))
.filter(f -> secondOrganize.equals(f.getSecondOrganize()))
.filter(s ->
!Arrays.asList(excludeParamKeys).contains(s.getParamKey())
).sorted(Comparator.comparing(ParamEntity::getDisplayType)).collect(Collectors.toMap(x -> x.getParamKey(), y -> y.getParamValue(), (o, n) -> n, LinkedHashMap::new));
}
@Override
public boolean needRefresh() {
if (super.cacheService.isShareCache()) {
......
......@@ -57,7 +57,7 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "type", AppTypeEnum.getEnumMap());
this.addDict(model, "shelves", paramService.getParamBySecondOrganize("App", "shelves"));
this.addDict(model, "appThemeName", paramService.getParamBySecondOrganize("App", "appThemeName"));
this.addDict(model, "appThemeName", paramService.getParamBySecondOrganizeOrder("App", "appThemeName"));
this.addDict(model, "distribute", YesNoEnum.getEnumMap());
this.addDict(model, "dateUpdate", YesNoEnum.getEnumMap());
super.init(model, context);
......@@ -73,8 +73,8 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
@Override
protected void doListBefore(AppEntity query, Map<String, Object> model, Context context) throws AppException {
String serverName = request.getHeader("server-name");
Integer serverPort = DataUtil.converStr2Int(request.getHeader("server-port"),0);
log.info("【应用请求】【请求体】-->serverName{} ,port:{}",serverName ,serverPort);
Integer serverPort = DataUtil.converStr2Int(request.getHeader("server-port"), 0);
log.info("【应用请求】【请求体】-->serverName{} ,port:{}", serverName, serverPort);
query.setServerName(serverName);
query.setServerPort(serverPort);
super.doListBefore(query, model, context);
......@@ -86,7 +86,7 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
entity.setApplianceSiteScope(appEntityList.size());
entity.setSiteIdList(appEntityList.stream().map(AppEntity::getSiteId).collect(Collectors.toList()));
SiteEntity siteEntity = siteService.getCache(entity.getSiteId().toString());
if(!ObjectUtils.isEmpty(siteEntity)){
if (!ObjectUtils.isEmpty(siteEntity)) {
//请求地址 http://domian/app/siteCode/appcode/html
String domainUrl = GlobalSysInfo.getParamValue(Constant.PARAM_SERVER_HTTP_URL, "http://192.168.0.98:11078");
entity.setCustUrl(UrlBuilder.of(domainUrl)
......@@ -95,7 +95,7 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
.addPath(entity.getAppCode())
.addPath(entity.getVersion().toString())
.toString());
}else{
} else {
entity.setCustUrl("");
}
return super.infoAfter(id, model, entity, context);
......@@ -169,11 +169,6 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
}
public static void main(String[] args) {
......@@ -182,7 +177,7 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
String s = UrlBuilder.of(domainUrl).addPath("app").addPath("1").addPath("2").toString();
System.out.println(s);*/
ZipUtil.unzip("F://1672973316144.zip","E://abc");
ZipUtil.unzip("F://1672973316144.zip", "E://abc");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment