欣影管理平台时间任务功能

jni
liuguijing 2 years ago
parent 6a7577b646
commit 0e12618250

@ -5,7 +5,10 @@ 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.TerminalChannelListModel;
import com.shxy.xymanager_common.model.TerminalListModel; import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalIdVo;
import com.shxy.xymanager_service.service.TerminalChannelService;
import com.shxy.xymanager_service.service.TerminalService; 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;
@ -13,6 +16,8 @@ import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; 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.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -23,14 +28,14 @@ import org.springframework.web.bind.annotation.RestController;
public class ChannelController extends BaseController { public class ChannelController extends BaseController {
@Autowired @Autowired
TerminalService terminalService; 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 = "查询") @Log(title = "获取通道列表", type = "查询")
public ResponseReult<TerminalListModel> getChannelList() { public ResponseReult<TerminalChannelListModel> getChannelList(@RequestBody @Validated TerminalIdVo vo) {
ServiceBody<TerminalListModel> serviceBody = terminalService.getTerminalList(); ServiceBody<TerminalChannelListModel> serviceBody = terminalChannelService.getChannelList(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.TerminalListModel; import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalIdVo; import com.shxy.xymanager_common.vo.TerminalIdListVo;
import com.shxy.xymanager_common.vo.TerminalVo; import com.shxy.xymanager_common.vo.TerminalVo;
import com.shxy.xymanager_common.vo.UpdateTerminalVo; import com.shxy.xymanager_common.vo.UpdateTerminalVo;
import com.shxy.xymanager_service.service.TerminalService; import com.shxy.xymanager_service.service.TerminalService;
@ -41,7 +41,6 @@ public class TerminalController 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("/addTerminal") @RequestMapping("/addTerminal")
@ -72,7 +71,7 @@ public class TerminalController 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("/deleteTerminal") @RequestMapping("/deleteTerminal")
@Log(title = "删除装置列表", type = "修改") @Log(title = "删除装置列表", type = "修改")
public ResponseReult<String> deleteTerminal(@RequestBody @Validated TerminalIdVo vo) { public ResponseReult<String> deleteTerminal(@RequestBody @Validated TerminalIdListVo vo) {
ServiceBody<String> serviceBody = terminalService.deleteTerminal(vo); ServiceBody<String> serviceBody = terminalService.deleteTerminal(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) { if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData()); return ResponseReult.success(serviceBody.getData());

@ -5,11 +5,9 @@ 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.TerminalListModel; import com.shxy.xymanager_common.model.TerminalPhotoListModel;
import com.shxy.xymanager_common.vo.TerminalIdVo; import com.shxy.xymanager_common.vo.TerminalAndChannelIdVo;
import com.shxy.xymanager_common.vo.TerminalVo; import com.shxy.xymanager_service.service.TerminalPhotoService;
import com.shxy.xymanager_common.vo.UpdateTerminalVo;
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;
@ -22,20 +20,20 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@Api(value = "设备接口", tags = "设备接口相关") @Api(value = "图片接口", tags = "图片接口相关")
@RestController @RestController
@Slf4j @Slf4j
public class TerminalPhotoController extends BaseController { public class TerminalPhotoController extends BaseController {
@Autowired @Autowired
TerminalService terminalService; TerminalPhotoService terminalPhotoService;
@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("/getTerminalList") @RequestMapping("/getTerminalPhotoList")
@Log(title = "获取设备列表", type = "查询") @Log(title = "获取设备列表", type = "查询")
public ResponseReult<TerminalListModel> getTerminalList() { public ResponseReult<TerminalPhotoListModel> getTerminalPhotoList(@RequestBody @Validated TerminalAndChannelIdVo vo) {
ServiceBody<TerminalListModel> serviceBody = terminalService.getTerminalList(); 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());
} else { } else {
@ -44,43 +42,4 @@ public class TerminalPhotoController extends BaseController {
} }
@ApiOperation(value = "添加设备", notes = "添加设备接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/addTerminal")
@Log(title = "新增设备列表", type = "新增")
public ResponseReult<String> addTerminal(@RequestBody @Validated TerminalVo vo) {
ServiceBody<String> serviceBody = terminalService.addTerminal(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("/updateTerminal")
@Log(title = "修改设备", type = "修改")
public ResponseReult<String> updateTerminal(@RequestBody @Validated UpdateTerminalVo vo) {
ServiceBody<String> serviceBody = terminalService.updateTerminal(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("/deleteTerminal")
@Log(title = "删除装置列表", type = "修改")
public ResponseReult<String> deleteTerminal(@RequestBody @Validated TerminalIdVo vo) {
ServiceBody<String> serviceBody = terminalService.deleteTerminal(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
} }

@ -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());
}
}
}

@ -1,8 +1,11 @@
package com.shxy.xymanager_common.entity; package com.shxy.xymanager_common.entity;
import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
@Data
public class TerminalPhoto implements Serializable { public class TerminalPhoto implements Serializable {
private Long id; private Long id;
@ -26,103 +29,8 @@ public class TerminalPhoto implements Serializable {
private Byte manualRequest; private Byte manualRequest;
private Integer createTime; private Date createTime;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getTermId() {
return termId;
}
public void setTermId(Integer termId) {
this.termId = termId;
}
public Integer getChannelId() {
return channelId;
}
public void setChannelId(Integer channelId) {
this.channelId = channelId;
}
public Byte getPresetId() {
return presetId;
}
public void setPresetId(Byte presetId) {
this.presetId = presetId;
}
public Integer getWidth() {
return width;
}
public void setWidth(Integer width) {
this.width = width;
}
public Integer getHeight() {
return height;
}
public void setHeight(Integer height) {
this.height = height;
}
public Integer getFileSize() {
return fileSize;
}
public void setFileSize(Integer fileSize) {
this.fileSize = fileSize;
}
public Date getPhotoTime() {
return photoTime;
}
public void setPhotoTime(Date photoTime) {
this.photoTime = photoTime;
}
public Date getRecvTime() {
return recvTime;
}
public void setRecvTime(Date recvTime) {
this.recvTime = recvTime;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path == null ? null : path.trim();
}
public Byte getManualRequest() {
return manualRequest;
}
public void setManualRequest(Byte manualRequest) {
this.manualRequest = manualRequest;
}
public Integer getCreateTime() {
return createTime;
}
public void setCreateTime(Integer createTime) {
this.createTime = createTime;
}
} }

@ -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;
}
}

@ -5,18 +5,14 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List; import java.util.List;
@Data @Data
@ApiModel(value = "装置编号数组", description = "装置编号数组描述") @ApiModel(value = "装置编号对象", description = "装置编号对象描述")
public class TerminalIdVo { public class TerminalIdVo {
@NotEmpty(message = "不能传入空值")
@ApiModelProperty(value = "装置对象数组", required = true, example = "A0001")
private List<Item> list;
@Data @NotNull(message = "装置编号不能缺少")
private static class Item {
@ApiModelProperty(value = "装置编号", example = "123455") @ApiModelProperty(value = "装置编号", example = "123455")
private Integer id; private Integer cmdid;
}
} }

@ -2,6 +2,8 @@ package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.entity.TerminalChannels; import com.shxy.xymanager_common.entity.TerminalChannels;
import java.util.List;
public interface TerminalChannelsDao { public interface TerminalChannelsDao {
int deleteByPrimaryKey(Integer id); int deleteByPrimaryKey(Integer id);
@ -9,7 +11,7 @@ public interface TerminalChannelsDao {
int insertSelective(TerminalChannels record); int insertSelective(TerminalChannels record);
TerminalChannels selectByPrimaryKey(Integer id); List<TerminalChannels> selectByTermid(Integer termid);
int updateByPrimaryKeySelective(TerminalChannels record); int updateByPrimaryKeySelective(TerminalChannels record);

@ -1,8 +1,14 @@
package com.shxy.xymanager_dao.dao; package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.entity.TerminalPhoto; import com.shxy.xymanager_common.entity.TerminalPhoto;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface TerminalPhotoDao { public interface TerminalPhotoDao {
List<TerminalPhoto> selectPhotoList(@Param("terminalid") Integer terminalid, @Param("channelid") Integer channelid);
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(Long id);
int insert(TerminalPhoto record); int insert(TerminalPhoto record);

@ -103,14 +103,30 @@
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;--> <!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>--> <!-- </table>-->
<table tableName="lines" <!-- <table tableName="lines"-->
domainObjectName="Lines" <!-- domainObjectName="Lines"-->
mapperName="LinesDao" <!-- mapperName="LinesDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<table tableName="terminal_schedulemapper"
domainObjectName="TerminalScheduleMapper"
mapperName="TerminalScheduleMapperDao"
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"/>-->
</table> </table>
<table tableName="terminal_schedulerule"
domainObjectName="TerminalScheduleRule"
mapperName="TerminalScheduleRuleDao"
enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false">
<!-- <property name="useActualColumnNames" value="false"/>-->
</table>
</context> </context>
</generatorConfiguration> </generatorConfiguration>

@ -91,7 +91,7 @@
update_time = #{updateat,jdbcType=TIMESTAMP}, update_time = #{updateat,jdbcType=TIMESTAMP},
</if> </if>
</set> </set>
where id = #{id,jdbcType=INTEGER} where id = #{data.id}
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.Lines"> <update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.Lines">

@ -2,22 +2,29 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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.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="term_id" jdbcType="INTEGER" property="termId"/>
<result column="channel_no" jdbcType="TINYINT" property="channelNo" /> <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"/>
</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, term_id, channel_no, channel_name, max_resolution_width, max_resolution_height
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" 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 id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</select> </select>
<select id="selectByTermid" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_channels
where term_id = #{termid}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from terminal_channels delete from terminal_channels
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}

@ -2,26 +2,33 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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.TerminalPhotoDao"> <mapper namespace="com.shxy.xymanager_dao.dao.TerminalPhotoDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalPhoto"> <resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalPhoto">
<id column="id" jdbcType="BIGINT" property="id" /> <id column="id" jdbcType="BIGINT" property="id"/>
<result column="term_id" jdbcType="INTEGER" property="termId" /> <result column="term_id" jdbcType="INTEGER" property="termId"/>
<result column="channel_id" jdbcType="INTEGER" property="channelId" /> <result column="channel_id" jdbcType="INTEGER" property="channelId"/>
<result column="preset_id" jdbcType="TINYINT" property="presetId" /> <result column="preset_id" jdbcType="TINYINT" property="presetId"/>
<result column="width" jdbcType="INTEGER" property="width" /> <result column="width" jdbcType="INTEGER" property="width"/>
<result column="height" jdbcType="INTEGER" property="height" /> <result column="height" jdbcType="INTEGER" property="height"/>
<result column="file_size" jdbcType="INTEGER" property="fileSize" /> <result column="file_size" jdbcType="INTEGER" property="fileSize"/>
<result column="photo_time" jdbcType="TIMESTAMP" property="photoTime" /> <result column="photo_time" jdbcType="TIMESTAMP" property="photoTime"/>
<result column="recv_time" jdbcType="TIMESTAMP" property="recvTime" /> <result column="recv_time" jdbcType="TIMESTAMP" property="recvTime"/>
<result column="path" jdbcType="VARCHAR" property="path" /> <result column="path" jdbcType="VARCHAR" property="path"/>
<result column="manual_request" jdbcType="TINYINT" property="manualRequest" /> <result column="manual_request" jdbcType="TINYINT" property="manualRequest"/>
<result column="create_time" jdbcType="INTEGER" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, term_id, channel_id, preset_id, width, height, file_size, photo_time, recv_time, id, term_id, channel_id, preset_id, width, height, file_size, photo_time, recv_time,
path, manual_request, create_time path, manual_request, create_time
</sql> </sql>
<select id="selectPhotoList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_photos
where term_id = #{terminalid} and channel_id = #{channelid}
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from terminal_photos from terminal_photos
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</select> </select>

@ -119,13 +119,12 @@ public class LineServiceImpl implements LineService {
*/ */
@Override @Override
public ServiceBody<String> updateLine(UpdateLineVo vo) { public ServiceBody<String> updateLine(UpdateLineVo vo) {
Lines lines = new Lines(); Lines lines = BeanUtil.copyProperties(vo, Lines.class);
BeanUtil.copyProperties(vo, Lines.class);
int i = linesDao.updateByPrimaryKeySelective(lines,new Date()); int i = linesDao.updateByPrimaryKeySelective(lines,new Date());
if (i != 0) { if (i != 0) {
return Asserts.success("删除成功"); return Asserts.success("修改成功");
} else { } else {
return Asserts.error("删除失败"); return Asserts.error("修改失败");
} }
} }

@ -1,28 +1,48 @@
package com.shxy.xymanager_service.impl; 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.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalListModel; import com.shxy.xymanager_common.entity.TerminalChannels;
import com.shxy.xymanager_common.vo.TerminalVo; 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 com.shxy.xymanager_service.service.TerminalChannelService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/** /**
* *
* *
*/ */
@Service @Service
@Slf4j @Slf4j
public class TerminalChannelServiceImpl implements TerminalChannelService { public class TerminalChannelServiceImpl implements TerminalChannelService {
@Autowired
TerminalChannelsDao terminalChannelsDao;
/**
*
* @param vo
* @return
*/
@Override @Override
public ServiceBody<TerminalListModel> getChannelTreeList() { public ServiceBody<TerminalChannelListModel> getChannelList(TerminalIdVo vo) {
return null; 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);
@Override
public ServiceBody<String> addTerminal(TerminalVo terminalVo) {
return null;
} }
} }

@ -4,6 +4,7 @@ import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalListModel; import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalVo; import com.shxy.xymanager_common.vo.TerminalVo;
import com.shxy.xymanager_service.service.TerminalChannelService; import com.shxy.xymanager_service.service.TerminalChannelService;
import com.shxy.xymanager_service.service.TerminalParamsService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -13,11 +14,11 @@ import org.springframework.stereotype.Service;
*/ */
@Service @Service
@Slf4j @Slf4j
public class TerminalParamsServiceImpl implements TerminalChannelService { public class TerminalParamsServiceImpl implements TerminalParamsService {
@Override @Override
public ServiceBody<TerminalListModel> getChannelTreeList() { public ServiceBody<TerminalListModel> getTerminalList() {
return null; return null;
} }

@ -1,30 +1,65 @@
package com.shxy.xymanager_service.impl; 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.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalListModel; import com.shxy.xymanager_common.entity.TerminalPhoto;
import com.shxy.xymanager_common.vo.TerminalVo; import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_service.service.TerminalChannelService; 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 com.shxy.xymanager_service.service.TerminalPhotoService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/** /**
* *
*
*/ */
@Service @Service
@Slf4j @Slf4j
public class TerminalPhotoServiceImpl implements TerminalPhotoService { public class TerminalPhotoServiceImpl implements TerminalPhotoService {
@Autowired
TerminalPhotoDao terminalPhotoDao;
/**
* idid
*
* @param vo
* @return
*/
@Override @Override
public ServiceBody<TerminalListModel> getTerminalList() { public ServiceBody<TerminalPhotoListModel> getTerminalPhotoList(TerminalAndChannelIdVo vo) {
return null; 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 int pageSize = pageData.getPageSize();
public ServiceBody<String> addTerminal(TerminalVo terminalVo) { model.setPagesize(pageSize);
return null; 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;
}
}

@ -8,7 +8,7 @@ import com.shxy.xymanager_common.entity.Terminals;
import com.shxy.xymanager_common.enums.CommonStatus; 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.TerminalListModel; import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalIdVo; import com.shxy.xymanager_common.vo.TerminalIdListVo;
import com.shxy.xymanager_common.vo.TerminalVo; import com.shxy.xymanager_common.vo.TerminalVo;
import com.shxy.xymanager_common.vo.UpdateTerminalVo; import com.shxy.xymanager_common.vo.UpdateTerminalVo;
import com.shxy.xymanager_dao.dao.TerminalsDao; import com.shxy.xymanager_dao.dao.TerminalsDao;
@ -95,7 +95,7 @@ public class TerminalServiceImpl implements TerminalService {
* @return * @return
*/ */
@Override @Override
public ServiceBody<String> deleteTerminal(TerminalIdVo vo) { public ServiceBody<String> deleteTerminal(TerminalIdListVo vo) {
List<Terminals> list = BeanUtil.copyToList(vo.getList(), Terminals.class); List<Terminals> list = BeanUtil.copyToList(vo.getList(), Terminals.class);
int i = terminalsDao.deleteById(list,CommonStatus.DELETE.value(),new Date()); int i = terminalsDao.deleteById(list,CommonStatus.DELETE.value(),new Date());
if (i != 0) { if (i != 0) {

@ -4,13 +4,11 @@ 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.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.entity.Lines;
import com.shxy.xymanager_common.entity.Terminals; import com.shxy.xymanager_common.entity.Terminals;
import com.shxy.xymanager_common.enums.CommonStatus; 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.TerminalListModel; import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.LineIdVo; import com.shxy.xymanager_common.vo.TerminalIdListVo;
import com.shxy.xymanager_common.vo.TerminalIdVo;
import com.shxy.xymanager_common.vo.TerminalVo; import com.shxy.xymanager_common.vo.TerminalVo;
import com.shxy.xymanager_dao.dao.TerminalsDao; import com.shxy.xymanager_dao.dao.TerminalsDao;
import com.shxy.xymanager_service.service.TerminalStatusService; import com.shxy.xymanager_service.service.TerminalStatusService;
@ -79,7 +77,7 @@ public class TerminalStatusServiceImpl implements TerminalStatusService {
* @return * @return
*/ */
@Override @Override
public ServiceBody<String> deleteLine(TerminalIdVo vo) { public ServiceBody<String> deleteLine(TerminalIdListVo vo) {
List<Terminals> list = BeanUtil.copyToList(vo.getList(), Terminals.class); List<Terminals> list = BeanUtil.copyToList(vo.getList(), Terminals.class);
int i = terminalsDao.deleteById(list,CommonStatus.DELETE.value(),new Date()); int i = terminalsDao.deleteById(list,CommonStatus.DELETE.value(),new Date());
if (i != 0) { if (i != 0) {

@ -1,27 +1,22 @@
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.TerminalChannelListModel;
import com.shxy.xymanager_common.model.TerminalListModel; import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalIdVo;
import com.shxy.xymanager_common.vo.TerminalVo; import com.shxy.xymanager_common.vo.TerminalVo;
/** /**
* 线 *
* *
* @author * @author
*/ */
public interface TerminalChannelService { public interface TerminalChannelService {
/** /**
* 线 *
* *
* @return * @return
*/ */
ServiceBody<TerminalListModel> getChannelTreeList(); ServiceBody<TerminalChannelListModel> getChannelList(TerminalIdVo vo);
/**
*
*
* @return
*/
ServiceBody<String> addTerminal(TerminalVo terminalVo);
} }

@ -1,27 +1,20 @@
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.TerminalListModel; import com.shxy.xymanager_common.model.TerminalPhotoListModel;
import com.shxy.xymanager_common.vo.TerminalVo; import com.shxy.xymanager_common.vo.TerminalAndChannelIdVo;
/** /**
* *
* *
* @author * @author
*/ */
public interface TerminalPhotoService { public interface TerminalPhotoService {
/** /**
* * id
* *
* @return * @return
*/ */
ServiceBody<TerminalListModel> getTerminalList(); ServiceBody<TerminalPhotoListModel> getTerminalPhotoList(TerminalAndChannelIdVo vo);
/**
*
*
* @return
*/
ServiceBody<String> addTerminal(TerminalVo terminalVo);
} }

@ -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);
}

@ -5,7 +5,7 @@ import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalVo; import com.shxy.xymanager_common.vo.TerminalVo;
/** /**
* *
* *
* @author * @author
*/ */
@ -15,7 +15,7 @@ public interface TerminalScheduleService {
* *
* @return * @return
*/ */
ServiceBody<TerminalListModel> getTerminalList(); ServiceBody<TerminalListModel> getScheduleList();
/** /**
* *

@ -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.TerminalListModel; import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalIdVo; import com.shxy.xymanager_common.vo.TerminalIdListVo;
import com.shxy.xymanager_common.vo.TerminalVo; import com.shxy.xymanager_common.vo.TerminalVo;
import com.shxy.xymanager_common.vo.UpdateTerminalVo; import com.shxy.xymanager_common.vo.UpdateTerminalVo;
@ -40,6 +40,6 @@ public interface TerminalService {
* @param vo * @param vo
* @return * @return
*/ */
ServiceBody<String> deleteTerminal(TerminalIdVo vo); ServiceBody<String> deleteTerminal(TerminalIdListVo vo);
} }

@ -2,8 +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.TerminalListModel; import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.LineIdVo; import com.shxy.xymanager_common.vo.TerminalIdListVo;
import com.shxy.xymanager_common.vo.TerminalIdVo;
import com.shxy.xymanager_common.vo.TerminalVo; import com.shxy.xymanager_common.vo.TerminalVo;
/** /**
@ -31,5 +30,5 @@ public interface TerminalStatusService {
* @param vo * @param vo
* @return * @return
*/ */
ServiceBody<String> deleteLine(TerminalIdVo vo); ServiceBody<String> deleteLine(TerminalIdListVo vo);
} }

Loading…
Cancel
Save