大屏接口编写

duhanyu
dongdingding 1 year ago
parent 6bc2c55434
commit 1bd151b3d8

@ -2,10 +2,7 @@ package com.ruoyi.tcZz.controller;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
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.domain.reponse.*;
import com.ruoyi.tcZz.service.ScreenService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -14,6 +11,9 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/**
*
*/
@ -69,6 +69,21 @@ public class ScreenController extends BaseController {
@ApiOperation(value = "网评文章", response = ScreenArticlesResponse.class)
@GetMapping("/screenarticles")
public AjaxResult screenArticles() {
return AjaxResult.success(screenService.getScreenOpinionReport());
return AjaxResult.success(screenService.getScreenArticles());
}
/**
*
*/
@ApiOperation(value = "清郎专项行动数据统计", response = ScreenQinglangResponse.class)
@GetMapping("/screenqinglang")
public AjaxResult screenQinglang() {
ScreenQinglangResponse screenQinglangResponse=new ScreenQinglangResponse();
List<ScreenQinglangWeifanResponse> list= screenService.getScreenQinglang();
List<ScreenQinglangWeiguiResponse> list1= screenService.getScreenQinglangWeigui();
screenQinglangResponse.setScreenQinglangWeifanResponse(list);
screenQinglangResponse.setScreenQinglangWeiguiResponse(list1);
return AjaxResult.success(screenQinglangResponse);
}
}

@ -3,8 +3,8 @@ package com.ruoyi.tcZz.controller;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.exception.base.BaseException;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.tcZz.domain.TcYqyj;
import com.ruoyi.tcZz.domain.TcYqzs;
import com.ruoyi.tcZz.service.ITcYqzsService;
import io.swagger.annotations.Api;
@ -56,6 +56,17 @@ public class TcYqzsController extends BaseController {
@ApiOperation("新增舆情走势图")
@PostMapping
public AjaxResult add(@RequestBody TcYqzs tcYqzs) {
/**
*
*/
TcYqzs tcYqzs1 = new TcYqzs();
tcYqzs1.setAreaId(tcYqzs.getAreaId());
tcYqzs1.setDateTime(tcYqzs.getDateTime());
List<TcYqzs> list = tcYqzsService.selectTcYqzsList(tcYqzs1);
if (!list.isEmpty()) {
throw new BaseException("同一天内不得新增多条太仓数据");
}
return toAjax(tcYqzsService.insertTcYqzs(tcYqzs));
}
@ -100,6 +111,7 @@ public class TcYqzsController extends BaseController {
tcYqzsService.importUser(tcYqzsList);
return AjaxResult.success();
}
/**
*
*
@ -109,15 +121,14 @@ public class TcYqzsController extends BaseController {
@ApiOperation("批量启用禁用")
@GetMapping("/isStatus")
public AjaxResult isStatus(@RequestParam("isStatus") Integer isStatus,@RequestParam("ids") List<String> ids) {
tcYqzsService.updateByisStatus(isStatus,ids);
public AjaxResult isStatus(@RequestParam("isStatus") Integer isStatus, @RequestParam("ids") List<String> ids) {
tcYqzsService.updateByisStatus(isStatus, ids);
return AjaxResult.success();
}
@ApiOperation("通用下载excel模板")
@PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response)
{
public void importTemplate(HttpServletResponse response) {
ExcelUtil<TcYqzs> util = new ExcelUtil<TcYqzs>(TcYqzs.class);
util.importTemplateExcel(response, " 舆情走势图列表");
}

@ -34,9 +34,9 @@ public class TcYqzs extends BaseEntity
private Long areaId;
/** 日期 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "日期")
@Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date dateTime;
/** 非敏感数量 */

@ -1,7 +1,29 @@
package com.ruoyi.tcZz.domain.reponse;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
*/
@Data
@ApiModel("网评文章")
public class ScreenArticlesResponse {
/**
*
*/
@ApiModelProperty("本级录用")
private Integer count;
/**
*
*/
@ApiModelProperty("苏州级录用")
private Integer count1;
/**
*
*/
@ApiModelProperty("省级及以上录用")
private Integer count2;
}

@ -0,0 +1,27 @@
package com.ruoyi.tcZz.domain.reponse;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
*
*/
@Data
@ApiModel("清郎专项行动")
public class ScreenQinglangResponse {
/**
*
*/
@ApiModelProperty("清郎专项行动处理有害信息数据统计")
List<ScreenQinglangWeifanResponse> screenQinglangWeifanResponse;
/**
*
*/
@ApiModelProperty("关闭直播平台违规账号")
List<ScreenQinglangWeiguiResponse> screenQinglangWeiguiResponse;
}

@ -0,0 +1,33 @@
package com.ruoyi.tcZz.domain.reponse;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
*
*/
@Data
@ApiModel("清郎专项行动处理有害信息数据统计")
public class ScreenQinglangWeifanResponse {
/**
*
*/
@ApiModelProperty("处理有害信息数量")
private Integer count1;
/**
*
*/
@ApiModelProperty("日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date dateTime;
}

@ -0,0 +1,30 @@
package com.ruoyi.tcZz.domain.reponse;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
*
*/
@Data
@ApiModel("关闭直播平台违规账号")
public class ScreenQinglangWeiguiResponse {
/**
*
*/
@ApiModelProperty("关闭直播平台违规账号")
private Integer count2;
/**
*
*/
@ApiModelProperty("日期")
@DateTimeFormat(pattern = "yyyy-MM-dd ")
@JsonFormat(pattern = "yyyy-MM-dd ")
private Date dateTime;
}

@ -1,8 +1,8 @@
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;
import com.ruoyi.tcZz.domain.reponse.*;
import java.util.List;
/**
*
@ -28,6 +28,30 @@ public interface ScreenMapper {
*
* @return
*/
ScreenOpinionReportResponse getScreenOpinionReport();
/**
*
*
* @return
*/
ScreenArticlesResponse getScreenArticles();
/**
*
*
* @return
*/
List<ScreenQinglangWeifanResponse> getScreenQinglang();
/**
*
* @return
*/
List<ScreenQinglangWeiguiResponse> getScreenQinglangWeigui();
}

@ -1,8 +1,8 @@
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;
import com.ruoyi.tcZz.domain.reponse.*;
import java.util.List;
/**
*
@ -34,4 +34,25 @@ public interface ScreenService {
*/
ScreenOpinionReportResponse getScreenOpinionReport();
/**
*
*
* @return
*/
ScreenArticlesResponse getScreenArticles();
/**
*
*
* @return
*/
List<ScreenQinglangWeifanResponse> getScreenQinglang();
/**
*
* @return
*/
List<ScreenQinglangWeiguiResponse> getScreenQinglangWeigui();
}

@ -1,13 +1,13 @@
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.domain.reponse.*;
import com.ruoyi.tcZz.mapper.ScreenMapper;
import com.ruoyi.tcZz.service.ScreenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
*
*/
@ -34,4 +34,19 @@ public class ScreenServiceImpl implements ScreenService {
public ScreenOpinionReportResponse getScreenOpinionReport() {
return screenMapper.getScreenOpinionReport();
}
@Override
public ScreenArticlesResponse getScreenArticles() {
return screenMapper.getScreenArticles();
}
@Override
public List<ScreenQinglangWeifanResponse> getScreenQinglang() {
return screenMapper.getScreenQinglang();
}
@Override
public List<ScreenQinglangWeiguiResponse> getScreenQinglangWeigui() {
return screenMapper.getScreenQinglangWeigui();
}
}

@ -26,4 +26,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
(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>
<select id="getScreenArticles" resultType="com.ruoyi.tcZz.domain.reponse.ScreenArticlesResponse">
SELECT *
FROM (SELECT COUNT(*) AS count FROM tc_wpwzlyqk where type =1 and isStatus=1) count,
(SELECT COUNT(*) AS count1 FROM tc_wpwzlyqk where type=2 and isStatus=1) count1,
(SELECT COUNT(*) AS count2 FROM tc_wpwzlyqk where type=3 and isStatus=1 ) count2;
</select>
<select id="getScreenQinglang" resultType="com.ruoyi.tcZz.domain.reponse.ScreenQinglangWeifanResponse">
select count1,date_time as dateTime from tc_qlzxxdsjtj order by date_time desc
</select>
<select id="getScreenQinglangWeigui"
resultType="com.ruoyi.tcZz.domain.reponse.ScreenQinglangWeiguiResponse">
select count2,date_time as dateTime from tc_qlzxxdsjtj order by date_time desc limit 12
</select>
</mapper>

@ -43,6 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null and remark != ''">and remark = #{remark}</if>
<if test="count1 != null ">and count1 = #{count1}</if>
<if test="count2 != null ">and count2 = #{count2}</if>
<if test="dateTime != null ">and dateTime like concat('%', #{dateTime}, '%')</if>
</where>
order by date_time asc
</select>

Loading…
Cancel
Save