LAPTOP-KB9HII50\70708 2 months ago
parent
commit
1e8c20ff2f

+ 19 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/a4endpoint/MedicineDeviceEndpoint.java

@ -42,6 +42,25 @@ public class MedicineDeviceEndpoint extends EnvelopRestEndpoint {
    @Value("${wechat.id}")
    private String wechatId;
    @GetMapping(value = "sendSocketMessage")
    @ApiOperation(value = "socket发送事件")
    public Envelop sendSocketMessage(
            @ApiParam(name = "equNum", value = "设备编码",required = true)
            @RequestParam(value = "equNum", required = true) String equNum,
            @ApiParam(name = "type", value = "指令类型",required = true)
            @RequestParam(value = "type", required = true) String type,
            @ApiParam(name = "message", value = "指令说明",required = true)
            @RequestParam(value = "message", required = true) String message){
        try {
            medicineServive.sendSocketMessage(equNum+"_T",type,message);
            return Envelop.getSuccess("操作成功");
        }catch (Exception e){
            e.printStackTrace();
            return Envelop.getError("操作失败");
        }
    }
    @GetMapping(value = "patientReqLogPage")
    @ApiOperation(value = "居民请求运行日志")
    public PageEnvelop patientReqLogPage(

+ 9 - 8
svr/svr-base/src/main/java/com/yihu/jw/base/service/a3service/MedicinedeviceService.java

@ -239,18 +239,19 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
    //货道信息列表
    public PageEnvelop cabinetInventoryPage(Integer page,Integer size,String idDevice,String startTime,String endTime){
        String sql = "select id,id_device idDevice,state,num,layer_no layerNo,wayer_no wayerNo,qty,drug_name drugName" +
                ",cargo_capacity cargoCapacity,shelf_status shelfStatus,cargo_state cargoState,fault_state faultState" +
                ",if(fault_state='1','故障',if(fault_state='0','正常','')) faultStateNam,if(cargo_state='1','开启',if(cargo_state='0','关闭','')) cargoStateName" +
                ",if(shelf_status='1','上架',if(shelf_status='0','下架','')) shelfStatusName,delivery_address" +
                ",DATE_FORMAT(update_time,'%Y-%m-%d %H:%i:%S') updateTime";
        String sql = "select i.id,i.id_device idDevice,i.state,i.num,i.layer_no layerNo,i.wayer_no wayerNo,i.qty,i.drug_name drugName" +
                ",i.cargo_capacity cargoCapacity,i.shelf_status shelfStatus,i.cargo_state cargoState,i.fault_state faultState" +
                ",if(i.fault_state='1','故障',if(i.fault_state='0','正常','')) faultStateNam,if(i.cargo_state='1','开启',if(i.cargo_state='0','关闭','')) cargoStateName" +
                ",if(i.shelf_status='1','上架',if(i.shelf_status='0','下架','')) shelfStatusName,d.delivery_address deliveryAddress " +
                ",DATE_FORMAT(i.update_time,'%Y-%m-%d %H:%i:%S') updateTime";
        String countSql = "select count(id) ";
        String filter = " from t_mediicinecabinet_inventory where id_device='"+idDevice+"' ";
        String filter = " from t_mediicinecabinet_inventory i,t_mediicine_device d " +
                " where i.id_device='"+idDevice+"' and i.id_device=d.id ";
        if(!StringUtils.isEmpty(startTime)){
            filter += " and update_time>='"+startTime+"'";
            filter += " and i.update_time>='"+startTime+"'";
        }
        if(!StringUtils.isEmpty(endTime)){
            filter += " and update_time<='"+endTime+"'";
            filter += " and i.update_time<='"+endTime+"'";
        }
        String orderBy = " order by fault_state desc,update_time desc limit "+(page-1)*size+","+size;