Sfoglia il codice sorgente

Merge branch 'dev' of http://192.168.1.220:10080/jiwei/wlyy2.0 into dev

wangzhinan 6 anni fa
parent
commit
71970ac2eb

+ 34 - 0
common/common-tracer/pom.xml

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>wlyy-parent-pom</artifactId>
        <groupId>com.yihu.jw</groupId>
        <version>2.0.0</version>
        <relativePath>../../wlyy-parent-pom/pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>common-tracer</artifactId>
    <dependencies>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-zipkin</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
    </dependencies>
</project>

+ 50 - 0
common/common-tracer/src/main/java/com/yihu/jw/advice/HttpAdvice.java

@ -0,0 +1,50 @@
package com.yihu.jw.advice;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
/**
 * Created by yeshijie on 2018/9/14
 */
@Aspect
@Component
public class HttpAdvice {
    @Autowired
    private Tracer tracer;
    @Autowired
    private ObjectMapper objectMapper;
    private Logger logger = LoggerFactory.getLogger(HttpAdvice.class);
    @Around("within(@org.springframework.web.bind.annotation.RestController *)")
    public Object process(ProceedingJoinPoint point) throws Throwable {
        //保存入参
        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
        tracer.getCurrentSpan().logEvent(objectMapper.writeValueAsString(request.getParameterMap()));
        //访问目标方法的参数:
        Object[] args = point.getArgs();
        Long strartTime = System.currentTimeMillis();
        Object returnValue = point.proceed(args);
        Long endTime = System.currentTimeMillis();
        //保存响应
        tracer.getCurrentSpan().logEvent(objectMapper.writeValueAsString(returnValue));
        //保存响应时间
        tracer.getCurrentSpan().logEvent("executeTime:"+(endTime - strartTime));
        return returnValue;
    }
}

+ 8 - 4
svr/svr-base/pom.xml

@ -54,10 +54,10 @@
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
        </dependency>
        <!--<dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-zipkin</artifactId>
        </dependency>-->
        <!--<dependency>-->
            <!--<groupId>org.springframework.cloud</groupId>-->
            <!--<artifactId>spring-cloud-starter-zipkin</artifactId>-->
        <!--</dependency>-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-activemq</artifactId>
@ -92,6 +92,10 @@
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-web</artifactId>
        </dependency>
        <!--<dependency>-->
            <!--<groupId>com.yihu.jw</groupId>-->
            <!--<artifactId>common-tracer</artifactId>-->
        <!--</dependency>-->
        <!-- 文件服务器 -->
        <dependency>
            <groupId>com.yihu</groupId>

+ 7 - 2
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationManageService.java

@ -128,7 +128,10 @@ public class RehabilitationManageService {
                resultMap.put("id",one.get("id"));
                resultMap.put("status",one.get("status"));//康复计划状态
                //健康情况
                resultMap.put("healthyCondition","康复期");
                String healthyConditionSql =" select  label_name from "+basedb+".wlyy_sign_patient_label_info where status=1 and patient='"+one.get("patient")+"' and label_type=8";
                List<Map<String,Object>> healthyConditionList = jdbcTemplate.queryForList(healthyConditionSql);
                String healthyCondition = healthyConditionList.size()>0?healthyConditionList.get(0).get("label_name")+"":"";
                resultMap.put("healthyCondition",healthyCondition);
                //安排类型
                String planTypeName = null;
                Integer planTypeTemp = (Integer)one.get("plan_type");
@ -704,6 +707,8 @@ public class RehabilitationManageService {
                case 2:planTypeName="(转)社区医院" ;break;
                case 3:planTypeName="(转)转家庭病床" ;break;
            }
            map.put("createUser",one.getCreateUser());
            map.put("createUserName",one.getCreateUserName());
            map.put("planId",one.getId());
            map.put("planTypeName",planTypeName);
            String statusName = "";
@ -1102,7 +1107,7 @@ public class RehabilitationManageService {
        Integer finishedCount = rehabilitationDetailDao.findByStatusAndPlanId(1,planId);
        resultMap.put("allCount",allCount);
        resultMap.put("finishedCount",finishedCount);
        resultMap.put("healthyCondition","康复期");
//        resultMap.put("healthyCondition",healthyCondition);
        return ObjEnvelop.getSuccess(SpecialistMapping.api_success,resultMap);
    }

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

@ -25,6 +25,7 @@
        <module>../common/common-util</module>
        <module>../common/common-fegin</module>
        <module>../common/common-web</module>
        <module>../common/common-tracer</module>
    </modules>
</project>

+ 5 - 0
wlyy-parent-pom/pom.xml

@ -161,6 +161,11 @@
                <artifactId>common-web</artifactId>
                <version>${version.wlyy-common}</version>
            </dependency>
            <dependency>
                <groupId>com.yihu.jw</groupId>
                <artifactId>common-tracer</artifactId>
                <version>${version.wlyy-common}</version>
            </dependency>
            <!-- Jkzl Starter -->
            <dependency>