Commit 67a1a324 authored by “yiyousong”'s avatar “yiyousong”
parents 7969d656 bf828e28
This diff is collapsed.
......@@ -32,4 +32,9 @@ public class AppVo extends BaseEntityLong {
*/
private String appIconUrl;
private String serverName;
private Integer serverPort;
}
\ No newline at end of file
package com.mortals.xhx.module.app.service.impl;
import cn.hutool.core.lang.Validator;
import cn.hutool.core.net.url.UrlBuilder;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
......@@ -110,20 +111,25 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
item.setSiteIdList(appEntityList.stream().map(AppEntity::getSiteId).collect(Collectors.toList()));
//构建访问地址
SiteEntity siteEntity = siteService.getCache(item.getSiteId().toString());
String domainUrl = GlobalSysInfo.getParamValue(Constant.PARAM_SERVER_HTTP_URL, "http://192.168.0.98:11078");
// String domainUrl = GlobalSysInfo.getParamValue(Constant.PARAM_SERVER_HTTP_URL, "http://192.168.0.98:11078");
String domainUrl = "";
if (!ObjectUtils.isEmpty(params.getServerName()) && Validator.isIpv4(params.getServerName())) {
domainUrl = UrlBuilder.ofHttp(params.getServerName()).setPort(params.getServerPort() > 0 ? params.getServerPort() : 11078).build();
}
if (!ObjectUtils.isEmpty(siteEntity)) {
//请求地址 http://domian/app/siteCode/appcode/html
item.setCustUrl(UrlBuilder.of(domainUrl)
item.setCustUrl(UrlBuilder.ofHttp(params.getServerName()).setPort(params.getServerPort() > 0 ? params.getServerPort() : 11078)
.addPath(CUSTAPP_ROOT_PATH)
.addPath(siteEntity.getSiteCode())
.addPath(item.getAppCode())
.addPath(item.getVersion().toString())
.toString());
.build());
} else {
item.setCustUrl("");
}
//构建图标地址
item.setAppIconUrl(UrlBuilder.of(domainUrl)
item.setAppIconUrl(UrlBuilder.ofHttp(params.getServerName()).setPort(params.getServerPort() > 0 ? params.getServerPort() : 11078)
.addPath(item.getAppIconPath()).build());
});
super.findAfter(params, pageInfo, context, list);
......@@ -325,7 +331,7 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
entity.setFileName(null);
//判断如果应用下架,通知自助服务终端
if(entity.getShelves()==YesNoEnum.NO.getValue()){
if (entity.getShelves() == YesNoEnum.NO.getValue()) {
AppPdu appPdu = new AppPdu();
appPdu.setAppId(entity.getId());
appFeign.forbidden(appPdu);
......
......@@ -2,10 +2,12 @@ package com.mortals.xhx.module.app.web;
import cn.hutool.core.net.url.UrlBuilder;
import cn.hutool.core.util.ZipUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.AppTypeEnum;
......@@ -17,6 +19,7 @@ import com.mortals.xhx.module.app.service.AppService;
import com.mortals.xhx.module.site.model.SiteEntity;
import com.mortals.xhx.module.site.model.SiteQuery;
import com.mortals.xhx.module.site.service.SiteService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -38,6 +41,7 @@ import static com.mortals.xhx.common.key.Constant.CUSTAPP_ROOT_PATH;
*/
@RestController
@RequestMapping("app")
@Slf4j
public class AppController extends BaseCRUDJsonBodyMappingController<AppService, AppEntity, Long> {
@Autowired
......@@ -53,11 +57,29 @@ 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, "distribute", YesNoEnum.getEnumMap());
this.addDict(model, "dateUpdate", YesNoEnum.getEnumMap());
super.init(model, context);
}
/**
* @param query
* @param model
* @param context
* @throws AppException
*/
@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);
query.setServerName(serverName);
query.setServerPort(serverPort);
super.doListBefore(query, model, context);
}
@Override
protected int infoAfter(Long id, Map<String, Object> model, AppEntity entity, Context context) throws AppException {
List<AppEntity> appEntityList = this.service.find(new AppQuery().appCode(entity.getAppCode()), context);
......
......@@ -38,24 +38,6 @@ public class BusinessMatterServiceImpl extends AbstractCRUDServiceImpl<BusinessM
}
}
/**
* @param list
* @param context
* @throws AppException
*/
@Override
protected void saveBefore(List<BusinessMatterEntity> list, Context context) throws AppException {
//批量校验列表 如果存在 则剔除
Iterator<BusinessMatterEntity> iterator = list.iterator();
while (iterator.hasNext()) {
BusinessMatterEntity next = iterator.next();
int count = this.getDao().getCount(new BusinessMatterQuery().siteBusinessId(next.getSiteBusinessId()).matterId(next.getMatterId()));
if(count>0){
iterator.remove();
}
}
super.saveBefore(list, context);
}
@Override
public Result<BusinessMatterEntity> getListByBusiness(BusinessMatterQuery query, PageInfo pageInfo, Context context) {
......
......@@ -45,6 +45,22 @@ Content-Type: application/json
client.global.set("BusinessMatter_id", JSON.parse(response.body).data.id);
%}
###业务事项关联更新与保存
POST {{baseUrl}}/business/matter/batchSave
Authorization: {{authToken}}
Content-Type: application/json
[{
"siteId":1,
"siteName":"w19oxc",
"siteBusinessId":11,
"siteBusinessName":"ujaud2",
"matterId":34034,
"matterName":"iajw6p"
}]
###业务事项关联查看
GET {{baseUrl}}/business/matter/info?id={{BusinessMatter_id}}
Accept: application/json
......
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