大屏接口编写

duhanyu
dongdingding 1 year ago
parent aad22aca51
commit 07efa93047

@ -2,7 +2,10 @@ package com.ruoyi.tcZz.controller;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.tcZz.domain.TcAqg;
import com.ruoyi.tcZz.domain.reponse.ScreenArticlesResponse;
import com.ruoyi.tcZz.domain.reponse.ScreenOpinionReportResponse;
import com.ruoyi.tcZz.domain.reponse.ScreenSourceResponse;
import com.ruoyi.tcZz.domain.reponse.ScreenSupervisionResponse;
import com.ruoyi.tcZz.service.ScreenService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -11,8 +14,6 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
*
*/
@ -30,10 +31,44 @@ public class ScreenController extends BaseController {
*
*/
@ApiOperation(value = "大屏监管对象", response = TcAqg.class)
@ApiOperation(value = "大屏监管对象", response = ScreenSupervisionResponse.class)
@GetMapping("/screensupervision")
public AjaxResult screenSupervision(TcAqg tcAqg) {
// List<TcAqg> list = screenService.selectTcAqgList(tcAqg);
return null;
public AjaxResult screenSupervision() {
return AjaxResult.success(screenService.getScreenSupervision());
}
/**
*
*/
@ApiOperation(value = "大屏数据来源", response = ScreenSourceResponse.class)
@GetMapping("/screensource")
public AjaxResult screenSource() {
return AjaxResult.success(screenService.getScreenSource());
}
/**
*
*/
@ApiOperation(value = "舆情报告", response = ScreenOpinionReportResponse.class)
@GetMapping("/screenopinionreport")
public AjaxResult screenOpinionReport() {
return AjaxResult.success(screenService.getScreenOpinionReport());
}
/**
*
*/
@ApiOperation(value = "网评文章", response = ScreenArticlesResponse.class)
@GetMapping("/screenarticles")
public AjaxResult screenArticles() {
return AjaxResult.success(screenService.getScreenOpinionReport());
}
}

@ -0,0 +1,7 @@
package com.ruoyi.tcZz.domain.reponse;
/**
*
*/
public class ScreenArticlesResponse {
}

@ -0,0 +1,41 @@
package com.ruoyi.tcZz.domain.reponse;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
*/
@Data
@ApiModel("大屏舆情报告响应类")
public class ScreenOpinionReportResponse {
/**
*
*/
@ApiModelProperty("提示单")
private Integer count;
/**
*
*/
@ApiModelProperty("转办单")
private Integer count1;
/**
*
*/
@ApiModelProperty("专报 ")
private Integer count2;
/**
*
*/
@ApiModelProperty("月报")
private Integer count3;
/**
* IDC
*/
@ApiModelProperty("深度报告")
private Integer count4;
}

@ -0,0 +1,30 @@
package com.ruoyi.tcZz.domain.reponse;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
*/
@Data
@ApiModel("大屏数据来源")
public class ScreenSourceResponse {
/**
*
*/
@ApiModelProperty("硬探针")
private Integer count;
/**
*
*/
@ApiModelProperty("软探针")
private Integer count1;
/**
*
*/
@ApiModelProperty("系统监测")
private Integer count2;
}

@ -0,0 +1,42 @@
package com.ruoyi.tcZz.domain.reponse;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data;
/**
*
*/
@Data
@ApiModel("大屏监管对象请求类")
public class ScreenSupervisionResponse {
/**
*
*/
@ApiModelProperty("等保系统")
private Integer count;
/**
*
*/
@ApiModelProperty("等保单位")
private Integer count1;
/**
*
*/
@ApiModelProperty("政府网站")
private Integer count2;
/**
*
*/
@ApiModelProperty("监管单位、网站监测")
private Integer count3;
/**
*IDC
*/
@ApiModelProperty("IDC单位")
private Integer count4;
}

@ -0,0 +1,33 @@
package com.ruoyi.tcZz.mapper;
import com.ruoyi.tcZz.domain.reponse.ScreenOpinionReportResponse;
import com.ruoyi.tcZz.domain.reponse.ScreenSourceResponse;
import com.ruoyi.tcZz.domain.reponse.ScreenSupervisionResponse;
/**
*
*/
public interface ScreenMapper {
/**
*
*/
ScreenSupervisionResponse getScreenSupervision();
/**
*
*/
ScreenSourceResponse getScreenSource();
/**
*
*
* @return
*/
ScreenOpinionReportResponse getScreenOpinionReport();
}

@ -1,5 +1,9 @@
package com.ruoyi.tcZz.service;
import com.ruoyi.tcZz.domain.reponse.ScreenOpinionReportResponse;
import com.ruoyi.tcZz.domain.reponse.ScreenSourceResponse;
import com.ruoyi.tcZz.domain.reponse.ScreenSupervisionResponse;
/**
*
*/
@ -7,6 +11,27 @@ public interface ScreenService {
/**
*
*
* @return
*/
ScreenSupervisionResponse getScreenSupervision();
/**
*
*
* @return
*/
ScreenSourceResponse getScreenSource();
/**
*
*
* @return
*/
ScreenOpinionReportResponse getScreenOpinionReport();
}

@ -1,6 +1,11 @@
package com.ruoyi.tcZz.service.impl;
import com.ruoyi.tcZz.domain.reponse.ScreenOpinionReportResponse;
import com.ruoyi.tcZz.domain.reponse.ScreenSourceResponse;
import com.ruoyi.tcZz.domain.reponse.ScreenSupervisionResponse;
import com.ruoyi.tcZz.mapper.ScreenMapper;
import com.ruoyi.tcZz.service.ScreenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
@ -8,4 +13,25 @@ import org.springframework.stereotype.Service;
*/
@Service
public class ScreenServiceImpl implements ScreenService {
/**
*
*/
@Autowired
private ScreenMapper screenMapper;
@Override
public ScreenSupervisionResponse getScreenSupervision() {
return screenMapper.getScreenSupervision();
}
@Override
public ScreenSourceResponse getScreenSource() {
return screenMapper.getScreenSource();
}
@Override
public ScreenOpinionReportResponse getScreenOpinionReport() {
return screenMapper.getScreenOpinionReport();
}
}

@ -0,0 +1,29 @@
<?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.ruoyi.tcZz.mapper.ScreenMapper">
<select id="getScreenSupervision" resultType="com.ruoyi.tcZz.domain.reponse.ScreenSupervisionResponse">
SELECT *
FROM (SELECT COUNT(*) AS count FROM tc_dbxt WHERE isStatus=1) count,
(SELECT COUNT(*) AS count1 FROM tc_dbdw WHERE isStatus = 1) count1,
(SELECT COUNT(*) AS count2 FROM tc_zfwz WHERE isStatus = 1) count2,
(SELECT COUNT(*) AS count3 FROM tc_jgdw WHERE isStatus = 1) count3,
(SELECT COUNT(*) AS count4 FROM tc_idcdw WHERE isStatus = 1) count4;
</select>
<select id="getScreenSource" resultType="com.ruoyi.tcZz.domain.reponse.ScreenSourceResponse">
SELECT *
FROM (SELECT COUNT(*) AS count FROM tc_sjly where type =1) count,
(SELECT COUNT(*) AS count1 FROM tc_sjly where type=2) count1,
(SELECT COUNT(*) AS count2 FROM tc_xtjc ) count2;
</select>
<select id="getScreenOpinionReport" resultType="com.ruoyi.tcZz.domain.reponse.ScreenOpinionReportResponse">
SELECT *
FROM (SELECT COUNT(*) AS count FROM tc_yqbg where type =1 and isStatus=1) count,
(SELECT COUNT(*) AS count1 FROM tc_yqbg where type=2 and isStatus=1) count1,
(SELECT COUNT(*) AS count2 FROM tc_yqbg where type=3 and isStatus=1 ) count2,
(SELECT COUNT(*) AS count3 FROM tc_yqbg where type=4 and isStatus=1 ) count3,
(SELECT COUNT(*) AS count4 FROM tc_yqbg where type=5 and isStatus=1 ) count4;
</select>
</mapper>
Loading…
Cancel
Save