Browse Source

药柜修改

wushilong 3 years ago
parent
commit
fdbad6c3ce

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/controller/monitorPlatform/MonitorPlatformController.java

@ -863,7 +863,7 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
    @ApiOperation("获取设备品牌列表")
    @ApiOperation("获取设备品牌列表")
    public Envelop getBrandsDetail(
    public Envelop getBrandsDetail(
            @ApiParam(name = "deviceType", value = "设备类型", required = true)
            @ApiParam(name = "deviceType", value = "设备类型", required = true)
            @RequestParam(value = "deviceType", required = true, defaultValue = "1,2,5") String deviceType) {
            @RequestParam(value = "deviceType", required = true, defaultValue = "1,2,5,22") String deviceType) {
        return success(monitorPlatformService.getBrandsDetail(deviceType));
        return success(monitorPlatformService.getBrandsDetail(deviceType));
    }
    }

+ 41 - 22
svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java

@ -56,8 +56,6 @@ public class MonitorPlatformService {
    private String wxId;
    private String wxId;
    @Value("${wechat.flag}")
    @Value("${wechat.flag}")
    private boolean flag;
    private boolean flag;
    @Value("${hlw.baseUrl}")
    private String baseUrl;
    public static Map<String, String> tokenMap = new HashMap<>();
    public static Map<String, String> tokenMap = new HashMap<>();
    @Autowired
    @Autowired
@ -1350,35 +1348,50 @@ public class MonitorPlatformService {
            ) {
            ) {
                String sql = "select COUNT(*) from xmiot.iot_equipmet_detail";
                String sql = "select COUNT(*) from xmiot.iot_equipmet_detail";
                /*取到智慧药柜*/
                /*取到智慧药房*/
                Map<String, Object> medicinecabinetCount = getMedicinecabinetCount();
                Map<String, Object> medicinecabinetCount = getMedicinecabinetCount();
                //智慧药柜
                //智慧药房
                int ygtotal = Integer.parseInt(medicinecabinetCount.get("total").toString());
                int ygtotal = Integer.parseInt(medicinecabinetCount.get("total").toString());
                int ygusing = Integer.parseInt(medicinecabinetCount.get("using").toString());
                int ygusing = Integer.parseInt(medicinecabinetCount.get("using").toString());
                int ygstock = Integer.parseInt(medicinecabinetCount.get("stock").toString());
                int ygstock = Integer.parseInt(medicinecabinetCount.get("stock").toString());
                Integer count = jdbcTemplate.queryForObject(sql, Integer.class);
                Integer count = jdbcTemplate.queryForObject(sql, Integer.class);
                JSONObject tmp = new JSONObject();
                JSONObject tmp = new JSONObject();
                tmp.put("using", count + ygusing);
                tmp.put("total", count + ygtotal);
                tmp.put("type", "5");
                tmp.put("stock", 0 + ygstock);
                if ("0".equals(showLevel)) {
                if ("0".equals(showLevel)) {
                    tmp.put("device_name", "组合一体机");
                    tmp.put("device_name", "组合一体机");
                    tmp.put("Subdivision", true);
                    tmp.put("Subdivision", true);
                    tmp.put("using", count + ygusing);
                    tmp.put("total", count + ygtotal);
                    tmp.put("type", "5");
                    tmp.put("stock", 0 + ygstock);
                    result.getJSONArray("deviceInfo").add(tmp);
                    tmp.put("showLevel", Integer.parseInt(showLevel));
                } else {
                } else {
                    tmp.put("device_name", "健康小屋");
                    tmp.put("Subdivision", false);
                    //智慧药柜
                    medicinecabinetCount.put("Subdivision", false);
                    medicinecabinetCount.put("showLevel", 1);
                    result.getJSONArray("deviceInfo").add(medicinecabinetCount);
                    result.put("grantCount", result.getInteger("grantCount") + count);
                    /*string用,分割*/
                    String[] arrays = deviceType.split(",");
                    for (String string : arrays) {
                        if ("5".equals(string)){
                            /*健康小屋*/
                            tmp.put("device_name", "健康小屋");
                            tmp.put("Subdivision", false);
                            tmp.put("total", count);
                            tmp.put("using", count);
                            tmp.put("stock", 0);
                            tmp.put("type", 5);
                            tmp.put("showLevel", Integer.parseInt(showLevel));
                            result.getJSONArray("deviceInfo").add(tmp);
                        }
                        if ("22".equals(string)){
                            //智慧药房
                            medicinecabinetCount.put("Subdivision", false);
                            medicinecabinetCount.put("showLevel", Integer.parseInt(showLevel));
                            medicinecabinetCount.put("type", 22);
                            result.getJSONArray("deviceInfo").add(medicinecabinetCount);
                            result.put("grantCount", result.getInteger("grantCount") + count);
                        }
                    }
                }
                }
                tmp.put("showLevel", Integer.parseInt(showLevel));
                result.getJSONArray("deviceInfo").add(tmp);
                //统计健康小屋数据/ 小屋全部统计为正常使用
                //统计健康小屋数据/ 小屋全部统计为正常使用
@ -1547,8 +1560,12 @@ public class MonitorPlatformService {
            }
            }
            sql.append("GROUP BY wd.manufacturer_code,pd.device_name ");
            sql.append("GROUP BY wd.manufacturer_code,pd.device_name ");
            if ((org.apache.commons.lang3.StringUtils.isNoneBlank(deviceType) && deviceType.contains("5")) || org.apache.commons.lang3.StringUtils.isBlank(deviceType)) {
            if ((org.apache.commons.lang3.StringUtils.isNoneBlank(deviceType) && deviceType.contains("5")) || org.apache.commons.lang3.StringUtils.isBlank(deviceType)) {
                sql.append("UNION select case device_name when '自助体检一体机' then '健康小屋'  else device_name  end AS device_name from xmiot.iot_equipmet_detail group BY manufacturer_code,device_name");
                sql.append(" UNION select case device_name when '自助体检一体机' then '健康小屋'  else device_name  end AS device_name from xmiot.iot_equipmet_detail group BY manufacturer_code,device_name");
            }
            }
            if((org.apache.commons.lang3.StringUtils.isNoneBlank(deviceType) && deviceType.contains("22")) || org.apache.commons.lang3.StringUtils.isBlank(deviceType)) {
                sql.append(" UNION select case device_name when '自助体检一体机' then '智慧药房'  else device_name  end AS device_name from xmiot.iot_equipmet_detail group BY manufacturer_code,device_name");
            }
            sql.append(")A");
            sql.append(")A");
            List<String> list = jdbcTemplate.queryForList(sql.toString(), String.class);
            List<String> list = jdbcTemplate.queryForList(sql.toString(), String.class);
            List<String> reList = new ArrayList<>();
            List<String> reList = new ArrayList<>();
@ -1851,7 +1868,7 @@ public class MonitorPlatformService {
        resultMap.put("total", total);
        resultMap.put("total", total);
        resultMap.put("stock", notUsedTotal);
        resultMap.put("stock", notUsedTotal);
        resultMap.put("using", usedTotal);
        resultMap.put("using", usedTotal);
        resultMap.put("device_name", "智慧药柜");
        resultMap.put("device_name", "智慧药房");
        return resultMap;
        return resultMap;
    }
    }
@ -1982,7 +1999,9 @@ public class MonitorPlatformService {
        List<Map<String, String>> list = new ArrayList<>();
        List<Map<String, String>> list = new ArrayList<>();
        try {
        try {
            //药柜请求地址
            //药柜请求地址
            String urlResult = httpClientUtil.getBodyRawForm(baseUrl + url, parame);
            String ygurl = "SELECT isd.dict_name,isd.`code` from iot_system_dict isd WHERE dict_name = 'HLW_YGBASEURL'";
            Map<String, Object> baseUrll = jdbcTemplate.queryForMap(ygurl);
            String urlResult = httpClientUtil.getBodyRawForm(baseUrll.get("code") + url, parame);
            JSONObject resultObject = JSONObject.parseObject(urlResult);
            JSONObject resultObject = JSONObject.parseObject(urlResult);
            if (resultObject.get("status").equals("200")) {
            if (resultObject.get("status").equals("200")) {
                JSONObject jsonObjectData = JSONObject.parseObject(AesEncryptUtils.agDecrypt(resultObject.get("data").toString()));
                JSONObject jsonObjectData = JSONObject.parseObject(AesEncryptUtils.agDecrypt(resultObject.get("data").toString()));

+ 17 - 10
svr/svr-iot/src/main/resources/application.yml

@ -81,6 +81,8 @@ spring:
    url: http://www.xmtyw.cn/wlyy/
    url: http://www.xmtyw.cn/wlyy/
    appid: 915d0345-5b1d-11e6-8344-fa163e8aee61
    appid: 915d0345-5b1d-11e6-8344-fa163e8aee61
    appsecret: 915d0345-5b1d-11e6-8344-fa163e8aee57
    appsecret: 915d0345-5b1d-11e6-8344-fa163e8aee57
#hlw:
#  baseUrl: https://zb.xmtyw.cn/medicine/cityihealth/base
es:
es:
  pwflag: 1 # 1需要密码,2不需要密码
  pwflag: 1 # 1需要密码,2不需要密码
  index:
  index:
@ -118,6 +120,8 @@ spring:
    url: http://www.xmtyw.cn/wlyy/
    url: http://www.xmtyw.cn/wlyy/
    appid: 915d0345-5b1d-11e6-8344-fa163e8aee61
    appid: 915d0345-5b1d-11e6-8344-fa163e8aee61
    appsecret: 915d0345-5b1d-11e6-8344-fa163e8aee57
    appsecret: 915d0345-5b1d-11e6-8344-fa163e8aee57
#hlw:
#  baseUrl: https://zb.xmtyw.cn/medicine/cityihealth/base
es:
es:
  pwflag: 1 # 1需要密码,2不需要密码
  pwflag: 1 # 1需要密码,2不需要密码
  index:
  index:
@ -155,6 +159,8 @@ spring:
    url: http://ehr.yihu.com/wlyy/
    url: http://ehr.yihu.com/wlyy/
    appid: 915d0345-5b1d-11e6-8344-fa163e8aee62
    appid: 915d0345-5b1d-11e6-8344-fa163e8aee62
    appsecret: 915d0345-5b1d-11e6-8344-fa163e8aee62
    appsecret: 915d0345-5b1d-11e6-8344-fa163e8aee62
#hlw:
#  baseUrl: https://zb.xmtyw.cn/medicine/cityihealth/base
es:
es:
  pwflag: 1 # 1需要密码,2不需要密码
  pwflag: 1 # 1需要密码,2不需要密码
  index:
  index:
@ -192,8 +198,9 @@ spring:
    url: http://ehr.yihu.com/wlyy/
    url: http://ehr.yihu.com/wlyy/
    appid: 915d0345-5b1d-11e6-8344-fa163e8aee62
    appid: 915d0345-5b1d-11e6-8344-fa163e8aee62
    appsecret: 915d0345-5b1d-11e6-8344-fa163e8aee62
    appsecret: 915d0345-5b1d-11e6-8344-fa163e8aee62
hlw:
  baseUrl: http://ehr.yihu.com/hlwyy/cityihealth/base
#hlw:
#  baseUrl: https://zb.xmtyw.cn/medicine/cityihealth/base    正式
#  #http://ehr.yihu.com/hlwyy/cityihealth/base     测试
es:
es:
  pwflag: 1 # 1需要密码,2不需要密码
  pwflag: 1 # 1需要密码,2不需要密码
  index:
  index:
@ -231,8 +238,8 @@ spring:
    url: http://ehr.yihu.com/wlyy/
    url: http://ehr.yihu.com/wlyy/
    appid: 915d0345-5b1d-11e6-8344-fa163e8aee62
    appid: 915d0345-5b1d-11e6-8344-fa163e8aee62
    appsecret: 915d0345-5b1d-11e6-8344-fa163e8aee62
    appsecret: 915d0345-5b1d-11e6-8344-fa163e8aee62
hlw:
  baseUrl: http://ehr.yihu.com/hlwyy/cityihealth/base
#hlw:
#  baseUrl: https://zb.xmtyw.cn/medicine/cityihealth/base
fast-dfs:
fast-dfs:
  tracker-server: 172.26.0.110:22122 #服务器地址
  tracker-server: 172.26.0.110:22122 #服务器地址
fastDFS:
fastDFS:
@ -257,8 +264,8 @@ spring:
    url: http://www.xmtyw.cn/wlyy/
    url: http://www.xmtyw.cn/wlyy/
    appid: 915d0345-5b1d-11e6-8344-fa163e8aee61
    appid: 915d0345-5b1d-11e6-8344-fa163e8aee61
    appsecret: 915d0345-5b1d-11e6-8344-fa163e8aee57
    appsecret: 915d0345-5b1d-11e6-8344-fa163e8aee57
hlw:
  baseUrl: http://ehr.yihu.com/hlwyy/cityihealth/base
#hlw:
#  baseUrl: http://ehr.yihu.com/hlwyy/cityihealth/base
fast-dfs:
fast-dfs:
  tracker-server: 10.95.22.139:22122 #服务器地址
  tracker-server: 10.95.22.139:22122 #服务器地址
fastDFS:
fastDFS:
@ -282,8 +289,8 @@ spring:
    url: http://www.xmtyw.cn/wlyy/
    url: http://www.xmtyw.cn/wlyy/
    appid: 915d0345-5b1d-11e6-8344-fa163e8aee61
    appid: 915d0345-5b1d-11e6-8344-fa163e8aee61
    appsecret: 915d0345-5b1d-11e6-8344-fa163e8aee57
    appsecret: 915d0345-5b1d-11e6-8344-fa163e8aee57
hlw:
  baseUrl: http://ehr.yihu.com/hlwyy/cityihealth/base
#hlw:
#  baseUrl: https://zb.xmtyw.cn/medicine/cityihealth/base
fast-dfs:
fast-dfs:
  tracker-server: 10.95.22.139:22122 #服务器地址
  tracker-server: 10.95.22.139:22122 #服务器地址
fastDFS:
fastDFS:
@ -307,8 +314,8 @@ spring:
    url: http://www.xmtyw.cn/wlyytest/
    url: http://www.xmtyw.cn/wlyytest/
    appid: 915d0345-5b1d-11e6-8344-fa163e8aee62
    appid: 915d0345-5b1d-11e6-8344-fa163e8aee62
    appsecret: 915d0345-5b1d-11e6-8344-fa163e8aee62
    appsecret: 915d0345-5b1d-11e6-8344-fa163e8aee62
hlw:
  baseUrl: http://ehr.yihu.com/hlwyy/cityihealth/base
#hlw:
#  baseUrl: https://zb.xmtyw.cn/medicine/cityihealth/base
es:
es:
  pwflag: 1 # 1需要密码,2不需要密码
  pwflag: 1 # 1需要密码,2不需要密码
  host:  http://10.90.32.3:20011
  host:  http://10.90.32.3:20011

+ 1 - 1
svr/svr-iot/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
spring:
  application:
  application:
    name:  svr-iot
    name:  svr-iot-wsl
  cloud:
  cloud:
    config:
    config:
      failFast: true
      failFast: true