Browse Source

三方视频 登录+ 列表

master
qushutong 2 years ago
parent
commit
b5ac58e02e
  1. 7
      epmet-auth/src/main/java/com/epmet/constant/AuthHttpUrlConstant.java
  2. 17
      epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java
  3. 1
      epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java
  4. 18
      epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java
  5. 142
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/IcMonitoringDeviceDTO.java
  6. 58
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcMonitoringDeviceController.java
  7. 34
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcMonitoringDeviceDao.java
  8. 113
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcMonitoringDeviceEntity.java
  9. 51
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcMonitoringDeviceService.java
  10. 61
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcMonitoringDeviceServiceImpl.java
  11. 31
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMonitoringDeviceDao.xml

7
epmet-auth/src/main/java/com/epmet/constant/AuthHttpUrlConstant.java

@ -21,4 +21,11 @@ public interface AuthHttpUrlConstant {
*/
String RESI_AND_WORK_LOGIN_URL = "http://198.18.132.1:10264/api/third/customermp/resiandworklogin";
/**
* 视频墙登录授权接口
*/
String VIDEO_LOGIN_URL = "http://172.20.41.195:9006/video/api/login";
}

17
epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java

@ -267,4 +267,21 @@ public class ThirdLoginController {
return new Result<UserTokenResultDTO>().ok(thirdLoginService.sdtSSOLogin(authCode, customerId));
}
/**
*
* @description: 三方视频播放登录
* @author qushutong
* @date 2023/10/18 9:48
* @param
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.UserTokenResultDTO>
* @Version1.0
**/
@PostMapping("video/login")
public Result<UserTokenResultDTO> videoLogin() {
// 暂且写死。
String customerId = "1535072605621841922";
return new Result<UserTokenResultDTO>().ok(thirdLoginService.videoLogin(customerId));
}
}

1
epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java

@ -149,4 +149,5 @@ public interface ThirdLoginService {
void sendLoginEvent(String userId, String appId, String fromApp, String fromClient,String messageType);
UserTokenResultDTO videoLogin(String customerId);
}

18
epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java

@ -861,6 +861,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol
//getResultDataOrThrowsException(result, ServiceConstant.EPMET_MESSAGE_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用Message服务,发送登录事件到MQ失败");
}
// 接入流程:https://open.dingtalk.com/document/isvapp-server/unified-authorization-suite-access-process
// 1、获取个人用户token:https://open.dingtalk.com/document/isvapp-server/obtain-user-token
// 2、获取用户通讯录个人信息:https://open.dingtalk.com/document/isvapp-server/dingtalk-retrieve-user-information
@ -1303,4 +1304,21 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol
return govWebService.loginByThirdPlatform(loginGovParam);
}
@Override
public UserTokenResultDTO videoLogin(String customerId) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("userName","apizhsq");
jsonObject.put("password","12345678@df");
jsonObject.put("type",1);
String videoData = HttpClientManager.getInstance().sendPostByJSON(AuthHttpUrlConstant.VIDEO_LOGIN_URL, jsonObject.toString()).getData();
JSONObject toResult = JSON.parseObject(videoData);
JSONObject data = (JSONObject) toResult.get(videoData);
UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO();
userTokenResultDTO.setCustomerId(customerId);
userTokenResultDTO.setToken((String) data.get("token"));
return userTokenResultDTO;
}
}

142
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/IcMonitoringDeviceDTO.java

@ -0,0 +1,142 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.result.yt;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 监控设备表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2023-10-18
*/
@Data
public class IcMonitoringDeviceDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 监控设备名称
*/
private String deviceName;
/**
* 监控设备编码
*/
private String deviceCode;
/**
* 状态1在线0离线
*/
private String deviceStatus;
/**
* 设备类型,1:球机2半球3
固定枪机5:卡口枪机,53:其他
*/
private String deviceType;
/**
* 摄像头详细地址
*/
private String deviceAddress;
/**
* 备注
*/
private String remark;
/**
* 中心点位经度
*/
private String longitude;
/**
* 中心点位纬度
*/
private String latitude;
/**
* 组织id
*/
private String agencyId;
/**
* 上级组织id
*/
private String parentAgencyId;
/**
* 组织的所有上级组织id
*/
private String agencyPids;
/**
* 网格id
*/
private String gridId;
/**
* 网格名称
*/
private String gridName;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

58
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcMonitoringDeviceController.java

@ -0,0 +1,58 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.result.yt.IcMonitoringDeviceDTO;
import com.epmet.service.IcMonitoringDeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 监控设备表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2023-10-18
*/
@RestController
@RequestMapping("icmonitoringdevice")
public class IcMonitoringDeviceController {
@Autowired
private IcMonitoringDeviceService icMonitoringDeviceService;
@GetMapping("page")
public Result<PageData<IcMonitoringDeviceDTO>> page(@RequestBody PageFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class);
PageData<IcMonitoringDeviceDTO> page = icMonitoringDeviceService.page(formDTO);
return new Result<PageData<IcMonitoringDeviceDTO>>().ok(page);
}
}

34
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcMonitoringDeviceDao.java

@ -0,0 +1,34 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.IcMonitoringDeviceEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 监控设备表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2023-10-18
*/
@Mapper
public interface IcMonitoringDeviceDao extends BaseDao<IcMonitoringDeviceEntity> {
}

113
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcMonitoringDeviceEntity.java

@ -0,0 +1,113 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 监控设备表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2023-10-18
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_monitoring_device")
public class IcMonitoringDeviceEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 监控设备名称
*/
private String deviceName;
/**
* 监控设备编码
*/
private String deviceCode;
/**
* 状态1在线0离线
*/
private String deviceStatus;
/**
* 设备类型,1:球机2半球3
固定枪机5:卡口枪机,53:其他
*/
private String deviceType;
/**
* 摄像头详细地址
*/
private String deviceAddress;
/**
* 备注
*/
private String remark;
/**
* 中心点位经度
*/
private String longitude;
/**
* 中心点位纬度
*/
private String latitude;
/**
* 组织id
*/
private String agencyId;
/**
* 上级组织id
*/
private String parentAgencyId;
/**
* 组织的所有上级组织id
*/
private String agencyPids;
/**
* 网格id
*/
private String gridId;
/**
* 网格名称
*/
private String gridName;
}

51
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcMonitoringDeviceService.java

@ -0,0 +1,51 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.result.yt.IcMonitoringDeviceDTO;
import com.epmet.entity.IcMonitoringDeviceEntity;
import java.util.List;
import java.util.Map;
/**
* 监控设备表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2023-10-18
*/
public interface IcMonitoringDeviceService extends BaseService<IcMonitoringDeviceEntity> {
/**
* 默认分页
*
* @param
* @return PageData<IcMonitoringDeviceDTO>
* @author generator
* @date 2023-10-18
*/
PageData<IcMonitoringDeviceDTO> page(PageFormDTO formDTO);
}

61
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcMonitoringDeviceServiceImpl.java

@ -0,0 +1,61 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.SecurityUser;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IcMonitoringDeviceDao;
import com.epmet.dto.result.yt.IcMonitoringDeviceDTO;
import com.epmet.entity.IcMonitoringDeviceEntity;
import com.epmet.service.IcMonitoringDeviceService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 监控设备表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2023-10-18
*/
@Service
public class IcMonitoringDeviceServiceImpl extends BaseServiceImpl<IcMonitoringDeviceDao, IcMonitoringDeviceEntity> implements IcMonitoringDeviceService {
@Override
public PageData<IcMonitoringDeviceDTO> page(PageFormDTO formDTO) {
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
QueryWrapper<IcMonitoringDeviceEntity> wrapper = new QueryWrapper<>();
// wrapper.eq("AGENCY_ID",SecurityUser.getDeptId());
List<IcMonitoringDeviceEntity> list = baseDao.selectList(wrapper);
List<IcMonitoringDeviceDTO> icMonitoringDeviceDTOS = ConvertUtils.sourceToTarget(list, IcMonitoringDeviceDTO.class);
PageInfo<IcMonitoringDeviceDTO> pageInfo = new PageInfo<>(icMonitoringDeviceDTOS);
return new PageData<>(icMonitoringDeviceDTOS, pageInfo.getTotal());
}
}

31
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMonitoringDeviceDao.xml

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.IcMonitoringDeviceDao">
<resultMap type="com.epmet.entity.IcMonitoringDeviceEntity" id="icMonitoringDeviceMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="deviceName" column="DEVICE_NAME"/>
<result property="deviceCode" column="DEVICE_CODE"/>
<result property="deviceStatus" column="DEVICE_STATUS"/>
<result property="deviceType" column="DEVICE_TYPE"/>
<result property="deviceAddress" column="DEVICE_ADDRESS"/>
<result property="remark" column="REMARK"/>
<result property="longitude" column="LONGITUDE"/>
<result property="latitude" column="LATITUDE"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="parentAgencyId" column="PARENT_AGENCY_ID"/>
<result property="agencyPids" column="AGENCY_PIDS"/>
<result property="gridId" column="GRID_ID"/>
<result property="gridName" column="GRID_NAME"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>
Loading…
Cancel
Save