Commit 64eb625b authored by KeYong's avatar KeYong

Merge branch 'develop_station' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_station

parents 9a97b22e 01bf8593
package com.yeejoin.equipmanage.common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @ProjectName: amos-biz-boot
* @Package: com.yeejoin.equipmanage.common.vo
* @ClassName: VideoImportantEquipmentVo
* @Author: Jianqiang Gao
* @Description: VideoImportantEquipmentVo
* @Date: 2022/6/16 10:36
* @Version: 1.0
*/
@Data
@ApiModel(value = "VideoImportantEquipmentVo对象", description = "")
public class VideoImportantEquipmentVo {
@ApiModelProperty(value = "视频id")
private Long videoId;
@ApiModelProperty(value = "f_equipment表id(重点设备id)")
private Long importantEquipmentId;
@ApiModelProperty(value = "摄像机编号")
private String code;
@ApiModelProperty(value = "类型编码")
private String typeCode;
@ApiModelProperty(value = "类型")
private String type;
@ApiModelProperty(value = "访问url")
private String url;
@ApiModelProperty(value = "摄像机名称")
private String name;
@ApiModelProperty(value = "图片")
private String img;
@ApiModelProperty(value = "详细地址")
private String address;
}
\ No newline at end of file
......@@ -73,7 +73,6 @@ import com.yeejoin.equipmanage.common.vo.ExtinguishantLossRequest;
import com.yeejoin.equipmanage.common.vo.ExtinguishantRequeset;
import com.yeejoin.equipmanage.common.vo.LonAndLatEntityVo;
import com.yeejoin.equipmanage.common.vo.OnBoardEquipment;
import com.yeejoin.equipmanage.config.EquipmentIotMqttReceiveConfig;
import com.yeejoin.equipmanage.mapper.CarInfoMapper;
import com.yeejoin.equipmanage.mapper.CarMapper;
import com.yeejoin.equipmanage.mapper.CarPropertyMapper;
......@@ -97,7 +96,6 @@ import com.yeejoin.equipmanage.service.IEquipmentService;
import com.yeejoin.equipmanage.service.ISyncDataService;
import com.yeejoin.equipmanage.service.ISystemDicService;
import com.yeejoin.equipmanage.service.ProductionQRCode;
import com.yeejoin.equipmanage.service.impl.EquipmentSpecificSerivceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -151,8 +149,6 @@ public class CarController extends AbstractBaseController {
EquipmentQrcodeMapper equipmentQrcodeMapper;
@Resource(name = "productionQRCodeFactoryMap")
private Map<String, ProductionQRCode> messageHandMap;
@Autowired
EquipmentIotMqttReceiveConfig equipmentIotMqttReceiveConfig;
@Autowired
ICarLonAndLatDataService iCarLonAndLatDataService;
......@@ -204,7 +200,6 @@ public class CarController extends AbstractBaseController {
// saveFile(carInstance); 图片视频后期统一处理
EquipmentSpecificSerivceImpl.registerMqttTopic(car.getIotCode(), equipmentIotMqttReceiveConfig);
car.setQrCode(QRCodeUtil.generateQRCode());
List<CarProperty> carPropertyList = car.getCarPropertyList();
if (carPropertyList.size() > 0) {
......@@ -281,7 +276,6 @@ public class CarController extends AbstractBaseController {
// Set<CarProperty> carpList = carRequest.getCarPropertyList();
// carInstance = iCarService.saveCar(getUserInfo(), carInstance, carInfo, carpList);
// saveFile(carInstance);视频图片文件后期统一处理
EquipmentSpecificSerivceImpl.registerMqttTopic(car.getIotCode(), equipmentIotMqttReceiveConfig);
return iCarService.updateOneById(car);
}
......@@ -309,29 +303,6 @@ public class CarController extends AbstractBaseController {
syncDataService.syncDeletedFireVehicle(carIds);
iCarService.dataSyncDeletedIds(carIds);
}
String[] topics = equipmentIotMqttReceiveConfig.adapter.getTopic();
boolean flag = false;
for (String id : idStrings) {
String iotCode = iCarService.getById(id).getIotCode();
if (StringUtil.isNotEmpty(iotCode)) {
String prefix = iotCode.substring(0, 8);
String suffix = iotCode.substring(8);
String oldTopic = prefix + "/" + suffix + "/property";
for (String topic : topics) {
if (topic.equals(oldTopic)) {
flag = true;
break;
}
}
if (flag) {
try {
equipmentIotMqttReceiveConfig.adapter.removeTopic(prefix + "/" + suffix + "/property");
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
return new CommonResponse(SUCCESS);
}
}
......@@ -1030,32 +1001,11 @@ public class CarController extends AbstractBaseController {
public boolean delete(HttpServletRequest request, @RequestBody List<Long> idList) throws Exception {
List<Car> cars = iCarService.list(new QueryWrapper<Car>().in("id", idList));
String[] topics = equipmentIotMqttReceiveConfig.adapter.getTopic();
cars.forEach(car -> {
List<EquipmentOnCarAppVO> equipmentOnCarAppVOS = carMapper.selectEquipmentOnCarAppList(car.getId());
if (equipmentOnCarAppVOS.size() > 0) {
throw new BadRequest("有车载装备的车辆不能删除,请先卸载装备!");
}
boolean flag = false;
String iotCode = car.getIotCode();
if (StringUtil.isNotEmpty(car.getIotCode()) && iotCode.length() > 8) {
String prefix = iotCode.substring(0, 8);
String suffix = iotCode.substring(8);
String oldTopic = prefix + "/" + suffix + "/property";
for (String topic : topics) {
if (topic.equals(oldTopic)) {
flag = true;
break;
}
}
if (flag) {
try {
equipmentIotMqttReceiveConfig.adapter.removeTopic(prefix + "/" + suffix + "/property");
} catch (Exception e) {
e.printStackTrace();
}
}
}
});
return iCarService.removeOneByIds(idList);
}
......
package com.yeejoin.equipmanage.controller;
import com.yeejoin.equipmanage.common.vo.VideoImportantEquipmentVo;
import com.yeejoin.equipmanage.service.IVideoImportantEquipmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
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 java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @ProjectName: amos-biz-boot
* @Package: com.yeejoin.equipmanage.controller
* @ClassName: VideoImportantEquipmentController
* @Author: Jianqiang Gao
* @Description: VideoImportantEquipmentController
* @Date: 2022/6/16 10:24
* @Version: 1.0
*/
@RestController
@Api(tags = "视屏监控关联重点设备Api")
@Slf4j
@RequestMapping(value = "/videoImportantEquipment", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class VideoImportantEquipmentController {
@Autowired
private IVideoImportantEquipmentService videoImportantEquipmentService;
@RequestMapping(value = "/getVideoImportantEquipmentList", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "获取视屏监控关联重点设备集合", notes = "获取视屏监控关联重点设备集合")
public List<VideoImportantEquipmentVo> getVideoImportantEquipmentList(@RequestParam(required = false) Long importantEquipmentId) {
Map<String, Object> map = null;
if (importantEquipmentId != null) {
map = new HashMap<>();
map.put("importantEquipmentId", importantEquipmentId);
}
return videoImportantEquipmentService.getVideoImportantEquipmentList(map);
}
}
\ No newline at end of file
......@@ -2,8 +2,12 @@ package com.yeejoin.equipmanage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.equipmanage.common.entity.VideoImportantEquipment;
import com.yeejoin.equipmanage.common.vo.VideoImportantEquipmentVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* @author ZeHua Li
* @date 2020/11/25 15:48
......@@ -11,4 +15,5 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface VideoImportantEquipmentMapper extends BaseMapper<VideoImportantEquipment> {
List<VideoImportantEquipmentVo> getVideoImportantEquipmentList(Map<String, Object> map);
}
......@@ -2,6 +2,10 @@ package com.yeejoin.equipmanage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.equipmanage.common.entity.VideoImportantEquipment;
import com.yeejoin.equipmanage.common.vo.VideoImportantEquipmentVo;
import java.util.List;
import java.util.Map;
/**
* @author ZeHua Li
......@@ -9,4 +13,5 @@ import com.yeejoin.equipmanage.common.entity.VideoImportantEquipment;
* @since v2.0
*/
public interface IVideoImportantEquipmentService extends IService<VideoImportantEquipment> {
List<VideoImportantEquipmentVo> getVideoImportantEquipmentList(Map<String, Object> map);
}
package com.yeejoin.equipmanage.service.impl;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo;
import com.yeejoin.equipmanage.common.enums.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
......@@ -22,11 +21,13 @@ import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.equipmanage.common.entity.Equipment;
import com.yeejoin.equipmanage.common.entity.EquipmentDetail;
......@@ -44,11 +45,16 @@ import com.yeejoin.equipmanage.common.entity.StockBillDetail;
import com.yeejoin.equipmanage.common.entity.StockDetail;
import com.yeejoin.equipmanage.common.entity.WarehouseStructure;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentDetailDownloadVO;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo;
import com.yeejoin.equipmanage.common.enums.BillContentEnum;
import com.yeejoin.equipmanage.common.enums.EquipStatusEnum;
import com.yeejoin.equipmanage.common.enums.JournalTypeEnum;
import com.yeejoin.equipmanage.common.enums.NoticeEnum;
import com.yeejoin.equipmanage.common.enums.StockBillTypeEnum;
import com.yeejoin.equipmanage.common.utils.ExcelUtils;
import com.yeejoin.equipmanage.common.utils.QRCodeUtil;
import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.common.vo.StockDataVO;
import com.yeejoin.equipmanage.config.EquipmentIotMqttReceiveConfig;
import com.yeejoin.equipmanage.dto.EquipmentDetailDownloadTemplateDto;
import com.yeejoin.equipmanage.mapper.EquipmentDetailMapper;
import com.yeejoin.equipmanage.mapper.EquipmentMapper;
......@@ -105,8 +111,7 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
private ProductionQRCode equipmentProductionQRCode;
@Autowired
private IEquipmentSpecificIndexSerivce iEquipmentSpecificIndexSerivce;
@Autowired
EquipmentIotMqttReceiveConfig equipmentIotMqttReceiveConfig;
@Autowired
IManufacturerInfoService manufacturerInfoService;
......@@ -490,9 +495,6 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
if (!equipmentSpecificIndices.isEmpty()) {
iEquipmentSpecificIndexSerivce.saveBatch(equipmentSpecificIndices);
}
if (equipmentSpecific.getSingle() && StringUtil.isNotEmpty(equipmentSpecific.getIotCode())) {
EquipmentSpecificSerivceImpl.registerMqttTopic(equipmentSpecific.getIotCode(), equipmentIotMqttReceiveConfig);
}
}
@Override
......
......@@ -2,10 +2,15 @@ package com.yeejoin.equipmanage.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.equipmanage.common.entity.VideoImportantEquipment;
import com.yeejoin.equipmanage.common.vo.VideoImportantEquipmentVo;
import com.yeejoin.equipmanage.mapper.VideoImportantEquipmentMapper;
import com.yeejoin.equipmanage.service.IVideoImportantEquipmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* @author ZeHua Li
* @date 2020/11/25 15:49
......@@ -13,4 +18,12 @@ import org.springframework.stereotype.Service;
*/
@Service
public class VideoImportantEquipmentServiceImpl extends ServiceImpl<VideoImportantEquipmentMapper,VideoImportantEquipment> implements IVideoImportantEquipmentService {
@Autowired
private VideoImportantEquipmentMapper videoImportantEquipmentMapper;
@Override
public List<VideoImportantEquipmentVo> getVideoImportantEquipmentList(Map<String, Object> map) {
return videoImportantEquipmentMapper.getVideoImportantEquipmentList(map);
}
}
<?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.yeejoin.equipmanage.mapper.VideoImportantEquipmentMapper">
<select id="getVideoImportantEquipmentList"
resultType="com.yeejoin.equipmanage.common.vo.VideoImportantEquipmentVo" parameterType="java.util.Map">
SELECT
v.id AS videoId,
v.`name`,
v.`code`,
v.type_code,
v.type,
v.url,
v.img,
v.address,
vie.important_equipment_id
FROM
wl_video v
LEFT JOIN wl_video_important_equipment vie ON v.id = vie.video_id
<where>
<if test="importantEquipmentId != null">
vie.important_equipment_id = #{importantEquipmentId}
</if>
</where>
</select>
</mapper>
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