Merge remote-tracking branch 'origin/master' into dev

master
18616268358 2 years ago
commit 12c919ee67

@ -95,4 +95,17 @@ public class LineController extends BaseController {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg()); 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("/getLineAndGtList")
@Log(title = "线路和杆塔列表查询", type = "查询")
public ResponseReult<LineAndGtAndChannelListModel> getLineAndGtList(@RequestBody @Validated LineAndGtVo vo) {
ServiceBody<LineAndGtAndChannelListModel> serviceBody = lineService.getLineAndGtList(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
} }

@ -0,0 +1,76 @@
package com.shxy.xymanager_admin.controller;
import cn.hutool.json.JSONObject;
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.*;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_service.service.OpenService;
import com.shxy.xymanager_service.service.TerminalPhotoService;
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 OpenController extends BaseController {
@Autowired
TerminalPhotoService terminalPhotoService;
@Autowired
OpenService openService;
@ApiOperation(value = "对外图片查询", notes = "对外图片查询", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getPhotoListForOpen")
@Log(title = "对外图片查询", type = "查询")
public ResponseReult<TerminalPhotoListForOpenModel> getPhotoListForOpen(@RequestBody @Validated OpenTerminalAndTimeVo vo) {
ServiceBody<TerminalPhotoListForOpenModel> serviceBody = terminalPhotoService.getPhotoListForOpen(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 = 0, message = "请求成功"), @ApiResponse(code = 1, message = "用户名错误"), @ApiResponse(code = 2, message = "密码错误")})
@RequestMapping("/cmaUserLogin")
@Log(title = "第三方登录认证接口", type = "查询")
public JSONObject cmaUserLogin(@RequestBody @Validated UserLoginVo vo) {
JSONObject serviceBody = openService.cmaUserLogin(vo);
return serviceBody;
}
@ApiOperation(value = "远程拍照(短视频)控制", notes = "远程拍照(短视频)控制接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/ctrlCmaDeviceCapture")
@Log(title = "远程拍照(短视频)控制", type = "查询")
public JSONObject ctrlCmaDeviceCapture(@RequestBody @Validated OpenDeviceCaptureVo vo) {
JSONObject serviceBody = openService.ctrlCmaDeviceCapture(vo);
return serviceBody;
}
@ApiOperation(value = "查询装置状态", notes = "查询装置状态接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 0, message = "请求成功"), @ApiResponse(code = 1, message = "用户名错误"), @ApiResponse(code = 2, message = "密码错误")})
@RequestMapping("/cmaDeviceStatus")
@Log(title = "查询装置状态接口", type = "查询")
public JSONObject cmaDeviceStatus(@RequestBody @Validated OpenCmdidVo vo) {
JSONObject serviceBody = openService.cmaDeviceStatus(vo);
return serviceBody;
}
}

@ -5,7 +5,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.bean.SysUser; import com.shxy.xymanager_common.bean.SysUser;
import com.shxy.xymanager_common.entity.UserSession; import com.shxy.xymanager_common.entity.SysUserSession;
import com.shxy.xymanager_common.model.SysUserModel; import com.shxy.xymanager_common.model.SysUserModel;
import com.shxy.xymanager_common.vo.PageVo; import com.shxy.xymanager_common.vo.PageVo;
import com.shxy.xymanager_common.vo.SysUserUpdateVo; import com.shxy.xymanager_common.vo.SysUserUpdateVo;
@ -41,8 +41,8 @@ public class SysLoginController {
@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("/login") @RequestMapping("/login")
public ResponseReult<UserSession> login(@RequestBody SysUser sysUser) { public ResponseReult<SysUserSession> login(@RequestBody SysUser sysUser) {
ServiceBody<UserSession> serviceBody = loginService.remoteLogin(sysUser); ServiceBody<SysUserSession> serviceBody = loginService.remoteLogin(sysUser);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) { if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData()); return ResponseReult.success(serviceBody.getData());
} else { } else {
@ -56,7 +56,6 @@ public class SysLoginController {
* @param vo * @param vo
* @return * @return
*/ */
@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("/updateUser") @RequestMapping("/updateUser")

@ -195,6 +195,4 @@ public class TerminalController extends BaseController {
} }
} }
} }

@ -112,19 +112,6 @@ public class TerminalPhotoController extends BaseController {
} }
} }
@ApiOperation(value = "对外图片查询", notes = "对外图片查询", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getPhotoListForOpen")
@Log(title = "对外图片查询", type = "查询")
public ResponseReult<TerminalPhotoListForOpenModel> getPhotoListForOpen(@RequestBody @Validated TerminalAndTimeForOpenVo vo) {
ServiceBody<TerminalPhotoListForOpenModel> serviceBody = terminalPhotoService.getPhotoListForOpen(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
@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("/getReturnedPhoto") @RequestMapping("/getReturnedPhoto")

@ -1 +1 @@
org.springframework.boot.env.EnvironmentPostProcessor=com.shxy.xymanager_framework.config.MyEnvironmentPostProcessor #org.springframework.boot.env.EnvironmentPostProcessor=com.shxy.xymanager_framework.config.MyEnvironmentPostProcessor

@ -183,6 +183,7 @@ video:
address: http://47.96.238.157/videos/ address: http://47.96.238.157/videos/
session: session:
expire_time: 3600 expire_time: 3600
open_expire_time: 1800
rsa: rsa:
public_key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCViq0L+1XCTKOkt9nmy9aQbMRNNJNBOtPYRlCq/bRuwlYaq/I+XqSDkIF8s4JJSy3/Vgjw0fp8d4O+5KBS4Om9Ela60I2Vv/q8LjCNFNYbRE6xI7yrlyPukodmC/s1VgODDRHn3vVyKcK9nyF7xZsXixnlvltAky888CJkLpiGjQIDAQAB public_key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCViq0L+1XCTKOkt9nmy9aQbMRNNJNBOtPYRlCq/bRuwlYaq/I+XqSDkIF8s4JJSy3/Vgjw0fp8d4O+5KBS4Om9Ela60I2Vv/q8LjCNFNYbRE6xI7yrlyPukodmC/s1VgODDRHn3vVyKcK9nyF7xZsXixnlvltAky888CJkLpiGjQIDAQAB
private_key: MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAJWKrQv7VcJMo6S32ebL1pBsxE00k0E609hGUKr9tG7CVhqr8j5epIOQgXyzgklLLf9WCPDR+nx3g77koFLg6b0SVrrQjZW/+rwuMI0U1htETrEjvKuXI+6Sh2YL+zVWA4MNEefe9XIpwr2fIXvFmxeLGeW+W0CTLzzwImQumIaNAgMBAAECgYAzOn2LlD9Nv5lzzTPNl9jaQxiAZllnyDJYbcYmvaD5LIP4wRzMdvmexHtHb+tbFnEcfqmzbguEZiDw3Tt7COepQWvNzlM+/HbFtkXzSh6WEu2TgjZwudcCDHDyjDzUNgcWnBIw8/+Sy4COOm4p+UnprYK4sdriMZyz8K5UC8CxFQJBAODTt0lg/HiZKaOX7PMmsiRisd5oAslyDHCt66oPG29KTE1j4fwKDzGJlrOo1f4Q078IDYMO1I/Y3uP8Es3FT1MCQQCqRrD+lO3YCZOUGTHm2WGmbljIoeDpnIn2TZFyqDGKXs6EAx7SXkgarY2OC5O2aifMhXElPUGChfSgPmRUFHafAkEAxFtkWuwf1NxAJ6cKxZpoP6sLGenRdUrsXoUnrBEhruM/HOA9gLjwaB14x1SQASOFK/TGiE4ti6ynjoqbiafoDQJBAI0l6FZAsiBhX9pmQD1yeUXzNtmphr1gK+TmS+lVjyt6h4pa49PSn8atkyfqZNnTiYY6H56U9pbx3+Rtk9E23VUCQEZ9/JHUaGc77s3ibpcKFVemlb0i/Uvj2V45aoNfY34iex4biAUsRq/FJNiqBk+xQWkJ4QY8nKVE45GlaCfZ8/c= private_key: MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAJWKrQv7VcJMo6S32ebL1pBsxE00k0E609hGUKr9tG7CVhqr8j5epIOQgXyzgklLLf9WCPDR+nx3g77koFLg6b0SVrrQjZW/+rwuMI0U1htETrEjvKuXI+6Sh2YL+zVWA4MNEefe9XIpwr2fIXvFmxeLGeW+W0CTLzzwImQumIaNAgMBAAECgYAzOn2LlD9Nv5lzzTPNl9jaQxiAZllnyDJYbcYmvaD5LIP4wRzMdvmexHtHb+tbFnEcfqmzbguEZiDw3Tt7COepQWvNzlM+/HbFtkXzSh6WEu2TgjZwudcCDHDyjDzUNgcWnBIw8/+Sy4COOm4p+UnprYK4sdriMZyz8K5UC8CxFQJBAODTt0lg/HiZKaOX7PMmsiRisd5oAslyDHCt66oPG29KTE1j4fwKDzGJlrOo1f4Q078IDYMO1I/Y3uP8Es3FT1MCQQCqRrD+lO3YCZOUGTHm2WGmbljIoeDpnIn2TZFyqDGKXs6EAx7SXkgarY2OC5O2aifMhXElPUGChfSgPmRUFHafAkEAxFtkWuwf1NxAJ6cKxZpoP6sLGenRdUrsXoUnrBEhruM/HOA9gLjwaB14x1SQASOFK/TGiE4ti6ynjoqbiafoDQJBAI0l6FZAsiBhX9pmQD1yeUXzNtmphr1gK+TmS+lVjyt6h4pa49PSn8atkyfqZNnTiYY6H56U9pbx3+Rtk9E23VUCQEZ9/JHUaGc77s3ibpcKFVemlb0i/Uvj2V45aoNfY34iex4biAUsRq/FJNiqBk+xQWkJ4QY8nKVE45GlaCfZ8/c=

@ -1,264 +0,0 @@
package com.shxy.xymanager_common.bean;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* @ClassNameSysDept
* @Description .
* @Author Arno_Fu
* @CreatTime11/26/2019 - 8:50 PM
* @Version V1.0
*/
public class SysDept {
private static final long serialVersionUID = 1L;
/**
* id
*/
@ApiModelProperty(value="部门id", name="dept_id")
private Long deptId;
/**
* id
*/
@ApiModelProperty(value="父部门id", name="parentId")
private Long parentId;
/**
*
*/
private String ancestors;
/**
*
*/
@ApiModelProperty(value="部门名称", name="deptName")
private String deptName;
/**
*
*/
@ApiModelProperty(value="显示顺序", name="orderNum")
private Integer orderNum;
/**
*
*/
private String leader;
/**
*
*/
private String phone;
/**
*
*/
private String email;
/**
* 0 1
*/
private String status;
/**
* 0 1
*/
@ApiModelProperty(value="删除标志0代表存在 1代表删除", name="delFlag")
private String delFlag;
/**
*
*/
@ApiModelProperty(value="创建者", name="createBy")
private String createBy;
/**
*
*/
@ApiModelProperty(value="创建时间", name="createTime")
private Date createTime;
/**
*
*/
@ApiModelProperty(value="更新者", name="updateBy")
private String updateBy;
/**
*
*/
@ApiModelProperty(value="更新时间", name="updateTime")
private Date updateTime;
/**
*
* */
private String parentName;
/**
*
* */
private List<SysDept> children = new ArrayList<SysDept>();
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public String getAncestors() {
return ancestors;
}
public void setAncestors(String ancestors) {
this.ancestors = ancestors;
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public Integer getOrderNum() {
return orderNum;
}
public void setOrderNum(Integer orderNum) {
this.orderNum = orderNum;
}
public String getLeader() {
return leader;
}
public void setLeader(String leader) {
this.leader = leader;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getParentName() {
return parentName;
}
public void setParentName(String parentName) {
this.parentName = parentName;
}
public List<SysDept> getChildren() {
return children;
}
public void setChildren(List<SysDept> children) {
this.children = children;
}
@Override
public String toString() {
return "SysDept{" +
", deptId=" + deptId +
", parentId=" + parentId +
", ancestors=" + ancestors +
", deptName=" + deptName +
", orderNum=" + orderNum +
", leader=" + leader +
", phone=" + phone +
", email=" + email +
", status=" + status +
", delFlag=" + delFlag +
", createBy=" + createBy +
", createTime=" + createTime +
", updateBy=" + updateBy +
", updateTime=" + updateTime +
"}";
}
}

@ -1,7 +1,6 @@
package com.shxy.xymanager_common.bean; package com.shxy.xymanager_common.bean;
import cn.hutool.core.date.DateTime;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -56,12 +55,7 @@ public class SysUser {
private String status; private String status;
public SysUser() { public SysUser() {
} }
} }

@ -1,7 +1,5 @@
package com.shxy.xymanager_common.dto; package com.shxy.xymanager_common.dto;
import com.shxy.xymanager_common.entity.Terminals;
import com.shxy.xymanager_common.entity.TerminalsWithHeart;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;

@ -1,4 +1,4 @@
package com.shxy.xymanager_common.entity; package com.shxy.xymanager_common.dto;
import lombok.Data; import lombok.Data;

@ -1,50 +1,27 @@
package com.shxy.xymanager_common.entity; package com.shxy.xymanager_common.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
/** import java.util.Date;
* @ClassNameSysUser
* @Description
* @Author Arno_Fu
* @CreatTime11/26/2019 - 2:25 PM
* @Version V1.0
*/
@Data @Data
public class SysUser { public class SysUser {
/** private Integer uid;
* ID
*/
@ApiModelProperty(value="用户ID", name="user_id")
private Integer userId;
/**
*
*/
@ApiModelProperty(value="用户账号", name="userAccount")
private String userName; private String userName;
/** private Integer status;
*
*/
@ApiModelProperty(value="用户昵称", name="nickName")
private String nickName;
/** private String nickName;
*
*/
private String passwordSalt;
/**
*
*/
private String password; private String password;
/** private Integer role;
* 0 1
*/ private Date createTime;
private String status;
private Date updateTime;
} }

@ -6,7 +6,7 @@ import java.io.Serializable;
import java.math.BigInteger; import java.math.BigInteger;
@Data @Data
public class UserSession implements Serializable { public class SysUserSession implements Serializable {
private Integer id; private Integer id;
private String sessionId; private String sessionId;

@ -13,6 +13,8 @@ public class TerminalChannelMapper implements Serializable {
private Integer channelId; private Integer channelId;
private String alias;
private Date createTime; private Date createTime;
private Date updateTime; private Date updateTime;

@ -3,7 +3,7 @@ package com.shxy.xymanager_common.exception;
/** /**
* *
* *
* @author ruoyi * @author
*/ */
public class CustomException extends RuntimeException public class CustomException extends RuntimeException
{ {

@ -0,0 +1,22 @@
package com.shxy.xymanager_common.util;
import com.shxy.xymanager_common.constant.Constants;
/**
* Cma
*/
public class CmaUtil {
/**
*
* @param cmdid
* @param channel
* @param type
* @return
*/
public static String takePic(String cmdid, Integer channel, Integer type) {
String cmd = Constants.CMD + "capture --cmdid=" + cmdid + " --channel=" + channel + " --preset=255 --type=" + type;
return cmd;
}
}

@ -0,0 +1,17 @@
package com.shxy.xymanager_common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "线路杆塔查询", description = "线路杆塔查询")
public class LineAndGtVo {
@ApiModelProperty(value = "查询类型", example = "1--线路 2--杆塔")
private Integer type;
@ApiModelProperty(value = "编号", example = "123455")
private Integer id;
}

@ -0,0 +1,19 @@
package com.shxy.xymanager_common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
@ApiModel(value = "装置编号对象", description = "装置编号对象")
public class OpenCmdidVo {
@ApiModelProperty(value = "装置编号", example = "123455")
private String deviceID;
@ApiModelProperty(value = "sessionID", example = "123455")
private String sessionID;
}

@ -0,0 +1,20 @@
package com.shxy.xymanager_common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "用户登录参数", description = "用户登录参数描述")
public class OpenDeviceCaptureVo {
@ApiModelProperty(value = "装置编号", example = "123455")
private String deviceID;
@ApiModelProperty(value = "sessionID", example = "123455")
private String sessionID;
@ApiModelProperty(value = "操作", example = "1--拍照 2--拍视频")
private Integer operateType;
}

@ -12,7 +12,7 @@ import java.util.List;
@Data @Data
@ApiModel(value = "装置和查询时间提供", description = "装置和查询时间提供") @ApiModel(value = "装置和查询时间提供", description = "装置和查询时间提供")
public class TerminalAndTimeForOpenVo { public class OpenTerminalAndTimeVo {
@NotNull(message = "装置编号不能缺少") @NotNull(message = "装置编号不能缺少")
@ApiModelProperty(value = "装置编号", example = "123455") @ApiModelProperty(value = "装置编号", example = "123455")

@ -17,15 +17,15 @@ public class TerminalPhotoVo {
@NotNull(message = "通道号") @NotNull(message = "通道号")
@ApiModelProperty(value = "通道号", example = "123455") @ApiModelProperty(value = "通道号", example = "123455")
private Short channel; private Integer channel;
@NotNull(message = "装置列表不能缺少") @NotNull(message = "装置列表不能缺少")
@ApiModelProperty(value = "装置通道编号列表", example = "123455") @ApiModelProperty(value = "装置通道编号列表", example = "123455")
private Short preset; private Integer preset;
@NotNull(message = "图片类型") @NotNull(message = "图片类型")
@ApiModelProperty(value = "图片类型", example = "0--图片 1--视频") @ApiModelProperty(value = "图片类型", example = "0--图片 1--视频")
private Short captureType; private Integer captureType;
} }

@ -6,6 +6,7 @@ import lombok.Data;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -13,20 +14,20 @@ import java.util.List;
@ApiModel(value = "装置信息对象", description = "设备信息对象描述") @ApiModel(value = "装置信息对象", description = "设备信息对象描述")
public class TerminalVo { public class TerminalVo {
@ApiModelProperty(value = "线路编号", example = "123456") @ApiModelProperty(value = "线路编号", example = "123456")
private Integer lineid; private Integer lineId;
@ApiModelProperty(value = "杆塔编号", example = "123456") @ApiModelProperty(value = "杆塔编号", example = "123456")
private Integer towerid; private Integer towerId;
@ApiModelProperty(value = "通道编号", example = "123456") @ApiModelProperty(value = "通道编号", example = "[{id:int , alias:dskafjl},{id,alias}]")
private List<Integer> channelid; private List<Item> channelId;
@ApiModelProperty(value = "sim卡号", example = "123456") @ApiModelProperty(value = "sim卡号", example = "123456")
private String sim; private String sim;
@ApiModelProperty(value = "图像监测装置 ID17 位编码)", example = "12345678") @ApiModelProperty(value = "图像监测装置 ID17 位编码)", example = "12345678")
@NotBlank(message = "图像监测装置不能缺少") @NotBlank(message = "图像监测装置不能缺少")
private String cmdid; private String cmdId;
@ApiModelProperty(value = "原始 ID各厂家内部识别号", example = "12345678") @ApiModelProperty(value = "原始 ID各厂家内部识别号", example = "12345678")
private Short orgId; private Short orgId;
@ -61,4 +62,13 @@ public class TerminalVo {
@ApiModelProperty(value = "经度", example = "213") @ApiModelProperty(value = "经度", example = "213")
private Double longitude; private Double longitude;
@Data
public static class Item {
@NotNull(message = "通道编号")
@ApiModelProperty(value = "装置编号", example = "123455")
private Integer id;
@ApiModelProperty(value = "别名", example = "123455")
private String alias;
}
} }

@ -19,20 +19,20 @@ public class UpdateTerminalVo {
private Integer id; private Integer id;
@ApiModelProperty(value = "线路编号", example = "123456") @ApiModelProperty(value = "线路编号", example = "123456")
private Integer lineid; private Integer lineId;
@ApiModelProperty(value = "杆塔编号", example = "123456") @ApiModelProperty(value = "杆塔编号", example = "123456")
private Integer towerid; private Integer towerId;
@ApiModelProperty(value = "通道编号", example = "123456") @ApiModelProperty(value = "通道编号", example = "123456")
private List<Integer> channelid; private List<Item> channelId;
@ApiModelProperty(value = "sim卡号", example = "123456") @ApiModelProperty(value = "sim卡号", example = "123456")
private String sim; private String sim;
@ApiModelProperty(value = "图像监测装置 ID17 位编码)", example = "12345678") @ApiModelProperty(value = "图像监测装置 ID17 位编码)", example = "12345678")
@NotBlank(message = "图像监测装置不能缺少") @NotBlank(message = "图像监测装置不能缺少")
private String cmdid; private String cmdId;
@ApiModelProperty(value = "原始 ID各厂家内部识别号", example = "12345678") @ApiModelProperty(value = "原始 ID各厂家内部识别号", example = "12345678")
private Short orgId; private Short orgId;
@ -67,4 +67,16 @@ public class UpdateTerminalVo {
@ApiModelProperty(value = "经度", example = "213") @ApiModelProperty(value = "经度", example = "213")
private Double longitude; private Double longitude;
@Data
public static class Item {
@NotNull(message = "通道编号")
@ApiModelProperty(value = "装置编号", example = "123455")
private Integer id;
@ApiModelProperty(value = "别名", example = "123455")
private String alias;
}
} }

@ -0,0 +1,21 @@
package com.shxy.xymanager_common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
@ApiModel(value = "用户登录参数", description = "用户登录参数描述")
public class UserLoginVo {
@NotNull(message = "用户名")
@ApiModelProperty(value = "用户名", example = "123455")
private String username;
@NotNull(message = "密码")
@ApiModelProperty(value = "密码", example = "123455")
private String password;
}

@ -0,0 +1,22 @@
package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.entity.SysUser;
import org.apache.ibatis.annotations.Param;
public interface SysUserDao {
SysUser selectByPrimaryKey(Integer uid);
SysUser selectByUserName(@Param("username") String username);
int deleteByPrimaryKey(Integer uid);
int insert(SysUser record);
int insertSelective(SysUser record);
int updateByPrimaryKeySelective(SysUser record);
int updateByPrimaryKey(SysUser record);
}

@ -1,16 +1,17 @@
package com.shxy.xymanager_dao.dao; package com.shxy.xymanager_dao.dao;
import cn.hutool.core.util.StrUtil;
import com.shxy.xymanager_common.bean.SysUser; import com.shxy.xymanager_common.bean.SysUser;
import com.shxy.xymanager_common.entity.UserSession; import com.shxy.xymanager_common.entity.SysUserSession;
import com.shxy.xymanager_common.vo.PageVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
* @ClassNameSysUserMapper * @ClassNameSysUserMapper
* @Description Mapper . * @Description Mapper .
* @Author Arno_Fu * @Author Arno_Fu
* @CreatTime11/26/2019 - 2:51 PM * @CreatTime11/26/2019 - 2:51 PM
* @Version V1.0 * @Version V1.0
@ -20,10 +21,9 @@ import java.util.List;
public interface SysUserMapperDao { public interface SysUserMapperDao {
/** /**
*
* @Description
* @param userAccount * @param userAccount
* @return com.chenxuan.entity.model.SysUser * @return com.chenxuan.entity.model.SysUser
* @Description
*/ */
SysUser selectByUserAccount(@Param("userName") String userAccount); SysUser selectByUserAccount(@Param("userName") String userAccount);
@ -34,7 +34,7 @@ public interface SysUserMapperDao {
* @param userName * @param userName
* @return * @return
*/ */
int checkUserNameUnique(@Param("userName") String userName); int checkUserNameUnique(@Param("userName") String userName);
int addUser(SysUser user); int addUser(SysUser user);
@ -42,8 +42,6 @@ public interface SysUserMapperDao {
Integer updateById(SysUser user); Integer updateById(SysUser user);
/** /**
* *
* *
@ -65,7 +63,7 @@ public interface SysUserMapperDao {
* *
* *
* @param userName * @param userName
* @param avatar * @param avatar
* @return * @return
*/ */
int updateUserAvatar(@Param("userName") String userName, @Param("avatar") String avatar); int updateUserAvatar(@Param("userName") String userName, @Param("avatar") String avatar);
@ -92,11 +90,18 @@ public interface SysUserMapperDao {
int deleteUserById(String userId); int deleteUserById(String userId);
UserSession selectUserBySessionId(String sessionId); SysUserSession selectUserBySessionId(String sessionId);
void insertUserSession(SysUserSession session);
int updateUserSession(SysUserSession session);
List<SysUser> selectUserInfoList(@Param("status") Integer status);
int insertOrUpdate(@Param("item") SysUserSession session, @Param("createat") Date create, @Param("updateat") Date update);
void insertUserSession(UserSession session); SysUserSession selectBySessionId(@Param("sessionid") String sessionid);
int updateUserSession(UserSession session);
List<SysUser> selectUserInfoList(@Param("status") Integer status);
} }

@ -1,6 +1,8 @@
package com.shxy.xymanager_dao.dao; package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.dto.TerminalsWithHeart;
import com.shxy.xymanager_common.entity.TerminalStatus; import com.shxy.xymanager_common.entity.TerminalStatus;
import org.apache.ibatis.annotations.Param;
public interface TerminalStatusDao { public interface TerminalStatusDao {
int deleteByPrimaryKey(Integer termId); int deleteByPrimaryKey(Integer termId);
@ -11,6 +13,8 @@ public interface TerminalStatusDao {
TerminalStatus selectByPrimaryKey(Integer termId); TerminalStatus selectByPrimaryKey(Integer termId);
TerminalsWithHeart selectByCmdId(@Param("cmdid") String cmdid);
int updateByPrimaryKeySelective(TerminalStatus record); int updateByPrimaryKeySelective(TerminalStatus record);
int updateByPrimaryKey(TerminalStatus record); int updateByPrimaryKey(TerminalStatus record);

@ -213,9 +213,9 @@
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;--> <!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>--> <!-- </table>-->
<table tableName="request_results" <table tableName="sys_user"
domainObjectName="RequestResults" domainObjectName="SysUser"
mapperName="RequestResultsDao" mapperName="SysUserDao"
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"/>-->

@ -19,7 +19,7 @@
<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"/> <result column="dy_level_id" jdbcType="INTEGER" property="dyLevel"/>
<collection property="list" javaType="list" ofType="com.shxy.xymanager_common.entity.TerminalsWithHeart"> <collection property="list" javaType="list" ofType="com.shxy.xymanager_common.dto.TerminalsWithHeart">
<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="tower_name" jdbcType="INTEGER" property="name"/> <result column="tower_name" jdbcType="INTEGER" property="name"/>

@ -0,0 +1,134 @@
<?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.SysUserDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.SysUser">
<id column="uid" jdbcType="INTEGER" property="uid"/>
<result column="user_name" jdbcType="VARCHAR" property="userName"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="nick_name" jdbcType="VARCHAR" property="nickName"/>
<result column="password" jdbcType="VARCHAR" property="password"/>
<result column="role" jdbcType="INTEGER" property="role"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
uid, user_name, status, nick_name, password, role, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from sys_user
where uid = #{uid,jdbcType=INTEGER}
</select>
<select id="selectByUserName" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from sys_user
where user_name = #{username}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sys_user
where uid = #{uid,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.SysUser">
insert into sys_user (uid, user_name, status,
nick_name, password, role,
create_time, update_time)
values (#{uid,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
#{nickName,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, #{role,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.SysUser">
insert into sys_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="uid != null">
uid,
</if>
<if test="userName != null">
user_name,
</if>
<if test="status != null">
status,
</if>
<if test="nickName != null">
nick_name,
</if>
<if test="password != null">
password,
</if>
<if test="role != null">
role,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="uid != null">
#{uid,jdbcType=INTEGER},
</if>
<if test="userName != null">
#{userName,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="nickName != null">
#{nickName,jdbcType=VARCHAR},
</if>
<if test="password != null">
#{password,jdbcType=VARCHAR},
</if>
<if test="role != null">
#{role,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.SysUser">
update sys_user
<set>
<if test="userName != null">
user_name = #{userName,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="nickName != null">
nick_name = #{nickName,jdbcType=VARCHAR},
</if>
<if test="password != null">
password = #{password,jdbcType=VARCHAR},
</if>
<if test="role != null">
role = #{role,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 uid = #{uid,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.SysUser">
update sys_user
set user_name = #{userName,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER},
nick_name = #{nickName,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
role = #{role,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where uid = #{uid,jdbcType=INTEGER}
</update>
</mapper>

@ -2,13 +2,22 @@
<!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.SysUserMapperDao"> <mapper namespace="com.shxy.xymanager_dao.dao.SysUserMapperDao">
<resultMap id="SysUserResult" type="com.shxy.xymanager_common.bean.SysUser"> <resultMap id="SysUserResult" type="com.shxy.xymanager_common.bean.SysUser">
<id column="uid" property="userId" /> <id column="uid" property="userId"/>
<result column="name" property="userName" /> <result column="name" property="userName"/>
<result column="password" property="password" /> <result column="password" property="password"/>
<result column="status" property="status" /> <result column="status" property="status"/>
<result column="role" property="role" /> <result column="role" property="role"/>
</resultMap> </resultMap>
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.SysUserSession">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="session_id" jdbcType="VARCHAR" property="sessionId"/>
<result column="user_name" jdbcType="INTEGER" property="userName"/>
<result column="role" jdbcType="INTEGER" property="role"/>
<result column="expire_time" jdbcType="VARCHAR" property="expireTime"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="selectUserVo"> <sql id="selectUserVo">
SELECT SELECT
@ -19,15 +28,13 @@
sys_user u sys_user u
</sql> </sql>
<select id="selectByUserAccount" resultMap="SysUserResult"> <select id="selectByUserAccount" resultMap="SysUserResult">
SELECT * FROM sys_user WHERE user_name = #{userName} SELECT * FROM sys_user WHERE user_name = #{userName}
</select> </select>
<select id="selectPages" resultMap="SysUserResult">
<select id="selectPages" resultMap="SysUserResult">
<include refid="selectUserVo"/> <include refid="selectUserVo"/>
WHERE status = '0' WHERE status = '0'
<if test="params.userName != null and params.userName != ''"> <if test="params.userName != null and params.userName != ''">
AND user_name like concat('%', #{params.userName}, '%') AND user_name like concat('%', #{params.userName}, '%')
</if> </if>
@ -47,6 +54,10 @@
where u.user_id = #{userId} where u.user_id = #{userId}
</select> </select>
<select id="selectBySessionId" resultMap="BaseResultMap">
<include refid="selectUserVo"/>
where session_id = #{sessionid}
</select>
<update id="resetUserPwd"> <update id="resetUserPwd">
update sys_user set password = #{password} where user_name = #{userName} update sys_user set password = #{password} where user_name = #{userName}
@ -57,7 +68,7 @@
values(#{userName},#{userName},#{password},#{role},#{createTime}) values(#{userName},#{userName},#{password},#{role},#{createTime})
</insert> </insert>
<select id="selectUserBySessionId" resultType="com.shxy.xymanager_common.entity.UserSession"> <select id="selectUserBySessionId" resultType="com.shxy.xymanager_common.entity.SysUserSession">
select select
session_id as sessionId, session_id as sessionId,
user_name as userName, user_name as userName,
@ -67,7 +78,7 @@
where session_id = #{sessionId} where session_id = #{sessionId}
</select> </select>
<update id="updateUserSession" parameterType="com.shxy.xymanager_common.entity.UserSession"> <update id="updateUserSession" parameterType="com.shxy.xymanager_common.entity.SysUserSession">
update `sys_user_session` update `sys_user_session`
<set> <set>
<if test="expireTime!= null"> <if test="expireTime!= null">
@ -77,7 +88,6 @@
where session_id = #{sessionId} where session_id = #{sessionId}
</update> </update>
<update id="updateById" parameterType="com.shxy.xymanager_common.bean.SysUser"> <update id="updateById" parameterType="com.shxy.xymanager_common.bean.SysUser">
update `sys_user` update `sys_user`
<set> <set>
@ -100,15 +110,13 @@
where uid = #{userId} where uid = #{userId}
</update> </update>
<update id="deleteUserById" parameterType="java.lang.String"> <update id="deleteUserById" parameterType="java.lang.String">
update `sys_user` update `sys_user`
set status = 0 set status = 0
where uid = #{userId} where uid = #{userId}
</update> </update>
<insert id="insertUserSession" parameterType="com.shxy.xymanager_common.entity.SysUserSession">
<insert id="insertUserSession" parameterType="com.shxy.xymanager_common.entity.UserSession">
insert into sys_user_session (session_id, user_name,role,expire_time) insert into sys_user_session (session_id, user_name,role,expire_time)
values (#{sessionId,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{role,jdbcType=VARCHAR}, #{expireTime,jdbcType=INTEGER}) values (#{sessionId,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{role,jdbcType=VARCHAR}, #{expireTime,jdbcType=INTEGER})
</insert> </insert>
@ -126,4 +134,15 @@
order by create_time desc order by create_time desc
</select> </select>
<insert id="insertOrUpdate">
insert into sys_user_session (session_id,user_name,role,expire_time,create_time,update_time)
values (#{item.sessionId} ,#{item.userName}, #{item.role},#{item.expireTime},#{createat},#{updateat})
ON DUPLICATE KEY UPDATE
user_name = values(user_name),
role = values(role),
session_id = values (session_id),
expire_time = values (expire_time)
</insert>
</mapper> </mapper>

@ -5,6 +5,7 @@
<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_id" jdbcType="INTEGER" property="channelId"/> <result column="channel_id" jdbcType="INTEGER" property="channelId"/>
<result column="alias" jdbcType="VARCHAR" property="alias"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap> </resultMap>
@ -75,11 +76,11 @@
<insert id="insertList" parameterType="java.util.List"> <insert id="insertList" parameterType="java.util.List">
insert into terminal_channel_mapper insert into terminal_channel_mapper
(term_id, channel_id, (term_id, channel_id,alias,
create_time, update_time) create_time, update_time)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.termId},#{item.channelId},#{createat},#{updateat}) (#{item.termId},#{item.channelId},#{item.alias},#{createat},#{updateat})
</foreach> </foreach>
</insert> </insert>

@ -20,6 +20,16 @@
<result column="boot_time" jdbcType="BIGINT" property="bootTime"/> <result column="boot_time" jdbcType="BIGINT" property="bootTime"/>
<result column="rs_update_time" jdbcType="BIGINT" property="updateTime"/> <result column="rs_update_time" jdbcType="BIGINT" property="updateTime"/>
</resultMap> </resultMap>
<resultMap id="heartResultMap" type="com.shxy.xymanager_common.dto.TerminalsWithHeart">
<result column="term_id" jdbcType="INTEGER" property="id"/>
<result column="tower_id" jdbcType="INTEGER" property="towerid"/>
<result column="cmdid" jdbcType="VARCHAR" property="cmdid"/>
<result column="equip_name" jdbcType="VARCHAR" property="equipname"/>
<result column="display_name" jdbcType="VARCHAR" property="displayname"/>
<result column="model" jdbcType="VARCHAR" property="model"/>
<result column="last_heartbeat" jdbcType="BIGINT" property="lastheartbeat"/>
</resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
term_id, last_heartbeat, last_frame_no, battery_voltage, op_temperature, battery_capacity, term_id, last_heartbeat, last_frame_no, battery_voltage, op_temperature, battery_capacity,
floating_charge, total_working_time, working_time, gps_status,connection_state, signal_strength_4g, floating_charge, total_working_time, working_time, gps_status,connection_state, signal_strength_4g,
@ -31,6 +41,20 @@
from terminal_status from terminal_status
where term_id = #{termId,jdbcType=INTEGER} where term_id = #{termId,jdbcType=INTEGER}
</select> </select>
<select id="selectByCmdId" resultMap="heartResultMap">
select
b.term_id as term_id,
b.tower_id as tower_id,
b.cmdid as cmdid,
b.equip_name as equip_name,
b.display_name as display_name,
b.model as model,
b.last_heartbeat as last_heartbeat
from terminal_status a,
terminals b
where a.term_id = b.id and b.cmdid = #{cmdid}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from terminal_status delete from terminal_status
where term_id = #{termId,jdbcType=INTEGER} where term_id = #{termId,jdbcType=INTEGER}

@ -40,10 +40,10 @@
<groupId>ch.qos.logback</groupId> <groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId> <artifactId>logback-classic</artifactId>
</exclusion> </exclusion>
<exclusion> <!-- <exclusion>-->
<groupId>org.springframework.boot</groupId> <!-- <groupId>org.springframework.boot</groupId>-->
<artifactId>spring-boot-starter-tomcat</artifactId> <!-- <artifactId>spring-boot-starter-tomcat</artifactId>-->
</exclusion> <!-- </exclusion>-->
</exclusions> </exclusions>
</dependency> </dependency>

@ -29,6 +29,7 @@ public class CustomSecurityConfig implements WebMvcConfigurer {
.excludePathPatterns("/*/api-docs") .excludePathPatterns("/*/api-docs")
.excludePathPatterns("/error") .excludePathPatterns("/error")
.excludePathPatterns("/test/**") .excludePathPatterns("/test/**")
.excludePathPatterns("/cmaUserLogin")
.excludePathPatterns("/loginXcxuser") .excludePathPatterns("/loginXcxuser")
.excludePathPatterns("/loginXcxuser"); .excludePathPatterns("/loginXcxuser");
} }

@ -1,11 +1,19 @@
package com.shxy.xymanager_framework.interaction; package com.shxy.xymanager_framework.interaction;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.util.StrUtil;
import com.shxy.xymanager_common.annotation.JwtIgnore;
import com.shxy.xymanager_common.entity.SysUserSession;
import com.shxy.xymanager_common.enums.HttpMethod;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_service.service.SysUserService; import com.shxy.xymanager_service.service.SysUserService;
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.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -23,45 +31,48 @@ import java.math.BigInteger;
@Component @Component
@Slf4j @Slf4j
public class JwtInterceptor implements HandlerInterceptor { public class JwtInterceptor implements HandlerInterceptor {
@Autowired @Autowired
SysUserService sysUserService; SysUserService sysUserService;
@Value("${session.expire_time}") @Value("${session.expire_time}")
public BigInteger time; public BigInteger time;
@Override @Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
// 忽略带JwtIgnore注解的请求, 不做后续token认证校验 // 忽略带JwtIgnore注解的请求, 不做后续token认证校验
// if (handler instanceof HandlerMethod) { if (handler instanceof HandlerMethod) {
// HandlerMethod handlerMethod = (HandlerMethod) handler; HandlerMethod handlerMethod = (HandlerMethod) handler;
// JwtIgnore jwtIgnore = handlerMethod.getMethodAnnotation(JwtIgnore.class); JwtIgnore jwtIgnore = handlerMethod.getMethodAnnotation(JwtIgnore.class);
// if (jwtIgnore != null) { if (jwtIgnore != null) {
// return true; return true;
// } }
// } }
// if (HttpMethod.GET.name().equals(request.getMethod())) { if (HttpMethod.GET.name().equals(request.getMethod())) {
// response.setStatus(HttpServletResponse.SC_OK); response.setStatus(HttpServletResponse.SC_OK);
// return true; return true;
// } }
// // 获取请求头信息authorization信息 // 获取请求头信息authorization信息
// final String sessionId = request.getHeader("sessionId"); final String sessionId = request.getHeader("sessionId");
// if (StrUtil.isBlank(sessionId)) { if (StrUtil.isBlank(sessionId)) {
// log.info("sessionId为空登录过期"); log.info("sessionId为空登录过期");
// Asserts.fail(401, "登录过期"); Asserts.fail(401, "登录过期");
// }else{ }else{
// UserSession user = sysUserService.selectUserById(sessionId); SysUserSession user = sysUserService.selectUserById(sessionId);
// if(user!=null) { if(user!=null) {
// BigInteger expireTime = user.getExpireTime(); BigInteger expireTime = user.getExpireTime();
//
// BigInteger currentTime = MyDateUtils.TimeMillSecond2Second(new DateTime()); BigInteger currentTime = MyDateUtils.TimeMillSecond2Second(new DateTime());
// if (currentTime.subtract(expireTime).compareTo(time) > 0) { if (currentTime.subtract(expireTime).compareTo(time) > 0) {
// user.setExpireTime(currentTime.add(time)); user.setExpireTime(currentTime.add(time));
// sysUserService.updateUserSession(user); sysUserService.updateUserSession(user);
// } }
// }else{ }else{
// log.info("sessionId为空登录过期"); log.info("sessionId为空登录过期");
// Asserts.fail(401, "登录过期"); Asserts.fail(401, "登录过期");
// } }
// } }
return true; return true;
} }

@ -8,8 +8,7 @@ import cn.hutool.core.date.DateUnit;
import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.dto.DyLineAndTerminalWithHeartDto; import com.shxy.xymanager_common.dto.DyLineAndTerminalWithHeartDto;
import com.shxy.xymanager_common.entity.DyLevel; import com.shxy.xymanager_common.entity.DyLevel;
import com.shxy.xymanager_common.entity.Terminals; import com.shxy.xymanager_common.dto.TerminalsWithHeart;
import com.shxy.xymanager_common.entity.TerminalsWithHeart;
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.DyLineTreeListModel; import com.shxy.xymanager_common.model.DyLineTreeListModel;

@ -195,5 +195,30 @@ public class LineServiceImpl implements LineService {
return Asserts.success(model); return Asserts.success(model);
} }
/**
* 线
*
* @param vo
* @return
*/
@Override
public ServiceBody<LineAndGtAndChannelListModel> getLineAndGtList(LineAndGtVo vo) {
LineAndGtAndChannelListModel model = new LineAndGtAndChannelListModel();
List<LineAndGtAndChannelListModel.Bean> beans = new ArrayList<>();
Integer type = vo.getType();
Integer id = vo.getId();
if (type.intValue() == 1) {
List<Lines> list = linesDao.selectLineByDyId(null, CommonStatus.EFFECTIVE.value());
beans = BeanUtil.copyToList(list, LineAndGtAndChannelListModel.Bean.class);
} else {
if (id != null) {
List<Tower> list = towerDao.selectAllByLineid(id, CommonStatus.EFFECTIVE.value());
beans = BeanUtil.copyToList(list, LineAndGtAndChannelListModel.Bean.class);
}
}
model.setList(beans);
return Asserts.success(model);
}
} }

@ -6,7 +6,7 @@ import com.shxy.xymanager_common.bean.SysUser;
import com.shxy.xymanager_common.config.CustomRsaProperties; import com.shxy.xymanager_common.config.CustomRsaProperties;
import com.shxy.xymanager_common.constant.HttpStatusCode; import com.shxy.xymanager_common.constant.HttpStatusCode;
import com.shxy.xymanager_common.constant.UuidUtils; import com.shxy.xymanager_common.constant.UuidUtils;
import com.shxy.xymanager_common.entity.UserSession; import com.shxy.xymanager_common.entity.SysUserSession;
import com.shxy.xymanager_common.exception.Asserts; import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.exception.UserPasswordNotMatchException; import com.shxy.xymanager_common.exception.UserPasswordNotMatchException;
import com.shxy.xymanager_common.util.MyDateUtils; import com.shxy.xymanager_common.util.MyDateUtils;
@ -18,12 +18,8 @@ import com.shxy.xymanager_service.service.SysUserService;
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.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils;
import java.math.BigInteger; import java.math.BigInteger;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/** /**
* *
@ -69,10 +65,10 @@ public class LoginServiceImpl implements LoginService {
* @param sysUser * @param sysUser
* @return * @return
*/ */
public ServiceBody<UserSession> remoteLogin(SysUser sysUser) { public ServiceBody<SysUserSession> remoteLogin(SysUser sysUser) {
String sessionId = UuidUtils.getUUID(); String sessionId = UuidUtils.getUUID();
try { try {
UserSession user = getLoginUser(sysUser); SysUserSession user = getLoginUser(sysUser);
user.setSessionId(sessionId); user.setSessionId(sessionId);
sysUserMapperDao.insertUserSession(user); sysUserMapperDao.insertUserSession(user);
return Asserts.success(user); return Asserts.success(user);
@ -90,7 +86,7 @@ public class LoginServiceImpl implements LoginService {
* @param sysUser * @param sysUser
* @return * @return
*/ */
public UserSession getLoginUser(SysUser sysUser) throws Exception { public SysUserSession getLoginUser(SysUser sysUser) throws Exception {
// 用户验证 // 用户验证
SysUser account = sysUserService.findByUserAccount(sysUser.getUserName()); SysUser account = sysUserService.findByUserAccount(sysUser.getUserName());
// 判断用户是否存在 // 判断用户是否存在
@ -105,7 +101,7 @@ public class LoginServiceImpl implements LoginService {
if (!sysUser.getPassword().equals(pwd)) { if (!sysUser.getPassword().equals(pwd)) {
throw new UserPasswordNotMatchException("密码错误", HttpStatusCode.ERROR); throw new UserPasswordNotMatchException("密码错误", HttpStatusCode.ERROR);
} }
UserSession user = new UserSession(); SysUserSession user = new SysUserSession();
// loginUser.setPermissions(permissions); // loginUser.setPermissions(permissions);
user.setUserName(sysUser.getUserName()); user.setUserName(sysUser.getUserName());
user.setRole(account.getRole()); user.setRole(account.getRole());

@ -0,0 +1,226 @@
package com.shxy.xymanager_service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import cn.hutool.json.JSONObject;
import com.shxy.xymanager_common.constant.UuidUtils;
import com.shxy.xymanager_common.dto.TerminalsWithHeart;
import com.shxy.xymanager_common.entity.SysUser;
import com.shxy.xymanager_common.entity.SysUserSession;
import com.shxy.xymanager_common.entity.Terminals;
import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.util.CmaUtil;
import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_common.util.ProcessExecUtils;
import com.shxy.xymanager_common.vo.OpenCmdidVo;
import com.shxy.xymanager_common.vo.OpenDeviceCaptureVo;
import com.shxy.xymanager_common.vo.UserLoginVo;
import com.shxy.xymanager_dao.dao.SysUserDao;
import com.shxy.xymanager_dao.dao.SysUserMapperDao;
import com.shxy.xymanager_dao.dao.TerminalStatusDao;
import com.shxy.xymanager_dao.dao.TerminalsDao;
import com.shxy.xymanager_service.service.OpenService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import java.math.BigInteger;
import java.util.Date;
/**
*
*/
@Service
@Component
@Slf4j
public class OpenServiceImpl implements OpenService {
@Autowired
private SysUserMapperDao sysUserMapperDao;
@Autowired
private SysUserDao sysUserDao;
@Autowired
private TerminalsDao terminalsDao;
@Autowired
private TerminalStatusDao terminalStatusDao;
@Value("${session.open_expire_time}")
public BigInteger time;
/**
*
*
* @param vo
* @return
*/
@Override
public JSONObject cmaUserLogin(UserLoginVo vo) {
JSONObject jsonObject = new JSONObject();
String username = vo.getUsername();
SysUser sysUser = sysUserDao.selectByUserName(username);
// 判断用户是否存在
if (BeanUtil.isEmpty(sysUser)) {
jsonObject.putOpt("errcode", 1);
jsonObject.putOpt("errmsg", "用户不存在");
}
// 判断密码是否存在
String password = vo.getPassword();
if (BeanUtil.isEmpty(password)) {
jsonObject.putOpt("errcode", 2);
jsonObject.putOpt("errmsg", "密码错误");
}
String userPassword = SecureUtil.md5(password);
// 密码对比
if (!sysUser.getPassword().equals(userPassword)) {
jsonObject.putOpt("errcode", 2);
jsonObject.putOpt("errmsg", "密码错误");
}
Date date = new Date();
String sessionId = UuidUtils.getUUID();
SysUserSession sysUserSession = new SysUserSession();
sysUserSession.setUserName(username);
sysUserSession.setRole(sysUser.getRole());
sysUserSession.setSessionId(sessionId);
BigInteger expiretime = MyDateUtils.TimeMillSecond2Second(MyDateUtils.offsetMinute(date, 30));
sysUserSession.setExpireTime(expiretime);
sysUserMapperDao.insertOrUpdate(sysUserSession, date, date);
jsonObject.set("errcode", 0);
jsonObject.set("errmsg", "OK");
jsonObject.set("sessionid", sessionId);
jsonObject.set("keepingtime", 30);
return jsonObject;
}
/**
*
*
* @param vo
* @return
*/
@Override
public JSONObject ctrlCmaDeviceCapture(OpenDeviceCaptureVo vo) {
JSONObject jsonObject = new JSONObject();
String sessionID = vo.getSessionID();
String deviceID = vo.getDeviceID();
Integer operateType = vo.getOperateType();
if (StrUtil.isEmpty(sessionID)) {
jsonObject.set("errcode", 1);
jsonObject.set("errmsg", "invalid session");
return jsonObject;
}
if (StrUtil.isEmpty(deviceID)) {
jsonObject.set("errcode", 2);
jsonObject.set("errmsg", "device not register");
return jsonObject;
}
SysUserSession sysUserSession = sysUserMapperDao.selectBySessionId(sessionID);
if (BeanUtil.isEmpty(sysUserSession)) {
jsonObject.set("errcode", 1);
jsonObject.set("errmsg", "invalid session");
return jsonObject;
} else {
BigInteger expireTime = sysUserSession.getExpireTime();
BigInteger currentTime = MyDateUtils.TimeMillSecond2Second(new DateTime());
if (currentTime.subtract(expireTime).compareTo(time) > 0) {
jsonObject.set("errcode", 1);
jsonObject.set("errmsg", "invalid session");
return jsonObject;
}
}
Terminals terminals = terminalsDao.selectByCmdid(deviceID, CommonStatus.EFFECTIVE.value());
if (BeanUtil.isEmpty(terminals)) {
jsonObject.set("errcode", 2);
jsonObject.set("errmsg", "device not register");
return jsonObject;
}
if (operateType == 1) {
operateType = 0;
} else if (operateType == 2) {
operateType = 1;
} else {
jsonObject.set("errcode", 3);
jsonObject.set("errmsg", "invalid protocol");
return jsonObject;
}
String cmd1 = CmaUtil.takePic(vo.getDeviceID(), 1, operateType);
ProcessExecUtils.exec(cmd1);
String cmd2 = CmaUtil.takePic(vo.getDeviceID(), 2, operateType);
ProcessExecUtils.exec(cmd2);
jsonObject.set("errcode", 0);
jsonObject.set("errmsg", "OK");
return jsonObject;
}
/**
* 线
*
* @param vo
* @return
*/
@Override
public JSONObject cmaDeviceStatus(OpenCmdidVo vo) {
JSONObject jsonObject = new JSONObject();
String sessionID = vo.getSessionID();
String deviceID = vo.getDeviceID();
if (StrUtil.isEmpty(sessionID)) {
jsonObject.set("errcode", 1);
jsonObject.set("errmsg", "invalid session");
return jsonObject;
}
SysUserSession sysUserSession = sysUserMapperDao.selectBySessionId(sessionID);
if (BeanUtil.isEmpty(sysUserSession)) {
jsonObject.set("errcode", 1);
jsonObject.set("errmsg", "invalid session");
return jsonObject;
} else {
BigInteger expireTime = sysUserSession.getExpireTime();
BigInteger currentTime = MyDateUtils.TimeMillSecond2Second(new DateTime());
if (currentTime.subtract(expireTime).compareTo(time) > 0) {
jsonObject.set("errcode", 1);
jsonObject.set("errmsg", "invalid session");
return jsonObject;
}
}
if (StrUtil.isEmpty(deviceID)) {
jsonObject.set("errcode", 2);
jsonObject.set("errmsg", "device not register");
return jsonObject;
}
TerminalsWithHeart terminalsWithHeart = terminalStatusDao.selectByCmdId(deviceID);
if (BeanUtil.isEmpty(terminalsWithHeart)) {
jsonObject.set("errcode", 2);
jsonObject.set("errmsg", "device not register");
return jsonObject;
}
Long lastheartbeat = terminalsWithHeart.getLastheartbeat();
BigInteger time = MyDateUtils.TimeSecond2MillSecond(lastheartbeat);
DateTime date = MyDateUtils.date(time.longValue());
long between = MyDateUtils.between(MyDateUtils.getNowDate(), date, DateUnit.MINUTE);
if (between > 30) {
jsonObject.set("isonline", false);
jsonObject.set("errcode", 0);
jsonObject.set("errmsg", "ok");
} else {
jsonObject.set("isonline", true);
jsonObject.set("errcode", 0);
jsonObject.set("errmsg", "ok");
}
return jsonObject;
}
}

@ -6,17 +6,14 @@ import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.bean.SysUser; import com.shxy.xymanager_common.bean.SysUser;
import com.shxy.xymanager_common.config.CustomRsaProperties; import com.shxy.xymanager_common.config.CustomRsaProperties;
import com.shxy.xymanager_common.entity.UserSession; import com.shxy.xymanager_common.entity.SysUserSession;
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.LineListModel;
import com.shxy.xymanager_common.model.SysUserModel; import com.shxy.xymanager_common.model.SysUserModel;
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.RsaUtils; import com.shxy.xymanager_common.util.RsaUtils;
import com.shxy.xymanager_common.util.StringUtils; import com.shxy.xymanager_common.util.StringUtils;
import com.shxy.xymanager_common.vo.PageVo; import com.shxy.xymanager_common.vo.PageVo;
@ -174,13 +171,13 @@ public class SysUserServiceImpl implements SysUserService {
@Override @Override
public UserSession selectUserById(String sessionId) { public SysUserSession selectUserById(String sessionId) {
UserSession session = sysUserMapperDao.selectUserBySessionId(sessionId); SysUserSession session = sysUserMapperDao.selectUserBySessionId(sessionId);
return session; return session;
} }
@Override @Override
public int updateUserSession(UserSession user) { public int updateUserSession(SysUserSession user) {
int result = sysUserMapperDao.updateUserSession(user); int result = sysUserMapperDao.updateUserSession(user);
return result; return result;
} }

@ -1,8 +1,5 @@
package com.shxy.xymanager_service.impl; 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.TerminalParamsService; 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;
@ -15,14 +12,4 @@ import org.springframework.stereotype.Service;
@Slf4j @Slf4j
public class TerminalParamsServiceImpl implements TerminalParamsService { public class TerminalParamsServiceImpl implements TerminalParamsService {
@Override
public ServiceBody<TerminalListModel> getTerminalList() {
return null;
}
@Override
public ServiceBody<String> addTerminal(TerminalVo terminalVo) {
return null;
}
} }

@ -17,6 +17,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.*; import com.shxy.xymanager_common.model.*;
import com.shxy.xymanager_common.page.PageUtils; import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.util.CmaUtil;
import com.shxy.xymanager_common.util.MyDateUtils; import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_common.util.ProcessExecUtils; import com.shxy.xymanager_common.util.ProcessExecUtils;
import com.shxy.xymanager_common.util.StringUtils; import com.shxy.xymanager_common.util.StringUtils;
@ -260,7 +261,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
* @return * @return
*/ */
@Override @Override
public ServiceBody<TerminalPhotoListForOpenModel> getPhotoListForOpen(TerminalAndTimeForOpenVo vo) { public ServiceBody<TerminalPhotoListForOpenModel> getPhotoListForOpen(OpenTerminalAndTimeVo vo) {
String cmdid = vo.getCmdId(); String cmdid = vo.getCmdId();
TerminalPhotoListForOpenModel model = new TerminalPhotoListForOpenModel(); TerminalPhotoListForOpenModel model = new TerminalPhotoListForOpenModel();
@ -335,11 +336,10 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
@Override @Override
public ServiceBody<Date> getLatestPhoto(TerminalPhotoVo vo) { public ServiceBody<Date> getLatestPhoto(TerminalPhotoVo vo) {
/* Cma cma = new Cma(server, port);*/
DateTime now = DateTime.now(); DateTime now = DateTime.now();
String cmd = Constants.CMD + "capture --cmdid=" + vo.getCmdid() + " --channel=" + vo.getChannel() + " --preset=255 --type=" + vo.getCaptureType(); // String cmd = Constants.CMD + "capture --cmdid=" + vo.getCmdid() + " --channel=" + vo.getChannel() + " --preset=255 --type=" + vo.getCaptureType();
String cmd = CmaUtil.takePic(vo.getCmdid(), vo.getChannel(), vo.getCaptureType());
ProcessExecUtils.exec(cmd); ProcessExecUtils.exec(cmd);
/* Boolean hasNew = cma.requestCapture(vo.getCmdid(), vo.getChannel(), vo.getPreset(), vo.getCaptureType());*/
return Asserts.success(now); return Asserts.success(now);
} }

@ -1,8 +1,5 @@
package com.shxy.xymanager_service.impl; 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.TerminalPresetsService; import com.shxy.xymanager_service.service.TerminalPresetsService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -15,14 +12,4 @@ import org.springframework.stereotype.Service;
@Slf4j @Slf4j
public class TerminalPresetServiceImpl implements TerminalPresetsService { public class TerminalPresetServiceImpl implements TerminalPresetsService {
@Override
public ServiceBody<TerminalListModel> getTerminalList() {
return null;
}
@Override
public ServiceBody<String> addTerminal(TerminalVo terminalVo) {
return null;
}
} }

@ -1,8 +1,5 @@
package com.shxy.xymanager_service.impl; 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.TerminalScheduleService; import com.shxy.xymanager_service.service.TerminalScheduleService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -15,13 +12,4 @@ import org.springframework.stereotype.Service;
@Slf4j @Slf4j
public class TerminalScheduleServiceImpl implements TerminalScheduleService { public class TerminalScheduleServiceImpl implements TerminalScheduleService {
@Override
public ServiceBody<TerminalListModel> getScheduleList() {
return null;
}
@Override
public ServiceBody<String> addTerminal(TerminalVo terminalVo) {
return null;
}
} }

@ -114,12 +114,13 @@ public class TerminalServiceImpl implements TerminalService {
Date time = new Date(); Date time = new Date();
int i = terminalsDao.insertList(terminals, CommonStatus.EFFECTIVE.value(), time, time); int i = terminalsDao.insertList(terminals, CommonStatus.EFFECTIVE.value(), time, time);
Integer termid = terminals.getId(); Integer termid = terminals.getId();
List<Integer> channelid = vo.getChannelid(); List<TerminalVo.Item> channelId = vo.getChannelId();
if (!BeanUtil.isEmpty(channelid) && channelid.size() > 0) { if (CollectionUtil.isNotEmpty(channelId)) {
List<TerminalChannelMapper> list = new ArrayList<>(); List<TerminalChannelMapper> list = new ArrayList<>();
for (Integer id : channelid) { for (TerminalVo.Item item : channelId) {
TerminalChannelMapper record = new TerminalChannelMapper(); TerminalChannelMapper record = new TerminalChannelMapper();
record.setChannelId(id); record.setChannelId(item.getId());
record.setAlias(item.getAlias());
record.setTermId(termid); record.setTermId(termid);
list.add(record); list.add(record);
} }
@ -142,17 +143,17 @@ public class TerminalServiceImpl implements TerminalService {
@Override @Override
public ServiceBody<String> updateTerminal(UpdateTerminalVo vo) { public ServiceBody<String> updateTerminal(UpdateTerminalVo vo) {
Integer termid = vo.getId(); Integer termid = vo.getId();
List<Integer> channelid = vo.getChannelid(); List<UpdateTerminalVo.Item> channelId = vo.getChannelId();
Terminals terminals = new Terminals(); Terminals terminals = new Terminals();
BeanUtil.copyProperties(vo, terminals, true); BeanUtil.copyProperties(vo, terminals, true);
int i = terminalsDao.updateByPrimaryKeySelective(terminals, new Date()); int i = terminalsDao.updateByPrimaryKeySelective(terminals, new Date());
terminalChannelMapperDao.deleteByTermId(termid); terminalChannelMapperDao.deleteByTermId(termid);
if (!CollectionUtil.isEmpty(channelid)) { if (!CollectionUtil.isNotEmpty(channelId)) {
List<TerminalChannelMapper> list = new ArrayList<>(); List<TerminalChannelMapper> list = new ArrayList<>();
for (Integer id : channelid) { for (UpdateTerminalVo.Item item : channelId) {
TerminalChannelMapper record = new TerminalChannelMapper(); TerminalChannelMapper record = new TerminalChannelMapper();
record.setChannelId(id); record.setChannelId(item.getId());
record.setAlias(item.getAlias());
record.setTermId(termid); record.setTermId(termid);
list.add(record); list.add(record);
} }

@ -9,7 +9,6 @@ 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.TerminalIdListVo; import com.shxy.xymanager_common.vo.TerminalIdListVo;
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;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -52,11 +51,6 @@ public class TerminalStatusServiceImpl implements TerminalStatusService {
return Asserts.success(terminalListModel); return Asserts.success(terminalListModel);
} }
@Override
public ServiceBody<String> addTerminal(TerminalVo terminalVo) {
return null;
}
/** /**
* *

@ -51,4 +51,12 @@ public interface LineService {
*/ */
ServiceBody<LineAndGtAndChannelListModel> getLineAndGt(LineAndGtAndChannelVo vo); ServiceBody<LineAndGtAndChannelListModel> getLineAndGt(LineAndGtAndChannelVo vo);
/**
* 线
*
* @param vo
* @return
*/
ServiceBody<LineAndGtAndChannelListModel> getLineAndGtList(LineAndGtVo vo);
} }

@ -3,7 +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.bean.SysUser; import com.shxy.xymanager_common.bean.SysUser;
import com.shxy.xymanager_common.entity.UserSession; import com.shxy.xymanager_common.entity.SysUserSession;
/** /**
* @ClassNameLoginService * @ClassNameLoginService
@ -17,9 +17,9 @@ public interface LoginService {
ServiceBody<String> login(String username, String password) throws Exception; ServiceBody<String> login(String username, String password) throws Exception;
ServiceBody<UserSession> remoteLogin(SysUser sysUser); ServiceBody<SysUserSession> remoteLogin(SysUser sysUser);
UserSession getLoginUser(SysUser sysUser) throws Exception; SysUserSession getLoginUser(SysUser sysUser) throws Exception;

@ -0,0 +1,22 @@
package com.shxy.xymanager_service.service;
import cn.hutool.json.JSONObject;
import com.shxy.xymanager_common.vo.OpenCmdidVo;
import com.shxy.xymanager_common.vo.OpenDeviceCaptureVo;
import com.shxy.xymanager_common.vo.UserLoginVo;
/**
*
*
* @author
*/
public interface OpenService {
JSONObject cmaUserLogin(UserLoginVo vo);
JSONObject ctrlCmaDeviceCapture(OpenDeviceCaptureVo vo);
JSONObject cmaDeviceStatus(OpenCmdidVo vo);
}

@ -3,13 +3,12 @@ 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.bean.SysUser; import com.shxy.xymanager_common.bean.SysUser;
import com.shxy.xymanager_common.entity.UserSession; import com.shxy.xymanager_common.entity.SysUserSession;
import com.shxy.xymanager_common.model.SysUserModel; import com.shxy.xymanager_common.model.SysUserModel;
import com.shxy.xymanager_common.vo.PageVo; import com.shxy.xymanager_common.vo.PageVo;
import com.shxy.xymanager_common.vo.SysUserUpdateVo; import com.shxy.xymanager_common.vo.SysUserUpdateVo;
import com.shxy.xymanager_common.vo.SysUserVo; import com.shxy.xymanager_common.vo.SysUserVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestParam;
/** /**
@ -118,9 +117,9 @@ public interface SysUserService {
ServiceBody<String> deleteUserById(@Param("userId") String userId); ServiceBody<String> deleteUserById(@Param("userId") String userId);
UserSession selectUserById(String sessionId); SysUserSession selectUserById(String sessionId);
int updateUserSession(UserSession user); int updateUserSession(SysUserSession user);
ServiceBody<SysUserModel> selectUserList(PageVo vo); ServiceBody<SysUserModel> selectUserList(PageVo vo);

@ -1,8 +1,5 @@
package com.shxy.xymanager_service.service; 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;
/** /**
* *
@ -10,18 +7,5 @@ import com.shxy.xymanager_common.vo.TerminalVo;
* @author * @author
*/ */
public interface TerminalParamsService { public interface TerminalParamsService {
/**
*
*
* @return
*/
ServiceBody<TerminalListModel> getTerminalList();
/**
*
*
* @return
*/
ServiceBody<String> addTerminal(TerminalVo terminalVo);
} }

@ -1,10 +1,8 @@
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.entity.TerminalPhoto;
import com.shxy.xymanager_common.model.*; import com.shxy.xymanager_common.model.*;
import com.shxy.xymanager_common.vo.*; import com.shxy.xymanager_common.vo.*;
import io.swagger.models.auth.In;
import java.util.Date; import java.util.Date;
@ -33,7 +31,7 @@ public interface TerminalPhotoService {
* *
* @return * @return
*/ */
ServiceBody<TerminalPhotoListForOpenModel> getPhotoListForOpen(TerminalAndTimeForOpenVo vo); ServiceBody<TerminalPhotoListForOpenModel> getPhotoListForOpen(OpenTerminalAndTimeVo vo);
/** /**
* id * id

@ -1,8 +1,5 @@
package com.shxy.xymanager_service.service; 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;
/** /**
* *
@ -10,18 +7,5 @@ import com.shxy.xymanager_common.vo.TerminalVo;
* @author * @author
*/ */
public interface TerminalPresetsService { public interface TerminalPresetsService {
/**
*
*
* @return
*/
ServiceBody<TerminalListModel> getTerminalList();
/**
*
*
* @return
*/
ServiceBody<String> addTerminal(TerminalVo terminalVo);
} }

@ -1,8 +1,5 @@
package com.shxy.xymanager_service.service; 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;
/** /**
* *
@ -10,18 +7,5 @@ import com.shxy.xymanager_common.vo.TerminalVo;
* @author * @author
*/ */
public interface TerminalScheduleService { public interface TerminalScheduleService {
/**
*
*
* @return
*/
ServiceBody<TerminalListModel> getScheduleList();
/**
*
*
* @return
*/
ServiceBody<String> addTerminal(TerminalVo terminalVo);
} }

@ -3,7 +3,6 @@ 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.TerminalIdListVo; import com.shxy.xymanager_common.vo.TerminalIdListVo;
import com.shxy.xymanager_common.vo.TerminalVo;
/** /**
* *
@ -18,13 +17,6 @@ public interface TerminalStatusService {
*/ */
ServiceBody<TerminalListModel> getTerminalList(); ServiceBody<TerminalListModel> getTerminalList();
/**
*
*
* @return
*/
ServiceBody<String> addTerminal(TerminalVo terminalVo);
/** /**
* *
* @param vo * @param vo

Loading…
Cancel
Save