浏览代码

Merge branch 'medicare' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into luofenqiang

luofenqiang 3 年之前
父节点
当前提交
c1d08bbd7b

+ 13 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/a1entity/Mediicinedrugs.java

@ -223,6 +223,11 @@ public class Mediicinedrugs extends UuidIdentityEntityWithOperator implements Se
     */
     */
    private String orgName;
    private String orgName;
    /**
     * 拼音码
     */
    private String spellCode;
    public Mediicinedrugs() {
    public Mediicinedrugs() {
    }
    }
@ -500,4 +505,12 @@ public class Mediicinedrugs extends UuidIdentityEntityWithOperator implements Se
    public void setOrgName(String orgName) {
    public void setOrgName(String orgName) {
        this.orgName = orgName;
        this.orgName = orgName;
    }
    }
    public String getSpellCode() {
        return spellCode;
    }
    public void setSpellCode(String spellCode) {
        this.spellCode = spellCode;
    }
}
}

+ 3 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/a4endpoint/MedicineOutEndpoint.java

@ -133,6 +133,8 @@ public class MedicineOutEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "replenishEr", required = false) String replenishEr,
            @RequestParam(value = "replenishEr", required = false) String replenishEr,
            @ApiParam(name = "docNum", value = "单号")
            @ApiParam(name = "docNum", value = "单号")
            @RequestParam(value = "docNum", required = false) String docNum,
            @RequestParam(value = "docNum", required = false) String docNum,
            @ApiParam(name = "deviceId", value = "设备id")
            @RequestParam(value = "deviceId", required = false) String deviceId,
            @ApiParam(name = "receiveState", value = "领料状态")
            @ApiParam(name = "receiveState", value = "领料状态")
            @RequestParam(value = "receiveState", required = false) String receiveState,
            @RequestParam(value = "receiveState", required = false) String receiveState,
            @ApiParam(name = "userId", value = "用户id")
            @ApiParam(name = "userId", value = "用户id")
@ -141,7 +143,7 @@ public class MedicineOutEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "page") int page,
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
            @RequestParam(value = "size") int size) throws Exception {
        JSONObject result = stockoutService.queryOutListFullInfo(startTime, endTime, replenishEr, docNum,receiveState, userId, page,size,wechatId);
        JSONObject result = stockoutService.queryOutListFullInfo(deviceId,startTime, endTime, replenishEr, docNum,receiveState, userId, page,size,wechatId);
        return success(result.getJSONArray("msg"),result.getInteger("count"),page,size);
        return success(result.getJSONArray("msg"),result.getInteger("count"),page,size);
    }
    }

+ 3 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/a4endpoint/MedicineUpEndpoint.java

@ -101,13 +101,15 @@ public class MedicineUpEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "community", required = false) String community,
            @RequestParam(value = "community", required = false) String community,
            @ApiParam(name = "state", value = "备货单状态,1已生成,2未生成,3删除")
            @ApiParam(name = "state", value = "备货单状态,1已生成,2未生成,3删除")
            @RequestParam(value = "state", required = false) String state,
            @RequestParam(value = "state", required = false) String state,
            @ApiParam(name = "deviceId", value = "设备id")
            @RequestParam(value = "deviceId", required = false) String deviceId,
            @ApiParam(name = "userId", value = "用户id")
            @ApiParam(name = "userId", value = "用户id")
            @RequestParam(value = "userId", required = true) String userId,
            @RequestParam(value = "userId", required = true) String userId,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
            @RequestParam(value = "size") int size) throws Exception {
        JSONObject result = stockupService.queryUpListFullInfo(startTime, endTime, content, community, state, userId,page,size,wechatId);
        JSONObject result = stockupService.queryUpListFullInfo(deviceId,startTime, endTime, content, community, state, userId,page,size,wechatId);
        return success(result.getJSONArray("msg"),result.getInteger("count"),page,size);
        return success(result.getJSONArray("msg"),result.getInteger("count"),page,size);
    }
    }

+ 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,
            @RequestParam(value = "lowT",required = false) String lowT,
            @ApiParam(name = "heightT", value = "温度上限", required = false, defaultValue = "")
            @ApiParam(name = "heightT", value = "温度上限", required = false, defaultValue = "")
            @RequestParam(value = "heightT",required = false) String heightT,
            @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 = "搜索内容")
            @ApiParam(name = "content", value = "搜索内容")
            @RequestParam(value = "content", required = false) String content,
            @RequestParam(value = "content", required = false) String content,
            @ApiParam(name = "startTime", value = "开始时间", required = false, defaultValue = "")
            @ApiParam(name = "startTime", value = "开始时间", required = false, defaultValue = "")
@ -74,7 +78,7 @@ public class MedicineWarrayEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "page") int page,
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "分页大小", required = true, defaultValue = "15")
            @ApiParam(name = "size", value = "分页大小", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
            @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);
        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 + "'";
            conditionSql += " and t.state = '" + state + "'";
        }
        }
        if (!StringUtils.isEmpty(content)){
        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)){
        if (!StringUtils.isEmpty(drugClass)){
            conditionSql += " and t.drug_class_code = '" + 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";
        String conditionSql = " WHERE t.org_code = '" + mediicinedevice.getBelongCommunity() + "'\n";
        if (!StringUtils.isEmpty(content)) {
        if (!StringUtils.isEmpty(content)) {
            conditionSql += " AND CONCAT(IFNULL(t.`drug_name`,''),IFNULL(t.`drug_code`,''),IFNULL(t.`drug_name_alies`,'')) 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());
//      List<Mediicinedrugs> mediicinedrugs = drugsDao.findMediicinedrugsByOrgCode(mediicinedevice.getBelongCommunity());
        result.put("msg", hibenateUtils.createSQLQuery((sql+conditionSql),page,size));
        result.put("msg", hibenateUtils.createSQLQuery((sql+conditionSql),page,size));

+ 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("orderTypeName", orderTypeMap.get(mediicineorder.getOrderType()));
        //取药码
        //取药码
        jsonObject.put("pickUpNum", mediicineorder.getPickUpNum());
        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("msg", jsonObject);
        result.put("response", ConstantUtils.SUCCESS);
        result.put("response", ConstantUtils.SUCCESS);
        return result;
        return result;

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

@ -69,6 +69,7 @@ public class MedicineServive {
                        org.setOrgCode(h.getString("orgCode"));
                        org.setOrgCode(h.getString("orgCode"));
                        org.setQuantityUnit(h.getString("quantity_unit_name"));
                        org.setQuantityUnit(h.getString("quantity_unit_name"));
                        org.setPackUnit(h.getString("pack_unit_name"));
                        org.setPackUnit(h.getString("pack_unit_name"));
                        org.setSpellCode(h.getString("spellCode"));
                        list.add(org);
                        list.add(org);
                        addCount++;
                        addCount++;
                    } else {
                    } else {
@ -85,6 +86,7 @@ public class MedicineServive {
                        org.setOrgCode(h.getString("orgCode"));
                        org.setOrgCode(h.getString("orgCode"));
                        org.setQuantityUnit(h.getString("quantity_unit_name"));
                        org.setQuantityUnit(h.getString("quantity_unit_name"));
                        org.setPackUnit(h.getString("pack_unit_name"));
                        org.setPackUnit(h.getString("pack_unit_name"));
                        org.setSpellCode(h.getString("spellCode"));
                        list.add(org);
                        list.add(org);
                        updateCount++;
                        updateCount++;
                    }
                    }
@ -119,4 +121,29 @@ public class MedicineServive {
            throw new Exception("调用设备通信接口设置温湿度失败!");
            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("调用设备通信接口设置温湿度失败!");
        }*//*
    }*/
}
}

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

@ -297,8 +297,7 @@ public class MedicineStockOutService extends BaseJpaService<Mediicinestockout, M
    //orderNum, equNum, contact, startTime, endTime, sellState, orderState, dispensingWindow
    //orderNum, equNum, contact, startTime, endTime, sellState, orderState, dispensingWindow
    public JSONObject queryOutListFullInfo(
                                             String startTime, String endTime, String replenishEr,
    public JSONObject queryOutListFullInfo(String deviceId,String startTime, String endTime, String replenishEr,
                                             String docNum, String receiveState, String userId, int page, int size,String wechatId) throws Exception {
                                             String docNum, String receiveState, String userId, int page, int size,String wechatId) throws Exception {
        JSONObject result = new JSONObject();
        JSONObject result = new JSONObject();
        UserDO user = userDao.findOne(userId);
        UserDO user = userDao.findOne(userId);
@ -398,6 +397,10 @@ public class MedicineStockOutService extends BaseJpaService<Mediicinestockout, M
        if (!StringUtils.isEmpty(docNum)){
        if (!StringUtils.isEmpty(docNum)){
            conditionSql += " and t.doc_num like '%" + docNum + "%'";
            conditionSql += " and t.doc_num like '%" + docNum + "%'";
        }
        }
        if (!StringUtils.isEmpty(deviceId)){
             conditionSql +=" and t.replenish_equ ='"+deviceId+"' ";
        }
        sql = sql + conditionSql +" order by t.receive_state asc,t.doc_time desc ";
        sql = sql + conditionSql +" order by t.receive_state asc,t.doc_time desc ";
        List<Map<String,Object>> list=null;
        List<Map<String,Object>> list=null;

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

@ -246,8 +246,7 @@ public class MedicineStockUpService extends BaseJpaService<Mediicinestockup, Med
    }
    }
    public JSONObject queryUpListFullInfo(
            String startTime, String endTime, String content,
    public JSONObject queryUpListFullInfo(String deviceId,String startTime, String endTime, String content,
            String community, String state, String userId, int page, int size,String wechatId) throws Exception {
            String community, String state, String userId, int page, int size,String wechatId) throws Exception {
        JSONObject result = new JSONObject();
        JSONObject result = new JSONObject();
        UserDO user = userDao.findOne(userId);
        UserDO user = userDao.findOne(userId);
@ -347,6 +346,9 @@ public class MedicineStockUpService extends BaseJpaService<Mediicinestockup, Med
        if (!StringUtils.isEmpty(state)){
        if (!StringUtils.isEmpty(state)){
            conditionSql += " and t.state = '" + state + "'";
            conditionSql += " and t.state = '" + state + "'";
        }
        }
        if (!StringUtils.isEmpty(deviceId)){
            conditionSql += " and t.replenish_equ = '" + deviceId + "'";
        }
        sql = sql + conditionSql +" order by t.state desc,t.doc_time desc  ";
        sql = sql + conditionSql +" order by t.state desc,t.doc_time desc  ";
        List<Map<String,Object>> list=null;
        List<Map<String,Object>> list=null;

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

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

@ -2555,6 +2555,7 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
                "\tdir.layer_no as layerNo,\n" +
                "\tdir.layer_no as layerNo,\n" +
                "\tdir.wayer_no as wayerNo,\n" +
                "\tdir.wayer_no as wayerNo,\n" +
                "\tdir.merge_cargo as mergeCargo,\n" +
                "\tdir.merge_cargo as mergeCargo,\n" +
                "\tdir.quantity as quantity,\n" +
                "\tdir.merge_state as mergeState\n" +
                "\tdir.merge_state as mergeState\n" +
                "FROM\n" +
                "FROM\n" +
                "\tt_medicine_drug_inventory_record dir\n" +
                "\tt_medicine_drug_inventory_record dir\n" +