Browse Source

物联网修改

D 1 year ago
parent
commit
7bf78fe4bf
20 changed files with 497 additions and 26 deletions
  1. 1 15
      common/common-entity/sql/2023.sql
  2. 8 0
      common/common-entity/src/main/java/com/yihu/jw/entity/iot/company/IotCompanyAppDO.java
  3. 0 1
      common/common-entity/src/main/java/com/yihu/jw/entity/iot/company/IotCompanyDO.java
  4. 51 0
      common/common-entity/src/main/java/com/yihu/jw/entity/iot/device/IotPatientDeviceDO.java
  5. 10 1
      common/common-entity/src/main/java/com/yihu/jw/entity/iot/product/IotProductBaseInfoDO.java
  6. 89 0
      common/common-entity/src/main/java/com/yihu/jw/entity/iot/product/IotProductBaseInfoPropertyDO.java
  7. 4 1
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/iot/IotRequestMapping.java
  8. 10 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/iot/company/IotCompanyAppVO.java
  9. 0 1
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/iot/company/IotCompanyVO.java
  10. 50 1
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/iot/device/IotPatientDeviceVO.java
  11. 90 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/iot/product/IotProductBaseInfoPropertyVO.java
  12. 11 1
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/iot/product/IotProductBaseInfoVO.java
  13. 49 1
      svr/svr-iot/src/main/java/com/yihu/iot/controller/product/IotProductController.java
  14. 2 0
      svr/svr-iot/src/main/java/com/yihu/iot/dao/product/IotProductBaseInfoDao.java
  15. 19 0
      svr/svr-iot/src/main/java/com/yihu/iot/dao/product/IotProductBaseInfoPropertyDao.java
  16. 1 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/company/IotCompanyService.java
  17. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java
  18. 86 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/product/IotProductBaseInfoPropertyService.java
  19. 13 1
      svr/svr-iot/src/main/java/com/yihu/iot/service/product/IotProductBaseInfoService.java
  20. 2 2
      svr/svr-iot/src/main/resources/bootstrap.yml

+ 1 - 15
common/common-entity/sql/2023.sql

@ -1,21 +1,5 @@
CREATE TABLE `iot_statistics_realtime` (
     `id` varchar(50) NOT NULL,
     `type` varchar(50) DEFAULT NULL,
     `device_num` varchar(20) DEFAULT NULL COMMENT '设备数据',
     `sign_num` varchar(20) DEFAULT NULL COMMENT '体征数据',
     `abnormal_num` varchar(20) DEFAULT NULL COMMENT '异常数据',
     `create_time` datetime DEFAULT NULL,
     PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='大屏-统计-实时数据';
-- 数据库 device
ALTER TABLE wlyy_patient_device_location ADD city varchar(20) COMMENT '城市' ;
ALTER TABLE wlyy_patient_device_location ADD city_name varchar(20) COMMENT '城市名称' ;
ALTER TABLE wlyy_patient_device_location ADD town varchar(20) COMMENT '地区' ;
ALTER TABLE wlyy_patient_device_location ADD town_name varchar(20) COMMENT '地区名称' ;
ALTER TABLE wlyy_knowledge_article_dict ADD url varchar(500) COMMENT '外链地址' ;
ALTER TABLE wlyy_patient_device_location ADD town_name varchar(20) COMMENT '地区名称' ;

+ 8 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/iot/company/IotCompanyAppDO.java

@ -15,6 +15,8 @@ import java.io.Serializable;
@Entity
@Table(name = "iot_company_app")
public class IotCompanyAppDO extends UuidIdentityEntityWithOperator implements Serializable {
    @Column(name = "secret_key")
    private String secretKey;//
    @Column(name = "saas_id")
    private String saasId;//
    @Column(name = "name")
@ -76,4 +78,10 @@ public class IotCompanyAppDO extends UuidIdentityEntityWithOperator implements S
    public void setStatus(String status) {
        this.status = status;
    }
    public String getSecretKey() {
        return secretKey;
    }
    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }
}

+ 0 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/iot/company/IotCompanyDO.java

@ -15,7 +15,6 @@ import java.util.List;
@Entity
@Table(name = "iot_company")
public class IotCompanyDO extends UuidIdentityEntityWithOperator implements Serializable {
    @Column(name = "saas_id")
    private String saasId;//
    @Column(name = "status")

+ 51 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/iot/device/IotPatientDeviceDO.java

@ -62,6 +62,17 @@ public class IotPatientDeviceDO extends UuidIdentityEntityWithOperator implement
    private String damageImages;//申请维修附件图片,多个用逗号隔开
    @Column(name = "repair_description")
    private String repairDescription;//维修说明
    @Column(name = "property_name")
    private Integer propertyName; //设备通用名称
    @Column(name = "property_combination")
    private String propertyCombination;  //组合访视
    @Column(name = "property_use")
    private String propertyUse;//用途
    @Column(name = "property_network")
    private String propertyNetwork;//网络传输
    @Column(name = "property_location")
    private String propertyLocation;//投放位置
    public String getSaasId() {
        return saasId;
@ -241,4 +252,44 @@ public class IotPatientDeviceDO extends UuidIdentityEntityWithOperator implement
    public void setRepairDescription(String repairDescription) {
        this.repairDescription = repairDescription;
    }
    public Integer getPropertyName() {
        return propertyName;
    }
    public void setPropertyName(Integer propertyName) {
        this.propertyName = propertyName;
    }
    public String getPropertyCombination() {
        return propertyCombination;
    }
    public void setPropertyCombination(String propertyCombination) {
        this.propertyCombination = propertyCombination;
    }
    public String getPropertyUse() {
        return propertyUse;
    }
    public void setPropertyUse(String propertyUse) {
        this.propertyUse = propertyUse;
    }
    public String getPropertyNetwork() {
        return propertyNetwork;
    }
    public void setPropertyNetwork(String propertyNetwork) {
        this.propertyNetwork = propertyNetwork;
    }
    public String getPropertyLocation() {
        return propertyLocation;
    }
    public void setPropertyLocation(String propertyLocation) {
        this.propertyLocation = propertyLocation;
    }
}

+ 10 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/iot/product/IotProductBaseInfoDO.java

@ -15,7 +15,6 @@ import java.util.Date;
@Entity
@Table(name = "iot_product_base_info")
public class IotProductBaseInfoDO extends UuidIdentityEntityWithOperator implements Serializable {
    @Column(name = "saas_id")
    private String saasId;//
    @Column(name = "parent_id")
@ -69,6 +68,8 @@ public class IotProductBaseInfoDO extends UuidIdentityEntityWithOperator impleme
    private String spec;//规格
    @Column(name = "unit")
    private String unit;//单位
    @Column(name = "property")
    private String property;//属性 1.是 0.否
    @Column(name = "purchase_price")
    private Double purchasePrice;//进货价
    @Column(name = "retail_price")
@ -337,4 +338,12 @@ public class IotProductBaseInfoDO extends UuidIdentityEntityWithOperator impleme
    public void setInventoryFloor(Integer inventoryFloor) {
        this.inventoryFloor = inventoryFloor;
    }
    public String getProperty() {
        return property;
    }
    public void setProperty(String property) {
        this.property = property;
    }
}

+ 89 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/iot/product/IotProductBaseInfoPropertyDO.java

@ -0,0 +1,89 @@
package com.yihu.jw.entity.iot.product;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
/**
 * 类描述:
 *
 * @author 陈鑫
 * @date 2023-05-05 14:37
 **/
@Entity
@Table(name = "iot_product_base_info_property")
public class IotProductBaseInfoPropertyDO extends UuidIdentityEntityWithOperator implements Serializable {
    @Column(name = "product_id")
    private String productId;
    @Column(name = "name")
    private String name;
    @Column(name = "combination")
    private String combination;
    @Column(name = "use")
    private String use;
    @Column(name = "network")
    private String network;
    @Column(name = "location")
    private String location;
    @Column(name = "dictionaries")
    private String dictionaries;
    public String getProductId() {
        return productId;
    }
    public void setProductId(String productId) {
        this.productId = productId;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getCombination() {
        return combination;
    }
    public void setCombination(String combination) {
        this.combination = combination;
    }
    public String getUse() {
        return use;
    }
    public void setUse(String use) {
        this.use = use;
    }
    public String getNetwork() {
        return network;
    }
    public void setNetwork(String network) {
        this.network = network;
    }
    public String getLocation() {
        return location;
    }
    public void setLocation(String location) {
        this.location = location;
    }
    public String getDictionaries() {
        return dictionaries;
    }
    public void setDictionaries(String dictionaries) {
        this.dictionaries = dictionaries;
    }
}

+ 4 - 1
common/common-request-mapping/src/main/java/com/yihu/jw/rm/iot/IotRequestMapping.java

@ -42,6 +42,7 @@ public class IotRequestMapping {
        public static final String message_success_find_functions = "find success";
        public static final String message_success_import = "import success";
        public static final String message_fail = "fail";
        public static final String message_fail_name_is_null = "name is null";
        public static final String message_fail_is_no_exist = "is no exist";
        public static final String message_fail_id_no_exist = "id no exist";
@ -167,7 +168,9 @@ public class IotRequestMapping {
        public static final String setInventoryById = "setInventoryById";
        public static final String findAll = "findAll";
        public static final String findListByCategoryCode = "findListByCategoryCode";
        public static final String addProductProperty = "addProductProperty";
        public static final String updateProductProperty = "updateProductProperty";
        public static final String findProductProperty = "findProductProperty";
    }
    /**

+ 10 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/iot/company/IotCompanyAppVO.java

@ -16,6 +16,8 @@ public class IotCompanyAppVO implements Serializable {
    @ApiModelProperty("应用ID")
    private String id;
    @ApiModelProperty("秘钥")
    private String secretKey;
    @ApiModelProperty("应用名称")
    private String name;
    @ApiModelProperty("访问IP地址")
@ -88,4 +90,12 @@ public class IotCompanyAppVO implements Serializable {
    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }
    public String getSecretKey() {
        return secretKey;
    }
    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }
}

+ 0 - 1
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/iot/company/IotCompanyVO.java

@ -16,7 +16,6 @@ import java.util.List;
@JsonInclude(JsonInclude.Include.ALWAYS)
@ApiModel(value = "企业表", description = "企业表")
public class IotCompanyVO extends BaseVO implements Serializable {
    @ApiModelProperty("审核状态(预留字段)")
    private String status;
    @ApiModelProperty("企业名称")

+ 50 - 1
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/iot/device/IotPatientDeviceVO.java

@ -67,7 +67,16 @@ public class IotPatientDeviceVO extends BaseVO implements Serializable {
    private String sim;
    @ApiModelProperty("领用协议,多个用逗号隔开")
    private String imgs;
    @ApiModelProperty("设备通用名")
    private String propertyName;
    @ApiModelProperty("组合方式")
    private String propertyCombination;
    @ApiModelProperty("用途")
    private String propertyUse;
    @ApiModelProperty("网络传输")
    private String propertyNetwork;
    @ApiModelProperty("投放位置")
    private String propertyLocation;
    public String getPatient() {
        return patient;
@ -276,4 +285,44 @@ public class IotPatientDeviceVO extends BaseVO implements Serializable {
    public void setImgs(String imgs) {
        this.imgs = imgs;
    }
    public String getPropertyName() {
        return propertyName;
    }
    public void setPropertyName(String propertyName) {
        this.propertyName = propertyName;
    }
    public String getPropertyCombination() {
        return propertyCombination;
    }
    public void setPropertyCombination(String propertyCombination) {
        this.propertyCombination = propertyCombination;
    }
    public String getPropertyUse() {
        return propertyUse;
    }
    public void setPropertyUse(String propertyUse) {
        this.propertyUse = propertyUse;
    }
    public String getPropertyNetwork() {
        return propertyNetwork;
    }
    public void setPropertyNetwork(String propertyNetwork) {
        this.propertyNetwork = propertyNetwork;
    }
    public String getPropertyLocation() {
        return propertyLocation;
    }
    public void setPropertyLocation(String propertyLocation) {
        this.propertyLocation = propertyLocation;
    }
}

+ 90 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/iot/product/IotProductBaseInfoPropertyVO.java

@ -0,0 +1,90 @@
package com.yihu.jw.restmodel.iot.product;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.yihu.jw.restmodel.iot.common.BaseVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import java.io.Serializable;
/**
 * 类描述:
 *
 * @author 陈鑫
 * @date 2023-05-05 15:37
 **/
@JsonInclude(JsonInclude.Include.ALWAYS)
@ApiModel(description = "产品属性表")
public class IotProductBaseInfoPropertyVO extends BaseVO implements Serializable {
    @ApiModelProperty("产品id")
    private String productId;
    @ApiModelProperty("设备通用名")
    private String name;
    @ApiModelProperty("组合方式")
    private String combination;
    @ApiModelProperty("用途")
    private String use;
    @ApiModelProperty("网络传输")
    private String network;
    @ApiModelProperty("投放位置")
    private String location;
    @ApiModelProperty("数据采集字典")
    private String dictionaries;
    public String getProductId() {
        return productId;
    }
    public void setProductId(String productId) {
        this.productId = productId;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getCombination() {
        return combination;
    }
    public void setCombination(String combination) {
        this.combination = combination;
    }
    public String getUse() {
        return use;
    }
    public void setUse(String use) {
        this.use = use;
    }
    public String getNetwork() {
        return network;
    }
    public void setNetwork(String network) {
        this.network = network;
    }
    public String getLocation() {
        return location;
    }
    public void setLocation(String location) {
        this.location = location;
    }
    public String getDictionaries() {
        return dictionaries;
    }
    public void setDictionaries(String dictionaries) {
        this.dictionaries = dictionaries;
    }
}

+ 11 - 1
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/iot/product/IotProductBaseInfoVO.java

@ -6,6 +6,7 @@ import com.yihu.jw.restmodel.iot.common.BaseVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import java.io.Serializable;
import java.util.List;
@ -16,7 +17,6 @@ import java.util.List;
@JsonInclude(JsonInclude.Include.ALWAYS)
@ApiModel(description = "产品基本信息表")
public class IotProductBaseInfoVO extends BaseVO implements Serializable {
    @ApiModelProperty("父类ID")
    private String parentId;
    @ApiModelProperty("产品分类")
@ -90,6 +90,8 @@ public class IotProductBaseInfoVO extends BaseVO implements Serializable {
    private Double inventoryUpper;
    @ApiModelProperty("库存下限提醒值")
    private String inventoryFloor;
    @ApiModelProperty("属性 1.是 0.否")
    private String property;
    public String getParentId() {
        return parentId;
@ -370,4 +372,12 @@ public class IotProductBaseInfoVO extends BaseVO implements Serializable {
    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }
    public String getProperty() {
        return property;
    }
    public void setProperty(String property) {
        this.property = property;
    }
}

+ 49 - 1
svr/svr-iot/src/main/java/com/yihu/iot/controller/product/IotProductController.java

@ -2,12 +2,14 @@ package com.yihu.iot.controller.product;
import com.yihu.iot.service.device.IotDeviceInventoryWarningService;
import com.yihu.iot.service.dict.IotSystemDictService;
import com.yihu.iot.service.product.IotProductBaseInfoPropertyService;
import com.yihu.iot.service.product.IotProductBaseInfoService;
import com.yihu.jw.entity.iot.device.IotDeviceInventoryWarningDO;
import com.yihu.jw.entity.iot.product.IotProductBaseInfoDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.restmodel.iot.device.IotDeviceInventoryWarningVO;
import com.yihu.jw.restmodel.iot.product.IotMaintenanceUnitVO;
import com.yihu.jw.restmodel.iot.product.IotProductBaseInfoPropertyVO;
import com.yihu.jw.restmodel.iot.product.IotProductBaseInfoVO;
import com.yihu.jw.restmodel.iot.product.IotProductVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
@ -31,7 +33,8 @@ import java.util.List;
@RequestMapping(IotRequestMapping.Common.product)
@Api(tags = "产品管理相关操作", description = "产品管理相关操作")
public class IotProductController extends EnvelopRestEndpoint {
    @Autowired
    private IotProductBaseInfoPropertyService iotProductBaseInfoPropertyService;
    @Autowired
    private IotProductBaseInfoService iotProductBaseInfoService;
    @Autowired
@ -47,6 +50,8 @@ public class IotProductController extends EnvelopRestEndpoint {
    public MixEnvelop<IotProductBaseInfoVO, IotProductBaseInfoVO> findCompanyPage(
            @ApiParam(name = "name", value = "注册证号或产品名称", defaultValue = "")
            @RequestParam(value = "name", required = false) String name,
            @ApiParam(name = "property", value = "属性", defaultValue = "")
            @RequestParam(value = "property", required = false) String property,
            @ApiParam(name = "classify", value = "产品分类", defaultValue = "")
            @RequestParam(value = "classify", required = false) String classify,
            @ApiParam(name = "companyId", value = "企业id", defaultValue = "")
@ -76,6 +81,10 @@ public class IotProductController extends EnvelopRestEndpoint {
                filters += semicolon +"productClassify="+classify;
                semicolon = ";";
            }
            if(StringUtils.isNotBlank(property)){
                filters += semicolon +"property="+property;
                semicolon = ";";
            }
            String sorts = "-updateTime";
            //得到list数据
            List<IotProductBaseInfoDO> list = iotProductBaseInfoService.search(null, filters, sorts, page, size);
@ -227,5 +236,44 @@ public class IotProductController extends EnvelopRestEndpoint {
        return iotProductBaseInfoService.findAll();
    }
    @ApiOperation(value = "增加产品属性")
    @PostMapping(value = IotRequestMapping.Product.addProductProperty)
    public MixEnvelop<IotProductBaseInfoPropertyVO, IotProductBaseInfoPropertyVO> addProductProperty(@ApiParam(name = "jsonData", value = "添加产品属性json", defaultValue = "[]")
                                                                     @RequestParam(value = "jsonData", required = true)String jsonData){
        try {
            IotProductBaseInfoPropertyVO iotProductBaseInfoPropertyVO = toEntity(jsonData, IotProductBaseInfoPropertyVO.class);
            MixEnvelop<IotProductBaseInfoPropertyVO, IotProductBaseInfoPropertyVO> res = iotProductBaseInfoPropertyService.create(iotProductBaseInfoPropertyVO);
            //创建熟悉 修改熟悉状态为 1
            iotProductBaseInfoService.updateProperty(iotProductBaseInfoPropertyVO.getProductId(), "1");
            return res;
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError("操作失败");
        }
    }
    @ApiOperation(value = "修改产品熟悉 通过id")
    @PostMapping(value = IotRequestMapping.Product.updateProductProperty)
    public MixEnvelop<IotProductBaseInfoPropertyVO, IotProductBaseInfoPropertyVO> updateProductProperty(@ApiParam(name = "jsonData", value = "添加产品属性json", defaultValue = "[]") @RequestParam(value = "jsonData", required = true)String jsonData){
        try {
            IotProductBaseInfoPropertyVO iotProductBaseInfoPropertyVO = toEntity(jsonData, IotProductBaseInfoPropertyVO.class);
            return iotProductBaseInfoPropertyService.update(iotProductBaseInfoPropertyVO);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError("操作失败");
        }
    }
    @ApiOperation(value = "修改产品熟悉 通过id")
    @PostMapping(value = IotRequestMapping.Product.findProductProperty)
    public MixEnvelop<IotProductBaseInfoPropertyVO, IotProductBaseInfoPropertyVO> findProductProperty(@ApiParam(name = "productId", value = "产品id") @RequestParam(value = "productId", required = true) String productId){
        try {
            IotProductBaseInfoPropertyVO vo = iotProductBaseInfoPropertyService.findProductPropertyByProductId(productId);
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find, vo);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError("操作失败");
        }
    }
}

+ 2 - 0
svr/svr-iot/src/main/java/com/yihu/iot/dao/product/IotProductBaseInfoDao.java

@ -22,4 +22,6 @@ public interface IotProductBaseInfoDao extends PagingAndSortingRepository<IotPro
    @Query("from IotProductBaseInfoDO w where w.name =?1 and w.del = 1")
    IotProductBaseInfoDO findByName(String name);
    @Query("UPDATE IotProductBaseInfoDO SET property = ?2  WHERE id = ?1")
    boolean updateProperty(String productId, String property);
}

+ 19 - 0
svr/svr-iot/src/main/java/com/yihu/iot/dao/product/IotProductBaseInfoPropertyDao.java

@ -0,0 +1,19 @@
package com.yihu.iot.dao.product;
import com.yihu.jw.entity.iot.product.IotProductBaseInfoPropertyDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * 接口描述描述:属性列表
 *
 * @author 陈鑫
 * @date 2023-05-05 14:36
 **/
public interface IotProductBaseInfoPropertyDao extends PagingAndSortingRepository<IotProductBaseInfoPropertyDO, String>,
        JpaSpecificationExecutor<IotProductBaseInfoPropertyDO> {
    @Query("FROM IotProductBaseInfoPropertyDO d WHERE  d.productId = ?1 ")
    IotProductBaseInfoPropertyDO findProductPropertyByProductId(String productId);
}

+ 1 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/company/IotCompanyService.java

@ -890,6 +890,7 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
                oldApp.setCompanyId(iotCompany.getId());
                oldApp.setCompanyName(iotCompany.getName());
                oldApp.setSaasId(getCode());
                oldApp.setSecretKey(newApp.getSecretKey());
                iotCompanyAppDao.save(oldApp);
                //修改平台申请接口的应用信息

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java

@ -1913,7 +1913,7 @@ public class MonitorPlatformService {
    }
    public JSONArray getSearchTags() {
        String sql = "select id,`value` from xmiot.iot_system_dict where dict_name='DEVICE' and (value='组合一体机' or value ='单体征测量仪') and del=1;";
        String sql = "select id,`value` from xmiot.iot_system_dict where dict_name='DEVICE' and (value='终端一体机' or value ='体征监测设备') and del=1;";
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        JSONArray result = new JSONArray();
        for (Map<String, Object> map : list) {

+ 86 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/product/IotProductBaseInfoPropertyService.java

@ -0,0 +1,86 @@
package com.yihu.iot.service.product;
import com.yihu.iot.dao.product.IotProductBaseInfoDao;
import com.yihu.iot.dao.product.IotProductBaseInfoPropertyDao;
import com.yihu.jw.entity.iot.product.IotProductBaseInfoDO;
import com.yihu.jw.entity.iot.product.IotProductBaseInfoPropertyDO;
import com.yihu.jw.restmodel.iot.product.IotProductBaseInfoPropertyVO;
import com.yihu.jw.restmodel.iot.product.IotProductBaseInfoVO;
import com.yihu.jw.restmodel.iot.product.IotProductVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import static cn.hutool.core.util.ObjectUtil.hasEmpty;
/**
 * 类描述:
 *
 * @author 陈鑫
 * @date 2023-05-05 14:35
 **/
@Service
@Transactional(rollbackFor = Exception.class)
public class IotProductBaseInfoPropertyService extends BaseJpaService<IotProductBaseInfoPropertyDO, IotProductBaseInfoPropertyDao> {
    @Autowired
    IotProductBaseInfoPropertyDao iotProductBaseInfoPropertyDao;
    /**
     * 创建数据
     *
     * @param iotProductBaseInfoPropertyVO
     * @return boolean
     * @author cx
     * @date 2023/5/5 15:09
     */
    public MixEnvelop<IotProductBaseInfoPropertyVO, IotProductBaseInfoPropertyVO> create(IotProductBaseInfoPropertyVO iotProductBaseInfoPropertyVO) {
        IotProductBaseInfoPropertyDO iotProductBaseInfoPropertyDO = convertToModel(iotProductBaseInfoPropertyVO, IotProductBaseInfoPropertyDO.class);
        iotProductBaseInfoPropertyDao.save(iotProductBaseInfoPropertyDO);
        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_update);
    }
    /**
     * 修改数据
     *
     * @param iotProductBaseInfoPropertyVO
     * @return boolean
     * @author cx
     * @date 2023/5/5 15:13
     */
    public MixEnvelop<IotProductBaseInfoPropertyVO, IotProductBaseInfoPropertyVO> update(IotProductBaseInfoPropertyVO iotProductBaseInfoPropertyVO) {
        IotProductBaseInfoPropertyDO iotProductBaseInfoPropertyDO = convertToModel(iotProductBaseInfoPropertyVO, IotProductBaseInfoPropertyDO.class);
        iotProductBaseInfoPropertyDao.save(iotProductBaseInfoPropertyDO);
        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_update);
    }
    /**
     * 删除数据
     *
     * @param id
     * @return boolean
     * @author cx
     * @date 2023/5/5 15:19
     */
    public boolean del(String id) {
        iotProductBaseInfoPropertyDao.delete(id);
        //判断对象是否存在
        return iotProductBaseInfoPropertyDao.exists(id);
    }
    /**
     * 通过产品id 查找属性
     *
     * @param productId
     * @return IotProductBaseInfoPropertyVO
     * @author cx
     * @date 2023/5/5 16:47
     */
    public IotProductBaseInfoPropertyVO findProductPropertyByProductId(String productId) {
        IotProductBaseInfoPropertyDO res = iotProductBaseInfoPropertyDao.findProductPropertyByProductId(productId);
        return convertToModel(res, IotProductBaseInfoPropertyVO.class);
    }
}

+ 13 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/product/IotProductBaseInfoService.java

@ -13,7 +13,6 @@ import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang.StringUtils;
import org.omg.CORBA.BAD_CONTEXT;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -425,4 +424,17 @@ public class IotProductBaseInfoService extends BaseJpaService<IotProductBaseInfo
        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find,list);
    }
    /**
     * 修改属性
     *
     * @param productId
     * @param property
     * @return boolean
     * @author cx
     * @date 2023/5/5 16:12
     */
    public boolean updateProperty(String productId,String property) {
       return iotProductBaseInfoDao.updateProperty(productId, property);
    }
}

+ 2 - 2
svr/svr-iot/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
  application:
    name:  svr-iot
    name:  svr-iot-cx
  cloud:
    config:
      failFast: true
@ -28,7 +28,7 @@ spring:
  profiles: iottest
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://172.26.0.109:1221}
      uri: ${wlyy.spring.config.uri:http://172.26.0.107:1221}
      label: ${wlyy.spring.config.label:jwdev}
---