欣影管理平台新增拍照时间关联

jni
liuguijing 2 years ago
parent b7be61c7fd
commit 437328ce19

@ -6,6 +6,7 @@ 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_common.model.TerminalChannelListModel;
import com.shxy.xymanager_common.model.TerminalChannelTreeListModel;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalIdVo;
import com.shxy.xymanager_service.service.TerminalChannelService;
@ -42,4 +43,17 @@ public class ChannelController extends BaseController {
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("/getChannelTreeList")
@Log(title = "获取所有通道树状列表", type = "查询")
public ResponseReult<TerminalChannelTreeListModel> getChannelTreeList() {
ServiceBody<TerminalChannelTreeListModel> serviceBody = terminalChannelService.getChannelTreeList();
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
}

@ -55,7 +55,6 @@ public class TerminalScheduleRuleController extends BaseController {
}
}
@ApiOperation(value = "添加任务规则列表", notes = "添加任务规则列表接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/addSchelduleRuleList")
@ -69,7 +68,6 @@ public class TerminalScheduleRuleController extends BaseController {
}
}
@ApiOperation(value = "修改任务规则", notes = "修改任务规则接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/updateSchelduleRule")
@ -96,5 +94,18 @@ public class TerminalScheduleRuleController extends BaseController {
}
}
@ApiOperation(value = "拍照任务规则关联设备", notes = "拍照任务规则关联设备接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/relateSchelduleRule")
@Log(title = "删除任务规则", type = "修改")
public ResponseReult<String> relateSchelduleRule(@RequestBody @Validated RelateTerminalRuleIdVo vo) {
ServiceBody<String> serviceBody = terminalScheduleRuleService.relateSchelduleRule(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
}

@ -0,0 +1,16 @@
package com.shxy.xymanager_admin.controller;
import com.shxy.xymanager_common.base.BaseController;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RestController;
@Api(value = "关联任务规则接口", tags = "关联任务规则接口相关")
@RestController
@Slf4j
public class TerminalScheduleRuleMapperController extends BaseController {
}

@ -11,7 +11,7 @@ public class TerminalScheduleMapper implements Serializable {
private Integer termId;
private Byte channelId;
private Integer channelId;
private Integer scheduleId;

@ -0,0 +1,101 @@
package com.shxy.xymanager_common.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
*
*/
@Data
@ApiModel(value = "通道树状列表", description = "通道树状列表信息")
public class TerminalChannelTreeListModel implements Serializable {
@ApiModelProperty(value = "电压列表", example = "[]")
private List<DyLineTreeListModel.DyListBean> list;
@Data
public static class DyListBean {
@ApiModelProperty(value = "电压编号", example = "123456")
private Integer id;
@ApiModelProperty(value = "电压名称", example = "AAAA")
private String name;
@ApiModelProperty(value = "电压大小", example = "AAAA")
private Integer dyValue;
@ApiModelProperty(value = "线路列表", example = "[]")
private List<DyLineTreeListModel.LineBean> list;
}
@Data
public static class LineBean {
@ApiModelProperty(value = "线路编号", example = "123456")
private Integer id;
@ApiModelProperty(value = "线路名称", example = "AAAA")
private String name;
@ApiModelProperty(value = "单位", example = "123456")
private String bsManufacturer;
@ApiModelProperty(value = "装置信息", example = "123456")
private List<DyLineTreeListModel.TerminalBean> list;
}
@Data
public static class TerminalBean {
@ApiModelProperty(value = "装置编号", example = "123456")
private Integer id;
@ApiModelProperty(value = "杆塔编号", example = "123456")
private Integer towerid;
@ApiModelProperty(value = "图像监测装置 ID17 位编码)", example = "12345678")
private String cmdid;
@ApiModelProperty(value = "装置名称", example = "名称名称")
private String equipName;
@ApiModelProperty(value = "显示名", example = "名称名称")
private String name;
@ApiModelProperty(value = "装置型号", example = "型号型号")
private String model;
@ApiModelProperty(value = "通道列表对象", example = "[]")
private List<ChannelBean> list;
}
@Data
public static class ChannelBean {
@ApiModelProperty(value = "通道id", example = "12321")
private Integer id;
@ApiModelProperty(value = "装置编号", example = "123456")
private Integer termId;
@ApiModelProperty(value = "通道编号", example = "123456")
private Byte channelNo;
@ApiModelProperty(value = "通道名称", example = "123456")
private String channelName;
@ApiModelProperty(value = "分辨率W", example = "123456")
private Integer maxResolutionWidth;
@ApiModelProperty(value = "分辨率H", example = "123456")
private Integer maxResolutionHeight;
}
}

@ -0,0 +1,28 @@
package com.shxy.xymanager_common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
*
*/
@Data
@ApiModel(value = "关联任务规则编号对象", description = "关联任务规则编号对象描述")
public class RelateTerminalRuleIdVo {
@NotNull(message = "规则编号不能缺少")
@ApiModelProperty(value = "规则编号", example = "123455")
private Integer ruleid;
@NotNull(message = "通道编号列表不能缺少")
@ApiModelProperty(value = "通道编号列表", example = "123455")
private List<Integer> channelidlist;
@NotNull(message = "装置编号")
@ApiModelProperty(value = "装置编号", example = "123455")
private Integer termid;
}

@ -1,16 +1,24 @@
package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.entity.TerminalScheduleMapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface TerminalScheduleMapperDao {
int deleteByPrimaryKey(Integer id);
int deleteByChannelId(@Param("list") List<Integer> list, @Param("termid") Integer termid);
int insert(TerminalScheduleMapper record);
int insertSelective(TerminalScheduleMapper record);
int insertList(@Param("list") List<TerminalScheduleMapper> record, @Param("createat") Date create, @Param("updateat") Date update);
TerminalScheduleMapper selectByPrimaryKey(Integer id);
List<TerminalScheduleMapper> selectByChannelId(@Param("list") List<Integer> list, @Param("termid") Integer termid);
int updateByPrimaryKeySelective(TerminalScheduleMapper record);
int updateByPrimaryKey(TerminalScheduleMapper record);

@ -9,6 +9,27 @@
<result column="max_resolution_width" jdbcType="INTEGER" property="maxResolutionWidth"/>
<result column="max_resolution_height" jdbcType="INTEGER" property="maxResolutionHeight"/>
</resultMap>
<resultMap id="LineAndTerminalMap" type="com.shxy.xymanager_common.dto.DyLineAndTerminalDto">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="dyvalue" jdbcType="INTEGER" property="dyValue"/>
<collection property="list" javaType="list" ofType="com.shxy.xymanager_common.dto.LineAndTerminalDto">
<id column="line_id" jdbcType="INTEGER" property="id"/>
<result column="line_name" jdbcType="VARCHAR" property="name"/>
<result column="bs_manufacturer" jdbcType="VARCHAR" property="bsManufacturer"/>
<result column="dy_level_id" jdbcType="INTEGER" property="dyLevel"/>
<collection property="list" javaType="list" ofType="com.shxy.xymanager_common.entity.Terminals">
<result column="term_id" jdbcType="INTEGER" property="id"/>
<result column="tower_id" jdbcType="INTEGER" property="towerid"/>
<result column="cmdid" jdbcType="VARCHAR" property="cmdid"/>
<result column="equip_name" jdbcType="VARCHAR" property="equipName"/>
<result column="display_name" jdbcType="VARCHAR" property="displayName"/>
<result column="model" jdbcType="VARCHAR" property="model"/>
</collection>
</collection>
</resultMap>
<sql id="Base_Column_List">
id, term_id, channel_no, channel_name, max_resolution_width, max_resolution_height
</sql>
@ -25,6 +46,20 @@
from terminal_channels
where term_id = #{termid}
</select>
<select id="selectAll" resultMap="LineAndDyNameMap">
select
x.id as id,
x.name as name,
x.bs_manufacturer as bs_manufacturer,
x.dy_level_id as dy_level_id,
x.status as status,
y.name as dy_level_name
from `lines` x,
dy_level y
where x.dy_level_id = y.id and x.status = #{status}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from terminal_channels
where id = #{id,jdbcType=INTEGER}

@ -18,10 +18,37 @@
from terminal_schedulemapper
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from terminal_schedulemapper
where id = #{id,jdbcType=INTEGER}
</delete>
<select id="selectByChannelId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_schedulemapper
where channel_id in
<foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
and term_id = #{termid}
</select>
<delete id="deleteByChannelId">
delete from terminal_schedulemapper
where channel_id in
<foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
and term_id = #{termid}
</delete>
<insert id="insertList" parameterType="java.util.List">
insert into terminal_schedulemapper
(term_id,channel_id,schedule_id,create_time,update_time)
VALUES
<foreach collection="list" item="item" separator=",">
(#{item.termId},#{item.channelId},#{item.scheduleId},#{createat},#{updateat})
</foreach>
</insert>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleMapper">
insert into terminal_schedulemapper (id, term_id, channel_id,
schedule_id, create_time, update_time

@ -0,0 +1,14 @@
package com.shxy.xymanager_framework.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebConfig implements WebMvcConfigurer {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/download/**").addResourceLocations("file:/usr/local/home/manager/download/");
}
}

@ -6,6 +6,7 @@ import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.entity.TerminalChannels;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.TerminalChannelListModel;
import com.shxy.xymanager_common.model.TerminalChannelTreeListModel;
import com.shxy.xymanager_common.vo.TerminalIdVo;
import com.shxy.xymanager_dao.dao.TerminalChannelsDao;
import com.shxy.xymanager_service.service.TerminalChannelService;
@ -45,4 +46,24 @@ public class TerminalChannelServiceImpl implements TerminalChannelService {
}
return Asserts.success(model);
}
/**
*
* @return
*/
@Override
public ServiceBody<TerminalChannelTreeListModel> getChannelTreeList() {
TerminalChannelListModel model = new TerminalChannelListModel();
List<TerminalChannels> list = terminalChannelsDao.selectByTermid(1);
boolean empty = CollectionUtil.isEmpty(list);
if (empty) {
model.setList(new ArrayList<>());
} else {
List<TerminalChannelListModel.ChannelBean> channelBeans = BeanUtil.copyToList(list, TerminalChannelListModel.ChannelBean.class);
model.setList(channelBeans);
}
return null;
}
}

@ -3,7 +3,6 @@ package com.shxy.xymanager_service.impl;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalVo;
import com.shxy.xymanager_service.service.TerminalChannelService;
import com.shxy.xymanager_service.service.TerminalPresetsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@ -5,6 +5,7 @@ import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollectionUtil;
import com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.entity.TerminalScheduleMapper;
import com.shxy.xymanager_common.entity.TerminalScheduleRule;
import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.exception.Asserts;
@ -13,12 +14,15 @@ import com.shxy.xymanager_common.model.TerminalScheduleRuleModel;
import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.TerminalScheduleMapperDao;
import com.shxy.xymanager_dao.dao.TerminalScheduleRuleDao;
import com.shxy.xymanager_service.service.TerminalScheduleRuleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -33,6 +37,9 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
@Autowired
TerminalScheduleRuleDao terminalScheduleRuleDao;
@Autowired
TerminalScheduleMapperDao terminalScheduleMapperDao;
/**
*
*
@ -158,4 +165,41 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
}
}
/**
*
*
* @param vo
* @return
*/
@Override
@Transactional
public ServiceBody<String> relateSchelduleRule(RelateTerminalRuleIdVo vo) {
ArrayList<TerminalScheduleMapper> list = new ArrayList<>();
List<Integer> channelidlist = vo.getChannelidlist();
Integer ruleid = vo.getRuleid();
Integer termid = vo.getTermid();
List<TerminalScheduleMapper> mappers = terminalScheduleMapperDao.selectByChannelId(channelidlist, termid);
boolean empty = CollectionUtil.isEmpty(mappers);
if (!empty) {
terminalScheduleMapperDao.deleteByChannelId(channelidlist, termid);
}
for (Integer item : channelidlist) {
TerminalScheduleMapper record = new TerminalScheduleMapper();
record.setChannelId(item);
record.setScheduleId(ruleid);
record.setTermId(termid);
list.add(record);
}
Date date = new Date();
int i = terminalScheduleMapperDao.insertList(list, date, date);
if (i != 0) {
return Asserts.success("关联成功");
} else {
return Asserts.error("关联失败");
}
}
}

@ -10,16 +10,14 @@ import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.vo.PageVo;
import com.shxy.xymanager_common.vo.TerminalIdListVo;
import com.shxy.xymanager_common.vo.TerminalVo;
import com.shxy.xymanager_common.vo.UpdateTerminalVo;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.TerminalsDao;
import com.shxy.xymanager_service.service.TerminalService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.validation.constraints.NotEmpty;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -79,7 +77,7 @@ public class TerminalServiceImpl implements TerminalService {
public ServiceBody<String> addTerminal(TerminalVo vo) {
List<Terminals> list = BeanUtil.copyToList(vo.getList(), Terminals.class);
Date time = new Date();
int i = terminalsDao.insertList(list, CommonStatus.EFFECTIVE.value(), time,time);
int i = terminalsDao.insertList(list, CommonStatus.EFFECTIVE.value(), time, time);
if (i != 0) {
return Asserts.success("录入成功");
} else {
@ -89,6 +87,7 @@ public class TerminalServiceImpl implements TerminalService {
/**
*
*
* @param vo
* @return
*/
@ -96,7 +95,7 @@ public class TerminalServiceImpl implements TerminalService {
public ServiceBody<String> updateTerminal(UpdateTerminalVo vo) {
Terminals terminals = new Terminals();
BeanUtil.copyProperties(vo, terminals, true);
int i = terminalsDao.updateByPrimaryKeySelective(terminals,new Date());
int i = terminalsDao.updateByPrimaryKeySelective(terminals, new Date());
if (i != 0) {
return Asserts.success("修改成功");
} else {
@ -112,8 +111,16 @@ public class TerminalServiceImpl implements TerminalService {
*/
@Override
public ServiceBody<String> deleteTerminal(TerminalIdListVo vo) {
List<Terminals> list = BeanUtil.copyToList(vo.getList(), Terminals.class);
int i = terminalsDao.deleteById(list,CommonStatus.DELETE.value(),new Date());
ArrayList<Terminals> list = new ArrayList<>();
List<TerminalIdVo> beans = vo.getList();
for (TerminalIdVo item : beans) {
Terminals terminals = new Terminals();
terminals.setId(item.getTermid());
list.add(terminals);
}
// List<Terminals> list = BeanUtil.copyToList(vo.getList(), Terminals.class);
int i = terminalsDao.deleteById(list, CommonStatus.DELETE.value(), new Date());
if (i != 0) {
return Asserts.success("删除成功");
} else {

@ -2,6 +2,7 @@ package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalChannelListModel;
import com.shxy.xymanager_common.model.TerminalChannelTreeListModel;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalIdVo;
import com.shxy.xymanager_common.vo.TerminalVo;
@ -19,4 +20,12 @@ public interface TerminalChannelService {
*/
ServiceBody<TerminalChannelListModel> getChannelList(TerminalIdVo vo);
/**
*
*
*
* @return
*/
ServiceBody<TerminalChannelTreeListModel> getChannelTreeList();
}

@ -33,7 +33,6 @@ public interface TerminalScheduleRuleService {
*/
ServiceBody<String> addSchedulelRuleList(TerminalRuleListVo vo);
/**
*
*
@ -42,7 +41,6 @@ public interface TerminalScheduleRuleService {
*/
ServiceBody<String> updateSchelduleRule(TerminalRuleVo vo);
/**
*
*
@ -50,4 +48,12 @@ public interface TerminalScheduleRuleService {
* @return
*/
ServiceBody<String> deleteSchelduleRule(TerminalRuleIdListVo vo);
/**
*
*
* @param vo
* @return
*/
ServiceBody<String> relateSchelduleRule(RelateTerminalRuleIdVo vo);
}

Loading…
Cancel
Save