Преглед изворни кода

患者端--档案接口完善

hzp пре 8 година
родитељ
комит
a18dd915cd

+ 28 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/archives/PatientEventService.java

@ -55,6 +55,28 @@ public class PatientEventService {
        return re;
    }
    /**
     * 删除就诊事件
     */
    @Transactional
    public void deleteEvent(String id) throws Exception
    {
        Long eventId =Long.valueOf(id);
        PatientEvent event = patientEventDao.findOne(eventId);
        if(event!=null)
        {
            List<PatientEventImg> list = patientEventImgDao.findByEventId(eventId);
            if(list!=null && list.size()>0)
            {
                patientEventImgDao.delete(list);
            }
            patientEventDao.delete(event);
        }
        else{
            throw new Exception("不存在该就诊事件!");
        }
    }
    /**
     * 保存就诊事件详情
     */
@ -65,7 +87,12 @@ public class PatientEventService {
        PatientEvent event = new PatientEvent();
        if(!StringUtils.isEmpty(json.optString("id")))
        {
            event.setId(json.getLong("id"));
            //判断是否存在
            event =patientEventDao.findOne(json.getLong("id"));
            if(event==null)
            {
                throw new Exception("不存在该就诊事件!");
            }
        }
        else{
            event.setCreateTime(new Date());

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

@ -216,10 +216,11 @@ public class PatientRecordService {
        String response = jwSmjkService.getExamAndLabReport(patient.getSsc(), page, pageSize);     //【基卫接口】
        //获取app数据
        String sql = "select a.*,b.img_type as catalog,GROUP_CONCAT(b.img_label) as label from wlyy_patient_event a\n" +
                "left join wlyy_patient_event_img b on b.event_id=a.id and b.img_type in ('检查报告','检验报告')\n" +
                "where a.patient='" + patientCode + "'\n" +
                "group by b.img_type order by a.event_date desc";
        String sql = "select a.*,b.img_type as catalog,GROUP_CONCAT(b.img_label) as label \n" +
                "from wlyy_patient_event a,wlyy_patient_event_img b\n" +
                "where a.patient='"+patientCode+"' and b.event_id=a.id and b.img_type in ('检查报告','检验报告')  \n" +
                "group by b.event_id,b.img_type order by a.event_date desc";
        List<Map<String, Object>> appList = jdbcTemplate.queryForList(sql);
        if (!StringUtils.isEmpty(response)) {
@ -246,7 +247,7 @@ public class PatientRecordService {
                re.add(map);
            }
            //*******过滤
            //过滤
            for (Map<String, Object> item : appList) {
                Map<String, String> map = new HashMap<>();
                map.put("id", item.get("id").toString());
@ -269,7 +270,8 @@ public class PatientRecordService {
            //排序
            re = sortMapList(re, "eventDate", "DESC");
        } else {
        }
        else {
            for (Map<String, Object> item : appList) {
                Map<String, String> map = new HashMap<>();
                map.put("id", String.valueOf(item.get("id")));

+ 14 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/archives/PatientArchivesController.java

@ -123,7 +123,7 @@ public class PatientArchivesController extends WeixinBaseController {
                                    @RequestParam(value="pageSize",required = true) String pageSize)
    {
        try {
            List<Map<String,String>> result = patientRecordService.getExamAndLabReport(getUID(), page, pageSize);
            List<Map<String,String>> result = patientRecordService.getExamAndLabReport("P20161008001", page, pageSize);
            return write(200, "获取检查检验报告成功!", "data", result);
        } catch (Exception e) {
@ -162,7 +162,20 @@ public class PatientArchivesController extends WeixinBaseController {
        }
    }
    @RequestMapping(value = "/event/delete", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("删除就诊事件")
    public String deleteEvent(@ApiParam(name="event",value="就诊事件id",defaultValue = "")
                                  @RequestParam(value="event",required = true) String event)
    {
        try {
            patientEventService.deleteEvent(event);
            return write(200, "删除就诊事件成功!");
        } catch (Exception e) {
            return invalidUserException(e, -1, "删除就诊事件失败!");
        }
    }
    @RequestMapping(value = "/event/uploadImg", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody