ソースを参照

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

shikejing 4 年 前
コミット
11a4859406

+ 14 - 2
svr/svr-iot/src/main/java/com/yihu/iot/controller/platform/IotInterfaceController.java

@ -1,5 +1,6 @@
package com.yihu.iot.controller.platform;
import com.yihu.iot.model.AppServiceCount;
import com.yihu.iot.service.company.IotCompanyService;
import com.yihu.iot.service.platform.IotCompanyAppInterfaceService;
import com.yihu.iot.service.platform.IotInterfaceLogService;
@ -10,6 +11,7 @@ import com.yihu.jw.entity.iot.platform.IotShareInterfaceDO;
import com.yihu.jw.restmodel.iot.company.IotCompanyVO;
import com.yihu.jw.restmodel.iot.platform.IotAppInterfacesVO;
import com.yihu.jw.restmodel.iot.platform.IotInterfaceLogVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.iot.IotRequestMapping;
@ -20,6 +22,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
@ -413,6 +417,14 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
    }
    @ApiOperation("大屏应用服务")
    @RequestMapping(value = "/getAppService" , method = RequestMethod.GET)
    public Envelop getAppService() {
        try {
            return success(iotCompanyService.getAppService());
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError("查询失败");
        }
    }
}

+ 29 - 0
svr/svr-iot/src/main/java/com/yihu/iot/model/AppServiceCount.java

@ -0,0 +1,29 @@
package com.yihu.iot.model;
/***
 * @ClassName: AppServiceCount
 * @Description:
 * @Auther: shi kejing
 * @Date: 2020/11/18 15:45
 */
public class AppServiceCount {
    private int count;
    private String appName;
    public int getCount() {
        return count;
    }
    public void setCount(int count) {
        this.count = count;
    }
    public String getAppName() {
        return appName;
    }
    public void setAppName(String appName) {
        this.appName = appName;
    }
}

+ 23 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/company/IotCompanyService.java

@ -1,8 +1,10 @@
package com.yihu.iot.service.company;
import com.alibaba.fastjson.JSONObject;
import com.yihu.iot.dao.company.*;
import com.yihu.iot.dao.platform.IotCompanyAppInterfaceDao;
import com.yihu.iot.dao.platform.IotInterfaceLogDao;
import com.yihu.iot.model.AppServiceCount;
import com.yihu.iot.service.useragent.UserAgent;
import com.yihu.jw.entity.iot.company.*;
import com.yihu.jw.entity.iot.platform.IotCompanyAppInterfaceDO;
@ -1157,4 +1159,25 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_create);
    }
    public JSONObject getAppService(){
        JSONObject object = new JSONObject();
        String str = "SELECT SUM(b.count) count,b.app_name appName\n" +
                "FROM (SELECT COUNT(id) fali,app_name,interface_name FROM xmiot.iot_interface_log  WHERE state=0 GROUP BY app_name,interface_name) c\n" +
                "RIGHT JOIN (SELECT count(id) count,app_name,interface_name,work_type FROM xmiot.iot_interface_log WHERE app_name IS NOT NULL\n" +
                "GROUP BY app_name,interface_name) b ON c.app_name=b.app_name AND c.interface_name=b.interface_name\n" +
                "GROUP BY b.app_name ORDER BY count DESC";
        String str1 = "SELECT SUM(b.count) count,b.app_name appName\n" +
                "FROM (SELECT COUNT(id) fali,app_name,interface_name FROM xmiot.iot_interface_log  WHERE state=0 GROUP BY app_name,interface_name) c\n" +
                "RIGHT JOIN (SELECT count(id) count,app_name,interface_name,work_type FROM xmiot.iot_interface_log WHERE app_name IS NOT NULL\n" +
                "GROUP BY app_name,interface_name) b ON c.app_name=b.app_name AND c.interface_name=b.interface_name\n" +
                "GROUP BY b.app_name ORDER BY count DESC limit 0,3";
        List<AppServiceCount> counts = jdbcTemplate.query(str,new BeanPropertyRowMapper<>(AppServiceCount.class));
        List<AppServiceCount> counts1 = jdbcTemplate.query(str1,new BeanPropertyRowMapper<>(AppServiceCount.class));
        object.put("appcount",counts.size());
        object.put("sortList",counts1);
        return object;
    }
}

+ 10 - 3
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistScreenResultService.java

@ -140,9 +140,16 @@ public class SpecialistScreenResultService {
            surveyScreenResultVo.setDoctorMobile(String.valueOf(doctorList.get(0).get("mobile")));
        }
        //获取问卷详情
        String templateSql = "select t.is_third from "+basedb+".wlyy_survey_templates t where t.code = '" + templateCode + "' and t.del = 1 ";
        String thirdId = jdbcTemplate.queryForObject(templateSql, String.class);
        surveyScreenResultVo.setIsThird(thirdId);
        String templateSql = "select t.* from "+basedb+".wlyy_survey_templates t where t.code = '" + templateCode + "' and t.del = 1 ";
        List<Map<String, Object>> templateSqlList = jdbcTemplate.queryForList(templateSql);
        if (templateSqlList.size()>0){
            surveyScreenResultVo.setIsThird(templateSqlList.get(0).get("is_third").toString());
        }else {
            surveyScreenResultVo.setIsThird(null);
        }
//        String templateSql = "select t.is_third from "+basedb+".wlyy_survey_templates t where t.code = '" + templateCode + "' and t.del = 1 ";
//        String thirdId = jdbcTemplate.queryForObject(templateSql, String.class);
//        surveyScreenResultVo.setIsThird(thirdId);
        //获取转诊信息
        String reservationSql = "SELECT * FROM " + basedb + ".`wlyy_patient_reservation` r where r.relation_code = '" + code + "' and r.`status` = 1 ";
        List<Map<String, Object>> list = jdbcTemplate.queryForList(reservationSql);