소스 검색

Merge branch 'dev' of liuwenbin/patient-co-management into dev

huangwenjie 7 년 전
부모
커밋
7123e669a3

+ 1 - 1
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/DeviceTypeConvert.java

@ -41,7 +41,7 @@ public class DeviceTypeConvert implements Convert {
        for (Map<String,Object> one : dict){
            String result = one.get("name")+"";
            if(dataModel.getServerType().equals(result)||dataModel.getServerType().indexOf(result)>0){
            if(dataModel.getServerType().equals(result)||dataModel.getServerType().indexOf(result)>=0){
                return one.get("code")+"";
            }
        }

+ 18 - 10
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java

@ -5616,6 +5616,8 @@ public class StatisticsESService {
            }
            if (hospitals != null && hospitals.size() > 0) {
                int amount = 0;
                int allNum = 0;
                for (Hospital hos : hospitals) {
                    if (hos.getCode().length() > 10) {
                        continue;
@ -5623,7 +5625,7 @@ public class StatisticsESService {
//                    String sql = " select count(DISTINCT p.doctor,p.device_sn) AS amount,p.doctor as doctorCode,r.name as doctorName from wlyy.wlyy_patient_device p JOIN wlyy.wlyy_doctor r on p.doctor is not null and  p.doctor =r.code  LEFT JOIN device.wlyy_devices d on p.device_sn=d.device_code where p.del=0 and p.doctor is not null and d.grant_org_code ='" + hos.getCode() + "'  group by p.doctor,r.name";
                    String sql = " select count(*) as amount,if(a.doctor is null,'other',a.doctor) as doctorCode,if(a.NAME is null,'其他',a.NAME) as doctorName " +
                            " from (select  DISTINCT p.doctor,r.name,p.device_sn FROM wlyy.wlyy_patient_device p left join device.wlyy_devices d on p.device_sn=d.device_code left JOIN wlyy.wlyy_doctor r ON  p.doctor = r. CODE " +
                            "where p.del=0 and d.is_binding in (1,2) and d.grant_org_code ='" + hos.getCode() + "') a " +
                            "where p.del=0 and d.is_binding in (1,2) and p.category_code in('1','2') and d.grant_org_code ='" + hos.getCode() + "') a " +
                            " GROUP BY a.doctor,a.name";
                    List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
                    for (Map<String, Object> one : list) {
@ -5632,9 +5634,23 @@ public class StatisticsESService {
                        obj.put("name", one.get("doctorName"));
                        obj.put("amount", one.get("amount"));
                        obj = deviceRateList(obj,hos);
                        if("other".equals(one.get("doctorCode")+"")){
                            amount += Integer.valueOf(obj.get("amount")+"");
                            allNum += Integer.valueOf(obj.get("allNum")+"");
                            continue;
                        }
                        resultList.add(obj);
                    }
                }
                Map<String, Object> otherObj = new HashMap<>();
                otherObj.put("code", "other");
                otherObj.put("name", "其他");
                otherObj.put("amount", amount);
                otherObj.put("allNum", allNum);
                otherObj.put("bindingNum", amount);
                otherObj.put("rate", getRange(amount, allNum, 2));//续签率是 续签量/去年的签约数
                otherObj.put("rateNum", getRangeNum(amount, allNum, 2));//续签率是 续签量/去年的签约数
                resultList.add(otherObj);
            }
//        }
        return resultList;
@ -5754,7 +5770,7 @@ public class StatisticsESService {
        String temp = "other".equals(reMap.get("code"))? " and p.doctor is null ":" and p.doctor='"+reMap.get("code")+"' ";
        String sql = " select count(1) as amount " +
                " from (select  DISTINCT p.doctor,r.name,p.device_sn FROM wlyy.wlyy_patient_device p left join device.wlyy_devices d on p.device_sn=d.device_code left JOIN wlyy.wlyy_doctor r ON  p.doctor = r. CODE " +
                " where d.is_binding in (1,2) and  d.grant_org_code ='" + hos.getCode() + "' "+temp+") a " +
                " where d.is_binding in (1,2) and p.category_code in('1','2') and d.grant_org_code ='" + hos.getCode() + "' "+temp+") a " +
                " GROUP BY a.doctor,a.name";
//        Map<String, Object> map = jdbcTemplate.queryForMap(sql);
        List<Map<String,Object>> result = jdbcTemplate.queryForList(sql);
@ -6159,14 +6175,6 @@ public class StatisticsESService {
//    }
    /**
     * 查询签约
     *
     * @param type      0 按周,1 按月
     * @param startDate
     * @param endDate
     * @return
     */
    /*public JSONArray getDeviceLine(String doctor, String type, String startDate, String endDate) throws Exception {
        AdminTeam admin = adminTeamDao.findByLeaderCode(doctor);

+ 5 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/kit/JyKitService.java

@ -31,6 +31,8 @@ public class JyKitService {
    @Value("${juye.companyCode}")
    private String companyCode;
    @Value("${juye.companySecret}")
    private String companySecret;
    @Value("${juye.url}")
    private String jyUrl;
    @Autowired
@ -41,7 +43,7 @@ public class JyKitService {
    private String timeTermRedisKey = "juye:getToken:time_term";
    private String tokenRedisKey = "juye:getToken:token";
    /****************************************接口路径 start**************************************************/
    /****************************************接口路径 start****************************************************/
    private String kitBinding = "companyBindDevice";//药盒绑定接口
    private String getKitSetInfo = "getInfoByDeviceSn";//获取药盒设置信息接口
    private String getKitToken = "getToken";//获取巨烨token
@ -186,6 +188,7 @@ public class JyKitService {
     */
    public String getRequestPost(List<NameValuePair> params,String url) throws Exception{
        params.add(new BasicNameValuePair("company_code", companyCode));
        params.add(new BasicNameValuePair("company_secret", companySecret));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
@ -198,7 +201,7 @@ public class JyKitService {
     * @throws Exception
     */
    public String getRequestGet(List<NameValuePair> params,String url) throws Exception{
        String paramStr="?company_code="+companyCode;
        String paramStr="?company_code="+companyCode+"&company_secret="+companySecret;
        for(NameValuePair one : params){
            paramStr += "&"+one.getName()+"="+one.getValue();
        }

+ 2 - 1
patient-co/patient-co-wlyy/src/main/resources/application-dev.yml

@ -221,4 +221,5 @@ ylz:
juye:
  url: http://api.zayata.com/index.php?s=/Company/Device/
  token: YTgzYjc2YWIzZjdjOTA1MTE0ODY2YjcyOGNkYWFmZWR6YXlhdGFjb21wYW55
  companyCode: 86350206000000001
  companyCode: 86350206000000001
  companySecret: ODZhZjg1OWM4YTQyMDNkMWU5MDkxNjE0YmRhODI5YmU=

+ 2 - 1
patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml

@ -226,4 +226,5 @@ ylz:
#药盒请求巨烨的域名以及巨烨给予的公司编号
juye:
  url: http://zayata.oicp.net:30080/index.php?s=/Company/Device/
  companyCode: 86350206000000001
  companyCode: 86350206000000001
  companySecret: ODZhZjg1OWM4YTQyMDNkMWU5MDkxNjE0YmRhODI5YmU=

+ 3 - 2
patient-co/patient-co-wlyy/src/main/resources/application-prod.yml

@ -225,7 +225,8 @@ ylz:
  gateway:
    url: http://120.42.37.94:1301/ehc-empi-web/gateway
#药盒请求巨烨的域名以及巨烨给予的公司编号
# 药盒请求巨烨的域名以及巨烨给予的公司编号
juye:
  url: http://api.zayata.com/index.php?s=/Company/Device/
  companyCode: 86350206000000001
  companyCode: 86350206000000001
  companySecret: ODZhZjg1OWM4YTQyMDNkMWU5MDkxNjE0YmRhODI5YmU=

+ 2 - 1
patient-co/patient-co-wlyy/src/main/resources/application-test.yml

@ -211,4 +211,5 @@ ylz:
    url: http://www.mstpay.com:1300/huangsb
juye:
  url: http://zayata.oicp.net:30080/index.php?s=/Company/Device/
  companyCode: 86350206000000001
  companyCode: 86350206000000001
  companySecret: ODZhZjg1OWM4YTQyMDNkMWU5MDkxNjE0YmRhODI5YmU=