Browse Source

解决冲突后的提交

wangjun 4 năm trước cách đây
mục cha
commit
b885d88beb

+ 3 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/OutpatientDao.java

@ -18,6 +18,9 @@ public interface OutpatientDao extends PagingAndSortingRepository<WlyyOutpatient
    @Query("from WlyyOutpatientDO a where a.patient = ?1 and a.status in(0,1)")
    List<WlyyOutpatientDO> findByPatientList(String patient);
    @Query("from WlyyOutpatientDO a where a.patient = ?1 and a.status in(3) order by a.createTime desc ")
    List<WlyyOutpatientDO> findByPatientListByStatus(String patient);
    @Query("from WlyyOutpatientDO a where a.patient = ?1 and a.hisStatus=1 and a.createTime>=?2 and a.createTime<=?3")
    List<WlyyOutpatientDO> findByPatientListNoStatus(String patient,Date startDate,Date endDate);

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

@ -88,8 +88,6 @@ import com.yihu.jw.wechat.enterprise.EnterpriseService;
import com.yihu.jw.wechat.service.BaseSensitiveFilterWordsService;
import com.yihu.jw.wechat.service.WxAccessTokenService;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.network.HttpResponse;
import com.yihu.utils.network.HttpUtils;
import com.yihu.utils.security.MD5;
import com.ylzinfo.ehc.EhcHandler;
import com.ylzinfo.ehc.common.utils.DateUtils;
@ -1100,11 +1098,46 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    public Map<String, Object> checkOutpatient(String patient) throws Exception {
    public Map<String, Object> checkOutpatient(String patient,String wxId) throws Exception {
        //-1卡余额不足,,-2 存在未结束的诊断热 1成功
        Map<String, Object> rs = new HashedMap();
        //1.余额判断改到前端判断
        //net.sf.json.JSONObject json = entranceService.qutpatientBalance(cardNo,demoFlag);
        if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
            List<WlyyOutpatientDO> outpatientDOS = outpatientDao.findByPatientListByStatus(patient);
            if (outpatientDOS!=null&&outpatientDOS.size()!=0){
                WlyyOutpatientDO outpatientDO = outpatientDOS.get(0);
                if (outpatientDO.getHisStatus()!=null&&outpatientDO.getHisStatus()!=1){
                    rs.put("outpatient", outpatientDO);
                    rs.put("code", -3);
                    rs.put("mes", "您上一次就诊未结算,请结算后才能发起复诊。");
                    List<BasePatientWechatDo> patientWechatDos = patientWechatDao.findByWechatIdAndPatientId(wxId, patient);
                    if (patientWechatDos == null || patientWechatDos.size() == 0) {
                        throw new Exception("openid不存在!");
                    }
                    WxWechatDO wxWechatDO = wechatDao.findById(wxId);
                    BasePatientWechatDo patientWechatDo = patientWechatDos.get(0);
                    String payUrl = ylzPayService.createSicardPayUrl(wxWechatDO.getAppOriginId(),patientWechatDo.getOpenid(),outpatientDO.getCardNo(),"WX");
                    rs.put("payUrl",payUrl);
                    return rs;
                }else if (outpatientDO.getHisStatus()==null){
                    rs.put("outpatient", outpatientDO);
                    rs.put("code", -3);
                    rs.put("mes", "您上一次就诊未结算,请结算后才能发起复诊。");
                    List<BasePatientWechatDo> patientWechatDos = patientWechatDao.findByWechatIdAndPatientId(wxId, patient);
                    if (patientWechatDos == null || patientWechatDos.size() == 0) {
                        throw new Exception("openid不存在!");
                    }
                    WxWechatDO wxWechatDO = wechatDao.findById(wxId);
                    BasePatientWechatDo patientWechatDo = patientWechatDos.get(0);
                    String payUrl = ylzPayService.createSicardPayUrl(wxWechatDO.getAppOriginId(),patientWechatDo.getOpenid(),outpatientDO.getCardNo(),"WX");
                    rs.put("payUrl",payUrl);
                    return rs;
                }
            }
        }
        //2.判断是否有未结束的
        List<WlyyOutpatientDO> list = outpatientDao.findByPatientList(patient);
@ -7783,7 +7816,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        params.put("xmlStr", patNo);
        returnValue = com.yihu.jw.utils.WebserviceUtil.post(url,
                "http://business.htemr.haitaiinc.com",
                "manageEmrDataAll",
                "manageEmrDataRestore",
                params);
        logger.info("门诊病历列表信息,返回值xmlstr:" + returnValue);
@ -7817,7 +7850,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        params.put("xmlStr", patNo);
        returnValue = com.yihu.jw.utils.WebserviceUtil.post(url,
                "http://business.htemr.haitaiinc.com",
                "manageEmrDataAll",
                "manageEmrDataRestore",
                params);
        logger.info("门诊病历列表信息,返回值xmlstr:" + returnValue);

+ 1 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java

@ -374,6 +374,7 @@ public class EntranceService {
                                wlyyPrescriptionInfoVO.setGroupNo(null != jsonObjectBody.get("DISP_DEPOSITE") ? jsonObjectBody.get("DISP_DEPOSITE").toString() : "");
                                //规格
                                wlyyPrescriptionInfoVO.setSpecification(null != jsonObjectBody.get("DRUG_SPEC") ? jsonObjectBody.get("DRUG_SPEC").toString() : "");
                                wlyyPrescriptionInfoVO.setSerial(null!=jsonObjectBody.get("serial")? jsonObjectBody.get("serial").toString() : "");
                                wlyyPrescriptionInfoVO.setDel(1);
                                wlyyPrescriptionInfoVOS.add(wlyyPrescriptionInfoVO);
                            }

+ 12 - 9
business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java

@ -854,7 +854,7 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                object.put("send_time",DateUtil.dateToStr(DateUtil.strToDate(map.get("timestamp").toString(),"yyyy-MM-dd HH:mm:ss"),"yyyy-MM-dd HH:mm:ss"));
                array.add(object);
            }
            info.put("content",array.toJSONString());
            info.put("content",array);
        }
@ -1121,8 +1121,9 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                "  p.dept_name AS \"dept_name\"," +
                "  a.doctor AS \"doctor\"," +
                "  a.doctor_name AS \"doctor_name\"," +
                "  a.his_register_fee AS \"his_register_fee\"," +
                "  c.idcard AS \"docIdcard\"" +
                "  a.drug_fee AS \"drug_fee\"," +
                "  c.idcard AS \"docIdcard\", " +
                "  a.create_time AS \"create_time\" " +
                "  from  wlyy_prescription a" +
                "     JOIN base_patient b on a.patient_code = b.id " +
                "     JOIN base_doctor c on a.doctor = c.id " +
@ -1159,6 +1160,8 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                // 获取监管平台唯一标识
                String visitDocCode = achNsDoctorRecord(info.get("docIdcard").toString());
                String trialDocCode =  achNsDoctorRecord("350524198906247742");
                jb.put("id_prescription", orgCode +"_"+ (String)info.get("id"));
                jb.put("pres_no",info.get("real_order")== null?"0":info.get("real_order"));
                jb.put("pres_class_code", "1");
@ -1187,21 +1190,21 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                jb.put("pres_subject_name", dept.length>=2?dept[1]:"");
                jb.put("pres_dept_code", info.get("dept")== null?"0":info.get("dept"));
                jb.put("pres_dept_name",info.get("dept_name")== null?"0":info.get("dept_name"));
                jb.put("pres_time", info.get("create_time")== null?"1900-01-01 00:00:00":DateUtil.dateToStrLong((Date)info.get("create_time")));
                jb.put("trial_time",DateUtil.dateToStrLong(new Date()));
                jb.put("pres_time", info.get("create_time")== null?DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss"):DateUtil.dateToStrLong((Date)info.get("create_time")));
                jb.put("trial_time",info.get("create_time")== null?DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss"):DateUtil.dateToStrLong((Date)info.get("create_time")));
                jb.put("pres_doc_code", visitDocCode);
                jb.put("pres_doc_name", info.get("doctor_name")== null?"0":info.get("doctor_name"));
                jb.put("pres_doc_id_no", info.get("docIdcard")== null?"0":info.get("docIdcard"));
                jb.put("trial_doc_code", visitDocCode);
                jb.put("trial_doc_name", info.get("doctor_name")== null?"0":info.get("doctor_name"));
                jb.put("trial_doc_id_no",info.get("docIdcard")== null?"0":info.get("docIdcard"));
                jb.put("trial_doc_code", trialDocCode);
                jb.put("trial_doc_name", "合理用药系统审方");
                jb.put("trial_doc_id_no","350524198906247742");
                jb.put("diag_code", info.get("icd10"));
                jb.put("diag_name", info.get("icd10_name"));
                jb.put("diseases_type", "0");
                jb.put("mobility_flag", "3");
                jb.put("long_medical_flag", "3");
                jb.put("pres_effec_days", 0);
                jb.put("total_price",info.get("his_register_fee")== null?  0 : info.get("his_register_fee"));
                jb.put("total_price",info.get("drug_fee")== null?  0 : info.get("drug_fee"));
                jb.put("upload_time", DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss"));
                jb.put("pres_photo", "");
                jb.put("pres_photos_list", "");

+ 52 - 28
business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java

@ -85,15 +85,16 @@ public class StatisticsEsService {
        SaveModel saveModel3 = null;
        //上周今天收入;
        SaveModel saveModel4 = null;
        SaveModel saveModel7 = null;
        String[] indexes = index.split(",");
        if (StringUtils.isNotEmpty(level2_type)) {
            saveModel = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, indexes[0], SaveModel.timeLevel_DDL, level2_type);
            saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, indexes[1], SaveModel.timeLevel_DDL, level2_type);
            saveModel2 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, indexes[2], SaveModel.timeLevel_DDL,level2_type);
            saveModel2 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, indexes[2]+",21", SaveModel.timeLevel_DDL,level2_type);
        } else {
            saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level, indexes[0], SaveModel.timeLevel_DDL);
            saveModel1 = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level, indexes[1], SaveModel.timeLevel_DDL);
            saveModel2 = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level, indexes[2], SaveModel.timeLevel_DDL);
            saveModel2 = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, area, level, indexes[2]+",21", SaveModel.timeLevel_DDL);
        }
        JSONObject object = new JSONObject();
        String yesterday = DateUtil.getNextDay(endDate, -1);//昨天
@ -110,8 +111,8 @@ public class StatisticsEsService {
        DecimalFormat df = new DecimalFormat("0.00");
        String str = df.format(num);
        object.put("dayPrice",str);//日均收入
        saveModel3 = elasticsearchUtil.findOneDateQuotaLevel0(yesterday, yesterday, area, level, indexes[2], SaveModel.timeLevel_DDL);
        saveModel4 = elasticsearchUtil.findOneDateQuotaLevel0(lastDay, lastDay, area, level, indexes[2], SaveModel.timeLevel_DDL);
        saveModel3 = elasticsearchUtil.findOneDateQuotaLevel0(yesterday, yesterday, area, level, indexes[2]+",21", SaveModel.timeLevel_DDL);
        saveModel4 = elasticsearchUtil.findOneDateQuotaLevel0(lastDay, lastDay, area, level, indexes[2]+",21", SaveModel.timeLevel_DDL);
        object.put("outPatientCount",saveModel.getResult2().longValue());//问诊量
        object.put("prescriptionCount",saveModel1.getResult2().longValue());//开方量
        object.put("priceTotal",saveModel2.getResult1().longValue());//总收入
@ -443,35 +444,35 @@ public class StatisticsEsService {
        if (interval==1){
            JSONArray array = dateTotalStatistics3(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
            object.put("data",array);
            JSONArray array1 = dateTotalStatistics3(startDate,endDate,area,level,"3","3",SaveModel.timeLevel_ZL,null);
            JSONArray array1 = dateTotalStatistics3(startDate,endDate,area,level,"3,21","3",SaveModel.timeLevel_ZL,null);
            object.put("specialistData",array1);
            JSONArray array2 = dateTotalStatistics3(startDate,endDate,area,level,"3","1",SaveModel.timeLevel_ZL,"1");
            JSONArray array2 = dateTotalStatistics3(startDate,endDate,area,level,"3,21","1",SaveModel.timeLevel_ZL,"1");
            object.put("topicData",array2);
            JSONArray array3 = dateTotalStatistics3(startDate,endDate,area,level,"3","2",SaveModel.timeLevel_ZL,null);
            JSONArray array3 = dateTotalStatistics3(startDate,endDate,area,level,"3,21","2",SaveModel.timeLevel_ZL,null);
            object.put("synergyData",array3);
            JSONArray array4 = dateTotalStatistics3(startDate,endDate,area,level,"3","1",SaveModel.timeLevel_ZL,"2");
            JSONArray array4 = dateTotalStatistics3(startDate,endDate,area,level,"3,21","1",SaveModel.timeLevel_ZL,"2");
            object.put("vedioData",array4);
        }else if (interval==2){
            JSONArray array = weekTotalStatisticsDf(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL);
            object.put("data",array);
            JSONArray array1 = weekTotalStatistics3(startDate,endDate,area,level,"3","3",SaveModel.timeLevel_ZL,"1");
            JSONArray array1 = weekTotalStatistics3(startDate,endDate,area,level,"3,21","3",SaveModel.timeLevel_ZL,"1");
            object.put("specialistData",array1);
            JSONArray array2 = weekTotalStatistics3(startDate,endDate,area,level,"3","1",SaveModel.timeLevel_ZL,"1");
            JSONArray array2 = weekTotalStatistics3(startDate,endDate,area,level,"3,21","1",SaveModel.timeLevel_ZL,"1");
            object.put("topicData",array2);
            JSONArray array3 = weekTotalStatistics3(startDate,endDate,area,level,"3","2",SaveModel.timeLevel_ZL,null);
            JSONArray array3 = weekTotalStatistics3(startDate,endDate,area,level,"3,21","2",SaveModel.timeLevel_ZL,null);
            object.put("synergyData",array3);
            JSONArray array4 = weekTotalStatistics3(startDate,endDate,area,level,"3","1",SaveModel.timeLevel_ZL,"2");
            JSONArray array4 = weekTotalStatistics3(startDate,endDate,area,level,"3,21","1",SaveModel.timeLevel_ZL,"2");
            object.put("vedioData",array4);
        }else if (interval==3){
            JSONArray array = monthTotalStatistics3(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
            object.put("data",array);
            JSONArray array1 = monthTotalStatistics3(startDate,endDate,area,level,"3","3",SaveModel.timeLevel_ZL,"1");
            JSONArray array1 = monthTotalStatistics3(startDate,endDate,area,level,"3,21","3",SaveModel.timeLevel_ZL,"1");
            object.put("specialistData",array1);
            JSONArray array2 = monthTotalStatistics3(startDate,endDate,area,level,"3","1",SaveModel.timeLevel_ZL,"1");
            JSONArray array2 = monthTotalStatistics3(startDate,endDate,area,level,"3,21","1",SaveModel.timeLevel_ZL,"1");
            object.put("topicData",array2);
            JSONArray array3 = monthTotalStatistics3(startDate,endDate,area,level,"3","2",SaveModel.timeLevel_ZL,null);
            JSONArray array3 = monthTotalStatistics3(startDate,endDate,area,level,"3,21","2",SaveModel.timeLevel_ZL,null);
            object.put("synergyData",array3);
            JSONArray array4 = monthTotalStatistics3(startDate,endDate,area,level,"3","1",SaveModel.timeLevel_ZL,"2");
            JSONArray array4 = monthTotalStatistics3(startDate,endDate,area,level,"3,21","1",SaveModel.timeLevel_ZL,"2");
            object.put("vedioData",array4);
        }
        DecimalFormat decimalFormat = new DecimalFormat("0.00");
@ -4443,24 +4444,47 @@ public class StatisticsEsService {
        object.put("excelData",resultArray);
        return object;
    }
    /**
     * 日期柱状图处方变换
     *
     *
     * app端头部收入统计
     * @param startDate
     * @param endDate
     * @param area
     * @param level 2科室
     * @param level
     * @param index
     * @param level2_type 4 医院
     * @return
     * @throws Exception
     *//*
public JSONObject changePrescriptionLineOnlyTop(String startDate, String endDate, String area, int level, String index,int interval, String level2_type,String key1,String key2) throws Exception {
    if(StringUtils.isNotBlank(key1)&&StringUtil.isBlank(key2)){
        List<SaveModel> precriptionList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "", "", level2_type);
     */
    public  JSONObject appIndexHead(String startDate, String endDate, String area, int level, String index) throws Exception {
        JSONObject object = new JSONObject();
        String nowStartDate = DateUtil.getStringDateShort();
        String monthStartDate = DateUtil.getFristDayOfMonth();
        String monthEndDate = DateUtil.getLastDayOfMonth();
        //今日收入总收入
        SaveModel nowPrice = elasticsearchUtil.findOneDateQuotaLevel0(nowStartDate, nowStartDate, area, level, index, SaveModel.timeLevel_ZL);
        object.put("nowPrice",nowPrice.getResult1());
        //本月总收入
        SaveModel nowMonthPrice = elasticsearchUtil.findOneDateQuotaLevel0(monthStartDate, monthEndDate, area, level, index, SaveModel.timeLevel_ZL);
        object.put("nowMonthPrice",nowPrice.getResult1());
        SaveModel totalPrice = elasticsearchUtil.findOneDateQuotaLevel0(nowStartDate, nowStartDate, area, level, index, SaveModel.timeLevel_DDL);
        object.put("totalPrice",totalPrice.getResult1());
        return object;
    }
    return null;
}*/
    public  JSONObject appIndexCenter(String startDate, String endDate, String area, int level, String index) throws Exception {
        JSONObject object = new JSONObject();
        //图文复诊
        SaveModel topicTotal = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level, "12", SaveModel.timeLevel_ZL);
        object.put("topicTotal",topicTotal.getResult1());
        //视频复诊
        SaveModel videoTotal = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level, "16", SaveModel.timeLevel_ZL);
        object.put("videoTotal",videoTotal.getResult1());
        //专家咨询
        SaveModel specialistTotal = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level, "6", SaveModel.timeLevel_ZL);
        object.put("specialistTotal",specialistTotal.getResult1());
        //专科协同
        SaveModel synergyTotal = elasticsearchUtil.findOneDateQuotaLevel0(startDate, endDate, area, level, "14", SaveModel.timeLevel_ZL);
        object.put("synergyTotal",synergyTotal.getResult1());
        return object;
    }
}

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

@ -802,7 +802,7 @@ public class ImService {
			accessToken = wxAccessTokenService.getWxAccessTokenById(wechat_appid).getAccessToken();
		}
		InputStream is = null;
		String url = "http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=" + accessToken + "&media_id=" + mediaId;
		String url = "https://api.weixin.qq.com/cgi-bin/media/get?access_token=" + accessToken + "&media_id=" + mediaId;
//		String url = "http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=30_OBJbMMPW9TnyGHKf32bcjkXtxWnzBrtqWlSMBnNk8MWpJ6qis2TnsecRYNZImgahdx30WrsI1bGco6K67-j4sT1QkDxYKBrVvjaYF6QgbY8dgBMzuoARKoaxtX3ehiYvdCLSUHvogrpF3n0GANIfCHAHUP&media_id=R_060hnyXAFyHD9HaOLl15xhDIzDvcA61-Wz34GkXmCakdrsFJqxrPEBHewmAEK9";
		logger.info("media/get"+url);
		try {
@ -861,7 +861,7 @@ public class ImService {
		logger.info("accessToken 过期时重新下载多媒体文件:wechat_appid:"+wechat_appid);
		logger.info("accessToken 过期时重新下载多媒体文件:mediaId:"+mediaId);
		InputStream is = null;
		String url = "http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=" + accessToken + "&media_id=" + mediaId;
		String url = "https://api.weixin.qq.com/cgi-bin/media/get?access_token=" + accessToken + "&media_id=" + mediaId;
		logger.info("media/get"+url);
		try {
			URL urlGet = new URL(url);

+ 2 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -1325,6 +1325,8 @@ public class BaseHospitalRequestMapping {
        public static final String consultLinePC = "/consultLinePC";
        public static final String consultListPC = "/consultListPC";
        public static final String indexTotalApp = "/indexTotalApp";
        public static final String appIndexHead = "/appIndexHead";
        public static final String appIndexCenter ="/appIndexCenter";
    }

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

@ -428,45 +428,47 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
		msgObj.put("consultcode",consult);
		String jsonStr = "";
		if ("xm_zsyy_wx".equalsIgnoreCase(wxId)){
		//结束时医生未开处方则发送模板消息结算
		ConsultDo cons = consultDao.findOne(consult);
		if (StringUtils.isNoneBlank(cons.getRelationCode())){
			WlyyOutpatientDO outpatientDO = outpatientDao.findById(cons.getRelationCode());
			List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutpatientId(outpatientDO.getId());
			if (wlyyPrescriptionDOS==null||wlyyPrescriptionDOS.size()==0){
				logger.info("发送诊查费支付模板消息start");
				BasePatientDO patientDO = basePatientDao.findById(outpatientDO.getPatient());
				String userName = null;
				String idcard = null;
				if (patientDO != null) {
					userName = patientDO.getName();
					idcard = patientDO.getIdcard();
				}
				PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(outpatientDO.getConsumer());
				String userNo = null;
				if (patientMappingDO != null) {
					userNo = patientMappingDO.getMappingCode();
				}
				String cardNo = null;
				if (StringUtils.isNoneBlank(outpatientDO.getCardNo())) {
					cardNo = outpatientDO.getCardNo();
				}
				String date=DateUtil.dateToStr(outpatientDO.getRegisterDate(), "yyyyMMddHHmmss");
				net.sf.json.JSONObject object =entranceService.BS15054(patientMappingDO.getMappingCode(),outpatientDO.getRealOrder(),false);
				net.sf.json.JSONObject res = object.getJSONObject("resquest");
				logger.info("获取待结算数据 res: " + res.toString());
				String rsCode = res.getString("@RESULT");
				String free= 0+"";
				if ("0".equals(rsCode)) {
					free = res.getString("@total_charge");
				}
				if (!free.equalsIgnoreCase("0")){
					ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, outpatientDO.getXtgzh(), outpatientDO.getDeptName(), outpatientDO.getDoctorName(), date, free, "1");
			//结束时医生未开处方则发送模板消息结算
			ConsultDo cons = consultDao.findOne(consult);
			if (StringUtils.isNoneBlank(cons.getRelationCode())){
				WlyyOutpatientDO outpatientDO = outpatientDao.findById(cons.getRelationCode());
				List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutpatientId(outpatientDO.getId());
				if (wlyyPrescriptionDOS==null||wlyyPrescriptionDOS.size()==0){
					logger.info("发送诊查费支付模板消息start");
					BasePatientDO patientDO = basePatientDao.findById(outpatientDO.getPatient());
					String userName = null;
					String idcard = null;
					if (patientDO != null) {
						userName = patientDO.getName();
						idcard = patientDO.getIdcard();
					}
					PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(outpatientDO.getConsumer());
					String userNo = null;
					if (patientMappingDO != null) {
						userNo = patientMappingDO.getMappingCode();
					}
					String cardNo = null;
					if (StringUtils.isNoneBlank(outpatientDO.getCardNo())) {
						cardNo = outpatientDO.getCardNo();
					}
					String date=DateUtil.dateToStr(outpatientDO.getRegisterDate(), "yyyyMMddHHmmss");
					net.sf.json.JSONObject object =entranceService.BS15054(patientMappingDO.getMappingCode(),outpatientDO.getRealOrder(),false);
					net.sf.json.JSONObject res = object.getJSONObject("resquest");
					logger.info("获取待结算数据 res: " + res.toString());
					String rsCode = res.getString("@RESULT");
					String free= 0+"";
					if ("0".equals(rsCode)) {
						if (res.getString("@settle_flag").equalsIgnoreCase("N")){
							free = res.getString("@total_charge");
						}
					}
					if (!free.equalsIgnoreCase("0")){
						ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, outpatientDO.getXtgzh(), outpatientDO.getDeptName(), outpatientDO.getDoctorName(), date, free, "1");
					}
					logger.info("发送诊查费支付模板消息end");
				}
				logger.info("发送诊查费支付模板消息end");
			}
		}
		}
		if(1 == resutl){
			jsonStr = "{\"id\":\""+ UUID.randomUUID().toString()+"\",\"sender_id\":\""+doctorCode+"\",\"sender_name\":\"系统\",\"timestamp\":"+new Date().getTime()+",\"content_type\":7,\"content\":"+msgObj.toString()+",\"business_type\":1}";
		}

+ 3 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java

@ -663,7 +663,9 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
				String rsCode = res.getString("@RESULT");
				String free= 0+"";
				if ("0".equals(rsCode)) {
					free = res.getString("@total_charge");
					if (res.getString("@settle_flag").equalsIgnoreCase("N")){
						free = res.getString("@total_charge");
					}
				}
				if (!free.equalsIgnoreCase("0")){
					ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, outpatientDO.getXtgzh(), outpatientDO.getDeptName(), outpatientDO.getDoctorName(), date, free, "1");

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

@ -877,12 +877,9 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                        prescriptionLogDao.save(prescriptionLogDO);
                                        for (WaitPayDetailVO waitPayDetailVO1:listWPD){
                                            if (waitPayDetailVO1.getItemName().equalsIgnoreCase("互联网医院复诊诊查费")){
                                                List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByRealOrderList(waitPayDetailVO1.getRecipeNo());
                                                if (wlyyPrescriptionDOS!=null&&wlyyPrescriptionDOS.size()!=0){
                                                    WlyyPrescriptionDO wlyyPrescriptionDO = wlyyPrescriptionDOS.get(0);
                                                    prescriptionService.updateHisStatusByOutpatientId(wlyyPrescriptionDO.getOutpatientId());
                                                    logger.info("更新门诊结算状态");
                                                }
                                                WlyyOutpatientDO wlyyOutpatientDO1 = outpatientDao.findByRealOrder(waitPayDetailVO1.getRecipeNo());
                                                wlyyOutpatientDO1.setHisStatus(1);
                                                outpatientDao.save(wlyyOutpatientDO1);
                                            }
                                        }
                                        logger.info("处方结算成功"+pushPayLog+"====="+waitPayDetailVO.getRecipeNo());
@ -905,6 +902,11 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                                logger.info("更新门诊结算状态");
                                            }
                                        }
                                    }else {
                                        WlyyOutpatientDO wlyyOutpatientDO1 = outpatientDao.findByRealOrder(waitPayDetailVO.getRecipeNo());
                                        wlyyOutpatientDO1.setHisStatus(1);
                                        outpatientDao.save(wlyyOutpatientDO1);
                                        logger.info("更新门诊结算状态");
                                    }
                                }
                                prescriptionDao.updateStatusByRealOrder(waitPayDetailVO.getRecipeNo(),30,new Date());

+ 60 - 7
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/statistics/EsStatisticsEndpoint.java

@ -36,7 +36,7 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
     * @param startDate
     * @param endDate
     * @param area
     * @param level 5 市  4区  3医院 2科室 1医生
     * @param level 2 市  3区  4医院 5、科室 6医生
     * @param index
     * @param level2_type 2 市  3区  4医院 5、科室 6医生
     * @return
@ -55,7 +55,7 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
        JSONObject result = new JSONObject();
        logger.info("index:"+index+" and level2_type:"+level2_type+" and level:"+level);
        try {
            if (index.contains("3")){
            if (index.contains("3,21")){
                result= statisticsEsService.getOutPatientPriceLine(startDate, endDate, area, level, index, interval,level2_type);
            }else {
                result= statisticsEsService.getOutPatientLine(startDate, endDate, area, level, index, interval,level2_type);
@ -74,7 +74,7 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
     * @param startDate
     * @param endDate
     * @param area
     * @param level 5 市  4区  3医院 2科室 1医生
     * @param level 2 市  3区  4医院 5、科室 6医生
     * @param index
     * @param level2_type 2 市  3区  4医院 5、科室 6医生
     * @return
@ -103,7 +103,7 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
     * @param startDate
     * @param endDate
     * @param area
     * @param level 5 市  4区  3医院 2科室 1医生
     * @param level 2 市  3区  4医院 5、科室 6医生
     * @param index
     * @param level2_type 2 市  3区  4医院 5、科室 6医生
     * @return
@ -132,7 +132,7 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
     * @param startDate
     * @param endDate
     * @param area
     * @param level 5 市  4区  3医院 2科室 1医生
     * @param level 2 市  3区  4医院 5、科室 6医生
     * @param index
     * @param level2_type 2 市  3区  4医院 5、科室 6医生
     * @return
@ -205,7 +205,7 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
     * @param area
     * @param level
     * @param index
     * @param level2_type 5 市  4区  3医院 2科室 1医生
     * @param level2_type 2 市  3区  4医院 5、科室 6医生
     * @return
     */
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.outPatientGrade)
@ -234,7 +234,7 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
     * @param startDate
     * @param endDate
     * @param area
     * @param level 5 市  4区  3医院 2科室 1医生
     * @param level 2 市  3区  4医院 5、科室 6医生
     * @param index
     * @param level2_type 2 市  3区  4医院 5、科室 6医生
     * @return
@ -833,4 +833,57 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
    }
    /**
     *
     * @param startDate
     * @param endDate
     * @param area
     * @param level 2 市  3区  4医院 5科室 6医生
     * @param index
     * @return
     */
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.appIndexHead)
    @ApiOperation(value = "app首页头部收入统计")
    public ObjEnvelop appIndexHead(
            @RequestParam(required = true) String startDate,
            @RequestParam(required = true) String endDate,
            @RequestParam(required = true) String area,
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String index) {
        JSONObject result = new JSONObject();
        try {
            result= statisticsEsService.appIndexHead(startDate, endDate, area, level, index);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return success(result);
    }
    /**
     *
     * @param startDate
     * @param endDate
     * @param area
     * @param level 2 市  3区  4医院 5科室 6医生
     * @param index
     * @return
     */
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.appIndexCenter)
    @ApiOperation(value = "app首页中部门诊量统计")
    public ObjEnvelop appIndexCenter(
            @RequestParam(required = true) String startDate,
            @RequestParam(required = true) String endDate,
            @RequestParam(required = true) String area,
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String index) {
        JSONObject result = new JSONObject();
        try {
            result= statisticsEsService.appIndexHead(startDate, endDate, area, level, index);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return success(result);
    }
}