全局划线参数修改 表名修改 告警图片优化 杆塔顺序修改
parent
d03730cf7a
commit
8f9b69211c
@ -0,0 +1,55 @@
|
||||
package com.shxy.xymanager_admin.controller;
|
||||
|
||||
import com.shxy.xymanager_common.annotation.Log;
|
||||
import com.shxy.xymanager_common.base.BaseController;
|
||||
import com.shxy.xymanager_common.base.ResponseReult;
|
||||
import com.shxy.xymanager_common.bean.ServiceBody;
|
||||
import com.shxy.xymanager_common.bean.ServiceStatus;
|
||||
import com.shxy.xymanager_service.service.GloablParamsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import io.swagger.annotations.ApiResponses;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
||||
@Api(value = "全局参数设置接口", tags = "全局参数设置接口相关")
|
||||
@RestController
|
||||
@Slf4j
|
||||
public class GloableParamsController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
GloablParamsService gloableParamsService;
|
||||
|
||||
@ApiOperation(value = "查询图片绘制开关状态", notes = "查询图片绘制开关状态接口", httpMethod = "POST")
|
||||
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
|
||||
@RequestMapping("/getMarkEnableStatus")
|
||||
@Log(title = "新增杆塔", type = "查询")
|
||||
public ResponseReult<Integer> getMarkEnableStatus() {
|
||||
ServiceBody<Integer> serviceBody = gloableParamsService.getMarkEnableStatus();
|
||||
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
|
||||
return ResponseReult.success(serviceBody.getData());
|
||||
} else {
|
||||
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增杆塔", notes = "新增杆塔接口", httpMethod = "POST")
|
||||
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
|
||||
@RequestMapping("/updateMarkEnableStatus")
|
||||
@Log(title = "新增杆塔", type = "查询")
|
||||
public ResponseReult<String> updateMarkEnableStatus(@RequestParam("status") Integer status) {
|
||||
ServiceBody<String> serviceBody = gloableParamsService.updateMarkEnableStatus(status);
|
||||
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
|
||||
return ResponseReult.success(serviceBody.getData());
|
||||
} else {
|
||||
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1 +1 @@
|
||||
#org.springframework.boot.env.EnvironmentPostProcessor=com.shxy.xymanager_framework.config.MyEnvironmentPostProcessor
|
||||
org.springframework.boot.env.EnvironmentPostProcessor=com.shxy.xymanager_framework.config.MyEnvironmentPostProcessor
|
||||
|
@ -0,0 +1,22 @@
|
||||
package com.shxy.xymanager_common.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class GlobalParams implements Serializable {
|
||||
private Integer id;
|
||||
|
||||
private String paramName;
|
||||
|
||||
private String paramValue;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
package com.shxy.xymanager_common.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class Tower implements Serializable {
|
||||
|
||||
private Integer id;
|
||||
private String name;
|
||||
private Integer lineId;
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.shxy.xymanager_common.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class Towers implements Serializable {
|
||||
|
||||
private Integer id;
|
||||
private String name;
|
||||
private Integer lineId;
|
||||
private Integer order;
|
||||
private Integer status;
|
||||
private Date createTime;
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.shxy.xymanager_common.enums;
|
||||
|
||||
|
||||
/**
|
||||
* 常用状态
|
||||
* "ImgMark"
|
||||
*
|
||||
* @author 晶晶
|
||||
*/
|
||||
public enum GloableParamsType {
|
||||
ImgMark("img_mark");
|
||||
|
||||
private String name;
|
||||
|
||||
GloableParamsType(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public String value() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.shxy.xymanager_dao.dao;
|
||||
|
||||
import com.shxy.xymanager_common.entity.GlobalParams;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface GlobalParamsDao {
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(GlobalParams record);
|
||||
|
||||
int insertSelective(GlobalParams record);
|
||||
|
||||
GlobalParams selectByPrimaryKey(Long id);
|
||||
|
||||
List<GlobalParams> selectAll();
|
||||
|
||||
int updateByPrimaryKeySelective(GlobalParams record);
|
||||
|
||||
int updateByPrimaryKey(GlobalParams record);
|
||||
|
||||
int updateByParamName(@Param("data") GlobalParams record, @Param("updatetime") Date updatetime);
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
<?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.shxy.xymanager_dao.dao.GlobalParamsDao">
|
||||
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.GlobalParams">
|
||||
<id column="id" jdbcType="INTEGER" property="id"/>
|
||||
<result column="param_name" jdbcType="VARCHAR" property="paramName"/>
|
||||
<result column="param_value" jdbcType="VARCHAR" property="paramValue"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, param_name, param_value, create_time, update_time
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from global_params
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
|
||||
<select id="selectAll" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from global_params
|
||||
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from global_params
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.GlobalParams">
|
||||
insert into global_params (id, param_name, param_value,
|
||||
create_time, update_time)
|
||||
values (#{id,jdbcType=BIGINT}, #{paramName,jdbcType=VARCHAR}, #{paramValue,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.GlobalParams">
|
||||
insert into global_params
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="paramName != null">
|
||||
param_name,
|
||||
</if>
|
||||
<if test="paramValue != null">
|
||||
param_value,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="paramName != null">
|
||||
#{paramName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="paramValue != null">
|
||||
#{paramValue,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.GlobalParams">
|
||||
update global_params
|
||||
<set>
|
||||
<if test="paramName != null">
|
||||
param_name = #{paramName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="paramValue != null">
|
||||
param_value = #{paramValue,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.GlobalParams">
|
||||
update global_params
|
||||
set param_name = #{paramName,jdbcType=VARCHAR},
|
||||
param_value = #{paramValue,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
|
||||
<update id="updateByParamName" parameterType="com.shxy.xymanager_common.entity.GlobalParams">
|
||||
update global_params
|
||||
set
|
||||
param_value = #{data.paramValue},
|
||||
update_time = #{updatetime}
|
||||
where param_name = #{data.paramName}
|
||||
</update>
|
||||
</mapper>
|
@ -0,0 +1,59 @@
|
||||
package com.shxy.xymanager_service.impl;
|
||||
|
||||
import com.shxy.xymanager_common.bean.ServiceBody;
|
||||
import com.shxy.xymanager_common.entity.GlobalParams;
|
||||
import com.shxy.xymanager_common.enums.GloableParamsType;
|
||||
import com.shxy.xymanager_common.exception.Asserts;
|
||||
import com.shxy.xymanager_dao.dao.GlobalParamsDao;
|
||||
import com.shxy.xymanager_service.cache.XyCache;
|
||||
import com.shxy.xymanager_service.service.GloablParamsService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 装置通道实现层
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class GloablParamsServiceImpl implements GloablParamsService {
|
||||
|
||||
@Autowired
|
||||
GlobalParamsDao globalParamsDao;
|
||||
|
||||
/**
|
||||
* 获取绘制状态
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServiceBody<Integer> getMarkEnableStatus() {
|
||||
Map<String, String> globalParams = XyCache.globalParams;
|
||||
String s = globalParams.get(GloableParamsType.ImgMark.value());
|
||||
Integer integer = Integer.valueOf(s);
|
||||
return Asserts.success(integer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改绘制状态
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServiceBody<String> updateMarkEnableStatus(Integer status) {
|
||||
GlobalParams record = new GlobalParams();
|
||||
record.setParamName(GloableParamsType.ImgMark.value());
|
||||
record.setParamValue(String.valueOf(status));
|
||||
int i = globalParamsDao.updateByParamName(record, new Date());
|
||||
if (i != 0) {
|
||||
XyCache.globalParams.put(GloableParamsType.ImgMark.value(), String.valueOf(status));
|
||||
return Asserts.success("修改成功");
|
||||
} else {
|
||||
return Asserts.error("修改失败");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.shxy.xymanager_service.service;
|
||||
|
||||
|
||||
import com.shxy.xymanager_common.bean.ServiceBody;
|
||||
|
||||
/**
|
||||
* 全局参数设置
|
||||
*
|
||||
* @author jingjing
|
||||
*/
|
||||
public interface GloablParamsService {
|
||||
|
||||
/**
|
||||
* 获取绘制状态
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ServiceBody<Integer> getMarkEnableStatus();
|
||||
|
||||
/**
|
||||
* 修改绘制状态
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ServiceBody<String> updateMarkEnableStatus(Integer status);
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue