Compare commits

..

No commits in common. '4812cc84078b22ef47fdec3b1320238b98f5eb9e' and '22195458c419e565b7a3ef0ce58a97a223689184' have entirely different histories.

@ -77,8 +77,6 @@ public class DeviceInstallInfo extends TenantModel implements Owned<String>,Seri
private String workingOfTheDetectorImage;
// @ApiModelProperty(value = "测漏图片")
private String sideLeakageImage;
// @ApiModelProperty(value = "泡沫水测漏图片")
private String formSideLeakageImage;
// @ApiModelProperty(value = "点火图片")
private String ignitionPictureImage;
// @ApiModelProperty(value = "装完成全景图片")
@ -89,10 +87,6 @@ public class DeviceInstallInfo extends TenantModel implements Owned<String>,Seri
private String workOrderImage;
//@ApiModelProperty(value = "打孔图片")
private String punchingImage;
//@ApiModelProperty(value = "设备信息图片")
private String deviceInfoImage;
//@ApiModelProperty(value = "门牌号图片")
private String houseNumberImage;
// @ApiModelProperty(value = "用户id")
private String uid;
// @ApiModelProperty(value = "租户编号")

@ -38,6 +38,4 @@ public interface IAlertConfigData extends ICommonData<AlertConfig, Long> {
List<AlertConfig> findByUidAndRuleInfoIdAndDeviceName(String uid, String ruleInfoId,String deviceName);
Paging<AlertConfig> selectAlertConfigPage(PageRequest<AlertConfig> request);
List<AlertConfig> findByRuleInfoIdAndDeviceName(String ruleInfoId,String deviceName);
}

@ -114,9 +114,6 @@ public interface IDeviceInfoData extends IOwnedData<DeviceInfo, String> {
* @param page
* @param size
*/
Paging<DeviceInfo> findByConditions(String name,String uid, String subUid, String productKey,
String groupId, Boolean online, String keyword,
int page, int size,Long areaDepeId,String startTime,String endTime,String deviceName,Integer deviceStatus);
Paging<DeviceInfo> findByConditions(String name,String uid, String subUid, String productKey,
String groupId, Boolean online, String keyword,
int page, int size,Long areaDepeId,String startTime,String endTime,String deviceName);
@ -202,6 +199,4 @@ public interface IDeviceInfoData extends IOwnedData<DeviceInfo, String> {
List<DeviceInfo> findNeverUsedDevices();
Long findNeverUsedDevices(DeviceInfo deviceInfo,Boolean flag);
List<AlertStatDTO> getDeviceRecord();
List<DeviceInfo> findByDeptAreaIdAndProductKeyAndDeviceName(Long areaDeptId, String productKey, String deviceName);
}

@ -33,6 +33,4 @@ public interface IDeviceInstallInfoData extends IOwnedData<DeviceInstallInfo, St
DeviceInstallInfo findByDeviceNameAndUid(String deviceName,String uid);
DeviceInstallInfo findByDeviceNameAndUidAndState(String deviceName,String uid,Integer state);
DeviceInstallInfo findById(String id);
}

@ -85,6 +85,4 @@ public interface ISysRoleData extends ICommonData<SysRole, Long> {
List<SysRole> selectRoleList(SysRole role);
List<SysRole> findByUserId(Long id);
List<SysRole> selectByTenantId(Long tenantId);
}

@ -127,12 +127,6 @@ public class DeviceInfoDataCache implements IDeviceInfoData, SmartInitializingSi
public List<AlertStatDTO> getDeviceRecord() {
return deviceInfoData.getDeviceRecord();
}
@Override
public List<DeviceInfo> findByDeptAreaIdAndProductKeyAndDeviceName(Long deviceId, String productKey, String deviceName) {
return deviceInfoData.findByDeptAreaIdAndProductKeyAndDeviceName(deviceId,productKey,deviceName);
}
/**
*
*/
@ -244,12 +238,6 @@ public class DeviceInfoDataCache implements IDeviceInfoData, SmartInitializingSi
String groupId, Boolean state, String keyword, int page, int size,Long deptAreaId,String startTime,String endTime,String deviceName) {
return deviceInfoData.findByConditions(name,uid, subUid, productKey, groupId, state, keyword, page, size,deptAreaId,startTime,endTime,deviceName);
}
@Override
public Paging<DeviceInfo> findByConditions(String name,String uid, String subUid, String productKey,
String groupId, Boolean state, String keyword, int page, int size,Long deptAreaId,String startTime,String endTime,String deviceName,Integer deviceStatus) {
return deviceInfoData.findByConditions(name,uid, subUid, productKey, groupId, state, keyword, page, size,deptAreaId,startTime,endTime,deviceName,deviceStatus);
}
@Override
public Paging<DeviceInfo> findByConditionsExcel(String name,String uid, String subUid, String productKey,
String groupId, Boolean state, String keyword, int page, int size,Long deptAreaId,String startTime,String endTime) {

@ -176,18 +176,6 @@ public class DeviceInfoPropertyDataCache implements IDeviceInfoData {
public List<AlertStatDTO> getDeviceRecord() {
return deviceInfoData.getDeviceRecord();
}
@Override
public List<DeviceInfo> findByDeptAreaIdAndProductKeyAndDeviceName(Long areaDeptId, String productKey, String deviceName) {
List<DeviceInfo> deviceInfo = deviceInfoData.findByDeptAreaIdAndProductKeyAndDeviceName(areaDeptId, productKey, deviceName);
if (deviceInfo == null) {
return null;
}
deviceInfo.forEach(deviceInfo1 -> deviceInfo1.setProperty(getProperties(deviceInfo1.getDeviceId())));
// deviceInfo.setProperty(getProperties(deviceInfo.getDeviceId()));
return deviceInfo;
}
@Override
public List<DeviceInfo> findByParentId(String parentId) {
return deviceInfoData.findByParentId(parentId);
@ -202,11 +190,6 @@ public class DeviceInfoPropertyDataCache implements IDeviceInfoData {
public Paging<DeviceInfo> findByConditions(String name,String uid, String subUid, String productKey, String groupId, Boolean online, String keyword, int page, int size,Long deptAreaId,String startTime,String endTime,String deviceName) {
return deviceInfoData.findByConditions(name,uid, subUid, productKey, groupId, online, keyword, page, size,deptAreaId,startTime,endTime,deviceName);
}
@Override
public Paging<DeviceInfo> findByConditions(String name,String uid, String subUid, String productKey, String groupId, Boolean online, String keyword, int page, int size,Long deptAreaId,String startTime,String endTime,String deviceName,Integer deviceStatus) {
return deviceInfoData.findByConditions(name,uid, subUid, productKey, groupId, online, keyword, page, size,deptAreaId,startTime,endTime,deviceName,deviceStatus);
}
@Override
public Paging<DeviceInfo> findByConditionsExcel(String name,String uid, String subUid, String productKey, String groupId, Boolean online, String keyword, int page, int size,Long deptAreaId,String startTime,String endTime) {
return deviceInfoData.findByConditionsExcel(name,uid, subUid, productKey, groupId, online, keyword, page, size,deptAreaId,startTime,endTime);

@ -41,6 +41,4 @@ public interface AlertConfigRepository extends JpaRepository<TbAlertConfig, Long
List<TbAlertConfig> findByRuleInfoIdAndEnable(String ruleInfoId,Boolean enable);
List<TbAlertConfig> findByDeviceNameAndEnable(String deviceName,Boolean enable);
List<TbAlertConfig> findByUidAndRuleInfoIdAndDeviceNameAndEnable(String uid, String ruleInfoId,String deviceName,Boolean enable);
List<TbAlertConfig> findByRuleInfoIdAndDeviceNameAndEnable(String ruleInfoId, String deviceName, Boolean enable);
}

@ -39,6 +39,4 @@ public interface DeviceInfoRepository extends JpaRepository<TbDeviceInfo, String
List<TbDeviceInfo> findByDeptAreaIdAndProductKey(Long deptAreaId,String productKey);
long countByUid(String uid);
long countByUidAndState(String uid,String state);
List<TbDeviceInfo> findByDeptAreaIdAndProductKeyAndDeviceName(Long deptAreaId, String productKey, String deviceName);
}

@ -86,8 +86,6 @@ public class TbDeviceInstallInfo extends BaseEntity implements TenantAware {
private String workingOfTheDetectorImage;
@ApiModelProperty(value = "测漏图片")
private String sideLeakageImage;
@ApiModelProperty(value = "泡沫水测漏图片")
private String formSideLeakageImage;
@ApiModelProperty(value = "点火图片")
private String ignitionPictureImage;
@ApiModelProperty(value = "装完成全景图片")
@ -100,10 +98,6 @@ public class TbDeviceInstallInfo extends BaseEntity implements TenantAware {
private String punchingImage;
@ApiModelProperty(value = "装电源线照片")
private String fiexImage;
@ApiModelProperty(value = "设备信息图片")
private String deviceInfoImage;
@ApiModelProperty(value = "门牌号图片")
private String houseNumberImage;
@ApiModelProperty(value = "用户id")
private String uid;

@ -82,12 +82,6 @@ public class AlertConfigDataImpl implements IAlertConfigData, IJPACommData<Alert
.findAll(buildQueryCondition(request.getData()), PageBuilder.toPageable(request));
return new Paging<>(alertConfigPage.getTotalElements(), MapstructUtils.convert(alertConfigPage.getContent(), AlertConfig.class));
}
@Override
public List<AlertConfig> findByRuleInfoIdAndDeviceName(String ruleInfoId,String deviceName) {
return MapstructUtils.convert(alertConfigRepository.findByRuleInfoIdAndDeviceNameAndEnable(ruleInfoId,deviceName,true),AlertConfig.class);
}
@Override
public List<AlertConfig> findByUidAndRuleInfoId(String uid, String ruleInfoId) {
return MapstructUtils.convert(alertConfigRepository.findByUidAndRuleInfoId(uid, ruleInfoId), AlertConfig.class);

@ -513,11 +513,6 @@ public class DeviceInfoDataImpl implements IDeviceInfoData, IJPACommData<DeviceI
}
@Override
public List<DeviceInfo> findByDeptAreaIdAndProductKeyAndDeviceName(Long deptAreaId, String productKey, String deviceName) {
return parseVoToDto(deviceInfoRepository.findByDeptAreaIdAndProductKeyAndDeviceName(deptAreaId, productKey, deviceName));
}
@Override
public Paging<DeviceInfo> findByConditionsExcel(String name, String uid, String subUid,
String productKey, String groupId,
@ -637,7 +632,7 @@ public class DeviceInfoDataImpl implements IDeviceInfoData, IJPACommData<DeviceI
public Paging<DeviceInfo> findByConditions(String name, String uid, String subUid,
String productKey, String groupId,
Boolean online, String keyword,
int page, int size, Long deptAreaId,String startTime,String endTime,String deviceName,Integer deviceStatus) {
int page, int size, Long deptAreaId,String startTime,String endTime,String deviceName) {
JPAQuery<TbDeviceInfo> query = jpaQueryFactory.selectFrom(tbDeviceInfo);
// 根据groupId, 如果groupId存在则关联查询TbDeviceGroupMapping, 根据groupId,查询对应的devices
@ -677,21 +672,6 @@ public class DeviceInfoDataImpl implements IDeviceInfoData, IJPACommData<DeviceI
if (ObjectUtil.isNotEmpty(areaIds)) {*/
if(deptAreaId != 0) {
query.where(tbDeviceInfo.deptAreaId.in(deptAreaId));
} else {
if(ObjectUtil.isNotEmpty(LoginHelper.getUserId())) {
SysUser user = isSysUserData.findById(LoginHelper.getUserId());
if (ObjectUtil.isNotNull(user)) {
if (ObjectUtil.isNotNull(user.getDeptAreaId())) {
Long deptAreaId1 = user.getDeptAreaId();
// 根据部门id获取部门对象
SysDept dept = sysDeptData.findById(deptAreaId1);
if(dept.getParentId()!=0l){
// 说明为子部门 筛选条件为部门id
query.where(tbDeviceInfo.deptAreaId.eq(deptAreaId1));
}
}
}
}
}
// query.where(tbDeviceInfo.deptAreaId.in(deptAreaId));
// }
@ -732,128 +712,6 @@ public class DeviceInfoDataImpl implements IDeviceInfoData, IJPACommData<DeviceI
query.where(tbDeviceInfo.productKey.eq(productKey));
}
if(ObjectUtil.isNotNull(deviceStatus)){
query.where(tbDeviceInfo.deviceStatus.eq(deviceStatus));
}
if (online != null) {
query.where(tbDeviceInfo.state.eq(online ? "online" : "offline"));
}
if (StringUtils.isNotBlank(keyword)) {
query.where(tbDeviceInfo.deviceId.like("%" + keyword + "%")
.or(tbDeviceInfo.deviceName.like("%" + keyword + "%")));
}
if (ObjectUtil.isNotNull(startTime)&& ObjectUtil.isNotNull(endTime)) {
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date startDateTime = sdf.parse(startTime);
Date dateTime = sdf.parse(endTime);
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
// LocalDateTime startDateTime = LocalDateTime.parse(dictData.getStartTime() , formatter);
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
// LocalDateTime dateTime = LocalDateTime.parse(dictData.getEndTime(), formatter);
query.where(tbDeviceInfo.createTime.between(startDateTime, dateTime));
} catch (Exception e) {
}
}
query.orderBy(tbDeviceInfo.createAt.desc());
query.offset((page - 1) * size).limit(size);
List<TbDeviceInfo> tbDeviceInfos = query.fetch();
long total = query.fetchCount();
List<DeviceInfo> deviceInfos = new ArrayList<>(tbDeviceInfos.size());
for (TbDeviceInfo tbDeviceInfo : tbDeviceInfos) {
DeviceInfo deviceInfo = MapstructUtils.convert(tbDeviceInfo, DeviceInfo.class);
fillDeviceInfo(tbDeviceInfo.getDeviceId(), tbDeviceInfo, deviceInfo);
deviceInfos.add(deviceInfo);
}
return new Paging<>(total, deviceInfos);
}
public Paging<DeviceInfo> findByConditions(String name, String uid, String subUid,
String productKey, String groupId,
Boolean online, String keyword,
int page, int size, Long deptAreaId,String startTime,String endTime,String deviceName) {
JPAQuery<TbDeviceInfo> query = jpaQueryFactory.selectFrom(tbDeviceInfo);
// 根据groupId, 如果groupId存在则关联查询TbDeviceGroupMapping, 根据groupId,查询对应的devices
if (StringUtils.isNotBlank(groupId)) {
if(!groupId.equals("0")){
query.join(tbDeviceGroupMapping).on(tbDeviceGroupMapping.deviceId.eq(tbDeviceInfo.deviceId));
// query.where(tbDeviceGroupMapping.groupId.eq(groupId));
query.where(tbDeviceGroupMapping.groupId.eq(groupId));
}
}else{
query.join(tbDeviceGroupMapping).on(tbDeviceGroupMapping.deviceId.eq(tbDeviceInfo.deviceId));
query.where(tbDeviceGroupMapping.groupId.isNull());
}
if (StringUtils.isNotBlank(uid)) {
query.where(tbDeviceInfo.uid.eq(uid));
}
if (StringUtils.isNotBlank(name)) {
query.where(tbDeviceInfo.name.like("%" + name + "%"));
}
if (StringUtils.isNotBlank(deviceName)) {
query.where(tbDeviceInfo.deviceName.like("%" + deviceName + "%"));
}
System.out.println(TenantHelper.getTenantId());
if (ObjectUtil.isNotNull(TenantHelper.getTenantId()) && (!LoginHelper.isSuperAdmin() || TenantHelper.getTenantId()!=0)) {
query.where(tbDeviceInfo.tenantId.eq(TenantHelper.getTenantId()));
}
if (ObjectUtil.isNotNull(deptAreaId)) {
/* List<Long> areaIds;
// if (Objects.nonNull(user) && Objects.nonNull(user.getDeptAreaId())) {
Long areaId = deptAreaId;
List<SysDept> depts = sysDeptData.findByDeptId(areaId);
areaIds = StreamUtils.toList(depts, SysDept::getId);
areaIds.add(areaId);
if (ObjectUtil.isNotEmpty(areaIds)) {*/
if(deptAreaId != 0) {
query.where(tbDeviceInfo.deptAreaId.in(deptAreaId));
}
// query.where(tbDeviceInfo.deptAreaId.in(deptAreaId));
// }
}else{
if(!LoginHelper.isSuperAdmin()) {
if(ObjectUtil.isNotEmpty(LoginHelper.getUserId())) {
SysUser user = isSysUserData.findById(LoginHelper.getUserId());
if (ObjectUtil.isNotNull(user)) {
if (ObjectUtil.isNotNull(user.getDeptAreaId())) {
/* List<Long> areaIds;
// if (Objects.nonNull(user) && Objects.nonNull(user.getDeptAreaId())) {
Long areaId = user.getDeptAreaId();
List<SysDept> depts = sysDeptData.findByDeptId(areaId);
areaIds = StreamUtils.toList(depts, SysDept::getId);
areaIds.add(areaId);
if (ObjectUtil.isNotEmpty(areaIds)) {*/
query.where(tbDeviceInfo.deptAreaId.in(user.getDeptAreaId()));
// }
} else {
if(ObjectUtil.isNotEmpty(LoginHelper.getUserType()) && !LoginHelper.getUserType().equals(UserType.APP_USER)) {
//没有绑定区域查不到设备
query.where(tbDeviceInfo.id.eq("0"));
}
}
}
}
}else{
query.where(tbDeviceInfo.deptAreaId.isNull());
}
}
if (StringUtils.isNotBlank(subUid)) {
query.join(tbDeviceSubUser).on(tbDeviceSubUser.deviceId.eq(tbDeviceInfo.deviceId));
query.where(tbDeviceSubUser.uid.eq(subUid));
}
if (StringUtils.isNotBlank(productKey)) {
query.where(tbDeviceInfo.productKey.eq(productKey));
}
if (online != null) {
query.where(tbDeviceInfo.state.eq(online ? "online" : "offline"));
}

@ -77,10 +77,4 @@ public class DeviceInstallInfoDataImpl implements IDeviceInstallInfoData, IJPACo
public DeviceInstallInfo findByDeviceNameAndUidAndState(String deviceName, String uid, Integer state) {
return MapstructUtils.convert(homeRepository.findByDeviceNameAndUidAndState(deviceName,uid,state), DeviceInstallInfo.class);
}
@Override
public DeviceInstallInfo findById(String id) {
TbDeviceInstallInfo tbDeviceInstallInfo = homeRepository.findById(id).orElse(null);
return MapstructUtils.convert(tbDeviceInstallInfo, DeviceInstallInfo.class);
}
}

@ -222,15 +222,6 @@ public class SysRoleDataImpl implements ISysRoleData, IJPACommData<SysRole, Long
.fetch();
}
@Override
public List<SysRole> selectByTenantId(Long tenantId) {
return jpaQueryFactory.select(Projections.bean(SysRole.class, tbSysRole.id, tbSysRole.roleName, tbSysRole.roleKey, tbSysRole.roleSort, tbSysRole.dataScope, tbSysRole.status, tbSysRole.delFlag, tbSysRole.createTime, tbSysRole.remark))
.from(tbSysRole)
.where(PredicateBuilder.instance()
.and(tbSysRole.tenantId.eq(tenantId))
.build()).fetch();
}
private List<SysRole> buildQueryTitle(Predicate predicate) {
return jpaQueryFactory.selectDistinct(tbSysRole.id)
.select(Projections.fields(SysRole.class, tbSysRole.id, tbSysRole.roleName,

@ -37,8 +37,6 @@ import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.data.manager.IDeviceInstallInfoData;
import cc.iotkit.manager.config.GasInstallationPDFGenerator;
import cc.iotkit.manager.config.PDFGenerator;
import cc.iotkit.manager.dto.bo.BatchPdfWrapper;
import cc.iotkit.manager.dto.bo.ExportTask;
import cc.iotkit.manager.dto.bo.device.DeviceDetectorQueryBo;
import cc.iotkit.manager.dto.bo.device.DeviceInstallInfoQueryBo;
import cc.iotkit.manager.dto.bo.device.DeviceQueryBo;
@ -102,11 +100,6 @@ import java.net.URLEncoder;
import java.security.SecureRandom;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.zip.Deflater;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import static cc.iotkit.data.model.QTbDeviceInstallInfo.tbDeviceInstallInfo;
import static com.itextpdf.kernel.pdf.PdfName.*;
@ -123,12 +116,6 @@ public class DeviceInstallInfoController {
@Autowired
private IDeviceInstallInfoData iDeviceInstallInfoData;
@Autowired
private ExecutorService taskExecutor;
// 存储任务状态
private static final ConcurrentHashMap<String, ExportTask> exportTasks = new ConcurrentHashMap<>();
@ApiOperation(value = "安装列表", notes = "设备列表", httpMethod = "POST")
//@SaCheckPermission("iot:device:query")
@PostMapping("/page")
@ -214,57 +201,6 @@ public class DeviceInstallInfoController {
PDFGenerator.generateInstallationPDF(data, response.getOutputStream());
}
@PostMapping("/getPdfBatch")
@SaCheckPermission("device:install:upload")
public void getPdfBatch(@Validated @RequestBody Request<BatchPdfWrapper> request, HttpServletResponse response) throws Exception {
List<String> ids = request.getData().getData();
if (ids == null || ids.isEmpty()) {
throw new BizException(ErrCode.PARAMS_EXCEPTION);
}
response.setContentType("application/zip");
response.setHeader("Content-Disposition", "attachment; filename=\"批量安装信息.zip\"");
// 创建ZIP输出流
try (ZipOutputStream zipOut = new ZipOutputStream(response.getOutputStream())) {
zipOut.setLevel(Deflater.BEST_COMPRESSION);
for (String id : ids) {
DeviceInstallInfo data = iDeviceInstallInfoData.findById(id);
if (data == null) {
continue; // 跳过不存在的记录
}
// 生成PDF字节数组
ByteArrayOutputStream pdfBaos = new ByteArrayOutputStream();
PDFGenerator.generateInstallationPDFBytes(data, pdfBaos);
byte[] pdfBytes = pdfBaos.toByteArray();
// 创建ZIP条目
String fileName = data.getUserName() + "_" +
data.getCommunityName() + "_" +
data.getBuildingUnit() + data.getRoomNo() + ".pdf";
// 清理文件名中的非法字符
fileName = fileName.replaceAll("[\\\\/:*?\"<>|]", "_");
ZipEntry entry = new ZipEntry(fileName);
zipOut.putNextEntry(entry);
zipOut.write(pdfBytes, 0, pdfBytes.length);
zipOut.closeEntry();
}
zipOut.finish();
}
}
@ApiOperation("导出设备列表")
@Log(title = "导出设备列表", businessType = BusinessType.EXPORT)
// @SaCheckPermission("system:user:export")@RequestBody Request<ProductBo>

@ -1,11 +0,0 @@
package cc.iotkit.manager.dto.bo;
import lombok.Data;
import java.util.List;
@Data
public class BatchExportRequest {
private List<String> data;
private Long tenantId;
}

@ -1,11 +0,0 @@
package cc.iotkit.manager.dto.bo;
import lombok.Data;
import java.util.List;
@Data
public class BatchPdfWrapper {
private List<String> data;
private Long tenantId;
}

@ -1,28 +0,0 @@
package cc.iotkit.manager.dto.bo;
import lombok.Data;
import java.util.Date;
import java.util.List;
// 任务状态类
@Data
public class ExportTask {
private String taskId;
private List<String> ids;
private String status; // PENDING, PROCESSING, COMPLETED, FAILED
private String filePath;
private String errorMessage;
private Date createTime;
private Date completeTime;
private int progress; // 进度 0-100
public ExportTask(String taskId, List<String> ids, String status) {
this.taskId = taskId;
this.ids = ids;
this.status = status;
this.createTime = new Date();
this.progress = 0;
}
}

@ -90,8 +90,5 @@ public class DeviceQueryBo extends BaseDto {
private String endTime;
private String config;
//设备状态0正常1故障2报警3离线
private Integer deviceStatus;
}

@ -56,7 +56,4 @@ public class DeviceInfoExpordVo implements Serializable {
private Long tenantId;
@ExcelProperty(value = "设备区域")
private Long deptAreaId;
@ExcelProperty(value = "设备位置")
private String site;
}

@ -57,6 +57,4 @@ public class DeviceInfoImportVo implements Serializable {
private Long tenantId;
@ExcelProperty(value = "设备区域")
private Long deptAreaId;
@ExcelProperty(value = "设备位置")
private String site;
}

@ -61,10 +61,6 @@ public class DeviceInstallInfoExpordVo implements Serializable {
// @ApiModelProperty(value = "切断阀编号")
@ExcelProperty(value = "地址")
private String site;
@ExcelProperty(value = "切断阀编号")
private String shutValueNumber;
@ExcelProperty(value = "报警器编号")
private String deviceName;
// @ApiModelProperty(value = "燃气表号")
@ExcelProperty(value = "表号")
private String gasMeterNumber;

@ -64,10 +64,6 @@ public class DeviceInstallInfoVo implements Serializable {
// @ApiModelProperty(value = "切断阀编号")
@ExcelProperty(value = "地址")
private String site;
@ExcelProperty(value = "切断阀编号")
private String shutValueNumber;
@ExcelProperty(value = "报警器编号")
private String deviceName;
// @ApiModelProperty(value = "燃气表号")
@ExcelProperty(value = "表号")
private String gasMeterNumber;

@ -223,8 +223,6 @@ public class DeviceInstallInfoServiceImpl implements IDeviceInstallInfoService {
DeviceInstallInfo deviceInfo = MapstructUtils.convert(tbDeviceInfo, DeviceInstallInfo.class);
DeviceInstallInfoVo deviceInstallInfoVo = MapstructUtils.convert(deviceInfo, DeviceInstallInfoVo.class);
deviceInstallInfoVo.setXuhao(i);
deviceInstallInfoVo.setShutValueNumber(deviceInfo.getShutValueNumber());
deviceInstallInfoVo.setDeviceName(deviceInfo.getDeviceName());
deviceInstallInfoVo.setSite(tbDeviceInfo.getCommunityName() + tbDeviceInfo.getBuildingUnit() + tbDeviceInfo.getRoomNo());
deviceInstallInfoVo.setManufacturer("天津费加罗");
deviceInstallInfoVo.setPosition("成功");
@ -276,4 +274,4 @@ public class DeviceInstallInfoServiceImpl implements IDeviceInstallInfoService {
return predicate.build();
}*/
}
}

@ -148,14 +148,13 @@ public class DeviceManagerServiceImpl implements IDeviceManagerService {
String name = query.getName();
String deviceName = query.getDeviceName();
String pk = query.getProductKey();
Integer deviceStatus = query.getDeviceStatus();
//关键字查询
String keyword = query.getKeyword();
String group = query.getGroup();
Boolean online = query.getOnline();
Long areaDepeId = query.getDeptAreaId();
Paging<DeviceInfoVo> result = MapstructUtils.convert(deviceInfoData.findByConditions(name, uid, subUid, pk, group,
online, keyword, pageRequest.getPageNum(), pageRequest.getPageSize(), areaDepeId, query.getStartTime(), query.getEndTime(), deviceName,deviceStatus), DeviceInfoVo.class);
online, keyword, pageRequest.getPageNum(), pageRequest.getPageSize(), areaDepeId, query.getStartTime(), query.getEndTime(), deviceName), DeviceInfoVo.class);
List<Category> categorys = categoryData.findAll();
for (DeviceInfoVo row : result.getRows()) {
if (ObjectUtil.isNotEmpty(row.getProductKey())) {

@ -62,7 +62,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.security.PermitAll;
import java.time.LocalDateTime;
@ -164,7 +163,6 @@ public class ThingServiceImpl implements IThingService {
switch (type) {
case REGISTER:
//设备注册
// 根据
String deviceId = registerDevice(device, (DeviceRegister) action, null);
deviceUpdateLastTime(deviceId, lastTime);
@ -369,9 +367,8 @@ public class ThingServiceImpl implements IThingService {
.deviceStatus(device.getDeviceStatus())
.occurred(System.currentTimeMillis())
.build();
//增加启用未启用条件查询
List<AlertConfig> config = iAlertConfigData.findByDeviceName(device.getDeviceName());
//在设备列表中,添加了手机号并且选择了通知方式、语音、短信等。其实是添加到了告警事件配置里面。
// List<AlertRecord> alerts = idAlertRecordData.selectAlertConfigPage(AlertRecordBo.builder().details(device.getDeviceName()).build());
System.out.println("设备告警 您的设备【" + device.getDeviceName() + "】触发事件 事件类型为:【" + map.get("eventTypeValue").toString() + "】。");
if (ObjectUtil.isEmpty(config)) {
@ -382,12 +379,7 @@ public class ThingServiceImpl implements IThingService {
executor.execute(() -> {
List<Rule> rules = ruleMessageHandler.processMessage1(thingModelMessage);
for (Rule rule : rules) {
//这里也要加增加启用未启用条件查询
List<AlertConfig> config1 = iAlertConfigData.findByRuleInfoIdAndDeviceName(rule.getId(),device.getDeviceName());
if(CollectionUtils.isEmpty(config1)){
config1 = iAlertConfigData.findByRuleInfoIdAndDeviceName(rule.getId(),null);
}
List<AlertConfig> config1 = iAlertConfigData.findByRuleInfoId(rule.getId());
for (int i = 0; i < config1.size(); i++) {
idAlertRecordData.save(AlertRecord.builder()
.level(config1.get(i).getLevel())
@ -402,28 +394,28 @@ public class ThingServiceImpl implements IThingService {
.deptAreaId(device.getDeptAreaId())
.readFlg(false)
.alertTime(System.currentTimeMillis())
.details("您的设备【" + device.getDeviceName() + "】,位置【" + device.getSite() + "】触发事件 事件类型为:【" + map.get("eventTypeValue").toString() + "】。")
.details("您的设备【" + device.getDeviceName() + "】触发事件 事件类型为:【" + map.get("eventTypeValue").toString() + "】。")
.build());
// if (ObjectUtil.isNotEmpty(deviceInfoArrayList1)) {
// for (int j = 0; j < deviceInfoArrayList1.size(); j++) {
// String deviceName = deviceInfoArrayList1.get(j).getNodeStatus().equals("1")?device.getDeviceName(): deviceInfoArrayList1.get(j).getNodeDevice();
// idAlertRecordData.save(AlertRecord.builder()
// .level(config1.get(i).getLevel())
// .name(config1.get(i).getName())
// .reasonForRemovalFlag(0)
// .productKey(device.getProductKey())
// .levelStatus(eventTypeValue1)
// .deviceName(deviceInfoArrayList1.get(j).getDeviceName())
// .site(deviceInfoArrayList1.get(j).getSite())
// .tenantId(deviceInfoArrayList1.get(j).getTenantId())
// .uid(deviceInfoArrayList1.get(j).getUid())
// .deptAreaId(deviceInfoArrayList1.get(j).getDeptAreaId())
// .readFlg(false)
// .alertTime(System.currentTimeMillis())
// .details("您的设备【" + deviceInfoArrayList1.get(j).getDeviceName() + "】,节点" + deviceInfoArrayList1.get(j).getNode() + "触发事件,事件类型:【联动箱输出】," + "告警设备:" + deviceName)
// .build());
// }
// }
if (ObjectUtil.isNotEmpty(deviceInfoArrayList1)) {
for (int j = 0; j < deviceInfoArrayList1.size(); j++) {
String deviceName = deviceInfoArrayList1.get(j).getNodeStatus().equals("1")?device.getDeviceName(): deviceInfoArrayList1.get(j).getNodeDevice();
idAlertRecordData.save(AlertRecord.builder()
.level(config1.get(i).getLevel())
.name(config1.get(i).getName())
.reasonForRemovalFlag(0)
.productKey(device.getProductKey())
.levelStatus(eventTypeValue1)
.deviceName(deviceInfoArrayList1.get(j).getDeviceName())
.site(deviceInfoArrayList1.get(j).getSite())
.tenantId(deviceInfoArrayList1.get(j).getTenantId())
.uid(deviceInfoArrayList1.get(j).getUid())
.deptAreaId(deviceInfoArrayList1.get(j).getDeptAreaId())
.readFlg(false)
.alertTime(System.currentTimeMillis())
.details("您的设备【" + deviceInfoArrayList1.get(j).getDeviceName() + "】,节点" + deviceInfoArrayList1.get(j).getNode() + "触发事件,事件类型:【联动箱输出】," + "告警设备:" + deviceName)
.build());
}
}
ruleExecutor.execute1(thingModelMessage, config1);
}
}
@ -451,28 +443,28 @@ public class ThingServiceImpl implements IThingService {
.deptAreaId(device.getDeptAreaId())
.readFlg(false)
.alertTime(System.currentTimeMillis())
.details("您的设备【" + device.getDeviceName() + "】,位置【" + device.getSite() + "】触发事件 事件类型为:【" + map.get("eventTypeValue").toString() + "】。")
.details("您的设备【" + device.getDeviceName() + "】触发事件 事件类型为:【" + map.get("eventTypeValue").toString() + "】。")
.build());
// if (ObjectUtil.isNotEmpty(deviceInfoArrayList1)) {
// for (int j = 0; j < deviceInfoArrayList1.size(); j++) {
// String deviceName = deviceInfoArrayList1.get(j).getNodeStatus().equals("1")?device.getDeviceName(): deviceInfoArrayList1.get(j).getNodeDevice();
// idAlertRecordData.save(AlertRecord.builder()
// .level(config.get(i).getLevel())
// .name(config.get(i).getName())
// .site(deviceInfoArrayList1.get(j).getSite())
// .reasonForRemovalFlag(0)
// .productKey(device.getProductKey())
// .levelStatus(eventTypeValue1)
// .deviceName(deviceInfoArrayList1.get(j).getDeviceName())
// .tenantId(deviceInfoArrayList1.get(j).getTenantId())
// .uid(deviceInfoArrayList1.get(j).getUid())
// .deptAreaId(deviceInfoArrayList1.get(j).getDeptAreaId())
// .readFlg(false)
// .alertTime(System.currentTimeMillis())
// .details("您的设备【" + deviceInfoArrayList1.get(j).getDeviceName() + "】,节点" + deviceInfoArrayList1.get(j).getNode() + "触发事件,事件类型:【联动箱输出】," + "告警设备:" + deviceName)
// .build());
// }
// }
if (ObjectUtil.isNotEmpty(deviceInfoArrayList1)) {
for (int j = 0; j < deviceInfoArrayList1.size(); j++) {
String deviceName = deviceInfoArrayList1.get(j).getNodeStatus().equals("1")?device.getDeviceName(): deviceInfoArrayList1.get(j).getNodeDevice();
idAlertRecordData.save(AlertRecord.builder()
.level(config.get(i).getLevel())
.name(config.get(i).getName())
.site(deviceInfoArrayList1.get(j).getSite())
.reasonForRemovalFlag(0)
.productKey(device.getProductKey())
.levelStatus(eventTypeValue1)
.deviceName(deviceInfoArrayList1.get(j).getDeviceName())
.tenantId(deviceInfoArrayList1.get(j).getTenantId())
.uid(deviceInfoArrayList1.get(j).getUid())
.deptAreaId(deviceInfoArrayList1.get(j).getDeptAreaId())
.readFlg(false)
.alertTime(System.currentTimeMillis())
.details("您的设备【" + deviceInfoArrayList1.get(j).getDeviceName() + "】,节点" + deviceInfoArrayList1.get(j).getNode() + "触发事件,事件类型:【联动箱输出】," + "告警设备:" + deviceName)
.build());
}
}
ruleExecutor.execute1(thingModelMessage, config);
}
// RuleExecutor ruleExecutor = new RuleExecutor();
@ -499,21 +491,7 @@ public class ThingServiceImpl implements IThingService {
flag = false;
if (deviceInfo2.getNodeOneStatus().equals("1")) {
//选中的任意一个设备报警就发送联动控制指令
String[] deviceNames = {
deviceInfo2.getNodeOneDevice(),
deviceInfo2.getNodeTwoDevice(),
deviceInfo2.getNodeThreeDevice(),
deviceInfo2.getNodeFourDevice(),
deviceInfo2.getNodeFiveDevice()
};
boolean matchFound = Arrays.stream(deviceNames)
.filter(Objects::nonNull)
.anyMatch(name -> name.equals(device.getDeviceName()));
if (matchFound) {
flag = deviceLinkageControlSend(deviceInfo2, deviceInfo2.getNodeOne());
}
flag = deviceLinkageControlSend(deviceInfo2, deviceInfo2.getNodeOne());
} else {
//满足所有的设备告警才触发联动控制
String[] nodeOneDevice = deviceInfo2.getNodeOneDevice().split(",");
@ -535,21 +513,7 @@ public class ThingServiceImpl implements IThingService {
flag = false;
if (deviceInfo2.getNodeTwoStatus().equals("1")) {
//选中的任意一个设备报警就发送联动控制指令
String[] deviceNames = {
deviceInfo2.getNodeOneDevice(),
deviceInfo2.getNodeTwoDevice(),
deviceInfo2.getNodeThreeDevice(),
deviceInfo2.getNodeFourDevice(),
deviceInfo2.getNodeFiveDevice()
};
boolean matchFound = Arrays.stream(deviceNames)
.filter(Objects::nonNull)
.anyMatch(name -> name.equals(device.getDeviceName()));
if (matchFound) {
flag = deviceLinkageControlSend(deviceInfo2, deviceInfo2.getNodeOne());
}
flag = deviceLinkageControlSend(deviceInfo2, deviceInfo2.getNodeTwo());
} else {
//满足所有的设备告警才触发联动控制
String[] nodeOneDevice = deviceInfo2.getNodeTwoDevice().split(",");
@ -568,21 +532,7 @@ public class ThingServiceImpl implements IThingService {
flag = false;
if (deviceInfo2.getNodeThreeStatus().equals("1")) {
//选中的任意一个设备报警就发送联动控制指令
String[] deviceNames = {
deviceInfo2.getNodeOneDevice(),
deviceInfo2.getNodeTwoDevice(),
deviceInfo2.getNodeThreeDevice(),
deviceInfo2.getNodeFourDevice(),
deviceInfo2.getNodeFiveDevice()
};
boolean matchFound = Arrays.stream(deviceNames)
.filter(Objects::nonNull)
.anyMatch(name -> name.equals(device.getDeviceName()));
if (matchFound) {
flag = deviceLinkageControlSend(deviceInfo2, deviceInfo2.getNodeOne());
}
flag = deviceLinkageControlSend(deviceInfo2, deviceInfo2.getNodeThree());
} else {
//满足所有的设备告警才触发联动控制
String[] nodeOneDevice = deviceInfo2.getNodeThreeDevice().split(",");
@ -601,21 +551,7 @@ public class ThingServiceImpl implements IThingService {
flag = false;
if (deviceInfo2.getNodeFourStatus().equals("1")) {
//选中的任意一个设备报警就发送联动控制指令
String[] deviceNames = {
deviceInfo2.getNodeOneDevice(),
deviceInfo2.getNodeTwoDevice(),
deviceInfo2.getNodeThreeDevice(),
deviceInfo2.getNodeFourDevice(),
deviceInfo2.getNodeFiveDevice()
};
boolean matchFound = Arrays.stream(deviceNames)
.filter(Objects::nonNull)
.anyMatch(name -> name.equals(device.getDeviceName()));
if (matchFound) {
flag = deviceLinkageControlSend(deviceInfo2, deviceInfo2.getNodeOne());
}
flag = deviceLinkageControlSend(deviceInfo2, deviceInfo2.getNodeFour());
} else {
//满足所有的设备告警才触发联动控制
String[] nodeOneDevice = deviceInfo2.getNodeFourDevice().split(",");
@ -634,21 +570,7 @@ public class ThingServiceImpl implements IThingService {
flag = false;
if (deviceInfo2.getNodeFiveStatus().equals("1")) {
//选中的任意一个设备报警就发送联动控制指令
String[] deviceNames = {
deviceInfo2.getNodeOneDevice(),
deviceInfo2.getNodeTwoDevice(),
deviceInfo2.getNodeThreeDevice(),
deviceInfo2.getNodeFourDevice(),
deviceInfo2.getNodeFiveDevice()
};
boolean matchFound = Arrays.stream(deviceNames)
.filter(Objects::nonNull)
.anyMatch(name -> name.equals(device.getDeviceName()));
if (matchFound) {
flag = deviceLinkageControlSend(deviceInfo2, deviceInfo2.getNodeOne());
}
flag = deviceLinkageControlSend(deviceInfo2, deviceInfo2.getNodeFive());
} else {
//满足所有的设备告警才触发联动控制
String[] nodeOneDevice = deviceInfo2.getNodeFiveDevice().split(",");
@ -745,27 +667,12 @@ public class ThingServiceImpl implements IThingService {
"controlOutput", node + "0001"
))
.build();
idAlertRecordData.save(AlertRecord.builder()
.level("1")
.name("联动控制箱下发")
.reasonForRemovalFlag(0)
.productKey(device.getProductKey())
.levelStatus("联动控制箱下发")
.deviceName(device.getDeviceName())
.site(device.getSite())
.tenantId(device.getTenantId())
.uid(device.getUid())
.deptAreaId(device.getDeptAreaId())
.readFlg(false)
.alertTime(System.currentTimeMillis())
.details("您的设备【" + device.getDeviceName() + "】,节点" + node + "触发事件,事件类型:【联动箱输出】。")
.build());
//联动控制箱下发指令
deviceService.invoke(thingService);
return true;
}
//浓度变化,事件类型:
//浓度变化
public void extractDetectorData(DeviceInfo device, Map<String, Object> baseInfo) {
for (Map.Entry<String, Object> entry : baseInfo.entrySet()) {
if (entry.getKey().startsWith("dataDetectorValue")) {
@ -980,7 +887,7 @@ public class ThingServiceImpl implements IThingService {
if (productKey != null && device.getProductKey() != null
&& !device.getProductKey().equals(productKey)) {
//防止设备变更了产品key
// device.setProductKey(productKey);
device.setProductKey(productKey);
// device.setModel(register.getModel());
deviceInfoData.save(device);
}

@ -28,12 +28,10 @@ import cc.iotkit.common.thing.ThingModelMessage;
import cc.iotkit.common.utils.JsonUtils;
import cc.iotkit.data.manager.IAlertConfigData;
import cc.iotkit.data.manager.IDeviceInfoData;
import cc.iotkit.data.manager.IProductData;
import cc.iotkit.data.manager.IUserInfoData;
import cc.iotkit.model.UserInfo;
import cc.iotkit.model.alert.AlertConfig;
import cc.iotkit.model.device.DeviceInfo;
import cc.iotkit.model.product.Product;
import cc.iotkit.model.rule.RuleLog;
import cc.iotkit.model.worder.WorderDO;
import cc.iotkit.ruleengine.action.Action;
@ -65,11 +63,9 @@ import org.dromara.sms4j.api.entity.SmsResponse;
import org.dromara.sms4j.core.factory.SmsFactory;
import org.dromara.sms4j.provider.enumerate.SupplierType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Lazy;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import javax.security.auth.message.config.AuthConfig;
@ -104,14 +100,6 @@ public class RuleExecutor {
@Resource
private WxMaService wxMaService;
@Autowired
@Qualifier("productDataCache")
private IProductData productData;
@Autowired
@Qualifier("deviceInfoDataCache")
private IDeviceInfoData deviceInfoData;
public void execute1(ThingModelMessage message,List<AlertConfig> listAlertConfigs) {
DeviceInfo deviceInfo = iDeviceInfoData.findByDeviceId(message.getDeviceId());
// 注入 WxMaService 后直接调用
@ -291,7 +279,6 @@ public class RuleExecutor {
case "0":
//发送短信
try {
Date date = new Date(message.getTime());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String templateId = "SMS_492470379";
@ -316,23 +303,6 @@ public class RuleExecutor {
System.out.println("短信接口返回的数据:" + smsResponse);
/* if (!"OK".equals(smsResponse.getCode())) {
}*/
// 发送联动控制箱短信
List<DeviceInfo> deviceInfos = deviceLinkageControl(deviceInfo);
if(CollectionUtils.isEmpty(deviceInfos)){
break;
}
String templateId1 = "SMS_496730336";
LinkedHashMap<String, String> map1 = new LinkedHashMap<>(1);
map.put("boxDeviceName", deviceInfos.get(0).getDeviceName());
String deviceName = deviceInfos.get(0).getNodeStatus().equals("1")?deviceInfo.getDeviceName(): deviceInfos.get(0).getNodeDevice();
String node = deviceInfos.get(0).getNode();
map.put("node", node);
map.put("deviceSite", site);
map.put("deviceName", deviceName);
SmsBlend smsBlend1 = SmsFactory.createSmsBlend(SupplierType.ALIBABA);
SmsResponse smsResponse1 = smsBlend1.sendMessage(userInfo.getUserName(), templateId1, map);
System.out.println("短信接口返回的数据:" + smsResponse1);
} catch (Exception e) {
e.printStackTrace();
}
@ -548,98 +518,4 @@ public class RuleExecutor {
return results;
}
private List<DeviceInfo> deviceLinkageControl(DeviceInfo device) {
List<DeviceInfo> deviceInfo1 = new ArrayList<>();
deviceInfo1 = getDeviceInfo(device.getDeptAreaId(), "MQFejp7cyDMH3enG");
Boolean flag = false;
String nodeStatus = null;
List<DeviceInfo> deviceInfo55 = new ArrayList<>();
if (deviceInfo1 != null && !deviceInfo1.isEmpty()) {
for (DeviceInfo deviceInfo2 : deviceInfo1) {
if (ObjectUtil.isNotNull(deviceInfo2.getNodeOne()) && ObjectUtil.isNotNull(deviceInfo2.getNodeOneStatus()) && ObjectUtil.isNotNull(deviceInfo2.getNodeOneDevice())) {
if(device.getDeviceName().equals(deviceInfo2.getNodeOneDevice())){
nodeStatus = "1";
deviceInfo2.setNode(nodeStatus);
deviceInfo2.setNodeStatus(deviceInfo2.getNodeOneStatus());
deviceInfo2.setNodeDevice(deviceInfo2.getNodeOneDevice());
deviceInfo55.add(deviceInfo2);
}
}
if (ObjectUtil.isNotNull(deviceInfo2.getNodeTwo()) && ObjectUtil.isNotNull(deviceInfo2.getNodeTwoStatus()) && ObjectUtil.isNotNull(deviceInfo2.getNodeTwoDevice())) {
//deviceLinkageControlSend(deviceInfo2,deviceInfo2.getNodeTwo());
if(device.getDeviceName().equals(deviceInfo2.getNodeTwoDevice())){
nodeStatus = "2";
deviceInfo2.setNode(nodeStatus);
deviceInfo2.setNodeStatus(deviceInfo2.getNodeTwoStatus());
deviceInfo2.setNodeDevice(deviceInfo2.getNodeTwoDevice());
deviceInfo55.add(deviceInfo2);
}
}
if (ObjectUtil.isNotNull(deviceInfo2.getNodeThree()) && ObjectUtil.isNotNull(deviceInfo2.getNodeThreeStatus()) && ObjectUtil.isNotNull(deviceInfo2.getNodeThreeDevice())) {
// deviceLinkageControlSend(deviceInfo2,deviceInfo2.getNodeThree());
if(device.getDeviceName().equals(deviceInfo2.getNodeThreeDevice())){
nodeStatus = "3";
deviceInfo2.setNode(nodeStatus);
deviceInfo2.setNodeStatus(deviceInfo2.getNodeThreeStatus());
deviceInfo2.setNodeDevice(deviceInfo2.getNodeThreeDevice());
deviceInfo55.add(deviceInfo2);
}
}
if (ObjectUtil.isNotNull(deviceInfo2.getNodeFour()) && ObjectUtil.isNotNull(deviceInfo2.getNodeFourStatus()) && ObjectUtil.isNotNull(deviceInfo2.getNodeFourDevice())) {
// deviceLinkageControlSend(deviceInfo2,deviceInfo2.getNodeFour());
if(device.getDeviceName().equals(deviceInfo2.getNodeFourDevice())){
nodeStatus = "4";
deviceInfo2.setNode(nodeStatus);
deviceInfo2.setNodeStatus(deviceInfo2.getNodeFourStatus());
deviceInfo2.setNodeDevice(deviceInfo2.getNodeFourDevice());
deviceInfo55.add(deviceInfo2);
}
}
if (ObjectUtil.isNotNull(deviceInfo2.getNodeFive()) && ObjectUtil.isNotNull(deviceInfo2.getNodeFiveStatus()) && ObjectUtil.isNotNull(deviceInfo2.getNodeFiveDevice())) {
// deviceLinkageControlSend(deviceInfo2,deviceInfo2.getNodeFive());
if(device.getDeviceName().equals(deviceInfo2.getNodeFiveDevice())){
nodeStatus = "5";
deviceInfo2.setNode(nodeStatus);
deviceInfo2.setNodeStatus(deviceInfo2.getNodeFiveStatus());
deviceInfo2.setNodeDevice(deviceInfo2.getNodeFiveDevice());
deviceInfo55.add(deviceInfo2);
}
}
}
}
return deviceInfo55;
}
public List<DeviceInfo> getDeviceInfo(Long areaDeptId, String productKey) {
try {
return deviceInfoData.findByDeptAreaIdAndProductKey(areaDeptId, productKey);
// return deviceInfoData.findByDeptAreaIdAndProductKeyAndDeviceName(areaDeptId, productKey, deviceName);
} catch (Throwable e) {
log.error("get device error", e);
return null;
}
}
}

@ -362,8 +362,7 @@ public class SysTenantServiceImpl implements ISysTenantService {
//删除角色
SysRole querySysRole=new SysRole();
querySysRole.setTenantId(tenantId);
// List<SysRole> roles =sysRoleData.selectRoleList(querySysRole);
List<SysRole> roles =sysRoleData.selectByTenantId(tenantId);
List<SysRole> roles =sysRoleData.selectRoleList(querySysRole);
sysRoleData.deleteByIds(roles.stream().map(SysRole::getId).collect(Collectors.toList()));
//删除部门
List<SysDept> lsDepts = sysDeptData.findByTenantId(tenantId);

@ -28,9 +28,6 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@Configuration
@EnableScheduling
public class SchedulerConfig {
@ -44,10 +41,4 @@ public class SchedulerConfig {
return scheduler;
}
@Bean
public ExecutorService taskExecutor() {
// 创建一个固定大小的线程池大小为10
return Executors.newFixedThreadPool(10);
}
}
}

@ -52,7 +52,6 @@ spring:
hibernate:
format_sql: false
use_sql_comments: false # 输出SQL注释
generate_statistics: false # 关闭统计信息
session_factory:
# statement_inspector: com.example.TenantSQLInterceptor
# dialect: org.hibernate.dialect.MySQL5Dialect
@ -60,8 +59,7 @@ spring:
type: com.zaxxer.hikari.HikariDataSource
driverClassName: com.mysql.cj.jdbc.Driver
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
url: jdbc:mysql://172.16.0.64:3306/hma_iot?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&useSSL=false
# url: jdbc:mysql://123.57.78.108:3306/hma_iot_test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&useSSL=false
url: jdbc:mysql://123.57.78.108:3306/hma_iot?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&useSSL=false
username: root
password: 1093e4769496a6ed
#password: CGKhbMfrdz6w3icX
@ -83,8 +81,7 @@ spring:
rest:
#使用内置es的配置
#uris: http://elasticsearch:9200
# uris: http://123.57.78.108:9301
uris: http://172.16.0.64:9301
uris: http://123.57.78.108:9301
username: elastic
password: hmkj@2023
connection-timeout: 10s
@ -112,8 +109,7 @@ spring:
embedded:
enabled: false
#host: redis
# host: 123.57.78.108
host: 172.16.0.64
host: 123.57.78.108
port: 6379
database: 11
password: HMkj@2023

@ -72,12 +72,6 @@
<appender-ref ref="console"/>
</logger>
<logger name="org.hibernate.SQL" level="OFF"/>
<logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="OFF"/>
<logger name="org.hibernate.type.descriptor.sql" level="OFF"/>
<logger name="org.hibernate.engine.QueryParameters" level="OFF"/>
<logger name="org.hibernate.engine.query.HQLQueryPlan" level="OFF"/>
<logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="trace"/>
<!-- <logger name="org.springframework" level="debug" additivity="false">-->
@ -92,4 +86,4 @@
<appender-ref ref="console"/>
</root>
</configuration>
</configuration>
Loading…
Cancel
Save