瀏覽代碼

返回值非空判断

wangjun 4 年之前
父節點
當前提交
be261681d4

+ 22 - 14
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/XzzxEntranceService.java

@ -3405,20 +3405,24 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
        List<WlyyPrescriptionEmrDO> wlyyPrescriptionEmrDOList = new ArrayList<>();
        if(object.getInteger("status")==200){
            String obj = object.getString("obj");
            logger.info("obj:"+obj);
            JSONArray array = JSONArray.parseArray(obj.replace("[]","\"\"")).getJSONArray(0);
            logger.info("arrayResponse:"+array.toJSONString());
            for (int i=0;i<array.size();i++){
                JSONObject jsonObject = array.getJSONObject(i);
                logger.info("jsonObject:"+jsonObject);
                WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO = new WlyyPrescriptionEmrDO();
                wlyyPrescriptionEmrDO.setComplaint(null==jsonObject.get("CHIEF_COMPLAINT")?"":jsonObject.get("CHIEF_COMPLAINT").toString());
                wlyyPrescriptionEmrDO.setMedicalHistory(null==jsonObject.get("PRESENT_ILLNESS")?"":jsonObject.get("PRESENT_ILLNESS").toString());
                wlyyPrescriptionEmrDO.setPastHistory(null==jsonObject.get("PAST_HISTORY")?"":jsonObject.get("PAST_HISTORY").toString());
                wlyyPrescriptionEmrDO.setPhysicalExamination(null==jsonObject.get("PHYSICAL_EXAMINATION")?"":jsonObject.get("PHYSICAL_EXAMINATION").toString());
                wlyyPrescriptionEmrDO.setAssistExamination(null==jsonObject.get("OBSERVE_RESULT")?"":jsonObject.get("OBSERVE_RESULT").toString());
                wlyyPrescriptionEmrDO.setAllergicHistory(null==jsonObject.get("ALLERGY_HISTORY")?"":jsonObject.get("ALLERGY_HISTORY").toString());
                wlyyPrescriptionEmrDOList.add(wlyyPrescriptionEmrDO);
            if("[[]]".equalsIgnoreCase(obj)||"[]".equalsIgnoreCase(obj)||StringUtils.isBlank(obj)){
                return null;
            }else {
                logger.info("obj:" + obj);
                JSONArray array = JSONArray.parseArray(obj.replace("[]", "\"\"")).getJSONArray(0);
                logger.info("arrayResponse:" + array.toJSONString());
                for (int i = 0; i < array.size(); i++) {
                    JSONObject jsonObject = array.getJSONObject(i);
                    logger.info("jsonObject:" + jsonObject);
                    WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO = new WlyyPrescriptionEmrDO();
                    wlyyPrescriptionEmrDO.setComplaint(null == jsonObject.get("CHIEF_COMPLAINT") ? "" : jsonObject.get("CHIEF_COMPLAINT").toString());
                    wlyyPrescriptionEmrDO.setMedicalHistory(null == jsonObject.get("PRESENT_ILLNESS") ? "" : jsonObject.get("PRESENT_ILLNESS").toString());
                    wlyyPrescriptionEmrDO.setPastHistory(null == jsonObject.get("PAST_HISTORY") ? "" : jsonObject.get("PAST_HISTORY").toString());
                    wlyyPrescriptionEmrDO.setPhysicalExamination(null == jsonObject.get("PHYSICAL_EXAMINATION") ? "" : jsonObject.get("PHYSICAL_EXAMINATION").toString());
                    wlyyPrescriptionEmrDO.setAssistExamination(null == jsonObject.get("OBSERVE_RESULT") ? "" : jsonObject.get("OBSERVE_RESULT").toString());
                    wlyyPrescriptionEmrDO.setAllergicHistory(null == jsonObject.get("ALLERGY_HISTORY") ? "" : jsonObject.get("ALLERGY_HISTORY").toString());
                    wlyyPrescriptionEmrDOList.add(wlyyPrescriptionEmrDO);
                }
            }
        }
        return wlyyPrescriptionEmrDOList;
@ -3457,6 +3461,9 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
        List<WlyyPrescriptionEmrDO> wlyyPrescriptionEmrDOList = new ArrayList<>();
        if(object.getInteger("status")==200){
            String obj = object.getString("obj");
            if("[[]]".equalsIgnoreCase(obj)||"[]".equalsIgnoreCase(obj)||StringUtils.isBlank(obj)){
                return null;
            }else {
            logger.info("obj:"+obj);
            JSONArray array = JSONArray.parseArray(obj.replace("[]","\"\"")).getJSONArray(0);
            logger.info("arrayResponse:"+array.toJSONString());
@ -3475,6 +3482,7 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
                jsonArray.add(jsonObject);
            }
            return jsonArray;
            }
        }else {
            return null;
        }

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

@ -2194,7 +2194,62 @@ public class ImService {
			else if(status ==1){
				sql +=" and b.status = 10 ";
			}
			if (org.apache.commons.lang.StringUtils.isNotBlank(doctor)) {
				sql += " AND b.doctor='" + doctor + "' ";
			}
			if (!StringUtils.isEmpty(title)) {
				title = "%" + title + "%";
				sql += " and a.symptoms like '" + title + "'";
			}
			if (!StringUtils.isEmpty(start_time)) {
				if ("xm_ykyy_wx".equals(wxId)) {
					if (flag) {
						sql += " and a.czrq >= str_to_date('" + start_time + "','YYYY-MM-DD HH24:MI:SS')";
					} else {
						sql += " and a.czrq >= to_date('" + start_time + "','YYYY-MM-DD HH24:MI:SS')";
					}
				} else {
					sql += " and a.czrq >= '" + start_time + "'";
				}
			}
			if (!StringUtils.isEmpty(end_time)) {
				if ("xm_ykyy_wx".equals(wxId)) {
					if (flag) {
						sql += " and a.czrq <= str_to_date('" + end_time + "','YYYY-MM-DD HH24:MI:SS')";
					} else {
						sql += " and a.czrq <= to_date('" + end_time + "','YYYY-MM-DD HH24:MI:SS')";
					}
				} else {
					sql += " and a.czrq <= '" + end_time + "'";
				}
			}
			//咨询状态
			if (status != 0) {
				if (status == 2) {//就诊中
					sql += " and b.status = 0 ";
				} else if (status == 3) {
					sql += " and b.status = 1 ";
				} else {
				}
			}
			//咨询类型
			if (!StringUtils.isEmpty(type) && !type.equalsIgnoreCase("0")) {
				sql += " AND a.type in (" + type + ")";
			}
			if (!StringUtils.isEmpty(id)) {
				sql += " and a.id = '" + id + "'";
			}
			sql += " ORDER BY a.czrq desc ";
		}else {
			if (-1 == status&&(type.equalsIgnoreCase("0")||type.equalsIgnoreCase("9"))) {
				sql = "SELECT " +
@ -2391,7 +2446,11 @@ public class ImService {
				//咨询类型
				if (!StringUtils.isEmpty(type) && !type.equalsIgnoreCase("0")) {
					sql += " AND a.type in (" + type + ")";
					if("9".equalsIgnoreCase(type)){
						sql +=" AND a.type in (9,16)" ;
					}else {
						sql +=" AND a.type in ("+type+")" ;
					}
				}
				if (!StringUtils.isEmpty(id)) {
@ -2536,6 +2595,64 @@ public class ImService {
			else if(status ==1){
				sql +=" and b.status = 10 ";
			}
			if (org.apache.commons.lang.StringUtils.isNotBlank(doctor)){
				sql+=" AND b.doctor='"+doctor+"' ";
			}
			if(!StringUtils.isEmpty(title)){
				title="%"+title+"%";
				sql +=" and a.symptoms like '"+title+"'";
			}
			if(!StringUtils.isEmpty(start_time)){
				if("xm_ykyy_wx".equals(wxId)){
					if (flag){
						sql +=" and a.czrq >= str_to_date('"+start_time+"','YYYY-MM-DD HH24:MI:SS')";
					}else {
						sql +=" and a.czrq >= to_date('"+start_time+"','YYYY-MM-DD HH24:MI:SS')";
					}
				}else {
					sql +=" and a.czrq >= '"+start_time+"'";
				}
			}
			if(!StringUtils.isEmpty(end_time)){
				if("xm_ykyy_wx".equals(wxId)){
					if (flag){
						sql +=" and a.czrq <= str_to_date('"+end_time+"','YYYY-MM-DD HH24:MI:SS')";
					}else {
						sql +=" and a.czrq <= to_date('"+end_time+"','YYYY-MM-DD HH24:MI:SS')";
					}
				}else {
					sql +=" and a.czrq <= '"+end_time+"'";
				}
			}
			//咨询状态
			if(status != 0){
				if(status ==2 ){//就诊中
					sql +=" and b.status = 0 ";
				}else if(status ==3 ){
					sql +=" and b.status = 1 ";
				}else{}
			}
			//咨询类型
			if(!StringUtils.isEmpty(type)&&!type.equalsIgnoreCase("0")){
				sql +=" AND a.type in ("+type+")" ;
			}
			if (!StringUtils.isEmpty(id)) {
				sql += " and a.id = '" + id + "'";
			}
			sql += " ORDER BY a.czrq desc ";
		}else{
			if (-1 == status&&(type.equalsIgnoreCase("0")||type.equalsIgnoreCase("9"))) {
@ -2676,9 +2793,15 @@ public class ImService {
				//咨询类型
				if(!StringUtils.isEmpty(type)&&!type.equalsIgnoreCase("0")){
					sql +=" AND a.type in ("+type+")" ;
					if("9".equalsIgnoreCase(type)){
						sql +=" AND a.type in (9,16)" ;
					}else {
						sql +=" AND a.type in ("+type+")" ;
					}
				}
				if (!StringUtils.isEmpty(id)) {
					sql += " and a.id = '" + id + "'";
				}