Переглянути джерело

入参存在部分NULL数据,没有做判断处理,处理完成,数据能正常上传。

hill9868 5 роки тому
батько
коміт
8c9750b191

+ 12 - 3
svr/svr-iot/src/main/java/com/yihu/iot/controller/analyzer/IotAnalyzerController.java

@ -740,18 +740,27 @@ public class IotAnalyzerController extends EnvelopRestEndpoint {
     */
    @PostMapping(value = "/yitouxiaowu" ,consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "奕拓体征数据解析入库", notes = "奕拓体征数据解析入库")
    public Envelop updateDeviceData(
    public String updateDeviceData(
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData)throws Exception {
        logger.info( "体征数据入库:jsonData = " + jsonData );
        String strResult = "";
        boolean res = iotAnalyzerService.analyzerMapM(jsonData);
        if(res){
            Map result = new HashMap();
            result.put("success", "true");
            result.put("message", "体征信息上传成功。");
            strResult = objectMapper.writeValueAsString(res);
            return success("体征数据上传成功");
            return strResult;
        }else {
            return failed("体征数据上传失败");
            Map result = new HashMap();
            result.put("success", "false");
            result.put("message", "体征信息上传失败。");
            strResult = objectMapper.writeValueAsString(res);
            return strResult;
        }
    }