소스 검색

Merge branch 'dev' of huangzhanpeng/wlyy_management into dev

lyr 8 년 전
부모
커밋
010389635c

+ 77 - 36
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/archives/PatientRecordService.java

@ -206,7 +206,7 @@ public class PatientRecordService {
    /**
     * 获取检查检验列表
     */
    public List<Map<String, String>> getExamAndLabReport(String patientCode, String page, String pageSize) throws Exception {
    public List<Map<String, String>> getExamAndLabReport(String patientCode, String page, String pageSize, String lastTime) throws Exception {
        List<Map<String, String>> re = new ArrayList<>();
        //获取患者
@ -227,12 +227,22 @@ public class PatientRecordService {
        List<Map<String, Object>> appList = jdbcTemplate.queryForList(sql);
        if (!StringUtils.isEmpty(response)) {
        if (!StringUtils.isEmpty(response) && !"[{}]".equals(response)) {
            JSONArray array = new JSONArray(response);
            String max = "";
            String min = "";
            for (int i = 0; i < array.length(); i++) {
                JSONObject item = array.getJSONObject(i);
                Map<String, String> map = new HashMap<>();
                if (i == 0) //最大值
                {
                    max = item.optString("END_TIME");
                } else if (i == array.length() - 1) //最小值
                {
                    min = item.optString("END_TIME");
                }
                map.put("id", item.optString("EVENT"));
                map.put("patient", patientCode);
                map.put("eventDate", item.optString("END_TIME"));
@ -257,46 +267,72 @@ public class PatientRecordService {
            //过滤
            for (Map<String, Object> item : appList) {
                Map<String, String> map = new HashMap<>();
                map.put("id", item.get("id").toString());
                map.put("patient", patientCode);
                map.put("eventDate", DateUtil.dateToStrLong((Date) item.get("event_date")));
                String type = "";
                if ("检验报告".equals(item.get("catalog"))) {
                    type = "检验";
                } else if ("检查报告".equals(item.get("catalog"))) {
                    type = "检查";
                String eventDate = DateUtil.dateToStrLong((Date) item.get("event_date"));
                int maxCompare = eventDate.compareTo(max);
                int minCompare = eventDate.compareTo(min);
                Boolean contain = false;
                if (maxCompare < 0 && minCompare >= 0)       //时间范围内
                {
                    contain = true;
                }
                //第一页特殊处理
                if ("1".equals(page) && maxCompare >= 0) {
                    contain = true;
                }
                //最后一页特殊处理
                if (!"1".equals(page) && (array.length() == 0 || "[{}]".equals(response)) && !StringUtils.isEmpty(lastTime)) {
                    int lastTimeCompare = eventDate.compareTo(lastTime);
                    if (lastTimeCompare < 0) {
                        contain = true;
                    }
                }
                if (contain) {
                    Map<String, String> map = new HashMap<>();
                    map.put("id", item.get("id").toString());
                    map.put("patient", patientCode);
                    map.put("eventDate", eventDate);
                    String type = "";
                    if ("检验报告".equals(item.get("catalog"))) {
                        type = "检验";
                    } else if ("检查报告".equals(item.get("catalog"))) {
                        type = "检查";
                    }
                    map.put("type", type);
                    map.put("catalogCode", "");
                    map.put("serial", "");
                    map.put("orgName", String.valueOf(item.get("org_name")));
                    map.put("label", String.valueOf(item.get("label"))); //检测项目
                    map.put("dataFrom", "2");//基卫数据
                    re.add(map);
                }
                map.put("type", type);
                map.put("catalogCode", "");
                map.put("serial", "");
                map.put("orgName", String.valueOf(item.get("org_name")));
                map.put("label", String.valueOf(item.get("label"))); //检测项目
                map.put("dataFrom", "2");//基卫数据
                re.add(map);
            }
            //排序
            re = sortMapList(re, "eventDate", "DESC");
        } else {
            for (Map<String, Object> item : appList) {
                Map<String, String> map = new HashMap<>();
                map.put("id", String.valueOf(item.get("id")));
                map.put("patient", patientCode);
                map.put("eventDate", DateUtil.dateToStrLong((Date) item.get("event_date")));
                String type = "";
                if ("检验报告".equals(item.get("catalog"))) {
                    type = "检验";
                } else if ("检查报告".equals(item.get("catalog"))) {
                    type = "检查";
            if ("1".equals(page)) {
                for (Map<String, Object> item : appList) {
                    Map<String, String> map = new HashMap<>();
                    map.put("id", String.valueOf(item.get("id")));
                    map.put("patient", patientCode);
                    map.put("eventDate", DateUtil.dateToStrLong((Date) item.get("event_date")));
                    String type = "";
                    if ("检验报告".equals(item.get("catalog"))) {
                        type = "检验";
                    } else if ("检查报告".equals(item.get("catalog"))) {
                        type = "检查";
                    }
                    map.put("type", type);
                    map.put("catalogCode", "");
                    map.put("serial", "");
                    map.put("orgName", String.valueOf(item.get("org_name")));
                    map.put("label", String.valueOf(item.get("label"))); //检测项目
                    map.put("dataFrom", "2");//基卫数据
                    re.add(map);
                }
                map.put("type", type);
                map.put("catalogCode", "");
                map.put("serial", "");
                map.put("orgName", String.valueOf(item.get("org_name")));
                map.put("label", String.valueOf(item.get("label"))); //检测项目
                map.put("dataFrom", "2");//基卫数据
                re.add(map);
            }
        }
@ -310,7 +346,12 @@ public class PatientRecordService {
    public String getDrugsListPage(String patientCode, String page, String pageSize) throws Exception {
        //获取患者
        Patient patient = patientDao.findByCode(patientCode);
        return jwSmjkService.getDrugsListPage(patient.getSsc(), page, pageSize);
        String response = jwSmjkService.getDrugsListPage(patient.getSsc(), page, pageSize);
        if ("[{}]".equals(response)) {
            response = "[]";
        }
        return response;
    }

+ 4 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/archives/DoctorArchivesController.java

@ -118,10 +118,12 @@ public class DoctorArchivesController extends BaseController {
                                @ApiParam(name="page",value="第几页",defaultValue = "1")
                                @RequestParam(value="page",required = true) String page,
                                @ApiParam(name="pageSize",value="每页几行",defaultValue = "10")
                                @RequestParam(value="pageSize",required = true) String pageSize)
                                @RequestParam(value="pageSize",required = true) String pageSize,
                                @ApiParam(name="lastTime",value="最后一条时间",defaultValue = "2010-10-10 00:00:00")
                                    @RequestParam(value="lastTime",required = false) String lastTime)
    {
        try {
            List<Map<String,String>> result = patientRecordService.getExamAndLabReport(patient, page, pageSize);
            List<Map<String,String>> result = patientRecordService.getExamAndLabReport(patient, page, pageSize,lastTime);
            return write(200, "获取检查检验报告成功!", "data", result);
        } catch (Exception e) {

+ 4 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/archives/PatientArchivesController.java

@ -121,10 +121,12 @@ public class PatientArchivesController extends WeixinBaseController {
    public String getReportList(@ApiParam(name="page",value="第几页",defaultValue = "1")
                                    @RequestParam(value="page",required = true) String page,
                                @ApiParam(name="pageSize",value="每页几行",defaultValue = "10")
                                    @RequestParam(value="pageSize",required = true) String pageSize)
                                    @RequestParam(value="pageSize",required = true) String pageSize,
                                @ApiParam(name="lastTime",value="最后一条时间",defaultValue = "2010-10-10 00:00:00")
                                    @RequestParam(value="lastTime",required = false) String lastTime)
    {
        try {
            List<Map<String,String>> result = patientRecordService.getExamAndLabReport(getUID(), page, pageSize);
            List<Map<String,String>> result = patientRecordService.getExamAndLabReport(getUID(), page, pageSize,lastTime);
            return write(200, "获取检查检验报告成功!", "data", result);
        } catch (Exception e) {

+ 4 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/OpenApiSmjkController.java

@ -118,10 +118,12 @@ public class OpenApiSmjkController extends BaseController {
								@ApiParam(name="page",value="第几页",defaultValue = "1")
								@RequestParam(value="page",required = true) String page,
								@ApiParam(name="pageSize",value="每页几行",defaultValue = "10")
								@RequestParam(value="pageSize",required = true) String pageSize)
								@RequestParam(value="pageSize",required = true) String pageSize,
								@ApiParam(name="lastTime",value="最后一条时间",defaultValue = "2010-10-10 00:00:00")
									@RequestParam(value="lastTime",required = false) String lastTime)
	{
		try {
			List<Map<String,String>> result = patientRecordService.getExamAndLabReport(patient, page, pageSize);
			List<Map<String,String>> result = patientRecordService.getExamAndLabReport(patient, page, pageSize,lastTime);
			return write(200, "获取检查检验报告成功!", "data", result);
		} catch (Exception e) {