Browse Source

[解决bug]

wangzhinan 3 years ago
parent
commit
15c9a2403e

+ 5 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/a4endpoint/MedicineWarrayEndpoint.java

@ -64,6 +64,10 @@ public class MedicineWarrayEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "lowT",required = false) String lowT,
            @ApiParam(name = "heightT", value = "温度上限", required = false, defaultValue = "")
            @RequestParam(value = "heightT",required = false) String heightT,
            @ApiParam(name = "lowH", value = "湿度下限", required = false, defaultValue = "")
            @RequestParam(value = "lowH",required = false) String lowH,
            @ApiParam(name = "heightH", value = "湿度上限", required = false, defaultValue = "")
            @RequestParam(value = "heightH",required = false) String heightH,
            @ApiParam(name = "content", value = "搜索内容")
            @RequestParam(value = "content", required = false) String content,
            @ApiParam(name = "startTime", value = "开始时间", required = false, defaultValue = "")
@ -74,7 +78,7 @@ public class MedicineWarrayEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "分页大小", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        JSONObject result = warraytService.getTemperature(equNum, equType,networkStatus, lowT, heightT, content,startTime, endTime,page,size);
        JSONObject result = warraytService.getTemperature(equNum, equType,networkStatus, lowT, heightT,lowH,heightH, content,startTime, endTime,page,size);
        return success(result.getJSONArray("msg"),result.getInteger("count"),page,size);
    }

+ 2 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/service/a3service/MedicineDrugsService.java

@ -301,7 +301,7 @@ public class MedicineDrugsService extends BaseJpaService<Mediicinedrugs, Mediici
            conditionSql += " and t.state = '" + state + "'";
        }
        if (!StringUtils.isEmpty(content)){
            conditionSql += " AND CONCAT(IFNULL(t.`drug_code`,''), IFNULL(t.`drug_bar_code`,''), IFNULL(t.`drug_name`,''), IFNULL(t.`drug_short_code`,'')) like '%"+content+"%'";
            conditionSql += " AND CONCAT(IFNULL(t.drug_code,''), IFNULL(t.drug_bar_code,''), IFNULL(t.drug_name,''), IFNULL(t.drug_short_code,''), IFNULL(lower(t.spell_code),'')) like '%"+content.toLowerCase()+"%'";
        }
        if (!StringUtils.isEmpty(drugClass)){
            conditionSql += " and t.drug_class_code = '" + drugClass + "'";
@ -415,7 +415,7 @@ public class MedicineDrugsService extends BaseJpaService<Mediicinedrugs, Mediici
        String conditionSql = " WHERE t.org_code = '" + mediicinedevice.getBelongCommunity() + "'\n";
        if (!StringUtils.isEmpty(content)) {
            conditionSql += " AND CONCAT(IFNULL(t.drug_name,''),IFNULL(t.drug_code,''),IFNULL(t.drug_name_alies,''),IFNULL(t.spell_code,'')) LIKE '%" + content + "%'";
            conditionSql += " AND CONCAT(IFNULL(t.drug_name,''),IFNULL(t.drug_code,''),IFNULL(t.drug_name_alies,''),IFNULL(lower(t.spell_code),'')) LIKE '%" + content.toLowerCase() + "%'";
        }
//        List<Mediicinedrugs> mediicinedrugs = drugsDao.findMediicinedrugsByOrgCode(mediicinedevice.getBelongCommunity());
        result.put("msg", hibenateUtils.createSQLQuery(sql + conditionSql));

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/service/a3service/MedicineOrderService.java

@ -440,7 +440,7 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
        jsonObject.put("orderTypeName", orderTypeMap.get(mediicineorder.getOrderType()));
        //取药码
        jsonObject.put("pickUpNum", mediicineorder.getPickUpNum());
        jsonObject.put("device", StringUtils.isEmpty(mediicineorder.getShippingEqu()) ? null : deviceDao.findOne(mediicineorder.getShippingEqu()));
        jsonObject.put("device", StringUtils.isEmpty(mediicineorder.getShippingEqu()) ? null : deviceDao.findMediicinedeviceByEquNum(mediicineorder.getShippingEqu()));
        result.put("msg", jsonObject);
        result.put("response", ConstantUtils.SUCCESS);
        return result;

+ 25 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/a3service/MedicineServive.java

@ -121,4 +121,29 @@ public class MedicineServive {
            throw new Exception("调用设备通信接口设置温湿度失败!");
        }*/
    }
    /*public void sendSocketMessage(String devId, String type,String message) throws Exception {
        JSONObject object = new JSONObject();
        String param = "";
        if (StringUtils.isNoneBlank(devId)) {
            param = "?devId=" + devId;
        }
        if (StringUtils.isNoneBlank(temperature)) {
            param += "?temperature=" + temperature;
        }
        if (StringUtils.isNoneBlank(humidity)) {
            param += "?humidity=" + humidity;
        }
        param += "?temperatureControl=" + temperatureControl;
        param += "?humidityControl=" + humidityControl;
        param += "?heat=" + heat;
        String res = httpClientUtil.get(socketUrl+param,"utf-8");
        System.out.println(res);
        *//* if (StringUtils.isNoneBlank(res)){
            object =JSONObject.parseObject(res);
        }else{
            throw new Exception("调用设备通信接口设置温湿度失败!");
        }*//*
    }*/
}

+ 12 - 8
svr/svr-base/src/main/java/com/yihu/jw/base/service/a3service/MedicineWarrayService.java

@ -80,7 +80,7 @@ public class MedicineWarrayService extends BaseJpaService<Mediicinewarray, Medii
    }
    public JSONObject getTemperature(
            String equNum, String equType, String netStatus, String lowT, String heightT,
            String equNum, String equType, String netStatus, String lowT, String heightT,String lowH,String heightH,
                String content, String startTime, String endTime, int page, int size) throws Exception {
        JSONObject result = new JSONObject();
        String sql = "SELECT\n" +
@ -130,19 +130,25 @@ public class MedicineWarrayService extends BaseJpaService<Mediicinewarray, Medii
//        conditionSql += " and t.type like '%温度%'";
        if (!StringUtils.isEmpty(equNum)){
            conditionSql += " and t.equ_num = '" + equNum + "'";
            conditionSql += " and t.equ_num = '" + equNum + "' ";
        }
        if (!StringUtils.isEmpty(equType)){
            conditionSql += " and t.equ_type = '" + equType + "'";
            conditionSql += " and t.equ_type = '" + equType + "' ";
        }
        if (!StringUtils.isEmpty(netStatus)){
            conditionSql += " and t.network_status = '" + netStatus + "'";
            conditionSql += " and t.network_status = '" + netStatus + "' ";
        }
        if (!StringUtils.isEmpty(lowT)) {
            conditionSql += " and t.temperature >= " + lowT;
            conditionSql += " and t.temperature >= " + lowT +" ";
        }
        if (!StringUtils.isEmpty(heightT)) {
            conditionSql += " and t.temperature <= " + heightT;
            conditionSql += " and t.temperature <= " + heightT +" ";
        }
        if (!StringUtils.isEmpty(lowH)) {
            conditionSql += " and t.humidity >= " + lowH +" ";
        }
        if (!StringUtils.isEmpty(heightH)) {
            conditionSql += " and t.humidity <= " + heightH +" ";
        }
        if (!StringUtils.isEmpty(content)){
            conditionSql += " and CONCAT(IFNULL(t.`equ_name`,''), IFNULL(t.`equ_num`,'')) like '%" + content + "%'";
@ -807,8 +813,6 @@ public class MedicineWarrayService extends BaseJpaService<Mediicinewarray, Medii
        mediicinedevice.setAbnormal(type);
        mediicinedevice.setLogTime(new Date());
        mediicinedevice.setNowHumidity(humidity+"");
        mediicinedevice.setNetworkStatus("1");
        mediicinedevice.setSaleStatus("1");
        deviceDao.save(mediicinedevice);
        Mediicinewarray mediicinewarray = medicinedeviceService.uploadDeviceInfo(equNum, temperature, humidity, type, null, null, null, null);
        result.put("msg",mediicinewarray);