diff --git a/epmet-auth/src/main/java/com/epmet/constant/AuthHttpUrlConstant.java b/epmet-auth/src/main/java/com/epmet/constant/AuthHttpUrlConstant.java index cb6ecf6194..e4532588f5 100644 --- a/epmet-auth/src/main/java/com/epmet/constant/AuthHttpUrlConstant.java +++ b/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"; + } diff --git a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java index b55ec45b9f..ca92e9f17f 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java @@ -267,4 +267,21 @@ public class ThirdLoginController { return new Result().ok(thirdLoginService.sdtSSOLogin(authCode, customerId)); } + /** + * + * @description: 三方视频播放登录 + * @author qushutong + * @date 2023/10/18 9:48 + * @param + * @return com.epmet.commons.tools.utils.Result + * @Version1.0 + **/ + @PostMapping("video/login") + public Result videoLogin() { + // 暂且写死。 + String customerId = "1535072605621841922"; + return new Result().ok(thirdLoginService.videoLogin(customerId)); + } + + } diff --git a/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java b/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java index c52d783561..979d7ca592 100644 --- a/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java +++ b/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); } diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index c30f5c3c42..bc6114a2ed 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/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; + } + } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/IcMonitoringDeviceDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/IcMonitoringDeviceDTO.java new file mode 100644 index 0000000000..a9de7732ed --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcMonitoringDeviceController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcMonitoringDeviceController.java new file mode 100644 index 0000000000..45415b952a --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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> page(@RequestBody PageFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); + PageData page = icMonitoringDeviceService.page(formDTO); + return new Result>().ok(page); + } + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcMonitoringDeviceDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcMonitoringDeviceDao.java new file mode 100644 index 0000000000..9b5d9c5f80 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcMonitoringDeviceEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcMonitoringDeviceEntity.java new file mode 100644 index 0000000000..7401f69762 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcMonitoringDeviceService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcMonitoringDeviceService.java new file mode 100644 index 0000000000..3f454aecae --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + + /** + * 默认分页 + * + * @param + * @return PageData + * @author generator + * @date 2023-10-18 + */ + PageData page(PageFormDTO formDTO); + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcMonitoringDeviceServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcMonitoringDeviceServiceImpl.java new file mode 100644 index 0000000000..a05990fc72 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 implements IcMonitoringDeviceService { + + + @Override + public PageData page(PageFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + QueryWrapper wrapper = new QueryWrapper<>(); +// wrapper.eq("AGENCY_ID",SecurityUser.getDeptId()); + List list = baseDao.selectList(wrapper); + List icMonitoringDeviceDTOS = ConvertUtils.sourceToTarget(list, IcMonitoringDeviceDTO.class); + PageInfo pageInfo = new PageInfo<>(icMonitoringDeviceDTOS); + return new PageData<>(icMonitoringDeviceDTOS, pageInfo.getTotal()); + } + + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMonitoringDeviceDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMonitoringDeviceDao.xml new file mode 100644 index 0000000000..594cecb1ba --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMonitoringDeviceDao.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file