Commit 9aacd689 authored by chenzhao's avatar chenzhao

移动端驾驶舱提供接口

parent 948cdc1e
...@@ -4,8 +4,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -4,8 +4,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
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.RequestParam;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
import java.util.Map; import java.util.Map;
@FeignClient(name = "${amos.idx.name:AMOS-IDX}", path = "idx", configuration = {FeignConfiguration.class}) @FeignClient(name = "${amos.idx.name:AMOS-IDX}", path = "idx", configuration = {FeignConfiguration.class})
...@@ -24,4 +28,23 @@ public interface IdxFeign { ...@@ -24,4 +28,23 @@ public interface IdxFeign {
@GetMapping("/table/getPage") @GetMapping("/table/getPage")
FeignClientResult<Page<Map<String, Object>>> getPage(@RequestParam Map<String, Object> map); FeignClientResult<Page<Map<String, Object>>> getPage(@RequestParam Map<String, Object> map);
@RequestMapping(value = "/publicAnalysis/getStationMessage", method = RequestMethod.GET, consumes = "application/json")
FeignClientResult<List<Map<String, Object>>> getStationMark(@RequestParam(value = "code") String code);
@RequestMapping(value = "/publicAnalysis/appletSroce", method = RequestMethod.GET, consumes = "application/json")
Map<String, Object> getStationMarkList(@RequestParam(value = "code") String code,
@RequestParam(value = "pageNumber") String pageNumber,
@RequestParam(value = "pageSize") String pageSize);
@RequestMapping(value = "/jxIopAnalysis/stationRanking", method = RequestMethod.GET, consumes = "application/json")
FeignClientResult<Map<String, Object>> stationRanking(@RequestParam("pageNumber") Long pageNumber,
@RequestParam("pageSize") Long pageSize,
@RequestParam(required = false, value = "stationType") String type,
@RequestParam(required = false, value = "parentCode") String parentCode);
} }
...@@ -69,4 +69,8 @@ public interface StationBasicMapper extends BaseMapper<StationBasic> { ...@@ -69,4 +69,8 @@ public interface StationBasicMapper extends BaseMapper<StationBasic> {
*/ */
List<StationBasicDto> getStationBasicListAll(); List<StationBasicDto> getStationBasicListAll();
StationBasicDto getStationInfoByCode(@Param("stationCode")String stationCode);
List<StationBasicDto> getStationsByAreaCode(@Param("areaCode")String stationCode);
} }
...@@ -192,4 +192,23 @@ ...@@ -192,4 +192,23 @@
FROM FROM
station_basic station_basic
</select> </select>
<select id="getStationInfoByCode" resultType="com.yeejoin.amos.boot.module.jxiop.api.dto.StationBasicDto">
select
*
from
station_basic
where
station_code = #{stationCode}
</select>
<select id="getStationsByAreaCode" resultType="com.yeejoin.amos.boot.module.jxiop.api.dto.StationBasicDto">
select
*
from
station_basic
where
area_code = #{areaCode}
</select>
</mapper> </mapper>
package com.yeejoin.amos.boot.module.jxiop.api.amosprojectmapper;
public interface CompanyMapper {
public String getAreaCompanyCode(String code);
}
package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.jxiop.api.dto.StationBasicDto;
import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.MonitorFanIndicatorMapper;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.api.util.CommonResponse;
import com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESEquipments;
import com.yeejoin.amos.boot.module.jxiop.biz.constants.CommonConstans;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.AppletMonitorServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitorFanIndicatorImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.*;
@RestController
@Api(tags = "小程序-监盘")
@RequestMapping(value = "/applet")
public class AppletMonitorController {
@Autowired
AppletMonitorServiceImpl appletMonitorService;
@Autowired
StationBasicMapper stationBasicMapper;
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "风机布置图-总概览")
@GetMapping("/CockpitData")
public ResponseModel<Map<String, Object>> getData(@RequestParam(value = "code") String code,
@RequestParam(value = "level") String level) {
if ("station".equals(level)){
StationBasicDto stationBasic = stationBasicMapper.getStationInfoByCode(code);
if (stationBasic.getStationType().equals("FDZ")) {
return ResponseHelper.buildResponse(appletMonitorService.getFanStationInfo(stationBasic));
}else {
return ResponseHelper.buildResponse(appletMonitorService.getPvStationInfo(stationBasic));
}
}else {
return ResponseHelper.buildResponse(appletMonitorService.getAreaInfo(code));
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jxiop.api.amosprojectmapper.CompanyMapper">
<select id="getAreaCompanyCode" resultType="string">
select
ORG_CODE
from
privilege_company
where
COMPANY_CODE = #{code}
and
LEVEL = 'area'
and IS_DELETED = 0
</select>
</mapper>
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