设备类型关联

This commit is contained in:
haozq 2024-09-23 15:08:50 +08:00
parent a69106d8f8
commit 622fb1a1e6
9 changed files with 25 additions and 4 deletions

View File

@ -13,6 +13,8 @@ public class DevInfoVo implements Serializable {
private String bdId; private String bdId;
private String relType;
/** /**
* 设备id * 设备id
*/ */

View File

@ -88,4 +88,11 @@ public interface DataCenterMapper {
* @return * @return
*/ */
String getDevBdData(@Param("edgeId") String edgeId); String getDevBdData(@Param("edgeId") String edgeId);
/**
* 查询本系统设备类型
* @param vo
* @return
*/
Integer getDevTypeId(DevInfoVo vo);
} }

View File

@ -45,6 +45,11 @@ public class DataCenterServiceImpl implements DataCenterService{
if (StringUtils.isNotEmpty(list)) { if (StringUtils.isNotEmpty(list)) {
list.forEach(vo->{ list.forEach(vo->{
vo.setBdId(bdId); vo.setBdId(bdId);
vo.setRelType(vo.getDeviceType());
Integer devType=mapper.getDevTypeId(vo);
if(devType!=null && devType!=0){
vo.setDeviceType(devType.toString());
}
int nums = mapper.getDevInfoNum(vo); int nums = mapper.getDevInfoNum(vo);
if(nums>0){ if(nums>0){
//是否更新 //是否更新

View File

@ -92,4 +92,11 @@
LEFT JOIN tb_bd_record tbr on tbr.id=bdr.record_id LEFT JOIN tb_bd_record tbr on tbr.id=bdr.record_id
where tbr.audit_status=1 and bdr.dev_code=#{edgeId} where tbr.audit_status=1 and bdr.dev_code=#{edgeId}
</select> </select>
<select id="getDevTypeId" resultType="java.lang.Integer">
select dict_code
FROM sys_dict_data
WHERE dict_type='dev_type'
and status=0
and dict_value LIKE CONCAT("%",#{},',',"%")
</select>
</mapper> </mapper>

View File

@ -9,10 +9,10 @@
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>bonus-datacenter</artifactId> <artifactId>bonus-data</artifactId>
<description> <description>
bonus-modules-datacenter 数据中心服务 bonus-modules-data 数据中心服务
</description> </description>
<dependencies> <dependencies>

View File

@ -16,9 +16,9 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
@EnableCustomSwagger2 @EnableCustomSwagger2
@EnableRyFeignClients @EnableRyFeignClients
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class }) @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
public class BonusDataCenterApplication { public class BonusDataApplication {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(BonusDataCenterApplication.class, args); SpringApplication.run(BonusDataApplication.class, args);
System.err.println("(♥◠‿◠)ノ゙ 数据中心服务启动成功 ლ(´ڡ`ლ)゙ \n" + System.err.println("(♥◠‿◠)ノ゙ 数据中心服务启动成功 ლ(´ڡ`ლ)゙ \n" +
" .-------. ____ __ \n" + " .-------. ____ __ \n" +
" | _ _ \\ \\ \\ / / \n" + " | _ _ \\ \\ \\ / / \n" +