Browse Source

设备地址修改,pom文件依赖bug修复

LiTaohong 7 years ago
parent
commit
e8c7764f6e

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

@ -127,7 +127,7 @@ public class IotRequestMapping {
        public static final String findLocationByIdCard= "findLocationByIdCard";
        public static final String findLocationBySn= "findLocationBySn";
        public static final String deleteLocation= "deteleLocation";
        public static final String updateLocation= "deteleLocation";
        public static final String updateLocation= "updateLocation";
    }

+ 1 - 1
common/common-rest-model/pom.xml

@ -58,7 +58,7 @@
        </dependency>
        <dependency>
            <groupId>io.searchbox</groupId>
            <artifactId>jest-common</artifactId>
            <artifactId>jest</artifactId>
            <version>2.4.0</version>
        </dependency>
    </dependencies>

+ 1 - 0
svr-lib-parent-pom/pom.xml

@ -317,6 +317,7 @@
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${version.common.lang3}</version>
            </dependency>
            <dependency>

+ 2 - 7
svr/svr-iot/pom.xml

@ -20,11 +20,6 @@
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-entity</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.base</groupId>
            <artifactId>common-data-es</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-request-mapping</artifactId>
@ -61,12 +56,12 @@
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <!--tomcat 启动时 打开注释 start-->
            <exclusions>
           <!-- <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
            </exclusions>
            </exclusions>-->
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>

+ 21 - 4
svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotPatientDeviceController.java

@ -195,7 +195,7 @@ public class IotPatientDeviceController extends EnvelopRestController{
        }
    }
    @GetMapping(value = IotRequestMapping.PatientDevice.findLocationByIdCard)
    @PostMapping(value = IotRequestMapping.PatientDevice.findLocationByIdCard)
    @ApiOperation(value = "根据idCard查询设备地址", notes = "根据idCard查询设备地址")
    public Envelop<List<LocationDataVO>> findDeviceLocationsByIdCard(@ApiParam(name = "jsonData", value = "jsonData", defaultValue = "")
                                                                     @RequestParam(value = "jsonData",required = true) String jsonData) {
@ -208,7 +208,7 @@ public class IotPatientDeviceController extends EnvelopRestController{
        }
    }
    @GetMapping(value = IotRequestMapping.PatientDevice.findLocationBySn)
    @PostMapping(value = IotRequestMapping.PatientDevice.findLocationBySn)
    @ApiOperation(value = "根据sn码查询设备地址", notes = "根据sn码查询设备地址")
    public Envelop<List<LocationDataVO>> findDeviceLocationsBySn(@ApiParam(name = "jsonData", value = "jsonData", defaultValue = "")
                                                                     @RequestParam(value = "jsonData",required = true) String jsonData) {
@ -221,9 +221,9 @@ public class IotPatientDeviceController extends EnvelopRestController{
        }
    }
    @GetMapping(value = IotRequestMapping.PatientDevice.deleteLocation)
    @PostMapping(value = IotRequestMapping.PatientDevice.deleteLocation)
    @ApiOperation(value = "解绑设备删除地址", notes = "解绑设备删除地址")
    public Envelop deleteLocation(@ApiParam(name = "jsonData", value = "jsonData", defaultValue = "")
    public Envelop deleteLocations(@ApiParam(name = "jsonData", value = "jsonData", defaultValue = "")
                                                                 @RequestParam(value = "jsonData",required = true) String jsonData) {
        try {
            boolean bool = iotPatientDeviceService.deleteLocationsByIdcardOrSn(jsonData);
@ -237,4 +237,21 @@ public class IotPatientDeviceController extends EnvelopRestController{
            return Envelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = IotRequestMapping.PatientDevice.updateLocation)
    @ApiOperation(value = "设备地址修改", notes = "设备地址修改")
    public Envelop updateLocations(@ApiParam(name = "jsonData", value = "jsonData", defaultValue = "")
                                   @RequestParam(value = "jsonData",required = true) String jsonData) {
        try {
            boolean bool = iotPatientDeviceService.updateLocationsByIdcardOrSn(jsonData);
            if(bool){
                return Envelop.getSuccess(IotRequestMapping.Device.message_success_create,"device update success");
            }
            return Envelop.getError("delete fail,not exist");
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
        }
    }
}

+ 0 - 3
svr/svr-iot/src/main/java/com/yihu/iot/datainput/service/DataSearchService.java

@ -4,12 +4,9 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.base.es.config.ElastricSearchHelper;
import com.yihu.base.hbase.HBaseHelper;
import com.yihu.iot.datainput.enums.DataTypeEnum;
import com.yihu.iot.datainput.util.ConstantUtils;
import com.yihu.iot.datainput.util.RowKeyUtils;
import com.yihu.iot.service.common.ElasticSearchQueryGenerator;
import com.yihu.jw.iot.datainput.Data;
import com.yihu.jw.iot.datainput.StepInfoDO;
import com.yihu.jw.restmodel.iot.datainput.DataBodySignsVO;
import com.yihu.jw.restmodel.iot.datainput.WeRunDataVO;
import com.yihu.jw.util.date.DateUtil;

+ 18 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotPatientDeviceService.java

@ -232,4 +232,22 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,I
        return bool;
    }
    /**
     * 设备地址修改,根据Sn或idCard修改地址
     * @return
     */
    public boolean updateLocationsByIdcardOrSn(String jsonData){
        List<SaveModel> saveModelList = new ArrayList<>();
        SearchSourceBuilder queryStr = elasticSearchQueryGenerator.getQueryBuilder("",jsonData);
        JestResult esResult = elastricSearchHelper.search(ConstantUtils.deviceLocationIndex,ConstantUtils.deviceLocationType,queryStr.toString());
        List<LocationDataVO> resultList = getESResultBeanList(esResult);
        for(LocationDataVO locationDataVO : resultList){
            SaveModel saveModel = new SaveModel();
            saveModel.setId(locationDataVO.getId());
            saveModelList.add(saveModel);
        }
        boolean bool = elastricSearchHelper.update(ConstantUtils.deviceLocationIndex,ConstantUtils.deviceLocationType,saveModelList);
        return bool;
    }
}

+ 4 - 4
web-gateway/pom.xml

@ -40,12 +40,12 @@
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
           <!-- <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
            </exclusions>
            </exclusions>-->
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
@ -63,10 +63,10 @@
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
       <!-- <dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
        </dependency>-->
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>

+ 1 - 1
web-gateway/src/main/resources/application.yml

@ -3,7 +3,7 @@ server:
  port: 8088
spring:
  application:
    name:  web-gateway  #注册到发现服务的id 如果id一样 eurika会自动做负载
    name:  web-gateway-lith  #注册到发现服务的id 如果id一样 eurika会自动做负载
  http:
    multipart:
      enabled: true