Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

yeshijie 3 years ago
parent
commit
53ff553fcd

+ 3 - 3
common/common-entity/src/main/java/com/yihu/jw/entity/care/contacts/PatientSosContactsDO.java

@ -19,7 +19,7 @@ public class PatientSosContactsDO extends IdEntity {
    private String patient;
    private String sosName; //紧急联系人
    private String sosPhone; //联系电话
    private String relation; //与联系人关系 同base_patient_family_member
    private Integer relation; //与联系人关系 同base_patient_family_member
    private Date updateTime; //修改日期
    private Integer successFlag;//联系人是否同步成功 -2删除失败 -1添加失败 0待同步 1添加成功 2删除成功
    private Integer del;
@ -51,11 +51,11 @@ public class PatientSosContactsDO extends IdEntity {
        this.sosPhone = sosPhone;
    }
    public String getRelation() {
    public Integer getRelation() {
        return relation;
    }
    public void setRelation(String relation) {
    public void setRelation(Integer relation) {
        this.relation = relation;
    }

+ 31 - 23
common/common-util/src/main/java/com/yihu/jw/util/healthIndex/HealthIndexUtil.java

@ -54,17 +54,19 @@ public class HealthIndexUtil {
            int index = Integer.valueOf(values[1]);
            String value1 = values[0];
            // 餐后
            if (index % 2 == 0) {
                tmp.put("value1",value1);
                tmp.put("indexName","血糖");
                tmp.put("error",checkHealthIndex(NumberUtils.toDouble(value1), maxValueAfter, minValueAfter));
            if (StringUtils.isNotBlank(value1)){
                if (index % 2 == 0) {
                    tmp.put("value1",value1);
                    tmp.put("indexName","血糖");
                    tmp.put("error",checkHealthIndex(NumberUtils.toDouble(value1), maxValueAfter, minValueAfter));
            } else { //餐前
                tmp.put("value1",value1);
                tmp.put("indexName","血糖");
                tmp.put("error",checkHealthIndex(NumberUtils.toDouble(value1), maxValueBefore, minValueBefore));
                } else { //餐前
                    tmp.put("value1",value1);
                    tmp.put("indexName","血糖");
                    tmp.put("error",checkHealthIndex(NumberUtils.toDouble(value1), maxValueBefore, minValueBefore));
                }
                result.add(tmp);
            }
            result.add(tmp);
        }
        //血压校验
        else if (type == 2) {
@ -78,17 +80,21 @@ public class HealthIndexUtil {
            Double maxValueSZY = HEALTH_STANDARD_SZY_MAX;
            Double minValueSZY = HEALTH_STANDARD_SZY_MIN;
            // 收缩压/舒张压校验
            tmp.put("value1",value1);
            tmp.put("indexName","收缩压");
            tmp.put("error",checkHealthIndex(NumberUtils.toDouble(value1), maxValueSSY, minValueSSY));
            result.add(tmp);
            if (StringUtils.isNotBlank(value1)){
                tmp.put("value1",value1);
                tmp.put("indexName","收缩压");
                tmp.put("error",checkHealthIndex(NumberUtils.toDouble(value1), maxValueSSY, minValueSSY));
                result.add(tmp);
            }
            //舒张压校验
            tmp = new JSONObject();
            tmp.put("value1",value2);
            tmp.put("indexName","舒张压");
            tmp.put("error",checkHealthIndex(NumberUtils.toDouble(value2), maxValueSZY, minValueSZY));
            result.add(tmp);
            tmp = new JSONObject();
            if (StringUtils.isNotBlank(value2)){
                tmp = new JSONObject();
                tmp.put("value1",value2);
                tmp.put("indexName","舒张压");
                tmp.put("error",checkHealthIndex(NumberUtils.toDouble(value2), maxValueSZY, minValueSZY));
                result.add(tmp);
                tmp = new JSONObject();
            }
            //脉搏检验
            if (StringUtils.isNotBlank(value3)){
                tmp.put("value1",value3);
@ -99,10 +105,12 @@ public class HealthIndexUtil {
        }
        else if (type == 5) {//心率
            String value1 = values[0];//心率
            tmp.put("value1",value1);
            tmp.put("indexName","心率");
            tmp.put("error",checkHealthIndex(NumberUtils.toDouble(value1), HEALTH_STANDARD_HEART_RATE_MAX, HEALTH_STANDARD_HEART_RATE_MIN));
            result.add(tmp);
            if (StringUtils.isNotBlank(value1)){
                tmp.put("value1",value1);
                tmp.put("indexName","心率");
                tmp.put("error",checkHealthIndex(NumberUtils.toDouble(value1), HEALTH_STANDARD_HEART_RATE_MAX, HEALTH_STANDARD_HEART_RATE_MIN));
                result.add(tmp);
            }
        }
        return result;
    }

+ 40 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/PatientDeviceController.java

@ -9,6 +9,7 @@ import com.yihu.jw.care.service.device.PatientHealthIndexService;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.care.device.DevicePatientDevice;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.web.ListEnvelop;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -303,4 +304,43 @@ public class PatientDeviceController extends BaseController {
            return errorResult(e);
        }
    }
    @ApiOperation("获取设备详情信息")
    @RequestMapping(value = "getPatientDeviceDetail",method = RequestMethod.GET)
    public String getPatientDeviceDetail(@ApiParam(name="patient")
                                         @RequestParam(value = "patient")String patient,
                                         @ApiParam(name="deviceSN")
                                         @RequestParam(value = "deviceSN")String deviceSn){
        try {
            JSONObject result = patientDeviceService.getPatientDeviceDetail(patient,deviceSn);
            if (result.getInt(ResponseContant.resultFlag)==ResponseContant.success){
                return write(200,"获取成功","data",result.getJSONObject(ResponseContant.resultMsg));
            }else {
                return error(-1,result.getString(ResponseContant.resultMsg));
            }
        }catch (Exception e){
            return errorResult(e);
        }
    }
    @ApiOperation("获取设备详情信息")
    @RequestMapping(value = "getPatientDeviceData",method = RequestMethod.GET)
    public String getPatientDeviceData(@ApiParam(name="patient")
                                       @RequestParam(value = "patient")String patient,
                                       @ApiParam(name="deviceSN")
                                       @RequestParam(value = "deviceSN")String deviceSn,
                                       @ApiParam(name="page")
                                       @RequestParam(value = "page")Integer page,
                                       @ApiParam(name="pageSize")
                                       @RequestParam(value = "pageSize")Integer pageSize){
        try {
            return write(200,"获取成功","data",patientDeviceService.getPatientDeviceData(patient,deviceSn,page,pageSize));
        }catch (Exception e){
            return errorResult(e);
        }
    }
}

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

@ -0,0 +1,39 @@
package com.yihu.jw.care.endpoint.patient;
import com.yihu.jw.care.service.patient.OnlineContactService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/***
 * @ClassName: OnlineContactEndpoint
 * @Description: 在线联系
 * @Auther: shi kejing
 * @Date: 2021/8/11 16:43
 */
@RestController
@RequestMapping("online" )
@Api(tags = "在线联系", description = "在线联系")
public class OnlineContactEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private OnlineContactService service;
    @GetMapping(value = "getOnLineObj")
    @ApiOperation(value = "获取在线联系")
    public Envelop getOnLineObj(
            @ApiParam(name = "patient", value = "居民id") @RequestParam(value = "patient", required = true) String patient) {
        try{
            return success("获取成功",service.getOnLineObj(patient));
        }catch (Exception e){
            return failedException2(e);
        }
    }
}

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/assistance/EmergencyAssistanceService.java

@ -969,7 +969,7 @@ public class EmergencyAssistanceService extends BaseJpaService<EmergencyAssistan
        String sql = " select '20' as OrderType,ord.id,ord.doctor,ord.status,p.name,'紧急呼叫' as serve_desc,DATE_FORMAT(ord.create_time,'%Y-%m-%d %H:%i:%S') create_time" +
                " from base_emergency_assistance_order ord INNER JOIN base_doctor p on ord.doctor = p.id where ord.doctor='"+doctor+"'" ;
        sql +="UNION " +
                "select  '22' as 'OrderType',ord.id,ord.doctor,p.name,ord.status,ord.serve_desc,DATE_FORMAT(ord.create_time,'%Y-%m-%d %H:%i:%S') create_time " +
                "select  '22' as 'OrderType',ord.id,ord.doctor,ord.status,p.name,ord.serve_desc,DATE_FORMAT(ord.create_time,'%Y-%m-%d %H:%i:%S') create_time " +
                "from base_security_monitoring_order ord INNER JOIN base_doctor p on ord.doctor = p.id  where ord.doctor='"+doctor+"'" ;
        String countSql = "select count(id) from ("+sql+")A ";
        long count = jdbcTemplate.queryForObject(countSql,long.class);

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/contacts/ContactsService.java

@ -282,7 +282,7 @@ public class ContactsService {
                contactsDO.setPatient(patient);
                contactsDO.setSosName(name);
                contactsDO.setSosPhone(num);
                contactsDO.setRelation(relation);
                contactsDO.setRelation(Integer.parseInt(relation));
                contactsDO.setSuccessFlag(0);
                sosContactsDao.save(contactsDO);
            }

+ 142 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/device/PatientDeviceService.java

@ -1,10 +1,13 @@
package com.yihu.jw.care.service.device;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.yihu.jw.care.config.AqgConfig;
import com.yihu.jw.care.dao.device.DeviceDao;
import com.yihu.jw.care.dao.device.DeviceDetailDao;
import com.yihu.jw.care.dao.device.PatientDeviceDao;
import com.yihu.jw.care.service.contacts.ContactsService;
import com.yihu.jw.care.service.wechat.WeiXinAccessTokenUtils;
import com.yihu.jw.care.util.ConcealUtil;
import com.yihu.jw.care.util.MyJdbcTemplate;
@ -15,9 +18,12 @@ import com.yihu.jw.entity.care.device.Device;
import com.yihu.jw.entity.care.device.DeviceDetail;
import com.yihu.jw.entity.care.device.DevicePatientDevice;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.util.common.GpsUtil;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.healthIndex.HealthIndexUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.collections.map.HashedMap;
@ -79,6 +85,8 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
    private StringRedisTemplate redisTemplate;
    @Autowired
    private HttpClientUtil httpClientUtil;
    @Autowired
    private YsDeviceService ysDeviceService;
    @Autowired
    WeiXinAccessTokenUtils tokenUtils;
@ -91,6 +99,10 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
    private String esIndex;
    @Autowired
    private GpsUtil gpsUtil;
    @Autowired
    private ContactsService contactsService;
    @Autowired
    private HealthIndexUtil healthIndexUtil;
    @PostConstruct
    public void init() {
@ -761,13 +773,141 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
        return resultMap;
    }
    /**
     * 根据设备sn及居民code获取居民有效的设备绑定信息
     * @param deviceSn 设备sn码
     * @return
     */
    public JSONObject getPatientDeviceDetail(String patient,String deviceSn){
        JSONObject result = new JSONObject();
        BasePatientDO patientDO = patientDao.findById(patient);
        if (null==patientDO){
            result.put(ResponseContant.resultFlag,ResponseContant.fail);
            result.put(ResponseContant.resultMsg,"当前居民不存在");
        }
        List<DevicePatientDevice> devices = patientDeviceDao.findByDeviceSn(deviceSn);
        if (devices.size()==0){
            result.put(ResponseContant.resultFlag,ResponseContant.fail);
            result.put(ResponseContant.resultMsg,"未查询到该设备");
        }else {
            DevicePatientDevice device = devices.get(0);
            if (!patient.equals(device.getUser())){
                result.put(ResponseContant.resultFlag,ResponseContant.fail);
                result.put(ResponseContant.resultMsg,"居民未绑定该设备");
            }else {
                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 " +
                        "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 and pd.device_sn ='"+deviceSn+"' ";
                Map<String,Object> devInfo = jdbcTemplate.queryForMap(sql);
                devInfo.put("patient",patient);
                devInfo.put("patientName",patientDO.getName());
                devInfo.put("sosContactsDOS",new ArrayList<>());
                if ("4".equals(device.getCategoryCode())||"7".equals(device.getCategoryCode())){
                    devInfo.put("sosContactsDOS",contactsService.getPatientSosContacts(patient));
                }
                result.put(ResponseContant.resultFlag,ResponseContant.success);
                result.put(ResponseContant.resultMsg,JSON.parseObject(JSON.toJSONString(devInfo, SerializerFeature.WriteMapNullValue)));
            }
        }
        return result;
    }
    /**
     * 根据设备sn及居民code获取居民有效的设备绑定数据
     * @param deviceSn 设备sn码
     * @return
     */
    public List<DevicePatientDevice> findByDeviceSn(String deviceSn){
       return  patientDeviceDao.findByDeviceSn(deviceSn);
    public JSONObject getPatientDeviceData(String patient,String deviceSn,Integer page,Integer pageSize)throws Exception{
        page = page>0?page-1:0;
        JSONObject result = new JSONObject();
        List<DevicePatientDevice> devices = patientDeviceDao.findByDeviceSn(deviceSn);
        if (devices.size()>0){
            DevicePatientDevice device = devices.get(0);
            if (!patient.equals(device.getUser())){
                throw new Exception("居民未绑定该设备");
            }else{
                switch (device.getCategoryCode()){
                    case "1"://血压设备
                        result = getHealthIndex(result,deviceSn,patient,page,pageSize);
                        break;
                    case "2"://血糖设备
                        result = getHealthIndex(result,deviceSn,patient,page,pageSize);
                        break;
                    case "4"://手表 紧急工单与安防工单
                        result = getEmeWarn(result,deviceSn,patient,page,pageSize);
                        break;
                    case "7"://报警器 紧急工单
                        result = getEmeWarn(result,deviceSn,patient,page,pageSize);
                        break;
                    case "12"://监控
                        com.alibaba.fastjson.JSONObject tmp =ysDeviceService.getDeviceLiveAddress(patient,deviceSn,1,null);
                        result.put("monitorInfoStatus",tmp.getIntValue(ResponseContant.resultFlag));
                        if (tmp.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail){
                            result.put("monitorInfo",tmp.getString(ResponseContant.resultMsg));
                        }
                        else {
                            result.put("monitorInfo",tmp.getJSONObject(ResponseContant.resultMsg));
                        }
                        break;
                    default://安防设备
                        result = null;
                        break;
                }
            }
        }else {
            throw new Exception("设备未被绑定");
        }
        return result;
    }
    public JSONObject getHealthIndex(JSONObject result,String deviceSn,String patient,Integer page,Integer pageSize){
        String sqlCount = "select count(id) from wlyy_patient_health_index where user ='"+patient+"' and device_sn='"+deviceSn+"' " +
                " and del=1 ";
        String sql = "select *,CAST(DATE_FORMAT(record_date,'%Y-%m-%d %H:%i:%S') as char) sign_status from wlyy_patient_health_index where user ='"+patient+"' and device_sn='"+deviceSn+"' " +
                " and del=1 order by record_date desc limit "+page*pageSize+","+pageSize;
        long count = jdbcTemplate.queryForObject(sqlCount,long.class);
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        for (Map<String,Object> tmp:list){
            Integer type =Integer.parseInt(tmp.get("type").toString());
            String value1 = tmp.get("value1")==null?null:tmp.get("value1").toString();
            String value2 = tmp.get("value2")==null?null:tmp.get("value2").toString();
            String value3 = tmp.get("value3")==null?null:tmp.get("value3").toString();
            String value4 = tmp.get("value4")==null?null:tmp.get("value4").toString();
            String value5 = tmp.get("value5")==null?null:tmp.get("value5").toString();
            String value6 = tmp.get("value6")==null?null:tmp.get("value6").toString();
            String value7 = tmp.get("value7")==null?null:tmp.get("value7").toString();
            com.alibaba.fastjson.JSONArray errorInfo = healthIndexUtil.verifyHealthIndex(type,value1,value2,value3,value4,value5,value6,value7);
            tmp.put("errorInfo",errorInfo);
        }
        result.put("total",count);
        result.put("page",page+1);
        result.put("pageSize",pageSize);
        result.put("dataList",list);
        return result;
    }
    public JSONObject getEmeWarn(JSONObject result,String deviceSn,String patient,Integer page,Integer pageSize){
        String sqlCount = "select SUM(total) from( \n" +
                "select count(ord.id) as total from base_emergency_assistance_order ord  where ord.device_sn='"+deviceSn+"' " +
                " and ord.patient='"+patient+"' " +
                "UNION All " +
                "select count(ord.id)  as total from base_security_monitoring_order ord  where ord.device_sn='"+deviceSn+"' " +
                " and ord.patient='"+patient+"' )A ";
        long count = jdbcTemplate.queryForObject(sqlCount,long.class);
        String sql = "select '20' as OrderType,ord.id,ord.patient,ord.patient_name,ord.doctor,ord.status,ord.doctor_name," +
                "'紧急呼叫' as serve_desc,DATE_FORMAT(ord.create_time,'%Y-%m-%d %H:%i:%S') create_time " +
                "from base_emergency_assistance_order ord  where ord.device_sn='"+deviceSn+"' and ord.patient='"+patient+"' " +
                "UNION " +
                "select  '22' as 'OrderType',ord.id,ord.patient,ord.patient_name,ord.doctor,ord.status,ord.doctor_name," +
                "ord.serve_desc,DATE_FORMAT(ord.create_time,'%Y-%m-%d %H:%i:%S') create_time from base_security_monitoring_order ord " +
                " where ord.device_sn='"+deviceSn+"' and ord.patient='"+patient+"'  order by create_time desc limit "+page*pageSize+","+pageSize;
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        result.put("total",count);
        result.put("page",page+1);
        result.put("pageSize",pageSize);
        result.put("dataList",list);
        return result;
    }
     /******************************************* 爱牵挂设备start *****************************************************/

+ 109 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/patient/OnlineContactService.java

@ -0,0 +1,109 @@
package com.yihu.jw.care.service.patient;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/***
 * @ClassName: OnlineContactService
 * @Description:
 * @Auther: shi kejing
 * @Date: 2021/8/11 16:47
 */
@Service
public class OnlineContactService extends BaseJpaService<BasePatientDO, BasePatientDao> {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private ImUtil imUtil;
    public JSONObject getOnLineObj(String patient){
        JSONObject obj = new JSONObject();
        String zlySql = "SELECT d.id,d.name,d.photo FROM base_doctor d,base_service_package_sign_record spsr\n" +
                "WHERE d.del = 1 AND d.doctor_level = 2 AND d.id = spsr.sign_doctor AND spsr.`status` = 1 AND spsr.patient = '"+patient+"'";
        String jsSql = "SELECT p.id,p.`name`,p.photo,pfm.family_relation familyRelation,p.archive_type\n" +
                "FROM base_patient_family_member pfm,base_patient p\n" +
                "WHERE pfm.del = 1 AND pfm.family_member = p.id AND p.patient_status = 1 AND pfm.patient = '"+patient+"'";
        String fwzSql = "SELECT o.`code`,o.`name`,o.photo,o.mobile,o.address\n" +
                "FROM base_doctor_hospital dh,base_org o,base_service_package_sign_record spsr\n" +
                "WHERE dh.del = 1 AND o.del = 1 AND spsr.`status` = 1 AND spsr.sign_doctor = dh.doctor_code\n" +
                "AND dh.org_code = o.`code` AND spsr.patient = '"+patient+"' GROUP BY o.`code`";
        List<Map<String,Object>> zlyList = jdbcTemplate.queryForList(zlySql);
        List<Map<String,Object>> jsList = jdbcTemplate.queryForList(jsSql);
        List<Map<String,Object>> fwzList = jdbcTemplate.queryForList(fwzSql);
        if (zlyList.size() > 0){
            for (int i=0;i<zlyList.size();i++){
                JSONObject helperObj = new JSONObject();
                helperObj.put("id",zlyList.get(i).get("id"));
                helperObj.put("name",zlyList.get(i).get("name"));
                helperObj.put("photo",zlyList.get(i).get("photo"));
                Integer onLineFlag =0;
                String onLineStr = imUtil.findByUserIdAndType(zlyList.get(i).get("id").toString(),"helper");
                JSONObject oneLineObj = JSONObject.parseObject(onLineStr);
                if (200 == oneLineObj.getInteger("status")){
                    if (oneLineObj.getInteger("data")>0){
                        onLineFlag=1;
                    }
                }
                helperObj.put("onLineFlag", onLineFlag);
                obj.put("helperObj",helperObj);
            }
        }
        if (jsList.size() > 0){
            for (int i=0;i<jsList.size();i++){
                JSONObject familyObj = new JSONObject();
                familyObj.put("id",jsList.get(i).get("id"));
                familyObj.put("name",jsList.get(i).get("name"));
                familyObj.put("photo",jsList.get(i).get("photo"));
                familyObj.put("familyRelation",jsList.get(i).get("familyRelation"));
                String archive_type = null;
                Integer onLineFlag =0;
                switch (jsList.get(i).get("archive_type").toString()){
                    case "1":
                        archive_type = "older";//老人
                        break;
                    case "2":
                        archive_type = "child";//新生儿
                        break;
                }
                if (StringUtils.isNotBlank(archive_type)){
                    String onLineStr = imUtil.findByUserIdAndType(jsList.get(i).get("id").toString(),archive_type);
                    JSONObject oneLineObj = JSONObject.parseObject(onLineStr);
                    if (200 == oneLineObj.getInteger("status")){
                        if (oneLineObj.getInteger("data")>0){
                            onLineFlag=1;
                        }
                    }
                }
                familyObj.put("onLineFlag", onLineFlag);
                obj.put("familyObj",familyObj);
            }
        }
        if (fwzList.size() > 0){
            for (int i=0;i<fwzList.size();i++){
                JSONObject serStationObj = new JSONObject();
                serStationObj.put("code",fwzList.get(i).get("code"));
                serStationObj.put("name",fwzList.get(i).get("name"));
                serStationObj.put("photo",fwzList.get(i).get("photo"));
                serStationObj.put("mobile",fwzList.get(i).get("mobile"));
                serStationObj.put("address",fwzList.get(i).get("address"));
                obj.put("serStationObj",serStationObj);
            }
        }
        return obj;
    }
}

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/statistics/StatisticsService.java

@ -277,7 +277,7 @@ public class StatisticsService {
        Integer helperTotal = 0;
        Integer teacherTotal = 0;
        //老人 儿童注册人数
        String sql1 = "SELECT COUNT(*) c,archive_type from base_patient WHERE archive_type is  not null and del='1' GROUP BY archive_type";
        String sql1 = "SELECT COUNT(*) c,archive_type*1 as archive_type from base_patient WHERE archive_type is  not null and del='1' GROUP BY archive_type";
        List<Map<String,Object>> list1 = jdbcTemplate.queryForList(sql1);
        for(Map<String,Object> map:list1){
            String archive_type = map.get("archive_type").toString();