Commit 238fd7d4 authored by wangjinjing's avatar wangjinjing

发布的版本

parent adf5dfe2
......@@ -94,7 +94,7 @@
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.11</version>
<version>8.0.27</version>
</dependency>
<dependency>
......@@ -178,6 +178,18 @@
<version>1.2.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.17.0</version>
</dependency>
</dependencies>
<repositories>
......
......@@ -6,8 +6,6 @@ import tk.mybatis.spring.annotation.MapperScan;
@SpringBootApplication
//@MapperScan("im.dx.system.mapper")
//@PropertySource("file:${spring.profiles.path}")
public class ShiroActionApplication {
public static void main(String[] args) {
SpringApplication.run(ShiroActionApplication.class, args);
......
......@@ -61,5 +61,9 @@ public class ScheduleTaskConfig {
}
}
// @Scheduled(cron = "0/16 * 1-18 * * ?")
private void st() {
log.info(new Date().toLocaleString());
}
}
......@@ -28,7 +28,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@ControllerAdvice
//@ControllerAdvice
public class WebExceptionHandler {
@Resource
......@@ -52,79 +52,79 @@ public class WebExceptionHandler {
@ExceptionHandler
public String unauthorized(NoHandlerFoundException e) {
if (log.isDebugEnabled()) {
log.debug("请求的地址不存在", e);
log.debug("请求的地址不存在", e);
}
return generateErrorInfo(ResultBean.FAIL, "请求的地址不存在", HttpStatus.NOT_FOUND.value());
return generateErrorInfo(ResultBean.FAIL, "请求的地址不存在", HttpStatus.NOT_FOUND.value());
}
@ExceptionHandler(value = {UnauthorizedException.class})
public String unauthorized(Exception e) {
if (log.isDebugEnabled()) {
log.debug("无权限");
log.debug("无权限");
}
return generateErrorInfo(ResultBean.FAIL, "无权限");
return generateErrorInfo(ResultBean.FAIL, "无权限");
}
@ExceptionHandler
public String unknownAccount(UnknownAccountException e) {
if (log.isDebugEnabled()) {
log.debug("账号不存在");
log.debug("账号不存在");
}
return generateErrorInfo(ResultBean.FAIL, "账号不存在");
return generateErrorInfo(ResultBean.FAIL, "账号不存在");
}
@ExceptionHandler
public String incorrectCredentials(IncorrectCredentialsException e) {
if (log.isDebugEnabled()) {
log.debug("密码错误");
log.debug("密码错误");
}
return generateErrorInfo(ResultBean.FAIL, "密码错误");
return generateErrorInfo(ResultBean.FAIL, "密码错误");
}
@ExceptionHandler
public String excessiveAttemptsException(ExcessiveAttemptsException e) {
if (log.isDebugEnabled()) {
log.debug("登录失败次数过多");
log.debug("登录失败次数过多");
}
return generateErrorInfo(ResultBean.FAIL, "登录失败次数过多, 请稍后再试");
return generateErrorInfo(ResultBean.FAIL, "登录失败次数过多, 请稍后再试");
}
@ExceptionHandler
public String lockedAccount(LockedAccountException e) {
if (log.isDebugEnabled()) {
log.debug("账号已锁定");
log.debug("账号已锁定");
}
return generateErrorInfo(ResultBean.FAIL, "账号已锁定");
return generateErrorInfo(ResultBean.FAIL, "账号已锁定");
}
@ExceptionHandler
public String lockedAccount(CaptchaIncorrectException e) {
if (log.isDebugEnabled()) {
log.debug("验证码错误");
log.debug("验证码错误");
}
return generateErrorInfo(ResultBean.FAIL, "验证码错误");
return generateErrorInfo(ResultBean.FAIL, "验证码错误");
}
@ExceptionHandler
public String lockedAccount(DuplicateNameException e) {
if (log.isDebugEnabled()) {
log.debug("用户名已存在");
log.debug("用户名已存在");
}
return generateErrorInfo(ResultBean.FAIL, "用户名已存在");
return generateErrorInfo(ResultBean.FAIL, "用户名已存在");
}
@ExceptionHandler
public String missingRequestParameter(MissingServletRequestParameterException e) {
if (log.isDebugEnabled()) {
log.debug("请求参数无效");
log.debug("请求参数无效");
}
return generateErrorInfo(ResultBean.FAIL, "请求参数缺失");
return generateErrorInfo(ResultBean.FAIL, "请求参数缺失");
}
@ExceptionHandler
public String methodArgumentNotValid(BindException e) {
if (log.isDebugEnabled()) {
log.debug("参数校验失败", e);
log.debug("参数校验失败", e);
}
List<ObjectError> allErrors = e.getBindingResult().getAllErrors();
StringBuilder errorMessage = new StringBuilder();
......@@ -140,19 +140,19 @@ public class WebExceptionHandler {
@ExceptionHandler
public String all(Exception e) {
String msg = e.getMessage() == null ? "系统出现异常" : e.getMessage();
String msg = e.getMessage() == null ? "系统出现异常" : e.getMessage();
log.error(msg, e);
generateErrorInfo(ResultBean.FAIL, msg, HttpStatus.INTERNAL_SERVER_ERROR.value());
return "forward:/error";
}
/**
* 生成错误信息, 放到 request 域中.
* 生成错误信息, 放到 request 域中.
*
* @param code 错误码
* @param msg 错误信息
* @param httpStatus HTTP 状态码
* @return SpringBoot 默认提供的 /error Controller 处理器
* @param code 错误码
* @param msg 错误信息
* @param httpStatus HTTP 状态码
* @return SpringBoot 默认提供的 /error Controller 处理器
*/
private String generateErrorInfo(int code, String msg, int httpStatus) {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
......@@ -164,14 +164,14 @@ public class WebExceptionHandler {
/**
* 捕获 ClientAbortException 异常, 不做任何处理, 防止出现大量堆栈日志输出, 此异常不影响功能.
* 捕获 ClientAbortException 异常, 不做任何处理, 防止出现大量堆栈日志输出, 此异常不影响功能.
*/
@ExceptionHandler({HttpMediaTypeNotAcceptableException.class, ClientAbortException.class})
@ResponseBody
@ResponseStatus
public void clientAbortException(Exception ex) {
if (log.isDebugEnabled()) {
log.debug("出现了断开异常:", ex);
log.debug("出现了断开异常:", ex);
}
}
......
......@@ -3,13 +3,9 @@ package im.dx.common.shiro;
import im.dx.common.constants.AuthcTypeEnum;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
@Component
@ConfigurationProperties(prefix = "shiro-action")
......@@ -80,27 +76,27 @@ public class ShiroActionProperties {
this.permsCacheTimeout = permsCacheTimeout;
}
@PostConstruct
public void validate() {
Set<String> set = new HashSet<>();
for (Provider provider : this.oauth2Provider.values()) {
// ClientId 不能为空
if (!StringUtils.hasText(provider.getClientId())) {
throw new IllegalStateException("Client id must not be empty.");
}
// ClientSecret 不能为空
if (!StringUtils.hasText(provider.getClientSecret())) {
throw new IllegalStateException("Client secret must not be empty.");
}
// 回调地址不能重复.
if (!set.add(provider.redirectUrl)) {
throw new IllegalStateException("redirectUrl must not be duplicate.");
}
}
}
// @PostConstruct
// public void validate() {
// Set<String> set = new HashSet<>();
//
// for (Provider provider : this.oauth2Provider.values()) {
// // ClientId 不能为空
// if (!StringUtils.hasText(provider.getClientId())) {
// throw new IllegalStateException("Client id must not be empty.");
// }
//
// // ClientSecret 不能为空
// if (!StringUtils.hasText(provider.getClientSecret())) {
// throw new IllegalStateException("Client secret must not be empty.");
// }
//
// // 回调地址不能重复.
// if (!set.add(provider.redirectUrl)) {
// throw new IllegalStateException("redirectUrl must not be duplicate.");
// }
// }
// }
public static class Provider {
private String clientId;
......
package im.dx.system.controller;
import com.github.pagehelper.PageInfo;
import im.dx.common.annotation.OperationLog;
import im.dx.common.util.PageResultBean;
import im.dx.common.util.ResultBean;
import im.dx.system.model.Code;
......@@ -20,7 +19,12 @@ public class CodeController {
@Resource
private CodeService codeService;
@OperationLog("获取code列表")
/***
* 获取code列表
* @param page
* @param limit
* @return
*/
@GetMapping("/list")
@ResponseBody
public PageResultBean<Code> getList(@RequestParam(value = "page", defaultValue = "1") int page,
......@@ -30,30 +34,47 @@ public class CodeController {
return new PageResultBean<>(userPageInfo.getTotal(), userPageInfo.getList());
}
@OperationLog("获取指定type的code列表")
/***
* 获取指定type的code列表
* @param typeid
* @return
*/
@GetMapping("/list/{typeid}")
@ResponseBody
public ResultBean getList(@PathVariable("typeid") String typeid) {
List<Code> codes = codeService.selectAllWithType(typeid);
return ResultBean.success(codes);
};
}
@OperationLog("更新code")
/**
* 更新code
* @param codelist
* @return
*/
@PostMapping("/update")
public ResultBean update(@RequestBody List<Code> codelist) {
int result = codeService.updatecode(codelist);
return ResultBean.success();
}
@OperationLog("新增")
/***
* 新增
* @param codelist
* @return
*/
@PostMapping("/add")
public ResultBean add(@RequestBody List<Code> codelist) {
int result = codeService.addcode(codelist);
return ResultBean.success();
}
@OperationLog("新增videoalarm")
/***
* 新增videoalarm
* @param videoeRecordType
* @return
*/
@PostMapping("/addvideoeRecordType")
public ResultBean VideoeRecordType(@RequestBody VideoeRecordType videoeRecordType) {
//判断存不存在
......@@ -65,16 +86,19 @@ public class CodeController {
return ResultBean.success();
}
@OperationLog("更新用户列表")
@GetMapping("/codetest")
/***
* 更新用户列表
*/
public void test() {
List<Code> codes = codeService.selectAllWithKey(1, 10);
}
@OperationLog("更新code time")
/**
* 更新code time
* @param codelist
* @return
*/
@PostMapping("/updatetime")
public ResultBean updatetime(@RequestBody List<Code> codelist) {
......@@ -82,14 +106,22 @@ public class CodeController {
return ResultBean.success();
}
@OperationLog("禁用账号")
/***
* 禁用账号
* @param codeId
* @return
*/
@PostMapping("/{codeId}/disable")
@ResponseBody
public ResultBean disable(@PathVariable("codeId") String codeId) {
return ResultBean.success(codeService.disableCodeByCodeID(codeId));
}
@OperationLog("激活账号")
/***
* 激活账号
* @param codeId
* @return
*/
@PostMapping("/{codeId}/enable")
@ResponseBody
public ResultBean enable(@PathVariable("codeId") String codeId) {
......
package im.dx.system.controller;
import im.dx.common.annotation.OperationLog;
import im.dx.common.shiro.ShiroActionProperties;
import im.dx.common.util.ResultBean;
import im.dx.common.util.TreeUtil;
......@@ -39,7 +38,11 @@ public class DeptController {
return "dept/dept-list";
}
@OperationLog("获取部门列表")
/***
* 获取部门列表
* @param parentId
* @return
*/
@GetMapping("/list")
@ResponseBody
public ResultBean getList(@RequestParam(value="parentId",required = false) Integer parentId) {
......@@ -68,7 +71,11 @@ public class DeptController {
return "dept/dept-add";
}
@OperationLog("新增部门")
/***
* 新增部门
* @param dept
* @return
*/
@ResponseBody
@RequestMapping(value = "/add", method = RequestMethod.POST)
public ResultBean add(Dept dept) {
......@@ -81,7 +88,11 @@ public class DeptController {
return ResultBean.success(deptService.insert(dept));
}
@OperationLog("删除部门")
/***
* 删除部门
* @param deptId
* @return
*/
@DeleteMapping("/{deptId}")
@ResponseBody
public ResultBean delete(@PathVariable("deptId") Integer deptId) {
......@@ -89,7 +100,11 @@ public class DeptController {
return ResultBean.success();
}
@OperationLog("修改部门")
/***
* 修改部门
* @param dept
* @return
*/
@ResponseBody
@RequestMapping(value = "/update", method = RequestMethod.POST)
public ResultBean update(Dept dept) {
......@@ -113,7 +128,13 @@ public class DeptController {
return ResultBean.success(dept);
}
@OperationLog("调整部门排序")
/***
* 调整部门排序
* @param currentId
* @param swapId
* @return
*/
@PostMapping("/swap")
@ResponseBody
public ResultBean swapSort(Integer currentId, Integer swapId) {
......@@ -121,8 +142,13 @@ public class DeptController {
return ResultBean.success();
}
@OperationLog("查询部门及監控")
/***
* 查询部门及監控
* @param deptId
* @param username
* @param tdmc
* @return
*/
@GetMapping("/listvideo")
@ResponseBody
public ResultBean listvideo( @RequestParam("deptId") String deptId,@RequestParam("username") String username,@RequestParam("tdmc")String tdmc) {
......@@ -135,8 +161,13 @@ public class DeptController {
return ResultBean.success(deptlist);
}
@OperationLog("查询部门及監控")
/***
* 查询部门及監控
* @param deptId
* @param username
* @param tdmc
* @return
*/
@GetMapping("/listvideotree")
@ResponseBody
public ResultBean listvideotree( @RequestParam("deptId") String deptId,@RequestParam("username") String username,@RequestParam("tdmc")String tdmc) {
......@@ -150,9 +181,12 @@ public class DeptController {
return ResultBean.success(list);
}
@OperationLog("查询部门及其子節點")
/***
* 查询部门及其子节点
* @param deptId
* @param username
* @return
*/
@GetMapping("/listChildDept")
@ResponseBody
public ResultBean listChildDept( @RequestParam("deptId") Integer deptId,@RequestParam("username") String username) {
......@@ -165,7 +199,12 @@ public class DeptController {
return ResultBean.success(deptlist);
}
@OperationLog("更新部門默認監控")
/***
* 更新部门默认监控
* @param deptId
* @param videoId
* @return
*/
@PostMapping("/updateDefaultVideo")
@ResponseBody
public ResultBean updateDefaultVideo( @RequestParam("deptId") String deptId,@RequestParam("videoId") String videoId) {
......@@ -177,16 +216,12 @@ public class DeptController {
}
}
@OperationLog("查詢部門默認監控")
@GetMapping("/queryDefaultVideoId")
@ResponseBody
public ResultBean queryDefaultVideo( @RequestParam("deptId") String deptId) {
return ResultBean.success(deptService.selectDefaultVideoByDeptId(deptId));
}
/***
* 查询所有部门默认监控
* @param deptId
* @return
*/
@OperationLog("查詢所有部門默認監控")
@GetMapping("/queryAllDefaultVideo")
@ResponseBody
public ResultBean queryAllDefaultVideo( @RequestParam("deptId") String deptId) {
......@@ -195,26 +230,11 @@ public class DeptController {
}
@OperationLog("新增部門默認監控")
@PostMapping("/insertDefaultVideo")
@ResponseBody
public ResultBean insertDefaultVideo( @RequestParam("deptId") String deptId,
@RequestParam("videoId[]") List<String> videoId) {
for(String videoid:videoId)
{
//判断是否存在
int result= deptService.selectExistsDefaultVideo(deptId,videoid);
if(result==0){
deptService.insertDefaultVideo(deptId,videoid);
}
}
return ResultBean.success();
}
@OperationLog("查询所有监控")
/**
* 查询所有监控
* @param deptid
* @return
*/
@GetMapping("/listAllvideoIdsByDeptid")
@ResponseBody
public ResultBean listAllvideoIdsByDeptid(@RequestParam("deptid") String deptid) {
......
package im.dx.system.controller;
import com.github.pagehelper.PageInfo;
import im.dx.common.annotation.OperationLog;
import im.dx.common.shiro.ShiroActionProperties;
import im.dx.common.util.PageResultBean;
import im.dx.common.util.ResultBean;
......@@ -43,7 +42,11 @@ public class DeptTreeController {
return "dept/dept-list";
}
@OperationLog("获取部门列表")
/***
* 获取部门列表
* @param parentId
* @return
*/
@GetMapping("/list")
@ResponseBody
public ResultBean getList(@RequestParam(required = false) String parentId) {
......@@ -54,13 +57,17 @@ public class DeptTreeController {
@GetMapping("/tree/root")
@ResponseBody
public ResultBean treeAndRoot() {
return ResultBean.success(deptTreeService.selectAllDeptTreeAndRoot());
return
ResultBean.success(deptTreeService.selectAllDeptTreeAndRoot());
}
@GetMapping("/tree")
@ResponseBody
public ResultBean tree() {
return ResultBean.success( TreeUtil.toTree(deptTreeService.selectAllDeptTree("0"),"deptId","parentId","children",DeptTree.class,"0"));
return ResultBean.success(
TreeUtil.toTree(deptTreeService.selectAllDeptTree("0"),
"deptId","parentId","children",
DeptTree.class,"0"));
}
@GetMapping("/alltree")
@ResponseBody
......@@ -68,10 +75,16 @@ public class DeptTreeController {
return ResultBean.success( deptTreeService.selectAllDeptTree("0"));
}
@GetMapping("/videotree/{deptId}")
@GetMapping("/videotree/{deptId}/{username}")
@ResponseBody
public ResultBean videotree(@PathVariable("deptId") String deptId) {
List<DeptTree> dept= deptTreeService.selectAllVideoTree("0");
public ResultBean videotree(@PathVariable("deptId") String deptId,@PathVariable("username") String username) {
if (null!=username && shiroActionProperties.getSuperAdminUsername().equals(username)) {
deptId = "0";
username=null;
}
List<DeptTree> dept= deptTreeService.selectAllVideoTree(deptId,username);
return ResultBean.success(TreeUtil.toTree(dept,"deptId","parentId","children",DeptTree.class,"0"));
}
......@@ -95,7 +108,11 @@ public class DeptTreeController {
// return ResultBean.success(deptTreeService.insert(dept));
// }
@OperationLog("删除部门")
/***
* 删除部门
* @param deptId
* @return
*/
@DeleteMapping("/{deptId}")
@ResponseBody
public ResultBean delete(@PathVariable("deptId") String deptId) {
......@@ -103,7 +120,11 @@ public class DeptTreeController {
return ResultBean.success();
}
@OperationLog("修改部门")
/***
* 修改部门
* @param dept
* @return
*/
@PutMapping
@ResponseBody
public ResultBean update(DeptTree dept) {
......@@ -119,7 +140,12 @@ public class DeptTreeController {
return "dept/dept-add";
}
@OperationLog("调整部门排序")
/***
* 调整部门排序
* @param currentId
* @param swapId
* @return
*/
@PostMapping("/swap")
@ResponseBody
public ResultBean swapSort(Integer currentId, Integer swapId) {
......@@ -127,7 +153,12 @@ public class DeptTreeController {
return ResultBean.success();
}
@OperationLog("获取部门列表")
/***
* 获取部门列表
* @param parentId
* @param username
* @return
*/
@GetMapping("/listByUsername")
@ResponseBody
public ResultBean listByUsername(@RequestParam(required = false) String parentId,String username) {
......@@ -138,7 +169,11 @@ public class DeptTreeController {
return ResultBean.success(deptList);
}
@OperationLog("获取角色所管辖事件监控")
/**
* 获取角色所管辖事件监控
* @param userID
* @return
*/
@GetMapping("/listeventByvideoid/{userID}")
@ResponseBody
public ResultBean listeventByvideoid(@PathVariable("userID") String userID) {
......@@ -147,7 +182,13 @@ public class DeptTreeController {
return ResultBean.success(eventids);
}
@OperationLog("获取监控控制的事件")
/***
* 获取监控控制的事件
* @param parentId
* @param page
* @param limit
* @return
*/
@GetMapping("/recordtype/list")
@ResponseBody
public PageResultBean<Map> getrecordtypeList(@RequestParam(required = false) String parentId,
......@@ -160,7 +201,13 @@ public class DeptTreeController {
PageInfo<Map> rolePageInfo = new PageInfo<>(menuList);
return new PageResultBean<>(rolePageInfo.getTotal(), rolePageInfo.getList());
}
@OperationLog("删除监控控制的事件")
/***
* 删除监控控制的事件
* @param taskno
* @param status
* @return
*/
@GetMapping("/delvideorecord/{taskno}/{status}")
@ResponseBody
public TaskResultObj delvideorecord(@PathVariable("taskno") String taskno,@PathVariable("status") String status) {
......
package im.dx.system.controller;
import im.dx.common.util.DateUtils;
import im.dx.system.model.Menu;
import im.dx.system.service.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
......@@ -41,9 +31,6 @@ public class IndexController {
@Resource
private RoleService roleService;
@Resource
private SysLogService sysLogService;
@Resource
private UserOnlineService userOnlineService;
......@@ -142,6 +129,12 @@ public class IndexController {
model.addAttribute("menus", menuTreeVOS);
return "page/manualscreen";
}
@GetMapping(value = {"/xxtj"})
public String xxtj(Model model) {
List<Menu> menuTreeVOS = menuService.selectCurrentUserMenuTree();
model.addAttribute("menus", menuTreeVOS);
return "page/xxtj";
}
@GetMapping(value = {"/symrjk"})
......
package im.dx.system.controller;
import cn.hutool.core.util.IdUtil;
import im.dx.common.annotation.OperationLog;
import im.dx.common.shiro.ShiroActionProperties;
import im.dx.common.util.CaptchaUtil;
import im.dx.common.util.DateUtils;
import im.dx.common.util.ResultBean;
import im.dx.system.model.ResultObj;
......@@ -11,7 +8,6 @@ import im.dx.system.model.User;
import im.dx.system.service.UserService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
......@@ -21,16 +17,10 @@ import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.thymeleaf.TemplateEngine;
import javax.annotation.Resource;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
@Controller
public class LoginController {
......@@ -73,15 +63,21 @@ public class LoginController {
return ResultBean.success(cuser);
}
@OperationLog("注销")
/***
* 注销
* @return
*/
@GetMapping("/logout")
public String logout() {
SecurityUtils.getSubject().logout();
return "redirect:login";
}
@OperationLog("用户账号查询权限")
/***
* 用户账号查询权限
* @param username
* @return
*/
@PostMapping("/firstmenu")
@ResponseBody
public ResultBean firstmenu(String username) {
......@@ -95,7 +91,12 @@ public class LoginController {
return ResultBean.success();
}
@OperationLog("用户账号查询权限")
/***
* 用户账号查询权限
* @param menuid
* @param username
* @return
*/
@PostMapping("/secondmenu")
@ResponseBody
public ResultBean firstmenu(Integer menuid,String username) {
......
package im.dx.system.controller;
import com.github.pagehelper.PageInfo;
import im.dx.common.annotation.OperationLog;
import im.dx.common.util.PageResultBean;
import im.dx.system.model.LoginLog;
import im.dx.system.service.LoginLogService;
......@@ -26,7 +25,12 @@ public class LoginLogController {
return "log/login-logs";
}
@OperationLog("查看登录日志")
/***
* 查看登录日志
* @param page
* @param limit
* @return
*/
@GetMapping("/list")
@ResponseBody
public PageResultBean<LoginLog> getList(@RequestParam(value = "page", defaultValue = "1") int page,
......
package im.dx.system.controller;
import im.dx.common.annotation.OperationLog;
import im.dx.common.annotation.RefreshFilterChain;
import im.dx.common.util.ResultBean;
import im.dx.system.model.Menu;
......@@ -26,7 +25,12 @@ public class MenuController {
return "menu/menu-list";
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@OperationLog("获取菜单列表")
/***
* 获取菜单列表
* @param parentId
* @return
*/
@GetMapping("/list")
@ResponseBody
public ResultBean getList(@RequestParam(required = false) Integer parentId) {
......@@ -57,7 +61,11 @@ public class MenuController {
return ResultBean.success(menuService.getALLMenuAndCountOperatorTreeAndRoot());
}
@OperationLog("新增菜单")
/**
* 新增菜单
* @param menu
* @return
*/
@RefreshFilterChain
@PostMapping
@ResponseBody
......@@ -68,7 +76,11 @@ public class MenuController {
return ResultBean.success();
}
@OperationLog("删除菜单")
/***
* 删除菜单
* @param menuId
* @return
*/
@RefreshFilterChain
@DeleteMapping("/{menuId}")
@ResponseBody
......@@ -84,7 +96,12 @@ public class MenuController {
return "menu/menu-add";
}
@OperationLog("修改菜单")
/***
* 修改菜单
* @param menu
* @return
*/
@RefreshFilterChain
@PutMapping
@ResponseBody
......@@ -94,7 +111,12 @@ public class MenuController {
return ResultBean.success();
}
@OperationLog("调整部门排序")
/***
* 调整部门排序
* @param currentId
* @param swapId
* @return
*/
@PostMapping("/swap")
@ResponseBody
public ResultBean swapSort(Integer currentId, Integer swapId) {
......
package im.dx.system.controller;
import im.dx.common.annotation.OperationLog;
import im.dx.common.constants.AuthcTypeEnum;
import im.dx.common.shiro.OAuth2Helper;
import im.dx.common.util.ResultBean;
......@@ -8,7 +7,6 @@ import im.dx.common.util.ShiroUtil;
import im.dx.system.model.UserAuths;
import im.dx.system.model.vo.OAuth2VO;
import im.dx.system.service.UserAuthsService;
import me.zhyd.oauth.request.AuthRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -16,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
......@@ -30,34 +27,15 @@ public class OAuth2Controller {
@Resource
private UserAuthsService userAuthsService;
/**
* 生成 Github 授权地址
*/
@OperationLog("Github OAuth2 登录")
@GetMapping("/render/github")
@ResponseBody
public ResultBean renderGithubAuth(HttpServletResponse response) {
AuthRequest authRequest = oAuth2Helper.getAuthRequest(AuthcTypeEnum.GITHUB);
return ResultBean.successData(authRequest.authorize());
}
/**
* 生成 Gitee 授权地址
*/
@OperationLog("Gitee OAuth2 登录")
@GetMapping("/render/gitee")
@ResponseBody
public ResultBean renderGiteeAuth(HttpServletResponse response) {
AuthRequest authRequest = oAuth2Helper.getAuthRequest(AuthcTypeEnum.GITEE);
return ResultBean.successData(authRequest.authorize());
}
@GetMapping("/index")
public String index() {
return "oauth2/oauth2-list";
}
@OperationLog("获取账号绑定信息")
/***
* 获取账号绑定信息
* @return
*/
@GetMapping("/list")
@ResponseBody
public ResultBean list() {
......@@ -80,9 +58,8 @@ public class OAuth2Controller {
}
/**
* 取消授权
* 取消账号绑定
*/
@OperationLog("取消账号绑定")
@GetMapping("/revoke/{provider}")
@ResponseBody
public Object revokeAuth(@PathVariable("provider") AuthcTypeEnum provider) {
......
package im.dx.system.controller;
import im.dx.common.annotation.OperationLog;
import im.dx.common.annotation.RefreshFilterChain;
import im.dx.common.util.ResultBean;
import im.dx.system.model.Operator;
......@@ -19,7 +18,10 @@ public class OperatorController {
@Resource
private OperatorService operatorService;
@OperationLog("查看操作日志")
/***
* 查看操作日志
* @return
*/
@GetMapping("/index")
public String index() {
return "operator/operator-list";
......
package im.dx.system.controller;
import com.github.pagehelper.PageInfo;
import im.dx.common.annotation.OperationLog;
import im.dx.common.util.PageResultBean;
import im.dx.common.util.ResultBean;
import im.dx.common.util.TreeUtil;
import im.dx.system.model.Role;
import im.dx.system.model.TaskParams;
import im.dx.system.model.UserRoleTree;
import im.dx.system.service.RoleService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
......@@ -28,7 +25,13 @@ public class RoleController {
return "role/role-list";
}
@OperationLog("查询角色列表")
/**
* 查询角色列表
* @param page
* @param limit
* @param roleQuery
* @return
*/
@GetMapping("/list")
@ResponseBody
public PageResultBean<Role> getList(@RequestParam(value = "page", defaultValue = "1") int page,
......@@ -44,7 +47,11 @@ public class RoleController {
return "role/role-add";
}
@OperationLog("新增角色")
/**
* 新增角色
* @param role
* @return
*/
@PostMapping
@ResponseBody
public ResultBean add(Role role) {
......@@ -59,7 +66,11 @@ public class RoleController {
return "role/role-add";
}
@OperationLog("修改角色")
/**
* 修改角色
* @param role
* @return
*/
@PutMapping
@ResponseBody
public ResultBean update(Role role) {
......@@ -67,8 +78,11 @@ public class RoleController {
return ResultBean.success();
}
@OperationLog("删除角色")
/***
* 删除角色
* @param roleId
* @return
*/
@DeleteMapping("/{roleId}")
@ResponseBody
public ResultBean delete(@PathVariable("roleId") Integer roleId) {
......@@ -76,7 +90,12 @@ public class RoleController {
return ResultBean.success();
}
@OperationLog("为角色授予菜单")
/***
* 为角色授予菜单
* @param roleId
* @param menuIds
* @return
*/
@PostMapping("/{roleId}/grant/menu")
@ResponseBody
public ResultBean grantMenu(@PathVariable("roleId") Integer roleId, @RequestParam(value = "menuIds[]", required = false) Integer[] menuIds) {
......@@ -84,8 +103,12 @@ public class RoleController {
return ResultBean.success();
}
@OperationLog("为角色授予操作权限")
/***
* 为角色授予操作权限
* @param roleId
* @param operatorIds
* @return
*/
@PostMapping("/{roleId}/grant/operator")
@ResponseBody
public ResultBean grantOperator(@PathVariable("roleId") Integer roleId, @RequestParam(value = "operatorIds[]", required = false) Integer[] operatorIds) {
......@@ -115,8 +138,12 @@ public class RoleController {
return ResultBean.success(operatorIds);
}
@OperationLog("为角色授予菜单")
/***
* 为角色授予菜单
* @param roleId
* @param videorecordIds
* @return
*/
@PostMapping("/{roleId}/grant/videorecord")
@ResponseBody
public ResultBean grantVideorecord(@PathVariable("roleId") Integer roleId, @RequestParam(value = "videorecordIds[]", required = false) String[] videorecordIds) {
......@@ -124,14 +151,22 @@ public class RoleController {
return ResultBean.success();
}
@OperationLog("查询角色用户树形数据")
/***
* 查询角色用户树形数据
* @return
*/
@GetMapping("/listAllUsers")
@ResponseBody
public ResultBean listAllUsers() {
return ResultBean.success(roleService.queryRoleUserTree());
}
@OperationLog("给用户添加任务")
/***
* 给用户添加任务
* @param taskParams
* @return
*/
@PostMapping("/addtaskinfo")
@ResponseBody
public ResultBean addtaskinfo(@RequestBody TaskParams taskParams) {
......
package im.dx.system.controller;
import com.github.pagehelper.PageInfo;
import im.dx.common.annotation.OperationLog;
import im.dx.common.util.PageResultBean;
import im.dx.common.util.ResultBean;
import im.dx.common.validate.groups.Create;
......@@ -43,7 +42,13 @@ public class UserController {
return "user/user-send";
}
@OperationLog("获取用户列表")
/***
* 获取用户列表
* @param page
* @param pageSize
* @param userQuery
* @return
*/
@GetMapping("/list")
@ResponseBody
public PageResultBean<User> getList(@RequestParam(value = "page", defaultValue = "1") int page,
......@@ -54,7 +59,14 @@ public class UserController {
return new PageResultBean<>(userPageInfo.getTotal(), userPageInfo.getList());
}
@OperationLog("根據部門获取用户列表")
/***
* 根據部門获取用户列表
* @param page
* @param pageSize
* @param deptId
* @param userName
* @return
*/
@GetMapping("/list/userByDeptId")
@ResponseBody
public PageResultBean<User> getList(@RequestParam(value = "page", defaultValue = "1") int page,
......@@ -83,7 +95,12 @@ public class UserController {
return "user/user-add";
}
@OperationLog("编辑角色")
/***
* 编辑角色
* @param user
* @param roleIds
* @return
*/
@PutMapping
@ResponseBody
public ResultBean putupdate(@Valid User user, @RequestParam(value = "role[]", required = false) Integer[] roleIds) {
......@@ -91,8 +108,12 @@ public class UserController {
return ResultBean.success();
}
@OperationLog("编辑角色")
/***
* 编辑角色
* @param user
* @param roleIds
* @return
*/
@PostMapping("/edit")
@ResponseBody
public ResultBean update(@Valid User user, @RequestParam(value = "role[]", required = false) Integer[] roleIds) {
......@@ -101,7 +122,13 @@ public class UserController {
return ResultBean.success();
}
@OperationLog("新增用户")
/***
* 新增用户
* @param user
* @param roleIds
* @return
*/
@PostMapping
@ResponseBody
public ResultBean adduser(@Validated(Create.class) User user, @RequestParam(value = "role[]", required = false) Integer[] roleIds) {
......@@ -110,7 +137,12 @@ public class UserController {
return ResultBean.success(userService.add(user, roleIds));
}
@OperationLog("新增用户")
/***
* 新增用户
* @param user
* @param roleIds
* @return
*/
@PostMapping("/add")
@ResponseBody
public ResultBean add(@Validated(Create.class) User user, @RequestParam(value = "role[]", required = false) Integer[] roleIds) {
......@@ -119,21 +151,34 @@ public class UserController {
return ResultBean.success(userService.add(user, roleIds));
}
@OperationLog("禁用账号")
/***
* 禁用账号
* @param userId
* @return
*/
@PostMapping("/{userId:\\d+}/disable")
@ResponseBody
public ResultBean disable(@PathVariable("userId") Integer userId) {
return ResultBean.success(userService.disableUserByID(userId));
}
@OperationLog("激活账号")
/**
* 激活账号
* @param userId
* @return
*/
@PostMapping("/{userId}/enable")
@ResponseBody
public ResultBean enable(@PathVariable("userId") Integer userId) {
return ResultBean.success(userService.enableUserByID(userId));
}
@OperationLog("删除账号")
/***
* 删除账号
* @param userId
* @return
*/
@DeleteMapping("/{userId}")
@ResponseBody
public ResultBean delete(@PathVariable("userId") Integer userId) {
......@@ -147,9 +192,13 @@ public class UserController {
return "user/user-reset-pwd";
}
/***
* 重置密码
* @param userId
* @param password
* @return
*/
@OperationLog("重置密码")
@PostMapping("/{userId}/reset")
@ResponseBody
public ResultBean resetPassword(@PathVariable("userId") Integer userId, String password) {
......@@ -160,7 +209,12 @@ public class UserController {
return ResultBean.error("");
}
@OperationLog("重置密码")
/**
* 重置密码
* @param user
* @param newpwd
* @return
*/
@PostMapping("/myreset/{newpwd}")
@ResponseBody
public ResultBean resetPassword(User user, @PathVariable("newpwd") String newpwd) {
......
......@@ -21,22 +21,11 @@ import java.util.concurrent.*;
@Slf4j
public class UserOnlineController {
@Value("${ipurl}")
String ipurl;
@Autowired
private RestTemplate restTemplate;
@Resource
private UserOnlineService userOnlineService;
private static CompletionService<String> completionService = new ExecutorCompletionService<String>(ThreadPoolUtil.getPool());
@GetMapping("/index")
public String index() {
return "online/user-online-list";
}
@GetMapping("/list")
@ResponseBody
......@@ -45,12 +34,6 @@ public class UserOnlineController {
return new PageResultBean<>(list.size(), list);
}
@PostMapping("/kickout")
@ResponseBody
public ResultBean forceLogout(String sessionId) {
userOnlineService.forceLogout(sessionId);
return ResultBean.success();
}
}
......@@ -22,7 +22,7 @@ public interface DeptTreeMapper {
List<DeptTree> selectByParentId(@Param("parentId") String parentId);
List<DeptTree> selectAllTree(@Param("parent_id")String parent_id);
List<DeptTree> selectAllVideoTree(@Param("parent_id")String parent_id);
List<DeptTree> selectAllVideoTree(@Param("parent_id")String parent_id,@Param("username")String username );
List<String> selectChildrenIDByPrimaryKey(@Param("deptId") String deptId);
......
package im.dx.system.mapper;
import com.sun.tracing.dtrace.ModuleAttributes;
import im.dx.system.model.DeviceChannelid;
import im.dx.system.model.Traffalarmrecord;
import im.dx.system.model.TraffalarmrecordResult;
......
......@@ -23,9 +23,13 @@ public interface TrafficStatisticsMapper {
List<TraffpictureParam> queryTraffalarmrecordByPage(Map map);
List<TraffpictureParam> queryTaskInfoByPage(Map map);
int updateTraffalarmrecordById(@Param(value = "list") List<TraffpictureParam> recordlist);
int updateDisputesInfo(@Param(value = "list") List<TraffpictureParam> recordlist);
List<RecordResult> todaytraffRecords(Map map);
public List<Map> todaythbtraffRecords(Map map);
......@@ -39,10 +43,11 @@ public interface TrafficStatisticsMapper {
List<Traffalarmrecordstate> selecteventresultBypage(TraffalarmrecordstatParams params);
int deleteTraffalarmrecordById(String recordid);
int deleteTraffalarmrecordById(String recordid);
int updateTraffalarmrecordPushStatusById(String recordid);
int updateTraffalarmrecordPushStatusById(String recordid);
int deleteTraffalarmrecordByIds(String recordid);
int deleteTraffalarmrecordByIds(String recordid);
List<Pedestrian> queryTraffPedeDetail(String id);
......@@ -53,5 +58,13 @@ public interface TrafficStatisticsMapper {
List<PeopleRideBicyc> queryTraffPeopleRideBicycDetail(String id);
int delTraffalarmrecordByIds(@Param(value = "list") List<TraffpictureParam> recordlist);
int delDisputesInfo(@Param(value = "list") List<TraffpictureParam> recordlist);
int deltaskinfoByIds(@Param(value = "list") List<TraffpictureParam> recordlist);
List<StatisticsData> eventStatistics(StatisticsParam statisticsParam);
List<StatisticsData> deviceStatistics(StatisticsParam statisticsParam);
List<StatisticsData> departmentEventStatistics(StatisticsParam statisticsParam);
List<Map> sendInfoStatistics(StatisticsParam statisticsParam);
}
\ No newline at end of file
......@@ -10,7 +10,9 @@ import java.util.List;
@Mapper
public interface VideoMapper {
List<Video> selectByMutiParam(@Param("deptId")String deptId,@Param("videoName")String videoName);
List<Video> selectByMutiParam(@Param("deptId")String deptId,
@Param("userId")String userId,
@Param("videoName")String videoName);
int insert(Sbtdspsr video);
void delete(String id);
void updateByPrimaryKey(Sbtdspsr video);
......
......@@ -58,6 +58,15 @@ public class DeptVideo implements Serializable {
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<DeptVideo> nodes;
private Integer vels;
private String idsets;
public String getIdsets() {
return idsets;
}
public void setIdsets(String idsets) {
this.idsets = idsets;
}
public String getDeptId() {
return deptId;
......
......@@ -4,29 +4,29 @@ package im.dx.system.model;
import lombok.Getter;
/**
* 通用返回值 枚举类
* 通用返回值 枚举类
* @author cp
*/
@Getter
public enum ResponseEnum {
/* 错误信息 */
E_1000(1000, "返回值必须为PageResult"),
E_1001(1001, "必须传递分页参数"),
E_1002(1002, "参数值异常"),
E_1003(1003, "参数值转换异常"),
E_1004(1004, "参数值为空"),
/* 保存 更新 重置 删除 等 */
E_1005(1005,"更新失败"),
E_1006(1006,"无结果"),
E_1007(1007,"未登录"),
E_1008(1008,"请求超时"),
E_1009(1009,"请求下游服务异常"),
E_1010(1010,"数据保存失败"),
E_1011(1011,"数据重复"),
E_9999(9999,"系统异常"),
SUCCESS(200,"请求成功");
/* 错误信息 */
E_1000(1000, "返回值必须为PageResult"),
E_1001(1001, "必须传递分页参数"),
E_1002(1002, "参数值异常"),
E_1003(1003, "参数值转换异常"),
E_1004(1004, "参数值为空"),
/* 保存 更新 重置 删除 等 */
E_1005(1005,"更新失败"),
E_1006(1006,"无结果"),
E_1007(1007,"未登录"),
E_1008(1008,"请求超时"),
E_1009(1009,"请求下游服务异常"),
E_1010(1010,"数据保存失败"),
E_1011(1011,"数据重复"),
E_9999(9999,"系统异常"),
SUCCESS(200,"请求成功");
private int code;
......
......@@ -8,31 +8,31 @@ import lombok.Setter;
import java.util.List;
/**
* 自定义响应结构
* 自定义响应结构
* @author cp
*/
@Getter
@Setter
public class ResultObj {
// 定义jackson对象
// 定义jackson对象
private static final ObjectMapper MAPPER = new ObjectMapper();
/**
* 响应业务状态
* 200 成功
* 201 错误
* 400 参数错误
* 响应业务状态
* 200 成功
* 201 错误
* 400 参数错误
*/
private Integer status;
/**
* 响应消息
* 响应消息
*/
private String msg;
/**
* 响应中的数据
* 响应中的数据
*/
private Object data;
......@@ -70,11 +70,11 @@ public class ResultObj {
/**
* 将json结果集转化为SysResult对象
* 将json结果集转化为SysResult对象
*
* @param jsonData json数据
* @param clazz SysResult中的object类型
* @return SysResult对象
* @param jsonData json数据
* @param clazz SysResult中的object类型
* @return SysResult对象
*/
public static ResultObj formatToPojo(String jsonData, Class<?> clazz) {
try {
......@@ -97,10 +97,10 @@ public class ResultObj {
}
/**
* 没有object对象的转化
* 没有object对象的转化
*
* @param json 字符串
* @return SysResult对象
* @param json 字符串
* @return SysResult对象
*/
public static ResultObj format(String json) {
try {
......@@ -112,11 +112,11 @@ public class ResultObj {
}
/**
* Object是集合转化
* Object是集合转化
*
* @param jsonData json数据
* @param clazz 集合中的类型
* @return SysResult对象
* @param jsonData json数据
* @param clazz 集合中的类型
* @return SysResult对象
*/
public static ResultObj formatToList(String jsonData, Class<?> clazz) {
try {
......
......@@ -14,7 +14,7 @@ import java.util.Date;
* @since 2021-04-29
*/
public class TraffpictureParam extends Traffpicture {
private Long recordid;
private Long id;
private String fdid;
private Integer channelid;
private Long areaid;
......@@ -151,12 +151,14 @@ public class TraffpictureParam extends Traffpicture {
this.imagedata = imagedata;
}
public Long getRecordid() {
return recordid;
@Override
public Long getId() {
return id;
}
public void setRecordid(Long recordid) {
this.recordid = recordid;
@Override
public void setId(Long id) {
this.id = id;
}
public String getFdid() {
......
......@@ -82,8 +82,8 @@ public class DeptTreeService {
/**
* 查找所有的部门的树形结构
*/
public List<DeptTree> selectAllVideoTree(String parentId) {
return deptTreeMapper.selectAllVideoTree(parentId);
public List<DeptTree> selectAllVideoTree(String parentId,String userId) {
return deptTreeMapper.selectAllVideoTree(parentId,userId);
}
......
......@@ -60,7 +60,7 @@ public class MenuService {
*/
public List<Menu> getALLMenuTreeAndRoot() {
List<Menu> allMenuTree = getALLTree();
return addRootNode("导航目录", 0, allMenuTree);
return addRootNode("", 0, allMenuTree);
}
/**
......
......@@ -27,7 +27,6 @@ public class TrafficStatisticsService {
public List<TraffpictureParam> queryTaskInfoByPage( Map map,int page, int limit) {
PageHelper.startPage(page,limit);
List<TraffpictureParam> traffalarmrecordResults=trafficStatisticsMapper.queryTaskInfoByPage(map);
return traffalarmrecordResults;
}
......@@ -35,6 +34,10 @@ public class TrafficStatisticsService {
return trafficStatisticsMapper.updateTraffalarmrecordById(recordlist);
}
public int updateDisputesInfo(List<TraffpictureParam> recordlist ){
return trafficStatisticsMapper.updateDisputesInfo(recordlist);
}
public List<RecordResult> todaytraffRecords(Map map) {
return trafficStatisticsMapper.todaytraffRecords(map);
......@@ -94,4 +97,23 @@ public class TrafficStatisticsService {
return trafficStatisticsMapper.selectCodeByCodeid(codeid,level);
}
public int delDisputesInfo(List<TraffpictureParam> recordlist){
return trafficStatisticsMapper.delDisputesInfo(recordlist);
}
public List<StatisticsData> eventStatistics(StatisticsParam statisticsParam){
return trafficStatisticsMapper.eventStatistics(statisticsParam);
}
public List<StatisticsData> deviceStatistics(StatisticsParam statisticsParam){
return trafficStatisticsMapper.deviceStatistics(statisticsParam);
}
public List<Map> sendInfoStatistics(StatisticsParam statisticsParam){
return trafficStatisticsMapper.sendInfoStatistics(statisticsParam);
}
public List<StatisticsData> departmentEventStatistics(StatisticsParam statisticsParam){
return trafficStatisticsMapper.departmentEventStatistics(statisticsParam);
}
}
\ No newline at end of file
......@@ -19,9 +19,9 @@ public class VideoService {
/**
* 根据父 ID 获取所有部门下的监控信息
*/
public List<Video> selectByMutiParam(int page, int rows,String deptId,String videoName) {
public List<Video> selectByMutiParam(int page, int rows,String deptId,String userId,String videoName) {
PageHelper.startPage(page, rows);
return videoMapper.selectByMutiParam(deptId,videoName);
return videoMapper.selectByMutiParam(deptId,userId,videoName);
}
@Transactional
......
spring.datasource.username=root
spring.datasource.password=123456
#spring.datasource.url=jdbc:mysql://172.22.135.45:12345/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.url=jdbc:mysql://172.16.24.29:3306/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
#spring.datasource.url=jdbc:mysql://172.22.135.45:12345/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
spring.datasource.url=jdbc:mysql://172.16.24.29:3306/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.filters= stat
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasounamerce.filters= stat
spring.datasource.maxActive= 1000
spring.datasource.initialSize=100
spring.datasource.maxWait= 60000
......
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.filters= stat
spring.datasource.maxActive= 1000
spring.datasource.initialSize=100
......
spring.profiles.active=local
spring.profiles.active=devzjgs
server.port=8083
mybatis.configuration.map-underscore-to-camel-case=true
mybatis.configuration.default-fetch-size=100
mybatis.configuration.default-statement-timeout=3000
mybatis.type-aliases-package=im.dx.system.model.vo
mybatis.mapper-locations=classpath:mapper/*.xml
file.rtspurl=http://zjh189.ncpoi.cc:7180/getDeviceSnapshot
file.taskurl=http://172.16.24.29:8089/ai/task
spring.http.encoding.force=true
......
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="false">
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
<property name="log.path" value="/home/ubuntu/tar/videoalarm/logs/${spring.application.name}"/>
<property name="log.path" value="/home/ubuntu/tar/logs/zjgszdVideoAlarmService/${spring.application.name}"/>
<!--<property name="log.path" value="/home/prod/deploy/HZDXService/logs/${spring.application.name}"/>-->
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN"
......
......@@ -55,6 +55,7 @@
<result column="parent_id" jdbcType="INTEGER" property="parentId"/>
<result column="order_num" jdbcType="INTEGER" property="orderNum"/>
<result column="vels" jdbcType="INTEGER" property="vels"/>
<result column="idsets" jdbcType="VARCHAR" property="idsets"/>
</resultMap>
......@@ -160,10 +161,10 @@
<where>
<choose>
<when test="parent_id!=null">
and parent_id = #{parent_id}
and find_in_set(#{parent_id},idsets)
</when>
<otherwise>
and parent_id =0
and find_in_set('0',idsets)
</otherwise>
</choose>
</where>
......@@ -171,43 +172,47 @@
</select>
<select id="listvideo" resultMap="VideoTreeBaseResultMap">
select distinct t.dept_id dept_id,
select distinct t.dept_id dept_id,
t.dept_name ,
parent_id parent_id,
levels ,t.order_num,0 vels
parent_id parent_id,
levels ,t.order_num,0 vels,idsets
from dept t
<if test="deptId != null and deptId!=0">
,t_user a
where a.dept_id = t.dept_id
and a.dept_id = #{deptId}
<if test="username != null and username!='' ">
and a.username = #{username}
</if>
</if>
union all
select a.* ,0 vels from (SELECT
CONCAT_WS( '_' ,A .sbbh , tdbh) dept_id,
union
select a.* ,0 vels from (SELECT
A .sbbh dept_id,
A .tdmc dept_name,
A .xzbh parent_id,
A .xzbh parent_id,
'' levels,
(
SELECT
max(order_num)
FROM
dept
) + (@rownum := @rownum + 1) order_num
0 order_num,0 idsets
FROM
dept T,(SELECT @rownum:=0) r ,
sbtdspsr A where
T .dept_id = A .xzbh
sbtdspsr
A where
T .dept_id = A .xzbh and
find_in_set(A.xzbh,T.idsets)
and find_in_set(#{deptId},idsets)
<if test="tdmc != null and tdmc!='' ">
and tdmc like '%${tdmc}%'
</if>)a
and tdmc like '%${tdmc}%'
</if>
)a
union
select a.* ,0 vels,0 idsets from (SELECT
a .sbbh dept_id,
a .tdmc dept_name,
a .xzbh parent_id,
'' levels,
0 order_num
from sbtdspsr a,role_videoerecordtype b,user_role c
where a.sbbh=b.videorecordtypeid and b.roleid=c.role_id
and c.user_id=
(select distinct user_id from t_user where username=#{username})
)a
</select>
<select id="listAllvideoIdsByDeptid" resultType="java.util.HashMap">
select concat(sbbh,'_',tdbh) vidoid
select sbbh vidoid
from sbtdspsr a
where a.xzbh in (
select t1.dept_id
......
......@@ -28,8 +28,8 @@
<result column="order_num" jdbcType="INTEGER" property="orderNum"/>
<result column="create_time" jdbcType="VARCHAR" property="createTime"/>
<result column="modify_time" jdbcType="VARCHAR" property="modifyTime"/>
<!--<collection property="children" ofType="im.zhaojun.system.model.DeptTree" select="selectAllTree"-->
<!--column="{parent_id = dept_id}"/>-->
<collection property="children" ofType="im.dx.system.model.DeptTree" select="selectAllTree"
column="{parent_id = dept_id}"/>
</resultMap>
<resultMap id="TreeBaseVideoResultMap" type="im.dx.system.model.DeptTree">
......@@ -131,18 +131,14 @@
<select id="selectAllTree" resultMap="TreeBaseResultMap">
select
t1.dept_id, t1.dept_name, t1.parent_id, t1.order_num, t1.create_time, t1.modify_time,t1.levels
from dept t1 left join dept t2
on t1.parent_id = t2.dept_id
from dept t1
<where>
<choose>
<when test="parent_id!=null">
and t1.parent_id = #{parent_id}
or t1.dept_id = #{parent_id}
or t2.parent_id =#{parent_id}
or t2.dept_id = #{parent_id}
<when test="parent_id != null">
and parent_id = #{parent_id}
</when>
<otherwise>
t1.parent_id =0
and parent_id = 0
</otherwise>
</choose>
</where>
......@@ -158,35 +154,26 @@
t.order_num
from dept t
union
select distinct t1.dept_id dept_id,
t1.dept_name,
t1.parent_id parent_id,
t1.levels,
t1.order_num
from dept t1
left join dept t2
on t1.parent_id = t2.dept_id
where t1.parent_id =0
or t1.dept_id =0
or t2.parent_id =0
or t2.dept_id =0
union
select sbbh dept_id,
select a.* , (SELECT count(*) FROM dept) + (@rownum := @rownum + 1) order_num from (
select distinct sbbh dept_id,
tdmc dept_name,
xzbh parent_id,
'3' levels,
(SELECT count(*) FROM dept) + (@rownum := @rownum + 1) order_num
from sbtdspsr,(SELECT @rownum:=0) r
-- union
-- select taskno dept_id,
-- b.name dept_name,
-- videoid parent_id,
-- '4' levels,
-- (SELECT count(*) FROM sbtdspsr) + (@rownum := @rownum + 1) order_num
-- from quartz_task_informations a
-- left join t_code b
-- on a.recordtype = b.key and b.type=1
) a,(SELECT @rownum:=0) r
(select max(levels)+1 from dept ) levels
from dept t1, sbtdspsr A where
t1.dept_id = A.xzbh and
find_in_set(A.xzbh,idsets)
and find_in_set(#{parent_id},idsets)
union
select a.* from (SELECT
a .sbbh dept_id,
a .tdmc dept_name,
a .xzbh parent_id,
(select max(levels)+1 from dept ) levels
from sbtdspsr a,role_videoerecordtype b,user_role c
where a.sbbh=b.videorecordtypeid and b.roleid=c.role_id
and c.user_id=(select user_id from t_user where username=#{username} limit 1)
)a)a
) a,(SELECT @rownum:=0) r
order by order_num
</select>
......@@ -226,7 +213,7 @@
(select name from t_code b where a.sendtype=b.key and b.type=2)sendtype,'3' tasktype,imgsrc
from autosnaptaskinfo a
where a.devicenum=#{videoId} and status!=4
order by frozenstatus desc
order by id desc
</select>
......
......@@ -2,56 +2,36 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="im.dx.system.mapper.LoginLogMapper">
<resultMap id="BaseResultMap" type="im.dx.system.model.LoginLog">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="id" jdbcType="INTEGER" property="id" />
<id column="id" jdbcType="INTEGER" property="id" />
<result column="login_time" jdbcType="VARCHAR" property="loginTime" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="login_status" jdbcType="CHAR" property="loginStatus" />
<result column="ip" jdbcType="VARCHAR" property="ip" />
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, login_time, username, login_status, ip
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from login_log
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from login_log
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="im.dx.system.model.LoginLog">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into login_log (login_time, username, login_status,
ip)
values (#{loginTime,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{loginStatus,jdbcType=CHAR},
#{ip,jdbcType=VARCHAR})
</insert>
<update id="updateByPrimaryKey" parameterType="im.dx.system.model.LoginLog">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update login_log
set login_time = #{loginTime,jdbcType=VARCHAR},
username = #{username,jdbcType=VARCHAR},
......
......@@ -49,7 +49,6 @@
<result column="create_time" jdbcType="VARCHAR" property="createTime"/>
<result column="modify_time" jdbcType="VARCHAR" property="modifyTime"/>
<result column="icon" jdbcType="VARCHAR" property="icon"/>
<!--<collection property="children" ofType="im.zhaojun.system.model.Menu" select="selectAllMenuAndCountOperator" column="{parent_id = menu_id}"/>-->
</resultMap>
<sql id="Base_Column_List">
......
......@@ -2,10 +2,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="im.dx.system.mapper.OperatorMapper">
<resultMap id="BaseResultMap" type="im.dx.system.model.Operator">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="operator_id" jdbcType="INTEGER" property="operatorId" />
<result column="menu_id" jdbcType="INTEGER" property="menuId" />
<result column="operator_name" jdbcType="VARCHAR" property="operatorName" />
......@@ -16,46 +12,27 @@
<result column="modify_time" jdbcType="VARCHAR" property="modifyTime" />
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
operator_id, menu_id, operator_name, url, perms, http_method, create_time, modify_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
select
<include refid="Base_Column_List" />
from operator
where operator_id = #{operatorId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from operator
where operator_id = #{operatorId,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="operator_id" keyProperty="operatorId" parameterType="im.dx.system.model.Operator">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into operator (operator_id , menu_id, operator_name, url,
insert into operator (operator_id , menu_id, operator_name, url,
perms, http_method, create_time,
modify_time)
select max(operator_id )+1,#{menuId,jdbcType=INTEGER}, #{operatorName,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR},#{perms,jdbcType=VARCHAR}, #{httpMethod,jdbcType=VARCHAR}, #{createTime,jdbcType=VARCHAR},#{modifyTime,jdbcType=VARCHAR},#{createTime,jdbcType=VARCHAR},#{modifyTime,jdbcType=VARCHAR}
</insert>
<update id="updateByPrimaryKey" parameterType="im.dx.system.model.Operator">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update operator
update operator
set menu_id = #{menuId,jdbcType=INTEGER},
operator_name = #{operatorName,jdbcType=VARCHAR},
url = #{url,jdbcType=VARCHAR},
......
......@@ -43,18 +43,22 @@
<select id="selectByMutiParam" resultMap="BaseResultMap">
select a.xh, a.tdmc, a.sbbh ,a.tdbh,a.squrllj,a.xzbh,a.jd,a.wd , b.dept_name qymc, a.tdlx,a.kz3
from sbtdspsr a,(select t1.dept_id, t1.dept_name
from dept t1
left join dept t2
on t1.parent_id = t2.dept_id
where t1.parent_id = #{deptId}
or t1.dept_id = #{deptId}
or t2.parent_id =#{deptId}
or t2.dept_id = #{deptId})b
from sbtdspsr a,
(select t1.dept_id, t1.dept_name
from dept t1 where find_in_set( #{deptId},idsets))b
where a.xzbh=b.dept_id
<if test="videoName != null and videoName != '' ">
and tdmc like '%${videoName}%'
</if>
union
select a.xh, a.tdmc, a.sbbh ,a.tdbh,a.squrllj,a.xzbh,a.jd,a.wd ,
(select b.dept_name from dept b where b.dept_id=a.xzbh limit 1) qymc, a.tdlx,a.kz3
from sbtdspsr a
<if test="userId !=null and userId !=''">
,role_videoerecordtype b
where a.sbbh=b.videorecordtypeid
and b.roleid=(select role_id from user_role where user_id=#{userId} limit 1)
</if>
order by sbbh
</select>
<insert id="insert" parameterType="im.dx.system.model.Sbtdspsr">
......
......@@ -21,39 +21,19 @@ let vue_right = new Vue({
iframe.onload=function() {
document.getElementById('iframe').contentWindow.frames.setImg();
}
// setimg();
// draw = new DrawRectangle('draw-canvas', {
// src:this.imgsrc,
// layers: [{},
// {
// "x1":x,
// "y1": y,
// "x2": x+w,
// "y2": y+h,
// "width": w,
// "height": h,
// "strokeStyle": "red",
// "type": 0
// }
// ]
// });
},
},
add: function (item){
$("#myjgModal1").modal("show");
},
edit: function (item) {
vue_default.data_s.xh = item.xh;
vue_default.data_s.xh = item.xh;
vue_default.data_s.sbbh = item.sbbh;
vue_default.data_s.tdbh = item.tdbh;
vue_default.data_s.tdmc = item.tdmc;
vue_default.valueId= item.xzbh;
vue_default.data_s.tdlx=item.tdlx;
vue_default.initHandle();
// vue_default.data_s.qymc = item.qymc,
// vue_myjgModal1_edit.data_s.squrllj = item.squrllj
$("#myjgModal1").modal("show");
$("#myjgModal1").modal("show");
},
del: function (item) {
if (!confirm("确认删除监控吗?")) {
......@@ -80,6 +60,8 @@ let vue_right = new Vue({
page: pages,
pageSize: this.fy_select,
deptId: this.xz_jg,
userId: getCookie("bjpt_userId"),
username: getCookie("bjpt_realName"),
videoName: $("#ryxm").val(),
},
success: function (result) {
......@@ -118,7 +100,6 @@ let vue_right = new Vue({
});
},
getChange:function () {
// alert(this.fy_select);
this.queryRY(1,true);
}
},
......@@ -135,6 +116,7 @@ let vue_sjcx = new Vue({
timetype:0,
detectType:null,
notljt:1,
notface:1,
sfzdzptype:0,
imgsrc:''
},
......@@ -156,8 +138,6 @@ let vue_sjcx = new Vue({
else if(this.cheakallornot=="1") {
this.widthdata = "440px";
}
},
getPic:function(){
......@@ -171,7 +151,8 @@ let vue_sjcx = new Vue({
success: function (result) {
if(result.errorCode=="0"){
that.imgsrc= result.data;
draw.src=result.data;
document.getElementById('iframe').contentWindow.frames.setImg();
// draw.src=result.data;
}
},error:function(result){
......@@ -179,18 +160,21 @@ let vue_sjcx = new Vue({
}
});
},
changedetectType: function(){
if(this.detectType=="15"){
if(this.detectType=="15" ){
//垃圾桶检测
this.notljt=0;
}else{
this.notljt=1; }
this.notljt=1;
}
if(this.detectType=="60"){
this.notljt=2;
this.objectType="6";
}
else{
this.notljt=1;
}
},
addtask: function (item) {
if($("#starthour").val()=="" && $("#endhour").val()!="")
......@@ -255,7 +239,7 @@ let vue_sjcx = new Vue({
params: {
starthour: $("#starthour").val() ,
endhour:$("#endhour").val(),
thresholdValue: 0,
thresholdValue:$("#thresholdValue").val(),
objectType: $("#objectType").val(),
sendType: $("#autosend").val(),//是否自动推送,
},
......@@ -284,13 +268,12 @@ let vue_sjcx = new Vue({
}
}
});
}else {
if( this.timetype == 0){
str=$("#starthour").val() + "," + $("#endhour").val() + "," + $("#schedulerRule").val();
}else{
str= $("#starthour").val() + "," + $("#endhour").val() + "," + $("#schedulerRule").val() * this.timetype * 60;
}
//确认添加任务事件
$.ajax({
......@@ -305,9 +288,8 @@ let vue_sjcx = new Vue({
type: "0",
name: $("#name").val(),
params: {
schedulerRule: this.timetype == 0 ? $("#starthour").val() + "," + $("#endhour").val() + "," + $("#schedulerRule").val() :
$("#starthour").val() + "," + $("#endhour").val() + "," + $("#schedulerRule").val() * this.timetype * 60,
thresholdValue: 0,
schedulerRule: str,
thresholdValue:$("#thresholdValue").val(),
objectType: $("#objectType").val(),
sendType: $("#autosend").val(),//是否自动推送,
},
......@@ -329,6 +311,13 @@ let vue_sjcx = new Vue({
});
$("#myModal2").modal("hide");
} else {
if (result.errorCode == '-1')
{
result.errorMg="超时";
}
else{
result.errorMsg="任务已存在";
}
layer.msg(result.errorMsg, {
icon: 2,
time: 2000
......@@ -339,6 +328,11 @@ let vue_sjcx = new Vue({
}
}
else{//调用垃圾识别算法服务
str=$("#schedulerRule").val()*this.timetype*60000;
if(this.timetype==0){
str=$("#schedulerRule").val()*1000;
}
$.ajax({
url: "/video/LJTtask",
dataType: "json",
......@@ -349,8 +343,7 @@ let vue_sjcx = new Vue({
deviceNum: vue_sjcx.sbbh,
spId: vue_sjcx.sbbh,
interfaceCode: "NEW_LJTMYJC_001",
interval:this.timetype==0?$("#schedulerRule").val()*1000:
$("#schedulerRule").val()*this.timetype*60000 ,
interval:str ,
status:1,
params: {
starthour: $("#starthour").val(),
......@@ -383,39 +376,7 @@ let vue_sjcx = new Vue({
}
},
});
// let vue_myjgModal1 = new Vue({
// el: '#myjgModal1',
// data: {
// data_s: {
// sbbh: '',
// tdmc: '',
// squrllj: '',
// xzbh: '',
// tdlx:'1'
// },
// },
// methods: {
// define: function () {
// vue_myjgModal1.data_s.xzbh=vue_myjgModal1.data_s.qybh;
// $.ajax({
// url: "/video/add",
// dataType: "json",
// type: "POST",
// data: vue_myjgModal1.data_s,
// success: function (result) {
// if (result.code == 0) {
// vue_right.queryRY(1, true);
// $("#myjgModal1").modal("hide");
// info_new("监控新增成功");
// window.setTimeout("$('#info-warning-new').modal('hide')", 2000);
// }
// }
// });
// }
// }
// });
let vue_default= new Vue({
el:"#myjgModal1",
name: "el-tree-select",
......
......@@ -726,7 +726,7 @@ let vue_sjsstxnow = new Vue({
state_cli: function (item, e, index, type) {
let json_s = [];
json_s.push({
recordid: item.recordid + '',
id: item.id + '',
channelid: item.channelid,
fdid: item.fdid,
recordtime: item.recordtime,
......
......@@ -27,10 +27,9 @@ let vue_rwpfhistory = new Vue({
taskwp_select:[{
'id':0,
'name':''
},
{
'id':1,
'id':2,
'name':''
},
......@@ -324,6 +323,52 @@ let vue_rwpfhistory = new Vue({
}, 100);
},
back: function(){
let taskexists=0;
if(vue_rwpfhistory.state_arr.length>0) {
//判断是否是已经下派的任务
vue_rwpfhistory.state_arr.forEach(function (item, index) {
if (item.handler=="undefined" || item.handler == null || item.handler == '') {
taskexists = 1;
}
});
}
let str="";
if(taskexists==1){
str="存在尚未分配的告警,只撤回已经分派的任务,"
}
if(vue_rwpfhistory.state_arr.length>0) {
layer.confirm(str+"确认撤回", {icon: 3, title: "提示"},
function (index) {
//将分派出去的任务信息删除
$.ajax({
url: "/TrafficStatistics/delDisputesInfo",
dateType: 'json',
type: "POST",
contentType: 'application/json',
data: JSON.stringify(vue_rwpfhistory.state_arr),
success: function (result) {
if (result.code == 0) {
vue_rwpfhistory.query(1, true);
layer.msg("撤回成功");
vue_rwpfhistory.state_arr=[];
}
else{
layer.msg("撤回失败");
}
}
});
layer.close(index);
}, function (index) {//取消回调
layer.close(index);
}
);
}else{
layer.msg("请选择告警信息!")
}
},
distributed: function(){
......@@ -339,20 +384,20 @@ let vue_rwpfhistory = new Vue({
if(vue_rwpfhistory.state_arr.length>0) {
//判断是否是已经下派的任务
vue_rwpfhistory.state_arr.forEach(function (item, index) {
if (typeof item.handler != 'undefined' && item.handler != null && item.handler != '') {
if (item.handler != "undefined" && item.handler != null && item.handler != '') {
taskexists = 1;
}
});
return taskexists;
}
},
del: function() {
sfpf= this.sfpfrw();
let sfpf= this.sfpfrw();
msg="确认删除该告警?";
if(sfpf==1) {
msg="存在已经被分派的告警信息,确认删除?";
}
layer.confirm(msg, {icon: 3, title: "提示"},
function (index) {
layer.close(index);
......@@ -383,7 +428,7 @@ let vue_rwpfhistory = new Vue({
$(".div-ul").find('input:checked').each(function () {
let arr = $(this).val().split("|");
vue_rwpfhistory.state_arr.push({
recordid: arr[0],
id: arr[0],
channelid: arr[1],
fdid: arr[2],
recordtime: arr[3],
......@@ -543,7 +588,7 @@ let vue_sjsstxnow = new Vue({
state_cli: function (item, e, index, type) {
let json_s = [];
json_s.push({
recordid: item.recordid + '',
id: item.recordid + '',
channelid: item.channelid,
fdid: item.fdid,
recordtime: item.recordtime,
......@@ -592,7 +637,7 @@ let vue_sjsstxnow = new Vue({
//获得选中的userid,告警id
let jsonstr=[];
vue_rwpfhistory.state_arr.forEach(function(item,index){
jsonstr.push(item.recordid);
jsonstr.push(item.id);
});
$.ajax({
url: "/role/addtaskinfo",
......@@ -763,11 +808,12 @@ $("#all").click(function () {
// vue_rwpfhistory.state_arr.push($(this).val());
let arr = $(this).val().split("|");
vue_rwpfhistory.state_arr.push({
recordid: arr[0],
id: arr[0],
channelid: arr[1],
fdid: arr[2],
recordtime: arr[3],
recordtype: arr[4]
recordtype: arr[4],
handler:arr[5]
});
});
vue_rwpfhistory.show_nums = true;
......
This diff is collapsed.
......@@ -51,7 +51,6 @@
<img class="error-page-img" th:src="@{/images/ic_500.svg}">
<div class="error-page-info">
<h1>500</h1>
<h1 th:text="${message}"></h1>
<div class="error-page-info-desc">诶呦,服务器开了个小差~</div>
</div>
</div>
......
......@@ -97,18 +97,7 @@
<script type="text/javascript">
function oauth2_github() {
$.get('/oauth2/render/github', function (data) {
console.log(data);
handlerResult(data, renderDone);
});
}
function oauth2_gitee() {
$.get('/oauth2/render/gitee', function (result) {
handlerResult(result, renderDone);
});
}
function renderDone(data) {
var winObj = window.open(data, 'newwindow', 'height=500, width=500, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no');
......
......@@ -248,21 +248,18 @@
</tr>
<tr v-show="notljt==1">
<td width="120px">检测对象<font color="red">*</font></td>
<td width="240px">
<td width="240px" >
<select class="form-control" id="objectType" required>
<option th:value="0" >
所有
</option>
<option th:value="1" >
人脸
所有
</option>
<option th:value="2" >
<option th:value="5" >
机动车
</option>
<option th:value="3" >
<option th:value="4" >
非机动车
</option>
<option th:value="4" >
<option th:value="7" >
</option>
</select>
......@@ -307,12 +304,12 @@
<td width="100px">执行时间间隔<font color="red">*</font></td>
<td width="240px"> <input type="number" required class="form-control" max="59" min="1" id="schedulerRule"> </td>
</tr>
<tr v-show="notljt==1">
<tr v-show="notljt==1 || notljt==2">
<td>告警阀值 <font color="red">*</font></td>
<td width="240px"><input type="number" required id="thresholdValue" class="form-control"min="0" th:value="0"> </td>
</tr>
<tr v-show="notljt==1" id="threshold" >
<tr v-show="notljt==1 || notljt==2" id="threshold" >
<td>是否自动推送<font color="red">*</font></td>
<td width="240px">
<select class="form-control" id="autosend" required>
......@@ -349,7 +346,7 @@
style="float: left;padding-left: 12px;padding-top: 10px;">刷新图片</a>
</td>
</tr>
<tr v-show="notljt==1">
<tr v-show="notljt==1 || notljt==2">
<td width="150px"> 告警回调地址<font color="red">*</font></td>
<td colspan="1"><input required type="text" class="form-control" id="url"> </td>
</tr>
......@@ -457,8 +454,14 @@
init(cvw, cvh, imgw, imgh) {
var item = this.layers[1];
this.ratew = cvw / imgw;
this.rateh = cvh / imgh;
console.log("ratew=="+this.ratew);
console.log("rateh=="+this.rateh);
this.ctx.beginPath();
this.startX = (item.x1) * this.ratew;
this.startY = (item.y1) * this.rateh;
......@@ -482,6 +485,7 @@
//设置图片为canvas的背景
setImageBackground(src) {
debugger
const img = new Image();
img.src = src;
img.onload = ()=>
......@@ -658,7 +662,6 @@
let allNotIn = 1;
let item = this.layers[0];
this.ctx.beginPath();
console.log(item.x1);
this.ctx.rect(item.x1, item.y1, item.width, item.height);
this.ctx.strokeStyle = item.strokeStyle;
if (this.ctx.isPointInPath(x * this.scale, y * this.scale)) {
......@@ -763,6 +766,11 @@
}))
var ratew = this.config.width / this.canvas.width;
var rateh = this.config.height / this.canvas.height;
console.log(ratew);
console.log("this.ratew=="+this.ratew);
console.log("rateh=="+rateh);
console.log("this.rateh=="+this.rateh);
console.log("this.startX=="+this.startX);
this.layers.splice(1, 1, this.fixPosition({
x1: Math.ceil(this.startX * ratew),
......@@ -772,6 +780,8 @@
strokeStyle: this.config.solidColor,
type: this.type
}));
document.getElementById('objectxy').value=Math.ceil(this.startX * this.ratew)+","+Math.ceil(this.startY * this.rateh)
+","+Math.ceil((this.endX-this.startX) * this.ratew)+","+Math.ceil((this.endY-this.startY) * this.rateh);
......
......@@ -119,7 +119,7 @@
var DTree = dtree.render({
elem: "#menuTree",
url:"/depttree/videotree/"+getCookie("bjpt_deptId"),
url:"/depttree/videotree/"+getCookie("bjpt_deptId")+"/"+getCookie("bjpt_realName"),
dataStyle: "layuiStyle",
initLevel: 5, // 初始打开节点级别
method: "GET",
......
......@@ -59,8 +59,8 @@
</span>
<div style="padding: 10px">
<span class="div-right-top">
<img src="../img/back.png" title="回退" @click="back()">
<img src="../img/pftask.png" title="派发" @click="distributed()"></span>
<img v-show="taskwpmodel_select!=1" src="../img/back.png" title="撤回" @click="back()">
<img v-show="taskwpmodel_select!=2" src="../img/pftask.png" title="派发" @click="distributed()"></span>
</div>
<div style="height:calc(100% - 164px);margin-top: 20px;" class="tables">
<ul class="div-ul div-pub-gt" v-if="show">
......
......@@ -107,11 +107,11 @@
<!--<span>辖区名称:</span>-->
<!--<span v-text="item.xzmc"></span>-->
<!--</div>-->
<div v-show="item.targetnum!=null && item.targetnum>0">
<span>密度:</span>
<span v-text="item.targetnum!=null">{{item.targetnum==null?'':item.targetnum.split('/')[0]}}</span>
<span>警界值:</span>
<span v-text="item.targetnum!=null">{{item.targetnum==null?'':item.targetnum.split('/')[1]}}</span>
<div v-show="item.targetnum!=null && item.targetnum!=''">
<span v-show="item.recordtype=='60'">检测值(戴口罩/总人数/阀值): <span >{{item.targetnum}}</span></span>
<span v-show="item.recordtype=='10'">检测值(总数/阀值): <span >{{item.targetnum}}</span></span>
<span v-show="item.recordtype=='12'">检测值(总数): <span >{{item.targetnum}}</span></span>
</div>
</div>
<div class="li-bottom">
......
......@@ -105,6 +105,11 @@
type: this.type
}));
this.ctx.stroke();
console.log("cvw=="+cvw);
console.log("cvh=="+cvh);
console.log("imgw=="+imgw);
console.log("imgh=="+imgh);
parent.document.getElementById('objectxy').value=Math.ceil(this.startX * this.ratew)+","+Math.ceil(this.startY * this.rateh)
+","+Math.ceil((this.endX-this.startX) * this.ratew)+","+Math.ceil((this.endY-this.startY) * this.rateh);
}
......@@ -402,8 +407,15 @@
strokeStyle: this.config.solidColor,
type: this.type
}));
parent.document.getElementById('objectxy').value=Math.ceil(this.startX * this.ratew)+","+Math.ceil(this.startY * this.rateh)
+","+Math.ceil((this.endX-this.startX) * this.ratew)+","+Math.ceil((this.endY-this.startY) * this.rateh);
console.log("ratew=="+ratew);
console.log("rateh=="+rateh);
console.log("this.rateh=="+this.rateh);
console.log("this.ratew=="+this.ratew);
console.log("this.startX=="+this.startX);
parent.document.getElementById('objectxy').value=Math.ceil(this.startX * ratew)+","+Math.ceil(this.startY * rateh)
+","+Math.ceil((this.endX-this.startX) * ratew)+","+Math.ceil((this.endY-this.startY) * rateh);
} else if (this.optype >= 3) {
this.fixPosition(this.currentR);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment