后台设备接口

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.BaseCarQueue;
import com.ruoyi.basetyre.domain.BaseCarType; import com.ruoyi.basetyre.domain.BaseCarType;
import com.ruoyi.basetyre.domain.BaseDevice;
import com.ruoyi.basetyre.service.IBaseCarQueueService; import com.ruoyi.basetyre.service.IBaseCarQueueService;
import com.ruoyi.basetyre.service.IBaseCarTypeService; import com.ruoyi.basetyre.service.IBaseCarTypeService;
import com.ruoyi.basetyre.service.IBaseDeviceService;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -43,7 +45,8 @@ public class BaseCarController extends BaseController
private IBaseCarQueueService baseCarQueueService; private IBaseCarQueueService baseCarQueueService;
@Autowired @Autowired
private IBaseCarTypeService baseCarTypeService; private IBaseCarTypeService baseCarTypeService;
@Autowired
private IBaseDeviceService baseDeviceService;
/** /**
* *
*/ */
@ -52,7 +55,7 @@ public class BaseCarController extends BaseController
public TableDataInfo list(BaseCar baseCar) public TableDataInfo list(BaseCar baseCar)
{ {
startPage(); startPage();
List<BaseCar> list = baseCarService.selectBaseCarList(baseCar); List<BaseCar> list = baseCarService.queryList(baseCar);
return getDataTable(list); return getDataTable(list);
} }
@ -128,4 +131,14 @@ public class BaseCarController extends BaseController
ajaxResult.put("CarTypeList",baseCarTypeList); ajaxResult.put("CarTypeList",baseCarTypeList);
return ajaxResult; 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 * @return
*/ */
public int deleteBaseCarByIds(String[] ids); public int deleteBaseCarByIds(String[] ids);
List<BaseCar> queryList(BaseCar baseCar);
} }

@ -27,6 +27,14 @@ public interface IBaseCarService
*/ */
public List<BaseCar> selectBaseCarList(BaseCar baseCar); 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); 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"> <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 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> </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"> <select id="selectBaseCarList" parameterType="BaseCar" resultMap="BaseCarResult">
<include refid="selectBaseCarVo"/> <include refid="selectBaseCarVo"/>
<where> <where>
<if test="companyCode != null and companyCode != ''"> and company_code = #{companyCode}</if> <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="carQueueId != null and carQueueId != ''"> and car_queue_id = #{carQueueId}</if>
<if test="carTypeId != null and carTypeId != ''"> and car_type_id = #{carTypeId}</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> <where>
<if test="tyreFacCode != null and tyreFacCode != ''"> and tyre_fac_code = #{tyreFacCode}</if> <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="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="simCode != null and simCode != ''"> and sim_code = #{simCode}</if>
<if test="deviceType != null "> and device_type = #{deviceType}</if> <if test="deviceType != null "> and device_type = #{deviceType}</if>
<if test="state != null "> and state = #{state}</if> <if test="state != null "> and state = #{state}</if>

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

Loading…
Cancel
Save