后台设备接口

master
杨万里 2 years ago
parent e5e2a4d3d5
commit 79795e34dd

@ -6,8 +6,10 @@ import javax.validation.Valid;
import com.ruoyi.basetyre.domain.BaseCarQueue;
import com.ruoyi.basetyre.domain.BaseCarType;
import com.ruoyi.basetyre.domain.BaseDevice;
import com.ruoyi.basetyre.service.IBaseCarQueueService;
import com.ruoyi.basetyre.service.IBaseCarTypeService;
import com.ruoyi.basetyre.service.IBaseDeviceService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -43,7 +45,8 @@ public class BaseCarController extends BaseController
private IBaseCarQueueService baseCarQueueService;
@Autowired
private IBaseCarTypeService baseCarTypeService;
@Autowired
private IBaseDeviceService baseDeviceService;
/**
*
*/
@ -52,7 +55,7 @@ public class BaseCarController extends BaseController
public TableDataInfo list(BaseCar baseCar)
{
startPage();
List<BaseCar> list = baseCarService.selectBaseCarList(baseCar);
List<BaseCar> list = baseCarService.queryList(baseCar);
return getDataTable(list);
}
@ -128,4 +131,14 @@ public class BaseCarController extends BaseController
ajaxResult.put("CarTypeList",baseCarTypeList);
return ajaxResult;
}
@GetMapping("/getDeviceList")
public TableDataInfo getDeviceList(String deviceId){
BaseDevice baseDevice = new BaseDevice();
baseDevice.setState((long) 0);
baseDevice.setInternetThingsNo(deviceId);
List<BaseDevice> baseDeviceList = baseDeviceService.selectBaseDeviceList(baseDevice);
return getDataTable(baseDeviceList);
}
}

@ -58,4 +58,6 @@ public interface BaseCarMapper
* @return
*/
public int deleteBaseCarByIds(String[] ids);
List<BaseCar> queryList(BaseCar baseCar);
}

@ -27,6 +27,14 @@ public interface IBaseCarService
*/
public List<BaseCar> selectBaseCarList(BaseCar baseCar);
/**
*
* @param baseCar
* @return
*/
public List<BaseCar> queryList(BaseCar baseCar);
/**
*
*

@ -48,6 +48,11 @@ public class BaseCarServiceImpl implements IBaseCarService
return baseCarMapper.selectBaseCarList(baseCar);
}
@Override
public List<BaseCar> queryList(BaseCar baseCar) {
return baseCarMapper.queryList(baseCar);
}
/**
*
*

@ -37,10 +37,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectBaseCarVo">
select id, company_code, car_queue_id, car_type_id, car_license, car_license_in, car_license_parent, car_id_parent, user_id, user_name, device_id, device_bind_time, first_change_date, trailer_num, is_hand_device, is_has_device, longitude, latitude, tires_total, is_delete, create_time, create_id, create_by, create_name, modify_time, modify_id, modify_by from base_car
</sql>
<select id="queryList" parameterType="BaseCar" resultMap="BaseCarResult">
SELECT
bc.id,
bcq.title car_queue_id,
bct.title car_type_id,
bc.car_license,
bc.device_id,
bc.device_bind_time,
bc.create_time,
bc.create_by,
bc.create_name
FROM
base_car bc
LEFT JOIN base_car_queue bcq ON bc.car_queue_id = bcq.id
LEFT JOIN base_car_type bct ON bct.id = bc.car_type_id
<where>
<if test="carLicense != null and carLicense != ''"> and bc.car_license = #{carLicense}</if>
</where>
</select>
<select id="selectBaseCarList" parameterType="BaseCar" resultMap="BaseCarResult">
<include refid="selectBaseCarVo"/>
<where>
<where>
<if test="companyCode != null and companyCode != ''"> and company_code = #{companyCode}</if>
<if test="carQueueId != null and carQueueId != ''"> and car_queue_id = #{carQueueId}</if>
<if test="carTypeId != null and carTypeId != ''"> and car_type_id = #{carTypeId}</if>

@ -34,7 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="tyreFacCode != null and tyreFacCode != ''"> and tyre_fac_code = #{tyreFacCode}</if>
<if test="companyCode != null and companyCode != ''"> and company_code = #{companyCode}</if>
<if test="internetThingsNo != null and internetThingsNo != ''"> and internet_things_no = #{internetThingsNo}</if>
<if test="internetThingsNo != null and internetThingsNo != ''"> and internet_things_no like concat('%', #{internetThingsNo}, '%') </if>
<if test="simCode != null and simCode != ''"> and sim_code = #{simCode}</if>
<if test="deviceType != null "> and device_type = #{deviceType}</if>
<if test="state != null "> and state = #{state}</if>

@ -81,7 +81,7 @@
<el-button
icon="Finished"
type="text"
@click="handleBang(scope.row.id)"
@click="handleBang()"
>
绑定接收器
</el-button>
@ -98,19 +98,18 @@
@pagination="getList"
/>
<el-dialog v-model="bangOpen" append-to-body title="绑定接收器" width="500px" @close="()=>{bindValue='';bindInput=''}">
<el-input v-model="bindInput" style="width:200px"/>
<el-button type="primary" @click="bindSearch"></el-button>
<el-dialog @close="()=>{bindValue='';bindInput=''}" v-model="bangOpen" append-to-body title="绑定接收器" width="500px">
<el-input style="width:200px" v-model="bindInput" /> <el-button type="primary" @click="bindSearch" >搜索</el-button>
<el-table ref="bindRef" v-loading="loading" :data="bindList">
<el-table-column align="center" width="25">
<template #default="scope">
<el-radio-group v-model="bindValue">
<el-radio :label="scope.row.id" @click="bindHandleSelectionChange(scope.row.internetThingsNo)"></el-radio>
<el-radio @click="bindHandleSelectionChange(scope.row.id)" :label="scope.row.id"> </el-radio>
</el-radio-group>
</template>
</el-table-column>
<el-table-column align="center" label="接收器编号" prop="internetThingsNo" width="150"/>
<el-table-column align="center" label="设备类型" prop="deviceType"/>
<el-table-column align="center" label="接收器编号" prop="carLicense" width="150"/>
<el-table-column align="center" label="设备类型" prop="carQueueId"/>
</el-table>
<template #footer>
<div class="dialog-footer">

Loading…
Cancel
Save