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

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

huangwenjie 5 роки тому
батько
коміт
0435af82bc

+ 5 - 0
business/base-service/pom.xml

@ -127,6 +127,11 @@
            <artifactId>ehcsdk</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-redis</artifactId>
            <version>1.8.9.RELEASE</version>
        </dependency>
    </dependencies>
    <build>

+ 27 - 3
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -66,6 +66,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@ -77,6 +78,7 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.lang.Boolean;
import java.util.*;
import java.util.concurrent.TimeUnit;
/**
 * Created by Trick on 2019/5/17
@ -147,6 +149,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    private PrescriptionLogService prescriptionLogService;
    @Autowired
    private WlyyInspectionDao wlyyInspectionDao;
    @Autowired
    private StringRedisTemplate redisTemplate;
    
    @Value("${demo.flag}")
@ -2375,6 +2379,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "patient.sex AS sex," +
                "patient.idcard AS idcard," +
                "patient.photo AS photo," +
                "outpatient.mobile AS mobile," +
                "patient.birthday AS birthday," +
                "room.consult_type AS consult_type," +
                "date_format(room.reservation_time ,'%Y-%m-%d %H:%i:%S' ) AS timedate_format," +
@ -3088,11 +3093,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            //根据身份证计算年龄
            for(Map<String,Object> outpatient :list){
                String idcard = (String)outpatient.get("idcard");
                String patient_id = (String)outpatient.get("patient_id");
                outpatient.put("age",DateUtil.getAgeForIdcard(idcard));
    
                String outpatient_id = (String)outpatient.get("id");
                
                
	
	            String isAlert = redisTemplate.opsForValue().get("patient_alert_"+patient_id);
	            if(StringUtils.isBlank(isAlert)){
		            outpatient.put("alert_tag",0);//已提醒
	            }else{
		            outpatient.put("alert_tag",1);//未提醒
	            }
            }
        }
    
@ -3110,6 +3121,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "patient.photo AS photo," +
                "patient.birthday AS birthday," +
                "patient.mobile AS mobile," +
                "outpatient.mobile AS outpatient_mobile," +
                "room.consult_type AS consult_type," +
                "date_format(room.reservation_time ,'%Y-%m-%d %H:%i:%S' ) AS time," +
                "date_format(room.reservation_time ,'%Y-%m-%d' ) AS group_date," +
@ -3141,6 +3153,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            //根据身份证计算年龄
            for(Map<String,Object> outpatient :list){
                String idcard = (String)outpatient.get("idcard");
                String patient_id = (String)outpatient.get("patient_id");
                outpatient.put("age",DateUtil.getAgeForIdcard(idcard));
    
                String group_date = (String)outpatient.get("group_date");
@ -3156,8 +3169,19 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                //全科医生来源
                outpatient.put("general_doctor_info","");//全科医生名字
                outpatient.put("general_doctor_hospital","");//全科医生社区
                outpatient.put("alert_tag",0);//是否已提醒
                String isAlert = redisTemplate.opsForValue().get("patient_alert_"+patient_id);
                if(StringUtils.isBlank(isAlert)){
                    outpatient.put("alert_tag",0);//已提醒
                }else{
                    outpatient.put("alert_tag",1);//未提醒
                }
                
                outpatient.put("online_tag",0);//在线状态
    
                String outpatient_mobile = (String)outpatient.get("outpatient_mobile");
                if(StringUtils.isNoneBlank(outpatient_mobile)){
                    outpatient.put("mobile",outpatient_mobile);//复诊有手机号,传递复诊手机号
                }
            }
        }
    

+ 9 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java

@ -28,11 +28,13 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
/**
@ -65,6 +67,9 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
	
	@Autowired
	private BaseDoctorHospitalDao baseDoctorHospitalDao;
	
	@Autowired
	private StringRedisTemplate redisTemplate;
	
	
@ -537,6 +542,10 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
	public Envelop alertPatientOnline(@ApiParam(name = "patient", value = "居民CODE")
	                                         @RequestParam(value = "patient",required = true) String patient) {
		
		String isAlert = redisTemplate.opsForValue().get("patient_alert_"+patient);
		if(StringUtils.isBlank(isAlert)){
			redisTemplate.opsForValue().set("patient_alert_"+patient,patient, 1, TimeUnit.DAYS);
		}
		return success("操作成功");
	}