欣影管理平台时间任务功能
parent
6a7577b646
commit
0e12618250
@ -0,0 +1,51 @@
|
||||
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_common.model.TerminalListModel;
|
||||
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_service.service.TerminalScheduleRuleService;
|
||||
import com.shxy.xymanager_service.service.TerminalScheduleService;
|
||||
import com.shxy.xymanager_service.service.TerminalService;
|
||||
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.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
||||
@Api(value = "任务规则接口", tags = "任务规则接口相关")
|
||||
@RestController
|
||||
@Slf4j
|
||||
public class TerminalScheduleRuleController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
TerminalScheduleRuleService terminalScheduleRuleService;
|
||||
|
||||
@ApiOperation(value = "获取任务规则列表", notes = "获取任务规则列表接口", httpMethod = "POST")
|
||||
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
|
||||
@RequestMapping("/getScheduleRulelList")
|
||||
@Log(title = "获取任务规则列表", type = "查询")
|
||||
public ResponseReult<TerminalListModel> getSchedulelRuleList() {
|
||||
ServiceBody<TerminalListModel> serviceBody = terminalScheduleRuleService.getScheduleRuleList();
|
||||
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
|
||||
return ResponseReult.success(serviceBody.getData());
|
||||
} else {
|
||||
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -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 TerminalChannelListModel implements Serializable {
|
||||
|
||||
@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,67 @@
|
||||
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 TerminalPhotoListModel implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "总记录数", example = "120")
|
||||
private long total;
|
||||
@ApiModelProperty(value = "总页数", example = "120")
|
||||
private int totalpage;
|
||||
@ApiModelProperty(value = "当前页", example = "1")
|
||||
private int currentpage;
|
||||
@ApiModelProperty(value = "每页记录数", example = "1")
|
||||
private int pagesize;
|
||||
|
||||
@ApiModelProperty(value = "通道列表对象", example = "[]")
|
||||
private List<ChannelBean> list;
|
||||
|
||||
@Data
|
||||
public static class ChannelBean {
|
||||
|
||||
@ApiModelProperty(value = "通道id", example = "12321")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "装置编号", example = "123456")
|
||||
private Integer termId;
|
||||
|
||||
@ApiModelProperty(value = "通道编号", example = "123456")
|
||||
private Integer channelId;
|
||||
|
||||
@ApiModelProperty(value = "预置位编号", example = "123456")
|
||||
private Byte presetId;
|
||||
|
||||
@ApiModelProperty(value = "宽度", example = "123456")
|
||||
private Integer width;
|
||||
|
||||
@ApiModelProperty(value = "高度", example = "123456")
|
||||
private Integer height;
|
||||
|
||||
@ApiModelProperty(value = "大小", example = "123456")
|
||||
private Integer fileSize;
|
||||
|
||||
@ApiModelProperty(value = "拍照时间", example = "123456")
|
||||
private Date photoTime;
|
||||
|
||||
@ApiModelProperty(value = "接收时间", example = "123456")
|
||||
private Date recvTime;
|
||||
|
||||
@ApiModelProperty(value = "照片路径", example = "123456")
|
||||
private String path;
|
||||
|
||||
@ApiModelProperty(value = "拍照方式", example = "123456")
|
||||
private Byte manualRequest;
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
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;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "装置编号", description = "装置编号描述")
|
||||
public class TerminalAndChannelIdVo {
|
||||
|
||||
@NotNull(message = "装置编号不能缺少")
|
||||
@ApiModelProperty(value = "装置编号", example = "123455")
|
||||
private Integer terminalid;
|
||||
|
||||
@NotNull(message = "通道编号不能缺少")
|
||||
@ApiModelProperty(value = "通道编号", example = "123455")
|
||||
private Integer channelid;
|
||||
|
||||
@Min(value = 1, message = "分页位置最小从1开始")
|
||||
@ApiModelProperty(value = "分页位置从1开始", required = true, example = "1")
|
||||
private int pageindex;
|
||||
|
||||
@Min(value = 1, message = "分页大小最小为1")
|
||||
@ApiModelProperty(value = "分页大小", required = true, example = "1")
|
||||
private int pagesize;
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
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 TerminalIdListVo {
|
||||
@NotEmpty(message = "不能传入空值")
|
||||
@ApiModelProperty(value = "装置对象数组", required = true, example = "A0001")
|
||||
private List<Item> list;
|
||||
|
||||
@Data
|
||||
private static class Item {
|
||||
@ApiModelProperty(value = "装置编号", example = "123455")
|
||||
private Integer id;
|
||||
}
|
||||
}
|
@ -1,28 +1,48 @@
|
||||
package com.shxy.xymanager_service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
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_common.entity.TerminalChannels;
|
||||
import com.shxy.xymanager_common.exception.Asserts;
|
||||
import com.shxy.xymanager_common.model.TerminalChannelListModel;
|
||||
import com.shxy.xymanager_common.vo.TerminalIdVo;
|
||||
import com.shxy.xymanager_dao.dao.TerminalChannelsDao;
|
||||
import com.shxy.xymanager_service.service.TerminalChannelService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 杆塔信息实现层
|
||||
* 装置通道实现层
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class TerminalChannelServiceImpl implements TerminalChannelService {
|
||||
|
||||
@Autowired
|
||||
TerminalChannelsDao terminalChannelsDao;
|
||||
|
||||
/**
|
||||
* 装置通道获取
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServiceBody<TerminalListModel> getChannelTreeList() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServiceBody<String> addTerminal(TerminalVo terminalVo) {
|
||||
return null;
|
||||
public ServiceBody<TerminalChannelListModel> getChannelList(TerminalIdVo vo) {
|
||||
TerminalChannelListModel model = new TerminalChannelListModel();
|
||||
List<TerminalChannels> list = terminalChannelsDao.selectByTermid(vo.getCmdid());
|
||||
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 Asserts.success(model);
|
||||
}
|
||||
}
|
||||
|
@ -1,30 +1,65 @@
|
||||
package com.shxy.xymanager_service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
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.model.TerminalListModel;
|
||||
import com.shxy.xymanager_common.vo.TerminalVo;
|
||||
import com.shxy.xymanager_service.service.TerminalChannelService;
|
||||
import com.shxy.xymanager_common.entity.TerminalPhoto;
|
||||
import com.shxy.xymanager_common.exception.Asserts;
|
||||
import com.shxy.xymanager_common.model.TerminalPhotoListModel;
|
||||
import com.shxy.xymanager_common.page.PageUtils;
|
||||
import com.shxy.xymanager_common.vo.TerminalAndChannelIdVo;
|
||||
import com.shxy.xymanager_dao.dao.TerminalPhotoDao;
|
||||
import com.shxy.xymanager_service.service.TerminalPhotoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 杆塔信息实现层
|
||||
*
|
||||
* 装置图片实现层
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class TerminalPhotoServiceImpl implements TerminalPhotoService {
|
||||
|
||||
@Autowired
|
||||
TerminalPhotoDao terminalPhotoDao;
|
||||
|
||||
|
||||
/**
|
||||
* 根据装置id和通道id获取图片
|
||||
*
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServiceBody<TerminalListModel> getTerminalList() {
|
||||
return null;
|
||||
}
|
||||
public ServiceBody<TerminalPhotoListModel> getTerminalPhotoList(TerminalAndChannelIdVo vo) {
|
||||
TerminalPhotoListModel model = new TerminalPhotoListModel();
|
||||
int pageindex = vo.getPageindex();
|
||||
int pagesize = vo.getPagesize();
|
||||
PageUtils.SetPage(pageindex, pagesize);
|
||||
List<TerminalPhoto> list = terminalPhotoDao.selectPhotoList(vo.getTerminalid(), vo.getChannelid());
|
||||
boolean empty = CollectionUtil.isEmpty(list);
|
||||
if (empty) {
|
||||
model.setList(new ArrayList<>());
|
||||
} else {
|
||||
List<TerminalPhotoListModel.ChannelBean> beans = BeanUtil.copyToList(list, TerminalPhotoListModel.ChannelBean.class, CopyOptions.create().ignoreCase());
|
||||
model.setList(beans);
|
||||
}
|
||||
PageInfo pageData = PageUtils.getPageData(list);
|
||||
int currentpage = pageData.getPageNum();
|
||||
model.setCurrentpage(currentpage);
|
||||
long total = pageData.getTotal();
|
||||
model.setTotal(total);
|
||||
|
||||
@Override
|
||||
public ServiceBody<String> addTerminal(TerminalVo terminalVo) {
|
||||
return null;
|
||||
int pageSize = pageData.getPageSize();
|
||||
model.setPagesize(pageSize);
|
||||
int pages = pageData.getPages();
|
||||
model.setTotalpage(pages);
|
||||
return Asserts.success(model);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,31 @@
|
||||
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.TerminalScheduleRuleService;
|
||||
import com.shxy.xymanager_service.service.TerminalScheduleService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 时间任务实现层
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleService {
|
||||
|
||||
/**
|
||||
* 时间
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServiceBody<TerminalListModel> getScheduleRuleList() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServiceBody<String> addSchelduleRule(TerminalVo terminalVo) {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -1,27 +1,22 @@
|
||||
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.TerminalListModel;
|
||||
import com.shxy.xymanager_common.vo.TerminalIdVo;
|
||||
import com.shxy.xymanager_common.vo.TerminalVo;
|
||||
|
||||
/**
|
||||
* 杆塔线路接口
|
||||
* 通道接口
|
||||
*
|
||||
* @author 晶晶
|
||||
*/
|
||||
public interface TerminalChannelService {
|
||||
/**
|
||||
* 获取杆塔线路树状数据
|
||||
* 获取通道数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ServiceBody<TerminalListModel> getChannelTreeList();
|
||||
|
||||
/**
|
||||
* 添加设备信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ServiceBody<String> addTerminal(TerminalVo terminalVo);
|
||||
ServiceBody<TerminalChannelListModel> getChannelList(TerminalIdVo vo);
|
||||
|
||||
}
|
||||
|
@ -1,27 +1,20 @@
|
||||
package com.shxy.xymanager_service.service;
|
||||
|
||||
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_common.model.TerminalPhotoListModel;
|
||||
import com.shxy.xymanager_common.vo.TerminalAndChannelIdVo;
|
||||
|
||||
/**
|
||||
* 设备接口
|
||||
* 装置图片接口
|
||||
*
|
||||
* @author 晶晶
|
||||
*/
|
||||
public interface TerminalPhotoService {
|
||||
/**
|
||||
* 获取所有设备接口
|
||||
* 根据通道和装置id获取图片接口
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ServiceBody<TerminalListModel> getTerminalList();
|
||||
|
||||
/**
|
||||
* 添加设备信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ServiceBody<String> addTerminal(TerminalVo terminalVo);
|
||||
ServiceBody<TerminalPhotoListModel> getTerminalPhotoList(TerminalAndChannelIdVo vo);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,27 @@
|
||||
package com.shxy.xymanager_service.service;
|
||||
|
||||
import com.shxy.xymanager_common.bean.ServiceBody;
|
||||
import com.shxy.xymanager_common.model.TerminalListModel;
|
||||
import com.shxy.xymanager_common.vo.TerminalVo;
|
||||
|
||||
/**
|
||||
* 任务规则接口
|
||||
*
|
||||
* @author 晶晶
|
||||
*/
|
||||
public interface TerminalScheduleRuleService {
|
||||
/**
|
||||
* 获取所有任务规则接口
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ServiceBody<TerminalListModel> getScheduleRuleList();
|
||||
|
||||
/**
|
||||
* 添加任务规则接口
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ServiceBody<String> addSchelduleRule(TerminalVo terminalVo);
|
||||
|
||||
}
|
Loading…
Reference in New Issue