欣影管理平台装置通道表修改

jni
liuguijing 2 years ago
parent 437328ce19
commit 7a7b024230

@ -5,12 +5,14 @@ import com.shxy.xymanager_common.base.BaseController;
import com.shxy.xymanager_common.base.ResponseReult; import com.shxy.xymanager_common.base.ResponseReult;
import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.bean.ServiceStatus; import com.shxy.xymanager_common.bean.ServiceStatus;
import com.shxy.xymanager_common.model.DyLineTreeAndChannelListModel;
import com.shxy.xymanager_common.model.TerminalChannelListModel; import com.shxy.xymanager_common.model.TerminalChannelListModel;
import com.shxy.xymanager_common.model.TerminalChannelTreeListModel; import com.shxy.xymanager_common.model.TerminalChannelMapperListModel;
import com.shxy.xymanager_common.model.TerminalListModel; import com.shxy.xymanager_common.vo.TerminalChannelIdListVo;
import com.shxy.xymanager_common.vo.TerminalChannelVo;
import com.shxy.xymanager_common.vo.TerminalIdVo; import com.shxy.xymanager_common.vo.TerminalIdVo;
import com.shxy.xymanager_common.vo.UpdateTerminalChannelVo;
import com.shxy.xymanager_service.service.TerminalChannelService; import com.shxy.xymanager_service.service.TerminalChannelService;
import com.shxy.xymanager_service.service.TerminalService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponse;
@ -31,12 +33,67 @@ public class ChannelController extends BaseController {
@Autowired @Autowired
TerminalChannelService terminalChannelService; TerminalChannelService terminalChannelService;
@ApiOperation(value = "获取通道接口", notes = "获取通道列表接口", httpMethod = "POST")
@ApiOperation(value = "获取所有通道列表", notes = "获取所有通道列表接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getChannelList") @RequestMapping("/getChannelList")
@Log(title = "获取所有通道列表", type = "查询")
public ResponseReult<TerminalChannelListModel> getChannelList() {
ServiceBody<TerminalChannelListModel> serviceBody = terminalChannelService.getChannelList();
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("/addChannelList")
@Log(title = "新增通道接口", type = "新增")
public ResponseReult<String> addChannelList(@RequestBody @Validated TerminalChannelVo vo) {
ServiceBody<String> serviceBody = terminalChannelService.addChannelList(vo);
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("/updateChannelList")
@Log(title = "修改通道列表", type = "查询")
public ResponseReult<String> updateChannelList(@RequestBody @Validated UpdateTerminalChannelVo vo) {
ServiceBody<String> serviceBody = terminalChannelService.updateChannelList(vo);
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("/deleteChannelList")
@Log(title = "获取通道列表", type = "查询") @Log(title = "获取通道列表", type = "查询")
public ResponseReult<TerminalChannelListModel> getChannelList(@RequestBody @Validated TerminalIdVo vo) { public ResponseReult<String> deleteChannelList(@RequestBody @Validated TerminalChannelIdListVo vo) {
ServiceBody<TerminalChannelListModel> serviceBody = terminalChannelService.getChannelList(vo); ServiceBody<String> serviceBody = terminalChannelService.deleteChannelList(vo);
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("/getChannelByTermid")
@Log(title = "根据装置号获取通道接口", type = "查询")
public ResponseReult<TerminalChannelMapperListModel> getChannelByTermid(@RequestBody @Validated TerminalIdVo vo) {
ServiceBody<TerminalChannelMapperListModel> serviceBody = terminalChannelService.getChannelByTermid(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) { if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData()); return ResponseReult.success(serviceBody.getData());
} else { } else {
@ -48,8 +105,8 @@ public class ChannelController extends BaseController {
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getChannelTreeList") @RequestMapping("/getChannelTreeList")
@Log(title = "获取所有通道树状列表", type = "查询") @Log(title = "获取所有通道树状列表", type = "查询")
public ResponseReult<TerminalChannelTreeListModel> getChannelTreeList() { public ResponseReult<DyLineTreeAndChannelListModel> getChannelTreeList(@RequestBody @Validated TerminalIdVo vo) {
ServiceBody<TerminalChannelTreeListModel> serviceBody = terminalChannelService.getChannelTreeList(); ServiceBody<DyLineTreeAndChannelListModel> serviceBody = terminalChannelService.getChannelTreeList(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) { if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData()); return ResponseReult.success(serviceBody.getData());
} else { } else {

@ -6,7 +6,7 @@ import com.shxy.xymanager_common.base.ResponseReult;
import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.bean.ServiceStatus; import com.shxy.xymanager_common.bean.ServiceStatus;
import com.shxy.xymanager_common.model.TerminalPhotoListModel; import com.shxy.xymanager_common.model.TerminalPhotoListModel;
import com.shxy.xymanager_common.vo.TerminalAndChannelIdVo; import com.shxy.xymanager_common.vo.TerminalAndChannelIdAndTimeVo;
import com.shxy.xymanager_service.service.TerminalPhotoService; import com.shxy.xymanager_service.service.TerminalPhotoService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -32,7 +32,7 @@ public class TerminalPhotoController extends BaseController {
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getTerminalPhotoList") @RequestMapping("/getTerminalPhotoList")
@Log(title = "获取设备列表", type = "查询") @Log(title = "获取设备列表", type = "查询")
public ResponseReult<TerminalPhotoListModel> getTerminalPhotoList(@RequestBody @Validated TerminalAndChannelIdVo vo) { public ResponseReult<TerminalPhotoListModel> getTerminalPhotoList(@RequestBody @Validated TerminalAndChannelIdAndTimeVo vo) {
ServiceBody<TerminalPhotoListModel> serviceBody = terminalPhotoService.getTerminalPhotoList(vo); ServiceBody<TerminalPhotoListModel> serviceBody = terminalPhotoService.getTerminalPhotoList(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) { if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData()); return ResponseReult.success(serviceBody.getData());

@ -7,6 +7,7 @@ import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.bean.ServiceStatus; import com.shxy.xymanager_common.bean.ServiceStatus;
import com.shxy.xymanager_common.model.TerminalScheduleRuleListModel; import com.shxy.xymanager_common.model.TerminalScheduleRuleListModel;
import com.shxy.xymanager_common.model.TerminalScheduleRuleModel; import com.shxy.xymanager_common.model.TerminalScheduleRuleModel;
import com.shxy.xymanager_common.model.TerminalScheduleRuleTimeListModel;
import com.shxy.xymanager_common.vo.*; import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_service.service.TerminalScheduleRuleService; import com.shxy.xymanager_service.service.TerminalScheduleRuleService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -97,8 +98,8 @@ public class TerminalScheduleRuleController extends BaseController {
@ApiOperation(value = "拍照任务规则关联设备", notes = "拍照任务规则关联设备接口", httpMethod = "POST") @ApiOperation(value = "拍照任务规则关联设备", notes = "拍照任务规则关联设备接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/relateSchelduleRule") @RequestMapping("/relateSchelduleRule")
@Log(title = "删除任务规则", type = "修改") @Log(title = "关联任务规则", type = "修改")
public ResponseReult<String> relateSchelduleRule(@RequestBody @Validated RelateTerminalRuleIdVo vo) { public ResponseReult<String> relateSchelduleRule(@RequestBody @Validated RelateTerminalListRuleIdVo vo) {
ServiceBody<String> serviceBody = terminalScheduleRuleService.relateSchelduleRule(vo); ServiceBody<String> serviceBody = terminalScheduleRuleService.relateSchelduleRule(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) { if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData()); return ResponseReult.success(serviceBody.getData());
@ -107,5 +108,17 @@ public class TerminalScheduleRuleController extends BaseController {
} }
} }
@ApiOperation(value = "根据通道和装置编号获取拍照时间表", notes = "根据通道和装置编号获取拍照时间表", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getChannelSchelduleRule")
@Log(title = "根据通道和装置编号获取拍照时间表", type = "修改")
public ResponseReult<TerminalScheduleRuleTimeListModel> getChannelSchelduleRule(@RequestBody @Validated TerminalAndChannelIdVo vo) {
ServiceBody<TerminalScheduleRuleTimeListModel> serviceBody = terminalScheduleRuleService.getChannelSchelduleRule(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
} }

@ -1,20 +1,30 @@
package com.shxy.xymanager_admin; package com.shxy.xymanager_admin;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.shxy.xymanager_common.entity.Lines; import com.shxy.xymanager_common.entity.Lines;
import com.shxy.xymanager_common.entity.TerminalScheduleRule;
import com.shxy.xymanager_common.entity.Terminals; import com.shxy.xymanager_common.entity.Terminals;
import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_dao.dao.LinesDao; import com.shxy.xymanager_dao.dao.LinesDao;
import com.shxy.xymanager_dao.dao.TerminalScheduleRuleDao;
import com.shxy.xymanager_dao.dao.TerminalsDao; import com.shxy.xymanager_dao.dao.TerminalsDao;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import java.sql.Time;
import java.util.Date; import java.util.Date;
import java.util.List;
@SpringBootTest @SpringBootTest
class XymanagerAdminApplicationTests { class XymanagerAdminApplicationTests {
@Autowired @Autowired
TerminalsDao terminalsDao; TerminalsDao terminalsDao;
@Autowired
TerminalScheduleRuleDao terminalScheduleRuleDao;
@Autowired @Autowired
LinesDao linesDao; LinesDao linesDao;
@ -41,6 +51,15 @@ class XymanagerAdminApplicationTests {
// int i = terminalsDao.insertSelective(terminals); // int i = terminalsDao.insertSelective(terminals);
// System.out.println(i +""); // System.out.println(i +"");
// TerminalScheduleRule bean = terminalScheduleRuleDao.selectByPrimaryKey(1);
// Time startTime = bean.getStartTime();
// Time endTime = bean.getEndTime();
// Integer span = bean.getSpan();
// List<DateTime> dateTimes = MyDateUtils.rangeToList(startTime, endTime, DateField.MINUTE, span);
// for (DateTime item : dateTimes) {
// String dateTime = DateUtil.formatTime(item);
// }
// System.out.println(dateTime.toString());
} }

@ -0,0 +1,21 @@
package com.shxy.xymanager_common.dto;
import lombok.Data;
import java.util.List;
/**
* 线
*/
@Data
public class DyLineAndTerminalAndChannelDto {
private Integer id;
private String name;
private Integer dyValue;
private List<LineAndTerminalAndChannelDto> list;
}

@ -0,0 +1,18 @@
package com.shxy.xymanager_common.dto;
import lombok.Data;
import java.util.List;
@Data
public class LineAndTerminalAndChannelDto {
private Integer id;
private String name;
private String bsManufacturer;
private List<TerminalsAndChannelDto> list;
}

@ -0,0 +1,25 @@
package com.shxy.xymanager_common.dto;
import lombok.Data;
/**
*
*/
@Data
public class TermChannelAndMapperDto {
private Integer id;
private Integer termid;
private Integer channelid;
private String channelname;
private Integer status;
private Integer maxResolutionWidth;
private Integer maxResolutionHeight;
}

@ -0,0 +1,15 @@
package com.shxy.xymanager_common.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class TerminalChannelsDto implements Serializable {
private Integer id;
private String name;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,22 @@
package com.shxy.xymanager_common.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class TerminalsAndChannelDto implements Serializable {
private Integer id;
private Integer towerid;
private String cmdid;
private String name;
private List<TerminalChannelsDto> list;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,22 @@
package com.shxy.xymanager_common.entity;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class TerminalChannelMapper implements Serializable {
private Integer id;
private Integer termId;
private Integer channelId;
private Date createTime;
private Date updateTime;
private static final long serialVersionUID = 1L;
}

@ -3,21 +3,24 @@ package com.shxy.xymanager_common.entity;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
@Data @Data
public class TerminalChannels implements Serializable { public class TerminalChannels implements Serializable {
private Integer id; private Integer id;
private Integer termId;
private Byte channelNo;
private String channelName; private String channelName;
private Integer maxResolutionWidth; private Integer maxResolutionWidth;
private Integer maxResolutionHeight; private Integer maxResolutionHeight;
private Integer status;
private Date createTime;
private Date updateTime;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }

@ -0,0 +1,82 @@
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 DyLineTreeAndChannelListModel implements Serializable {
@ApiModelProperty(value = "电压列表", example = "[]")
private List<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<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<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 name;
@ApiModelProperty(value = "通道信息", example = "123456")
private List<ChannelBean> list;
}
@Data
public static class ChannelBean {
@ApiModelProperty(value = "通道id", example = "12321")
private Integer id;
@ApiModelProperty(value = "通道名称", example = "123456")
private String name;
}
}

@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -21,17 +20,14 @@ public class TerminalChannelListModel implements Serializable {
@Data @Data
public static class ChannelBean { public static class ChannelBean {
@ApiModelProperty(value = "通道id", example = "12321")
private Integer id;
@ApiModelProperty(value = "装置编号", example = "123456")
private Integer termId;
@ApiModelProperty(value = "通道编号", example = "123456") @ApiModelProperty(value = "通道编号", example = "123456")
private Byte channelNo; private Integer id;
@ApiModelProperty(value = "通道名称", example = "123456") @ApiModelProperty(value = "通道名称", example = "123456")
private String channelName; private String channelname;
@ApiModelProperty(value = "通道状态", example = "123456")
private Integer status;
@ApiModelProperty(value = "分辨率W", example = "123456") @ApiModelProperty(value = "分辨率W", example = "123456")
private Integer maxResolutionWidth; private Integer maxResolutionWidth;

@ -0,0 +1,43 @@
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.Date;
import java.util.List;
/**
*
*/
@Data
@ApiModel(value = "通道关联表和通道列表", description = "通道列表信息")
public class TerminalChannelMapperListModel implements Serializable {
@ApiModelProperty(value = "通道关联表和通道列表对象", example = "[]")
private List<ChannelBean> list;
@Data
public static class ChannelBean {
@ApiModelProperty(value = "装置编号", example = "123456")
private Integer termId;
@ApiModelProperty(value = "通道编号", example = "123456")
private Integer channelid;
@ApiModelProperty(value = "通道名称", example = "123456")
private String channelname;
@ApiModelProperty(value = "通道状态", example = "123456")
private Integer status;
@ApiModelProperty(value = "分辨率W", example = "123456")
private Integer maxResolutionWidth;
@ApiModelProperty(value = "分辨率H", example = "123456")
private Integer maxResolutionHeight;
}
}

@ -0,0 +1,21 @@
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.sql.Time;
import java.util.List;
/**
*
*/
@Data
@ApiModel(value = "时间任务详情", description = "时间任务详情信息")
public class TerminalScheduleRuleTimeListModel implements Serializable {
@ApiModelProperty(value = "任务名称", example = "123456")
private List<String> list;
}

@ -1,7 +1,11 @@
package com.shxy.xymanager_common.util; package com.shxy.xymanager_common.util;
import ch.qos.logback.core.util.TimeUtil;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Range;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
import java.lang.management.ManagementFactory; import java.lang.management.ManagementFactory;
@ -154,4 +158,11 @@ public class MyDateUtils extends DateUtil {
// long sec = diff % nd % nh % nm / ns; // long sec = diff % nd % nh % nm / ns;
return day + "天" + hour + "小时" + min + "分钟"; return day + "天" + hour + "小时" + min + "分钟";
} }
// public static String dfdsa(Date start, Date end, DateField unit, int step, boolean isIncludeStart, boolean isIncludeEnd){
// new Range(DateUtil.date(start), DateUtil.date(end), (current, end1, index) -> {
// DateTime dt = DateUtil.date(start).offsetNew(unit, (index + 1) * step);
// return dt.isAfter(end1) ? null : dt;
// }, isIncludeStart, isIncludeEnd);
// }
} }

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

@ -1,28 +0,0 @@
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;
}

@ -0,0 +1,26 @@
package com.shxy.xymanager_common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.Date;
@Data
@ApiModel(value = "装置和通道编号和查询时间", description = "装置和通道编号和查询时间描述")
public class TerminalAndChannelIdAndTimeVo {
@NotNull(message = "装置编号不能缺少")
@ApiModelProperty(value = "装置编号", example = "123455")
private Integer terminalid;
@NotNull(message = "通道编号不能缺少")
@ApiModelProperty(value = "通道编号", example = "123455")
private Integer channelid;
@NotNull(message = "查询时间不能缺少")
@ApiModelProperty(value = "查询时间", example = "123455")
private Date time;
}

@ -4,7 +4,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date; import java.util.Date;
@ -20,7 +19,4 @@ public class TerminalAndChannelIdVo {
@ApiModelProperty(value = "通道编号", example = "123455") @ApiModelProperty(value = "通道编号", example = "123455")
private Integer channelid; private Integer channelid;
@NotNull(message = "查询时间不能缺少")
@ApiModelProperty(value = "查询时间", example = "123455")
private Date time;
} }

@ -0,0 +1,16 @@
package com.shxy.xymanager_common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import java.util.List;
@Data
@ApiModel(value = "通道编号数组对象", description = "通道编号数组对象")
public class TerminalChannelIdListVo {
@NotEmpty(message = "不能传入空值")
@ApiModelProperty(value = "通道编号数组", required = true, example = "A0001")
private List<Integer> list;
}

@ -0,0 +1,34 @@
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 TerminalChannelVo {
@NotNull(message = "装置列表不能缺少")
@ApiModelProperty(value = "装置通道编号列表", example = "123455")
private List<Item> list;
@Data
public static class Item {
@NotNull(message = "通道编号")
@ApiModelProperty(value = "装置编号", example = "123455")
private Integer id;
@NotNull(message = "通道编号不能缺少")
@ApiModelProperty(value = "通道编号", example = "123455")
private Integer channelname;
@ApiModelProperty(value = "分辨率W", example = "123456")
private Integer maxResolutionWidth;
@ApiModelProperty(value = "分辨率H", example = "123456")
private Integer maxResolutionHeight;
}
}

@ -12,7 +12,6 @@ import java.util.List;
@ApiModel(value = "装置编号对象", description = "装置编号对象描述") @ApiModel(value = "装置编号对象", description = "装置编号对象描述")
public class TerminalIdVo { public class TerminalIdVo {
@NotNull(message = "装置编号不能缺少")
@ApiModelProperty(value = "装置编号", example = "123455") @ApiModelProperty(value = "装置编号", example = "123455")
private Integer termid; private Integer termid;
} }

@ -0,0 +1,31 @@
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 UpdateTerminalChannelVo {
@NotNull(message = "通道编号")
@ApiModelProperty(value = "装置编号", example = "123455")
private Integer id;
@NotNull(message = "通道编号不能缺少")
@ApiModelProperty(value = "通道编号", example = "123455")
private Integer channelname;
@NotNull(message = "通道编号状态")
@ApiModelProperty(value = "通道状态", example = "0---关闭 1--开启")
private Integer status;
@ApiModelProperty(value = "分辨率W", example = "123456")
private Integer maxResolutionWidth;
@ApiModelProperty(value = "分辨率H", example = "123456")
private Integer maxResolutionHeight;
}

@ -0,0 +1,21 @@
package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.entity.TerminalChannelMapper;
import java.util.List;
public interface TerminalChannelMapperDao {
int deleteByPrimaryKey(Integer id);
int insert(TerminalChannelMapper record);
int insertSelective(TerminalChannelMapper record);
List<TerminalChannelMapper> selectByTermid(Integer id);
TerminalChannelMapper selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TerminalChannelMapper record);
int updateByPrimaryKey(TerminalChannelMapper record);
}

@ -1,19 +1,27 @@
package com.shxy.xymanager_dao.dao; package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.dto.DyLineAndTerminalAndChannelDto;
import com.shxy.xymanager_common.dto.TermChannelAndMapperDto;
import com.shxy.xymanager_common.entity.TerminalChannels; import com.shxy.xymanager_common.entity.TerminalChannels;
import com.shxy.xymanager_common.entity.TerminalScheduleMapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List; import java.util.List;
public interface TerminalChannelsDao { public interface TerminalChannelsDao {
int deleteByPrimaryKey(Integer id); int deleteByPrimaryKey(Integer id);
int insert(TerminalChannels record); int insertList(@Param("list") List<TerminalChannels> record,@Param("status") Integer status, @Param("createat") Date create, @Param("updateat") Date update);
int insertSelective(TerminalChannels record); List<TerminalChannels> selectChannelList();
List<TerminalChannels> selectByTermid(Integer termid); List<TermChannelAndMapperDto> selectByTermid(@Param("termid") Integer termid, @Param("status") Integer status);
int updateByPrimaryKeySelective(TerminalChannels record); List<DyLineAndTerminalAndChannelDto> selectAllAndChannelByTermid(@Param("termid") Integer termid, @Param("status") Integer status);
int updateByPrimaryKeySelective(@Param("data") TerminalChannels record,@Param("updateat") Date update);
int deleteList(@Param("list") List<Integer> list,@Param("status") Integer status,@Param("updateat") Date update);
int updateByPrimaryKey(TerminalChannels record);
} }

@ -1,13 +1,14 @@
package com.shxy.xymanager_dao.dao; package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.entity.TerminalScheduleMapper; import com.shxy.xymanager_common.entity.TerminalScheduleMapper;
import com.shxy.xymanager_common.vo.RelateTerminalListRuleIdVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
public interface TerminalScheduleMapperDao { public interface TerminalScheduleMapperDao {
int deleteByChannelId(@Param("list") List<Integer> list, @Param("termid") Integer termid); int deleteByChannelId(@Param("list") List<TerminalScheduleMapper> list);
int insert(TerminalScheduleMapper record); int insert(TerminalScheduleMapper record);
@ -17,7 +18,9 @@ public interface TerminalScheduleMapperDao {
TerminalScheduleMapper selectByPrimaryKey(Integer id); TerminalScheduleMapper selectByPrimaryKey(Integer id);
List<TerminalScheduleMapper> selectByChannelId(@Param("list") List<Integer> list, @Param("termid") Integer termid); TerminalScheduleMapper selectByChannelId(@Param("channelid") Integer list, @Param("termid") Integer termid);
List<TerminalScheduleMapper> selectByTerminalBean(@Param("list") List<RelateTerminalListRuleIdVo.Item> list);
int updateByPrimaryKeySelective(TerminalScheduleMapper record); int updateByPrimaryKeySelective(TerminalScheduleMapper record);

@ -128,9 +128,17 @@
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;--> <!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>--> <!-- </table>-->
<table tableName="dy_level" <!-- <table tableName="dy_level"-->
domainObjectName="DyLevel" <!-- domainObjectName="DyLevel"-->
mapperName="DyLevelDao" <!-- mapperName="DyLevelDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<table tableName="terminal_channel_mapper"
domainObjectName="TerminalChannelMapper"
mapperName="TerminalChannelMapperDao"
enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false"> enableSelectByExample="false" selectByExampleQueryId="false">
<!-- <property name="useActualColumnNames" value="false"/>--> <!-- <property name="useActualColumnNames" value="false"/>-->

@ -0,0 +1,100 @@
<?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.TerminalChannelMapperDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalChannelMapper">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="term_id" jdbcType="INTEGER" property="termId"/>
<result column="channel_id" jdbcType="INTEGER" property="channelId"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
id, term_id, channel_id, create_time, update_time
</sql>
<select id="selectByTermid" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_channel_mapper
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_channel_mapper
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from terminal_channel_mapper
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalChannelMapper">
insert into terminal_channel_mapper (id, term_id, channel_id,
create_time, update_time)
values (#{id,jdbcType=INTEGER}, #{termId,jdbcType=INTEGER}, #{channelId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalChannelMapper">
insert into terminal_channel_mapper
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="termId != null">
term_id,
</if>
<if test="channelId != null">
channel_id,
</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=INTEGER},
</if>
<if test="termId != null">
#{termId,jdbcType=INTEGER},
</if>
<if test="channelId != null">
#{channelId,jdbcType=INTEGER},
</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.TerminalChannelMapper">
update terminal_channel_mapper
<set>
<if test="termId != null">
term_id = #{termId,jdbcType=INTEGER},
</if>
<if test="channelId != null">
channel_id = #{channelId,jdbcType=INTEGER},
</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=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalChannelMapper">
update terminal_channel_mapper
set term_id = #{termId,jdbcType=INTEGER},
channel_id = #{channelId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

@ -3,35 +3,47 @@
<mapper namespace="com.shxy.xymanager_dao.dao.TerminalChannelsDao"> <mapper namespace="com.shxy.xymanager_dao.dao.TerminalChannelsDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalChannels"> <resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalChannels">
<id column="id" jdbcType="INTEGER" property="id"/> <id column="id" jdbcType="INTEGER" property="id"/>
<result column="term_id" jdbcType="INTEGER" property="termId"/>
<result column="channel_no" jdbcType="TINYINT" property="channelNo"/>
<result column="channel_name" jdbcType="VARCHAR" property="channelName"/> <result column="channel_name" jdbcType="VARCHAR" property="channelName"/>
<result column="max_resolution_width" jdbcType="INTEGER" property="maxResolutionWidth"/> <result column="max_resolution_width" jdbcType="INTEGER" property="maxResolutionWidth"/>
<result column="max_resolution_height" jdbcType="INTEGER" property="maxResolutionHeight"/> <result column="max_resolution_height" jdbcType="INTEGER" property="maxResolutionHeight"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap> </resultMap>
<resultMap id="LineAndTerminalMap" type="com.shxy.xymanager_common.dto.DyLineAndTerminalDto"> <resultMap id="TerminalAndMapperMap" type="com.shxy.xymanager_common.dto.TermChannelAndMapperDto">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="termid" jdbcType="INTEGER" property="termid"/>
<result column="channel_id" jdbcType="INTEGER" property="channelid"/>
<result column="channel_name" jdbcType="VARCHAR" property="channelname"/>
<result column="max_resolution_width" jdbcType="INTEGER" property="maxResolutionWidth"/>
<result column="max_resolution_height" jdbcType="INTEGER" property="maxResolutionHeight"/>
<result column="status" jdbcType="INTEGER" property="status"/>
</resultMap>
<resultMap id="LineAndTerminalMap" type="com.shxy.xymanager_common.dto.DyLineAndTerminalAndChannelDto">
<id column="id" jdbcType="INTEGER" property="id"/> <id column="id" jdbcType="INTEGER" property="id"/>
<result column="name" jdbcType="VARCHAR" property="name"/> <result column="name" jdbcType="VARCHAR" property="name"/>
<result column="dyvalue" jdbcType="INTEGER" property="dyValue"/> <result column="dyvalue" jdbcType="INTEGER" property="dyValue"/>
<collection property="list" javaType="list" ofType="com.shxy.xymanager_common.dto.LineAndTerminalDto"> <collection property="list" javaType="list" ofType="com.shxy.xymanager_common.dto.LineAndTerminalAndChannelDto">
<id column="line_id" jdbcType="INTEGER" property="id"/> <id column="line_id" jdbcType="INTEGER" property="id"/>
<result column="line_name" jdbcType="VARCHAR" property="name"/> <result column="line_name" jdbcType="VARCHAR" property="name"/>
<result column="bs_manufacturer" jdbcType="VARCHAR" property="bsManufacturer"/> <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.dto.TerminalsAndChannelDto">
<collection property="list" javaType="list" ofType="com.shxy.xymanager_common.entity.Terminals">
<result column="term_id" jdbcType="INTEGER" property="id"/> <result column="term_id" jdbcType="INTEGER" property="id"/>
<result column="tower_id" jdbcType="INTEGER" property="towerid"/> <result column="tower_id" jdbcType="INTEGER" property="towerid"/>
<result column="cmdid" jdbcType="VARCHAR" property="cmdid"/> <result column="cmdid" jdbcType="VARCHAR" property="cmdid"/>
<result column="equip_name" jdbcType="VARCHAR" property="equipName"/> <result column="display_name" jdbcType="VARCHAR" property="name"/>
<result column="display_name" jdbcType="VARCHAR" property="displayName"/> <collection property="list" javaType="list" ofType="com.shxy.xymanager_common.dto.TerminalChannelsDto">
<result column="model" jdbcType="VARCHAR" property="model"/> <result column="channel_id" jdbcType="INTEGER" property="id"/>
<result column="channel_name" jdbcType="VARCHAR" property="name"/>
</collection>
</collection> </collection>
</collection> </collection>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, term_id, channel_no, channel_name, max_resolution_width, max_resolution_height id, channel_name, max_resolution_width, max_resolution_height,status,create_time,update_time
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select select
@ -39,25 +51,52 @@
from terminal_channels from terminal_channels
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</select> </select>
<select id="selectChannelList" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<select id="selectByTermid" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from terminal_channels from terminal_channels
where term_id = #{termid}
</select> </select>
<select id="selectByTermid" parameterType="java.lang.Integer" resultMap="TerminalAndMapperMap">
<select id="selectAll" resultMap="LineAndDyNameMap">
select select
x.id as id, x.id as id,
x.name as name, x.term_id as termid,
x.channel_id as channel_id,
y.channel_name as channel_name,
y.max_resolution_width as max_resolution_width,
y.max_resolution_height as max_resolution_height,
y.status as status
from terminal_channel_mapper x,
terminal_channels y
where x.channel_id = y.id and y.status = #{status}
<if test="termid != null">
and x.term_id = #{termid}
</if>
</select>
<select id="selectAllAndChannelByTermid" resultMap="LineAndTerminalMap">
select
z.id as id,
z.name as name,
z.dy_value as dyvalue,
x.id as line_id,
x.name as line_name,
x.bs_manufacturer as bs_manufacturer, x.bs_manufacturer as bs_manufacturer,
x.dy_level_id as dy_level_id, y.id as term_id,
x.status as status, y.tower_id as tower_id,
y.name as dy_level_name y.cmdid as cmdid,
y.display_name as display_name,
k.id as channel_id,
k.channel_name as channel_name
from `lines` x, from `lines` x,
dy_level y terminals y,
where x.dy_level_id = y.id and x.status = #{status} dy_level z,
terminal_channel_mapper j,
terminal_channels k
where z.id = x.dy_level_id and x.id = y.line_id and j.term_id = y.id and j.channel_id = k.id
and x.status = #{status} and y.status = #{status} and z.status = #{status} and k.status = #{status}
<if test="termid != null">
and y.id = #{termid}
</if>
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
@ -115,34 +154,41 @@
</if> </if>
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalChannels"> <update id="updateByPrimaryKeySelective">
update terminal_channels update terminal_channels
<set> <set>
<if test="termId != null"> <if test="data.channelName != null">
term_id = #{termId,jdbcType=INTEGER}, channel_name = #{data.channelName},
</if> </if>
<if test="channelNo != null"> <if test="data.maxResolutionWidth != null">
channel_no = #{channelNo,jdbcType=TINYINT}, max_resolution_width = #{data.maxResolutionWidth},
</if> </if>
<if test="channelName != null"> <if test="data.maxResolutionHeight != null">
channel_name = #{channelName,jdbcType=VARCHAR}, max_resolution_height = #{data.maxResolutionHeight},
</if> </if>
<if test="maxResolutionWidth != null"> <if test="data.status != null">
max_resolution_width = #{maxResolutionWidth,jdbcType=INTEGER}, status = #{data.status,jdbcType=INTEGER},
</if> </if>
<if test="maxResolutionHeight != null"> <if test="updateat != null">
max_resolution_height = #{maxResolutionHeight,jdbcType=INTEGER}, update_time = #{updateat},
</if> </if>
</set> </set>
where id = #{id,jdbcType=INTEGER} where id = #{data.id}
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalChannels">
<update id="deleteList">
update terminal_channels update terminal_channels
set term_id = #{termId,jdbcType=INTEGER}, <set>
channel_no = #{channelNo,jdbcType=TINYINT}, <if test="status != null">
channel_name = #{channelName,jdbcType=VARCHAR}, status = #{status,jdbcType=INTEGER},
max_resolution_width = #{maxResolutionWidth,jdbcType=INTEGER}, </if>
max_resolution_height = #{maxResolutionHeight,jdbcType=INTEGER} <if test="updateat != null">
where id = #{id,jdbcType=INTEGER} update_time = #{updateat},
</if>
</set>
where
<foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</update> </update>
</mapper> </mapper>

@ -19,24 +19,33 @@
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</select> </select>
<select id="selectByChannelId" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByChannelId" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from terminal_schedulemapper from terminal_schedulemapper
where channel_id in where channel_id = #{channelid}
<foreach collection="list" item="id" index="index" open="(" close=")" separator=","> and term_id = #{termid}
</select>
<select id="selectByTerminalBean" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_schedulemapper
where
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
term_id = #{item.termid} and channel_id in
<foreach collection="item.channelidlist" item="id" index="index" open="(" close=")" separator=",">
#{id} #{id}
</foreach> </foreach>
and term_id = #{termid} </foreach>
</select> </select>
<delete id="deleteByChannelId"> <delete id="deleteByChannelId">
delete from terminal_schedulemapper delete from terminal_schedulemapper
where channel_id in where
<foreach collection="list" item="id" index="index" open="(" close=")" separator=","> <foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{id} term_id = #{item.termId} and channel_id = #{item.channelId}
</foreach> </foreach>
and term_id = #{termid}
</delete> </delete>
<insert id="insertList" parameterType="java.util.List"> <insert id="insertList" parameterType="java.util.List">

@ -1,13 +1,21 @@
package com.shxy.xymanager_service.impl; package com.shxy.xymanager_service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.dto.DyLineAndTerminalAndChannelDto;
import com.shxy.xymanager_common.dto.TermChannelAndMapperDto;
import com.shxy.xymanager_common.entity.TerminalChannels; import com.shxy.xymanager_common.entity.TerminalChannels;
import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.exception.Asserts; import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.DyLineTreeAndChannelListModel;
import com.shxy.xymanager_common.model.TerminalChannelListModel; import com.shxy.xymanager_common.model.TerminalChannelListModel;
import com.shxy.xymanager_common.model.TerminalChannelTreeListModel; import com.shxy.xymanager_common.model.TerminalChannelMapperListModel;
import com.shxy.xymanager_common.vo.TerminalChannelIdListVo;
import com.shxy.xymanager_common.vo.TerminalChannelVo;
import com.shxy.xymanager_common.vo.TerminalIdVo; import com.shxy.xymanager_common.vo.TerminalIdVo;
import com.shxy.xymanager_common.vo.UpdateTerminalChannelVo;
import com.shxy.xymanager_dao.dao.TerminalChannelsDao; import com.shxy.xymanager_dao.dao.TerminalChannelsDao;
import com.shxy.xymanager_service.service.TerminalChannelService; import com.shxy.xymanager_service.service.TerminalChannelService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -15,11 +23,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
* *
*
*/ */
@Service @Service
@Slf4j @Slf4j
@ -29,19 +37,84 @@ public class TerminalChannelServiceImpl implements TerminalChannelService {
TerminalChannelsDao terminalChannelsDao; TerminalChannelsDao terminalChannelsDao;
/** /**
* *
*
* @param vo * @param vo
* @return * @return
*/ */
@Override @Override
public ServiceBody<TerminalChannelListModel> getChannelList(TerminalIdVo vo) { public ServiceBody<String> addChannelList(TerminalChannelVo vo) {
List<TerminalChannels> list = BeanUtil.copyToList(vo.getList(), TerminalChannels.class, CopyOptions.create().ignoreCase());
Date date = new Date();
int i = terminalChannelsDao.insertList(list, CommonStatus.EFFECTIVE.value(), date, date);
if (i != 0) {
return Asserts.success("录入成功");
} else {
return Asserts.error("录入失败");
}
}
/**
*
*
* @param vo
* @return
*/
@Override
public ServiceBody<String> updateChannelList(UpdateTerminalChannelVo vo) {
TerminalChannels bean = BeanUtil.copyProperties(vo, TerminalChannels.class);
int i = terminalChannelsDao.updateByPrimaryKeySelective(bean, new Date());
if (i != 0) {
return Asserts.success("修改成功");
} else {
return Asserts.error("修改失败");
}
}
@Override
public ServiceBody<String> deleteChannelList(TerminalChannelIdListVo vo) {
int i = terminalChannelsDao.deleteList(vo.getList(), CommonStatus.DELETE.value(), new Date());
if (i != 0) {
return Asserts.success("删除成功");
} else {
return Asserts.error("删除失败");
}
}
/**
*
*
* @return
*/
@Override
public ServiceBody<TerminalChannelListModel> getChannelList() {
TerminalChannelListModel model = new TerminalChannelListModel(); TerminalChannelListModel model = new TerminalChannelListModel();
List<TerminalChannels> list = terminalChannelsDao.selectByTermid(vo.getTermid()); List<TerminalChannels> list = terminalChannelsDao.selectChannelList();
boolean empty = CollectionUtil.isEmpty(list); boolean empty = CollectionUtil.isEmpty(list);
if (empty) { if (empty) {
model.setList(new ArrayList<>()); model.setList(new ArrayList<>());
} else { } else {
List<TerminalChannelListModel.ChannelBean> channelBeans = BeanUtil.copyToList(list, TerminalChannelListModel.ChannelBean.class); List<TerminalChannelListModel.ChannelBean> channelBeans = BeanUtil.copyToList(list, TerminalChannelListModel.ChannelBean.class, CopyOptions.create().ignoreCase());
model.setList(channelBeans);
}
return Asserts.success(model);
}
/**
*
*
* @param vo
* @return
*/
@Override
public ServiceBody<TerminalChannelMapperListModel> getChannelByTermid(TerminalIdVo vo) {
TerminalChannelMapperListModel model = new TerminalChannelMapperListModel();
List<TermChannelAndMapperDto> list = terminalChannelsDao.selectByTermid(vo.getTermid(), CommonStatus.EFFECTIVE.value());
boolean empty = CollectionUtil.isEmpty(list);
if (empty) {
model.setList(new ArrayList<>());
} else {
List<TerminalChannelMapperListModel.ChannelBean> channelBeans = BeanUtil.copyToList(list, TerminalChannelMapperListModel.ChannelBean.class, CopyOptions.create().ignoreCase());
model.setList(channelBeans); model.setList(channelBeans);
} }
return Asserts.success(model); return Asserts.success(model);
@ -50,20 +123,21 @@ public class TerminalChannelServiceImpl implements TerminalChannelService {
/** /**
* *
*
* @return * @return
*/ */
@Override @Override
public ServiceBody<TerminalChannelTreeListModel> getChannelTreeList() { public ServiceBody<DyLineTreeAndChannelListModel> getChannelTreeList(TerminalIdVo vo) {
TerminalChannelListModel model = new TerminalChannelListModel(); DyLineTreeAndChannelListModel model = new DyLineTreeAndChannelListModel();
List<TerminalChannels> list = terminalChannelsDao.selectByTermid(1); List<DyLineAndTerminalAndChannelDto> list = terminalChannelsDao.selectAllAndChannelByTermid(vo.getTermid(), CommonStatus.EFFECTIVE.value());
boolean empty = CollectionUtil.isEmpty(list); boolean empty = CollectionUtil.isEmpty(list);
if (empty) { if (empty) {
model.setList(new ArrayList<>()); model.setList(new ArrayList<>());
} else { } else {
List<TerminalChannelListModel.ChannelBean> channelBeans = BeanUtil.copyToList(list, TerminalChannelListModel.ChannelBean.class); List<DyLineTreeAndChannelListModel.DyListBean> channelBeans = BeanUtil.copyToList(list, DyLineTreeAndChannelListModel.DyListBean.class);
model.setList(channelBeans); model.setList(channelBeans);
} }
return null; return Asserts.success(model);
} }
} }

@ -3,14 +3,11 @@ package com.shxy.xymanager_service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions; import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.entity.TerminalPhoto; import com.shxy.xymanager_common.entity.TerminalPhoto;
import com.shxy.xymanager_common.exception.Asserts; import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.TerminalPhotoListModel; import com.shxy.xymanager_common.model.TerminalPhotoListModel;
import com.shxy.xymanager_common.page.PageUtils; import com.shxy.xymanager_common.vo.TerminalAndChannelIdAndTimeVo;
import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_common.vo.TerminalAndChannelIdVo;
import com.shxy.xymanager_dao.dao.TerminalPhotoDao; import com.shxy.xymanager_dao.dao.TerminalPhotoDao;
import com.shxy.xymanager_service.service.TerminalPhotoService; import com.shxy.xymanager_service.service.TerminalPhotoService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -37,7 +34,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
* @return * @return
*/ */
@Override @Override
public ServiceBody<TerminalPhotoListModel> getTerminalPhotoList(TerminalAndChannelIdVo vo) { public ServiceBody<TerminalPhotoListModel> getTerminalPhotoList(TerminalAndChannelIdAndTimeVo vo) {
TerminalPhotoListModel model = new TerminalPhotoListModel(); TerminalPhotoListModel model = new TerminalPhotoListModel();
List<TerminalPhoto> list = terminalPhotoDao.selectPhotoList(vo.getTerminalid(), vo.getChannelid(),vo.getTime()); List<TerminalPhoto> list = terminalPhotoDao.selectPhotoList(vo.getTerminalid(), vo.getChannelid(),vo.getTime());
boolean empty = CollectionUtil.isEmpty(list); boolean empty = CollectionUtil.isEmpty(list);

@ -3,6 +3,9 @@ package com.shxy.xymanager_service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions; import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.entity.TerminalScheduleMapper; import com.shxy.xymanager_common.entity.TerminalScheduleMapper;
@ -11,6 +14,7 @@ import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.exception.Asserts; import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.TerminalScheduleRuleListModel; import com.shxy.xymanager_common.model.TerminalScheduleRuleListModel;
import com.shxy.xymanager_common.model.TerminalScheduleRuleModel; import com.shxy.xymanager_common.model.TerminalScheduleRuleModel;
import com.shxy.xymanager_common.model.TerminalScheduleRuleTimeListModel;
import com.shxy.xymanager_common.page.PageUtils; import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.util.MyDateUtils; import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_common.vo.*; import com.shxy.xymanager_common.vo.*;
@ -22,7 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.validation.constraints.NotNull; import java.sql.Time;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -173,25 +177,26 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
*/ */
@Override @Override
@Transactional @Transactional
public ServiceBody<String> relateSchelduleRule(RelateTerminalRuleIdVo vo) { public ServiceBody<String> relateSchelduleRule(RelateTerminalListRuleIdVo vo) {
ArrayList<TerminalScheduleMapper> list = new ArrayList<>(); ArrayList<TerminalScheduleMapper> list = new ArrayList<>();
List<Integer> channelidlist = vo.getChannelidlist(); List<RelateTerminalListRuleIdVo.Item> termBeanList = vo.getList();
Integer ruleid = vo.getRuleid(); Integer ruleid = vo.getRuleid();
Integer termid = vo.getTermid();
List<TerminalScheduleMapper> mappers = terminalScheduleMapperDao.selectByChannelId(channelidlist, termid); List<TerminalScheduleMapper> mappers = terminalScheduleMapperDao.selectByTerminalBean(termBeanList);
boolean empty = CollectionUtil.isEmpty(mappers); boolean empty = CollectionUtil.isEmpty(mappers);
if (!empty) { if (!empty) {
terminalScheduleMapperDao.deleteByChannelId(channelidlist, termid); terminalScheduleMapperDao.deleteByChannelId(mappers);
} }
for (Integer item : channelidlist) { for (RelateTerminalListRuleIdVo.Item item : termBeanList) {
for (Integer id : item.getChannelidlist()) {
TerminalScheduleMapper record = new TerminalScheduleMapper(); TerminalScheduleMapper record = new TerminalScheduleMapper();
record.setChannelId(item); record.setChannelId(id);
record.setScheduleId(ruleid); record.setScheduleId(ruleid);
record.setTermId(termid); record.setTermId(item.getTermid());
list.add(record); list.add(record);
} }
}
Date date = new Date(); Date date = new Date();
int i = terminalScheduleMapperDao.insertList(list, date, date); int i = terminalScheduleMapperDao.insertList(list, date, date);
if (i != 0) { if (i != 0) {
@ -199,7 +204,34 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
} else { } else {
return Asserts.error("关联失败"); return Asserts.error("关联失败");
} }
}
/**
*
* @param vo
* @return
*/
@Override
public ServiceBody<TerminalScheduleRuleTimeListModel> getChannelSchelduleRule(TerminalAndChannelIdVo vo) {
TerminalScheduleRuleTimeListModel model = new TerminalScheduleRuleTimeListModel();
TerminalScheduleMapper mapper = terminalScheduleMapperDao.selectByChannelId(vo.getChannelid(), vo.getTerminalid());
if (mapper == null) {
model.setList(new ArrayList<>());
}else {
Integer scheduleId = mapper.getScheduleId();
TerminalScheduleRule bean = terminalScheduleRuleDao.selectByPrimaryKey(scheduleId);
Time startTime = bean.getStartTime();
Time endTime = bean.getEndTime();
Integer span = bean.getSpan();
List<DateTime> dateTimes = MyDateUtils.rangeToList(startTime, endTime, DateField.MINUTE, span);
ArrayList<String> timelist = new ArrayList<>();
for (DateTime item : dateTimes) {
String dateTime = DateUtil.formatTime(item);
timelist.add(dateTime);
}
model.setList(timelist);
}
return Asserts.success(model);
} }
} }

@ -1,11 +1,13 @@
package com.shxy.xymanager_service.service; package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.DyLineTreeAndChannelListModel;
import com.shxy.xymanager_common.model.TerminalChannelListModel; import com.shxy.xymanager_common.model.TerminalChannelListModel;
import com.shxy.xymanager_common.model.TerminalChannelTreeListModel; import com.shxy.xymanager_common.model.TerminalChannelMapperListModel;
import com.shxy.xymanager_common.model.TerminalListModel; import com.shxy.xymanager_common.vo.TerminalChannelIdListVo;
import com.shxy.xymanager_common.vo.TerminalChannelVo;
import com.shxy.xymanager_common.vo.TerminalIdVo; import com.shxy.xymanager_common.vo.TerminalIdVo;
import com.shxy.xymanager_common.vo.TerminalVo; import com.shxy.xymanager_common.vo.UpdateTerminalChannelVo;
/** /**
* *
@ -13,19 +15,47 @@ import com.shxy.xymanager_common.vo.TerminalVo;
* @author * @author
*/ */
public interface TerminalChannelService { public interface TerminalChannelService {
/** /**
* *
*
* @return
*/
ServiceBody<String> addChannelList(TerminalChannelVo vo);
/**
*
*
* @return
*/
ServiceBody<String> updateChannelList(UpdateTerminalChannelVo vo);
/**
*
* *
* @return * @return
*/ */
ServiceBody<TerminalChannelListModel> getChannelList(TerminalIdVo vo); ServiceBody<String> deleteChannelList(TerminalChannelIdListVo vo);
/** /**
*
* *
* @return
*/
ServiceBody<TerminalChannelListModel> getChannelList();
/**
*
*
* @return
*/
ServiceBody<TerminalChannelMapperListModel> getChannelByTermid(TerminalIdVo vo);
/**
* *
* *
* @return * @return
*/ */
ServiceBody<TerminalChannelTreeListModel> getChannelTreeList(); ServiceBody<DyLineTreeAndChannelListModel> getChannelTreeList(TerminalIdVo vo);
} }

@ -2,7 +2,7 @@ package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalPhotoListModel; import com.shxy.xymanager_common.model.TerminalPhotoListModel;
import com.shxy.xymanager_common.vo.TerminalAndChannelIdVo; import com.shxy.xymanager_common.vo.TerminalAndChannelIdAndTimeVo;
/** /**
* *
@ -15,6 +15,6 @@ public interface TerminalPhotoService {
* *
* @return * @return
*/ */
ServiceBody<TerminalPhotoListModel> getTerminalPhotoList(TerminalAndChannelIdVo vo); ServiceBody<TerminalPhotoListModel> getTerminalPhotoList(TerminalAndChannelIdAndTimeVo vo);
} }

@ -3,6 +3,7 @@ package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalScheduleRuleListModel; import com.shxy.xymanager_common.model.TerminalScheduleRuleListModel;
import com.shxy.xymanager_common.model.TerminalScheduleRuleModel; import com.shxy.xymanager_common.model.TerminalScheduleRuleModel;
import com.shxy.xymanager_common.model.TerminalScheduleRuleTimeListModel;
import com.shxy.xymanager_common.vo.*; import com.shxy.xymanager_common.vo.*;
/** /**
@ -55,5 +56,12 @@ public interface TerminalScheduleRuleService {
* @param vo * @param vo
* @return * @return
*/ */
ServiceBody<String> relateSchelduleRule(RelateTerminalRuleIdVo vo); ServiceBody<String> relateSchelduleRule(RelateTerminalListRuleIdVo vo);
/**
*
* @param vo
* @return
*/
ServiceBody<TerminalScheduleRuleTimeListModel> getChannelSchelduleRule(TerminalAndChannelIdVo vo);
} }

Loading…
Cancel
Save