Commit 39f047eb authored by 廖旭伟's avatar 廖旭伟

测试问题修改

parent a09984bb
package com.mortals.xhx.base.framework.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.AntPathMatcher;
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
//@Configuration
public class WebConfig extends WebMvcConfigurationSupport {
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
AntPathMatcher matcher = new AntPathMatcher();
matcher.setCaseSensitive(false);
configurer.setPathMatcher(matcher);
}
}
......@@ -35,7 +35,7 @@ public interface IApiModelFeign extends IFeign {
* @return
*/
@PostMapping(value = "/site/list/allInfo")
ApiResp<List<SiteFeignVO>> getSitesAllInfoByQuery(@RequestBody SitePdu query);
String getSitesAllInfoByQuery(@RequestBody SitePdu query);
/***
* 站点模块列表
......@@ -43,7 +43,7 @@ public interface IApiModelFeign extends IFeign {
* @return
*/
@PostMapping(value = "model/list/noPage")
ApiResp<List<ModelFeignVO>> getModelByQuery(@RequestBody ModelPdu query);
String getModelByQuery(@RequestBody ModelPdu query);
/***
* 站点模块列表
......@@ -51,7 +51,7 @@ public interface IApiModelFeign extends IFeign {
* @return
*/
@PostMapping(value = "model/list/bySite")
ApiResp<List<ModelFeignVO>> getModelBySiteId(@RequestBody ModelPdu query);
String getModelBySiteId(@RequestBody ModelPdu query);
/***
* 站点模块列表
......@@ -66,10 +66,10 @@ public interface IApiModelFeign extends IFeign {
* @return
*/
@PostMapping(value = "model/census/list/noPage")
ApiResp<List<ModelCensusFeignVO>> getModelCensusByQuery(@RequestBody ModelPdu query);
String getModelCensusByQuery(@RequestBody ModelPdu query);
@PostMapping(value = "model/census/list/bySite")
ApiResp<List<ModelCensusFeignVO>> getModelCensusBySiteId(@RequestBody ModelPdu query);
String getModelCensusBySiteId(@RequestBody ModelPdu query);
......@@ -93,19 +93,19 @@ class ModelFeignFallbackFactory implements FallbackFactory<IApiModelFeign> {
}
@Override
public ApiResp<List<ModelFeignVO>> getModelByQuery(ModelPdu query) {
public String getModelByQuery(ModelPdu query) {
ApiResp<List<ModelFeignVO>> failResp = new ApiResp<>();
failResp.setCode(ApiRespCodeEnum.FAILED.getValue());
failResp.setMsg("暂时无法获取站点模块列表,请稍后再试!");
return failResp;
return JSON.toJSONString(failResp);
}
@Override
public ApiResp<List<ModelFeignVO>> getModelBySiteId(ModelPdu query) {
public String getModelBySiteId(ModelPdu query) {
ApiResp<List<ModelFeignVO>> failResp = new ApiResp<>();
failResp.setCode(ApiRespCodeEnum.FAILED.getValue());
failResp.setMsg("暂时无法获取站点模块列表,请稍后再试!");
return failResp;
return JSON.toJSONString(failResp);
}
@Override
......@@ -117,27 +117,27 @@ class ModelFeignFallbackFactory implements FallbackFactory<IApiModelFeign> {
}
@Override
public ApiResp<List<ModelCensusFeignVO>> getModelCensusByQuery(ModelPdu query) {
public String getModelCensusByQuery(ModelPdu query) {
ApiResp<List<ModelCensusFeignVO>> failResp = new ApiResp<>();
failResp.setCode(ApiRespCodeEnum.FAILED.getValue());
failResp.setMsg("暂时无法获取站点模块数据统计列表,请稍后再试!");
return failResp;
return JSON.toJSONString(failResp);
}
@Override
public ApiResp<List<ModelCensusFeignVO>> getModelCensusBySiteId(ModelPdu query) {
public String getModelCensusBySiteId(ModelPdu query) {
ApiResp<List<ModelCensusFeignVO>> failResp = new ApiResp<>();
failResp.setCode(ApiRespCodeEnum.FAILED.getValue());
failResp.setMsg("暂时无法获取站点模块数据统计列表,请稍后再试!");
return failResp;
return JSON.toJSONString(failResp);
}
@Override
public ApiResp<List<SiteFeignVO>> getSitesAllInfoByQuery(SitePdu query) {
public String getSitesAllInfoByQuery(SitePdu query) {
ApiResp<List<SiteFeignVO>> failResp = new ApiResp<>();
failResp.setCode(ApiRespCodeEnum.FAILED.getValue());
failResp.setMsg("暂时无法获取站点模块列表,请稍后再试!");
return failResp;
return JSON.toJSONString(failResp);
}
};
}
......
package com.mortals.xhx.module.menu.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.code.YesNo;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
......@@ -273,10 +275,10 @@ public class MenuServiceImpl extends AbstractCRUDServiceImpl<MenuDao, MenuEntity
}
List<MenuNodeVO> tree = creatMenuNodeTree(nodeList);
tree.forEach(item->{
if(item.getNodeName()=="数据管理"){
if(item.getNodeName().equals("数据管理")){
item.setChildList(creatCensus(item.getNodeId()));
}
if(item.getNodeName()=="站点编排"){
if(item.getNodeName().equals("站点编排")){
item.setChildList(creatModel(item.getNodeId()));
}
});
......@@ -292,12 +294,15 @@ public class MenuServiceImpl extends AbstractCRUDServiceImpl<MenuDao, MenuEntity
private List<MenuNodeVO> creatModel(Long nodeId){
ModelPdu modelPdu = new ModelPdu();
ApiResp<List<ModelFeignVO>> apiResp = apiModelFeign.getModelByQuery(modelPdu);
//ApiResp<List<ModelFeignVO>> apiResp = apiModelFeign.getModelByQuery(modelPdu);
String resp = apiModelFeign.getModelByQuery(modelPdu);
ApiResp<JSONObject> apiResp = JSON.parseObject(resp, ApiResp.class);
if (apiResp.getCode() != YesNoEnum.YES.getValue()) {
throw new AppException("获取站点列表信息失败:" + apiResp.getMsg());
}
List<ModelFeignVO> modelFeignVOS = JSONObject.parseArray(apiResp.getData().get("data").toString(),ModelFeignVO.class);
List<MenuNodeVO> nodeList = new ArrayList<>();
apiResp.getData().stream().forEach(item->{
modelFeignVOS.stream().forEach(item->{
MenuNodeVO nodeVO = new MenuNodeVO(item.getModelName(),item.getId(),nodeId);
nodeList.add(nodeVO);
});
......@@ -306,12 +311,15 @@ public class MenuServiceImpl extends AbstractCRUDServiceImpl<MenuDao, MenuEntity
private List<MenuNodeVO> creatCensus(Long nodeId){
ModelPdu modelPdu = new ModelPdu();
ApiResp<List<ModelCensusFeignVO>> apiResp = apiModelFeign.getModelCensusByQuery(modelPdu);
//ApiResp<List<ModelCensusFeignVO>> apiResp = apiModelFeign.getModelCensusByQuery(modelPdu);
String resp = apiModelFeign.getModelCensusByQuery(modelPdu);
ApiResp<JSONObject> apiResp = JSON.parseObject(resp, ApiResp.class);
if (apiResp.getCode() != YesNoEnum.YES.getValue()) {
throw new AppException("获取所有数据管理列表信息失败:" + apiResp.getMsg());
}
List<ModelCensusFeignVO> modelCensusFeignVOS = JSONObject.parseArray(apiResp.getData().get("data").toString(),ModelCensusFeignVO.class);
List<MenuNodeVO> nodeList = new ArrayList<>();
apiResp.getData().stream().forEach(item->{
modelCensusFeignVOS.stream().forEach(item->{
MenuNodeVO nodeVO = new MenuNodeVO(item.getCensusName(),item.getId(),nodeId);
nodeList.add(nodeVO);
});
......
package com.mortals.xhx.module.model;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
......@@ -44,11 +46,13 @@ public class ModelController extends BaseJsonBodyController {
int code=1;
try {
ModelPdu modelPdu = new ModelPdu();
ApiResp<List<ModelFeignVO>> apiResp = apiModelFeign.getModelByQuery(modelPdu);
//ApiResp<List<ModelFeignVO>> apiResp = apiModelFeign.getModelByQuery(modelPdu);
String resp = apiModelFeign.getModelByQuery(modelPdu);
ApiResp<JSONObject> apiResp = JSON.parseObject(resp, ApiResp.class);
if (apiResp.getCode() != YesNoEnum.YES.getValue()) {
throw new AppException("获取站点列表信息失败:" + apiResp.getMsg());
}
model.put("data", apiResp.getData());
model.put("data", apiResp.getData().get("data"));
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var9) {
......@@ -76,7 +80,9 @@ public class ModelController extends BaseJsonBodyController {
try {
ModelPdu modelPdu = new ModelPdu();
modelPdu.setSiteId(query.getSiteId());
ApiResp<List<ModelFeignVO>> apiResp = apiModelFeign.getModelBySiteId(modelPdu);
//ApiResp<List<ModelFeignVO>> apiResp = apiModelFeign.getModelBySiteId(modelPdu);
String resp = apiModelFeign.getModelBySiteId(modelPdu);
ApiResp<JSONObject> apiResp = JSON.parseObject(resp, ApiResp.class);
if (apiResp.getCode() != YesNoEnum.YES.getValue()) {
throw new AppException("获取站点列表信息失败:" + apiResp.getMsg());
}
......@@ -84,7 +90,7 @@ public class ModelController extends BaseJsonBodyController {
throw new AppException("未登录或者登录过期");
}
Map<Long,Long> map = roleModelService.getModelIdsUserId(this.getCurUser().getId());
List<ModelFeignVO> modelFeignVOList = apiResp.getData();
List<ModelFeignVO> modelFeignVOList = JSONObject.parseArray(apiResp.getData().get("data").toString(),ModelFeignVO.class);
List<ModelFeignVO> list = modelFeignVOList.stream().filter(item->map.containsKey(item.getId())).collect(Collectors.toList());
model.put("data", list);
model.put("message_info", busiDesc + "成功");
......@@ -114,7 +120,9 @@ public class ModelController extends BaseJsonBodyController {
try {
ModelPdu modelPdu = new ModelPdu();
modelPdu.setSiteId(query.getSiteId());
ApiResp<List<ModelCensusFeignVO>> apiResp = apiModelFeign.getModelCensusBySiteId(modelPdu);
//ApiResp<List<ModelCensusFeignVO>> apiResp = apiModelFeign.getModelCensusBySiteId(modelPdu);
String resp = apiModelFeign.getModelCensusBySiteId(modelPdu);
ApiResp<JSONObject> apiResp = JSON.parseObject(resp, ApiResp.class);
if (apiResp.getCode() != YesNoEnum.YES.getValue()) {
throw new AppException("获取站点数据管理列表信息失败:" + apiResp.getMsg());
}
......@@ -122,7 +130,7 @@ public class ModelController extends BaseJsonBodyController {
throw new AppException("未登录或者登录过期");
}
Map<Long,Long> map = roleModelService.getModelCensusByUserId(this.getCurUser().getId());
List<ModelCensusFeignVO> modelFeignVOList = apiResp.getData();
List<ModelCensusFeignVO> modelFeignVOList = JSONObject.parseArray(apiResp.getData().get("data").toString(),ModelCensusFeignVO.class);
List<ModelCensusFeignVO> list = modelFeignVOList.stream().filter(item->map.containsKey(item.getId())).collect(Collectors.toList());
Map<String, List<ModelCensusFeignVO>> resultList = list.stream().collect(Collectors.groupingBy(item->{ return "CensusType_"+item.getCensusType();}));
model.put("data", resultList);
......@@ -151,11 +159,13 @@ public class ModelController extends BaseJsonBodyController {
int code=1;
try {
ModelPdu modelPdu = new ModelPdu();
ApiResp<List<ModelCensusFeignVO>> apiResp = apiModelFeign.getModelCensusByQuery(modelPdu);
//ApiResp<List<ModelCensusFeignVO>> apiResp = apiModelFeign.getModelCensusByQuery(modelPdu);
String resp = apiModelFeign.getModelCensusByQuery(modelPdu);
ApiResp<JSONObject> apiResp = JSON.parseObject(resp, ApiResp.class);
if (apiResp.getCode() != YesNoEnum.YES.getValue()) {
throw new AppException("获取所有数据管理列表信息失败:" + apiResp.getMsg());
}
model.put("data", apiResp.getData());
model.put("data", apiResp.getData().get("data"));
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var9) {
......
package com.mortals.xhx.module.role.web;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
......@@ -64,11 +66,14 @@ public class RoleModelController extends BaseCRUDJsonBodyMappingController<RoleM
List<Long> ids = siteIdList.stream().map(s -> DataUtil.converStr2Long(s.trim(),0)).collect(Collectors.toList());
SitePdu sitePdu =new SitePdu();
sitePdu.setIdList(ids);
ApiResp<List<SiteFeignVO>> apiResp = apiModelFeign.getSitesAllInfoByQuery(sitePdu);
//ApiResp<List<SiteFeignVO>> apiResp = apiModelFeign.getSitesAllInfoByQuery(sitePdu);
String resp = apiModelFeign.getSitesAllInfoByQuery(sitePdu);
ApiResp<JSONObject> apiResp = JSON.parseObject(resp, ApiResp.class);
if (apiResp.getCode() != YesNoEnum.YES.getValue()) {
throw new AppException("获取站点列表信息失败:" + apiResp.getMsg());
}
model.put("data", apiResp.getData());
model.put("data", apiResp.getData().get("data"));
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var9) {
......
......@@ -23,7 +23,7 @@
a.roleId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('modelIds') or colPickMode == 1 and data.containsKey('modelIds')))">
a.modelId,
a.modelIds,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('censusIds') or colPickMode == 1 and data.containsKey('censusIds')))">
a.censusIds,
......@@ -90,7 +90,7 @@
</choose>
</foreach>
</trim>
<trim prefix="modelId=(case" suffix="ELSE modelId end),">
<trim prefix="modelIds=(case" suffix="ELSE modelIds end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('modelIds')) or (colPickMode==1 and !item.containsKey('modelIds'))">
when a.id=#{item.id} then #{item.modelIds}
......
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