Browse Source

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

liubing 3 years ago
parent
commit
68f2a52247

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

@ -356,7 +356,7 @@ public class DetectionPlatformEndpoint extends EnvelopRestEndpoint {
        }
    }
    @ApiOperation("获取流量/语音使用信息")
    @ApiOperation("获取流量/语音使用总数据表格-从统计初至今")
    @ResponseBody
    @RequestMapping(value = "getSimFlowVoiceLineInfo", method = RequestMethod.GET)
    public ListEnvelop getSimFlowVoiceLineInfo(@ApiParam(name="type",value = "1月2日")

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

@ -248,8 +248,8 @@ public class ContactsService {
                    }
                }
                String[] numTmp = num.split("_");
                String sql = " select pd.device_sn,wd.sim from  wlyy_patient_device pd inner join wlyy_devices wd  " +
                        "on pd.device_sn = wd.device_code and pd.del=0 and wd.sim is not null and pd.category_code in('7','4')  " +
                String sql = " select pd.device_sn,wd.iccid from  wlyy_patient_device pd inner join wlyy_devices wd  " +
                        "on pd.device_sn = wd.device_code and pd.del=0 and wd.iccid is not null and pd.category_code in('7','4')  " +
                        "where pd.user='"+patient+"' ";
                List<Map<String,Object>> sims = jdbcTemplate.queryForList(sql);
                //修改

+ 8 - 14
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/device/NetworkCardService.java

@ -165,7 +165,7 @@ public class NetworkCardService {
        params.add(new BasicNameValuePair("token", getAccessToken()));
        params.add(new BasicNameValuePair("groupId", NetworkCardConfig.flowGroupId));
        String response = httpClientUtil.get("https://api.iot.10086.cn/v5/ec/query/group-data-usage",params,"UTF-8");
//        {"status":"0","message":"正确","result":[{"useAmount":"2507595.00"}]}  单位KB  1GB=1024MB 1MB=1021KB
//        {"status":"0","message":"正确","result":[{"useAmount":"2507595.00"}]}  单位KB  1GB=1024MB 1MB=1024KB
        JSONObject responseBody = JSONObject.parseObject(response);
        if ("0".equals(responseBody.getString("status"))){
            useAmount= responseBody.getJSONArray("result").getJSONObject(0).getString("useAmount");
@ -188,24 +188,18 @@ public class NetworkCardService {
    public List<Map<String,Object>> getSimFlowVoiceLineInfo(String type,String data,String day){
        String sql = "";
        String sqlFilter = " ";
        if (StringUtils.isBlank(day)){
            if ("1".equals(type)){
                day = DateUtil.dateToStr(new Date(),DateUtil.YYYYMM);
            }
            if ("2".equals(type)){
                Date yesDay = DateUtil.getPreDays(new Date(),-1);
                day = DateUtil.dateToStr(yesDay,DateUtil.YYYYMMDD);
            }
        if (StringUtils.isNotBlank(day)){
            sqlFilter += " and day='"+day+"' ";
        }
        sqlFilter += " and day='"+day+"' ";
        if ("flow".equals(data)){
            sql = " select * from wlyy_sims_flow where type="+type+" ";
            sql = " select msisdn,sum(value) value,type from wlyy_sims_flow where type="+type+" ";
        }if ("voice".equals(data)){
            sql = " select * from wlyy_sims_voices where type="+type+" ";
            sql = " select msisdn,sum(value) value,type from wlyy_sims_voices where type="+type+" ";
        }
        sqlFilter += " ORDER BY `value`+0 desc ";
        return jdbcTemplate.queryForList(sql+sqlFilter);
        sql += sqlFilter+" GROUP BY msisdn ";
        return jdbcTemplate.queryForList(" select * from ("+sql+")A order by value desc ");
    }
    public List<Map<String,Object>> getSimCounts(){

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

@ -759,7 +759,11 @@ public class StatisticsService {
        }
        olderFamilyTotal = olderFamilyOff+olderFamilyOn;
        //家属绑定老人数量
        olderFamilyBinding = carePatientService.findOlderFamilyTotal(null,olderRelativeFilter);
        sql2 = " select count(distinct t3.id) total from base_patient t2 left JOIN base_patient_family_member t1 on t1.family_member = t2.id " +
                " Inner join base_patient t3 on t3.id = t1.patient " +
                " where t2.archive_type=3 and t2.del=1 and t3.archive_type=1 and t3.del=1 ";
        olderFamilyBinding = jdbcTemplate.queryForObject(sql2,Integer.class);
        //helper 助老员,teacher 教师,child 幼儿,olderWx 老人公众号,olderPad 老人平板
        result.put("olderTotal", olderTotal);