Commit df5e85dc authored by kongfm's avatar kongfm

Merge branch 'developer' of http://e7ypyu8.nat.ipyingshe.com/moa/amos-boot-biz into developer

parents 669022be 6eadb145
...@@ -67,7 +67,7 @@ public class ControllerAop { ...@@ -67,7 +67,7 @@ public class ControllerAop {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest request = attributes.getRequest(); HttpServletRequest request = attributes.getRequest();
// 不需要添加请求头的接口 // 不需要添加请求头的接口
String[] url = new String[]{"/api/user/selectInfo", "/api/user/save/curCompany", "/jcs/command/lookHtmlText", String[] url = new String[]{"/api/user/save/curCompany", "/jcs/command/lookHtmlText",
"/jcs/common/duty-person/findByDutyAreaId", "/tzs/wechatBack", "/tzs/elevator/getElevatorInfo"}; "/jcs/common/duty-person/findByDutyAreaId", "/tzs/wechatBack", "/tzs/elevator/getElevatorInfo"};
// 获取请求路径 // 获取请求路径
for (String uri : url) { for (String uri : url) {
......
...@@ -42,6 +42,16 @@ public class BaseController { ...@@ -42,6 +42,16 @@ public class BaseController {
return JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class); return JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
} }
/**
* 用户选择信息保存redis
*/
protected void saveSelectedOrgInfo(ReginParams reginParams) {
redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParams));
}
protected String getOrgCode(ReginParams reginParams) { protected String getOrgCode(ReginParams reginParams) {
if (reginParams == null) { if (reginParams == null) {
return null; return null;
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
u.sequence_nbr sequenceNbr, u.sequence_nbr sequenceNbr,
u.biz_org_name bizOrgName, u.biz_org_name bizOrgName,
u.biz_org_code bizOrgCode, u.biz_org_code bizOrgCode,
u.parent_id parent_id,
g.* g.*
FROM FROM
cb_org_usr u cb_org_usr u
...@@ -72,6 +73,9 @@ ...@@ -72,6 +73,9 @@
<if test="map.amosOrgId != null and map.amosOrgId != '-1'"> <if test="map.amosOrgId != null and map.amosOrgId != '-1'">
AND u.amos_org_id like concat(#{map.amosOrgId}, '%') AND u.amos_org_id like concat(#{map.amosOrgId}, '%')
</if> </if>
<if test="map.company != null and map.company != '-1'">
AND u.parent_id = #{map.company}
</if>
GROUP BY GROUP BY
u.sequence_nbr , u.sequence_nbr ,
u.biz_org_name , u.biz_org_name ,
...@@ -141,7 +145,7 @@ ...@@ -141,7 +145,7 @@
AND u.amos_org_code like concat('%',#{map.amosOrgCode}, '%') AND u.amos_org_code like concat('%',#{map.amosOrgCode}, '%')
</if> </if>
<if test="map.company != null and map.company != '-1'"> <if test="map.company != null and map.company != '-1'">
AND u.parent_id = #{company} AND u.parent_id = #{map.company}
</if> </if>
GROUP BY GROUP BY
u.sequence_nbr , u.sequence_nbr ,
......
...@@ -20,6 +20,20 @@ ...@@ -20,6 +20,20 @@
<groupId>org.apache.tika</groupId> <groupId>org.apache.tika</groupId>
<artifactId>tika-parsers</artifactId> <artifactId>tika-parsers</artifactId>
<version>1.17</version> <version>1.17</version>
<exclusions>
<exclusion>
<artifactId>poi</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
<exclusion>
<artifactId>poi-ooxml</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
<exclusion>
<artifactId>poi-scratchpad</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.yeejoin</groupId> <groupId>com.yeejoin</groupId>
......
...@@ -8,11 +8,19 @@ import lombok.Data; ...@@ -8,11 +8,19 @@ import lombok.Data;
@Data @Data
public class AlamVideoVO { public class AlamVideoVO {
private Long id; private Long id;
private String url; private String url;
private String token; private String token;
private String name; private String name;
private String code; private String code;
private String address;
private String img;
private String presetPosition; private String presetPosition;
} }
...@@ -2,6 +2,7 @@ package com.yeejoin.equipmanage.common.entity.vo; ...@@ -2,6 +2,7 @@ package com.yeejoin.equipmanage.common.entity.vo;
import lombok.Data; import lombok.Data;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -18,6 +19,6 @@ public class DetailPaneVO { ...@@ -18,6 +19,6 @@ public class DetailPaneVO {
//图片 //图片
private String pic; private String pic;
//参数 //参数
private List<Map<String,String>> items; private List<Map<String,String>> items = new ArrayList<Map<String,String>>();
} }
package com.yeejoin.equipmanage.common.enums;
/**
* 画布资源枚举
* @author DELL
*
*/
public enum BitmapEnum {
equipment("消防类设备", "equipment"),
video("视频类设备", "video");
BitmapEnum(String name, String key) {
this.name = name;
this.key = key;
}
private String name;
private String key;
public String getName() {
return name;
}
public String getKey() {
return key;
}
}
//package com.yeejoin.equipmanage.common.exception.handle; package com.yeejoin.equipmanage.common.exception.handle;
//
//import org.slf4j.Logger; import org.slf4j.Logger;
//import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
//import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
//import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ExceptionHandler;
//import org.springframework.web.bind.annotation.RestControllerAdvice; import org.springframework.web.bind.annotation.RestControllerAdvice;
//import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.RequestContextHolder;
//import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.context.request.ServletRequestAttributes;
//import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
//import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
//
//import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
//
///** /**
// * @description: 全局异常处理器 * @description: 全局异常处理器
// * @author: duanwei * @author: duanwei
// * @create: 2019-08-28 20:07 * @create: 2019-08-28 20:07
// **/ **/
//@RestControllerAdvice @RestControllerAdvice
//public class GlobalExceptionHandler { public class GlobalExceptionHandler {
//
// private Logger log = LoggerFactory.getLogger(this.getClass()); private Logger log = LoggerFactory.getLogger(this.getClass());
//
// public GlobalExceptionHandler() { public GlobalExceptionHandler() {
// } }
//
// @ExceptionHandler({ Exception.class }) @ExceptionHandler({ Exception.class })
// public ResponseModel<Object> MethodArgumentNotValidHandler(Exception exception) throws Exception { public ResponseModel<Object> MethodArgumentNotValidHandler(Exception exception) throws Exception {
// HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()) HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
// .getRequest(); .getRequest();
// ResponseModel<Object> response = new ResponseModel<>(); ResponseModel<Object> response = new ResponseModel<>();
//
// //解析平台返回错误信息,统一返回403,app 端统一跳转到登录页面 //解析平台返回错误信息,统一返回403,app 端统一跳转到登录页面
// if(exception.getMessage()!=null&&exception.getMessage().indexOf("账号已经在其他设备登录")!=-1 ||exception.getMessage().indexOf("请重新登录")!=-1){ if(exception.getMessage()!=null&&exception.getMessage().indexOf("账号已经在其他设备登录")!=-1 ||exception.getMessage().indexOf("请重新登录")!=-1){
// response.setStatus(HttpStatus.FORBIDDEN.value()); response.setStatus(HttpStatus.FORBIDDEN.value());
// }else{ }else{
// response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value()); response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
// } }
//
// response.setDevMessage("FAILED"); response.setDevMessage("FAILED");
// response.setMessage( exception.getMessage()); response.setMessage( exception.getMessage());
// response.setTraceId(RequestContext.getTraceId()); response.setTraceId(RequestContext.getTraceId());
// response.setPath(request.getServletPath());exception.printStackTrace(); response.setPath(request.getServletPath());exception.printStackTrace();
// return response; return response;
// } }
//
//} }
...@@ -136,7 +136,7 @@ public class DateUtils { ...@@ -136,7 +136,7 @@ public class DateUtils {
* @throws ParseException * @throws ParseException
*/ */
public static String dateFormat(Date date, String pattern) throws ParseException { public static String dateFormat(Date date, String pattern) throws ParseException {
if (StringUtils.isNotEmpty(pattern)) { if (StringUtils.isEmpty(pattern)) {
pattern = DateUtils.DATE_PATTERN; pattern = DateUtils.DATE_PATTERN;
} }
SimpleDateFormat sdf = new SimpleDateFormat(pattern); SimpleDateFormat sdf = new SimpleDateFormat(pattern);
......
...@@ -354,10 +354,10 @@ public class ExcelUtil ...@@ -354,10 +354,10 @@ public class ExcelUtil
style.setWrapText(true); style.setWrapText(true);
style.setAlignment(HorizontalAlignment.CENTER);// 左右居中 style.setAlignment(HorizontalAlignment.CENTER);// 左右居中
style.setVerticalAlignment(VerticalAlignment.CENTER); style.setVerticalAlignment(VerticalAlignment.CENTER);
style.setLeftBorderColor(HSSFColor.BLACK.index);// 左边框的颜色 // style.setLeftBorderColor(HSSFColor.BLACK.index);// 左边框的颜色
style.setRightBorderColor(HSSFColor.BLACK.index);// 右边框的颜色 // style.setRightBorderColor(HSSFColor.BLACK.index);// 右边框的颜色
style.setBottomBorderColor(HSSFColor.BLACK.index); // 设置单元格的边框颜色 // style.setBottomBorderColor(HSSFColor.BLACK.index); // 设置单元格的边框颜色
style.setFillForegroundColor(HSSFColor.WHITE.index); // style.setFillForegroundColor(HSSFColor.WHITE.index);
style.setBorderBottom(BorderStyle.THIN); style.setBorderBottom(BorderStyle.THIN);
style.setBorderLeft(BorderStyle.THIN); style.setBorderLeft(BorderStyle.THIN);
style.setBorderRight(BorderStyle.THIN); style.setBorderRight(BorderStyle.THIN);
......
...@@ -7,6 +7,7 @@ import java.util.Set; ...@@ -7,6 +7,7 @@ import java.util.Set;
import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
...@@ -41,7 +42,7 @@ public interface ImportFile { ...@@ -41,7 +42,7 @@ public interface ImportFile {
Cell cell = row.getCell(cellNum); Cell cell = row.getCell(cellNum);
if (cell.getCellType() == HSSFCell.CELL_TYPE_STRING) { if (cell.getCellType() == CellType.STRING) {
if (null != cell && StringUtil.isNotEmpty(cell.getStringCellValue())) { if (null != cell && StringUtil.isNotEmpty(cell.getStringCellValue())) {
ParsePropertyUtil.setting(value_1::add, () -> cell.getStringCellValue()); ParsePropertyUtil.setting(value_1::add, () -> cell.getStringCellValue());
ParsePropertyUtil.setting(value_2::add, () -> cell.getStringCellValue()); ParsePropertyUtil.setting(value_2::add, () -> cell.getStringCellValue());
......
...@@ -14,38 +14,38 @@ public class EquipmentAlarmDownloadVO implements Serializable { ...@@ -14,38 +14,38 @@ public class EquipmentAlarmDownloadVO implements Serializable {
@ExcelProperty(value = "告警类型", index = 0) @ExcelProperty(value = "告警类型", index = 0)
private String alarmType; private String alarmType = "";
@ExcelProperty(value = "告警设备", index = 1) @ExcelProperty(value = "告警设备", index = 1)
private String equipName; private String equipName = "";
@ExcelProperty(value = "告警内容", index = 2) @ExcelProperty(value = "告警内容", index = 2)
private String alarmContent; private String alarmContent = "";
@ExcelProperty(value = "设备编号", index = 3) @ExcelProperty(value = "设备编号", index = 3)
private String equipCode; private String equipCode = "";
@ExcelProperty(value = "告警位置", index = 4) @ExcelProperty(value = "告警位置", index = 4)
private String alarmPosition; private String alarmPosition = "";
@ExcelProperty(value = "保护对象", index = 5) @ExcelProperty(value = "保护对象", index = 5)
private String protectObj; private String protectObj = "";
@ExcelProperty(value = "告警时间", index = 6) @ExcelProperty(value = "告警时间", index = 6)
private String alarmTime; private String alarmTime = "";
@ExcelProperty(value = "处理状态", index = 7) @ExcelProperty(value = "处理状态", index = 7)
private String handleStatus; private String handleStatus = "";
@ExcelProperty(value = "处理类型", index = 8) @ExcelProperty(value = "处理类型", index = 8)
private String handleType; private String handleType = "";
@ExcelProperty(value = "处理时间", index = 9) @ExcelProperty(value = "处理时间", index = 9)
private String confirmDate; private String confirmDate = "";
@ExcelProperty(value = "报警原因", index = 10) @ExcelProperty(value = "报警原因", index = 10)
private String alarmReason; private String alarmReason = "";
@ExcelProperty(value = "处理情况", index = 11) @ExcelProperty(value = "处理情况", index = 11)
private String resolveResult; private String resolveResult = "";
} }
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
and a.call_time between #{startTime} and #{endTime} and a.call_time between #{startTime} and #{endTime}
</if> </if>
<if test="alertTypeCode!= null and alertTypeCode!= '' "> <if test="alertTypeCode!= null and alertTypeCode!= '' ">
and a.alert_type_code = #{alertTypeCode} and a.alarm_type_code = #{alertTypeCode}
</if> </if>
<if test="alertSourceCode!= null "> <if test="alertSourceCode!= null ">
and a.alert_source_code = #{alertSourceCode} and a.alert_source_code = #{alertSourceCode}
...@@ -177,7 +177,10 @@ ...@@ -177,7 +177,10 @@
<select id="selectAllCount" resultType="int"> <select id="selectAllCount" resultType="int">
SELECT SELECT
count(a.sequence_nbr) as num count(b.num)
FROM
(SELECT
a.sequence_nbr as num
FROM FROM
jc_alert_called a jc_alert_called a
<if test="isFatherAlert!= null and isFatherAlert == 'true' "> <if test="isFatherAlert!= null and isFatherAlert == 'true' ">
...@@ -191,7 +194,7 @@ ...@@ -191,7 +194,7 @@
and a.call_time between #{startTime} and #{endTime} and a.call_time between #{startTime} and #{endTime}
</if> </if>
<if test="alertTypeCode!= null and alertTypeCode!= '' "> <if test="alertTypeCode!= null and alertTypeCode!= '' ">
and a.alarm_type_code = #{alertTypeCode} and a.alert_type_code = #{alertTypeCode}
</if> </if>
<if test="alertSourceCode!= null "> <if test="alertSourceCode!= null ">
and a.alert_source_code = #{alertSourceCode} and a.alert_source_code = #{alertSourceCode}
...@@ -203,7 +206,7 @@ ...@@ -203,7 +206,7 @@
and j.alert_called_id = a.sequence_nbr and j.alert_called_id = a.sequence_nbr
GROUP BY a.sequence_nbr GROUP BY a.sequence_nbr
</if> </if>
</where> </where>) b
</select> </select>
......
...@@ -125,8 +125,11 @@ public class FireStationController extends BaseController { ...@@ -125,8 +125,11 @@ public class FireStationController extends BaseController {
@GetMapping(value = "/list/page") @GetMapping(value = "/list/page")
@ApiOperation(httpMethod = "GET", value = "新微型消防站分页查询", notes = "新微型消防站分页查询") @ApiOperation(httpMethod = "GET", value = "新微型消防站分页查询", notes = "新微型消防站分页查询")
public ResponseModel<Page<FireStationDto>> getFireStation(@RequestParam(value = "pageNum") int pageNum, public ResponseModel<Page<FireStationDto>> getFireStation(@RequestParam(value = "pageNum") int pageNum,
@RequestParam(value = "pageSize") int pageSize, @RequestParam(value = "pageSize") int pageSize,@RequestParam(value = "company",required = false) Long company,
FireStationDto fireStationDto) { FireStationDto fireStationDto) {
if (company != null && company != -1){
fireStationDto.setBizCompanyId(company);
}
return ResponseHelper.buildResponse(fireStationServiceImpl.getFirefighters(pageNum, pageSize, fireStationDto)); return ResponseHelper.buildResponse(fireStationServiceImpl.getFirefighters(pageNum, pageSize, fireStationDto));
} }
......
...@@ -393,10 +393,12 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -393,10 +393,12 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
if (!ObjectUtils.isEmpty(req.get("bizOrgName"))) { if (!ObjectUtils.isEmpty(req.get("bizOrgName"))) {
map.put("bizOrgName", req.get("bizOrgName")); map.put("bizOrgName", req.get("bizOrgName"));
} }
if (!ObjectUtils.isEmpty(req.get("personNumber"))) { if (!ObjectUtils.isEmpty(req.get("personNumber"))) {
map.put("personNumber", req.get("personNumber")); map.put("personNumber", req.get("personNumber"));
} }
if (req.containsKey("company") &&!ObjectUtils.isEmpty(req.get("company"))) {
req.put("parentId", req.get("company"));
}
/* BUG2680 查询部门人员错误 传递参数类型不正确 修改为string 2021-09-14 陈召 开始 */ /* BUG2680 查询部门人员错误 传递参数类型不正确 修改为string 2021-09-14 陈召 开始 */
if (req.get("parentId") != null && req.get("parentId") != "") { if (req.get("parentId") != null && req.get("parentId") != "") {
OrgUsr parent = this.getById(req.get("parentId").toString()); OrgUsr parent = this.getById(req.get("parentId").toString());
...@@ -412,7 +414,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -412,7 +414,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
req.remove("pageNum"); req.remove("pageNum");
req.remove("parentId"); req.remove("parentId");
req.remove("amosOrgId"); req.remove("amosOrgId");
req.remove("company");
map.put("fieldsValue", req); map.put("fieldsValue", req);
map.put("fields", alertFormServiceImpl.queryListByFormId(OrgPersonEnum.人员.getCode())); map.put("fields", alertFormServiceImpl.queryListByFormId(OrgPersonEnum.人员.getCode()));
pageBean.setTotal(this.baseMapper.selectPersonListCount(map)); pageBean.setTotal(this.baseMapper.selectPersonListCount(map));
......
...@@ -4,18 +4,23 @@ import java.util.Optional; ...@@ -4,18 +4,23 @@ import java.util.Optional;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.yeejoin.equipmanage.common.entity.vo.AppDownloadVO;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import com.yeejoin.equipmanage.common.entity.publics.CommonResponse; import com.yeejoin.equipmanage.common.entity.publics.CommonResponse;
import com.yeejoin.equipmanage.common.entity.vo.AppDownloadVO;
import com.yeejoin.equipmanage.common.utils.ExcelUtil; import com.yeejoin.equipmanage.common.utils.ExcelUtil;
import com.yeejoin.equipmanage.common.utils.FileUploadTypeEnum; import com.yeejoin.equipmanage.common.utils.FileUploadTypeEnum;
import com.yeejoin.equipmanage.service.IDownloadFileService; import com.yeejoin.equipmanage.service.IDownloadFileService;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
......
...@@ -153,8 +153,8 @@ public class EquipmentSpecificController extends AbstractBaseController { ...@@ -153,8 +153,8 @@ public class EquipmentSpecificController extends AbstractBaseController {
@RequestMapping(value = "/getOneCard", method = RequestMethod.GET) @RequestMapping(value = "/getOneCard", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "组装组态使用装备卡片数据") @ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "组装组态使用装备卡片数据")
public DetailPaneVO getOneCard(Long id) { public Object getOneCard(Long id , String type) {
return equipmentSpecificSerivce.getOneCard(id); return equipmentSpecificSerivce.getOneCard(id , type);
} }
/** /**
......
...@@ -35,6 +35,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -35,6 +35,7 @@ import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -44,11 +45,14 @@ import com.alibaba.fastjson.JSONObject; ...@@ -44,11 +45,14 @@ import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo; import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.bo.RoleBo;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel; import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel; import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel; import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import com.yeejoin.equipmanage.common.entity.publics.CommonResponse; import com.yeejoin.equipmanage.common.entity.publics.CommonResponse;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil; import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
...@@ -509,7 +513,7 @@ public class UserController extends AbstractBaseController { ...@@ -509,7 +513,7 @@ public class UserController extends AbstractBaseController {
/** /**
* APP登录 * APP登录
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.PUBLIC, needAuth = false)
@ApiOperation(value = "APP登录", notes = "APP登录") @ApiOperation(value = "APP登录", notes = "APP登录")
@PostMapping(value = "/mobile/login") @PostMapping(value = "/mobile/login")
public ResponseModel mobileLogin(@ApiParam(value = "账号", required = true) @RequestBody AppLoginUserParam param) { public ResponseModel mobileLogin(@ApiParam(value = "账号", required = true) @RequestBody AppLoginUserParam param) {
...@@ -522,7 +526,7 @@ public class UserController extends AbstractBaseController { ...@@ -522,7 +526,7 @@ public class UserController extends AbstractBaseController {
result.put("userId", jsonObject.getString("userId")); result.put("userId", jsonObject.getString("userId"));
result.put("appKey", jsonObject.getString("appKey")); result.put("appKey", jsonObject.getString("appKey"));
result.put("product", jsonObject.getString("product")); result.put("product", jsonObject.getString("product"));
result.put("jpushUserKey", appMessagePushService.buildJpushUserKey(jsonObject.getString("userId"))); result.put("jpushUserKey", AppMessagePushService.buildJpushUserKey(jsonObject.getString("userId")));
return CommonResponseUtil.success(result); return CommonResponseUtil.success(result);
} }
return CommonResponseUtil.failure("登录失败"); return CommonResponseUtil.failure("登录失败");
...@@ -605,6 +609,7 @@ public class UserController extends AbstractBaseController { ...@@ -605,6 +609,7 @@ public class UserController extends AbstractBaseController {
} }
Map<String, Object> mapRoles = objectToMap(user.getOrgRoles()); Map<String, Object> mapRoles = objectToMap(user.getOrgRoles());
result.put("userModel", user);
result.put("companys", listCompanyModel); result.put("companys", listCompanyModel);
result.put("orgRoles", user.getOrgRoles()); result.put("orgRoles", user.getOrgRoles());
result.put("companyDepartments", mapdate); result.put("companyDepartments", mapdate);
...@@ -684,49 +689,49 @@ public class UserController extends AbstractBaseController { ...@@ -684,49 +689,49 @@ public class UserController extends AbstractBaseController {
/** /**
* 保存登陆用户选择公司信息 * 保存登陆用户选择公司信息
*/ */
// @TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "保存登陆用户选择公司信息", notes = "保存登陆用户选择公司信息") @ApiOperation(value = "保存登陆用户选择公司信息", notes = "保存登陆用户选择公司信息")
// @PostMapping(value = "/save/curCompany") @PostMapping(value = "/save/curCompany")
// public JSONObject saveCurCompany( public JSONObject saveCurCompany(
// @ApiParam(value = "当前登陆用户所选单位机构编号", required = true) @RequestBody SelectUserInfo selectUserInfo) { @ApiParam(value = "当前登陆用户所选单位机构编号", required = true) @RequestBody SelectUserInfo selectUserInfo) {
// try { try {
// AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
//
// CompanyBo company = new CompanyBo(); CompanyBo company = new CompanyBo();
// DepartmentBo department = new DepartmentBo(); DepartmentBo department = new DepartmentBo();
// RoleBo role = new RoleBo(); RoleBo role = new RoleBo();
// if(ObjectUtils.isEmpty(selectUserInfo.getCompanyModel())){ if(ObjectUtils.isEmpty(selectUserInfo.getCompanyModel())){
// CompanyModel companyM = user.getCompanys().get(0); CompanyModel companyM = user.getCompanys().get(0);
// Bean.copyExistPropertis(companyM,company); Bean.copyExistPropertis(companyM,company);
//
// Map<Long, List<DepartmentModel>> mapDepartments = user.getCompanyDepartments(); Map<Long, List<DepartmentModel>> mapDepartments = user.getCompanyDepartments();
// DepartmentModel departmentM = mapDepartments.get(companyM.getSequenceNbr()).get(0); DepartmentModel departmentM = mapDepartments.get(companyM.getSequenceNbr()).get(0);
// Bean.copyExistPropertis(departmentM,department); Bean.copyExistPropertis(departmentM,department);
// Map<Long, List<RoleModel>> roles = user.getOrgRoles(); Map<Long, List<RoleModel>> roles = user.getOrgRoles();
// RoleModel roleM = roles.get(departmentM.getSequenceNbr()).get(0); RoleModel roleM = roles.get(departmentM.getSequenceNbr()).get(0);
//
// Bean.copyExistPropertis(roleM,role); Bean.copyExistPropertis(roleM,role);
// selectUserInfo.setCompanyModel(company); selectUserInfo.setCompanyModel(company);
// selectUserInfo.setDepartmentModel(department); selectUserInfo.setDepartmentModel(department);
// selectUserInfo.setRoleModel(role); selectUserInfo.setRoleModel(role);
// }else{ }else{
// company = selectUserInfo.getCompanyModel(); company = selectUserInfo.getCompanyModel();
// role = selectUserInfo.getRoleModel(); role = selectUserInfo.getRoleModel();
// department = selectUserInfo.getDepartmentModel(); department = selectUserInfo.getDepartmentModel();
// } }
// ReginParams reginParams = new ReginParams(); ReginParams reginParams = new ReginParams();
// reginParams.setCompany(company); reginParams.setUserModel(user);
// reginParams.setRole(role); reginParams.setCompany(company);
// reginParams.setDepartment(department); reginParams.setRole(role);
// saveSelectedOrgInfo(reginParams); reginParams.setDepartment(department);
// saveSelectedOrgInfo(reginParams);
// return buildCurCompany(selectUserInfo, user); return buildCurCompany(selectUserInfo, user);
// } catch (Exception e) { } catch (Exception e) {
// e.printStackTrace(); e.printStackTrace();
// logger.error("保存登陆用户选择公司信息异常", e); logger.error("保存登陆用户选择公司信息异常", e);
// throw new RuntimeException("系统繁忙,请稍后再试"); throw new RuntimeException("系统繁忙,请稍后再试");
// } }
// } }
private JSONObject buildCurCompany(SelectUserInfo selectUserInfo, AgencyUserModel user) { private JSONObject buildCurCompany(SelectUserInfo selectUserInfo, AgencyUserModel user) {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
......
...@@ -280,7 +280,7 @@ public class VideoController extends AbstractBaseController { ...@@ -280,7 +280,7 @@ public class VideoController extends AbstractBaseController {
@ApiOperation(httpMethod = "GET", value = "通过视频id和预置位获取可播放的flv格式地址", notes = "通过视频id和预置位获取可播放的flv格式地址") @ApiOperation(httpMethod = "GET", value = "通过视频id和预置位获取可播放的flv格式地址", notes = "通过视频id和预置位获取可播放的flv格式地址")
public String getVideoFlvUrl(@RequestParam String videoId, public String getVideoFlvUrl(@RequestParam String videoId,
@RequestParam String presetIndex) { @RequestParam String presetIndex) {
String flvUrl = videoService.getVideoUrl(videoId, presetIndex, ""); String flvUrl = videoService.getVideoUrl(videoId, presetIndex, "", "");
return flvUrl; return flvUrl;
} }
......
package com.yeejoin.equipmanage.fegin;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig;
/**
* @description:
* @author: tw
* @createDate: 2021/10/20
*/
@FeignClient(name = "${video.fegin.name}", path = "video", configuration = {MultipartSupportConfig.class})
public interface VideoFeignClient {
@RequestMapping(value = "/video-original/url/video/{indexCode}", method = RequestMethod.GET)
ResponseModel<String> videoUrlByIndexCode(@PathVariable("indexCode") String indexCode);
}
...@@ -41,7 +41,8 @@ public interface VideoMapper extends BaseMapper<Video> { ...@@ -41,7 +41,8 @@ public interface VideoMapper extends BaseMapper<Video> {
* @return * @return
*/ */
List<AlamVideoVO> getVideoBySpeId(Long id); List<AlamVideoVO> getVideoBySpeId(Long id);
List<AlamVideoVO> getVideoById(Long id);
AlamVideoVO getVideoById(Long id);
/** /**
......
...@@ -276,6 +276,7 @@ public class RemoteSecurityService { ...@@ -276,6 +276,7 @@ public class RemoteSecurityService {
dPasswordAuthModel.setPassword(DesUtil.encode(password, "qaz")); dPasswordAuthModel.setPassword(DesUtil.encode(password, "qaz"));
FeignClientResult feignClientResult = new FeignClientResult(); FeignClientResult feignClientResult = new FeignClientResult();
RequestContext.setProduct(productApp); RequestContext.setProduct(productApp);
RequestContext.setAppKey(appKeyApp);
feignClientResult = Privilege.authClient.idpassword(dPasswordAuthModel); feignClientResult = Privilege.authClient.idpassword(dPasswordAuthModel);
Map map = (Map) feignClientResult.getResult(); Map map = (Map) feignClientResult.getResult();
if (map != null) { if (map != null) {
......
...@@ -80,7 +80,7 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> { ...@@ -80,7 +80,7 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
* @param id * @param id
* @return * @return
*/ */
DetailPaneVO getOneCard(Long id); Object getOneCard(Long id, String type);
/** /**
* 通过id获取设备区域建筑等信息 * 通过id获取设备区域建筑等信息
......
...@@ -75,5 +75,5 @@ public interface IVideoService extends IService<Video> { ...@@ -75,5 +75,5 @@ public interface IVideoService extends IService<Video> {
* @param defaultUrl * @param defaultUrl
* @return * @return
*/ */
String getVideoUrl(String videoId, String presetIndex, String defaultUrl); String getVideoUrl(String videoId, String presetIndex, String defaultUrl, String code);
} }
...@@ -763,7 +763,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -763,7 +763,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
x.setLocation(x.getAddress()); x.setLocation(x.getAddress());
} }
} }
x.setUrl(videoService.getVideoUrl(x.getName(), x.getPresetPosition(), x.getUrl())); x.setUrl(videoService.getVideoUrl(x.getName(), x.getPresetPosition(), x.getUrl(), x.getCode()));
}); });
} }
return pages; return pages;
......
...@@ -43,6 +43,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -43,6 +43,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.util.StringUtil; import com.github.pagehelper.util.StringUtil;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.component.feign.config.InnerInvokException; import com.yeejoin.amos.component.feign.config.InnerInvokException;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
...@@ -238,8 +239,7 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarS ...@@ -238,8 +239,7 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarS
// redi缓存选择的用户信息 // redi缓存选择的用户信息
private String buildKey(String userId, String token) { private String buildKey(String userId, String token) {
return RedisKey.buildReginKey(userId, token);
return "region_" + userId + "_" + token;
} }
......
...@@ -83,9 +83,9 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -83,9 +83,9 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
final String alarmType = "IOT_CORE_PARAM"; final String alarmType = "IOT_CORE_PARAM";
Map<String, Object> res = new HashMap<>(); Map<String, Object> res = new HashMap<>();
if (videoType.equals(type)) { if (videoType.equals(type)) {
List<AlamVideoVO> video = videoMapper.getVideoById(equipId); List<AlamVideoVO> video = videoMapper.getVideoBySpeId(equipId);
video.forEach(action -> { video.forEach(action -> {
action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl())); action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl(), action.getCode()));
}); });
res.put("video", video); res.put("video", video);
return res; return res;
...@@ -103,7 +103,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -103,7 +103,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
} }
videoBySpeId.forEach(action -> { videoBySpeId.forEach(action -> {
action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl())); action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl(), action.getCode()));
}); });
res.put("data", specificAlarm); res.put("data", specificAlarm);
res.put("video", videoBySpeId); res.put("video", videoBySpeId);
......
...@@ -7,6 +7,7 @@ import java.net.SocketException; ...@@ -7,6 +7,7 @@ import java.net.SocketException;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -25,6 +26,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -25,6 +26,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.excel.ExcelUtil;
import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentFireAlarm; import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentFireAlarm;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecific; import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm; import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm;
...@@ -55,7 +57,6 @@ import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService; ...@@ -55,7 +57,6 @@ import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificIndexSerivce; import com.yeejoin.equipmanage.service.IEquipmentSpecificIndexSerivce;
import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce; import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce;
import com.yeejoin.equipmanage.service.IVideoService; import com.yeejoin.equipmanage.service.IVideoService;
import com.yeejoin.equipmanage.utils.ExcelUtil;
/** /**
* @author DELL * @author DELL
...@@ -103,11 +104,11 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -103,11 +104,11 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
throw new RuntimeException("导出数据列表无数据!"); throw new RuntimeException("导出数据列表无数据!");
} }
ExcelUtil.createTemplate(response, "设备告警信息", "设备告警信息", equipmentDownloads, EquipmentAlarmDownloadVO.class, null, ExcelUtil.createTemplate(response, "设备告警信息", "设备告警信息", equipmentDownloads, EquipmentAlarmDownloadVO.class, null,
null, null, false); false);
} }
public List<EquipmentAlarmDownloadVO> handleExportData(List<Long> ids, List<HashMap<String, Object>> list) { public List<EquipmentAlarmDownloadVO> handleExportData(List<Long> ids, List<HashMap<String, Object>> list) {
SimpleDateFormat sdf = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN);
List<EquipmentAlarmDownloadVO> equipmentDownloads = new ArrayList<>(); List<EquipmentAlarmDownloadVO> equipmentDownloads = new ArrayList<>();
if (!ObjectUtils.isEmpty(ids) && 0 < ids.size()) { if (!ObjectUtils.isEmpty(ids) && 0 < ids.size()) {
if (0 < list.size()) { if (0 < list.size()) {
...@@ -123,13 +124,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -123,13 +124,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
alarmDownloadVO.setEquipCode(StringUtil.isNotEmpty(alarm.get("fireEquipmentCode")) ? alarm.get("fireEquipmentCode").toString() : ""); alarmDownloadVO.setEquipCode(StringUtil.isNotEmpty(alarm.get("fireEquipmentCode")) ? alarm.get("fireEquipmentCode").toString() : "");
alarmDownloadVO.setAlarmPosition(StringUtil.isNotEmpty(alarm.get("warehouseStructureName")) ? alarm.get("warehouseStructureName").toString() : ""); alarmDownloadVO.setAlarmPosition(StringUtil.isNotEmpty(alarm.get("warehouseStructureName")) ? alarm.get("warehouseStructureName").toString() : "");
alarmDownloadVO.setProtectObj(StringUtil.isNotEmpty(alarm.get("equipmentName")) ? alarm.get("equipmentName").toString() : ""); alarmDownloadVO.setProtectObj(StringUtil.isNotEmpty(alarm.get("equipmentName")) ? alarm.get("equipmentName").toString() : "");
alarmDownloadVO.setAlarmTime(sdf.format(alarm.get("createDate"))); alarmDownloadVO.setAlarmTime(StringUtil.isNotEmpty(alarm.get("createDate")) ? alarm.get("createDate").toString().replace("T", " "):"");
// 处理状态、处理类型无业务字段,后期业务功能实现之后需在此处返回相应字段 // 处理状态、处理类型无业务字段,后期业务功能实现之后需在此处返回相应字段
alarmDownloadVO.setHandleStatus(String.valueOf(alarm.get("handleStatus"))); alarmDownloadVO.setHandleStatus(String.valueOf(alarm.get("handleStatus")));
alarmDownloadVO.setHandleType(ConfirmAlamEnum.getTypeByCode(String.valueOf(alarm.get("handleType")))); alarmDownloadVO.setHandleType(ConfirmAlamEnum.getTypeByCode(String.valueOf(alarm.get("handleType"))));
alarmDownloadVO.setResolveResult(StringUtil.isNotEmpty(alarm.get("resolveResult")) ? alarm.get("resolveResult").toString() : ""); alarmDownloadVO.setResolveResult(StringUtil.isNotEmpty(alarm.get("resolveResult")) ? alarm.get("resolveResult").toString() : "");
alarmDownloadVO.setConfirmDate(StringUtil.isNotEmpty(alarm.get("confirmDate")) ?sdf.format(alarm.get("confirmDate")) : ""); alarmDownloadVO.setConfirmDate(StringUtil.isNotEmpty(alarm.get("confirmDate")) ?alarm.get("confirmDate").toString().replace("T", " ") : "");
alarmDownloadVO.setAlarmReason(StringUtil.isNotEmpty(alarm.get("alarmReason")) ? alarm.get("alarmReason").toString() : ""); alarmDownloadVO.setAlarmReason(StringUtil.isNotEmpty(alarm.get("alarmReason")) ? alarm.get("alarmReason").toString() : "");
equipmentDownloads.add(alarmDownloadVO); equipmentDownloads.add(alarmDownloadVO);
} }
...@@ -150,13 +151,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -150,13 +151,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
alarmDownloadVO.setEquipCode(StringUtil.isNotEmpty(alarm.get("fireEquipmentCode")) ? alarm.get("fireEquipmentCode").toString() : ""); alarmDownloadVO.setEquipCode(StringUtil.isNotEmpty(alarm.get("fireEquipmentCode")) ? alarm.get("fireEquipmentCode").toString() : "");
alarmDownloadVO.setAlarmPosition(StringUtil.isNotEmpty(alarm.get("warehouseStructureName")) ? alarm.get("warehouseStructureName").toString() : ""); alarmDownloadVO.setAlarmPosition(StringUtil.isNotEmpty(alarm.get("warehouseStructureName")) ? alarm.get("warehouseStructureName").toString() : "");
alarmDownloadVO.setProtectObj(StringUtil.isNotEmpty(alarm.get("equipmentName")) ? alarm.get("equipmentName").toString() : ""); alarmDownloadVO.setProtectObj(StringUtil.isNotEmpty(alarm.get("equipmentName")) ? alarm.get("equipmentName").toString() : "");
alarmDownloadVO.setAlarmTime(sdf.format(alarm.get("createDate"))); alarmDownloadVO.setAlarmTime(StringUtil.isNotEmpty(alarm.get("createDate")) ? alarm.get("createDate").toString().replace("T", " "):"");
// 处理状态、处理类型无业务字段,后期业务功能实现之后需在此处返回相应字段 // 处理状态、处理类型无业务字段,后期业务功能实现之后需在此处返回相应字段
alarmDownloadVO.setHandleStatus(String.valueOf(alarm.get("handleStatus"))); alarmDownloadVO.setHandleStatus(String.valueOf(alarm.get("handleStatus")));
alarmDownloadVO.setHandleType(ConfirmAlamEnum.getTypeByCode(String.valueOf(alarm.get("handleType")))); alarmDownloadVO.setHandleType(ConfirmAlamEnum.getTypeByCode(String.valueOf(alarm.get("handleType"))));
alarmDownloadVO.setResolveResult(StringUtil.isNotEmpty(alarm.get("resolveResult")) ? alarm.get("resolveResult").toString() : ""); alarmDownloadVO.setResolveResult(StringUtil.isNotEmpty(alarm.get("resolveResult")) ? alarm.get("resolveResult").toString() : "");
alarmDownloadVO.setConfirmDate(StringUtil.isNotEmpty(alarm.get("confirmDate")) ?sdf.format(alarm.get("confirmDate")) : ""); alarmDownloadVO.setConfirmDate(StringUtil.isNotEmpty(alarm.get("confirmDate")) ?alarm.get("confirmDate").toString().replace("T", " ") : "");
alarmDownloadVO.setAlarmReason(StringUtil.isNotEmpty(alarm.get("alarmReason")) ? alarm.get("alarmReason").toString() : ""); alarmDownloadVO.setAlarmReason(StringUtil.isNotEmpty(alarm.get("alarmReason")) ? alarm.get("alarmReason").toString() : "");
equipmentDownloads.add(alarmDownloadVO); equipmentDownloads.add(alarmDownloadVO);
}); });
...@@ -236,7 +237,7 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -236,7 +237,7 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
video.setName(x.getName()); video.setName(x.getName());
video.setTokens(x.getToken()); video.setTokens(x.getToken());
video.setUrl(x.getUrl()); video.setUrl(x.getUrl());
video.setUrl(videoService.getVideoUrl(x.getName(), x.getPresetPosition(), x.getUrl())); video.setUrl(videoService.getVideoUrl(x.getName(), x.getPresetPosition(), x.getUrl(), x.getCode()));
video.setIp(x.getIp()); video.setIp(x.getIp());
video.setPort(x.getPort()); video.setPort(x.getPort());
video.setCode(x.getCode()); video.setCode(x.getCode());
......
...@@ -57,6 +57,7 @@ import com.yeejoin.equipmanage.common.entity.Video; ...@@ -57,6 +57,7 @@ import com.yeejoin.equipmanage.common.entity.Video;
import com.yeejoin.equipmanage.common.entity.Warehouse; import com.yeejoin.equipmanage.common.entity.Warehouse;
import com.yeejoin.equipmanage.common.entity.WarehouseStructure; import com.yeejoin.equipmanage.common.entity.WarehouseStructure;
import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO; import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO;
import com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO;
import com.yeejoin.equipmanage.common.entity.vo.AlarmInfoVO; import com.yeejoin.equipmanage.common.entity.vo.AlarmInfoVO;
import com.yeejoin.equipmanage.common.entity.vo.AlarmVO; import com.yeejoin.equipmanage.common.entity.vo.AlarmVO;
import com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO; import com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO;
...@@ -76,6 +77,7 @@ import com.yeejoin.equipmanage.common.entity.vo.TechInfoListVO; ...@@ -76,6 +77,7 @@ import com.yeejoin.equipmanage.common.entity.vo.TechInfoListVO;
import com.yeejoin.equipmanage.common.entity.vo.TechInfoVO; import com.yeejoin.equipmanage.common.entity.vo.TechInfoVO;
import com.yeejoin.equipmanage.common.entity.vo.VideoVO; import com.yeejoin.equipmanage.common.entity.vo.VideoVO;
import com.yeejoin.equipmanage.common.enums.BillContentEnum; import com.yeejoin.equipmanage.common.enums.BillContentEnum;
import com.yeejoin.equipmanage.common.enums.BitmapEnum;
import com.yeejoin.equipmanage.common.enums.EquipmentRiskTypeEnum; import com.yeejoin.equipmanage.common.enums.EquipmentRiskTypeEnum;
import com.yeejoin.equipmanage.common.enums.FileTypeEnum; import com.yeejoin.equipmanage.common.enums.FileTypeEnum;
import com.yeejoin.equipmanage.common.enums.StockBillTypeEnum; import com.yeejoin.equipmanage.common.enums.StockBillTypeEnum;
...@@ -89,10 +91,12 @@ import com.yeejoin.equipmanage.common.vo.EquipmentDetailVo; ...@@ -89,10 +91,12 @@ import com.yeejoin.equipmanage.common.vo.EquipmentDetailVo;
import com.yeejoin.equipmanage.common.vo.EquipmentOnCarVo; import com.yeejoin.equipmanage.common.vo.EquipmentOnCarVo;
import com.yeejoin.equipmanage.common.vo.EquipmentSpecific3dVo; import com.yeejoin.equipmanage.common.vo.EquipmentSpecific3dVo;
import com.yeejoin.equipmanage.config.EquipmentIotMqttReceiveConfig; import com.yeejoin.equipmanage.config.EquipmentIotMqttReceiveConfig;
import com.yeejoin.equipmanage.fegin.VideoFeignClient;
import com.yeejoin.equipmanage.mapper.EquipmentIndexMapper; import com.yeejoin.equipmanage.mapper.EquipmentIndexMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmMapper; import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper; import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper;
import com.yeejoin.equipmanage.mapper.UploadFileMapper; import com.yeejoin.equipmanage.mapper.UploadFileMapper;
import com.yeejoin.equipmanage.mapper.VideoMapper;
import com.yeejoin.equipmanage.service.IEquPropertyService; import com.yeejoin.equipmanage.service.IEquPropertyService;
import com.yeejoin.equipmanage.service.IEquipmentCategoryService; import com.yeejoin.equipmanage.service.IEquipmentCategoryService;
import com.yeejoin.equipmanage.service.IEquipmentDetailService; import com.yeejoin.equipmanage.service.IEquipmentDetailService;
...@@ -109,6 +113,7 @@ import com.yeejoin.equipmanage.service.IStockService; ...@@ -109,6 +113,7 @@ import com.yeejoin.equipmanage.service.IStockService;
import com.yeejoin.equipmanage.service.ISyncDataService; import com.yeejoin.equipmanage.service.ISyncDataService;
import com.yeejoin.equipmanage.service.ISystemDicService; import com.yeejoin.equipmanage.service.ISystemDicService;
import com.yeejoin.equipmanage.service.IUploadFileService; import com.yeejoin.equipmanage.service.IUploadFileService;
import com.yeejoin.equipmanage.service.IVideoService;
import com.yeejoin.equipmanage.service.IWarehouseService; import com.yeejoin.equipmanage.service.IWarehouseService;
import com.yeejoin.equipmanage.service.IWarehouseStructureService; import com.yeejoin.equipmanage.service.IWarehouseStructureService;
import com.yeejoin.equipmanage.utils.RelationRedisUtil; import com.yeejoin.equipmanage.utils.RelationRedisUtil;
...@@ -176,6 +181,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -176,6 +181,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Autowired @Autowired
IEquipmentIndexService iEquipmentIndexService; IEquipmentIndexService iEquipmentIndexService;
@Autowired
private IVideoService videoService;
@Value("${systemctl.dict.iot-core-param}") @Value("${systemctl.dict.iot-core-param}")
private String iotCoreParam; private String iotCoreParam;
...@@ -197,9 +205,13 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -197,9 +205,13 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Autowired @Autowired
private RelationRedisUtil relationRedisUtil; private RelationRedisUtil relationRedisUtil;
@Autowired
private VideoMapper videoMapper;
@Value("${systemctl.sync.switch}") @Value("${systemctl.sync.switch}")
private Boolean syncSwitch; private Boolean syncSwitch;
private final String injection = "{\n" + private final String injection = "{\n" +
"\n" + "\n" +
" \"items\": [\n" + " \"items\": [\n" +
...@@ -1050,14 +1062,25 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1050,14 +1062,25 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
} }
@Override @Override
public DetailPaneVO getOneCard(Long id) { public Object getOneCard(Long id, String type) {
if(BitmapEnum.video.getKey().equals(type)){
AlamVideoVO video = videoMapper.getVideoById(id);
if(!ObjectUtils.isEmpty(video)){
video.setUrl(videoService.getVideoUrl(video.getName().toString(), video.getPresetPosition(), video.getUrl(), video.getCode()));
}
return video;
}else{
DetailPaneVO detailPaneVO = new DetailPaneVO(); DetailPaneVO detailPaneVO = new DetailPaneVO();
Map<String, String> map = this.baseMapper.getQrCodeAndPic(id); Map<String, String> map = this.baseMapper.getQrCodeAndPic(id);
if(ObjectUtils.isEmpty(map)){
return detailPaneVO;
}
detailPaneVO.setQrCode(map.get("qrCode")); detailPaneVO.setQrCode(map.get("qrCode"));
detailPaneVO.setPic(map.get("pic")); detailPaneVO.setPic(map.get("pic"));
detailPaneVO.setItems(this.baseMapper.getOneCard(id)); detailPaneVO.setItems(this.baseMapper.getOneCard(id));
return detailPaneVO; return detailPaneVO;
} }
}
@Override @Override
public SourceNameByEquipSpeIdVO getSourceNameByEquipSpeId(Long id) { public SourceNameByEquipSpeIdVO getSourceNameByEquipSpeId(Long id) {
......
...@@ -27,6 +27,7 @@ import com.alibaba.fastjson.JSON; ...@@ -27,6 +27,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.component.feign.config.InnerInvokException; import com.yeejoin.amos.component.feign.config.InnerInvokException;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
...@@ -602,7 +603,7 @@ public class MainIotMonitorServiceImpl implements IMainIotMonitorSerivce { ...@@ -602,7 +603,7 @@ public class MainIotMonitorServiceImpl implements IMainIotMonitorSerivce {
// redis缓存选择的用户信息 // redis缓存选择的用户信息
private String buildKey(String userId, String token) { private String buildKey(String userId, String token) {
return "region_" + userId + "_" + token; return RedisKey.buildReginKey(userId, token);
} }
protected AgencyUserModel getUser() { protected AgencyUserModel getUser() {
......
...@@ -19,6 +19,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest; ...@@ -19,6 +19,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.component.feign.config.InnerInvokException; import com.yeejoin.amos.component.feign.config.InnerInvokException;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
...@@ -506,8 +507,7 @@ public class QREquipmentDefServiceImpl implements IQRCodeService<ScanResult<QREq ...@@ -506,8 +507,7 @@ public class QREquipmentDefServiceImpl implements IQRCodeService<ScanResult<QREq
// redi缓存选择的用户信息 // redi缓存选择的用户信息
private String buildKey(String userId, String token) { private String buildKey(String userId, String token) {
return RedisKey.buildReginKey(userId, token);
return "region_" + userId + "_" + token;
} }
} }
...@@ -20,6 +20,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -20,6 +20,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.component.feign.config.InnerInvokException; import com.yeejoin.amos.component.feign.config.InnerInvokException;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
...@@ -1242,8 +1243,6 @@ public class QREquipmentKnowledgeServiceImpl implements IQRCodeService<ScanResul ...@@ -1242,8 +1243,6 @@ public class QREquipmentKnowledgeServiceImpl implements IQRCodeService<ScanResul
// redi缓存选择的用户信息 // redi缓存选择的用户信息
private String buildKey(String userId, String token) { private String buildKey(String userId, String token) {
return RedisKey.buildReginKey(userId, token);
return "region_" + userId + "_" + token;
} }
} }
...@@ -12,6 +12,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -12,6 +12,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.component.feign.config.InnerInvokException; import com.yeejoin.amos.component.feign.config.InnerInvokException;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
...@@ -130,9 +131,7 @@ public class StockBillDetailServiceImpl extends ServiceImpl<StockBillDetailMappe ...@@ -130,9 +131,7 @@ public class StockBillDetailServiceImpl extends ServiceImpl<StockBillDetailMappe
} }
// redi缓存选择的用户信息 // redi缓存选择的用户信息
private String buildKey(String userId, String token) { private String buildKey(String userId, String token) {
return RedisKey.buildReginKey(userId, token);
return "region_" + userId + "_" + token;
} }
} }
package com.yeejoin.equipmanage.service.impl; package com.yeejoin.equipmanage.service.impl;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.equipmanage.common.entity.*; import com.yeejoin.equipmanage.common.entity.EquipmentCategory;
import com.yeejoin.equipmanage.common.entity.EquipmentIndex;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
import com.yeejoin.equipmanage.common.entity.Video;
import com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific;
import com.yeejoin.equipmanage.common.entity.VideoImportantEquipment;
import com.yeejoin.equipmanage.common.entity.VideoSource;
import com.yeejoin.equipmanage.common.entity.WarehouseStructure;
import com.yeejoin.equipmanage.common.entity.dto.VideoDTO; import com.yeejoin.equipmanage.common.entity.dto.VideoDTO;
import com.yeejoin.equipmanage.common.entity.dto.VideoSaveDto; import com.yeejoin.equipmanage.common.entity.dto.VideoSaveDto;
import com.yeejoin.equipmanage.common.entity.vo.*; import com.yeejoin.equipmanage.common.entity.vo.BuildingListVO;
import com.yeejoin.equipmanage.common.entity.vo.BuildingVideoListVO;
import com.yeejoin.equipmanage.common.entity.vo.BuildingVideoVO;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentCategoryTypeTreeVO;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo;
import com.yeejoin.equipmanage.common.entity.vo.PageSecurityVideoVO;
import com.yeejoin.equipmanage.common.entity.vo.PageVideoVO;
import com.yeejoin.equipmanage.common.entity.vo.VideoDownloadVO;
import com.yeejoin.equipmanage.common.entity.vo.VideoListVo;
import com.yeejoin.equipmanage.common.enums.EquipmentSpeIndexEnum; import com.yeejoin.equipmanage.common.enums.EquipmentSpeIndexEnum;
import com.yeejoin.equipmanage.common.enums.IndustryEnum; import com.yeejoin.equipmanage.common.enums.IndustryEnum;
import com.yeejoin.equipmanage.common.utils.HttpContentTypeUtil; import com.yeejoin.equipmanage.common.utils.HttpContentTypeUtil;
import com.yeejoin.equipmanage.common.utils.StringUtil; import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.fegin.VideoFeignClient;
import com.yeejoin.equipmanage.mapper.VideoMapper; import com.yeejoin.equipmanage.mapper.VideoMapper;
import com.yeejoin.equipmanage.service.*; import com.yeejoin.equipmanage.service.IBuilldService;
import lombok.extern.slf4j.Slf4j; import com.yeejoin.equipmanage.service.IEquipmentCategoryService;
import org.apache.commons.lang3.StringUtils; import com.yeejoin.equipmanage.service.IEquipmentIndexService;
import org.springframework.beans.factory.annotation.Autowired; import com.yeejoin.equipmanage.service.IEquipmentSpecificIndexService;
import org.springframework.beans.factory.annotation.Value; import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce;
import org.springframework.context.annotation.Lazy; import com.yeejoin.equipmanage.service.IVideoEquipmentSpecificService;
import org.springframework.stereotype.Service; import com.yeejoin.equipmanage.service.IVideoImportantEquipmentService;
import org.springframework.transaction.annotation.Transactional; import com.yeejoin.equipmanage.service.IVideoService;
import org.springframework.util.ObjectUtils; import com.yeejoin.equipmanage.service.IVideoSourceService;
import org.typroject.tyboot.core.foundation.utils.Bean; import com.yeejoin.equipmanage.service.IWarehouseStructureService;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.*; import lombok.extern.slf4j.Slf4j;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/** /**
* @author ZeHua Li * @author ZeHua Li
...@@ -69,6 +104,10 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements ...@@ -69,6 +104,10 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
VideoMapper videoMapper; VideoMapper videoMapper;
@Autowired
VideoFeignClient videoFeignClient;
@Value("${param.htvideo.url}") @Value("${param.htvideo.url}")
private String htvideoUrl; private String htvideoUrl;
...@@ -482,13 +521,27 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements ...@@ -482,13 +521,27 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
@Override @Override
public String getVideoUrl(String videoId, String presetIndex, String defaultUrl) { public String getVideoUrl(String videoId, String presetIndex, String defaultUrl, String code) {
if ("off".equals(isUseVideoTranscoding)) { if ("off".equals(isUseVideoTranscoding)) {
return defaultUrl; String url = getVideoUrl(code);
return ObjectUtils.isEmpty(url) ? defaultUrl : url;
} }
return getFlvUrlByVideoIdOrPresetIndex(videoId, presetIndex); return getFlvUrlByVideoIdOrPresetIndex(videoId, presetIndex);
} }
private String getVideoUrl(String code){
String url = "";
try{
ResponseModel<String> da = videoFeignClient.videoUrlByIndexCode(code);
if(!ObjectUtils.isEmpty(da)){
url = da.getResult().substring(da.getResult().indexOf("openUrl"));
}
}catch (Exception e) {
log.error("视频服务调用失败", e.getMessage());
}
return url;
}
public String getFlvUrlByVideoIdOrPresetIndex(String videoId, String presetIndex) { public String getFlvUrlByVideoIdOrPresetIndex(String videoId, String presetIndex) {
try { try {
String rtsp = getRtspUrlByVideoIdOrPresetIndex(videoId, presetIndex); String rtsp = getRtspUrlByVideoIdOrPresetIndex(videoId, presetIndex);
...@@ -542,91 +595,4 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements ...@@ -542,91 +595,4 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
return "rtsp"; return "rtsp";
} }
// /**
// * 异步保存监控和建筑关联关系
// * @param buildingCodes
// * @param videoId
// */
// @Async
// void saveVideoSource(String[] buildingCodes,Long videoId){
// List<VideoSource> videoSources = new ArrayList<>();
//
// //转map,方便后面code转id
// List<WarehouseStructure> list = warehouseStructureService.list();
// Map<String,Long> map = new HashMap<>();
// list.stream().forEach(x->{
// map.put(x.getCode(),x.getId());
// });
//
// //拼接数据
// for (int i = 0; i < buildingCodes.length; i++) {
// VideoSource videoSource = new VideoSource();
// videoSource.setVideoId(videoId);
// //通过code取id
// videoSource.setSourceId(map.get(buildingCodes[i]));
// videoSources.add(videoSource);
// }
//
// videoSourceService.saveBatch(videoSources);
// }
//
// /**
// * 异步保存监控和单个装备关联关系
// * @param equipmentSpecificCodes
// * @param videoId
// */
// @Async
// void saveEquipmentSpecificCodes(String[] equipmentSpecificCodes,Long videoId){
//
// List<VideoEquipmentSpecific> videoSources = new ArrayList<>();
//
// //转map,方便后面code转id
// List<EquipmentSpecific> list = equipmentSpecificSerivce.list();
// Map<String,Long> map = new HashMap<>();
// list.stream().forEach(x->{
// map.put(x.getCode(),x.getId());
// });
// //拼接数据
// for (int i = 0; i < equipmentSpecificCodes.length; i++) {
// VideoEquipmentSpecific videoEquipmentSpecific = new VideoEquipmentSpecific();
// videoEquipmentSpecific.setVideoId(videoId);
// //通过code取id
// videoEquipmentSpecific.setEquipmentSpecificId(map.get(equipmentSpecificCodes[i]));
// videoSources.add(videoEquipmentSpecific);
// }
//
// videoEquipmentSpecificService.saveBatch(videoSources);
// }
//
//
// /**
// * 异步保存监控和重点设备关联关系
// * @param importantEquipmentCodes
// * @param videoId
// */
// @Async
// void saveImportantEquipmentCodes(String[] importantEquipmentCodes,Long videoId){
//
// List<VideoImportantEquipment> videoImportantEquipments = new ArrayList<>();
//
// //转map,方便后面code转id
// List<EquipmentSpecificVo> list = baseMapper.selectImportantEquipment();
// Map<String,Long> map = new HashMap<>();
// list.stream().forEach(x->{
// map.put(x.getCode(),x.getId());
// });
//
// //拼接数据
// for (int i = 0; i < importantEquipmentCodes.length; i++) {
// VideoImportantEquipment videoImportantEquipment = new VideoImportantEquipment();
// videoImportantEquipment.setVideoId(videoId);
// //通过code取id
// videoImportantEquipment.setImportantEquipmentId(map.get(importantEquipmentCodes[i]));
// videoImportantEquipments.add(videoImportantEquipment);
// }
// videoImportantEquipmentService.saveBatch(videoImportantEquipments);
// }
} }
...@@ -13,6 +13,7 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient; ...@@ -13,6 +13,7 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
...@@ -28,7 +29,8 @@ import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils; ...@@ -28,7 +29,8 @@ import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils;
"org.typroject.tyboot.core.auth.face.orm.dao*", "org.typroject.tyboot.component.*.face.orm.dao*", "org.typroject.tyboot.core.auth.face.orm.dao*", "org.typroject.tyboot.component.*.face.orm.dao*",
"com.yeejoin.amos.boot.module.*.api.mapper", "com.yeejoin.amos.boot.biz.common.dao.mapper", "com.yeejoin.amos.boot.module.*.api.mapper", "com.yeejoin.amos.boot.biz.common.dao.mapper",
"com.yeejoin.equipmanage.mapper"}) "com.yeejoin.equipmanage.mapper"})
@ComponentScan({"org.typroject", "com.yeejoin.amos", "com.yeejoin.equipmanage"}) @ComponentScan(value = {"org.typroject", "com.yeejoin.amos", "com.yeejoin.equipmanage"}, excludeFilters = {
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler.class})})
@EnableFeignClients @EnableFeignClients
@EnableAsync @EnableAsync
public class AmostEquipApplication { public class AmostEquipApplication {
......
...@@ -50,6 +50,8 @@ iot.vehicle.track=AMOS-API-IOT ...@@ -50,6 +50,8 @@ iot.vehicle.track=AMOS-API-IOT
jcs.fegin.name=JCS jcs.fegin.name=JCS
video.fegin.name=VIDEO
#项目初始化画布id #项目初始化画布id
morphic.projectSeq=1390314016458514433 morphic.projectSeq=1390314016458514433
......
...@@ -226,7 +226,7 @@ FROM ...@@ -226,7 +226,7 @@ FROM
FROM FROM
wl_equipment_specific_index si, wl_equipment_specific_index si,
wl_equipment_index WI wl_equipment_index WI
where SI.equipment_index_id = WI.id and si.equipment_specific_id = #{equipmentSpecificId} where si.equipment_index_id = WI.id and si.equipment_specific_id = #{equipmentSpecificId}
</select> </select>
......
...@@ -136,17 +136,20 @@ ...@@ -136,17 +136,20 @@
where equipment_specific_id = #{id} where equipment_specific_id = #{id}
</select> </select>
<select id="getVideoById" resultType="com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO"> <select id="getVideoById" resultType="com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO">
select SELECT
vid.id, v.`name`,
vid.token, v.`code`,
vid.name, v.url,
vid.url, v.token,
vid.code, CONCAT_WS(' ', ws.full_name, v.address) AS address,
vid.preset_position as presetPosition v.img,
from v.preset_position as presetPosition
wl_video_equipment_specific as ves FROM
left join wl_video as vid on ves.video_id = vid.id wl_video v
where video_id = #{id} LEFT JOIN wl_video_source vs ON vs.video_id = v.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = vs.source_id
WHERE
v.id = #{id}
</select> </select>
<select id="pageColaBuildingVideo" resultType="com.yeejoin.equipmanage.common.entity.vo.BuildingVideoVO"> <select id="pageColaBuildingVideo" resultType="com.yeejoin.equipmanage.common.entity.vo.BuildingVideoVO">
......
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