zhengwei il y a 6 ans
Parent
commit
b9dcd81cd0

+ 10 - 2
src/main/java/com/yihu/quota/service/medicalInsurance/MedicalInsuranceService.java

@ -45,20 +45,28 @@ public class MedicalInsuranceService {
        StringBuffer sb = new StringBuffer();
        String start = month+"-01T00:00:00Z";
        String end = DateUtil.getLastDate(month+"-01","yyyy-MM-dd","yyyy-MM-dd")+"T23:59:59Z";
        String[] subfields = new String[3];
        if("0".equals(eventType)){
            fee=3000;
            sb.append("EHR_000045:[").append(fee).append(" TO *]").append(" AND event_date:[")
                    .append(start).append(" TO ").append(end).append("]");
            subfields[0]="EHR_000045";
            subfields[1]="EHR_000109_VALUE";
            subfields[2]="profile_id";
        }else{
            fee=20000;
            sb.append("EHR_000175:[").append(fee).append(" TO *]").append(" AND event_date:[")
                    .append(start).append(" TO ").append(end).append("]");
            subfields[0]="EHR_000175";
            subfields[1]="EHR_000293_VALUE";
            subfields[2]="profile_id";
        }
        SolrDocumentList sublist = solrUtil.query(ResourceCore.SubTable,q,sb.toString(),null,(page-1)*size,size);
        String[] fields = {"rowkey","patient_name","patient_age","patient_sex","demographic_id","EHR_001211","event_date"};
        SolrDocumentList sublist = solrUtil.query(ResourceCore.SubTable,q,sb.toString(),null,(page-1)*size,size,subfields);
        if(sublist!=null && sublist.getNumFound()>0){
            for (SolrDocument doc : sublist){
                String q1="rowkey:"+doc.getFieldValue("profile_id");
                SolrDocumentList list = solrUtil.query(ResourceCore.MasterTable,q1,null,null,0,1);
                SolrDocumentList list = solrUtil.query(ResourceCore.MasterTable,q1,null,null,0,1,fields);
                doc.putAll(list.get(0));
            }
        }