Explorar o código

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

liubing %!s(int64=2) %!d(string=hai) anos
pai
achega
ac25e23bbc

+ 75 - 58
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/HcyyEntranceService.java

@ -2449,9 +2449,10 @@ public class HcyyEntranceService {
    public String initParams(String serviceCode,String hisId,String payType,String patient,String doctor,List<WlyyPrescriptionInfoDO> infos,List<WlyyPrescriptionDiagnosisDO> diagnosisDOS,String outpatientId) throws Exception {
    public String initParams(String serviceCode,String payType,String patient,String doctor,List<WlyyPrescriptionInfoDO> infos,List<WlyyPrescriptionDiagnosisDO> diagnosisDOS,String outpatientId) throws Exception {
        String xml ="";
        String hisId = UUID.randomUUID().toString();
        PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patient);
        if (patientMappingDO == null){
            return "患者信息映射表为空";
@ -2460,20 +2461,30 @@ public class HcyyEntranceService {
        if (doctorMappingDO == null){
            return "医生信息映射表为空";
        }
        WlyyOutpatientDO outpatientDO =outpatientDao.findById(outpatientId);
        if(outpatientDO==null){
            return "就诊记录为空!";
        }
        String eventTime = DateUtil.dateToStrLong(outpatientDO.getCreateTime());
        String recipeTime = DateUtil.dateToStrLong(new Date());
        List<BaseDoctorHospitalDO> baseDoctorHospitalDOList = baseDoctorHospitalDao.findByDoctorCode(doctor);
        BaseDoctorHospitalDO baseDoctorHospitalDO = baseDoctorHospitalDOList.get(0);
        BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(doctor);
        BasePatientDO patientDO = patientDao.findById(patient);
        String hospital = "";
        String eventNo="";
        String eventTime = "";
        String dept = "";
        String deptName = "";
        if (infos!=null&&infos.size()!=0){
            WlyyOutpatientDO outpatientDO = outpatientDao.findById(outpatientId);
            hospital = outpatientDO.getHospital();
            eventNo = outpatientDO.getRegisterNo();
            eventTime = DateUtil.dateToStrLong(outpatientDO.getRegisterDate());
            dept = outpatientDO.getDept();
            deptName = outpatientDO.getDeptName();
        }
        Double recipeFeeTotal = 0.00;
        for (int i = 0; i < infos.size(); i++) {
            Double packRetprice = infos.get(i).getPackRetprice();
            Double feeTotal=Integer.parseInt(infos.get(i).getQuantity()) * packRetprice;
            Double feeTotal=infos.get(i).getPackQuantity() * packRetprice;
            recipeFeeTotal += feeTotal;
        }
        if (patientDO == null){
@ -2501,8 +2512,8 @@ public class HcyyEntranceService {
        //基础标记
        String base =
                "<base>  \n" +
                "    <hospital_code><![CDATA["+outpatientDO.getHospital()+"]]></hospital_code>  \n" +
                "    <event_no><![CDATA["+outpatientDO.getAdmNo()+"]]></event_no>  \n" +
                "    <hospital_code><![CDATA["+hospital+"]]></hospital_code>  \n" +
                "    <event_no><![CDATA["+eventNo+"]]></event_no>  \n" +
                "    <patient_id><![CDATA["+patientMappingDO.getMappingCode()+"]]></patient_id>  \n" +
                "    <source><![CDATA[门诊]]></source>  \n" +
                "</base>  \n";
@ -2515,9 +2526,9 @@ public class HcyyEntranceService {
                "           <id_no><![CDATA["+ patientDO.getIdcard()+"]]></id_no>  \n" +
                "           <birthday><![CDATA["+ patientDO.getBirthday()+"]]></birthday>  \n" +
                "           <event_time><![CDATA["+eventTime+"]]></event_time>  \n" +
                "           <dept_id><![CDATA["+outpatientDO.getDept()+"]]></dept_id>  \n" +
                "           <dept_name><![CDATA["+outpatientDO.getDeptName()+"]]></dept_name>  \n" +
                "           <pay_type><![CDATA["+("1".equalsIgnoreCase(payType) ? "医保" : "自费")+"]]></pay_type>  \n" +
                "           <dept_id><![CDATA["+dept+"]]></dept_id>  \n" +
                "           <dept_name><![CDATA["+deptName+"]]></dept_name>  \n" +
                "           <pay_type><![CDATA[自费]]></pay_type>  \n" +
                "           <pregnancy><![CDATA[]]></pregnancy>  \n" +
                "           <time_of_preg><![CDATA[]]></time_of_preg>  \n" +
                "           <breast_feeding><![CDATA[]]></breast_feeding>  \n" +
@ -2545,53 +2556,46 @@ public class HcyyEntranceService {
                "           <herb_packet_count><![CDATA[]]></herb_packet_count>  \n" +
                "           <recipe_status><![CDATA[0]]></recipe_status>  \n" +
                "           <comments><![CDATA[]]></comments>  \n" +
                "           <urgent_flag><![CDATA[0]]></urgent_flag>  \n" +
                "           <urgent_flag><![CDATA[1]]></urgent_flag>  \n" +
                "       </opt_prescription_info>";
        //处方明细
        String prescriptionItems="";
        for (int i = 0; i < infos.size(); i++) {
            String resId = UUID.randomUUID().toString();
            String prescriptionItem =
                    "        <opt_prescription_item>     \n" +
                    "           <recipe_item_id><![CDATA["+hisId+"]]></recipe_item_id>  \n" +
                    "           <recipe_id><![CDATA["+infos.get(i).getId()+"]]></recipe_id>  \n" +
                    "           <group_no><![CDATA["+infos.get(i).getGroupNo()+"]]></group_no>  \n" +
                    "           <drug_id><![CDATA["+infos.get(i).getDrugNo()+"]]></drug_id>  \n" +
                    "           <recipe_item_id><![CDATA["+resId+"]]></recipe_item_id>  \n" +
                    "           <recipe_id><![CDATA["+hisId+"]]></recipe_id>  \n" +
                    "           <group_no><![CDATA[1]]></group_no>  \n" +
                    "           <drug_id><![CDATA["+infos.get(i).getHisCode()+"]]></drug_id>  \n" +
                    "           <drug_name><![CDATA["+infos.get(i).getDrugName()+"]]></drug_name>  \n" +
                    "           <specification><![CDATA["+infos.get(i).getSpecification()+"]]></specification>  \n" +
                    "           <manufacturer_name><![CDATA["+infos.get(i).getDrugPlace()+"]]></manufacturer_name>  \n" +
                    "           <drug_dose><![CDATA["+infos.get(i).getDosage() + infos.get(i).getUnitName()+"]]></drug_dose>  \n" +
                    "           <drug_admin_route_name><![CDATA["+infos.get(i).getSupplyName()+"]]></drug_admin_route_name>  \n" +
                    "           <drug_using_freq><![CDATA["+infos.get(i).getUsageCode()+"]]></drug_using_freq>  \n" +
                    "           <despensing_num><![CDATA["+infos.get(i).getQuantity()+"]]></despensing_num>  \n" +
                    "           <despensing_num><![CDATA["+infos.get(i).getPackQuantity()+"]]></despensing_num>  \n" +
                    "           <pack_unit><![CDATA["+infos.get(i).getPackUnitName()+"]]></pack_unit>  \n" +
                    "           <count_unit><![CDATA["+infos.get(i).getPackQuantity()+"]]></count_unit>  \n" +
                    "           <unit_price><![CDATA["+infos.get(i).getPackRetprice()+"]]></unit_price>  \n" +
                    "           <fee_total><![CDATA["+Integer.parseInt(infos.get(i).getQuantity()) * infos.get(i).getPackRetprice()+"]]></fee_total>  \n" +
                    "           <duration><![CDATA["+infos.get(i).getUsageName()+"]]></duration>  \n" +
                    "           <fee_total><![CDATA["+infos.get(i).getPackQuantity() * infos.get(i).getPackRetprice()+"]]></fee_total>  \n" +
                    "           <duration><![CDATA["+infos.get(i).getDays()+"]]></duration>  \n" +
                    "           <preparation><![CDATA["+infos.get(i).getUnitName()+"]]></preparation>  \n" +
                    "           <approve_no><![CDATA["+infos.get(i).getPzwh()+"]]></approve_no>  \n" +
                    "           <medicare_type><![CDATA[]]></medicare_type>  \n" +
                    "           <ouvas_flag><![CDATA[]]></ouvas_flag>  \n" +
                    "           <skin_test_flag><![CDATA[]]></skin_test_flag>  \n" +
                    "           <duration><![CDATA[]]></duration>  \n" +
                    "           <special_prompt><![CDATA[]]></special_prompt>  \n" +
                    "       </opt_prescription_item>  ";
            prescriptionItems += prescriptionItem;
        }
        //医生反馈信息
        String feedback = "<feed_back>  \n" +
                "       <recipe_id><![CDATA["+hisId+"]]></recipe_id>  \n" +
                "       <message><![CDATA["+outpatientDO.getAdvice()+"]]></message>  \n" +
                "       <status><![CDATA[1]]></status>  \n" +
                "   </feed_back>  ";
        //诊断
        String prescriptionDiagnoses="";
        for (int i = 0; i < diagnosisDOS.size(); i++) {
            String diagDate = DateUtil.dateToStrLong(diagnosisDOS.get(i).getCreateTime());
            String prescriptionDiagnose =
                    "   <opt_diagnosis>  \n" +
                    "       <diag_id><![CDATA["+diagnosisDOS.get(i).getId()+"]]></diag_id>  \n" +
                    "       <diag_date><![CDATA["+diagDate+"]]></diag_date>  \n" +
                    "       <diag_date><![CDATA["+eventTime+"]]></diag_date>  \n" +
                    "       <diag_name><![CDATA["+diagnosisDOS.get(i).getName()+"]]></diag_name>  \n" +
                    "       <diag_code><![CDATA["+diagnosisDOS.get(i).getCode()+"]]></diag_code>  \n" +
                    "       <diag_status><![CDATA[0]]></diag_status>  \n" +
@ -2634,9 +2638,9 @@ public class HcyyEntranceService {
        else if (serviceCode.equals("CANCEL_GROUP_DRUG_V4")){
            xml = "<root>" + base + doctors + cancelPrescription + "</root>";
        }
        else if (serviceCode.equals("SF_V4_DOUBLE_SIGN")){
     /*   else if (serviceCode.equals("SF_V4_DOUBLE_SIGN")){
            xml = "<root>" + base + doctors + feedback + "</root>";
        }
        }*/
        return xml;
    }
@ -2649,28 +2653,41 @@ public class HcyyEntranceService {
     *                    SF_V4_DOUBLE_SIGN 	医生在对药师打回的处方进行双签处理后,医生站将双签信息推送给审方系统:、
     *                    CANCEL_GROUP_DRUG_V4 	删除已保存处方时调用、
     *                    SF_V4_DISCHARGED 	已保存处方进行数据修改
     * @param xml 入参数
     * @param name 服务名字
     * @param name 服务名字c
     * @return
     */
    public String checkPrescription(String serviceCode,String xml,String name){
        String url = getYYCheckUrl()+serviceCode;
        JSONObject object = new JSONObject();
        object.put("xml",xml);
        String response = httpClientUtil.postBody(url,object);
        WlyyHttpLogDO httpLogDO = new WlyyHttpLogDO();
        httpLogDO.setCode(serviceCode);
        httpLogDO.setName(name);
        httpLogDO.setRequest(xml);
        httpLogDO.setResponse(response);
        httpLogDO.setStatus("1");
        wlyyHttpLogDao.save(httpLogDO);
        return response;
    public String checkPrescription(String serviceCode,String jsonData,String name) throws Exception {
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+serviceCode+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <certificate>"+caKey+"</certificate> " +
                "</root>";
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                jsonData;
        Map<String,String> params = new HashedMap();
        WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        wlyyHttpLogDO.setRequest(params.toString());
        logger.info(name+" params:"+params.toString());
        String xml = getHcyyCAWebServiceInfo("CallInterface",params,getYYCheckUrl());
        wlyyHttpLogDO.setResponse(xml);
        wlyyHttpLogDO.setCreateTime(new Date());
        wlyyHttpLogDO.setCode(serviceCode);
        wlyyHttpLogDO.setName(name);
        wlyyHttpLogDao.save(wlyyHttpLogDO);
        logger.info(name+" json:"+xml);
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        return json;
    }
    //处方保存前,进行合理用药审查
    public String checkPrescriptions(String outpatient, String hisId, String payType, String patient, String doctor,List<WlyyPrescriptionInfoDO> infos, List<WlyyPrescriptionDiagnosisDO> diagnosisDOS) throws Exception {
    public String checkPrescriptions(String hisId, String payType, String patient, String doctor,List<WlyyPrescriptionInfoDO> infos, List<WlyyPrescriptionDiagnosisDO> diagnosisDOS,String outpatientId) throws Exception {
        if (null == infos || infos.size() == 0) {
            return "药品信息为空";
@ -2679,14 +2696,14 @@ public class HcyyEntranceService {
            return "诊断信息为空";
        }
            String xml = "";
            xml = initParams("GY_V4_FLEXIBLE", hisId, payType, patient, doctor, infos, diagnosisDOS,outpatient);
            String response = checkPrescription("GY_V4_FLEXIBLE", xml, "合理用药审查");
            xml = initParams("GY_SF_V4",payType, patient, doctor, infos, diagnosisDOS,outpatientId);
            String response = checkPrescription("GY_SF_V4", xml, "合理用药审查");
        return response;
    }
    //处方在医生站系统成功保存后调用
    public String saveCheck(String outpatient, String hisId, String payType, String patient, String doctor,List<WlyyPrescriptionInfoDO> infos, List<WlyyPrescriptionDiagnosisDO> diagnosisDOS){
    public String saveCheck(String outpatient, String hisId, String payType, String patient, String doctor,List<WlyyPrescriptionInfoDO> infos, List<WlyyPrescriptionDiagnosisDO> diagnosisDOS) throws Exception {
        if (infos == null || infos.size() == 0) {
            return "药品信息为空";
        }
@ -2695,7 +2712,7 @@ public class HcyyEntranceService {
        }
            String xml = null;
            try {
                xml = initParams("GY_SF_V4",hisId, payType, patient, doctor, infos, diagnosisDOS,outpatient);
                xml = initParams("GY_SF_V4", payType, patient, doctor, infos, diagnosisDOS,outpatient);
            } catch (Exception e) {
                e.printStackTrace();
            }
@ -2704,7 +2721,7 @@ public class HcyyEntranceService {
    }
    //处方保存成功后,发送给审方系统进行人工审方
    public String validCheck(String outpatient,String hisId, String payType, String patient, String doctor,List<WlyyPrescriptionInfoDO> infos, List<WlyyPrescriptionDiagnosisDO> diagnosisDOS){
    public String validCheck(String outpatient,String hisId, String payType, String patient, String doctor,List<WlyyPrescriptionInfoDO> infos, List<WlyyPrescriptionDiagnosisDO> diagnosisDOS) throws Exception {
        if (infos == null || infos.size() == 0) {
            return "药品信息为空";
        }
@ -2713,7 +2730,7 @@ public class HcyyEntranceService {
        }
            String xml = null;
            try {
                xml = initParams("SF_V4_VALID_FLAG", hisId, payType, patient, doctor, infos, diagnosisDOS,outpatient);
                xml = initParams("SF_V4_VALID_FLAG",payType, patient, doctor, infos, diagnosisDOS,outpatient);
            } catch (Exception e) {
                e.printStackTrace();
            }
@ -2722,7 +2739,7 @@ public class HcyyEntranceService {
    }
    //删除已保存处方时调用
    public String deletePrescription(String outpatient,String hisId, String payType, String patient, String doctor,List<WlyyPrescriptionInfoDO> infos, List<WlyyPrescriptionDiagnosisDO> diagnosisDOS){
    public String deletePrescription(String outpatient,String hisId, String payType, String patient, String doctor,List<WlyyPrescriptionInfoDO> infos, List<WlyyPrescriptionDiagnosisDO> diagnosisDOS) throws Exception {
        if (infos == null || infos.size() == 0) {
            return "药品信息为空";
        }
@ -2731,7 +2748,7 @@ public class HcyyEntranceService {
        }
            String xml = null;
            try {
                xml = initParams("CANCEL_GROUP_DRUG_V4", hisId, payType, patient, doctor, infos, diagnosisDOS,outpatient);
                xml = initParams("CANCEL_GROUP_DRUG_V4",payType, patient, doctor, infos, diagnosisDOS,outpatient);
            } catch (Exception e) {
                e.printStackTrace();
            }
@ -2740,7 +2757,7 @@ public class HcyyEntranceService {
    }
    //医生在对药师打回的处方进行双签处理后,医生站将双签信息推送给审方系统
    public String doubleSign(String outpatient,String hisId, String payType, String patient, String doctor,List<WlyyPrescriptionInfoDO> infos, List<WlyyPrescriptionDiagnosisDO> diagnosisDOS){
    public String doubleSign(String outpatient,String hisId, String payType, String patient, String doctor,List<WlyyPrescriptionInfoDO> infos, List<WlyyPrescriptionDiagnosisDO> diagnosisDOS) throws Exception {
        if (infos == null || infos.size() == 0) {
            return "药品信息为空";
        }
@ -2749,7 +2766,7 @@ public class HcyyEntranceService {
        }
            String xml = null;
            try {
                xml = initParams("SF_V4_DOUBLE_SIGN",  hisId, payType, patient, doctor, infos, diagnosisDOS,outpatient);
                xml = initParams("SF_V4_DOUBLE_SIGN",payType, patient, doctor, infos, diagnosisDOS,outpatient);
            } catch (Exception e) {
                e.printStackTrace();
            }

+ 2 - 2
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -2251,8 +2251,8 @@ public class ImService {
     * @param type
     * @return
     */
    public Integer SessionsUnreadMessageCount(String userid, String type) {
        return imUtil.SessionsUnreadMessageCount(userid, type);
    public Integer SessionsUnreadMessageCount(String userid, String type,String senderId) {
        return imUtil.SessionsUnreadMessageCount(userid, type,senderId);
    }
    public Integer SessionsUnreadMessageCountByUserId(String userid) {

+ 4 - 1
business/im-service/src/main/java/com/yihu/jw/im/util/ImUtil.java

@ -820,8 +820,11 @@ public class ImUtil {
	 * @param type
	 * @return
	 */
	public Integer SessionsUnreadMessageCount(String userid,String type){
	public Integer SessionsUnreadMessageCount(String userid,String type,String senderId){
		String url = im_host + "api/v2/sessions/unread_message_count?user_id="+userid+"&type="+type;
		if (StringUtils.isNotBlank(senderId)){
			url+="&senderId="+senderId;
		}
		String ret = HttpClientUtil.get(url,"utf-8");
		JSONObject obj = JSON.parseObject(ret);
//		if(obj.getInteger("count") ==200){

+ 6 - 5
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java

@ -429,13 +429,14 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
            }
            //账户密码登录的才验证密码强度
        String grant_type = parameters.get("grant_type");
        if ("password".equals(grant_type)) {
            if (!testPwd(parameters.get("password"))) {
                throw new PwdException("密码强度低,请用验证码登录,或者修改密码后在从新登录!");
        if ("hz_yyyzh_wx".equals(wechatId)) {
            String grant_type = parameters.get("grant_type");
            if ("password".equals(grant_type)) {
                if (!testPwd(parameters.get("password"))) {
                    throw new PwdException("密码强度低,请用验证码登录,或者修改密码后在从新登录!");
                }
            }
        }
        /*如果是移动端登陆则移除之前的token,
        在网关处通过HTTP状态码告知前端是过期(402)还是账号在别处登陆(403),
        实现同一账号只能在一处登陆*/

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/customerService/CustomerService.java

@ -139,7 +139,7 @@ public class CustomerService {
    public JSONObject consultNoReply(String doctor) {
        JSONObject result = new JSONObject();
        Integer integer = imService.SessionsUnreadMessageCount(doctor,"2");
        Integer integer = imService.SessionsUnreadMessageCount(doctor,"2","8a92aba9825c559d01833f47893d0027");
        result.put("total", integer);
        return result;
    }

+ 2 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doctor/CareDoctorService.java

@ -488,8 +488,8 @@ public class CareDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
            Integer unreadMessageCount = imService.SessionsUnreadMessageCountByUserId(doctor);
            object.put("unreadMessageCount",unreadMessageCount);//未读消息数量
            object.put("doorCoachOrder",coachOrderDOList.size());//上门辅导待完成数量
            Integer unConsultMsgCount = imService.SessionsUnreadMessageCount(doctor,"23");
            Integer unConsultMsgCount2 = imService.SessionsUnreadMessageCount(doctor,"24");
            Integer unConsultMsgCount = imService.SessionsUnreadMessageCount(doctor,"23",null);
            Integer unConsultMsgCount2 = imService.SessionsUnreadMessageCount(doctor,"24",null);
            object.put("unConsultMsgCount",unConsultMsgCount+unConsultMsgCount2);//咨询未读消息数量
            return object;
//        }

+ 8 - 24
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java

@ -15,19 +15,16 @@ import com.yihu.jw.entity.base.im.ConsultDo;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.base.wx.WxTemplateConfigDO;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleUserDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.enterprise.WxEnterpriseDO;
import com.yihu.jw.entity.hospital.enterprise.WxEnterpriseTokenDO;
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalRelationDO;
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.*;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.entity.ylzinfo.OauthYlzConfigDO;
import com.yihu.jw.es.service.StatisticsEsService;
import com.yihu.jw.es.service.yqfk.YqfkService;
@ -73,13 +70,10 @@ import com.yihu.jw.sms.service.YkyyINSMSService;
import com.yihu.jw.util.common.FileUtil;
import com.yihu.jw.util.common.XMLUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.WechatDao;
import com.yihu.jw.wechat.dao.WxTemplateConfigDao;
import com.yihu.jw.wechat.enterprise.EnterpriseService;
import com.yihu.jw.wechat.enterprise.dao.WxEnterpriseDao;
import com.yihu.jw.wechat.enterprise.dao.WxEnterpriseTokenDao;
import com.yihu.jw.wechat.service.WechatInfoService;
import com.yihu.jw.wlyy.wlyyhttp.WlyyHttpService;
import com.ylzinfo.onepay.sdk.OnepayClient;
@ -97,31 +91,21 @@ import net.sf.json.JSONArray;
import net.sf.json.xml.XMLSerializer;
import org.apache.axis.utils.StringUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.http.entity.ContentType;
import org.apache.poi.util.IOUtils;
import org.apache.tomcat.util.http.fileupload.FileItem;
import org.apache.tomcat.util.http.fileupload.FileItemFactory;
import org.apache.tomcat.util.http.fileupload.disk.DiskFileItemFactory;
import org.hibernate.validator.constraints.SafeHtml;
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.mock.web.MockMultipartFile;
import org.springframework.util.StreamUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import javax.activation.MimetypesFileTypeMap;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.math.BigDecimal;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
@ -529,7 +513,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                Integer zjqzCount = imService.sessionCountByType(doctor.getId(),15,0);
                //专家咨询
                Integer unreadMessageCount = imService.SessionsUnreadMessageCount(doctor.getId(),"1");
                Integer unreadMessageCount = imService.SessionsUnreadMessageCount(doctor.getId(),"1",null);
                result.put("zjCount",zjCount+zjqzCount);//专家咨询数量
                result.put("zjUnreadMessageCount",unreadMessageCount);//专家咨询未读数
            }else{
@ -558,9 +542,9 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
            }
            //医生咨询
            Integer zxCount = imService.SessionsUnreadMessageCount(doctor.getId(), "1");
            Integer fzCount = imService.SessionsUnreadMessageCount(doctor.getId(), "9");
            Integer spCount = imService.SessionsUnreadMessageCount(doctor.getId(), "16");
            Integer zxCount = imService.SessionsUnreadMessageCount(doctor.getId(), "1",null);
            Integer fzCount = imService.SessionsUnreadMessageCount(doctor.getId(), "9",null);
            Integer spCount = imService.SessionsUnreadMessageCount(doctor.getId(), "16",null);
            result.put("zxCount",zxCount);//专家咨询咨询数量
            result.put("fzCount",fzCount);//图文复诊数量
            result.put("spCount",spCount);//图文复诊数量
@ -2409,7 +2393,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
        result.put("videoConsultTotal",prescriptionService.getVideoCount(doctor,"2","3",wxId));//视频咨询总数量
        result.put("homeConsultCount",prescriptionService.getWaitVideoCount(doctor,"3","3",wxId));//家医咨询数量
        result.put("homeConsultTotal",prescriptionService.getVideoCount(doctor,"3","3",wxId));//家医咨询总数量
        Integer unreadMessageCount = imService.SessionsUnreadMessageCount(doctor,"1");
        Integer unreadMessageCount = imService.SessionsUnreadMessageCount(doctor,"1",null);
        result.put("zjUnreadMessageCount",unreadMessageCount);//专家咨询未读数
        if ("sd_tnzyy_wx".equalsIgnoreCase(wxId)){
            result.put("doorServiceCount",prescriptionService.waitUpdoorCount(doctor));//上门服务数量

+ 4 - 4
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/HcyyPrescriptionCotroller.java

@ -617,8 +617,6 @@ public class HcyyPrescriptionCotroller extends EnvelopRestEndpoint {
    @PostMapping(value = "/hcyyCheckInfo")
    @ApiOperation(value = "合理用药审核")
    public Envelop hcyyCheckInfo(
            @ApiParam(name = "outpatient", value = "就诊表id")
            @RequestParam(value = "outpatient", defaultValue = "") String outpatient,
            @ApiParam(name = "prescriptionOnly", value = "处方唯一标识")
            @RequestParam(value = "prescriptionOnly", defaultValue = "") String prescriptionOnly,
            @ApiParam(name = "payType", value = "付款方式0自费;1医保")
@ -630,7 +628,9 @@ public class HcyyPrescriptionCotroller extends EnvelopRestEndpoint {
            @ApiParam(name = "diagnosisDOS", value = "诊断json")
            @RequestParam(value = "diagnosisDOS", defaultValue = "") String diagnosisDOS,
            @ApiParam(name = "infos", value = "药品json")
            @RequestParam(value = "infos", defaultValue = "") String infos) throws Exception {
            @RequestParam(value = "infos", defaultValue = "") String infos,
            @ApiParam(name = "outpatientId",value = "门诊id")
            @RequestParam(value = "outpatientId", defaultValue = "") String outpatientId) throws Exception {
        JSONArray druginfos = JSONArray.parseArray(infos);
        List<WlyyPrescriptionInfoDO> wlyyPrescriptionInfoDOS = new ArrayList<>();
        for (int i = 0; i < druginfos.size(); i++) {
@ -643,7 +643,7 @@ public class HcyyPrescriptionCotroller extends EnvelopRestEndpoint {
            WlyyPrescriptionDiagnosisDO wlyyPrescriptionDiagnosisDO = toEntity(diagnosis.get(i).toString(), WlyyPrescriptionDiagnosisDO.class);
            wlyyPrescriptionDiagnosisDOS.add(wlyyPrescriptionDiagnosisDO);
        }
        return success(hcyyEntranceService.checkPrescriptions(outpatient,prescriptionOnly,payType,patient,doctor,wlyyPrescriptionInfoDOS,wlyyPrescriptionDiagnosisDOS));
        return success(hcyyEntranceService.checkPrescriptions(prescriptionOnly,payType,patient,doctor,wlyyPrescriptionInfoDOS,wlyyPrescriptionDiagnosisDOS,outpatientId));
    }
    /**