Переглянути джерело

Merge branch 'dev' of liuwenbin/patient-co-management into dev

liuwenbin 7 роки тому
батько
коміт
0e26dbd3c1

+ 4 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionDispensaryCodeService.java

@ -16,6 +16,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@ -65,7 +66,7 @@ public class PrescriptionDispensaryCodeService extends BaseService {
            }
        }
        List<Object> params = new ArrayList<>();//p2.*,p1.diagnosis as diagnosis ,p3.address as address
        String precriptionSql = "select p1.status , p1.diagnosis ,p3.address as address,p2.prescription_code as prescriptionCode,p2.code as dispensaryCode,p2.type  from wlyy_prescription_dispensary_code p2 " +
        String precriptionSql = "select p1.status , p1.diagnosis ,p3.address as address,p2.prescription_code as prescriptionCode,p2.code as dispensaryCode,p2.type,p1.create_time as createTime  from wlyy_prescription_dispensary_code p2 " +
                " left join  wlyy_prescription p1 on p2.prescription_code=p1.code LEFT JOIN wlyy_prescription_expressage p3 on p1.code=p3.prescription_code where p1.patient=? and p2.type=?  ";
        params.add(patientCode);
        params.add(type);
@ -89,9 +90,11 @@ public class PrescriptionDispensaryCodeService extends BaseService {
        precriptionSql += " limit "+(page-1)*pagesize+","+pagesize;
        List<Map<String, Object>> result = jdbcTemplate.queryForList(precriptionSql,params.toArray());
        List<Map<String, Object>> result2 = new ArrayList<>();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        for (Map<String, Object> m:result) {
            List<PrescriptionInfo> list = prescriptionInfoDao.findByPrescriptionCode(m.get("prescriptionCode").toString());
            m.put("prescriptionInfo",list);
            m.put("createTime",m.get("createTime")!=null?simpleDateFormat.format(m.get("createTime")):"");
            result2.add(m);
        }
        JSONArray array = new JSONArray(result2);