Compare commits
No commits in common. "bb0e14dcfb9bb9166db55d400c13c0e64b30652a" and "bcd4a398228c887ec7590d118656dc60ba0e6a37" have entirely different histories.
bb0e14dcfb
...
bcd4a39822
|
@ -1,7 +1,7 @@
|
||||||
package com.ruoyi.web.controller.board;
|
package com.ruoyi.web.controller.board;
|
||||||
|
|
||||||
import com.ruoyi.board.domain.AlertPlan;
|
import com.ruoyi.board.domain.AlertPlan;
|
||||||
import com.ruoyi.board.service.IAlertPlanService;
|
import com.ruoyi.board.service.AlertPlanService;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
@ -22,10 +22,10 @@ import java.util.List;
|
||||||
* @Date 2024-08-06
|
* @Date 2024-08-06
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/board/plan")
|
@RequestMapping("/alertPlan")
|
||||||
public class AlertPlanController extends BaseController {
|
public class AlertPlanController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IAlertPlanService alertPlanService;
|
private AlertPlanService alertPlanService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询预警计划列表
|
* 查询预警计划列表
|
||||||
|
@ -34,7 +34,7 @@ public class AlertPlanController extends BaseController {
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(AlertPlan alertPlan) {
|
public TableDataInfo list(AlertPlan alertPlan) {
|
||||||
startPage();
|
startPage();
|
||||||
List<AlertPlan> list = alertPlanService.selectList(alertPlan);
|
List<AlertPlan> list = alertPlanService.list();
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
package com.ruoyi.web.controller.board;
|
package com.ruoyi.web.controller.board;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSON;
|
|
||||||
import com.ruoyi.board.domain.BoardInfo;
|
import com.ruoyi.board.domain.BoardInfo;
|
||||||
import com.ruoyi.board.service.IBoardInfoService;
|
import com.ruoyi.board.service.BoardInfoService;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
@ -23,19 +22,21 @@ import java.util.List;
|
||||||
* @date 2024-08-06
|
* @date 2024-08-06
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/board/info")
|
@RequestMapping("/board")
|
||||||
public class BoardInfoController extends BaseController {
|
public class BoardInfoController extends BaseController
|
||||||
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBoardInfoService boardInfoService;
|
private BoardInfoService BoardInfoService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询情报板信息列表
|
* 查询情报板信息列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('board:info:list')")
|
@PreAuthorize("@ss.hasPermi('board:info:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(BoardInfo BoardInfo) {
|
public TableDataInfo list(BoardInfo BoardInfo)
|
||||||
|
{
|
||||||
startPage();
|
startPage();
|
||||||
List<BoardInfo> list = boardInfoService.list();
|
List<BoardInfo> list = BoardInfoService.list();
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,8 +46,9 @@ public class BoardInfoController extends BaseController {
|
||||||
@PreAuthorize("@ss.hasPermi('board:info:export')")
|
@PreAuthorize("@ss.hasPermi('board:info:export')")
|
||||||
@Log(title = "情报板信息", businessType = BusinessType.EXPORT)
|
@Log(title = "情报板信息", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, BoardInfo BoardInfo) {
|
public void export(HttpServletResponse response, BoardInfo BoardInfo)
|
||||||
List<BoardInfo> list = boardInfoService.list();
|
{
|
||||||
|
List<BoardInfo> list = BoardInfoService.list();
|
||||||
ExcelUtil<BoardInfo> util = new ExcelUtil<BoardInfo>(BoardInfo.class);
|
ExcelUtil<BoardInfo> util = new ExcelUtil<BoardInfo>(BoardInfo.class);
|
||||||
util.exportExcel(response, list, "情报板信息数据");
|
util.exportExcel(response, list, "情报板信息数据");
|
||||||
}
|
}
|
||||||
|
@ -56,8 +58,9 @@ public class BoardInfoController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('board:info:query')")
|
@PreAuthorize("@ss.hasPermi('board:info:query')")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
return success(boardInfoService.getById(id));
|
{
|
||||||
|
return success(BoardInfoService.getById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -66,9 +69,9 @@ public class BoardInfoController extends BaseController {
|
||||||
@PreAuthorize("@ss.hasPermi('board:info:add')")
|
@PreAuthorize("@ss.hasPermi('board:info:add')")
|
||||||
@Log(title = "情报板信息", businessType = BusinessType.INSERT)
|
@Log(title = "情报板信息", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody BoardInfo boardInfo) {
|
public AjaxResult add(@RequestBody BoardInfo BoardInfo)
|
||||||
logger.info(JSON.toJSONString(boardInfo));
|
{
|
||||||
return toAjax(boardInfoService.save(boardInfo));
|
return toAjax(BoardInfoService.save(BoardInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -77,8 +80,9 @@ public class BoardInfoController extends BaseController {
|
||||||
@PreAuthorize("@ss.hasPermi('board:info:edit')")
|
@PreAuthorize("@ss.hasPermi('board:info:edit')")
|
||||||
@Log(title = "情报板信息", businessType = BusinessType.UPDATE)
|
@Log(title = "情报板信息", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody BoardInfo BoardInfo) {
|
public AjaxResult edit(@RequestBody BoardInfo BoardInfo)
|
||||||
return toAjax(boardInfoService.saveOrUpdate(BoardInfo));
|
{
|
||||||
|
return toAjax(BoardInfoService.saveOrUpdate(BoardInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -87,7 +91,8 @@ public class BoardInfoController extends BaseController {
|
||||||
@PreAuthorize("@ss.hasPermi('board:info:remove')")
|
@PreAuthorize("@ss.hasPermi('board:info:remove')")
|
||||||
@Log(title = "情报板信息", businessType = BusinessType.DELETE)
|
@Log(title = "情报板信息", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
public AjaxResult remove(@PathVariable List<Long> ids) {
|
public AjaxResult remove(@PathVariable List<Long> ids)
|
||||||
return toAjax(boardInfoService.removeByIds(ids));
|
{
|
||||||
|
return toAjax(BoardInfoService.removeByIds(ids));
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,99 +0,0 @@
|
||||||
package com.ruoyi.web.controller.board;
|
|
||||||
|
|
||||||
import com.ruoyi.board.domain.PresetContent;
|
|
||||||
import com.ruoyi.board.service.IPresetContentService;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
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.enums.BusinessType;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 预置信息及模版Controller
|
|
||||||
*
|
|
||||||
* @author fuhao
|
|
||||||
* @date 2024-08-12
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/board/content")
|
|
||||||
public class PresetContentController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private IPresetContentService presetContentService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询预置信息及模版列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('board:content:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(PresetContent presetContent)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<PresetContent> list = presetContentService.list();
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出预置信息及模版列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('board:content:export')")
|
|
||||||
@Log(title = "预置信息及模版", businessType = BusinessType.EXPORT)
|
|
||||||
@PostMapping("/export")
|
|
||||||
public void export(HttpServletResponse response, PresetContent presetContent)
|
|
||||||
{
|
|
||||||
List<PresetContent> list = presetContentService.list();
|
|
||||||
ExcelUtil<PresetContent> util = new ExcelUtil<PresetContent>(PresetContent.class);
|
|
||||||
util.exportExcel(response, list, "预置信息及模版数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取预置信息及模版详细信息
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('board:content:query')")
|
|
||||||
@GetMapping(value = "/{id}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
||||||
{
|
|
||||||
return success(presetContentService.getById(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增预置信息及模版
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('board:content:add')")
|
|
||||||
@Log(title = "预置信息及模版", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@RequestBody PresetContent presetContent)
|
|
||||||
{
|
|
||||||
return toAjax(presetContentService.save(presetContent));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改预置信息及模版
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('board:content:edit')")
|
|
||||||
@Log(title = "预置信息及模版", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping
|
|
||||||
public AjaxResult edit(@RequestBody PresetContent presetContent)
|
|
||||||
{
|
|
||||||
return toAjax(presetContentService.updateById(presetContent));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除预置信息及模版
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('board:content:remove')")
|
|
||||||
@Log(title = "预置信息及模版", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{ids}")
|
|
||||||
public AjaxResult remove(@PathVariable Long[] ids)
|
|
||||||
{
|
|
||||||
return toAjax(presetContentService.removeByIds(Arrays.asList(ids)));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,35 +0,0 @@
|
||||||
package com.ruoyi.web.controller.board;
|
|
||||||
|
|
||||||
import com.ruoyi.board.domain.ReleaseRecord;
|
|
||||||
import com.ruoyi.board.service.IReleaseRecordService;
|
|
||||||
import com.ruoyi.board.service.impl.ReleaseRecordServiceImpl;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布记录表(pub_release_record)表控制层
|
|
||||||
*
|
|
||||||
* @author fuhao
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/pub_release_record")
|
|
||||||
public class ReleaseRecordController {
|
|
||||||
/**
|
|
||||||
* 服务对象
|
|
||||||
*/
|
|
||||||
@Autowired
|
|
||||||
private IReleaseRecordService releaseRecordServiceImpl;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过主键查询单条数据
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return 单条数据
|
|
||||||
*/
|
|
||||||
@GetMapping("selectOne")
|
|
||||||
public ReleaseRecord selectOne(Integer id) {
|
|
||||||
return releaseRecordServiceImpl.getById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
package com.ruoyi.web.controller.sensor;
|
|
||||||
|
|
||||||
|
|
||||||
import com.ruoyi.common.annotation.Anonymous;
|
|
||||||
import com.ruoyi.sensor.domain.PerceptionParams;
|
|
||||||
import com.ruoyi.sensor.service.ISensorDataService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/sensor/data")
|
|
||||||
public class OpenSensorDataController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISensorDataService sensorDataService;
|
|
||||||
|
|
||||||
@Anonymous
|
|
||||||
@PostMapping("/judge")
|
|
||||||
public void list(PerceptionParams perceptionParams) {
|
|
||||||
sensorDataService.perceptionParamsHandler(perceptionParams);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -9,10 +9,9 @@
|
||||||
<!-- 控制台输出 -->
|
<!-- 控制台输出 -->
|
||||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
<encoder>
|
<encoder>
|
||||||
<charset>UTF-8</charset>
|
|
||||||
<pattern>${log.pattern}</pattern>
|
<pattern>${log.pattern}</pattern>
|
||||||
</encoder>
|
</encoder>
|
||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<!-- 系统日志输出 -->
|
<!-- 系统日志输出 -->
|
||||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
@ -25,9 +24,8 @@
|
||||||
<maxHistory>60</maxHistory>
|
<maxHistory>60</maxHistory>
|
||||||
</rollingPolicy>
|
</rollingPolicy>
|
||||||
<encoder>
|
<encoder>
|
||||||
<charset>UTF-8</charset>
|
|
||||||
<pattern>${log.pattern}</pattern>
|
<pattern>${log.pattern}</pattern>
|
||||||
</encoder>
|
</encoder>
|
||||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
<!-- 过滤的级别 -->
|
<!-- 过滤的级别 -->
|
||||||
<level>INFO</level>
|
<level>INFO</level>
|
||||||
|
@ -48,7 +46,6 @@
|
||||||
<maxHistory>60</maxHistory>
|
<maxHistory>60</maxHistory>
|
||||||
</rollingPolicy>
|
</rollingPolicy>
|
||||||
<encoder>
|
<encoder>
|
||||||
<charset>UTF-8</charset>
|
|
||||||
<pattern>${log.pattern}</pattern>
|
<pattern>${log.pattern}</pattern>
|
||||||
</encoder>
|
</encoder>
|
||||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
@ -71,7 +68,6 @@
|
||||||
<maxHistory>60</maxHistory>
|
<maxHistory>60</maxHistory>
|
||||||
</rollingPolicy>
|
</rollingPolicy>
|
||||||
<encoder>
|
<encoder>
|
||||||
<charset>UTF-8</charset>
|
|
||||||
<pattern>${log.pattern}</pattern>
|
<pattern>${log.pattern}</pattern>
|
||||||
</encoder>
|
</encoder>
|
||||||
</appender>
|
</appender>
|
||||||
|
|
Binary file not shown.
|
@ -136,19 +136,6 @@
|
||||||
<groupId>com.baomidou</groupId>
|
<groupId>com.baomidou</groupId>
|
||||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||||
<version>3.5.4</version>
|
<version>3.5.4</version>
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<artifactId>jsqlparser</artifactId>
|
|
||||||
<groupId>com.github.jsqlparser</groupId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<!-- mybatis-plus-join 表关联增强 -->
|
|
||||||
<!-- https://mybatisplusjoin.com/pages/core/lambda/select/selectAll.html -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.yulichang</groupId>
|
|
||||||
<artifactId>mybatis-plus-join-boot-starter</artifactId>
|
|
||||||
<version>1.4.5</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -156,20 +143,6 @@
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- httpclient -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
|
||||||
<artifactId>httpclient</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>zhishuang.wang</groupId>
|
|
||||||
<artifactId>SanSiCMS</artifactId>
|
|
||||||
<version>1.0-SNAPSHOT</version>
|
|
||||||
<scope>system</scope>
|
|
||||||
<systemPath>${project.basedir}/lib/protocol/sansi/SanSiCMS.jar</systemPath>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
|
@ -4,8 +4,6 @@ import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
@ -21,34 +19,27 @@ public class BaseEntity implements Serializable
|
||||||
|
|
||||||
/** 搜索值 */
|
/** 搜索值 */
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@TableField(exist = false)
|
|
||||||
private String searchValue;
|
private String searchValue;
|
||||||
|
|
||||||
/** 创建者 */
|
/** 创建者 */
|
||||||
@TableField(exist = false)
|
|
||||||
private String createBy;
|
private String createBy;
|
||||||
|
|
||||||
/** 创建时间 */
|
/** 创建时间 */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@TableField(exist = false)
|
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
/** 更新者 */
|
/** 更新者 */
|
||||||
@TableField(exist = false)
|
|
||||||
private String updateBy;
|
private String updateBy;
|
||||||
|
|
||||||
/** 更新时间 */
|
/** 更新时间 */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@TableField(exist = false)
|
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
/** 备注 */
|
/** 备注 */
|
||||||
@TableField(exist = false)
|
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
/** 请求参数 */
|
/** 请求参数 */
|
||||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||||
@TableField(exist = false)
|
|
||||||
private Map<String, Object> params;
|
private Map<String, Object> params;
|
||||||
|
|
||||||
public String getSearchValue()
|
public String getSearchValue()
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
package com.ruoyi.common.utils.http;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* http 配置信息
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
public class HttpConf
|
|
||||||
{
|
|
||||||
// 获取连接的最大等待时间
|
|
||||||
public static int WAIT_TIMEOUT = 10000;
|
|
||||||
|
|
||||||
// 连接超时时间
|
|
||||||
public static int CONNECT_TIMEOUT = 10000;
|
|
||||||
|
|
||||||
// 读取超时时间
|
|
||||||
public static int SO_TIMEOUT = 60000;
|
|
||||||
|
|
||||||
// 最大连接数
|
|
||||||
public static int MAX_TOTAL_CONN = 200;
|
|
||||||
|
|
||||||
// 每个路由最大连接数
|
|
||||||
public static int MAX_ROUTE_CONN = 150;
|
|
||||||
|
|
||||||
// 重试次数
|
|
||||||
public static int RETRY_COUNT = 3;
|
|
||||||
|
|
||||||
// EPTWebServes地址
|
|
||||||
public static String EPTWEBSERVES_URL;
|
|
||||||
|
|
||||||
// tomcat默认keepAliveTimeout为20s
|
|
||||||
public static int KEEP_ALIVE_TIMEOUT;
|
|
||||||
}
|
|
|
@ -10,44 +10,13 @@ import java.net.SocketTimeoutException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLConnection;
|
import java.net.URLConnection;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.security.cert.CertificateException;
|
|
||||||
import java.security.cert.X509Certificate;
|
import java.security.cert.X509Certificate;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import javax.net.ssl.HostnameVerifier;
|
import javax.net.ssl.HostnameVerifier;
|
||||||
import javax.net.ssl.HttpsURLConnection;
|
import javax.net.ssl.HttpsURLConnection;
|
||||||
import javax.net.ssl.SSLContext;
|
import javax.net.ssl.SSLContext;
|
||||||
import javax.net.ssl.SSLSession;
|
import javax.net.ssl.SSLSession;
|
||||||
import javax.net.ssl.TrustManager;
|
import javax.net.ssl.TrustManager;
|
||||||
import javax.net.ssl.X509TrustManager;
|
import javax.net.ssl.X509TrustManager;
|
||||||
|
|
||||||
import org.apache.commons.collections4.MapUtils;
|
|
||||||
import org.apache.http.HttpEntity;
|
|
||||||
import org.apache.http.HttpResponse;
|
|
||||||
import org.apache.http.HttpStatus;
|
|
||||||
import org.apache.http.NameValuePair;
|
|
||||||
import org.apache.http.client.HttpRequestRetryHandler;
|
|
||||||
import org.apache.http.client.config.RequestConfig;
|
|
||||||
import org.apache.http.client.config.RequestConfig.Builder;
|
|
||||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
|
||||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
|
||||||
import org.apache.http.client.methods.HttpGet;
|
|
||||||
import org.apache.http.client.methods.HttpPost;
|
|
||||||
import org.apache.http.conn.ConnectTimeoutException;
|
|
||||||
import org.apache.http.conn.ConnectionKeepAliveStrategy;
|
|
||||||
import org.apache.http.conn.HttpClientConnectionManager;
|
|
||||||
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
|
|
||||||
import org.apache.http.conn.ssl.TrustStrategy;
|
|
||||||
import org.apache.http.entity.StringEntity;
|
|
||||||
import org.apache.http.impl.client.CloseableHttpClient;
|
|
||||||
import org.apache.http.impl.client.DefaultHttpRequestRetryHandler;
|
|
||||||
import org.apache.http.impl.client.HttpClients;
|
|
||||||
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
|
|
||||||
import org.apache.http.message.BasicNameValuePair;
|
|
||||||
import org.apache.http.protocol.HttpContext;
|
|
||||||
import org.apache.http.ssl.SSLContextBuilder;
|
|
||||||
import org.apache.http.util.EntityUtils;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import com.ruoyi.common.constant.Constants;
|
import com.ruoyi.common.constant.Constants;
|
||||||
|
@ -55,26 +24,13 @@ import com.ruoyi.common.utils.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通用http发送方法
|
* 通用http发送方法
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class HttpUtils
|
public class HttpUtils
|
||||||
{
|
{
|
||||||
private static final Logger log = LoggerFactory.getLogger(HttpUtils.class);
|
private static final Logger log = LoggerFactory.getLogger(HttpUtils.class);
|
||||||
|
|
||||||
public static RequestConfig requestConfig;
|
|
||||||
|
|
||||||
private static CloseableHttpClient httpClient;
|
|
||||||
|
|
||||||
private static PoolingHttpClientConnectionManager connMgr;
|
|
||||||
|
|
||||||
private static IdleConnectionMonitorThread idleThread;
|
|
||||||
|
|
||||||
static
|
|
||||||
{
|
|
||||||
HttpUtils.initClient();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 向指定 URL 发送GET方法的请求
|
* 向指定 URL 发送GET方法的请求
|
||||||
*
|
*
|
||||||
|
@ -103,7 +59,7 @@ public class HttpUtils
|
||||||
*
|
*
|
||||||
* @param url 发送请求的 URL
|
* @param url 发送请求的 URL
|
||||||
* @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
|
* @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
|
||||||
* @param contentType 内容类型 编码类型
|
* @param contentType 编码类型
|
||||||
* @return 所代表远程资源的响应结果
|
* @return 所代表远程资源的响应结果
|
||||||
*/
|
*/
|
||||||
public static String sendGet(String url, String param, String contentType)
|
public static String sendGet(String url, String param, String contentType)
|
||||||
|
@ -260,7 +216,7 @@ public class HttpUtils
|
||||||
String ret = "";
|
String ret = "";
|
||||||
while ((ret = br.readLine()) != null)
|
while ((ret = br.readLine()) != null)
|
||||||
{
|
{
|
||||||
if (ret != null && !ret.trim().equals(""))
|
if (ret != null && !"".equals(ret.trim()))
|
||||||
{
|
{
|
||||||
result.append(new String(ret.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8));
|
result.append(new String(ret.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
|
@ -315,479 +271,4 @@ public class HttpUtils
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取httpClient
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static CloseableHttpClient getHttpClient()
|
|
||||||
{
|
|
||||||
if (httpClient != null)
|
|
||||||
{
|
|
||||||
return httpClient;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return HttpClients.createDefault();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建连接池管理器
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private static PoolingHttpClientConnectionManager createConnectionManager()
|
|
||||||
{
|
|
||||||
|
|
||||||
PoolingHttpClientConnectionManager connMgr = new PoolingHttpClientConnectionManager();
|
|
||||||
// 将最大连接数增加到
|
|
||||||
connMgr.setMaxTotal(HttpConf.MAX_TOTAL_CONN);
|
|
||||||
// 将每个路由基础的连接增加到
|
|
||||||
connMgr.setDefaultMaxPerRoute(HttpConf.MAX_ROUTE_CONN);
|
|
||||||
|
|
||||||
return connMgr;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据当前配置创建HTTP请求配置参数。
|
|
||||||
*
|
|
||||||
* @return 返回HTTP请求配置。
|
|
||||||
*/
|
|
||||||
private static RequestConfig createRequestConfig()
|
|
||||||
{
|
|
||||||
Builder builder = RequestConfig.custom();
|
|
||||||
builder.setConnectionRequestTimeout(StringUtils.nvl(HttpConf.WAIT_TIMEOUT, 10000));
|
|
||||||
builder.setConnectTimeout(StringUtils.nvl(HttpConf.CONNECT_TIMEOUT, 10000));
|
|
||||||
builder.setSocketTimeout(StringUtils.nvl(HttpConf.SO_TIMEOUT, 60000));
|
|
||||||
return builder.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建默认的HTTPS客户端,信任所有的证书。
|
|
||||||
*
|
|
||||||
* @return 返回HTTPS客户端,如果创建失败,返回HTTP客户端。
|
|
||||||
*/
|
|
||||||
private static CloseableHttpClient createHttpClient(HttpClientConnectionManager connMgr)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
final SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustStrategy()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException
|
|
||||||
{
|
|
||||||
// 信任所有
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}).build();
|
|
||||||
final SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslContext);
|
|
||||||
|
|
||||||
// 重试机制
|
|
||||||
HttpRequestRetryHandler retryHandler = new DefaultHttpRequestRetryHandler(HttpConf.RETRY_COUNT, true);
|
|
||||||
ConnectionKeepAliveStrategy connectionKeepAliveStrategy = new ConnectionKeepAliveStrategy()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public long getKeepAliveDuration(HttpResponse httpResponse, HttpContext httpContext)
|
|
||||||
{
|
|
||||||
return HttpConf.KEEP_ALIVE_TIMEOUT; // tomcat默认keepAliveTimeout为20s
|
|
||||||
}
|
|
||||||
};
|
|
||||||
httpClient = HttpClients.custom().setSSLSocketFactory(sslsf).setConnectionManager(connMgr)
|
|
||||||
.setDefaultRequestConfig(requestConfig).setRetryHandler(retryHandler)
|
|
||||||
.setKeepAliveStrategy(connectionKeepAliveStrategy).build();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
log.error("Create http client failed", e);
|
|
||||||
httpClient = HttpClients.createDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
return httpClient;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 初始化 只需调用一次
|
|
||||||
*/
|
|
||||||
public synchronized static CloseableHttpClient initClient()
|
|
||||||
{
|
|
||||||
if (httpClient == null)
|
|
||||||
{
|
|
||||||
connMgr = createConnectionManager();
|
|
||||||
requestConfig = createRequestConfig();
|
|
||||||
// 初始化httpClient连接池
|
|
||||||
httpClient = createHttpClient(connMgr);
|
|
||||||
// 清理连接池
|
|
||||||
idleThread = new IdleConnectionMonitorThread(connMgr);
|
|
||||||
idleThread.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
return httpClient;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关闭HTTP客户端。
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public synchronized static void shutdown()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (idleThread != null)
|
|
||||||
{
|
|
||||||
idleThread.shutdown();
|
|
||||||
idleThread = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
log.error("httpclient connection manager close", e);
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (httpClient != null)
|
|
||||||
{
|
|
||||||
httpClient.close();
|
|
||||||
httpClient = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
log.error("httpclient close", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求上游 GET提交
|
|
||||||
*
|
|
||||||
* @param uri URL
|
|
||||||
* @throws IOException IO异常
|
|
||||||
*/
|
|
||||||
public static String getCall(final String uri) throws Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
return getCall(uri, null, null, Constants.UTF8);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求上游 GET提交
|
|
||||||
*
|
|
||||||
* @param uri URL
|
|
||||||
* @throws IOException IO异常
|
|
||||||
*/
|
|
||||||
public static String getCall(final String uri, Map<String, String> header) throws Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
return getCall(uri, null, header, Constants.UTF8);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求上游 GET提交
|
|
||||||
*
|
|
||||||
* @param uri URL
|
|
||||||
* @param contentType 内容类型
|
|
||||||
* @throws IOException IO异常
|
|
||||||
*/
|
|
||||||
public static String getCall(final String uri, String contentType) throws Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
return getCall(uri, contentType, null, Constants.UTF8);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求上游 GET提交
|
|
||||||
*
|
|
||||||
* @param uri URL
|
|
||||||
* @param contentType 内容类型
|
|
||||||
* @param charsetName 编码格式
|
|
||||||
* @throws IOException IO异常
|
|
||||||
*/
|
|
||||||
public static String getCall(final String uri, String contentType, Map<String, String> header, String charsetName) throws Exception
|
|
||||||
{
|
|
||||||
final String url = uri;
|
|
||||||
final HttpGet httpGet = new HttpGet(url);
|
|
||||||
httpGet.setConfig(requestConfig);
|
|
||||||
if (!StringUtils.isEmpty(contentType)) {
|
|
||||||
httpGet.addHeader("Content-Type", contentType);
|
|
||||||
}
|
|
||||||
if (!MapUtils.isEmpty(header)) {
|
|
||||||
header.forEach(httpGet::addHeader);
|
|
||||||
}
|
|
||||||
final CloseableHttpResponse httpRsp = getHttpClient().execute(httpGet);
|
|
||||||
try {
|
|
||||||
if (httpRsp.getStatusLine().getStatusCode() == HttpStatus.SC_OK
|
|
||||||
|| httpRsp.getStatusLine().getStatusCode() == HttpStatus.SC_FORBIDDEN) {
|
|
||||||
final HttpEntity entity = httpRsp.getEntity();
|
|
||||||
final String rspText = EntityUtils.toString(entity, charsetName);
|
|
||||||
EntityUtils.consume(entity);
|
|
||||||
return rspText;
|
|
||||||
} else {
|
|
||||||
throw new IOException("HTTP StatusCode=" + httpRsp.getStatusLine().getStatusCode());
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
try {
|
|
||||||
httpRsp.close();
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("关闭httpRsp异常", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求上游 POST提交
|
|
||||||
*
|
|
||||||
* @param uri URL
|
|
||||||
* @param paramsMap 参数
|
|
||||||
* @throws IOException IO异常
|
|
||||||
*/
|
|
||||||
public static String postCall(final String uri, Map<String, Object> paramsMap) throws Exception
|
|
||||||
{
|
|
||||||
return postCall(uri, null, paramsMap, Constants.UTF8, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求上游 POST提交
|
|
||||||
*
|
|
||||||
* @param uri URL url
|
|
||||||
* @param paramsMap 参数 参数
|
|
||||||
* @param header 请求头
|
|
||||||
* @throws IOException IO异常 异常
|
|
||||||
*/
|
|
||||||
public static String postCall(final String uri, Map<String, Object> paramsMap, Map<String, String> header) throws Exception
|
|
||||||
{
|
|
||||||
return postCall(uri, null, paramsMap, Constants.UTF8, header);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求上游 POST提交
|
|
||||||
*
|
|
||||||
* @param uri URL
|
|
||||||
* @param contentType 内容类型
|
|
||||||
* @param paramsMap 参数
|
|
||||||
* @throws IOException IO异常
|
|
||||||
*/
|
|
||||||
// public static String postCall(final String uri, String contentType, Map<String, Object> paramsMap) throws Exception {
|
|
||||||
//
|
|
||||||
// return postCall(uri, contentType, paramsMap, Constants.UTF8, null);
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求上游 POST提交
|
|
||||||
*
|
|
||||||
* @param uri URL
|
|
||||||
* @param contentType 内容类型
|
|
||||||
* @param paramsMap 参数
|
|
||||||
* @throws IOException IO异常
|
|
||||||
*/
|
|
||||||
public static String postCall(final String uri, String contentType, Map<String, Object> paramsMap, Map<String,String> header) throws Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
return postCall(uri, contentType, paramsMap, Constants.UTF8, header);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求上游 POST提交
|
|
||||||
*
|
|
||||||
* @param uri URL
|
|
||||||
* @param contentType 内容类型
|
|
||||||
* @param paramsMap 参数
|
|
||||||
* @param charsetName 编码格式
|
|
||||||
* @throws IOException IO异常
|
|
||||||
*/
|
|
||||||
public static String postCall(final String uri, String contentType, Map<String, Object> paramsMap,
|
|
||||||
String charsetName, Map<String, String> header) throws Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
final String url = uri;
|
|
||||||
final HttpPost httpPost = new HttpPost(url);
|
|
||||||
httpPost.setConfig(requestConfig);
|
|
||||||
if (!StringUtils.isEmpty(contentType))
|
|
||||||
{
|
|
||||||
httpPost.addHeader("Content-Type", contentType);
|
|
||||||
}
|
|
||||||
if (!MapUtils.isEmpty(header)) {
|
|
||||||
header.forEach(httpPost::addHeader);
|
|
||||||
}
|
|
||||||
// 添加参数
|
|
||||||
List<NameValuePair> list = new ArrayList<>();
|
|
||||||
if (paramsMap != null)
|
|
||||||
{
|
|
||||||
for (Map.Entry<String, Object> entry : paramsMap.entrySet())
|
|
||||||
{
|
|
||||||
list.add(new BasicNameValuePair(entry.getKey(), (String) entry.getValue()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
httpPost.setEntity(new UrlEncodedFormEntity(list, charsetName));
|
|
||||||
|
|
||||||
final CloseableHttpResponse httpRsp = getHttpClient().execute(httpPost);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (httpRsp.getStatusLine().getStatusCode() == HttpStatus.SC_OK)
|
|
||||||
{
|
|
||||||
final HttpEntity entity = httpRsp.getEntity();
|
|
||||||
final String rspText = EntityUtils.toString(entity, charsetName);
|
|
||||||
EntityUtils.consume(entity);
|
|
||||||
return rspText;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw new IOException("HTTP StatusCode=" + httpRsp.getStatusLine().getStatusCode());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
httpRsp.close();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
log.error("关闭httpRsp异常", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求上游 POST提交
|
|
||||||
*
|
|
||||||
* @param uri URL
|
|
||||||
* @param param
|
|
||||||
* @throws IOException IO异常
|
|
||||||
*/
|
|
||||||
public static String postCall(final String uri, String param) throws Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
return postCall(uri, null, param, Constants.UTF8, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求上游 POST提交
|
|
||||||
*
|
|
||||||
* @param uri URL
|
|
||||||
* @param param
|
|
||||||
* @throws IOException IO异常
|
|
||||||
*/
|
|
||||||
public static String postCall(final String uri, String param, Map<String, String> header) throws Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
return postCall(uri, null, param, Constants.UTF8, header);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求上游 POST提交
|
|
||||||
*
|
|
||||||
* @param uri URL
|
|
||||||
* @param contentType 内容类型
|
|
||||||
* @param param
|
|
||||||
* @throws IOException IO异常
|
|
||||||
*/
|
|
||||||
public static String postCall(final String uri, String contentType, String param) throws Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
return postCall(uri, contentType, param, Constants.UTF8, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求上游 POST提交
|
|
||||||
*
|
|
||||||
* @param uri URL
|
|
||||||
* @param contentType 内容类型
|
|
||||||
* @param param
|
|
||||||
* @param charsetName 编码格式
|
|
||||||
* @throws IOException IO异常
|
|
||||||
*/
|
|
||||||
public static String postCall(final String uri, String contentType, String param, String charsetName, Map<String, String> header)
|
|
||||||
throws Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
final String url = uri;
|
|
||||||
final HttpPost httpPost = new HttpPost(url);
|
|
||||||
httpPost.setConfig(requestConfig);
|
|
||||||
if (!StringUtils.isEmpty(contentType))
|
|
||||||
{
|
|
||||||
httpPost.addHeader("Content-Type", contentType);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
httpPost.addHeader("Content-Type", "application/json");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!MapUtils.isEmpty(header)) {
|
|
||||||
header.forEach(httpPost::addHeader);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 添加参数
|
|
||||||
StringEntity paramEntity = new StringEntity(param, charsetName);
|
|
||||||
httpPost.setEntity(paramEntity);
|
|
||||||
|
|
||||||
final CloseableHttpResponse httpRsp = getHttpClient().execute(httpPost);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (httpRsp.getStatusLine().getStatusCode() == HttpStatus.SC_OK)
|
|
||||||
{
|
|
||||||
final HttpEntity entity = httpRsp.getEntity();
|
|
||||||
final String rspText = EntityUtils.toString(entity, charsetName);
|
|
||||||
EntityUtils.consume(entity);
|
|
||||||
return rspText;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw new IOException("HTTP StatusCode=" + httpRsp.getStatusLine().getStatusCode());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
httpRsp.close();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
log.error("关闭httpRsp异常", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 判断HTTP异常是否为读取超时。
|
|
||||||
*
|
|
||||||
* @param e 异常对象。
|
|
||||||
* @return 如果是读取引起的异常(而非连接),则返回true;否则返回false。
|
|
||||||
*/
|
|
||||||
public static boolean isReadTimeout(final Throwable e)
|
|
||||||
{
|
|
||||||
return (!isCausedBy(e, ConnectTimeoutException.class) && isCausedBy(e, SocketTimeoutException.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检测异常e被触发的原因是不是因为异常cause。检测被封装的异常。
|
|
||||||
*
|
|
||||||
* @param e 捕获的异常。
|
|
||||||
* @param cause 异常触发原因。
|
|
||||||
* @return 如果异常e是由cause类异常触发,则返回true;否则返回false。
|
|
||||||
*/
|
|
||||||
public static boolean isCausedBy(final Throwable e, final Class<? extends Throwable> cause)
|
|
||||||
{
|
|
||||||
if (cause.isAssignableFrom(e.getClass()))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Throwable t = e.getCause();
|
|
||||||
while (t != null && t != e)
|
|
||||||
{
|
|
||||||
if (cause.isAssignableFrom(t.getClass()))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
t = t.getCause();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -1,72 +0,0 @@
|
||||||
package com.ruoyi.common.utils.http;
|
|
||||||
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
import org.apache.http.conn.HttpClientConnectionManager;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 连接池清理
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
public class IdleConnectionMonitorThread extends Thread
|
|
||||||
{
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(IdleConnectionMonitorThread.class);
|
|
||||||
|
|
||||||
private final HttpClientConnectionManager connMgr;
|
|
||||||
|
|
||||||
private volatile boolean shutdown;
|
|
||||||
|
|
||||||
public IdleConnectionMonitorThread(HttpClientConnectionManager connMgr)
|
|
||||||
{
|
|
||||||
super();
|
|
||||||
this.shutdown = false;
|
|
||||||
this.connMgr = connMgr;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
while (!shutdown)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
synchronized (this)
|
|
||||||
{
|
|
||||||
// 每5秒检查一次关闭连接
|
|
||||||
wait(HttpConf.KEEP_ALIVE_TIMEOUT / 4);
|
|
||||||
// 关闭失效的连接
|
|
||||||
connMgr.closeExpiredConnections();
|
|
||||||
// 可选的, 关闭20秒内不活动的连接
|
|
||||||
connMgr.closeIdleConnections(HttpConf.KEEP_ALIVE_TIMEOUT, TimeUnit.MILLISECONDS);
|
|
||||||
// log.debug("关闭失效的连接");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
log.error("关闭失效连接异常", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void shutdown()
|
|
||||||
{
|
|
||||||
shutdown = true;
|
|
||||||
if (connMgr != null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
connMgr.shutdown();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
log.error("连接池异常", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
synchronized (this)
|
|
||||||
{
|
|
||||||
notifyAll();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
package com.ruoyi.common.utils.http;
|
|
||||||
|
|
||||||
import io.netty.handler.codec.http.HttpUtil;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
|
|
||||||
class HttpUtilsTest {
|
|
||||||
|
|
||||||
void getCall() throws Exception {
|
|
||||||
Map<String, Object> paramsMap = new HashMap<>();
|
|
||||||
paramsMap.put("id", "1");
|
|
||||||
paramsMap.put("name", "ruoyi");
|
|
||||||
|
|
||||||
String json = "{\"id\": 1, \"name\": \"ry\"}";
|
|
||||||
String uri = "http://localhost:8080/sensor/data/judge";
|
|
||||||
|
|
||||||
HttpUtils.postCall(uri, paramsMap);
|
|
||||||
HttpUtils.postCall(uri, json);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,6 +1,5 @@
|
||||||
package com.ruoyi.framework.manager;
|
package com.ruoyi.framework.manager;
|
||||||
|
|
||||||
import com.ruoyi.common.utils.http.HttpUtils;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
@ -20,7 +19,6 @@ public class ShutdownManager
|
||||||
public void destroy()
|
public void destroy()
|
||||||
{
|
{
|
||||||
shutdownAsyncManager();
|
shutdownAsyncManager();
|
||||||
HttpUtils.shutdown();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
import java.math.BigDecimal;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@ -13,7 +12,7 @@ import lombok.EqualsAndHashCode;
|
||||||
* 警报计划表
|
* 警报计划表
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper=true)
|
||||||
@TableName(value = "pub_alert_plan")
|
@TableName(value = "pub_alert_plan")
|
||||||
public class AlertPlan extends BaseEntity {
|
public class AlertPlan extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
|
@ -38,13 +37,13 @@ public class AlertPlan extends BaseEntity {
|
||||||
* 最大值
|
* 最大值
|
||||||
*/
|
*/
|
||||||
@TableField(value = "max_value")
|
@TableField(value = "max_value")
|
||||||
private BigDecimal maxValue;
|
private Integer maxValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 最小值
|
* 最小值
|
||||||
*/
|
*/
|
||||||
@TableField(value = "min_value")
|
@TableField(value = "min_value")
|
||||||
private BigDecimal minValue;
|
private Integer minValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 显示内容
|
* 显示内容
|
||||||
|
|
|
@ -1,129 +0,0 @@
|
||||||
package com.ruoyi.board.domain;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import java.util.Date;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 预置信息及模版表
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@TableName(value = "pub_preset_content")
|
|
||||||
public class PresetContent {
|
|
||||||
/**
|
|
||||||
* 主键自增
|
|
||||||
*/
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 预置信息名称
|
|
||||||
*/
|
|
||||||
@TableField(value = "`name`")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 情报板尺寸
|
|
||||||
*/
|
|
||||||
@TableField(value = "board_size")
|
|
||||||
private String boardSize;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 信息类型
|
|
||||||
*/
|
|
||||||
@TableField(value = "info_type")
|
|
||||||
private Integer infoType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 预置内容
|
|
||||||
*/
|
|
||||||
@TableField(value = "content")
|
|
||||||
private String content;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 预览路径
|
|
||||||
*/
|
|
||||||
@TableField(value = "preview_path")
|
|
||||||
private String previewPath;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 字体样式
|
|
||||||
*/
|
|
||||||
@TableField(value = "font_style")
|
|
||||||
private String fontStyle;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 字体大小
|
|
||||||
*/
|
|
||||||
@TableField(value = "font_size")
|
|
||||||
private Integer fontSize;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 字体间距
|
|
||||||
*/
|
|
||||||
@TableField(value = "letter_spacing")
|
|
||||||
private Integer letterSpacing;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 字体颜色
|
|
||||||
*/
|
|
||||||
@TableField(value = "font_color")
|
|
||||||
private String fontColor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 字体坐标X
|
|
||||||
*/
|
|
||||||
@TableField(value = "font_position_x")
|
|
||||||
private Integer fontPositionX;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 字体坐标Y
|
|
||||||
*/
|
|
||||||
@TableField(value = "font_position_y")
|
|
||||||
private Integer fontPositionY;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 播放时间
|
|
||||||
*/
|
|
||||||
@TableField(value = "play_time")
|
|
||||||
private Integer playTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 当前预置类型 1:内置模版 0:预发布信息
|
|
||||||
*/
|
|
||||||
@TableField(value = "preset_type")
|
|
||||||
private Integer presetType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
@TableField(value = "remark")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
@TableField(value = "create_time")
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
@TableField(value = "update_time")
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建人id
|
|
||||||
*/
|
|
||||||
@TableField(value = "create_by")
|
|
||||||
private Integer createBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新人id
|
|
||||||
*/
|
|
||||||
@TableField(value = "update_by")
|
|
||||||
private Integer updateBy;
|
|
||||||
}
|
|
|
@ -1,45 +0,0 @@
|
||||||
package com.ruoyi.board.domain;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import java.util.Date;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布记录表
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@TableName(value = "pub_release_record")
|
|
||||||
public class ReleaseRecord {
|
|
||||||
/**
|
|
||||||
* 主键自增
|
|
||||||
*/
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 情报板ID
|
|
||||||
*/
|
|
||||||
@TableField(value = "board_id")
|
|
||||||
private Integer boardId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 预置信息ID
|
|
||||||
*/
|
|
||||||
@TableField(value = "preset_content_id")
|
|
||||||
private Integer presetContentId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
@TableField(value = "create_time")
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建人
|
|
||||||
*/
|
|
||||||
@TableField(value = "created_by")
|
|
||||||
private Integer createdBy;
|
|
||||||
}
|
|
|
@ -1,48 +0,0 @@
|
||||||
package com.ruoyi.board.domain;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布记录表
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class ReleaseRecordDto {
|
|
||||||
/**
|
|
||||||
* 主键自增
|
|
||||||
*/
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 情报板ID
|
|
||||||
*/
|
|
||||||
@TableField(value = "board_id")
|
|
||||||
private Integer boardId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 预置信息ID
|
|
||||||
*/
|
|
||||||
@TableField(value = "preset_content_id")
|
|
||||||
private Integer presetContentId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
@TableField(value = "create_time")
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建人
|
|
||||||
*/
|
|
||||||
@TableField(value = "created_by")
|
|
||||||
private Integer createdBy;
|
|
||||||
|
|
||||||
@TableField(value = "info_type")
|
|
||||||
private Integer infoType;
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
package com.ruoyi.board.domain.enums;
|
|
||||||
|
|
||||||
public class AlertPlanType {
|
|
||||||
|
|
||||||
public static int getPlanTypeByName(String planTypeName) {
|
|
||||||
// 0:雾,1:雨,2:雪
|
|
||||||
switch (planTypeName) {
|
|
||||||
case "雾":
|
|
||||||
return 0;
|
|
||||||
case "雨":
|
|
||||||
return 1;
|
|
||||||
case "雪":
|
|
||||||
return 2;
|
|
||||||
default:
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.ruoyi.board.mapper;
|
package com.ruoyi.board.mapper;
|
||||||
|
|
||||||
import com.github.yulichang.base.MPJBaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.ruoyi.board.domain.AlertPlan;
|
import com.ruoyi.board.domain.AlertPlan;
|
||||||
|
|
||||||
public interface AlertPlanMapper extends MPJBaseMapper<AlertPlan> {
|
public interface AlertPlanMapper extends BaseMapper<AlertPlan> {
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
package com.ruoyi.board.mapper;
|
package com.ruoyi.board.mapper;
|
||||||
|
|
||||||
import com.github.yulichang.base.MPJBaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.ruoyi.board.domain.BoardInfo;
|
import com.ruoyi.board.domain.BoardInfo;
|
||||||
|
|
||||||
public interface BoardInfoMapper extends MPJBaseMapper<BoardInfo> {
|
public interface BoardInfoMapper extends BaseMapper<BoardInfo> {
|
||||||
}
|
}
|
|
@ -1,7 +0,0 @@
|
||||||
package com.ruoyi.board.mapper;
|
|
||||||
|
|
||||||
import com.github.yulichang.base.MPJBaseMapper;
|
|
||||||
import com.ruoyi.board.domain.PresetContent;
|
|
||||||
|
|
||||||
public interface PresetContentMapper extends MPJBaseMapper<PresetContent> {
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
package com.ruoyi.board.mapper;
|
|
||||||
|
|
||||||
import com.github.yulichang.base.MPJBaseMapper;
|
|
||||||
import com.ruoyi.board.domain.ReleaseRecord;
|
|
||||||
|
|
||||||
public interface ReleaseRecordMapper extends MPJBaseMapper<ReleaseRecord> {
|
|
||||||
}
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
package com.ruoyi.board.service;
|
||||||
|
|
||||||
|
import com.ruoyi.board.domain.AlertPlan;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
public interface AlertPlanService extends IService<AlertPlan>{
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
package com.ruoyi.board.service;
|
||||||
|
|
||||||
|
import com.ruoyi.board.domain.BoardInfo;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
public interface BoardInfoService extends IService<BoardInfo>{
|
||||||
|
}
|
|
@ -1,13 +0,0 @@
|
||||||
package com.ruoyi.board.service;
|
|
||||||
|
|
||||||
import com.github.yulichang.base.MPJBaseService;
|
|
||||||
import com.ruoyi.board.domain.AlertPlan;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface IAlertPlanService extends MPJBaseService<AlertPlan> {
|
|
||||||
|
|
||||||
List<AlertPlan> selectList(AlertPlan alertPlan);
|
|
||||||
|
|
||||||
AlertPlan getOneByTypeAndValue(Integer type, Double value);
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
package com.ruoyi.board.service;
|
|
||||||
|
|
||||||
import com.github.yulichang.base.MPJBaseService;
|
|
||||||
import com.ruoyi.board.domain.BoardInfo;
|
|
||||||
|
|
||||||
public interface IBoardInfoService extends MPJBaseService<BoardInfo> {
|
|
||||||
|
|
||||||
BoardInfo getOneByIP(String ip);
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
package com.ruoyi.board.service;
|
|
||||||
|
|
||||||
import com.github.yulichang.base.MPJBaseService;
|
|
||||||
import com.ruoyi.board.domain.PresetContent;
|
|
||||||
|
|
||||||
public interface IPresetContentService extends MPJBaseService<PresetContent> {
|
|
||||||
|
|
||||||
PresetContent getOneByContentAndBoardSize(String content, String boardSize, Integer type);
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
package com.ruoyi.board.service;
|
|
||||||
|
|
||||||
import com.github.yulichang.base.MPJBaseService;
|
|
||||||
import com.ruoyi.board.domain.ReleaseRecord;
|
|
||||||
|
|
||||||
public interface IReleaseRecordService extends MPJBaseService<ReleaseRecord> {
|
|
||||||
|
|
||||||
ReleaseRecord getOneLatestByBoardId(String boardId, Integer type);
|
|
||||||
}
|
|
|
@ -1,36 +1,11 @@
|
||||||
package com.ruoyi.board.service.impl;
|
package com.ruoyi.board.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.ruoyi.board.domain.AlertPlan;
|
import com.ruoyi.board.domain.AlertPlan;
|
||||||
import com.ruoyi.board.mapper.AlertPlanMapper;
|
import com.ruoyi.board.mapper.AlertPlanMapper;
|
||||||
import com.ruoyi.board.service.IAlertPlanService;
|
import com.ruoyi.board.service.AlertPlanService;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class AlertPlanServiceImpl extends MPJBaseServiceImpl<AlertPlanMapper, AlertPlan> implements IAlertPlanService {
|
public class AlertPlanServiceImpl extends ServiceImpl<AlertPlanMapper, AlertPlan> implements AlertPlanService{
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<AlertPlan> selectList(AlertPlan alertPlan) {
|
|
||||||
LambdaQueryWrapper<AlertPlan> alertPlanLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
alertPlanLambdaQueryWrapper.eq(ObjectUtils.isNotEmpty(alertPlan.getType()), AlertPlan::getType, alertPlan.getType());
|
|
||||||
alertPlanLambdaQueryWrapper.eq(ObjectUtils.isNotEmpty(alertPlan.getLevel()), AlertPlan::getLevel, alertPlan.getLevel());
|
|
||||||
return list(alertPlanLambdaQueryWrapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public AlertPlan getOneByTypeAndValue(Integer planType, Double value) {
|
|
||||||
if (planType < 0) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
LambdaQueryWrapper<AlertPlan> alertPlanLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
alertPlanLambdaQueryWrapper
|
|
||||||
.eq(AlertPlan::getType, planType)
|
|
||||||
.le(AlertPlan::getMinValue, value)
|
|
||||||
.ge(AlertPlan::getMaxValue, value);
|
|
||||||
return getOne(alertPlanLambdaQueryWrapper);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,19 +1,12 @@
|
||||||
package com.ruoyi.board.service.impl;
|
package com.ruoyi.board.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import java.util.List;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.ruoyi.board.mapper.BoardInfoMapper;
|
import com.ruoyi.board.mapper.BoardInfoMapper;
|
||||||
import com.ruoyi.board.domain.BoardInfo;
|
import com.ruoyi.board.domain.BoardInfo;
|
||||||
import com.ruoyi.board.service.IBoardInfoService;
|
import com.ruoyi.board.service.BoardInfoService;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class BoardInfoServiceImpl extends MPJBaseServiceImpl<BoardInfoMapper, BoardInfo> implements IBoardInfoService {
|
public class BoardInfoServiceImpl extends ServiceImpl<BoardInfoMapper, BoardInfo> implements BoardInfoService{
|
||||||
|
|
||||||
@Override
|
|
||||||
public BoardInfo getOneByIP(String ip) {
|
|
||||||
LambdaQueryWrapper<BoardInfo> boardInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
boardInfoLambdaQueryWrapper.eq(BoardInfo::getBoardIp, ip);
|
|
||||||
return getOne(boardInfoLambdaQueryWrapper);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
package com.ruoyi.board.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import com.ruoyi.board.mapper.PresetContentMapper;
|
|
||||||
import com.ruoyi.board.domain.PresetContent;
|
|
||||||
import com.ruoyi.board.service.IPresetContentService;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class PresetContentServiceImpl extends MPJBaseServiceImpl<PresetContentMapper, PresetContent> implements IPresetContentService {
|
|
||||||
@Override
|
|
||||||
public PresetContent getOneByContentAndBoardSize(String content, String boardSize, Integer type) {
|
|
||||||
LambdaQueryWrapper<PresetContent> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper
|
|
||||||
.eq(PresetContent::getContent, content)
|
|
||||||
.eq(PresetContent::getBoardSize, boardSize)
|
|
||||||
.eq(PresetContent::getInfoType, type);
|
|
||||||
return getOne(queryWrapper);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
package com.ruoyi.board.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
||||||
import com.ruoyi.board.domain.PresetContent;
|
|
||||||
import com.ruoyi.board.domain.ReleaseRecordDto;
|
|
||||||
import lombok.Data;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import com.ruoyi.board.domain.ReleaseRecord;
|
|
||||||
import com.ruoyi.board.mapper.ReleaseRecordMapper;
|
|
||||||
import com.ruoyi.board.service.IReleaseRecordService;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class ReleaseRecordServiceImpl extends MPJBaseServiceImpl<ReleaseRecordMapper, ReleaseRecord> implements IReleaseRecordService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ReleaseRecord getOneLatestByBoardId(String boardId, Integer type) {
|
|
||||||
// LambdaQueryWrapper<ReleaseRecord> releaseRecordLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
// releaseRecordLambdaQueryWrapper
|
|
||||||
// .eq(ReleaseRecord::getBoardId, boardId)
|
|
||||||
// .orderByDesc(ReleaseRecord::getCreateTime)
|
|
||||||
// .last("LIMIT 1");
|
|
||||||
|
|
||||||
ReleaseRecordDto releaseRecord = selectJoinOne(ReleaseRecordDto.class,
|
|
||||||
new MPJLambdaWrapper<ReleaseRecord>()
|
|
||||||
.selectAll(ReleaseRecord.class)
|
|
||||||
.select(PresetContent::getInfoType)
|
|
||||||
.leftJoin(PresetContent.class, PresetContent::getId, ReleaseRecord::getPresetContentId)
|
|
||||||
.eq(ReleaseRecord::getBoardId, boardId)
|
|
||||||
.eq(PresetContent::getInfoType, type)
|
|
||||||
.orderByDesc(ReleaseRecord::getCreateTime)
|
|
||||||
.last("LIMIT 1")
|
|
||||||
);
|
|
||||||
System.out.println(releaseRecord);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,112 +0,0 @@
|
||||||
package com.ruoyi.protocol.sansi;
|
|
||||||
|
|
||||||
import com.ruoyi.board.domain.BoardInfo;
|
|
||||||
import com.ruoyi.board.domain.PresetContent;
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
import com.ruoyi.common.utils.uuid.UUID;
|
|
||||||
import com.ruoyi.protocol.sansi.enums.SanSiFontColor;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import zhishuang.wang.sansi.fcms.devinfor.DeviceControl;
|
|
||||||
import zhishuang.wang.sansi.fcms.devinfor.DeviceVar;
|
|
||||||
import zhishuang.wang.sansi.playlist.AreaItem;
|
|
||||||
import zhishuang.wang.sansi.playlist.PageItem;
|
|
||||||
import zhishuang.wang.sansi.playlist.PlayItem;
|
|
||||||
import zhishuang.wang.sansi.playlist.entry.*;
|
|
||||||
import zhishuang.wang.sansi.playlist.fcms.PlayListFcms;
|
|
||||||
import zhishuang.wang.sansi.tools.ReturnData;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class SanSiProtocol {
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(SanSiProtocol.class);
|
|
||||||
|
|
||||||
String deviceId = "1";
|
|
||||||
|
|
||||||
public String createTextItem(PresetContent presetContent, BoardInfo boardInfo) {
|
|
||||||
Animation animation = new Animation();
|
|
||||||
animation.setInAnimation(0);
|
|
||||||
animation.setInAnimationSpeed(200);
|
|
||||||
|
|
||||||
TextBase textBase = new TextBase(0, presetContent.getContent());
|
|
||||||
textBase.setFontSize(presetContent.getFontSize()+","+presetContent.getFontSize());
|
|
||||||
textBase.setFontName(presetContent.getFontStyle());
|
|
||||||
textBase.setWordSpace(presetContent.getLetterSpacing());
|
|
||||||
BaseColour fontColour = SanSiFontColor.getBaseColourByColorName(presetContent.getFontColor());
|
|
||||||
if (null == fontColour) {
|
|
||||||
log.error("BaseColour fontColour = SanSiFontColor.getBaseColourByColorName(presetContent.getFontColor()); 没有匹配到相应的字体颜色");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
textBase.setFontColour(fontColour);
|
|
||||||
|
|
||||||
PlayTimeBase textPlayTime = new PlayTimeBase(presetContent.getPlayTime());
|
|
||||||
PlayItem textPlayItem = new PlayItem(1, "1", "test", textBase, textPlayTime);
|
|
||||||
textPlayItem.setAnimation(animation);
|
|
||||||
textPlayItem.setX(presetContent.getFontPositionX());
|
|
||||||
textPlayItem.setY(presetContent.getFontPositionY());
|
|
||||||
|
|
||||||
List<PlayItem> playItemList = new ArrayList<>();
|
|
||||||
playItemList.add(textPlayItem);
|
|
||||||
|
|
||||||
String boardSize = boardInfo.getBoardSize();
|
|
||||||
String[] split = StringUtils.split(boardSize, "*");
|
|
||||||
if (split.length < 2) {
|
|
||||||
log.info("尺寸有问题,请重新设置尺寸");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
int height = Integer.parseInt(split[0]);
|
|
||||||
int width = Integer.parseInt(split[1]);
|
|
||||||
|
|
||||||
AreaPositon areaPositon = new AreaPositon(0, 0, height, width, 0);
|
|
||||||
AreaItem areaItem = new AreaItem("1", "areaItem", areaPositon, playItemList);
|
|
||||||
|
|
||||||
List<AreaItem> areaItemList = new ArrayList<>();
|
|
||||||
areaItemList.add(areaItem);
|
|
||||||
|
|
||||||
PageItem pageItem = new PageItem("1", "pageItem", areaItemList);
|
|
||||||
PlayListFcms plf = new PlayListFcms();
|
|
||||||
|
|
||||||
String path = "./sansi/" + UUID.fastUUID() + "/play.lst";
|
|
||||||
File file = new File(path);
|
|
||||||
if (file.exists()) {
|
|
||||||
file.delete();
|
|
||||||
}
|
|
||||||
|
|
||||||
ReturnData rd = plf.createFcmsPlayList(path, pageItem);
|
|
||||||
System.out.println("====" + rd.getCode());
|
|
||||||
System.out.println("====" + rd.getMessage());
|
|
||||||
if (rd.getCode() != 0) {
|
|
||||||
log.error("生成三思的上传文件出错了");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void loginDevice(BoardInfo boardInfo) {
|
|
||||||
DeviceVar.deviceInforInit(deviceId, 1, boardInfo.getBoardIp(), boardInfo.getBoardPort(), 2048);
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean uploadAndStartPlayList(String path) {
|
|
||||||
ReturnData uploadPlayListRD = DeviceControl.fcmsUploadPlayList(deviceId, path);//上传播放表
|
|
||||||
if (uploadPlayListRD.getCode() != 0) {
|
|
||||||
log.error("上传错误");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
ReturnData activePlayListRD = DeviceControl.fcmsActivePlayList(deviceId, "play.lst");
|
|
||||||
if (activePlayListRD.getCode() != 0) {
|
|
||||||
log.error("播放错误");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public boolean publishContent(BoardInfo boardInfo, PresetContent presetContent){
|
|
||||||
loginDevice(boardInfo);
|
|
||||||
String filePath = createTextItem(presetContent, boardInfo);
|
|
||||||
return uploadAndStartPlayList(filePath);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,30 +0,0 @@
|
||||||
package com.ruoyi.protocol.sansi.enums;
|
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import zhishuang.wang.sansi.playlist.entry.BaseColour;
|
|
||||||
|
|
||||||
import java.util.stream.Stream;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
public enum SanSiFontColor {
|
|
||||||
|
|
||||||
red("red", new BaseColour(255, 0, 0, 0, 0)),
|
|
||||||
yellow("yellow", new BaseColour(255, 255, 0, 0, 0)),
|
|
||||||
green("green", new BaseColour(0, 255, 0, 0, 0));
|
|
||||||
|
|
||||||
private final String colorName;
|
|
||||||
private final BaseColour colour;
|
|
||||||
|
|
||||||
SanSiFontColor(String colorName, BaseColour colour) {
|
|
||||||
this.colorName = colorName;
|
|
||||||
this.colour = colour;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static BaseColour getBaseColourByColorName(String colorName) {
|
|
||||||
return Stream.of(SanSiFontColor.values())
|
|
||||||
.filter(fontColor -> fontColor.getColorName().equals(colorName))
|
|
||||||
.map(SanSiFontColor::getColour)
|
|
||||||
.findFirst()
|
|
||||||
.orElse(null);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,4 +0,0 @@
|
||||||
package com.ruoyi.protocol.service;
|
|
||||||
|
|
||||||
public interface IProtocolService {
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
package com.ruoyi.protocol.service.impl;
|
|
||||||
|
|
||||||
import com.ruoyi.protocol.service.IProtocolService;
|
|
||||||
|
|
||||||
public class ProtocolServiceImpl implements IProtocolService {
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
package com.ruoyi.sensor.domain;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class PerceptionParams {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 感知类型: 雾 / 冰 或者 0/1/2/3 表示
|
|
||||||
*/
|
|
||||||
private String perceptionType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 感知值: 浮点数,精度为小数点后 2 位
|
|
||||||
*/
|
|
||||||
private Double perceptionValue;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 情报板 IP 地址
|
|
||||||
*/
|
|
||||||
private String boardIp;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 情报板协议
|
|
||||||
*/
|
|
||||||
private String boardProtocol;
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
package com.ruoyi.sensor.domain;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class WarningStatusInfo {
|
|
||||||
private String infoBoardIP;
|
|
||||||
private String warningType;
|
|
||||||
private Double warningValue;
|
|
||||||
private Integer currentWarningLevel;
|
|
||||||
private String status;
|
|
||||||
private Date triggerTime;
|
|
||||||
private String warningMessage;
|
|
||||||
}
|
|
|
@ -1,36 +0,0 @@
|
||||||
package com.ruoyi.sensor.merchants;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSON;
|
|
||||||
import com.ruoyi.common.utils.http.HttpUtils;
|
|
||||||
import com.ruoyi.sensor.domain.WarningStatusInfo;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class MerchantsHttp {
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(MerchantsHttp.class);
|
|
||||||
|
|
||||||
private static final String uri = "http://localhost:8080/merchants";
|
|
||||||
|
|
||||||
public static void sendWarning(WarningStatusInfo warningStatusInfo){
|
|
||||||
String jsonString = JSON.toJSONString(warningStatusInfo);
|
|
||||||
String result = null;
|
|
||||||
Map<String, String> header = new HashMap<>();
|
|
||||||
try {
|
|
||||||
result = HttpUtils.postCall(uri, jsonString, header);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("send warning error", e);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (StringUtils.isEmpty(result)) {
|
|
||||||
log.error("send warning error");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 记录上报结果
|
|
||||||
log.info(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
package com.ruoyi.sensor.service;
|
|
||||||
|
|
||||||
import com.ruoyi.sensor.domain.PerceptionParams;
|
|
||||||
|
|
||||||
public interface ISensorDataService {
|
|
||||||
|
|
||||||
void perceptionParamsHandler(PerceptionParams params);
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,88 +0,0 @@
|
||||||
package com.ruoyi.sensor.service.impl;
|
|
||||||
|
|
||||||
import com.ruoyi.board.domain.AlertPlan;
|
|
||||||
import com.ruoyi.board.domain.BoardInfo;
|
|
||||||
import com.ruoyi.board.domain.PresetContent;
|
|
||||||
import com.ruoyi.board.domain.ReleaseRecord;
|
|
||||||
import com.ruoyi.board.domain.enums.AlertPlanType;
|
|
||||||
import com.ruoyi.board.service.IAlertPlanService;
|
|
||||||
import com.ruoyi.board.service.IBoardInfoService;
|
|
||||||
import com.ruoyi.board.service.IPresetContentService;
|
|
||||||
import com.ruoyi.board.service.IReleaseRecordService;
|
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
|
||||||
import com.ruoyi.protocol.sansi.SanSiProtocol;
|
|
||||||
import com.ruoyi.sensor.domain.PerceptionParams;
|
|
||||||
import com.ruoyi.sensor.domain.WarningStatusInfo;
|
|
||||||
import com.ruoyi.sensor.merchants.MerchantsHttp;
|
|
||||||
import com.ruoyi.sensor.service.ISensorDataService;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class SensorDataServiceImpl implements ISensorDataService {
|
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(SensorDataServiceImpl.class);
|
|
||||||
@Autowired
|
|
||||||
private IBoardInfoService boardInfoService;
|
|
||||||
@Autowired
|
|
||||||
private IAlertPlanService alertPlanService;
|
|
||||||
@Autowired
|
|
||||||
private IPresetContentService presetContentService;
|
|
||||||
@Autowired
|
|
||||||
private IReleaseRecordService releaseRecordService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void perceptionParamsHandler(PerceptionParams params) {
|
|
||||||
int planTypeByName = AlertPlanType.getPlanTypeByName(params.getPerceptionType());
|
|
||||||
// 找到符合计划的预警
|
|
||||||
AlertPlan oneByTypeAndValue = alertPlanService.getOneByTypeAndValue(planTypeByName, params.getPerceptionValue());
|
|
||||||
if (null == oneByTypeAndValue) {
|
|
||||||
log.error("找不到预警计划");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 情报板设备信息
|
|
||||||
BoardInfo oneByIP = boardInfoService.getOneByIP(params.getBoardIp());
|
|
||||||
if (null == oneByIP) {
|
|
||||||
log.error("找不到情报板信息");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 预置发布的信息
|
|
||||||
PresetContent oneByContentAndBoardSize = presetContentService.getOneByContentAndBoardSize(oneByTypeAndValue.getDisplayContent(), oneByIP.getBoardSize(), planTypeByName);
|
|
||||||
if (null == oneByContentAndBoardSize) {
|
|
||||||
log.error("找不到预置发布的信息");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取同类型最新的一条发布记录
|
|
||||||
ReleaseRecord oneLatestByBoardId = releaseRecordService.getOneLatestByBoardId(oneByIP.getBoardIp(), 1);
|
|
||||||
if (null == oneLatestByBoardId) {
|
|
||||||
// 说明之前没有发布记录
|
|
||||||
}
|
|
||||||
|
|
||||||
// todo 发布
|
|
||||||
boolean sanSiProtocol = new SanSiProtocol().publishContent(oneByIP, oneByContentAndBoardSize);
|
|
||||||
// 经过主动发布之后就变成预置信息
|
|
||||||
// 发布之后记录发布内容 ReleaseRecord
|
|
||||||
ReleaseRecord releaseRecord = new ReleaseRecord();
|
|
||||||
releaseRecord.setBoardId(oneByIP.getId());
|
|
||||||
releaseRecord.setPresetContentId(oneByContentAndBoardSize.getId());
|
|
||||||
releaseRecord.setCreateTime(new Date());
|
|
||||||
releaseRecord.setCreatedBy(SecurityUtils.getUserId().intValue());
|
|
||||||
releaseRecordService.save(releaseRecord);
|
|
||||||
// 记录完了之后就需要向对方发送日志记录
|
|
||||||
WarningStatusInfo statusInfo = new WarningStatusInfo();
|
|
||||||
statusInfo.setStatus("");
|
|
||||||
statusInfo.setInfoBoardIP(oneByIP.getBoardIp());
|
|
||||||
statusInfo.setWarningType(params.getPerceptionType());
|
|
||||||
statusInfo.setWarningMessage(oneByContentAndBoardSize.getContent());
|
|
||||||
statusInfo.setWarningValue(params.getPerceptionValue());
|
|
||||||
statusInfo.setCurrentWarningLevel(oneByTypeAndValue.getLevel());
|
|
||||||
statusInfo.setTriggerTime(new Date());
|
|
||||||
// 开始发送状态记录
|
|
||||||
MerchantsHttp.sendWarning(new WarningStatusInfo());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,33 +0,0 @@
|
||||||
<?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.board.mapper.PresetContentMapper">
|
|
||||||
<resultMap id="BaseResultMap" type="com.ruoyi.board.domain.PresetContent">
|
|
||||||
<!--@mbg.generated-->
|
|
||||||
<!--@Table pub_preset_content-->
|
|
||||||
<id column="id" jdbcType="INTEGER" property="id" />
|
|
||||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
|
||||||
<result column="board_size" jdbcType="VARCHAR" property="boardSize" />
|
|
||||||
<result column="info_type" jdbcType="INTEGER" property="infoType" />
|
|
||||||
<result column="content" jdbcType="VARCHAR" property="content" />
|
|
||||||
<result column="preview_path" jdbcType="VARCHAR" property="previewPath" />
|
|
||||||
<result column="font_style" jdbcType="VARCHAR" property="fontStyle" />
|
|
||||||
<result column="font_size" jdbcType="INTEGER" property="fontSize" />
|
|
||||||
<result column="letter_spacing" jdbcType="INTEGER" property="letterSpacing" />
|
|
||||||
<result column="font_color" jdbcType="VARCHAR" property="fontColor" />
|
|
||||||
<result column="font_position_x" jdbcType="INTEGER" property="fontPositionX" />
|
|
||||||
<result column="font_position_y" jdbcType="INTEGER" property="fontPositionY" />
|
|
||||||
<result column="play_time" jdbcType="INTEGER" property="playTime" />
|
|
||||||
<result column="preset_type" jdbcType="INTEGER" property="presetType" />
|
|
||||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
|
||||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
||||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
|
||||||
<result column="create_by" jdbcType="INTEGER" property="createBy" />
|
|
||||||
<result column="update_by" jdbcType="INTEGER" property="updateBy" />
|
|
||||||
</resultMap>
|
|
||||||
<sql id="Base_Column_List">
|
|
||||||
<!--@mbg.generated-->
|
|
||||||
id, `name`, board_size, info_type, content, preview_path, font_style, font_size,
|
|
||||||
letter_spacing, font_color, font_position_x, font_position_y, play_time, preset_type,
|
|
||||||
remark, create_time, update_time, create_by, update_by
|
|
||||||
</sql>
|
|
||||||
</mapper>
|
|
|
@ -1,17 +0,0 @@
|
||||||
<?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.board.mapper.ReleaseRecordMapper">
|
|
||||||
<resultMap id="BaseResultMap" type="com.ruoyi.board.domain.ReleaseRecord">
|
|
||||||
<!--@mbg.generated-->
|
|
||||||
<!--@Table pub_release_record-->
|
|
||||||
<id column="id" jdbcType="INTEGER" property="id" />
|
|
||||||
<result column="board_id" jdbcType="INTEGER" property="boardId" />
|
|
||||||
<result column="preset_content_id" jdbcType="INTEGER" property="presetContentId" />
|
|
||||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
||||||
<result column="created_by" jdbcType="INTEGER" property="createdBy" />
|
|
||||||
</resultMap>
|
|
||||||
<sql id="Base_Column_List">
|
|
||||||
<!--@mbg.generated-->
|
|
||||||
id, board_id, preset_content_id, create_time, created_by
|
|
||||||
</sql>
|
|
||||||
</mapper>
|
|
|
@ -1,5 +1,5 @@
|
||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 瓷器活发布系统
|
VUE_APP_TITLE = 若依管理系统
|
||||||
|
|
||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
ENV = 'development'
|
ENV = 'development'
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 瓷器活发布系统
|
VUE_APP_TITLE = 若依管理系统
|
||||||
|
|
||||||
# 生产环境配置
|
# 生产环境配置
|
||||||
ENV = 'production'
|
ENV = 'production'
|
||||||
|
|
|
@ -1,44 +0,0 @@
|
||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
// 查询预置信息及模版列表
|
|
||||||
export function listContent(query) {
|
|
||||||
return request({
|
|
||||||
url: '/board/content/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询预置信息及模版详细
|
|
||||||
export function getContent(id) {
|
|
||||||
return request({
|
|
||||||
url: '/board/content/' + id,
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增预置信息及模版
|
|
||||||
export function addContent(data) {
|
|
||||||
return request({
|
|
||||||
url: '/board/content',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改预置信息及模版
|
|
||||||
export function updateContent(data) {
|
|
||||||
return request({
|
|
||||||
url: '/board/content',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除预置信息及模版
|
|
||||||
export function delContent(id) {
|
|
||||||
return request({
|
|
||||||
url: '/board/content/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
})
|
|
||||||
}
|
|
|
@ -1,44 +0,0 @@
|
||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
// 查询情报板信息列表
|
|
||||||
export function listInfo(query) {
|
|
||||||
return request({
|
|
||||||
url: '/board/info/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询情报板信息详细
|
|
||||||
export function getInfo(id) {
|
|
||||||
return request({
|
|
||||||
url: '/board/info/' + id,
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增情报板信息
|
|
||||||
export function addInfo(data) {
|
|
||||||
return request({
|
|
||||||
url: '/board/info',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改情报板信息
|
|
||||||
export function updateInfo(data) {
|
|
||||||
return request({
|
|
||||||
url: '/board/info',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除情报板信息
|
|
||||||
export function delInfo(id) {
|
|
||||||
return request({
|
|
||||||
url: '/board/info/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
})
|
|
||||||
}
|
|
|
@ -1,44 +0,0 @@
|
||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
// 查询警报计划列表
|
|
||||||
export function listPlan(query) {
|
|
||||||
return request({
|
|
||||||
url: '/board/plan/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询警报计划详细
|
|
||||||
export function getPlan(id) {
|
|
||||||
return request({
|
|
||||||
url: '/board/plan/' + id,
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增警报计划
|
|
||||||
export function addPlan(data) {
|
|
||||||
return request({
|
|
||||||
url: '/board/plan',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改警报计划
|
|
||||||
export function updatePlan(data) {
|
|
||||||
return request({
|
|
||||||
url: '/board/plan',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除警报计划
|
|
||||||
export function delPlan(id) {
|
|
||||||
return request({
|
|
||||||
url: '/board/plan/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
})
|
|
||||||
}
|
|
Binary file not shown.
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 79 KiB |
Binary file not shown.
Before Width: | Height: | Size: 79 KiB |
|
@ -9,6 +9,14 @@
|
||||||
<template v-if="device!=='mobile'">
|
<template v-if="device!=='mobile'">
|
||||||
<search id="header-search" class="right-menu-item" />
|
<search id="header-search" class="right-menu-item" />
|
||||||
|
|
||||||
|
<el-tooltip content="源码地址" effect="dark" placement="bottom">
|
||||||
|
<ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
|
||||||
|
</el-tooltip>
|
||||||
|
|
||||||
|
<el-tooltip content="文档地址" effect="dark" placement="bottom">
|
||||||
|
<ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />
|
||||||
|
</el-tooltip>
|
||||||
|
|
||||||
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
||||||
|
|
||||||
<el-tooltip content="布局大小" effect="dark" placement="bottom">
|
<el-tooltip content="布局大小" effect="dark" placement="bottom">
|
||||||
|
|
|
@ -1,448 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="auto">
|
|
||||||
<el-form-item label="预置信息名称" prop="name">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.name"
|
|
||||||
placeholder="请输入预置信息名称"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="情报板尺寸" prop="boardSize">
|
|
||||||
<el-select
|
|
||||||
v-model="queryParams.boardSize"
|
|
||||||
clearable
|
|
||||||
placeholder="全部">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.board_size"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label + ' ' + dict.value"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="类型" prop="type">
|
|
||||||
<el-select
|
|
||||||
v-model="queryParams.type"
|
|
||||||
clearable
|
|
||||||
placeholder="全部"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.alert_type"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleAdd"
|
|
||||||
v-hasPermi="['board:content:add']"
|
|
||||||
>新增</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="success"
|
|
||||||
plain
|
|
||||||
icon="el-icon-edit"
|
|
||||||
size="mini"
|
|
||||||
:disabled="single"
|
|
||||||
@click="handleUpdate"
|
|
||||||
v-hasPermi="['board:content:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-hasPermi="['board:content:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
@click="handleExport"
|
|
||||||
v-hasPermi="['board:content:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="contentList" @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column label="唯一编号" align="center" prop="id" />
|
|
||||||
<el-table-column label="预置信息名称" align="center" prop="name" />
|
|
||||||
<el-table-column label="情报板尺寸" align="center" prop="boardSize" />
|
|
||||||
<el-table-column label="信息类型" align="center" prop="infoType">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<dict-tag :options="dict.type.alert_type" :value="scope.row.infoType"/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="预置内容" align="center" prop="content" />
|
|
||||||
<el-table-column label="预览路径" align="center" prop="previewPath" />
|
|
||||||
<!-- <el-table-column label="字体样式" align="center" prop="fontStyle" />-->
|
|
||||||
<!-- <el-table-column label="字体大小" align="center" prop="fontSize" />-->
|
|
||||||
<!-- <el-table-column label="字体间距" align="center" prop="letterSpacing" />-->
|
|
||||||
<!-- <el-table-column label="字体颜色" align="center" prop="fontColor" />-->
|
|
||||||
<!-- <el-table-column label="字体坐标X" align="center" prop="fontPositionX" />-->
|
|
||||||
<!-- <el-table-column label="字体坐标Y" align="center" prop="fontPositionY" />-->
|
|
||||||
<el-table-column label="播放时间" align="center" prop="playTime" />
|
|
||||||
<!-- <el-table-column label="当前预置类型 1:内置模版 0:预发布信息" align="center" prop="presetType" />-->
|
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
@click="handleUpdate(scope.row)"
|
|
||||||
v-hasPermi="['board:content:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['board:content:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination
|
|
||||||
v-show="total>0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 添加或修改预置信息及模版对话框 -->
|
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="auto">
|
|
||||||
<el-form-item label="预置信息名称" prop="name">
|
|
||||||
<el-input v-model="form.name" placeholder="请输入预置信息名称" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="预置信息类型" prop="infoType">
|
|
||||||
<el-select
|
|
||||||
v-model="form.infoType"
|
|
||||||
placeholder="全部"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.alert_type"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="情报板尺寸" prop="boardSize">
|
|
||||||
<el-select
|
|
||||||
v-model="form.boardSize"
|
|
||||||
placeholder="请选择情报板尺寸">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.board_size"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label + ' ' + dict.value"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="预置内容" prop="content">
|
|
||||||
<el-input v-model="form.content" placeholder="请输入预置内容"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="字体样式" prop="fontStyle">
|
|
||||||
<el-select
|
|
||||||
v-model="form.fontStyle"
|
|
||||||
placeholder="请选择字体样式">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.font_style"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="字体颜色" prop="fontColor">
|
|
||||||
<el-select
|
|
||||||
v-model="form.fontColor"
|
|
||||||
placeholder="请选择字体颜色">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.font_color"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="字体大小" prop="fontSize">
|
|
||||||
<el-input-number :min="0" v-model="form.fontSize" placeholder="请输入字体大小" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="字体间距" prop="letterSpacing">
|
|
||||||
<el-input-number :min="0" v-model="form.letterSpacing" placeholder="请输入字体间距" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="字体坐标X" prop="fontPositionX">
|
|
||||||
<el-input-number v-model="form.fontPositionX" placeholder="请输入字体坐标X" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="字体坐标Y" prop="fontPositionY">
|
|
||||||
<el-input-number v-model="form.fontPositionY" placeholder="请输入字体坐标Y" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="播放时间" prop="playTime">
|
|
||||||
<el-input-number :min="0" v-model="form.playTime" placeholder="请输入播放时间" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="预览路径" prop="previewPath">
|
|
||||||
<el-input v-model="form.previewPath" placeholder="请输入预览路径" />
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { listContent, getContent, delContent, addContent, updateContent } from "@/api/board/content";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "Content",
|
|
||||||
dicts: ['board_size','font_color','font_style', 'alert_type'],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
// 遮罩层
|
|
||||||
loading: true,
|
|
||||||
// 选中数组
|
|
||||||
ids: [],
|
|
||||||
// 非单个禁用
|
|
||||||
single: true,
|
|
||||||
// 非多个禁用
|
|
||||||
multiple: true,
|
|
||||||
// 显示搜索条件
|
|
||||||
showSearch: true,
|
|
||||||
// 总条数
|
|
||||||
total: 0,
|
|
||||||
// 预置信息及模版表格数据
|
|
||||||
contentList: [],
|
|
||||||
// 弹出层标题
|
|
||||||
title: "",
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
name: null,
|
|
||||||
boardSize: null,
|
|
||||||
infoType: null,
|
|
||||||
content: null,
|
|
||||||
previewPath: null,
|
|
||||||
fontStyle: null,
|
|
||||||
fontSize: null,
|
|
||||||
letterSpacing: null,
|
|
||||||
fontColor: null,
|
|
||||||
fontPositionX: null,
|
|
||||||
fontPositionY: null,
|
|
||||||
playTime: null,
|
|
||||||
presetType: null,
|
|
||||||
},
|
|
||||||
// 表单参数
|
|
||||||
form: {},
|
|
||||||
// 表单校验
|
|
||||||
rules: {
|
|
||||||
name: [
|
|
||||||
{ required: true, message: "预置信息名称不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
boardSize: [
|
|
||||||
{ required: true, message: "情报板尺寸不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
infoType: [
|
|
||||||
{ required: true, message: "信息类型不能为空", trigger: "change" }
|
|
||||||
],
|
|
||||||
content: [
|
|
||||||
{ required: true, message: "预置内容不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
previewPath: [
|
|
||||||
{ required: true, message: "预览路径不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
fontStyle: [
|
|
||||||
{ required: true, message: "字体样式不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
fontSize: [
|
|
||||||
{ required: true, message: "字体大小不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
letterSpacing: [
|
|
||||||
{ required: true, message: "字体间距不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
fontColor: [
|
|
||||||
{ required: true, message: "字体颜色不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
fontPositionX: [
|
|
||||||
{ required: true, message: "字体坐标X不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
fontPositionY: [
|
|
||||||
{ required: true, message: "字体坐标Y不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
playTime: [
|
|
||||||
{ required: true, message: "播放时间不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
presetType: [
|
|
||||||
{ required: false, message: "当前预置类型 1:内置模版 0:预发布信息不能为空", trigger: "change" }
|
|
||||||
],
|
|
||||||
remark: [
|
|
||||||
{ required: false, message: "备注不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
createTime: [
|
|
||||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
updateTime: [
|
|
||||||
{ required: true, message: "更新时间不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
createBy: [
|
|
||||||
{ required: true, message: "创建人id不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
updateBy: [
|
|
||||||
{ required: true, message: "更新人id不能为空", trigger: "blur" }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/** 查询预置信息及模版列表 */
|
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
listContent(this.queryParams).then(response => {
|
|
||||||
this.contentList = response.rows;
|
|
||||||
this.total = response.total;
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
id: null,
|
|
||||||
name: null,
|
|
||||||
boardSize: null,
|
|
||||||
infoType: null,
|
|
||||||
content: null,
|
|
||||||
previewPath: null,
|
|
||||||
fontStyle: null,
|
|
||||||
fontSize: null,
|
|
||||||
letterSpacing: null,
|
|
||||||
fontColor: null,
|
|
||||||
fontPositionX: null,
|
|
||||||
fontPositionY: null,
|
|
||||||
playTime: null,
|
|
||||||
presetType: null,
|
|
||||||
remark: null,
|
|
||||||
createTime: null,
|
|
||||||
updateTime: null,
|
|
||||||
createBy: null,
|
|
||||||
updateBy: null
|
|
||||||
};
|
|
||||||
this.resetForm("form");
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
resetQuery() {
|
|
||||||
this.resetForm("queryForm");
|
|
||||||
this.handleQuery();
|
|
||||||
},
|
|
||||||
// 多选框选中数据
|
|
||||||
handleSelectionChange(selection) {
|
|
||||||
this.ids = selection.map(item => item.id)
|
|
||||||
this.single = selection.length!==1
|
|
||||||
this.multiple = !selection.length
|
|
||||||
},
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
handleAdd() {
|
|
||||||
this.reset();
|
|
||||||
this.open = true;
|
|
||||||
this.title = "添加预置信息及模版";
|
|
||||||
},
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.reset();
|
|
||||||
const id = row.id || this.ids
|
|
||||||
getContent(id).then(response => {
|
|
||||||
this.form = response.data;
|
|
||||||
this.form.infoType += '';
|
|
||||||
this.open = true;
|
|
||||||
this.title = "修改预置信息及模版";
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm() {
|
|
||||||
this.$refs["form"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.form.id != null) {
|
|
||||||
updateContent(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("修改成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addContent(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("新增成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
|
||||||
const ids = row.id || this.ids;
|
|
||||||
this.$modal.confirm('是否确认删除预置信息及模版编号为"' + ids + '"的数据项?').then(function() {
|
|
||||||
return delContent(ids);
|
|
||||||
}).then(() => {
|
|
||||||
this.getList();
|
|
||||||
this.$modal.msgSuccess("删除成功");
|
|
||||||
}).catch(() => {});
|
|
||||||
},
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
handleExport() {
|
|
||||||
this.download('board/content/export', {
|
|
||||||
...this.queryParams
|
|
||||||
}, `content_${new Date().getTime()}.xlsx`)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
|
@ -1,37 +0,0 @@
|
||||||
<template>
|
|
||||||
<el-select
|
|
||||||
v-model="size"
|
|
||||||
placeholder="请选择"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.board_size"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label + ' ' + dict.value"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
dicts: [
|
|
||||||
'board_size'
|
|
||||||
],
|
|
||||||
props: {
|
|
||||||
size: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data: {
|
|
||||||
return: {
|
|
||||||
sizeValue: '',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
|
|
||||||
</style>
|
|
|
@ -1,424 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="auto">
|
|
||||||
<el-form-item label="情报板名称" prop="boardName">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.boardName"
|
|
||||||
placeholder="请输入情报板名称"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="情报板工桩号" prop="boardMileage">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.boardMileage"
|
|
||||||
placeholder="请输入情报板工桩号"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="情报板尺寸" prop="boardSize">
|
|
||||||
<el-select
|
|
||||||
v-model="queryParams.boardSize"
|
|
||||||
clearable
|
|
||||||
placeholder="全部">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.board_size"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label + ' ' + dict.value"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="情报板品牌" prop="boardBrand">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.boardBrand"
|
|
||||||
placeholder="请输入情报板品牌"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="情报板通讯协议" prop="boardCommunicationProtocol">
|
|
||||||
<el-select
|
|
||||||
v-model="queryParams.boardCommunicationProtocol"
|
|
||||||
clearable
|
|
||||||
placeholder="全部"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.board_protocol"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="情报板路段" prop="boardRoadSection">
|
|
||||||
<treeselect v-model="queryParams.boardRoadSection" :options="deptOptions" placeholder="请选择归属路段"
|
|
||||||
style="width: 300px"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleAdd"
|
|
||||||
v-hasPermi="['board:info:add']"
|
|
||||||
>新增
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="success"
|
|
||||||
plain
|
|
||||||
icon="el-icon-edit"
|
|
||||||
size="mini"
|
|
||||||
:disabled="single"
|
|
||||||
@click="handleUpdate"
|
|
||||||
v-hasPermi="['board:info:edit']"
|
|
||||||
>修改
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-hasPermi="['board:info:remove']"
|
|
||||||
>删除
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
@click="handleExport"
|
|
||||||
v-hasPermi="['board:info:export']"
|
|
||||||
>导出
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange" append-to-body>
|
|
||||||
<el-table-column type="selection" width="55" align="center"/>
|
|
||||||
<el-table-column label="唯一编号" align="center" prop="id"/>
|
|
||||||
<el-table-column label="情报板名称" align="center" prop="boardName"/>
|
|
||||||
<el-table-column label="情报板路段" align="center" prop="boardRoadSection"/>
|
|
||||||
<el-table-column label="情报板方向" align="center" prop="boardDirection"/>
|
|
||||||
<el-table-column label="情报板工桩号" align="center" prop="boardMileage"/>
|
|
||||||
<el-table-column label="情报板尺寸" align="center" prop="boardSize">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<dict-tag :options="dict.type.board_size" :value="scope.row.boardSize"/>
|
|
||||||
{{ scope.row.boardSize }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="情报板品牌" align="center" prop="boardBrand"/>
|
|
||||||
<el-table-column label="情报板通讯协议" align="center" prop="boardCommunicationProtocol">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<dict-tag :options="dict.type.board_protocol" :value="scope.row.boardCommunicationProtocol"/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="情报板IP" align="center" prop="boardIp"/>
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
@click="handleUpdate(scope.row)"
|
|
||||||
v-hasPermi="['board:info:edit']"
|
|
||||||
>修改
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['board:info:remove']"
|
|
||||||
>删除
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination
|
|
||||||
v-show="total>0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 添加或修改情报板信息对话框 -->
|
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="auto">
|
|
||||||
<el-form-item label="情报板名称" prop="boardName">
|
|
||||||
<el-input v-model="form.boardName" placeholder="请输入情报板名称"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="情报板路段" prop="boardRoadSection">
|
|
||||||
<treeselect v-model="form.boardRoadSection" :options="deptOptions" placeholder="请选择归属路段"
|
|
||||||
style="width: 300px"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="情报板方向" prop="boardDirection">
|
|
||||||
<el-input v-model="form.boardDirection" placeholder="请输入情报板方向"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="情报板工桩号" prop="boardMileage">
|
|
||||||
<el-input v-model="form.boardMileage" placeholder="请输入情报板工桩号"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="情报板尺寸" prop="boardSize">
|
|
||||||
<el-select
|
|
||||||
v-model="form.boardSize"
|
|
||||||
placeholder="请选择"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.board_size"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label + ' ' + dict.value"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="情报板品牌" prop="boardBrand">
|
|
||||||
<el-input v-model="form.boardBrand" placeholder="请输入情报板品牌"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="情报板通讯协议" prop="boardCommunicationProtocol">
|
|
||||||
<el-select
|
|
||||||
v-model="form.boardCommunicationProtocol"
|
|
||||||
placeholder="全部"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.board_protocol"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="情报板IP" prop="boardIp">
|
|
||||||
<el-input v-model="form.boardIp" placeholder="请输入情报板IP"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="情报板端口号" prop="boardPort">
|
|
||||||
<el-input-number :min="0" :max="65535" v-model="form.boardPort"
|
|
||||||
placeholder="填0为默认端口"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {listInfo, getInfo, delInfo, addInfo, updateInfo} from "@/api/board/info";
|
|
||||||
import {deptTreeSelect} from "@/api/system/user";
|
|
||||||
import Treeselect from "@riophae/vue-treeselect";
|
|
||||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "Info",
|
|
||||||
dicts: ['board_size', 'board_protocol'],
|
|
||||||
components: {Treeselect},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
// 遮罩层
|
|
||||||
loading: true,
|
|
||||||
// 选中数组
|
|
||||||
ids: [],
|
|
||||||
// 非单个禁用
|
|
||||||
single: true,
|
|
||||||
// 非多个禁用
|
|
||||||
multiple: true,
|
|
||||||
// 部门树选项
|
|
||||||
deptOptions: [],
|
|
||||||
// 显示搜索条件
|
|
||||||
showSearch: true,
|
|
||||||
// 总条数
|
|
||||||
total: 0,
|
|
||||||
// 情报板信息表格数据
|
|
||||||
infoList: [],
|
|
||||||
// 弹出层标题
|
|
||||||
title: "",
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
boardName: null,
|
|
||||||
boardRoadSection: null,
|
|
||||||
boardDirection: null,
|
|
||||||
boardMileage: null,
|
|
||||||
boardSize: null,
|
|
||||||
boardBrand: null,
|
|
||||||
boardCommunicationProtocol: null,
|
|
||||||
boardIp: null,
|
|
||||||
boardPort: null
|
|
||||||
},
|
|
||||||
// 表单参数
|
|
||||||
form: {},
|
|
||||||
// 表单校验
|
|
||||||
rules: {
|
|
||||||
boardName: [
|
|
||||||
{required: true, message: "情报板名称不能为空", trigger: "blur"}
|
|
||||||
],
|
|
||||||
boardRoadSection: [
|
|
||||||
{required: true, message: "情报板路段不能为空", trigger: "blur"}
|
|
||||||
],
|
|
||||||
boardDirection: [
|
|
||||||
{required: true, message: "情报板方向不能为空", trigger: "blur"}
|
|
||||||
],
|
|
||||||
boardMileage: [
|
|
||||||
{required: true, message: "情报板工桩号不能为空", trigger: "blur"}
|
|
||||||
],
|
|
||||||
boardSize: [
|
|
||||||
{required: true, message: "情报板尺寸不能为空", trigger: "blur"}
|
|
||||||
],
|
|
||||||
boardBrand: [
|
|
||||||
{required: true, message: "情报板品牌不能为空", trigger: "blur"}
|
|
||||||
],
|
|
||||||
boardCommunicationProtocol: [
|
|
||||||
{required: true, message: "情报板通讯协议不能为空", trigger: "blur"}
|
|
||||||
],
|
|
||||||
boardIp: [
|
|
||||||
{required: true, message: "情报板IP不能为空", trigger: "blur"},
|
|
||||||
{
|
|
||||||
pattern: /^(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])$/,
|
|
||||||
message: "请输入正确的 IP",
|
|
||||||
trigger: "blur"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
boardPort: [
|
|
||||||
{required: true, message: "情报板端口号不能为空", trigger: "blur"}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getList();
|
|
||||||
this.getDeptTree();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/** 查询情报板信息列表 */
|
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
listInfo(this.queryParams).then(response => {
|
|
||||||
this.infoList = response.rows;
|
|
||||||
this.total = response.total;
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
id: null,
|
|
||||||
boardName: null,
|
|
||||||
boardRoadSection: null,
|
|
||||||
boardDirection: null,
|
|
||||||
boardMileage: null,
|
|
||||||
boardSize: null,
|
|
||||||
boardBrand: null,
|
|
||||||
boardCommunicationProtocol: null,
|
|
||||||
boardIp: null,
|
|
||||||
boardPort: null
|
|
||||||
};
|
|
||||||
this.resetForm("form");
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
console.log(this.queryParams)
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
resetQuery() {
|
|
||||||
this.resetForm("queryForm");
|
|
||||||
this.handleQuery();
|
|
||||||
},
|
|
||||||
// 多选框选中数据
|
|
||||||
handleSelectionChange(selection) {
|
|
||||||
this.ids = selection.map(item => item.id)
|
|
||||||
this.single = selection.length !== 1
|
|
||||||
this.multiple = !selection.length
|
|
||||||
},
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
handleAdd() {
|
|
||||||
this.reset();
|
|
||||||
this.open = true;
|
|
||||||
this.title = "添加情报板信息";
|
|
||||||
},
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.reset();
|
|
||||||
const id = row.id || this.ids
|
|
||||||
getInfo(id).then(response => {
|
|
||||||
this.form = response.data;
|
|
||||||
this.open = true;
|
|
||||||
this.title = "修改情报板信息";
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm() {
|
|
||||||
this.$refs["form"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.form.id != null) {
|
|
||||||
updateInfo(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("修改成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addInfo(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("新增成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
|
||||||
const ids = row.id || this.ids;
|
|
||||||
this.$modal.confirm('是否确认删除情报板信息编号为"' + ids + '"的数据项?').then(function () {
|
|
||||||
return delInfo(ids);
|
|
||||||
}).then(() => {
|
|
||||||
this.getList();
|
|
||||||
this.$modal.msgSuccess("删除成功");
|
|
||||||
}).catch(() => {
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
handleExport() {
|
|
||||||
this.download('board/info/export', {
|
|
||||||
...this.queryParams
|
|
||||||
}, `info_${new Date().getTime()}.xlsx`)
|
|
||||||
},
|
|
||||||
/** 查询部门下拉树结构 */
|
|
||||||
getDeptTree() {
|
|
||||||
deptTreeSelect().then(response => {
|
|
||||||
this.deptOptions = response.data;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
|
@ -1,355 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="auto">
|
|
||||||
<el-form-item label="等级" prop="level">
|
|
||||||
<el-select
|
|
||||||
v-model="queryParams.level"
|
|
||||||
clearable
|
|
||||||
placeholder="全部"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.alert_level"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="类型" prop="type">
|
|
||||||
<el-select
|
|
||||||
v-model="queryParams.type"
|
|
||||||
clearable
|
|
||||||
placeholder="全部"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.alert_type"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="最大值" prop="maxValue">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.maxValue"
|
|
||||||
placeholder="请输入最大值"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="最小值" prop="minValue">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.minValue"
|
|
||||||
placeholder="请输入最小值"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleAdd"
|
|
||||||
v-hasPermi="['board:plan:add']"
|
|
||||||
>新增</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="success"
|
|
||||||
plain
|
|
||||||
icon="el-icon-edit"
|
|
||||||
size="mini"
|
|
||||||
:disabled="single"
|
|
||||||
@click="handleUpdate"
|
|
||||||
v-hasPermi="['board:plan:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-hasPermi="['board:plan:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
@click="handleExport"
|
|
||||||
v-hasPermi="['board:plan:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="planList" @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column label="唯一编号" align="center" prop="id" />
|
|
||||||
<el-table-column label="类型" align="center" prop="type">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<dict-tag :options="dict.type.alert_type" :value="scope.row.type"/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="等级" align="center" prop="level">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<dict-tag :options="dict.type.alert_level" :value="scope.row.level"/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="最大值" align="center" prop="maxValue" />
|
|
||||||
<el-table-column label="最小值" align="center" prop="minValue" />
|
|
||||||
<el-table-column label="显示内容" align="center" prop="displayContent" />
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
@click="handleUpdate(scope.row)"
|
|
||||||
v-hasPermi="['board:plan:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['board:plan:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<pagination
|
|
||||||
v-show="total>0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 添加或修改警报计划对话框 -->
|
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
||||||
<el-form-item label="等级" prop="level">
|
|
||||||
<el-select
|
|
||||||
v-model="form.level"
|
|
||||||
placeholder="全部"
|
|
||||||
:value="1"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.alert_level"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="类型" prop="type">
|
|
||||||
<el-select
|
|
||||||
v-model="form.type"
|
|
||||||
placeholder="全部"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.alert_type"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="最小值" prop="minValue">
|
|
||||||
<el-input-number :min="0" :precision="2" v-model="form.minValue" placeholder="请输入最小值" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="最大值" prop="maxValue">
|
|
||||||
<el-input-number :min="form.minValue" :precision="2" v-model="form.maxValue" placeholder="请输入最大值" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="显示内容">
|
|
||||||
<el-input v-model="form.displayContent" :min-height="192"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { listPlan, getPlan, delPlan, addPlan, updatePlan } from "@/api/board/plan";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "Plan",
|
|
||||||
dicts: ['alert_level','alert_type'],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
// 遮罩层
|
|
||||||
loading: true,
|
|
||||||
// 选中数组
|
|
||||||
ids: [],
|
|
||||||
// 非单个禁用
|
|
||||||
single: true,
|
|
||||||
// 非多个禁用
|
|
||||||
multiple: true,
|
|
||||||
// 显示搜索条件
|
|
||||||
showSearch: true,
|
|
||||||
// 总条数
|
|
||||||
total: 0,
|
|
||||||
// 警报计划表格数据
|
|
||||||
planList: [],
|
|
||||||
// 弹出层标题
|
|
||||||
title: "",
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
type: null,
|
|
||||||
level: null,
|
|
||||||
maxValue: null,
|
|
||||||
minValue: null,
|
|
||||||
displayContent: null
|
|
||||||
},
|
|
||||||
// 表单参数
|
|
||||||
form: {},
|
|
||||||
// 表单校验
|
|
||||||
rules: {
|
|
||||||
type: [
|
|
||||||
{ required: true, message: "类型不能为空", trigger: "change" }
|
|
||||||
],
|
|
||||||
level: [
|
|
||||||
{ required: true, message: "等级不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
maxValue: [
|
|
||||||
{ required: true, message: "最大值不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
minValue: [
|
|
||||||
{ required: true, message: "最小值不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
displayContent: [
|
|
||||||
{ required: true, message: "显示内容不能为空", trigger: "blur" }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/** 查询警报计划列表 */
|
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
listPlan(this.queryParams).then(response => {
|
|
||||||
this.planList = response.rows;
|
|
||||||
this.total = response.total;
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
id: null,
|
|
||||||
type: null,
|
|
||||||
level: null,
|
|
||||||
maxValue: null,
|
|
||||||
minValue: null,
|
|
||||||
displayContent: null
|
|
||||||
};
|
|
||||||
this.resetForm("form");
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
resetQuery() {
|
|
||||||
this.resetForm("queryForm");
|
|
||||||
this.handleQuery();
|
|
||||||
},
|
|
||||||
// 多选框选中数据
|
|
||||||
handleSelectionChange(selection) {
|
|
||||||
this.ids = selection.map(item => item.id)
|
|
||||||
this.single = selection.length!==1
|
|
||||||
this.multiple = !selection.length
|
|
||||||
},
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
handleAdd() {
|
|
||||||
this.reset();
|
|
||||||
this.open = true;
|
|
||||||
this.title = "添加警报计划";
|
|
||||||
},
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.reset();
|
|
||||||
const id = row.id || this.ids
|
|
||||||
getPlan(id).then(response => {
|
|
||||||
this.form = response.data;
|
|
||||||
this.form.type += '';
|
|
||||||
this.form.level += '';
|
|
||||||
this.open = true;
|
|
||||||
this.title = "修改警报计划";
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm() {
|
|
||||||
this.$refs["form"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.form.id != null) {
|
|
||||||
updatePlan(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("修改成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addPlan(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("新增成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
|
||||||
const ids = row.id || this.ids;
|
|
||||||
this.$modal.confirm('是否确认删除警报计划编号为"' + ids + '"的数据项?').then(function() {
|
|
||||||
return delPlan(ids);
|
|
||||||
}).then(() => {
|
|
||||||
this.getList();
|
|
||||||
this.$modal.msgSuccess("删除成功");
|
|
||||||
}).catch(() => {});
|
|
||||||
},
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
handleExport() {
|
|
||||||
this.download('board/plan/export', {
|
|
||||||
...this.queryParams
|
|
||||||
}, `plan_${new Date().getTime()}.xlsx`)
|
|
||||||
},
|
|
||||||
/** 字典翻译 */
|
|
||||||
dictAlertPlanTypeFormat(){
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,8 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="login">
|
<div class="login">
|
||||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
|
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
|
||||||
<!-- <h3 class="title">若依后台管理系统</h3>-->
|
<h3 class="title">若依后台管理系统</h3>
|
||||||
<h3 class="title">发布系统</h3>
|
|
||||||
<el-form-item prop="username">
|
<el-form-item prop="username">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="loginForm.username"
|
v-model="loginForm.username"
|
||||||
|
@ -57,8 +56,7 @@
|
||||||
</el-form>
|
</el-form>
|
||||||
<!-- 底部 -->
|
<!-- 底部 -->
|
||||||
<div class="el-login-footer">
|
<div class="el-login-footer">
|
||||||
<!-- <span>Copyright © 2018-2024 ruoyi.vip All Rights Reserved.</span>-->
|
<span>Copyright © 2018-2024 ruoyi.vip All Rights Reserved.</span>
|
||||||
<span>瓷器活科技</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="register">
|
<div class="register">
|
||||||
<el-form ref="registerForm" :model="registerForm" :rules="registerRules" class="register-form">
|
<el-form ref="registerForm" :model="registerForm" :rules="registerRules" class="register-form">
|
||||||
<!-- <h3 class="title">若依后台管理系统</h3>-->
|
<h3 class="title">若依后台管理系统</h3>
|
||||||
<h3 class="title">发布系统</h3>
|
|
||||||
<el-form-item prop="username">
|
<el-form-item prop="username">
|
||||||
<el-input v-model="registerForm.username" type="text" auto-complete="off" placeholder="账号">
|
<el-input v-model="registerForm.username" type="text" auto-complete="off" placeholder="账号">
|
||||||
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
|
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
|
||||||
|
@ -62,8 +61,7 @@
|
||||||
</el-form>
|
</el-form>
|
||||||
<!-- 底部 -->
|
<!-- 底部 -->
|
||||||
<div class="el-register-footer">
|
<div class="el-register-footer">
|
||||||
<!-- <span>Copyright © 2018-2024 ruoyi.vip All Rights Reserved.</span>-->
|
<span>Copyright © 2018-2024 ruoyi.vip All Rights Reserved.</span>
|
||||||
<span>瓷器活科技</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -7,7 +7,7 @@ function resolve(dir) {
|
||||||
|
|
||||||
const CompressionPlugin = require('compression-webpack-plugin')
|
const CompressionPlugin = require('compression-webpack-plugin')
|
||||||
|
|
||||||
const name = process.env.VUE_APP_TITLE || '瓷器活发布系统' // 网页标题
|
const name = process.env.VUE_APP_TITLE || '若依管理系统' // 网页标题
|
||||||
|
|
||||||
const port = process.env.port || process.env.npm_config_port || 80 // 端口
|
const port = process.env.port || process.env.npm_config_port || 80 // 端口
|
||||||
|
|
||||||
|
@ -36,7 +36,6 @@ module.exports = {
|
||||||
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
||||||
[process.env.VUE_APP_BASE_API]: {
|
[process.env.VUE_APP_BASE_API]: {
|
||||||
target: `http://localhost:8080`,
|
target: `http://localhost:8080`,
|
||||||
// target: `http://192.168.2.137:8080`,
|
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
['^' + process.env.VUE_APP_BASE_API]: ''
|
['^' + process.env.VUE_APP_BASE_API]: ''
|
||||||
|
|
Loading…
Reference in New Issue