Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

trick9191 7 years ago
parent
commit
336368f83f

+ 4 - 0
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/compute/ComputeHelper.java

@ -177,6 +177,10 @@ public class ComputeHelper {
                    mapTemp.put(strKey.toString(), saveModelTemp);
                }
            }
            //如果字典长度是0 抛出异常
            if(dictModels.size()==0){
                throw new Exception("dict size:0,sql:"+dimensionQuota.getDictSql());
            }
            lastMaps = mapTemp;
        }

+ 2 - 1
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/save/es/ElasticFactory.java

@ -54,7 +54,8 @@ public class ElasticFactory {
                .Builder("http://" + esHost + ":" + port)
                .multiThreaded(true)
                .maxTotalConnection(50)// 最大链接
                .maxConnectionIdleTime(10, TimeUnit.SECONDS)//链接等待时间
                .maxConnectionIdleTime(120, TimeUnit.SECONDS)//链接等待时间
                .connTimeout(30000)
                .discoveryEnabled(true)
                .readTimeout(30000)//30秒
                .build());//得到链接

+ 0 - 1
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/service/JobService.java

@ -292,7 +292,6 @@ public class JobService {
        int day = daysBetween(startDate, endDate);
        for (int i = 0; i < day; i++) {
            productDataByOneDay(getYesterday(i, startDate));
        }
    }

+ 9 - 9
patient-co-statistics-es/src/main/resources/application.yml

@ -214,23 +214,23 @@ spring:
  datasource:
    primaryReadWrite: #只读库 主库
      url: jdbc:mysql://172.19.103.77/wlyy_quota?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: root
      password: 123456
      url: jdbc:mysql://172.19.103.85/data_for_stats?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: linzhou
      password: linzhou
#       url: jdbc:mysql://172.19.103.85/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
#       username: linzhou
#       password: linzhou
    primaryRead: #只读库 从库
      url: jdbc:mysql://172.19.103.77/wlyy_quota?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: root
      password: 123456
      url: jdbc:mysql://172.19.103.85/data_for_stats?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: linzhou
      password: linzhou
#       url: jdbc:mysql://172.19.103.85/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
#       username: linzhou
#       password: linzhou
    im: #im库
      url: jdbc:mysql://172.19.103.77/wlyy_quota?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: root
      password: 123456
      url: jdbc:mysql://172.19.103.85/data_for_stats?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: linzhou
      password: linzhou
  redis:
    host: 172.19.103.88 # Redis server host.

+ 13 - 8
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/guahao/GuahaoXMService.java

@ -51,7 +51,8 @@ public class GuahaoXMService implements IGuahaoService {
    @Autowired
    private PatientReservationDao patientReservationDao;
    @Autowired
    JwSmjkService jwSmjkService;
    @Autowired
    SignFamilyDao signFamilyDao;
@ -80,7 +81,13 @@ public class GuahaoXMService implements IGuahaoService {
        }
        // 查询医生职称和头像
        GuahaoDoctor doctor = GetDoctorInfo(doctorId, hospitalId, hosDeptId);
        GuahaoDoctor doctor = null;
        try{
            doctor = jwSmjkService.getGuahaoDoctor(doctorId, hospitalId, hosDeptId);
        }catch (Exception e){
            e.printStackTrace();
            System.out.println("获取医生信息失败");
        }
        // 保存预约记录
        PatientReservation reservation = new PatientReservation();
        reservation.setCode(code);
@ -92,8 +99,10 @@ public class GuahaoXMService implements IGuahaoService {
        reservation.setDeptName(hosDeptName);
        reservation.setDoctorCode(doctorId);
        reservation.setDoctorName(doctorName);
        reservation.setDoctorJob(doctor.getTitle());
        reservation.setDoctorPhoto(doctor.getPhoto());
        if(doctor!=null){
            reservation.setDoctorJob(doctor.getTitle());
            reservation.setDoctorPhoto(doctor.getPhoto());
        }
        reservation.setIdcard(cardNo);
        reservation.setName(patientName);
        reservation.setPatient(patient);
@ -1138,10 +1147,6 @@ public class GuahaoXMService implements IGuahaoService {
        }
    }
    @Autowired
    JwSmjkService jwSmjkService;
    /******************************** 基卫内网服务 ************************************************/
    public List<Map<String, Object>> GetDoctorArrangeTenDay(String hospitalId, String hosDeptId, String doctorId) throws Exception {

+ 42 - 43
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/JwSmjkService.java

@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.entity.dict.SystemDict;
import com.yihu.wlyy.service.system.SystemDictService;
import com.yihu.wlyy.service.third.ehr.EhrService;
import com.yihu.wlyy.service.third.guahao.GuahaoDoctor;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.util.SystemConf;
@ -345,49 +346,6 @@ public class JwSmjkService {
        return re;
    }
    public String responseStr(String response) throws Exception{
        String re = "";
        if (!StringUtils.isEmpty(response)) {
            JSONObject jsonObject = new JSONObject(response);
            int status = jsonObject.getInt("status");
            if (status == 200) {
                JSONArray jsonArray = jsonObject.getJSONArray("data");
                re = jsonArray.toString();
//                re = jsonObject.getString("data");
            } else {
                String msg = "处理失败,请联系管理员";
                if(!jsonObject.isNull("msg")){
                    msg = jsonObject.getString("msg");
                }
                throw new Exception(msg);
            }
        } else {
            throw new Exception("null response.");
        }
        return re;
    }
    public Boolean responseBool(String response) throws Exception{
        boolean re = false;
        if (!StringUtils.isEmpty(response)) {
            JSONObject jsonObject = new JSONObject(response);
            int status = jsonObject.getInt("status");
            if (status == 200) {
                re = jsonObject.getBoolean("data");
            } else {
                String msg = "处理失败,请联系管理员";
                if(!jsonObject.isNull("msg")){
                    msg = jsonObject.getString("msg");
                }
                throw new Exception(msg);
            }
        } else {
            throw new Exception("null response.");
        }
        return re;
    }
    /**
     * 获取医院列表
     * @param type
@ -565,6 +523,47 @@ public class JwSmjkService {
        return response;
    }
    /**
     * 获取医生信息
     * @param hospitalId
     * @param hosDeptId
     * @param doctorId
     * @return
     * @throws Exception
     */
    public GuahaoDoctor getGuahaoDoctor(String hospitalId,String hosDeptId,String doctorId) throws Exception{
        String response = GetDoctorInfo(hospitalId,hosDeptId,doctorId);
        if (!StringUtils.isEmpty(response)) {
            JSONObject jsonObject = new JSONObject(response);
            int status = jsonObject.getInt("status");
            if (status == 200) {
                GuahaoDoctor doctor = new GuahaoDoctor();
                JSONObject json = jsonObject.getJSONObject("data");
                doctor.setId(json.isNull("id")?"":json.getString("id"));//医生编码
                doctor.setName(json.isNull("name")?"":json.getString("name"));//医生姓名
                doctor.setSex(json.isNull("sex")?"":json.getString("sex"));//医生性别
                doctor.setTitle(json.isNull("title")?"":json.getString("title"));//医生职称
                doctor.setEdu(json.isNull("edu")?"":json.getString("edu"));//医生学历
                doctor.setIntroduce(json.isNull("introduce")?"":json.getString("introduce"));//医生简介
                doctor.setPhoto(json.isNull("photo")?"":json.getString("photo"));//医生头像
                doctor.setFee(json.isNull("fee")?"":json.getString("fee"));//医生挂号费
                doctor.setHosDeptId(json.isNull("hosDeptId")?"":json.getString("hosDeptId"));//医生科室编码
                doctor.setHosDeptName(json.isNull("hosDeptName")?"":json.getString("hosDeptName"));//医生科室名称
                doctor.setHospitalId(json.isNull("hospitalId")?"":json.getString("hospitalId"));//医生医院编码
                doctor.setHospitalName(json.isNull("hospitalName")?"":json.getString("hospitalName"));//医生医院名称
                return doctor;
            } else {
                String msg = "处理失败,请联系管理员";
                if(!jsonObject.isNull("msg")){
                    msg = jsonObject.getString("msg");
                }
                throw new Exception(msg);
            }
        } else {
            throw new Exception("null response.");
        }
    }
    /**
     * 获取预约状态(0 撤销 1 确认 2 已诊  3停诊)
     * @param hospitalId

+ 15 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/booking/DoctorBookingController.java

@ -68,11 +68,21 @@ public class DoctorBookingController extends BaseController{
    @ApiOperation("取消挂号单")
    @ObserverRequired
    public String CancelOrder(@ApiParam(name = "orderId", value = "订单id", defaultValue = "48")
                              @RequestParam(value = "orderId", required = true) Long orderId) {
                              @RequestParam(value = "orderId", required = true) Long orderId,
                              @ApiParam(name = "code", value = "订单code", defaultValue = "48")
                              @RequestParam(value = "code", required = false) String code,
                              @ApiParam(name = "ssc", value = "社保卡号", defaultValue = "48")
                              @RequestParam(value = "ssc", required = false) String ssc) {
        try {
            //获取订单信息
            PatientReservation obj = patientReservationService.findById(orderId);
            boolean re = jwSmjkService.CancelOrder(obj.getCode(),obj.getSsc());
            boolean re = false;
            if(obj==null){
                re = jwSmjkService.CancelOrder(code,ssc);
            }else {
                re = jwSmjkService.CancelOrder(obj.getCode(),obj.getSsc());
            }
//            if (obj != null) {
//                String type = obj.getType();
//                String code = obj.getCode();
@ -86,7 +96,9 @@ public class DoctorBookingController extends BaseController{
            if (re) {
                //更新状态
                patientReservationService.doctorCancelOrder(orderId,getUID());//"6c0cfe5065e011e69f7c005056850d66"
                if(obj!=null){
                    patientReservationService.doctorCancelOrder(orderId,getUID());//"6c0cfe5065e011e69f7c005056850d66"
                }
                return write(200, "取消挂号单成功!");
            } else {