网络管理大屏接口新增,网络舆情接口新增

dongdingding
董丁丁 2 years ago
parent f623de0977
commit c6d3cd8e88

@ -0,0 +1,39 @@
package com.ruoyi.screen.controller;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.screen.domain.response.ZongzhiWorkDynamicsResponse;
import com.ruoyi.screen.service.ZongzhiScreenManageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
*
*/
@RestController
@RequestMapping("/zongzhi/managescreen")
@Api(tags = " 太仓综治网络管理大屏接口")
public class ZongzhiScreenManageController {
@Resource
private ZongzhiScreenManageService zongzhiScreenManageService;
/**
*
*/
@ApiOperation(value = "工作动态", response = ZongzhiWorkDynamicsResponse.class)
@GetMapping("/workdynamics")
private AjaxResult getWorkDynamics() {
return AjaxResult.success(zongzhiScreenManageService.getWorkDynamics());
}
}

@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
/**
@ -83,4 +84,18 @@ public class ZongzhiScreenOpinionController {
return AjaxResult.success(zongzhiScreenOpinionService.getWordCloud());
}
/**
*
*/
@ApiOperation(value = "舆情报告", response = ZongzhiSentimentReportResponse.class)
@GetMapping("/sentimentreport")
private AjaxResult getSentimentReport() {
ZongzhiSentimentReportResponse zongzhiSentimentReportResponse = zongzhiScreenOpinionService.getSentimentReport();
zongzhiSentimentReportResponse.setReportList(zongzhiScreenOpinionService.getSentimentReportbyReportType());
return AjaxResult.success(zongzhiSentimentReportResponse);
}
}

@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
@ -19,7 +20,7 @@ import java.util.List;
@RequestMapping("/zongzhi/saftyscreen")
@Api(tags = " 太仓综治网络安全大屏接口")
public class ZongzhiScreenSaftyController {
@Autowired
@Resource
private ZongzhiScreenSaftyService zongzhiScreenSaftyService;

@ -0,0 +1,23 @@
package com.ruoyi.screen.domain.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
*/
@Data
@ApiModel("舆情报告分类响应类")
public class ZongzhiReportResponse {
@ApiModelProperty(value = "数量")
private Integer count;
@ApiModelProperty(value = "舆情报告类型1:专报 2:月报3深度报告")
private String sentimentReportType;
}

@ -0,0 +1,28 @@
package com.ruoyi.screen.domain.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
*
*/
@Data
@ApiModel("舆情报告响应类")
public class ZongzhiSentimentReportResponse {
@ApiModelProperty(value = "提示单")
private Integer reminder;
@ApiModelProperty(value = "是否转办1是 2否")
private Integer isturn;
@ApiModelProperty(value = "舆情报告分类响应类")
private List<ZongzhiReportResponse> reportList;
}

@ -0,0 +1,23 @@
package com.ruoyi.screen.domain.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
*/
@Data
@ApiModel("大屏数据工作动态响应类")
public class ZongzhiWorkDynamicsResponse {
@ApiModelProperty(value = "类型")
private String type;
@ApiModelProperty(value = "材料文件名称")
private String materialsName;
}

@ -0,0 +1,20 @@
package com.ruoyi.screen.mapper;
import com.ruoyi.screen.domain.response.ZongzhiWorkDynamicsResponse;
import java.util.List;
/**
*
*/
public interface ZongzhiScreenManageMapper {
/**
*
*/
public List<ZongzhiWorkDynamicsResponse> getWorkDynamics();
}

@ -1,9 +1,6 @@
package com.ruoyi.screen.mapper;
import com.ruoyi.screen.domain.response.ZongzhiSentimenClassificationResponse;
import com.ruoyi.screen.domain.response.ZongzhiSentimenWordCloudResponse;
import com.ruoyi.screen.domain.response.ZongzhiSentimentCountResponse;
import com.ruoyi.screen.domain.response.ZongzhiSentimentTypeResponse;
import com.ruoyi.screen.domain.response.*;
import java.util.List;
@ -47,4 +44,18 @@ public interface ZongzhiScreenOpinionMapper {
*
*/
public List<ZongzhiSentimenWordCloudResponse> getWordCloud();
/**
*
*/
public ZongzhiSentimentReportResponse getSentimentReport();
/**
*
*/
public List<ZongzhiReportResponse> getSentimentReportbyReportType();
}

@ -0,0 +1,20 @@
package com.ruoyi.screen.service;
import com.ruoyi.screen.domain.response.ZongzhiWorkDynamicsResponse;
import java.util.List;
/**
*
*/
public interface ZongzhiScreenManageService {
/**
*
*/
public List<ZongzhiWorkDynamicsResponse> getWorkDynamics();
}

@ -40,4 +40,20 @@ public interface ZongzhiScreenOpinionService {
public List<ZongzhiSentimenWordCloudResponse> getWordCloud();
/**
*
*/
public ZongzhiSentimentReportResponse getSentimentReport();
/**
*
*/
public List<ZongzhiReportResponse> getSentimentReportbyReportType();
}

@ -0,0 +1,26 @@
package com.ruoyi.screen.service.impl;
import com.ruoyi.screen.domain.response.ZongzhiWorkDynamicsResponse;
import com.ruoyi.screen.mapper.ZongzhiScreenManageMapper;
import com.ruoyi.screen.service.ZongzhiScreenManageService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
*
*/
@Service
public class ZongzhiScreenManageServiceImpl implements ZongzhiScreenManageService {
@Resource
ZongzhiScreenManageMapper zongzhiScreenManageMapper;
@Override
public List<ZongzhiWorkDynamicsResponse> getWorkDynamics() {
return zongzhiScreenManageMapper.getWorkDynamics();
}
}

@ -1,9 +1,6 @@
package com.ruoyi.screen.service.impl;
import com.ruoyi.screen.domain.response.ZongzhiSentimenClassificationResponse;
import com.ruoyi.screen.domain.response.ZongzhiSentimenWordCloudResponse;
import com.ruoyi.screen.domain.response.ZongzhiSentimentCountResponse;
import com.ruoyi.screen.domain.response.ZongzhiSentimentTypeResponse;
import com.ruoyi.screen.domain.response.*;
import com.ruoyi.screen.mapper.ZongzhiScreenOpinionMapper;
import com.ruoyi.screen.service.ZongzhiScreenOpinionService;
import org.springframework.stereotype.Service;
@ -43,4 +40,14 @@ public class ZongzhiScreenOpinionServiceImpl implements ZongzhiScreenOpinionServ
public List<ZongzhiSentimenWordCloudResponse> getWordCloud() {
return zongzhiScreenOpinionMapper.getWordCloud();
}
@Override
public ZongzhiSentimentReportResponse getSentimentReport() {
return zongzhiScreenOpinionMapper.getSentimentReport();
}
@Override
public List<ZongzhiReportResponse> getSentimentReportbyReportType() {
return zongzhiScreenOpinionMapper.getSentimentReportbyReportType();
}
}

@ -1,48 +1,30 @@
package com.ruoyi.zongzhi.controller;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.entity.SysDept;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.zongzhi.domain.TcTown;
import com.ruoyi.zongzhi.service.ITcTownService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller
*
*
* @author ruoyi
* @date 2023-08-10
*/
@RestController
@RequestMapping("/zongzhi/town")
@Api(tags = "区域")
public class TcTownController extends BaseController
{
public class TcTownController extends BaseController {
@Autowired
private ITcTownService tcTownService;
@ -51,8 +33,7 @@ public class TcTownController extends BaseController
*/
@GetMapping("/list")
public TableDataInfo list(TcTown tcTown)
{
public TableDataInfo list(TcTown tcTown) {
startPage();
List<TcTown> list = tcTownService.selectTcTownList(tcTown);
return getDataTable(list);
@ -64,8 +45,7 @@ public class TcTownController extends BaseController
@PostMapping("/export")
public void export(HttpServletResponse response, TcTown tcTown)
{
public void export(HttpServletResponse response, TcTown tcTown) {
List<TcTown> list = tcTownService.selectTcTownList(tcTown);
ExcelUtil<TcTown> util = new ExcelUtil<TcTown>(TcTown.class);
util.exportExcel(response, list, "区域数据");
@ -77,8 +57,7 @@ public class TcTownController extends BaseController
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(tcTownService.selectTcTownById(id));
}
@ -87,8 +66,7 @@ public class TcTownController extends BaseController
*/
@PostMapping
public AjaxResult add(@RequestBody TcTown tcTown)
{
public AjaxResult add(@RequestBody TcTown tcTown) {
return toAjax(tcTownService.insertTcTown(tcTown));
}
@ -97,8 +75,7 @@ public class TcTownController extends BaseController
*/
@PutMapping
public AjaxResult edit(@RequestBody TcTown tcTown)
{
public AjaxResult edit(@RequestBody TcTown tcTown) {
return toAjax(tcTownService.updateTcTown(tcTown));
}
@ -106,22 +83,21 @@ public class TcTownController extends BaseController
*
*/
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(tcTownService.deleteTcTownByIds(ids));
}
/**
* excel
* excel
*
* @param file
* @return
* @throws Exception
*/
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file) throws Exception
{
public AjaxResult importData(MultipartFile file) throws Exception {
ExcelUtil<TcTown> util = new ExcelUtil<TcTown>(TcTown.class);
List<TcTown> tcTownList = util.importExcel(file.getInputStream());
String message = tcTownService.importUser(tcTownList);
@ -130,12 +106,12 @@ public class TcTownController extends BaseController
/**
*
*
* @return
*/
@GetMapping("/new/tree")
@ApiOperation(value = "树形结构列表")
public AjaxResult treeselect(TcTown tcTown)
{
public AjaxResult treeselect(TcTown tcTown) {
List<TcTown> tcTowns = tcTownService.selectTcTownList(tcTown);
return AjaxResult.success(tcTownService.buildDeptTreeSelect(tcTowns));
}

@ -40,7 +40,7 @@ public class TcNetworkPingtai extends BaseEntity {
* 8.
*/
@Excel(name = "平台类别")
@ApiModelProperty(value = "平台类别")
@ApiModelProperty(value = "平台类别1.网址 2.抖音 3.微信 4.微博 5.今日头条 6.快手 7.B站 8.小红书")
private Long type;
/**

@ -0,0 +1,14 @@
<?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.screen.mapper.ZongzhiScreenManageMapper">
<select id="getWorkDynamics" resultType="com.ruoyi.screen.domain.response.ZongzhiWorkDynamicsResponse">
SELECT type, materials_name as materialsName
FROM `tc_work_dongtai`
GROUP BY type, materialsName
</select>
</mapper>

@ -34,4 +34,17 @@
from tc_network_sentiment
GROUP BY yuci_type
</select>
<select id="getSentimentReport"
resultType="com.ruoyi.screen.domain.response.ZongzhiSentimentReportResponse">
select a.reminder, b.isturn
from (select count(reminder) as reminder from tc_network_sentiment) a,
(select count(*) as isturn from tc_network_sentiment where isturn = '1') b
</select>
<select id="getSentimentReportbyReportType"
resultType="com.ruoyi.screen.domain.response.ZongzhiReportResponse">
select count(sentiment_report_type) as sentimentReportType, sentiment_report_type
from tc_network_sentiment
GROUP BY sentiment_report_type
</select>
</mapper>
Loading…
Cancel
Save