瀏覽代碼

代码修改

liubing 3 年之前
父節點
當前提交
ea2eab4a7e

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/doctor/admin/AdminListInfoController.java

@ -52,7 +52,7 @@ public class AdminListInfoController extends EnvelopRestEndpoint {
                return ObjEnvelop.getError("该操作没有权限");
            }
            return ObjEnvelop.getSuccess("查询成功",patientInfoPlatFormService.getPatientDeviceInfoWithDetail(patient));
            return ObjEnvelop.getSuccess("查询成功",patientInfoPlatFormService.getPatientDeviceInfoWithDetail(patient,null));
        }catch (Exception e){
            return failedObjEnvelopException2(e);
        }

+ 5 - 3
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/third/platForm/PatientInfoPlatFormEndpoint.java

@ -138,10 +138,12 @@ public class PatientInfoPlatFormEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = "getPatientDeviceInfoWithDetail")
    @ApiOperation("获取居民设备列表(带设备电量、预警情况、是否在线等信息)")
    public ObjEnvelop getPatientDeviceInfoWithDetail(@ApiParam(name="patient",value = "居民id",required = true)
                                        @RequestParam(value = "patient")String patient){
    public ObjEnvelop getPatientDeviceInfoWithDetail(@ApiParam(name="patient",value = "居民id",required = false)
                                                     @RequestParam(value = "patient")String patient,
                                                     @ApiParam(name="deviceSn",value = "设备SN",required = false)
                                                     @RequestParam(value = "deviceSn")String deviceSn){
        try {
            return ObjEnvelop.getSuccess("查询成功",patientInfoPlatFormService.getPatientDeviceInfoWithDetail(patient));
            return ObjEnvelop.getSuccess("查询成功",patientInfoPlatFormService.getPatientDeviceInfoWithDetail(patient,deviceSn));
        }catch (Exception e){
            return failedObjEnvelopException2(e);
        }

+ 13 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/third/PatientInfoPlatFormService.java

@ -691,9 +691,20 @@ public class PatientInfoPlatFormService {
    /**
     *获取设备详情
     */
    public List<Map<String,Object>> getPatientDeviceInfoWithDetail(String patient){
    public List<Map<String,Object>> getPatientDeviceInfoWithDetail(String patient,String deviceSn){
        List<Map<String,Object>>  list = new ArrayList<>();
        list = patientDeviceService.patientDeviceListByTopic(patient,null);
        String sql = "select dd.photo,pd.device_sn,dd.brands,dd.category_code,dd.model,pd.device_name,date_format(pd.czrq,'%Y-%m-%d %H:%i:%S' ) deviceTime,dd.device_type as deviceType " +
                "from dm_device dd INNER JOIN wlyy_patient_device pd on dd.category_code = pd.category_code INNER JOIN wlyy_devices wd on dd.model = wd.device_model and pd.device_sn = wd.device_code \n" +
                "where 1=1 and  pd.del=0 ";
        if (org.apache.commons.lang3.StringUtils.isNotBlank(patient)) {
            sql += " and  pd.`user`='" + patient + "' ";
        }
        if (org.apache.commons.lang3.StringUtils.isNotBlank(deviceSn)){
            sql += " and pd.device_sn = '"+deviceSn+"' ";
        }
        sql+=" order by pd.czrq asc ";
        list =  jdbcTemplate.queryForList(sql);
        for (Map<String,Object> tmp :list){
            String category_code = tmp.get("category_code").toString();
            String deviceSN = tmp.get("device_sn").toString();