Commit 5c96587f authored by 赵啸非's avatar 赵啸非

添加应用配置列表

parent 11a09b24
Pipeline #2888 failed with stages
......@@ -27,6 +27,9 @@ import com.mortals.xhx.feign.base.pdu.DeptPdu;
import com.mortals.xhx.feign.base.pdu.SitePdu;
import com.mortals.xhx.feign.rsp.ApiResp;
import com.mortals.xhx.feign.site.ISiteFeign;
import com.mortals.xhx.module.app.model.AppConfigEntity;
import com.mortals.xhx.module.app.model.AppConfigQuery;
import com.mortals.xhx.module.app.service.AppConfigService;
import com.mortals.xhx.module.baseset.model.BasesetEntity;
import com.mortals.xhx.module.baseset.model.BasesetQuery;
import com.mortals.xhx.module.baseset.service.BasesetService;
......@@ -72,6 +75,8 @@ public class HomeController extends BaseJsonBodyController {
private MatterDatumPrintService matterDatumPrintService;
@Autowired
private DeviceMatterDatumService deviceMatterDatumService;
@Autowired
private AppConfigService appConfigService;
@PostMapping({"site/list"})
......@@ -314,7 +319,7 @@ public class HomeController extends BaseJsonBodyController {
matterQuery.setIsRecommend(YesNoEnum.YES.getValue());
List<MatterEntity> matterList = matterService.find(matterQuery, this.getContext());
matterList= matterList.stream().map(m->{
matterList = matterList.stream().map(m -> {
MatterEntity matterEntity = new MatterEntity();
matterEntity.setMatterName(m.getMatterName());
matterEntity.setId(m.getId());
......@@ -394,7 +399,7 @@ public class HomeController extends BaseJsonBodyController {
ret.setData(model);
ret.setDict(model.get("dict"));
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
// log.info("home resp:{}", JSON.toJSONString(ret));
// log.info("home resp:{}", JSON.toJSONString(ret));
return ret;
}
......@@ -410,32 +415,57 @@ public class HomeController extends BaseJsonBodyController {
Integer serverPort = DataUtil.converStr2Int(request.getHeader("server-port"), 0);
log.info("【应用请求】【请求体】-->serverName{} ,port:{}", serverName, serverPort);
String appWhiteStr = GlobalSysInfo.getParamValue(Constant.PARAMS_WHITE_APP_LIST, "中心简介,办事指南,意见建议,通知公告");
Set<String> appWhiteSet = StrUtil.split(appWhiteStr, ",").stream().collect(Collectors.toSet());
Rest<List<AppPdu>> ret = new Rest();
List<AppPdu> collect = new ArrayList<>();
int code = VALUE_RESULT_SUCCESS;
try {
AppConfigQuery query = new AppConfigQuery();
query.setSiteId(siteId);
query.setOrderColList(Arrays.asList(new OrderCol("order")));
List<AppConfigEntity> appConfigEntities = appConfigService.find(query);
if (!ObjectUtils.isEmpty(appConfigEntities)) {
List<Long> AppIdList = appConfigEntities.stream().map(item -> item.getAppId()).collect(Collectors.toList());
AppPdu appPdu = new AppPdu();
appPdu.setSiteId(siteId);
appPdu.setIdList(AppIdList);
appPdu.setSize(-1);
appPdu.setType(1);
Rest<RespData<List<AppPdu>>> appRest = appFeign.list(appPdu);
String domainUrl = UrlBuilder.ofHttp(serverName).setPort(serverPort > 0 ? serverPort : 11078).build();
/// String domainUrl1 = StrUtil.sub(domainUrl, 0, domainUrl.length());
log.info("appRest:" + JSON.toJSONString(appRest));
log.info("domainUrl:" + domainUrl);
if (appRest.getCode() == YesNoEnum.YES.getValue()) {
collect = appRest.getData().getData().stream().filter(f -> appWhiteSet.contains(f.getAppName()))
collect = appRest.getData().getData().stream()
.peek(item -> {
item.setCustUrl(UrlBuilder.ofHttp(domainUrl).addPath(item.getCustUrl()).build());
log.info(item.getCustUrl());
log.info(item.getAppIconPath());
}).collect(Collectors.toList());
}
} catch (Exception e) {
code = VALUE_RESULT_FAILURE;
} else {
String appWhiteStr = GlobalSysInfo.getParamValue(Constant.PARAMS_WHITE_APP_LIST, "中心简介,办事指南,意见建议,通知公告");
Set<String> appWhiteSet = StrUtil.split(appWhiteStr, ",").stream().collect(Collectors.toSet());
try {
AppPdu appPdu = new AppPdu();
appPdu.setSiteId(siteId);
appPdu.setSize(-1);
appPdu.setType(1);
Rest<RespData<List<AppPdu>>> appRest = appFeign.list(appPdu);
String domainUrl = UrlBuilder.ofHttp(serverName).setPort(serverPort > 0 ? serverPort : 11078).build();
log.info("appRest:" + JSON.toJSONString(appRest));
log.info("domainUrl:" + domainUrl);
if (appRest.getCode() == YesNoEnum.YES.getValue()) {
collect = appRest.getData().getData().stream().filter(f -> appWhiteSet.contains(f.getAppName()))
.peek(item -> {
item.setCustUrl(UrlBuilder.ofHttp(domainUrl).addPath(item.getCustUrl()).build());
log.info(item.getCustUrl());
log.info(item.getAppIconPath());
}).collect(Collectors.toList());
}
} catch (Exception e) {
code = VALUE_RESULT_FAILURE;
}
}
ret.setCode(code);
ret.setData(collect);
......
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