ソースを参照

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

liubing 2 年 前
コミット
f060a28333

+ 42 - 26
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/statistics/DetectionPlatformEndpoint.java

@ -419,8 +419,10 @@ public class DetectionPlatformEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = "getVideoList")
    @ApiOperation(value = "获取监控点列表")
    public PageEnvelop getVideoList(@ApiParam @RequestParam(name = "page", required = false, defaultValue = "0") Integer page,
                                    @ApiParam @RequestParam(name = "pageSize", required = false, defaultValue = "20") Integer pageSize) {
    public PageEnvelop getVideoList(@ApiParam(name = "page", required = false, defaultValue = "0")
                                    @RequestParam(value = "page",required = false,defaultValue = "0") Integer page,
                                    @ApiParam(name = "pageSize", required = false, defaultValue = "50")
                                    @RequestParam(value = "pageSize",required = false,defaultValue = "50") Integer pageSize) {
        try {
            return platformService.getVideoList(page, pageSize);
        } catch (Exception e) {
@ -428,6 +430,21 @@ public class DetectionPlatformEndpoint extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = "getVideoListByTreeNode")
    @ApiOperation(value = "获取监控点列表")
    public PageEnvelop getVideoListByTreeNode(@ApiParam(name = "treeNode", required = true, defaultValue = "0")
                                    @RequestParam(value = "treeNode",required = true,defaultValue = "0") String treeNode,
                                    @ApiParam(name = "page", required = false, defaultValue = "0")
                                    @RequestParam(value = "page",required = false,defaultValue = "0") Integer page,
                                    @ApiParam(name = "pageSize", required = false, defaultValue = "50")
                                    @RequestParam(value = "pageSize",required = false,defaultValue = "50") Integer pageSize) {
        try {
            return platformService.getVideoListByTreeNode(treeNode,page, pageSize);
        } catch (Exception e) {
            return failedPageEnvelopException2(e);
        }
    }
    @GetMapping(value = "getVideoUrlByCode")
    @ApiOperation(value = "根据编码获取流地址")
    public ObjEnvelop getVideoUrl(@ApiParam @RequestParam String indexCode) {
@ -442,10 +459,9 @@ public class DetectionPlatformEndpoint extends EnvelopRestEndpoint {
        }
    }
    @PostMapping(value = "testDownloadVideoUrl")
    @ApiOperation(value = "下载m3u8")
    public ObjEnvelop downM3u8Video(@ApiParam @RequestParam String url) {
    public ObjEnvelop downM3u8Video(@RequestParam String url) {
        try {
            return platformService.downM3u8Video(url);
        } catch (Exception e) {
@ -455,26 +471,26 @@ public class DetectionPlatformEndpoint extends EnvelopRestEndpoint {
    }
    public static void main(String[] args) {
        String originUrlpath = "http://videocdn.renrenjiang.cn/Act-ss-m3u8-sd/1037359_1546064640169/1037359_1546064640169.m3u8";
        String preUrlPath = originUrlpath.substring(0, originUrlpath.lastIndexOf("/")+1);
        String rootPath = "E:\\videodir";
        String fileName = "";
        HlsDownloader downLoader = new HlsDownloader(originUrlpath, preUrlPath, rootPath);
        //downLoader.setThreadQuantity(10);
        try{
            fileName = downLoader.download(true);
        }
        catch (Exception e) {
            e.printStackTrace();
        }
        if(StringUtils.isBlank(fileName)){
            System.out.println("下载失败");
        }else{
            System.err.println("下载成功"+fileName);
            System.out.println("完整路径:"+rootPath+"\\"+fileName);
        }
    }
//    public static void main(String[] args) {
//        String originUrlpath = "http://videocdn.renrenjiang.cn/Act-ss-m3u8-sd/1037359_1546064640169/1037359_1546064640169.m3u8";
//        String preUrlPath = originUrlpath.substring(0, originUrlpath.lastIndexOf("/")+1);
//        String rootPath = "E:\\videodir";
//        String fileName = "";
//        HlsDownloader downLoader = new HlsDownloader(originUrlpath, preUrlPath, rootPath);
//        //downLoader.setThreadQuantity(10);
//        try{
//            fileName = downLoader.download(true);
//        }
//        catch (Exception e) {
//            e.printStackTrace();
//        }
//
//        if(StringUtils.isBlank(fileName)){
//            System.out.println("下载失败");
//        }else{
//            System.err.println("下载成功"+fileName);
//            System.out.println("完整路径:"+rootPath+"\\"+fileName);
//        }
//
//    }
}

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/statistics/OpenStatisticsEndpoint.java

@ -243,7 +243,7 @@ public class OpenStatisticsEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = "findUserByType")
    @ApiOperation(value = "人员实时动态搜索")
    public Envelop findUserByType(@ApiParam(name = "type", value = "类型:1幼儿,2签约老人,3社工,4医生,5老人家属 6助老员,7街道老人(未签约)8 需招呼老人 原社区老人 .不传返回四个类型的数据")
    public Envelop findUserByType(@ApiParam(name = "type", value = "类型:1幼儿,2已照护老人(签约+已绑定设备),3社工,4医生,5老人家属 6助老员,7街道老人(未签约)8 需招呼老人 原社区老人 .不传返回四个类型的数据")
                                  @RequestParam(value = "type", required = false) String type,
                                  @ApiParam(name = "name", value = "姓名")
                                  @RequestParam(value = "name", required = false) String name,

+ 9 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/lifeCare/LifeCareOrderService.java

@ -830,7 +830,9 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
        result.put("orderId",orderDO.getId());
        orderDO.setTotalFee(new BigDecimal(0));
        //新增工单与服务项费用关联关系
        if (orderWithPackageItemFeeAdd(result, jsonObjectParam, orderDO,null)) {return result;}
        if (orderWithPackageItemFeeAdd(result, jsonObjectParam, orderDO,null)) {
            return result;
        }
        result.put(ResponseContant.resultFlag, ResponseContant.success);
        result.put(ResponseContant.resultMsg, orderDO);
@ -838,6 +840,12 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
        //发起支付订单
        if (isNeedPay){
            payService.submitOrder(orderDO.getPatient(),"4",orderDO.getId(),orderDO.getTotalFee().doubleValue());
        }else {
            if(orderDO.getType() == 3){
                serviceNewsService.addServiceNews(orderDO.getProxyPatientName(),orderDO.getProxyPatient(),"4",orderDO.getPatientName(),orderDO.getId(),2);
            }else {
                serviceNewsService.addServiceNews(orderDO.getPatientName(),orderDO.getPatient(),"3",null,orderDO.getId(),1);
            }
        }
        //给签约医生发送预约短信

+ 36 - 39
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/patient/CarePatientService.java

@ -892,7 +892,8 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
    /**
     * 查找签约老人 + 名单800
     * @param name
     * @param residentialArea
     * @param residentialArea 小区名称
     * @param type 2已照护老人(签约+已绑定设备) , 8 需招呼老人
     * @param limit
     * @return
     */
@ -902,13 +903,26 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
                " WHERE a.archive_type = 1 and a.del = '1'   ";
        if ("2".equals(type)){
            sql+=" and a.sign_status=1 ";
            if(StringUtils.isNotBlank(area)&&5==level){
                sql += " and ((a.sign_status=1 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='"+area+"')" +
                        " or (EXISTS (select 1 from wlyy_patient_device pd where pd.user = a.id and pd.del=0) and a.saas_id='"+area+"' ))) ";
            }
            else {
                sql+=" and (a.sign_status=1 or (EXISTS (select 1 from wlyy_patient_device pd where pd.user = a.id and pd.del=0))) ";
            }
        }
        if ("8".equals(type)){
            sql+=" and a.register='1' ";
        if ("8".equals(type)){//需招呼老人
            sql+=" and a.register='1' and not EXISTS (select 1 from wlyy_patient_device pd where pd.user = a.id and pd.del=0) ";
            if (StringUtils.isNotBlank(area)&&5==level){
                if(StringUtils.isNotBlank(area)){
                    sql+= " and a.saas_id = '"+area+"' ";
                }
            }
        }
        //case 1 WHEN openid is not null then 1 WHEN a.on_line = '1' then 1 ELSE 0 end as online
        //if(openid is null,0,1) onlineWx,IFNULL(a.on_line,0) onlinePad
        if(!StringUtil.isBlank(name)){
@ -917,23 +931,6 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
        if(!StringUtil.isBlank(residentialArea)){
            sql+= " and residential_area = '"+residentialArea+"' ";
        }
        if (StringUtils.isNotBlank(area)&&5==level){
            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='"+area+"')  ";
            sql += " OR (a.saas_id = '"+area+"' ";
            if (StringUtils.isNotBlank(name)){
                sql+= " and a.name like '%"+name+"%' ";
            }
            if(StringUtils.isNotBlank(residentialArea)){
                sql+= " and a.residential_area = '"+residentialArea+"' ";
            }
            sql +=" )";
        }
        sql += filter1;
        sql += " GROUP BY a.id,a.name,a.photo,a.idcard,a.birthday,a.residential_area,a.sex,a.ykt_id,online,signStatus ";
        sql += " ORDER BY online desc,a.ykt_id desc,signStatus desc";
@ -984,10 +981,24 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
        String sql = "SELECT count(DISTINCT a.id) from base_patient a  WHERE a.archive_type = 1 and a.del = '1' ";
        if ("2".equals(type)){
            sql+=" and a.sign_status=1 ";
            if(StringUtils.isNotBlank(area)&&5==level){
                sql += " and ((a.sign_status=1 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='"+area+"')" +
                        " or (EXISTS (select 1 from wlyy_patient_device pd where pd.user = a.id and pd.del=0) and a.saas_id='"+area+"' ))) ";
            }
            else {
                sql+=" and (a.sign_status=1 or (EXISTS (select 1 from wlyy_patient_device pd where pd.user = a.id and pd.del=0))) ";
            }
        }
        if ("8".equals(type)){
            sql+=" and a.register='1' ";
        if ("8".equals(type)){//需招呼老人
            sql+=" and a.register='1' and not EXISTS (select 1 from wlyy_patient_device pd where pd.user = a.id and pd.del=0) ";
            if (StringUtils.isNotBlank(area)&&5==level){
                if(StringUtils.isNotBlank(area)){
                    sql+= " and a.saas_id = '"+area+"' ";
                }
            }
        }
        if(!StringUtil.isBlank(name)){
@ -996,21 +1007,7 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
        if(!StringUtil.isBlank(residentialArea)){
            sql+= " and residential_area = '"+residentialArea+"' ";
        }
        if (StringUtils.isNotBlank(area)&&5==level){
            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='"+area+"' )  ";
            sql += "OR (a.saas_id = '"+area+"' ";
            if (StringUtils.isNotBlank(name)){
                sql+= " and a.name like '%"+name+"%' ";
            }
            if(StringUtils.isNotBlank(residentialArea)){
                sql+= " and a.residential_area = '"+residentialArea+"' ";
            }
            sql +=" )";
        }
        sql += filter;
        return jdbcTemplate.queryForObject(sql,Integer.class);
    }

ファイルの差分が大きいため隠しています
+ 50 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/statistics/DetectionPlatformService.java


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

@ -453,9 +453,9 @@ public class StatisticsService {
                " '女' ELSE a.sex \n" +
                " END AS sex,\n" +
                " TIMESTAMPDIFF(YEAR,a.birthday,now()) AS age,\n" +
                " a.doctor_level,a.mobile,h.org_name,a.idcard ";
                " a.doctor_level,a.mobile,org.name org_name,a.idcard ";
        String countSql = " select count(a.id)";
        String fromSql = " from base_doctor a,base_doctor_hospital h where a.id=h.doctor_code and a.del = '1' and h.del = '1' " +
        String fromSql = " from base_doctor a,base_doctor_hospital h,base_org org where a.id=h.doctor_code and h.org_code=org.code and org.del=1 and a.del = '1' and h.del = '1' " +
                " and a.doctor_level is not null and h.org_code not in ( " +
                " SELECT dict_code from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_org'  )  and a.doctor_level="+type+"  ";
        if(StringUtils.isNotBlank(name)){
@ -2678,12 +2678,14 @@ 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.sign_status=1 and a.del = '1' ";
            sql += " and EXISTS ( select 1 from " +
            sql = "SELECT count(distinct 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+"') or " +
                    " (EXISTS (select 1 from wlyy_patient_device pd where pd.user = a.id and pd.del=0)) ) "+filter;
            count =  jdbcTemplate.queryForObject(sql,Integer.class);
            map.put("oldTotal",count);//照护老人数量
            filter = "";
@ -2810,6 +2812,9 @@ public class StatisticsService {
                        tmp.setServeItems(serviceItems.get(0));
                    }
                }
                if ("2".equals(tmp.getType())){//咨询
                    tmp.setServeItems("咨询");
                }
                if ("3".equals(tmp.getType())||"4".equals(tmp.getType())){//生活照料
                    String sql = " select group_concat(Distinct name SEPARATOR '、') from base_life_care_fee_detail where order_id ='"+relationCode+"' ";
                    List<String> serviceItems = jdbcTemplate.queryForList(sql,String.class);
@ -2817,6 +2822,9 @@ public class StatisticsService {
                        tmp.setServeItems(serviceItems.get(0));
                    }
                }
                if ("5".equals(tmp.getType())){//咨询
                    tmp.setServeItems("紧急救助");
                }
                if ("6".equals(tmp.getType())){//安防
                    String sql = "SELECT serve_desc FROM base_security_monitoring_order WHERE id = '"+relationCode+"'";
                    List<String> serviceItems = jdbcTemplate.queryForList(sql,String.class);
@ -3588,6 +3596,17 @@ public class StatisticsService {
        if (StringUtils.isNotBlank(name)) nameSql = " AND p.name LIKE '%" + name + "%'";
        if (StringUtils.isNotBlank(deviceSn)) deviceSnSql = " AND pd.device_sn = '" + deviceSn + "'";
        String filter="";
        String sqltmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_child' or dict_name = 'jkzl_older' ";
        List<Map<String,Object>> listtmp =  jdbcTemplate.queryForList(sqltmp);
        if(listtmp.size()>0){
            String orgCodes = String.valueOf(listtmp.get(0).get("orgCodes"));
            if (StringUtils.isNotBlank(orgCodes)){
                orgCodes = orgCodes.replaceAll(",","','");
                filter = " and p.id not in ('"+orgCodes+"') ";
            }
        }
        page = page>0?page-1:0;
        String deviceSql = "";
@ -3601,11 +3620,11 @@ public class StatisticsService {
                    " FROM " +
                    " wlyy_patient_device pd LEFT JOIN base_patient p ON pd.`user` = p.id LEFT JOIN dm_device dd ON pd.category_code = dd.category_code " +
                    " LEFT JOIN wlyy_devices wd ON wd.device_code = pd.device_sn WHERE " +
                    " pd.del = 0 " + nameSql + deviceSnSql + categoryCodeSql + contactStatusSql;
                    " pd.del = 0 "+filter + nameSql + deviceSnSql + categoryCodeSql + contactStatusSql;
            totalSql = "SELECT count(DISTINCT pd.id) FROM " +
                    " wlyy_patient_device pd LEFT JOIN base_patient p ON pd.`user` = p.id LEFT JOIN dm_device dd ON pd.category_code = dd.category_code " +
                    " LEFT JOIN wlyy_devices wd ON wd.device_code = pd.device_sn WHERE " +
                    " pd.del = 0 " + nameSql + deviceSnSql + categoryCodeSql + contactStatusSql;
                    " pd.del = 0 " +filter+ nameSql + deviceSnSql + categoryCodeSql + contactStatusSql;
        }
        if ("af".equals(type) || StringUtils.isBlank(type)) {