liubing 3 years ago
parent
commit
ac0a3a02c8

+ 3 - 1
common/common-entity/sql记录

@ -1044,4 +1044,6 @@ ALTER table base_capacity_assessment_record add column age tinyint(4) default  C
ALTER TABLE base.base_doctor_patient_tmp MODIFY COLUMN  doctor_code varchar(50) DEFAULT NULL COMMENT 'type=(1,2,4为医生id) ';
ALTER TABLE base.base_doctor_patient_tmp ADD COLUMN org_code varchar(50) DEFAULT NULL COMMENT 'type=(3为机构code)';
ALTER TABLE base.base_doctor_patient_tmp ADD COLUMN org_code varchar(50) DEFAULT NULL COMMENT 'type=(3为机构code)';
ALTER TABLE base_security_monitoring_order add column scene_img VARCHAR(1000) default null COMMENT '工单发起时的现场照片';

+ 9 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/securitymonitoring/SecurityMonitoringOrderDO.java

@ -321,6 +321,7 @@ public class SecurityMonitoringOrderDO extends UuidIdentityEntityWithOperator {
    private Integer orderSource;//工单发起来源状态 1APP 2手环 3居家报警 4监控器发起
    private Integer emergencyCancel;// 紧急预警工单误报警原因 字典emergency_cancel
    private String topicItem;//安防工单所属专题 base_system_dict_entry表service_item
    private String sceneImg;//现场照片
    /**
     * 医生确认医生结束服务时间
@ -718,4 +719,12 @@ public class SecurityMonitoringOrderDO extends UuidIdentityEntityWithOperator {
    public void setTopicItem(String topicItem) {
        this.topicItem = topicItem;
    }
    public String getSceneImg() {
        return sceneImg;
    }
    public void setSceneImg(String sceneImg) {
        this.sceneImg = sceneImg;
    }
}

+ 19 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/doctor/DoctorEndpoint.java

@ -208,4 +208,23 @@ public class DoctorEndpoint extends EnvelopRestEndpoint {
            return ObjEnvelop.getError("查询失败");
        }
    }
    @GetMapping(value = "/getArchiveList")
    @ApiOperation(value = "管理员获取居民档案列表")
    public PageEnvelop getArchiveList(@ApiParam(name="type",value = "档案类型,1老人 2新生儿")
                                      @RequestParam(value = "type",required = false,defaultValue = "2")Integer type,
                                      @ApiParam(name = "signStatus",value = "签约状况 -1未签约,0全部,1已签约 ")
                                      @RequestParam(value = "signStatus",required = false,defaultValue = "0")Integer signStatus,
                                      @ApiParam(name = "page")
                                      @RequestParam(value = "page",required = true)Integer page,
                                      @ApiParam(name = "size")
                                      @RequestParam(value = "size",required = true)Integer size){
        try {
            return doctorService.getArchiveList(type, signStatus, page, size);
        }catch (Exception e){
            e.printStackTrace();
            return PageEnvelop.getError("查询失败");
        }
    }
}

+ 1 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/patient/PatientEndpoint.java

@ -249,4 +249,5 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
            return ObjEnvelop.getError("获取失败");
        }
    }
}

+ 30 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doctor/CareDoctorService.java

@ -423,4 +423,34 @@ public class CareDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
//        }
    }
    public PageEnvelop getArchiveList(Integer type,Integer signStatus,Integer page,Integer size){
        page = page>0?page-1:0;
        String countSql  ="select count(DISTINCT p.id)";
        String sql = "select DISTINCT p.id,p.name,p.sex,p.photo,p.idcard from base_patient p  ";
        String sqlCondition = "";
        if (null!=type){
            sqlCondition +=" and p.del=1 and p.archive_type="+type+" ";
        }
        if (null!=signStatus){
            if (-1==signStatus){//未签约
                sqlCondition +=" and NOT EXISTS(select sr.id from base_service_package_sign_record sr " +
                        " INNER JOIN base_service_package_record pr on sr.id = pr.sign_id and sr.status=1 " +
                        " INNER JOIN base_service_package pack on pr.service_package_id = pack.id and pack.del=1 " +
                        " where sr.patient = p.id) ";
            }
            if (1==signStatus){//已签约
                sqlCondition +=" and EXISTS(select sr.id from base_service_package_sign_record sr " +
                        " INNER JOIN base_service_package_record pr on sr.id = pr.sign_id and sr.status=1 " +
                        " INNER JOIN base_service_package pack on pr.service_package_id = pack.id and pack.del=1 " +
                        " where sr.patient = p.id) ";
            }
        }
        Long count = jdbcTemplate.queryForObject(countSql+sqlCondition,Long.class);
        sqlCondition +=" limit "+page*size+","+size;
        List<Map<String,Object>> result = jdbcTemplate.queryForList(sql+sqlCondition);
        return PageEnvelop.getSuccessListWithPage("查询成功",result,page,size,count);
    }
}

+ 3 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/security/SecurityMonitoringOrderService.java

@ -295,6 +295,9 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
            map.put("inFenceStatus",false);
            map.put("inFenceName","疑似超出安全区域");
            emergencyOrderVO.setInformation(map);
        }
        if(4==orderDO.getOrderSource()){//todo 监控画面
        }
        //通知对象
        List<Map<String,Object>> noticePersons = new ArrayList<>();

+ 9 - 0
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/service/YsDeviceService.java

@ -77,6 +77,7 @@ public class YsDeviceService {
            JSONArray tmpArr = result.getJSONObject("eps").getJSONArray("alert");
            boolean fallFlag = false;
            String deviceSN = null;
            String sceneUrl = "";
            for (int i=0;i<tmpArr.size();i++){
                JSONObject tmpObj = tmpArr.getJSONObject(i);
                String msgType = tmpObj.getString("msgType");
@ -94,6 +95,13 @@ public class YsDeviceService {
                                if ("tumble_detection".equals(alarmType)){//tumble_detection跌倒类型    //有人出现SmartHumanDet
                                    fallFlag = true;
                                    deviceSN = bodyJsonObj2.getString("devSerial");//设备SN
                                    if (bodyJsonObj2.containsKey("pictureList")&&bodyJsonObj2.getJSONArray("pictureList")!=null){
                                        JSONArray pictureList = bodyJsonObj2.getJSONArray("pictureList");
                                        if (pictureList.size()>0){
                                            JSONObject tmp = pictureList.getJSONObject(0);
                                            sceneUrl = tmp.getString("url");//现场照片
                                        }
                                    }
                                }
                            }
                        }
@ -135,6 +143,7 @@ public class YsDeviceService {
                    jsonObject.put("serveLat",lat);
                    jsonObject.put("serveLon",lon);
                    jsonObject.put("topicItem","preventFall");
                    jsonObject.put("sceneImg",sceneUrl);
                    JSONObject jsonObjectParam = new JSONObject();
                    jsonObjectParam.put("order", jsonObject);
                    map.put("jsonData", jsonObjectParam.toJSONString());