Commit 2065552c authored by tangwei's avatar tangwei

解决冲突

parents 546aefd3 f7e65093
......@@ -238,7 +238,7 @@ public class EquipmentDetailController extends AbstractBaseController {
}
@RequestMapping(value = "/selectequipmentDateByCode", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "根据code查询", notes = "根据code查询")
public EquipmentDate selectequipmentDateByCode(@RequestParam String code,
@RequestParam(required = false) Long stockDetailId) {
......
......@@ -6,6 +6,7 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.component.robot.AmosRequestContext;
import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.utils.SpringUtils;
import com.yeejoin.equipmanage.fegin.JcsFeign;
......@@ -26,6 +27,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
......@@ -143,6 +145,8 @@ public class FireFightingSystemController extends AbstractBaseController {
IEquipmentService iEquipmentService;
@Autowired
FireFightingSystemMapper fireFightingSystemMapper;
@Autowired
private AmosRequestContext amosAuth;
@Value("${equipment.hierarchy}")
private String hierarchy;
......@@ -909,27 +913,33 @@ public class FireFightingSystemController extends AbstractBaseController {
/**
* 获取点位图,区域树数据
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "获取点位图,区域树数据", notes = "消防系统点位图使用")
@GetMapping(value = "/point/tree")
public List<PointTreeVo> getPointTree(@RequestParam(required = false) String systemId,
@RequestParam(required = false) String bizOrgCode,
@RequestParam(required = false) String type) {
RequestContext.setAppKey(amosAuth.getAppKey());
RequestContext.setProduct(amosAuth.getProduct());
RequestContext.setToken(amosAuth.getToken());
return fireFightingSystemService.getPointTree(systemId, bizOrgCode,type);
}
@RequestMapping(value = "/{systemCode}/system/detail", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation("通过系统code查询消防系统及部件信息")
public Map<String, Object> getSystemDetailByCode(@PathVariable String systemCode) {
return fireFightingSystemService.getSystemDetailByCode(systemCode);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "获取系统分类树", notes = "获取系统分类树")
@GetMapping(value = "/systemAndEquipmentTreeByBziOrgCode")
public List<OrgMenuDto> systemAndEquipmentTreeByBziOrgCode() {
RequestContext.setAppKey(amosAuth.getAppKey());
RequestContext.setProduct(amosAuth.getProduct());
RequestContext.setToken(amosAuth.getToken());
return fireFightingSystemService.systemAndEquipmentTreeByBziOrgCode();
}
......
......@@ -50,7 +50,7 @@ public class VideoImportantEquipmentController {
@RequestMapping(value = "/getVideoList", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "获取视屏监控关联重点设备集合(需求优化)", notes = "获取视屏监控关联重点设备集合(需求优化)")
public List<Map<String, List<VideoImportantEquipmentVo>>> getVideoList(@RequestParam(required = false) Long importantEquipmentId) {
Map<String, Object> map = null;
......
......@@ -10,6 +10,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.typroject.tyboot.core.foundation.context.RequestContext;
public class FeignBasicAuthRequestInterceptor implements RequestInterceptor {
public
......@@ -27,13 +28,28 @@ public class FeignBasicAuthRequestInterceptor implements RequestInterceptor {
String authToken = request.getHeader("token");
/* If token not found get it from request parameter */
if (StringUtils.isBlank(authToken)) {
authToken = request.getHeader("X-Access-Token");
if (StringUtils.isBlank(RequestContext.getToken())) {
authToken = request.getHeader("X-Access-Token");
template.header("X-Access-Token", authToken);
template.header("token", authToken);
template.header("appKey", request.getHeader("appKey"));
template.header("product", request.getHeader("product"));
template.header("clientType", "feignClient");
} else {
template.header("X-Access-Token", RequestContext.getToken());
System.out.println(RequestContext.getToken());
template.header("token", RequestContext.getToken());
template.header("appKey", RequestContext.getAppKey());
template.header("product", RequestContext.getProduct());
template.header("clientType", "feignClient");
}
} else {
template.header("X-Access-Token", authToken);
template.header("token", authToken);
template.header("appKey", request.getHeader("appKey"));
template.header("product", request.getHeader("product"));
template.header("clientType", "feignClient");
}
template.header("X-Access-Token", authToken);
template.header("token", authToken);
template.header("appKey", request.getHeader("appKey"));
template.header("product", request.getHeader("product"));
template.header("clientType", "feignClient");
}
}
}
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