新增接口
This commit is contained in:
parent
480e6804e7
commit
25da0b36eb
|
|
@ -48,6 +48,9 @@ public class RobotController extends BaseController {
|
|||
List<PatrolTask> list = service.getTaskList(task);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增任务
|
||||
* @param vo
|
||||
|
|
@ -166,6 +169,16 @@ public class RobotController extends BaseController {
|
|||
return service.getVideoList(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询录音文件
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("delVideo")
|
||||
public AjaxResult delVideo(@RequestBody RobotVideoVo vo) {
|
||||
return service.delVideo(vo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
package com.bonus.business.controller.robot;
|
||||
|
||||
import com.bonus.business.service.ISbdUserService;
|
||||
import com.bonus.business.vo.PatrolTask;
|
||||
import com.bonus.business.vo.RobotUserInfoVo;
|
||||
import com.bonus.business.vo.SbdUserVo;
|
||||
import com.bonus.common.annotation.Log;
|
||||
import com.bonus.common.core.controller.BaseController;
|
||||
import com.bonus.common.core.domain.AjaxResult;
|
||||
import com.bonus.common.core.domain.entity.SysUser;
|
||||
import com.bonus.common.core.page.TableDataInfo;
|
||||
import com.bonus.common.enums.BusinessType;
|
||||
import com.bonus.common.utils.SecurityUtils;
|
||||
import com.bonus.common.utils.StringUtils;
|
||||
|
|
@ -15,6 +18,8 @@ import org.springframework.validation.annotation.Validated;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 黑子
|
||||
* 送变电人员
|
||||
|
|
@ -26,8 +31,34 @@ public class SbdUserController extends BaseController{
|
|||
|
||||
@Autowired
|
||||
private ISbdUserService service;
|
||||
/**
|
||||
* 查询送变电人员接口
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("list")
|
||||
public TableDataInfo getList(SbdUserVo vo) {
|
||||
startPage();
|
||||
List<SbdUserVo> list = service.getList(vo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@GetMapping("/getUserList")
|
||||
public TableDataInfo getUserList(RobotUserInfoVo task) {
|
||||
startPage();
|
||||
List<RobotUserInfoVo> list = service.getUserList(task);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getUserListLimit")
|
||||
public AjaxResult getUserListLimit(RobotUserInfoVo vo) {
|
||||
return service.getUserListLimit(vo);
|
||||
}
|
||||
/**
|
||||
* 新增人员
|
||||
* @param user
|
||||
* @param multipartFile
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("addSbdUser")
|
||||
public AjaxResult addSbdUser(@Validated SbdUserVo user,@RequestParam("file") MultipartFile multipartFile) {
|
||||
return service.addSbdUser(user,multipartFile);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.business.mapper;
|
||||
|
||||
import com.bonus.business.vo.RobotTaskImageVo;
|
||||
import com.bonus.business.vo.RobotUserInfoVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
|
@ -32,4 +33,10 @@ public interface RobotEvenMapper {
|
|||
* @param vo
|
||||
*/
|
||||
void addTaskImage(RobotTaskImageVo vo);
|
||||
|
||||
/**
|
||||
* 新增人员信息
|
||||
* @param vo
|
||||
*/
|
||||
void addTaskUserInfo(RobotUserInfoVo vo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -142,4 +142,10 @@ public interface RobotMapper {
|
|||
* @return
|
||||
*/
|
||||
RobotVideoVo getVideoList(RobotVideoVo vo);
|
||||
|
||||
/**
|
||||
* 删除录音文件
|
||||
* @param vo
|
||||
*/
|
||||
void delVideo(RobotVideoVo vo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.business.mapper;
|
||||
|
||||
import com.bonus.business.vo.RobotUserInfoVo;
|
||||
import com.bonus.business.vo.RobotVo;
|
||||
import com.bonus.business.vo.SbdUserVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
|
@ -36,4 +37,25 @@ public interface SbdUserMapper {
|
|||
* @return
|
||||
*/
|
||||
int delUser(SbdUserVo user);
|
||||
|
||||
/**
|
||||
* 查询人员集合
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
List<SbdUserVo> getList(SbdUserVo vo);
|
||||
|
||||
/**
|
||||
* 分页查询人员动态数据
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
List<RobotUserInfoVo> getUserList(RobotUserInfoVo vo);
|
||||
|
||||
/**
|
||||
* 查询用户查询数据分页
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
List<RobotUserInfoVo> getUserListLimit(RobotUserInfoVo vo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ public class Test {
|
|||
String uuid= UUID.randomUUID().toString().replaceAll("-","");
|
||||
//登录接口
|
||||
String token=QxVideotape.login(TVideoConfigUtil.getMaps(),TVideoConfigUtil.Q2HTTPURL);
|
||||
String xmls= QxUtils.setVideoSource(XxmSendUtils.ROBOT_VIDEO_SOURCE,"33");
|
||||
String res33=QxVideotape.sendXmlPost(token,TVideoConfigUtil.Q2HTTPURL,"201115200268437643",xmls);
|
||||
//机器人 开启巡检
|
||||
// String xml2= QxUtils.getRobotStartTask(XxmSendUtils.CONTROLLER,XxmSendUtils.ROBOT_START_TASK,"WTBLS204766");
|
||||
// String res3=QxVideotape.sendXmlPost(token,TVideoConfigUtil.Q2HTTPURL,"201115200268437643",xml2);
|
||||
|
|
|
|||
|
|
@ -7,9 +7,33 @@ import lombok.extern.slf4j.Slf4j;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 黑子
|
||||
*/
|
||||
@Slf4j
|
||||
public class QxUtils {
|
||||
|
||||
|
||||
public static String setVideoSource(String opeId,String value){
|
||||
StringBuilder builder=new StringBuilder();
|
||||
try{
|
||||
builder.append("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
|
||||
builder.append("<M Type=\"ComReq\">");
|
||||
builder.append("<C Type=\"S\" Prio=\"1\" EPID=\"system\">");
|
||||
builder.append("<Res Type=\"OA\" Idx=\"0\" OptID=\"").append(opeId).append("\" >");
|
||||
builder.append("<Param ").append("Value=\"").append(value).append("\" ").append(">");
|
||||
builder.append("</Param>");
|
||||
builder.append("</Res>");
|
||||
builder.append("</C>");
|
||||
builder.append("</M>");
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return builder.toString();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static String getStartVideo(String type,String opeId,String id,String loop,String enable){
|
||||
StringBuilder builder=new StringBuilder();
|
||||
try{
|
||||
|
|
|
|||
|
|
@ -127,6 +127,8 @@ public class XxmSendUtils {
|
|||
*/
|
||||
public static String ROBOT_DEL_VIDEO="C_ST_DeteleLinkActionTipVoiceSets";
|
||||
|
||||
public static String ROBOT_VIDEO_SOURCE="F_OA_OutputVolume";
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -97,4 +97,11 @@ public interface IRobotService {
|
|||
* @return
|
||||
*/
|
||||
AjaxResult getVideoList(RobotVideoVo vo);
|
||||
|
||||
/**
|
||||
* 删除录音文件
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
AjaxResult delVideo(RobotVideoVo vo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
package com.bonus.business.service;
|
||||
|
||||
import com.bonus.business.vo.RobotUserInfoVo;
|
||||
import com.bonus.business.vo.SbdUserVo;
|
||||
import com.bonus.common.core.domain.AjaxResult;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 黑子
|
||||
*/
|
||||
|
|
@ -44,4 +47,25 @@ public interface ISbdUserService {
|
|||
* @return
|
||||
*/
|
||||
AjaxResult delUser(SbdUserVo user);
|
||||
|
||||
/**
|
||||
* 分页查询人员接口
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
List<SbdUserVo> getList(SbdUserVo vo);
|
||||
|
||||
/**
|
||||
* 人员动态
|
||||
* @param task
|
||||
* @return
|
||||
*/
|
||||
List<RobotUserInfoVo> getUserList(RobotUserInfoVo vo);
|
||||
|
||||
/**
|
||||
* 查询今日啥数据
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getUserListLimit(RobotUserInfoVo vo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,11 +10,13 @@ import com.bonus.business.robot.video.QxVideotape;
|
|||
import com.bonus.business.robot.video.TVideoConfigUtil;
|
||||
import com.bonus.business.service.IRobotEventXmlService;
|
||||
import com.bonus.business.vo.RobotTaskImageVo;
|
||||
import com.bonus.business.vo.RobotUserInfoVo;
|
||||
import com.bonus.common.config.RuoYiConfig;
|
||||
import com.bonus.common.utils.DateUtils;
|
||||
import com.bonus.common.utils.file.ImageSimilarityUtils;
|
||||
import com.bonus.common.utils.uuid.UUID;
|
||||
import com.github.pagehelper.util.StringUtil;
|
||||
import com.google.common.collect.Maps;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentHelper;
|
||||
|
|
@ -47,6 +49,7 @@ public class RobotEventXmlServiceImpl implements IRobotEventXmlService {
|
|||
|
||||
{
|
||||
eventIds.add("E_IVS_UploadPicture");
|
||||
eventIds.add("E_IVS_ObjectDetect_Face");
|
||||
eventIds.add("E_IVS_FaceRecognition");
|
||||
eventIds.add("E_IVS_UploadPicture_AUTO");
|
||||
eventIds.add("E_ST_RobotAlarm");
|
||||
|
|
@ -64,11 +67,13 @@ public class RobotEventXmlServiceImpl implements IRobotEventXmlService {
|
|||
String evenId= element.attributeValue("ID");
|
||||
boolean sf = eventIds.contains(evenId);
|
||||
if(sf){
|
||||
System.err.println(xml);
|
||||
System.err.println(evenId);
|
||||
//巡检图片存储
|
||||
if("E_IVS_UploadPicture_AUTO".equals(evenId)){
|
||||
saveImage(element);
|
||||
}else if("E_IVS_FaceRecognition".equals(evenId)){
|
||||
saveUserInfo(element);
|
||||
}else if("E_IVS_ObjectDetect_Face".equals(evenId)){
|
||||
saveUserImage(element);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -77,6 +82,123 @@ public class RobotEventXmlServiceImpl implements IRobotEventXmlService {
|
|||
log.error(e.toString(),e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户人脸识别
|
||||
* @param element
|
||||
*/
|
||||
private void saveUserInfo(Element element) {
|
||||
Element src = element.element("Src");
|
||||
String puid = src.attributeValue("ID");
|
||||
if(StringUtil.isNotEmpty(puid)) {
|
||||
int devPuid = mapper.getPuIdNum(puid);
|
||||
if(devPuid>0){
|
||||
Element slices = element.element("Slices");
|
||||
Iterator slice = slices.elementIterator("Slice");
|
||||
List<Map<String,String>> list=new ArrayList<>();
|
||||
while (slice.hasNext()) {
|
||||
Map<String,String> maps= Maps.newHashMap();
|
||||
//子节点名//父类节点
|
||||
Element sliceData = (Element) slice.next();
|
||||
Element snapshot = sliceData.element("Snapshot");
|
||||
String time = sliceData.attributeValue("MillisOffset");
|
||||
String url=snapshot.getText();
|
||||
url=url.split("\\?")[0];
|
||||
maps.put("url",url);
|
||||
maps.put("time",time);
|
||||
list.add(maps);
|
||||
}
|
||||
if(list.size() == 2){
|
||||
String url1= list.get(0).get("url");
|
||||
String url2= list.get(1).get("url");
|
||||
String extension =url1.substring( url1.lastIndexOf(".") + 1);
|
||||
// 上传文件路径-配置生成
|
||||
String dateTimeNow=DateUtils.dateTimeNow();
|
||||
long millis=System.currentTimeMillis();
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
//生成图路径
|
||||
String path=filePath+File.separator+"userinfo"+File.separator+dateTimeNow;
|
||||
//生成文件名称
|
||||
String image= File.separator+millis+"."+extension;
|
||||
long millis2=millis+1;
|
||||
String image2= "/"+millis2+"."+extension;
|
||||
//生成文件
|
||||
ImageDownloader.downloadImage(url1,path,image);
|
||||
//生成文件
|
||||
ImageDownloader.downloadImage(url2,path,image2);
|
||||
//存储文件路径
|
||||
String path1= "/userinfo/"+dateTimeNow+image;
|
||||
//存储文件路径
|
||||
String path2= "/userinfo/"+dateTimeNow+image2;
|
||||
String uuid= UUID.randomUUID().toString().replaceAll("-","");
|
||||
Element desc = element.element("Desc2");
|
||||
String idCard=desc.attributeValue("IDCard");
|
||||
String userName=desc.attributeValue("Name");
|
||||
RobotUserInfoVo vo=new RobotUserInfoVo(uuid,puid,path1,idCard,path2,userName,"1");
|
||||
mapper.addTaskUserInfo(vo);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 人脸识别伤处
|
||||
* @param element
|
||||
*/
|
||||
private void saveUserImage(Element element) {
|
||||
Element src = element.element("Src");
|
||||
String puid = src.attributeValue("ID");
|
||||
if(StringUtil.isNotEmpty(puid)) {
|
||||
int devPuid = mapper.getPuIdNum(puid);
|
||||
if(devPuid>0){
|
||||
Element slices = element.element("Slices");
|
||||
Iterator slice = slices.elementIterator("Slice");
|
||||
List<Map<String,String>> list=new ArrayList<>();
|
||||
while (slice.hasNext()) {
|
||||
Map<String,String> maps= Maps.newHashMap();
|
||||
//子节点名//父类节点
|
||||
Element sliceData = (Element) slice.next();
|
||||
Element snapshot = sliceData.element("Snapshot");
|
||||
String time = sliceData.attributeValue("MillisOffset");
|
||||
String url=snapshot.getText();
|
||||
url=url.split("\\?")[0];
|
||||
maps.put("url",url);
|
||||
maps.put("time",time);
|
||||
list.add(maps);
|
||||
}
|
||||
if(list.size() == 2){
|
||||
String url1= list.get(0).get("url");
|
||||
String url2= list.get(1).get("url");
|
||||
String extension =url1.substring( url1.lastIndexOf(".") + 1);
|
||||
// 上传文件路径-配置生成
|
||||
String dateTimeNow=DateUtils.dateTimeNow();
|
||||
long millis=System.currentTimeMillis();
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
//生成图路径
|
||||
String path=filePath+ "/"+"userinfo"+ "/"+dateTimeNow;
|
||||
//生成文件名称
|
||||
String image= "/"+millis+"."+extension;
|
||||
long millis2=millis+1;
|
||||
String image2= "/"+millis2+"."+extension;
|
||||
//生成文件
|
||||
ImageDownloader.downloadImage(url1,path,image);
|
||||
//生成文件
|
||||
ImageDownloader.downloadImage(url2,path,image2);
|
||||
//存储文件路径
|
||||
String path1= "/userinfo/"+dateTimeNow+image;
|
||||
//存储文件路径
|
||||
String path2= "/userinfo/"+dateTimeNow+image2;
|
||||
String uuid= UUID.randomUUID().toString().replaceAll("-","");
|
||||
RobotUserInfoVo vo=new RobotUserInfoVo(uuid,puid,path1,null,path2,null,"2");
|
||||
mapper.addTaskUserInfo(vo);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Async
|
||||
public void saveImage( Element element ){
|
||||
String token=redisService.get("qx","token");
|
||||
|
|
@ -104,14 +226,14 @@ public class RobotEventXmlServiceImpl implements IRobotEventXmlService {
|
|||
String filePath = RuoYiConfig.getUploadPath();
|
||||
String url=map.get("url").split("\\?")[0];
|
||||
//生成图路径
|
||||
String path=filePath+File.separator+"task"+File.separator+dateTimeNow;
|
||||
String path=filePath+"/"+"task"+"/"+dateTimeNow;
|
||||
String extension = url.substring(url.lastIndexOf(".") + 1);
|
||||
//生成文件名称
|
||||
String image= File.separator+millis+"."+extension;
|
||||
String image= "/"+millis+"."+extension;
|
||||
//生成文件
|
||||
ImageDownloader.downloadImage(map.get("url"),path,image);
|
||||
//存储文件路径
|
||||
String lastPath= File.separator+"task"+File.separator+dateTimeNow+image;
|
||||
String lastPath= "/task/"+dateTimeNow+image;
|
||||
RobotTaskImageVo imageUrl=mapper.getLastImage(positionId);
|
||||
String uuid= UUID.randomUUID().toString().replaceAll("-","");
|
||||
RobotTaskImageVo vo;
|
||||
|
|
@ -124,6 +246,7 @@ public class RobotEventXmlServiceImpl implements IRobotEventXmlService {
|
|||
}
|
||||
mapper.addTaskImage(vo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -285,10 +285,20 @@ public class RobotServiceImpl implements IRobotService {
|
|||
String res=QxVideotape.sendXmlPost(token,TVideoConfigUtil.Q2HTTPURL,robotVo.getPuId(),xml);
|
||||
return AjaxResult.success(XmlUtils.getSuccess(res));
|
||||
}else if("17".equals(robotVo.getType())){
|
||||
//设置声音大小
|
||||
if(StringUtil.isNotEmpty(robotVo.getSound())){
|
||||
String xmls= QxUtils.setVideoSource(XxmSendUtils.ROBOT_VIDEO_SOURCE,robotVo.getSound());
|
||||
QxVideotape.sendXmlPost(token,TVideoConfigUtil.Q2HTTPURL,robotVo.getPuId(),xmls);
|
||||
}
|
||||
//机器人 播放文件//停止播放 enable 0 /1
|
||||
String xml= QxUtils.getStartVideo(XxmSendUtils.CONTROLLER,XxmSendUtils.ROBOT_VIDEO_START,robotVo.getVideoId(),robotVo.getLoop(),robotVo.getEnable());
|
||||
String res=QxVideotape.sendXmlPost(token,TVideoConfigUtil.Q2HTTPURL,robotVo.getPuId(),xml);
|
||||
return AjaxResult.success(XmlUtils.getSuccess(res));
|
||||
}else if("18".equals(robotVo.getType())){
|
||||
//设置声音大小
|
||||
String xml= QxUtils.setVideoSource(XxmSendUtils.ROBOT_VIDEO_SOURCE,robotVo.getSound());
|
||||
String res= QxVideotape.sendXmlPost(token,TVideoConfigUtil.Q2HTTPURL,robotVo.getPuId(),xml);
|
||||
return AjaxResult.success(XmlUtils.getSuccess(res));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -585,6 +595,28 @@ public class RobotServiceImpl implements IRobotService {
|
|||
return AjaxResult.success(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult delVideo(RobotVideoVo vo) {
|
||||
try{
|
||||
String token=redisService.get("qx","token");
|
||||
if(StringUtil.isEmpty(token)){
|
||||
token=QxVideotape.login(TVideoConfigUtil.getMaps(),TVideoConfigUtil.Q2HTTPURL);
|
||||
redisService.set("qx:token",token,60*60);
|
||||
}
|
||||
//下发到机器人
|
||||
String delXml= QxUtils.getAddVideo(XxmSendUtils.CONTROLLER,XxmSendUtils.ROBOT_DEL_VIDEO,vo.getId(),null,null);
|
||||
String delRes=QxVideotape.sendXmlPost(token,TVideoConfigUtil.Q2HTTPURL,vo.getPuid(),delXml);
|
||||
Map<String,String> map= XmlUtils.getSuccess(delRes);
|
||||
if("200".equals(map.get("code"))){
|
||||
mapper.delVideo(vo);
|
||||
}
|
||||
return AjaxResult.success(map);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return AjaxResult.error("删除失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询任务时间
|
||||
* @param patrolTask
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
package com.bonus.business.service.impl;
|
||||
|
||||
import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A;
|
||||
import com.bonus.business.mapper.SbdUserMapper;
|
||||
import com.bonus.business.service.ISbdUserService;
|
||||
import com.bonus.business.service.IUploadFileService;
|
||||
import com.bonus.business.vo.RobotUserInfoVo;
|
||||
import com.bonus.business.vo.RobotVo;
|
||||
import com.bonus.business.vo.SbdUserVo;
|
||||
import com.bonus.common.core.domain.AjaxResult;
|
||||
|
|
@ -12,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -122,7 +125,51 @@ public class SbdUserServiceImpl implements ISbdUserService {
|
|||
return AjaxResult.error("删除失败!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询人员数据
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SbdUserVo> getList(SbdUserVo vo) {
|
||||
try{
|
||||
return mapper.getList(vo);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员列表查询
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<RobotUserInfoVo> getUserList(RobotUserInfoVo vo) {
|
||||
try{
|
||||
return mapper.getUserList(vo);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getUserListLimit(RobotUserInfoVo vo) {
|
||||
try{
|
||||
List<RobotUserInfoVo> list= mapper.getUserListLimit(vo);
|
||||
return AjaxResult.success(list);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return AjaxResult.success(new ArrayList<>());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,81 @@
|
|||
package com.bonus.business.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author 黑子
|
||||
*/
|
||||
@Data
|
||||
public class RobotUserInfoVo {
|
||||
|
||||
private String id;
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
private String puid;
|
||||
/**
|
||||
* 人脸图片
|
||||
*/
|
||||
private String image;
|
||||
/**
|
||||
* 身份证
|
||||
*/
|
||||
private String userId;
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
private String createDay;
|
||||
/**
|
||||
* 原始图片
|
||||
*/
|
||||
private String dataImage;
|
||||
/**
|
||||
* 人员名称
|
||||
*/
|
||||
private String userName;
|
||||
/**
|
||||
* 数据类型
|
||||
*/
|
||||
private String dataType;
|
||||
|
||||
private String createTime;
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
private String age;
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private String sex;
|
||||
/**
|
||||
* 岗位
|
||||
*/
|
||||
private String post;
|
||||
/**
|
||||
* 工种
|
||||
*/
|
||||
private String workType;
|
||||
|
||||
private String startTime;
|
||||
|
||||
private String endTime;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public RobotUserInfoVo() {
|
||||
|
||||
}
|
||||
|
||||
public RobotUserInfoVo(String id, String puid, String image, String userId, String dataImage,String userName,String dataType) {
|
||||
this.id = id;
|
||||
this.puid = puid;
|
||||
this.image = image;
|
||||
this.userId = userId;
|
||||
this.dataImage = dataImage;
|
||||
this.userName=userName;
|
||||
this.dataType=dataType;
|
||||
}
|
||||
}
|
||||
|
|
@ -63,6 +63,10 @@ public class RobotVo {
|
|||
private String enable;
|
||||
|
||||
private String loop="1";
|
||||
/**
|
||||
* 声音
|
||||
*/
|
||||
private String sound;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
task_image,create_time,last_image,create_day,last_time,similarity
|
||||
)values (#{id},#{taskTime},#{taskId},#{positionId},#{image},now(),#{lastImage},now(),#{lastTime},#{similarity})
|
||||
</insert>
|
||||
|
||||
<insert id="addTaskUserInfo">
|
||||
insert into robot_user_info (
|
||||
id, puid, image, create_time, user_id,create_day, data_image,user_name,data_type
|
||||
) value(#{id},#{puid},#{image},now(),#{userId},now(),#{dataImage},#{userName},#{dataType})
|
||||
</insert>
|
||||
<select id="getPuIdNum" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from sbd_robot_device
|
||||
|
|
|
|||
|
|
@ -76,6 +76,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<delete id="delPoint">
|
||||
delete from robot_location_point where id=#{id}
|
||||
</delete>
|
||||
<!--删除录音文件-->
|
||||
<delete id="delVideo">
|
||||
delete from robot_location_point where id=#{id}
|
||||
</delete>
|
||||
|
||||
|
||||
<select id="getTaskList" resultType="com.bonus.business.vo.PatrolTask">
|
||||
|
|
|
|||
|
|
@ -13,22 +13,62 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
</insert>
|
||||
<update id="updateSbdUser">
|
||||
update robot_sbd_user set user_name=#{userName}, sex=#{sex}, mobile=#{mobile}, work_type=#{workType}
|
||||
,post=#{post},image=#{image}
|
||||
update robot_sbd_user set user_name=#{userName}, sex=#{sex}, mobile=#{mobile}, work_type=#{workType},
|
||||
age=#{age},id_card=#{idCard} ,post=#{post},image=#{image}
|
||||
where id=#{id}
|
||||
</update>
|
||||
<delete id="delUser">
|
||||
update robot_sbd_user set del_flag=1 where id=#{id}
|
||||
</delete>
|
||||
<select id="getDetails" resultType="com.bonus.business.vo.SbdUserVo">
|
||||
select user_name userName, sex ,post,image,work_type workType,mobile,create_time createTime,data_source dataSource
|
||||
select user_name userName, sex ,post,image,work_type workType,mobile,create_time createTime,data_source dataSource,
|
||||
age,id_card idCard
|
||||
from robot_sbd_user
|
||||
WHERE del_flag=0
|
||||
|
||||
</select>
|
||||
<select id="getDeviceList" resultType="com.bonus.business.vo.RobotVo">
|
||||
SELECT td.id,td.dev_name devName,td.mac_id macId,td.puid puId,td.indexs
|
||||
FROM sbd_robot_device td
|
||||
where td.del_flag=0
|
||||
</select>
|
||||
<!--查询人员集合列表-->
|
||||
<select id="getList" resultType="com.bonus.business.vo.SbdUserVo">
|
||||
select user_name userName, sex ,post,image,work_type workType,mobile,
|
||||
create_time createTime,data_source dataSource,
|
||||
age,id_card idCard
|
||||
from robot_sbd_user
|
||||
WHERE del_flag=0
|
||||
<if test="workType!=null and workType!=''">
|
||||
and work_type like concat('%',#{workType},'%')
|
||||
</if>
|
||||
<if test="userName!=null and userName!=''">
|
||||
and user_name like concat('%',#{userName},'%')
|
||||
</if>
|
||||
<if test="post!=null and post!=''">
|
||||
and post like concat('%',#{post},'%')
|
||||
</if>
|
||||
</select>
|
||||
<select id="getUserList" resultType="com.bonus.business.vo.RobotUserInfoVo">
|
||||
select puid,user_id ,rui.user_name userName,rui.image,rui.data_image dataImage,rui.create_time createTime ,
|
||||
rsu.post,rsu.work_type workType,rsu.sex,rsu.age,create_day createDay
|
||||
from robot_user_info rui
|
||||
left join robot_sbd_user rsu on rsu.id_card=rui.user_id and rsu.del_flag=0
|
||||
<where>
|
||||
<if test="userName!=null and userName!=''">
|
||||
and rui.user_name like concat('%',#{userName},'%')
|
||||
</if>
|
||||
<if test="startTime!=null and startTime!='' and endTime!='' and endTime!=''">
|
||||
and rui.create_day between #{startTime} and #{endTime}
|
||||
</if>
|
||||
</where>
|
||||
order by rui.create_time desc
|
||||
</select>
|
||||
<select id="getUserListLimit" resultType="com.bonus.business.vo.RobotUserInfoVo">
|
||||
select puid,user_id ,rui.user_name userName,rui.image,rui.data_image dataImage,rui.create_time createTime ,
|
||||
rsu.post,rsu.work_type workType,rsu.sex,rsu.age,create_day createDay
|
||||
from robot_user_info rui
|
||||
left join robot_sbd_user rsu on rsu.id_card=rui.user_id and rsu.del_flag=0
|
||||
order by rui.create_time desc
|
||||
limit 12
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue