فهرست منبع

Merge branch 'dev' of liubing/wlyy2.0 into dev

liubing 3 سال پیش
والد
کامیت
2dba51e469

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

@ -196,7 +196,7 @@ public class CommonEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = "open/shuiBiaoInit")
    @ApiOperation(value = "微信模板消息推送")
    @ApiOperation(value = "水表用户初始化")
    public Envelop setRedisEnable() {
        try {
            commomService.shuiBiaoInit();

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/common/CommomService.java

@ -45,7 +45,7 @@ public class CommomService {
    private PatientDeviceDao patientDeviceDao;
    //模板消息测试
    //水表用户初始化
    public void shuiBiaoInit(){
        String sql = " select id,user_id,idcard from base_patient where user_id is NOT null and user_id<>'' ";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/message/BaseServiceNewsService.java

@ -77,7 +77,7 @@ public class BaseServiceNewsService {
     * @return
     */
    public List<Map<String,Object>> findPatinetByName(String name){
        String sql = "SELECT p.id,p.`name`,p.address,p.photo,p.mobile,p.lat_lon latLon,sex,idcard,p.pad_imei,p.openid,CAST(archive_type AS char) type from base_patient p\n" +
        String sql = "SELECT p.id,p.`name`,p.address,p.photo,p.mobile,p.lat_lon latLon,sex,idcard,p.pad_imei,p.openid,CAST(archive_type AS char) type,p.sign_status as signStatus from base_patient p\n" +
                "WHERE p.del = 1 and p.name like '%"+name+"%'";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        List<DevicePatientDevice> feeDetail = patientDeviceDao.findByAll();

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

@ -1675,7 +1675,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
                    }
                    break;
                case "dailyWater":
                    if (patientDeviceService.patientDeviceListByTopic(patient,"preventOutOfBed").size()==0){
                    if (patientDeviceService.patientDeviceListByTopic(patient,"dailyWater").size()==0){
                        result.put("dailyWater", null);
                    }else {
                        Integer count = Integer.parseInt(tmp.get("total").toString());
@ -1767,12 +1767,12 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
                    }
                    break;
                case "dailyWater":
                    devices = patientDeviceService.patientDeviceListByTopic(patient,"preventLost");
                    devices = patientDeviceService.patientDeviceListByTopic(patient,"dailyWater");
                    if (devices.size()>0){
                        tmp.put("band", true);
                        tmp.put("devices", devices);
                    }else {
                        tmp.put("band", true);
                        tmp.put("band", false);
                        tmp.put("devices", null);
                    }
                    break;

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

@ -2365,11 +2365,10 @@ public class StatisticsService {
            Integer count = jdbcTemplate.queryForObject(sql,Integer.class);
            map.put("doctorCount",count);
            sql = " SELECT count(o.bussiness_id) " +
                    "FROM ( SELECT o.id AS bussiness_id,o.team_code as dept,o.`status`,o.update_time " +
                    "FROM base_security_monitoring_order o UNION ALL  " +
                    "SELECT o.id AS bussiness_id,o.team_code as dept,o.`status`,o.update_time " +
                    "FROM base_emergency_assistance_order o " +
                    ") o WHERE 1=1  and dept='"+teamId+"' and `status` in (-2,0,1) ";
                    "FROM (  SELECT o.id AS bussiness_id,o.team_code as dept,o.`status`,o.update_time FROM base_security_monitoring_order o  " +
                    " where o.team_code='"+teamId+"' and o.`status` in (-2,0,1)  " +
                    " UNION ALL  SELECT o.id AS bussiness_id,o.team_code as dept,o.`status`,o.update_time FROM base_emergency_assistance_order o " +
                    " where o.team_code='"+teamId+"' and o.`status` in (-2,0,1)  )o  ";
            Long emeAssistanceCount = jdbcTemplate.queryForObject(sql,Long.class);
            map.put("emeAssistanceCount",emeAssistanceCount);
            sql = " SELECT count(o.id) FROM base_life_care_order o WHERE o.status<>0 and o.status<>-1  and EXISTS ( " +
@ -2401,11 +2400,11 @@ public class StatisticsService {
                orgCodes = orgCodes.replaceAll(",","','");
                filter = " and a.id not in ('"+orgCodes+"')";
            }
            sql = "SELECT count(a.id) from base_patient a  WHERE a.archive_type = 1 and a.del = '1' ";
            sql = "SELECT count(a.id) from base_patient a  WHERE a.archive_type = 1 and a.sign_status=1 and a.del = '1' ";
            sql += " and EXISTS ( select 1 from " +
                    "base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i,base_service_package pack " +
                    " where sr.id = r.sign_id and sr.status=1 and r.service_package_id = i.service_package_id and r.service_package_id = pack.id " +
                    " and i.del = 1  and sr.`status`=1 and CONVERT(sr.patient USING utf8)  = a.id and r.team_code='"+teamId+"' ) "+filter;
                    " and i.del = 1  and sr.`status`=1 and CONVERT(sr.patient USING utf8) = a.id and r.team_code='"+teamId+"' ) "+filter;
            count =  jdbcTemplate.queryForObject(sql,Integer.class);
            map.put("oldTotal",count);
            //照护老人数量
@ -2464,11 +2463,10 @@ public class StatisticsService {
            Integer count = jdbcTemplate.queryForObject(sql,Integer.class);
            map.put("doctorCount",count);
            sql = " SELECT count(o.bussiness_id) " +
                    "FROM ( SELECT o.id AS bussiness_id,o.team_code as dept,o.`status`,o.update_time " +
                    "FROM base_security_monitoring_order o UNION ALL  " +
                    "SELECT o.id AS bussiness_id,o.team_code as dept,o.`status`,o.update_time " +
                    "FROM base_emergency_assistance_order o " +
                    ") o WHERE 1=1  and dept='"+teamId+"' and `status` in (-2,0,1) ";
                    "FROM (  SELECT o.id AS bussiness_id,o.team_code as dept,o.`status`,o.update_time FROM base_security_monitoring_order o  " +
                    " where o.team_code='"+teamId+"' and o.`status` in (-2,0,1)  " +
                    " UNION ALL  SELECT o.id AS bussiness_id,o.team_code as dept,o.`status`,o.update_time FROM base_emergency_assistance_order o " +
                    " where o.team_code='"+teamId+"' and o.`status` in (-2,0,1)  )o  ";
            Long emeAssistanceCount = jdbcTemplate.queryForObject(sql,Long.class);
            map.put("emeAssistanceCount",emeAssistanceCount);//救助服务
            sql = " SELECT count(o.id) FROM base_life_care_order o WHERE o.status<>0 and o.status<>-1  and EXISTS ( " +
@ -2501,7 +2499,7 @@ public class StatisticsService {
                orgCodes = orgCodes.replaceAll(",","','");
                filter = " and a.id not in ('"+orgCodes+"')";
            }
            sql = "SELECT count(a.id) from base_patient a  WHERE a.archive_type = 1 and a.del = '1' ";
            sql = "SELECT count(a.id) from base_patient a  WHERE a.archive_type = 1 and a.sign_status=1 and a.del = '1' ";
            sql += " and EXISTS ( select 1 from " +
                    "base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i,base_service_package pack " +
                    " where sr.id = r.sign_id and sr.status=1 and r.service_package_id = i.service_package_id and r.service_package_id = pack.id " +

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

@ -649,17 +649,18 @@ public class PatientInfoPlatFormService {
            orgCodes = orgCodes.replaceAll(",","','");
            filter = " and ord.patient not in ('"+orgCodes+"') ";
        }
        String sqlCount = " select count(ord.id) from base_emergency_assistance_order ord INNER JOIN base_patient p on ord.patient = p.id where 1=1 ";
        String sql = " select '20' as OrderType,p.archive_type archiveType,p.residential_area residentialArea,ord.id,ord.patient, " +
                "p.name,'紧急呼叫' as serve_desc,DATE_FORMAT(ord.create_time,'%Y-%m-%d %H:%i:%S') create_time,ord.`status`," +
                " case p.sex when 1 then '男' when 2 then '女' else p.sex end as sex,TIMESTAMPDIFF(YEAR,p.birthday,now()) as age \n" +
                "from base_emergency_assistance_order ord INNER JOIN base_patient p on ord.patient = p.id " ;
                "from base_emergency_assistance_order ord INNER JOIN base_patient p on ord.patient = p.id and p.del=1 where 1=1 " ;
        if (StringUtils.isNotBlank(patient)){
            sql +=" and ord.patient='"+patient+"' ";
            filter +=" and ord.patient='"+patient+"' ";
        }
        sql +=  filter + "  order by create_time desc ";
        String countSql = "select count(id) from ("+sql+")A ";
        long count = jdbcTemplate.queryForObject(countSql,long.class);
        sql +=  filter + "  order by create_time desc";
        sqlCount  +=filter;
        long count = jdbcTemplate.queryForObject(sqlCount,long.class);
        sql +=" limit "+page*pageSize+","+pageSize;
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        return PageEnvelop.getSuccessListWithPage("查询成功",list,page,pageSize,count);