Commit 60c2b067 authored by KeYong's avatar KeYong

提交ES配置等

parent 387fa00f
......@@ -33,7 +33,6 @@ public class ElasticSearchClientConfig {
final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
credentialsProvider.setCredentials(AuthScope.ANY,
new UsernamePasswordCredentials(username, password));
try {
String url = uris.replace("http://", "");
final String[] parts = StringUtils.split(url, ":");
......@@ -43,10 +42,7 @@ public class ElasticSearchClientConfig {
httpClientBuilder.disableAuthCaching();
return httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);
});
builder.setRequestConfigCallback((requestConfigBuilder)->requestConfigBuilder.setConnectTimeout(5000 * 1000).setSocketTimeout(6000 * 1000));
return new RestHighLevelClient(builder);
} catch (Exception e) {
throw new IllegalStateException("Invalid ES nodes " + "property '" + uris + "'", e);
......
......@@ -21,6 +21,8 @@ import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.common.vo.EquipmentOnCarVo;
import com.yeejoin.equipmanage.common.vo.VideoOnEquipmentSpecificVo;
import com.yeejoin.equipmanage.dao.ESEquipmentSpecificDao;
import com.yeejoin.equipmanage.dto.ESEquipmentSpecificDto;
import com.yeejoin.equipmanage.fegin.IotFeign;
import com.yeejoin.equipmanage.mapper.EquipQrcodeRecordMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper;
......@@ -40,6 +42,7 @@ import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.*;
......@@ -92,7 +95,9 @@ public class EquipmentSpecificController extends AbstractBaseController {
*/
@RequestMapping(value = "/page", method = RequestMethod.POST)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "列表分页查询", notes = "补码列表接口,废弃未用到")
@ApiOperation(httpMethod = "POST", value = "列表分页查询", notes = "补码列表接口," +
"" +
"废弃未用到")
public IPage<ComplementCodeVO> saveEquipmentPoint(@RequestBody EquipmentSpecificDTO equipmentSpecific) {
return equipmentSpecificSerivce.selectEquipmentSpecific(equipmentSpecific);
}
......@@ -658,4 +663,14 @@ public class EquipmentSpecificController extends AbstractBaseController {
return equipmentSpecificSerivce.getFireEquipListByDefineCode(code, equipStatus, bizOrgCode, pageBean);
}
@Autowired
ESEquipmentSpecificDao esEquipmentSpecificDao;
@RequestMapping(value = "/test", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询")
public ResponseModel<String> getTester() {
return ResponseHelper.buildResponse(esEquipmentSpecificDao.save(""));
}
}
package com.yeejoin.equipmanage.dao;
import com.yeejoin.equipmanage.dto.ESEquipmentSpecificDto;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface ESEquipmentSpecificDao extends PagingAndSortingRepository<ESEquipmentSpecificDto, String> {
}
package com.yeejoin.equipmanage.dto;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.equipmanage.common.entity.Stock;
import com.yeejoin.equipmanage.common.entity.StockDetail;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author keyong
* @title: ESEquipmentSpecificDto
* <pre>
* @description: TODO
* </pre>
* @date 2024/8/6 14:19
*/
@Data
@Accessors(chain = true)
@Document(indexName = "equipment_specific", shards = 1, replicas = 0)
public class ESEquipmentSpecificDto {
@Id
private Long id;
@ApiModelProperty(value = "设备id")
@Field(type = FieldType.Long)
private Long equipmentDetailId;
@ApiModelProperty(value = "二维码")
@Field(type = FieldType.Text)
private String qrCode;
@ApiModelProperty(value = "管理方式(默认单件)")
@Field(type = FieldType.Boolean)
private Boolean single;
@ApiModelProperty(value = "所属系统")
@Field(type = FieldType.Text)
private String systemId;
@ApiModelProperty(value = "物联编码")
@Field(type = FieldType.Keyword)
private String iotCode;
@ApiModelProperty(value = "批量录入数量")
@Field(type = FieldType.Float)
private Float num;
@ApiModelProperty(value = "单位编码")
@Field(type = FieldType.Text)
private String orgCode;
@ApiModelProperty(value = "设备编码")
@Field(type = FieldType.Text)
private String code;
@ApiModelProperty(value = "录入方式")
@Field(type = FieldType.Integer)
private Integer inputWay;
@ApiModelProperty(value = "所属单位id(来源于平台)")
@Field(type = FieldType.Text)
private String agencyId;
@ApiModelProperty(value = "所属单位名称(来源于平台)")
@Field(type = FieldType.Text)
private String agencyName;
@ApiModelProperty(value = "所属队伍id(来源于平台)")
@Field(type = FieldType.Text)
private String teamId;
@ApiModelProperty(value = "队伍名称(冗余字段来源于平台)")
@Field(type = FieldType.Text)
private String teamName;
@ApiModelProperty(value = "实时指标名称")
@Field(type = FieldType.Text)
private String realtimeIotIndexName;
@ApiModelProperty(value = "实时指标编码")
@Field(type = FieldType.Text)
private String realtimeIotIndexKey;
@ApiModelProperty(value = "实时指标值")
@Field(type = FieldType.Text)
private String realtimeIotIndexValue;
@ApiModelProperty(value = "实时指标id(wl_equipment_specific_index_id)")
@Field(type = FieldType.Long)
private Long realtimeIotEsIndexId;
@ApiModelProperty(value = "指标id(wl_equipment_index_id)")
@Field(type = FieldType.Long)
private Long realtimeIotIndexId;
@ApiModelProperty(value = "实时指标更新时间")
@Field(type = FieldType.Date)
private Date realtimeIotIndexUpdateDate;
@ApiModelProperty(value = "物联设备实时状态,默认0表示正常(绿色#00ff00),1为故障类(黄色 #ffd500),2为火警类(红色#ff0000)")
@Field(type = FieldType.Text)
private String equipStatus="0";
@ApiModelProperty(value = "完整二维码")
@Field(type = FieldType.Text)
private String fullqrCode;
@Field(type = FieldType.Text)
private Stock stock;
@Field(type = FieldType.Object)
private StockDetail stockDetail;
//新加
@ApiModelProperty(value = "机构/部门名称")
@Field(type = FieldType.Text)
private String bizOrgName;
@ApiModelProperty(value = "机构编码")
@Field(type = FieldType.Text)
private String bizOrgCode;
/**
* 所属部门
*/
@Field(type = FieldType.Long)
private Long departmentId;
/**
* 物理区域id,数据来源于wl_area
*/
@Field(type = FieldType.Long)
private Long areaId;
/**
* 设备名称
*/
@Field(type = FieldType.Text)
private String name;
/**
* 设备位置
*/
@Field(type = FieldType.Text)
private String position;
/**
* 设备detail编码
*/
@Field(type = FieldType.Text)
private String equipmentCode;
/**
* 存放位置冗余字段
*/
@Field(type = FieldType.Long)
private Long warehouseStructureId;
@ApiModelProperty(value = "告警状态")
@Field(type = FieldType.Integer)
private Integer status;
@ApiModelProperty(value = "系统名称")
@Field(type = FieldType.Text)
private String systemName;
@ApiModelProperty(value = "设备值说明")
@Field(type = FieldType.Text)
private String valueLabel;
@ApiModelProperty(value = "质保信息")
@Field(type = FieldType.Text)
private String warrantyInfo;
@ApiModelProperty(value = "指标类型编码")
@Field(type = FieldType.Text)
private String typeCode;
@ApiModelProperty(value = "质保周期")
@JsonFormat(pattern = "yyyy-MM-dd")
@Field(type = FieldType.Date)
private Date warrantyPeriod;
@Field(type = FieldType.Text)
private String equipCondition;
@ApiModelProperty(value = "是否遥测")
@Field(type = FieldType.Boolean)
private Boolean isTrend;
@ApiModelProperty(value = "指标单位")
@Field(type = FieldType.Text)
private String unit;
@ApiModelProperty(value = "指标参数")
@Field(type = FieldType.Object)
private List<Map<String, Object>> indexParameter;
}
package com.yeejoin.equipmanage.service;
/**
* @author keyong
* @title: IESEquipmentSpecificService
* <pre>
* @description: TODO
* </pre>
* @date 2024/8/6 17:52
*/
public interface IESEquipmentSpecificService {
}
package com.yeejoin.equipmanage.service.impl;
import com.yeejoin.equipmanage.service.IESEquipmentSpecificService;
/**
* @author keyong
* @title: IESEquipmentSpecificService
* <pre>
* @description: TODO
* </pre>
* @date 2024/8/6 17:50
*/
public class ESEquipmentSpecificServiceImpl implements IESEquipmentSpecificService {
}
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