Browse Source

后台管理系统修改密码

huangwenjie 5 years ago
parent
commit
a500569c7e

+ 51 - 12
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java

@ -3,8 +3,6 @@ package com.yihu.jw.hospital.prescription.service.entrance;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.sun.webkit.dom.CSSStyleRuleImpl;
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
@ -29,15 +27,11 @@ import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDiagnosisDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao;
import com.yihu.jw.hospital.prescription.service.entrance.util.ConvertUtil;
import com.yihu.jw.hospital.prescription.service.entrance.util.MqSdkUtil;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.hospital.prescription.WlyyOutpatientVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
@ -46,7 +40,6 @@ import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.utils.network.HttpResponse;
import com.yihu.utils.network.HttpUtils;
import com.yihu.utils.security.MD5;
import com.ylzinfo.ehc.common.utils.DateUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -56,7 +49,6 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.io.IOException;
import java.util.*;
/**
@ -131,6 +123,9 @@ public class YkyyEntranceService {
    private PrescriptionInfoDao prescriptionInfoDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    
    @Autowired
    private YkyyService ykyyService;
    public List<Map<String, Object>> createSQLQuery(String sql, Map<String, Object> params, Integer page, Integer size){
@ -1524,7 +1519,51 @@ public class YkyyEntranceService {
        }
        return response1.getContent();
    }
    
    /**
     * 眼科通App消息推送接口
     * @param doctor
     * @param patient
     * @param orderType
     * @return
     */
    public String sendMesToYkt(String doctor, String patient, String orderType) throws Exception {
    
        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
        String yktDoctor ="";
        if (doctorMappingDO!=null&&StringUtils.isNoneBlank(doctorMappingDO.getMappingCode())){
            String doctorResponse = ykyyService.getYktDoctor(doctorMappingDO.getMappingCode());
            JSONObject jsonObject = JSONObject.parseObject(doctorResponse);
            if (jsonObject.getInteger("code")==200){
                JSONArray array1 = jsonObject.getJSONArray("data");
                if (array1!=null&&array1.size()!=0){
                    yktDoctor=array1.getJSONObject(0).getString("DOCTORUSERID");
                }
            }
        }else {
            throw new Exception("医生映射表不存在!");
        }
        
        BasePatientDO basePatientDO = basePatientDao.findById(patient);
        
        if(basePatientDO!=null){
            patient = basePatientDO.getUserId();
        }
        
        Map<String,Object> params = new HashedMap();
        params.put("doctorId",yktDoctor);
        params.put("patientId",patient);
        params.put("orderType",orderType);
        HttpResponse response = HttpUtils.doPost("http://www.yanketong.com:90/api/share/PushNotificationToDoctor",params);
    
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("code");
        if(status!=null&&status == 10000){
            return rs.getString("message");//推送失败原因
        }else{
            return "推送成功";
        }
    }
}

+ 2 - 5
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/YkyyController.java

@ -20,10 +20,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.axis.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.util.Date;
@ -219,6 +216,6 @@ public class YkyyController extends EnvelopRestEndpoint {
        result.put("fzCount",prescriptionService.getWaitVideoCount(doctor.getId(),"1","1"));//图文复诊数量
        return success("请求成功",result);
    }
    
    
}

+ 13 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/ykyy/YkyyController.java

@ -413,4 +413,17 @@ public class YkyyController extends EnvelopRestEndpoint {
        wxTemplateService.sendWxTemple(userName,senderName,idCard,phone,title,content,contentString,url);
        return success("操作成功");
    }
    
    
    @PostMapping(value = "/sendMesToYkt")
    @ApiOperation(value = "眼科通App消息推送接口")
    public Envelop sendMesToYkt(
            @ApiParam(name = "doctor", value = "医生code", required = true)
            @RequestParam(value = "doctor")String doctor,
            @ApiParam(name = "patient", value = "居民code", required = true)
            @RequestParam(value = "patient")String patient,
            @ApiParam(name = "orderType", value = "订单类型(1图文、2电话 3视频)", required = true)
            @RequestParam(value = "orderType")String orderType) throws Exception{
        return success(ykyyEntranceService.sendMesToYkt(doctor,patient,orderType));
    }
}