Commit 661c8adf authored by 赵啸非's avatar 赵啸非

添加站点业务备注

parent 6c147def
...@@ -60,6 +60,7 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu ...@@ -60,6 +60,7 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
item.setDatashow(businessEntity.getDatashow()); item.setDatashow(businessEntity.getDatashow());
item.setEnglishname(businessEntity.getEnglishname()); item.setEnglishname(businessEntity.getEnglishname());
item.setBusinessType(businessEntity.getBusinessType()); item.setBusinessType(businessEntity.getBusinessType());
item.setRemark(businessEntity.getRemark());
//判断业务是否含有子业务 //判断业务是否含有子业务
if (businessEntity.getIsBusiness() == IsBusinessEnum.一级业务.getValue()) { if (businessEntity.getIsBusiness() == IsBusinessEnum.一级业务.getValue()) {
//添加二级业务列表 //添加二级业务列表
......
package com.mortals.xhx.feign.area; package com.mortals.xhx.feign.area;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.mortals.xhx.common.code.ApiRespCodeEnum; import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.pdu.SitePdu; import com.mortals.xhx.common.pdu.SitePdu;
import com.mortals.xhx.feign.IFeign; import com.mortals.xhx.feign.IFeign;
import com.mortals.xhx.module.area.model.AreaEntity; import com.mortals.xhx.module.area.model.AreaEntity;
import com.mortals.xhx.feign.rsp.ApiResp;
import feign.hystrix.FallbackFactory; import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
...@@ -42,6 +41,25 @@ public interface IApiAreaFeign extends IFeign { ...@@ -42,6 +41,25 @@ public interface IApiAreaFeign extends IFeign {
String viewAreaInfo(@RequestParam(value = "id") Long id); String viewAreaInfo(@RequestParam(value = "id") Long id);
/**
* 删除区域信息
*
* @param ids
* @return
*/
@GetMapping(value = "/area/delete")
String delete(Long[] ids,@RequestHeader("Authorization") String authorization);
/**
* 区域信息保存更新
*
* @param entity
* @return
*/
@PostMapping(value = "/area/save")
String save(@RequestBody AreaEntity entity,@RequestHeader("Authorization") String authorization);
/** /**
* 查看区域子信息 * 查看区域子信息
* *
...@@ -76,55 +94,46 @@ public interface IApiAreaFeign extends IFeign { ...@@ -76,55 +94,46 @@ public interface IApiAreaFeign extends IFeign {
@Slf4j @Slf4j
@Component @Component
class AreaFeignFallbackFactory implements FallbackFactory<IApiAreaFeign> { class AreaFeignFallbackFactory implements FallbackFactory<IApiAreaFeign> {
@Override @Override
public IApiAreaFeign create(Throwable t) { public IApiAreaFeign create(Throwable t) {
return new IApiAreaFeign() { return new IApiAreaFeign() {
@Override @Override
public String list(AreaEntity query) { public String list(AreaEntity query) {
log.error("暂时无法获取区域列表信息,请稍后再试!query:{}", JSON.toJSONString(query)); return JSON.toJSONString(Rest.fail("暂时无法获取站点列表,请稍后再试!"));
log.error(t.getMessage());
ApiResp<String> failResp = new ApiResp<>();
failResp.setCode(ApiRespCodeEnum.FAILED.getValue());
failResp.setMsg("暂时无法获取区域列表信息,请稍后再试!");
return JSON.toJSONString(failResp);
} }
@Override @Override
public String viewAreaInfo(Long id) { public String viewAreaInfo(Long id) {
log.error("暂时无法获取区域信息,请稍后再试!parentId:{}", id); return JSON.toJSONString(Rest.fail("暂时无法获取站点列表,请稍后再试!"));
log.error(t.getMessage()); }
ApiResp<String> failResp = new ApiResp<>();
failResp.setCode(ApiRespCodeEnum.FAILED.getValue()); @Override
failResp.setMsg("暂时无法获取区域信息,请稍后再试!"); public String delete(Long[] ids, String authorization) {
return JSON.toJSONString(failResp); return null;
} }
@Override @Override
public String getListByParentId(String parentId) { public String getListByParentId(String parentId) {
log.error("暂时无法获取区域信息,请稍后再试!parentId:{}", parentId); return JSON.toJSONString(Rest.fail("暂时无法获取站点列表,请稍后再试!"));
log.error(t.getMessage());
ApiResp<String> failResp = new ApiResp<>();
failResp.setCode(ApiRespCodeEnum.FAILED.getValue());
failResp.setMsg("暂时无法获取区域信息,请稍后再试!");
return JSON.toJSONString(failResp);
} }
@Override @Override
public String treeselect() { public String treeselect() {
ApiResp<String> failResp = new ApiResp<>(); return JSON.toJSONString(Rest.fail("暂时无法获取站点列表,请稍后再试!"));
failResp.setCode(ApiRespCodeEnum.FAILED.getValue());
failResp.setMsg("暂时无法获取区域信息,请稍后再试!");
return JSON.toJSONString(failResp);
} }
@Override @Override
public String getFlatSitesByAreaIds(SitePdu query) { public String getFlatSitesByAreaIds(SitePdu query) {
ApiResp<String> failResp = new ApiResp<>(); return JSON.toJSONString(Rest.fail("暂时无法获取站点列表,请稍后再试!"));
failResp.setCode(ApiRespCodeEnum.FAILED.getValue());
failResp.setMsg("暂时无法获取站点列表,请稍后再试!");
return JSON.toJSONString(failResp);
} }
@Override
public String save(AreaEntity entity, String authorization) {
return null;
}
}; };
} }
} }
......
package com.mortals.xhx.feign.user; package com.mortals.xhx.feign.user;
import com.alibaba.fastjson.JSON;
import com.mortals.xhx.common.code.ApiRespCodeEnum;
import com.mortals.xhx.feign.IFeign; import com.mortals.xhx.feign.IFeign;
import com.mortals.xhx.feign.req.BaseUserQuery; import com.mortals.xhx.feign.req.BaseUserQuery;
import com.mortals.xhx.feign.req.BaseUserReq; import com.mortals.xhx.feign.req.BaseUserReq;
import com.mortals.xhx.feign.rsp.ApiResp; import com.mortals.xhx.feign.rsp.ApiResp;
import com.mortals.xhx.feign.rsp.UserRsp; import com.mortals.xhx.feign.rsp.UserRsp;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -15,7 +20,7 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -15,7 +20,7 @@ import org.springframework.web.bind.annotation.RequestBody;
* @author: zxfei * @author: zxfei
* @date: 2022/5/30 10:40 * @date: 2022/5/30 10:40
*/ */
@FeignClient(name = "portal-manager", path = "/zwfw") @FeignClient(name = "portal-manager", path = "/zwfw", fallback = UserFeignFallbackFactory.class)
public interface IApiUserFeign extends IFeign { public interface IApiUserFeign extends IFeign {
/** /**
...@@ -29,3 +34,20 @@ public interface IApiUserFeign extends IFeign { ...@@ -29,3 +34,20 @@ public interface IApiUserFeign extends IFeign {
} }
@Slf4j
@Component
class UserFeignFallbackFactory implements FallbackFactory<IApiUserFeign> {
@Override
public IApiUserFeign create(Throwable t) {
return new IApiUserFeign() {
@Override
public ApiResp<UserRsp> findAllUser(BaseUserReq<BaseUserQuery> req) {
ApiResp<UserRsp> failResp = new ApiResp<>();
failResp.setCode(ApiRespCodeEnum.FAILED.getValue());
failResp.setMsg("暂时无法获取站点列表,请稍后再试!");
return failResp;
}
};
}
}
\ No newline at end of file
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