Przeglądaj źródła

Merge branch 'dev' of yeshijie/wlyy2.0 into dev

叶仕杰 4 lat temu
rodzic
commit
47f48578f4

+ 13 - 1
svr/svr-iot/src/main/java/com/yihu/iot/aop/IntefaceLogRequiredAOP.java

@ -3,8 +3,11 @@ package com.yihu.iot.aop;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.yihu.iot.dao.gateway.GcTokenDao;
import com.yihu.iot.service.platform.IotInterfaceLogService;
import com.yihu.iot.service.useragent.UserAgent;
import com.yihu.jw.entity.iot.gateway.GcToken;
import org.apache.commons.lang.StringUtils;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
@ -40,6 +43,8 @@ public class IntefaceLogRequiredAOP {
    private UserAgent userAgent;
    @Autowired
    private IotInterfaceLogService iotInterfaceLogService;
    @Autowired
    private GcTokenDao gcTokenDaoDao;
    //Controller层切点路径
    @Pointcut("execution(* com.yihu.iot..*.*(..))")
@ -68,7 +73,14 @@ public class IntefaceLogRequiredAOP {
            Integer state = responseJson.getInteger("status")==200?1:0;
            Map<String,String> paramsMap = getMehtodParam(request);
            try {
                iotInterfaceLogService.saveLog(paramsMap.get("appId"),params,deleteSensitiveContent, request,state,method.getName());
                String appid = paramsMap.get("appId");
                if(StringUtils.isEmpty(appid)){
                    //如果没有传appid,则从token中取
                    String accesstoken = request.getHeader("accesstoken");
                    GcToken gcToken = gcTokenDaoDao.findByToken(accesstoken);
                    appid = gcToken.getAppid();
                }
                iotInterfaceLogService.saveLog(appid,params,deleteSensitiveContent, request,state,method.getName());
            }catch (Exception e){
                e.printStackTrace();
            }

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

@ -45,7 +45,7 @@ public class IotAnalyzerController extends EnvelopRestEndpoint {
     * @param jsonData
     * @return
     */
    @PostMapping(value = "/open/yitouxiaowu" ,consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @PostMapping(value = "/yitouxiaowu" ,consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "奕拓体征数据解析入库", notes = "奕拓体征数据解析入库")
    @IntefaceLogRequired
    public String yitouxiaowu(

+ 4 - 10
svr/svr-iot/src/main/java/com/yihu/iot/controller/third/ThirdDataInputController.java

@ -41,18 +41,12 @@ public class ThirdDataInputController {
        }
    }
    @PostMapping(value = IotRequestMapping.ThirdOpen.updateData)
    @ApiOperation(value = "更新体征记录", notes = "根据id更新体征记录(包括体征值、上传时间等)")
    @PostMapping(value = IotRequestMapping.ThirdOpen.iHealthDataSearch)
    @ApiOperation(value = "i健康查询体征记录", notes = "i健康查询体征记录")
    @IntefaceLogRequired
    public MixEnvelop updateData(
            @ApiParam(name = "jsonData", value = "", defaultValue = "")
            @RequestParam String jsonData) throws IOException {
    public MixEnvelop iHealthDataSearch() throws IOException {
        try{
            String str = dataSearchService.updateData(jsonData);
            if(!StringUtils.equalsIgnoreCase("true",str)){
                return MixEnvelop.getSuccess(DataRequestMapping.DataSearch.message_fail,str);
            }
            return MixEnvelop.getSuccess(DataRequestMapping.DataSearch.update_success,str);
            return MixEnvelop.getSuccess("success");
        } catch (ApiException e){
            return MixEnvelop.getError(e.getMessage(), e.getErrorCode());
        }

+ 2 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/platform/IotInterfaceLogService.java

@ -243,7 +243,8 @@ public class IotInterfaceLogService extends BaseJpaService<IotInterfaceLogDO, Io
        IotInterfaceLogDO interfaceLogDO = new IotInterfaceLogDO();
        if("yitouxiaowu".equals(method)){
            //默认厦门i健康
            appId = "ff808081724b116c017254d437fe000a";
        }
        //设置应用与公司