新增文件

master
Yangwl 2 years ago
parent d41a3e9d84
commit b3671a6d77

@ -6,6 +6,9 @@ spring:
druid:
# 主库数据源
master:
# url: jdbc:sqlserver://172.30.12.8:1433;SelectMethod=cursor;DatabaseName=XY_SMART_TIRE
# username: tscpdb
# password: MSSQL@bs.c321
url: jdbc:sqlserver://172.16.251.187:1433;SelectMethod=cursor;DatabaseName=XY_SMART_TIRE
username: DNC
password: dnc
@ -14,6 +17,7 @@ spring:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
# 初始连接数

@ -1,33 +1,29 @@
package com.ruoyi.basetyre.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import com.ruoyi.basetyre.domain.BaseCar;
import com.ruoyi.basetyre.domain.BaseCarQueue;
import com.ruoyi.basetyre.domain.BaseCarType;
import com.ruoyi.basetyre.domain.BaseDevice;
import com.ruoyi.basetyre.domain.vo.CarTyres;
import com.ruoyi.basetyre.service.IBaseCarQueueService;
import com.ruoyi.basetyre.service.IBaseCarService;
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;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.basetyre.domain.BaseCar;
import com.ruoyi.basetyre.service.IBaseCarService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Controller
@ -123,7 +119,7 @@ public class BaseCarController extends BaseController
@GetMapping("/getCarQueueAndType")
public AjaxResult getCarQueue_Type(){
BaseCarQueue baseCarQueue=new BaseCarQueue();
BaseCarType baseCarType = new BaseCarType();
BaseCarType baseCarType = new BaseCarType();
baseCarQueue.setState((long) 0);
baseCarQueue.setState((long) 0);
List<BaseCarQueue> baseCarQueueList = baseCarQueueService.selectBaseCarQueueList(baseCarQueue);
@ -155,4 +151,16 @@ public class BaseCarController extends BaseController
return success(baseCarList);
}
@GetMapping("/carTyres")
public AjaxResult carTyres(BaseCar baseCar){
//查询车辆车型
List<BaseCar> list = baseCarService.queryList(baseCar);
baseCar=list.get(0);
Map map=new HashMap();
map.put("carType",baseCar.getCarTypeId());
List<CarTyres> carTyresList = baseCarService.selectCarTyres(baseCar);
map.put("carTyresList",carTyresList);
return success(map);
}
}

@ -0,0 +1,104 @@
package com.ruoyi.basetyre.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.basetyre.domain.BaseCarGpsRecord;
import com.ruoyi.basetyre.service.IBaseCarGpsRecordService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* GPSController
*
* @author Yangwl
* @date 2023-03-14
*/
@RestController
@RequestMapping("/basetyre/BaseCarGpsRecord")
public class BaseCarGpsRecordController extends BaseController
{
@Autowired
private IBaseCarGpsRecordService baseCarGpsRecordService;
/**
* GPS
*/
@PreAuthorize("@ss.hasPermi('basetyre:BaseCarGpsRecord:list')")
@GetMapping("/list")
public TableDataInfo list(BaseCarGpsRecord baseCarGpsRecord)
{
startPage();
List<BaseCarGpsRecord> list = baseCarGpsRecordService.selectBaseCarGpsRecordList(baseCarGpsRecord);
return getDataTable(list);
}
/**
* GPS
*/
@PreAuthorize("@ss.hasPermi('basetyre:BaseCarGpsRecord:export')")
@Log(title = "车辆GPS记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BaseCarGpsRecord baseCarGpsRecord)
{
List<BaseCarGpsRecord> list = baseCarGpsRecordService.selectBaseCarGpsRecordList(baseCarGpsRecord);
ExcelUtil<BaseCarGpsRecord> util = new ExcelUtil<BaseCarGpsRecord>(BaseCarGpsRecord.class);
util.exportExcel(response, list, "车辆GPS记录数据");
}
/**
* GPS
*/
@PreAuthorize("@ss.hasPermi('basetyre:BaseCarGpsRecord:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(baseCarGpsRecordService.selectBaseCarGpsRecordById(id));
}
/**
* GPS
*/
@PreAuthorize("@ss.hasPermi('basetyre:BaseCarGpsRecord:add')")
@Log(title = "车辆GPS记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BaseCarGpsRecord baseCarGpsRecord)
{
return toAjax(baseCarGpsRecordService.insertBaseCarGpsRecord(baseCarGpsRecord));
}
/**
* GPS
*/
@PreAuthorize("@ss.hasPermi('basetyre:BaseCarGpsRecord:edit')")
@Log(title = "车辆GPS记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BaseCarGpsRecord baseCarGpsRecord)
{
return toAjax(baseCarGpsRecordService.updateBaseCarGpsRecord(baseCarGpsRecord));
}
/**
* GPS
*/
@PreAuthorize("@ss.hasPermi('basetyre:BaseCarGpsRecord:remove')")
@Log(title = "车辆GPS记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(baseCarGpsRecordService.deleteBaseCarGpsRecordByIds(ids));
}
}

@ -1,26 +1,19 @@
package com.ruoyi.basetyre.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.basetyre.domain.BaseCarQueue;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.basetyre.service.IBaseCarQueueService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.basetyre.service.IBaseCarQueueService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller

@ -1,25 +1,19 @@
package com.ruoyi.basetyre.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.basetyre.domain.BaseCarType;
import com.ruoyi.basetyre.service.IBaseCarTypeService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.basetyre.domain.BaseCarType;
import com.ruoyi.basetyre.service.IBaseCarTypeService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller

@ -1,25 +1,19 @@
package com.ruoyi.basetyre.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.basetyre.domain.BaseDevice;
import com.ruoyi.basetyre.service.IBaseDeviceService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.basetyre.domain.BaseDevice;
import com.ruoyi.basetyre.service.IBaseDeviceService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller

@ -1,27 +1,22 @@
package com.ruoyi.basetyre.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.utils.uuid.UUID;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.basetyre.domain.BaseTyre;
import com.ruoyi.basetyre.domain.vo.CarTyres;
import com.ruoyi.basetyre.service.IBaseTyreService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.basetyre.domain.BaseTyre;
import com.ruoyi.basetyre.service.IBaseTyreService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* Controller
@ -70,6 +65,25 @@ public class BaseTyreController extends BaseController
{
return success(baseTyreService.selectBaseTyreById(id));
}
/**
*
*/
@GetMapping("/getTyreInfoById")
public AjaxResult getTyreInfoById(@RequestParam("outerTireNumber") String outerTireNumber)
{
BaseTyre baseTyre= baseTyreService.getTyreInfoById(outerTireNumber);
return success(baseTyre);
}
@GetMapping("/getTyreLife")
public AjaxResult getTyreLife(@RequestParam("outerTireNumber") String outerTireNumber)
{
// Map<String, Object>
return baseTyreService.getTyreLife(outerTireNumber);
}
/**
*
@ -79,6 +93,10 @@ public class BaseTyreController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody BaseTyre baseTyre)
{
if (UserConstants.NOT_UNIQUE.equals(baseTyreService.checkBaseTyreUnique(baseTyre)))
{
return error("新增轮胎'" + baseTyre.getOuterTireNumber() + "'失败,外胎号已存在");
}
return toAjax(baseTyreService.insertBaseTyre(baseTyre));
}
@ -90,6 +108,10 @@ public class BaseTyreController extends BaseController
@PutMapping
public AjaxResult edit(@RequestBody BaseTyre baseTyre)
{
if (UserConstants.NOT_UNIQUE.equals(baseTyreService.checkBaseTyreUnique(baseTyre)))
{
return error("修改轮胎'" + baseTyre.getOuterTireNumber() + "'失败,外胎号已存在");
}
return toAjax(baseTyreService.updateBaseTyre(baseTyre));
}
@ -104,5 +126,39 @@ public class BaseTyreController extends BaseController
return toAjax(baseTyreService.deleteBaseTyreByIds(ids));
}
/**
*
* @param baseTyre
* @return
*/
@PostMapping("/insertBaseTyres")
public AjaxResult insertBaseTyreList(@RequestBody BaseTyre baseTyre)
{
return baseTyreService.insertBaseTyreList(baseTyre);
}
/**
*
* @param carTyres
* @return
*/
@PostMapping("/TyreInstall")
public AjaxResult TyreInstall(@RequestBody CarTyres carTyres){
return baseTyreService.tyreInstall(carTyres);
}
/**
*
* @param carTyres
* @return
*/
@PostMapping("/TyreUnInstall")
public AjaxResult TyreUnInstall(@RequestBody CarTyres carTyres){
return baseTyreService.TyreUnInstall(carTyres);
}
}

@ -0,0 +1,104 @@
package com.ruoyi.basetyre.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.basetyre.domain.BaseTyreHistoricalRecords;
import com.ruoyi.basetyre.service.IBaseTyreHistoricalRecordsService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author Yangwl
* @date 2023-03-13
*/
@RestController
@RequestMapping("/basetyre/tyre_historical_records")
public class BaseTyreHistoricalRecordsController extends BaseController
{
@Autowired
private IBaseTyreHistoricalRecordsService baseTyreHistoricalRecordsService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('basetyre:tyre_historical_records:list')")
@GetMapping("/list")
public TableDataInfo list(BaseTyreHistoricalRecords baseTyreHistoricalRecords)
{
startPage();
List<BaseTyreHistoricalRecords> list = baseTyreHistoricalRecordsService.selectBaseTyreHistoricalRecordsList(baseTyreHistoricalRecords);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('basetyre:tyre_historical_records:export')")
@Log(title = "轮胎历史", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BaseTyreHistoricalRecords baseTyreHistoricalRecords)
{
List<BaseTyreHistoricalRecords> list = baseTyreHistoricalRecordsService.selectBaseTyreHistoricalRecordsList(baseTyreHistoricalRecords);
ExcelUtil<BaseTyreHistoricalRecords> util = new ExcelUtil<BaseTyreHistoricalRecords>(BaseTyreHistoricalRecords.class);
util.exportExcel(response, list, "轮胎历史数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('basetyre:tyre_historical_records:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(baseTyreHistoricalRecordsService.selectBaseTyreHistoricalRecordsById(id));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('basetyre:tyre_historical_records:add')")
@Log(title = "轮胎历史", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BaseTyreHistoricalRecords baseTyreHistoricalRecords)
{
return toAjax(baseTyreHistoricalRecordsService.insertBaseTyreHistoricalRecords(baseTyreHistoricalRecords));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('basetyre:tyre_historical_records:edit')")
@Log(title = "轮胎历史", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BaseTyreHistoricalRecords baseTyreHistoricalRecords)
{
return toAjax(baseTyreHistoricalRecordsService.updateBaseTyreHistoricalRecords(baseTyreHistoricalRecords));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('basetyre:tyre_historical_records:remove')")
@Log(title = "轮胎历史", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(baseTyreHistoricalRecordsService.deleteBaseTyreHistoricalRecordsByIds(ids));
}
}

@ -1,25 +1,19 @@
package com.ruoyi.basetyre.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.basetyre.domain.CollectMachineGps;
import com.ruoyi.basetyre.service.ICollectMachineGpsService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.basetyre.domain.CollectMachineGps;
import com.ruoyi.basetyre.service.ICollectMachineGpsService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* GPSController

@ -2,6 +2,8 @@ package com.ruoyi.basetyre.domain;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -35,6 +37,8 @@ public class BaseCar extends BaseEntity
@Excel(name = "车型ID")
private String carTypeId;
private String cartype;
/** 车牌号 */
@Excel(name = "车牌号")
@NotBlank(message = "车牌号为空")
@ -88,11 +92,11 @@ public class BaseCar extends BaseEntity
/** 最新GPS经度 */
@Excel(name = "最新GPS经度")
private BigDecimal longitude;
private double longitude;
/** 最新GPS纬度 */
@Excel(name = "最新GPS纬度")
private BigDecimal latitude;
private double latitude;
/** 轮胎数 */
@Excel(name = "轮胎数")
@ -130,6 +134,24 @@ public class BaseCar extends BaseEntity
//车队id
private String queueId;
private List<BaseTyre> TyreList;
public String getCartype() {
return cartype;
}
public void setCartype(String cartype) {
this.cartype = cartype;
}
public List<BaseTyre> getTyreList() {
return TyreList;
}
public void setTyreList(List<BaseTyre> tyreList) {
TyreList = tyreList;
}
public String getQueueId() {
return queueId;
}
@ -298,21 +320,21 @@ public class BaseCar extends BaseEntity
{
return isHasDevice;
}
public void setLongitude(BigDecimal longitude)
public void setLongitude(double longitude)
{
this.longitude = longitude;
}
public BigDecimal getLongitude()
public double getLongitude()
{
return longitude;
}
public void setLatitude(BigDecimal latitude)
public void setLatitude(double latitude)
{
this.latitude = latitude;
}
public BigDecimal getLatitude()
public double getLatitude()
{
return latitude;
}

@ -0,0 +1,184 @@
package com.ruoyi.basetyre.domain;
import java.time.LocalDate;
import java.time.LocalTime;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* GPS base_car_gps_record
*
* @author Yangwl
* @date 2023-03-14
*/
public class BaseCarGpsRecord extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private String id;
/** 轮胎厂编号 */
@Excel(name = "轮胎厂编号")
private String tyreFacCode;
/** 企业编号 */
@Excel(name = "企业编号")
private String companyCode;
/** 车辆ID */
@Excel(name = "车辆ID")
private String carId;
/** 设备ID */
@Excel(name = "设备ID")
private String deviceId;
/** 报警状态 */
@Excel(name = "报警状态")
private Long fireState;
/** 经度 */
@Excel(name = "经度")
private double longitude;
/** 纬度 */
@Excel(name = "纬度")
private double latitude;
/** gps日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "gps日期", width = 30, dateFormat = "yyyy-MM-dd")
private LocalDate gpsDate;
/** gps时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "gps时间", width = 30, dateFormat = "yyyy-MM-dd")
private LocalTime gpsTime;
/** 车上里程表读数 */
@Excel(name = "车上里程表读数")
private Long carOnlineMileage;
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setTyreFacCode(String tyreFacCode)
{
this.tyreFacCode = tyreFacCode;
}
public String getTyreFacCode()
{
return tyreFacCode;
}
public void setCompanyCode(String companyCode)
{
this.companyCode = companyCode;
}
public String getCompanyCode()
{
return companyCode;
}
public void setCarId(String carId)
{
this.carId = carId;
}
public String getCarId()
{
return carId;
}
public void setDeviceId(String deviceId)
{
this.deviceId = deviceId;
}
public String getDeviceId()
{
return deviceId;
}
public void setFireState(Long fireState)
{
this.fireState = fireState;
}
public Long getFireState()
{
return fireState;
}
public void setLongitude(double longitude)
{
this.longitude = longitude;
}
public double getLongitude()
{
return longitude;
}
public void setLatitude(double latitude)
{
this.latitude = latitude;
}
public double getLatitude()
{
return latitude;
}
public void setGpsDate(LocalDate gpsDate)
{
this.gpsDate = gpsDate;
}
public LocalDate getGpsDate()
{
return gpsDate;
}
public void setGpsTime(LocalTime gpsTime)
{
this.gpsTime = gpsTime;
}
public LocalTime getGpsTime()
{
return gpsTime;
}
public void setCarOnlineMileage(Long carOnlineMileage)
{
this.carOnlineMileage = carOnlineMileage;
}
public Long getCarOnlineMileage()
{
return carOnlineMileage;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("tyreFacCode", getTyreFacCode())
.append("companyCode", getCompanyCode())
.append("carId", getCarId())
.append("deviceId", getDeviceId())
.append("fireState", getFireState())
.append("longitude", getLongitude())
.append("latitude", getLatitude())
.append("gpsDate", getGpsDate())
.append("gpsTime", getGpsTime())
.append("carOnlineMileage", getCarOnlineMileage())
.append("createTime", getCreateTime())
.toString();
}
}

@ -87,27 +87,27 @@ public class BaseTyre extends BaseEntity
/** 负荷指数 */
@Excel(name = "负荷指数")
private Long loadIndex;
private String loadIndex;
/** 轮辋尺寸 */
@Excel(name = "轮辋尺寸")
private Long rimSize;
private String rimSize;
/** 标准重量 */
@Excel(name = "标准重量")
private Long weight;
private String weight;
/** 断面宽 */
@Excel(name = "断面宽")
private Long sectionWidth;
private String sectionWidth;
/** 外直径 */
@Excel(name = "外直径")
private Long outerDiameter;
private String outerDiameter;
/** 扁平率 */
@Excel(name = "扁平率")
private Long flattening;
private String flattening;
/** 加强型 */
@Excel(name = "加强型")
@ -119,11 +119,11 @@ public class BaseTyre extends BaseEntity
/** 标准花纹深度 */
@Excel(name = "标准花纹深度")
private Long patternDepth;
private String patternDepth;
/** 装箱量 */
@Excel(name = "装箱量")
private Long ctn;
private String ctn;
/** 轮胎类型 */
@Excel(name = "轮胎类型")
@ -355,57 +355,57 @@ public class BaseTyre extends BaseEntity
{
return speedLevel;
}
public void setLoadIndex(Long loadIndex)
public void setLoadIndex(String loadIndex)
{
this.loadIndex = loadIndex;
}
public Long getLoadIndex()
public String getLoadIndex()
{
return loadIndex;
}
public void setRimSize(Long rimSize)
public void setRimSize(String rimSize)
{
this.rimSize = rimSize;
}
public Long getRimSize()
public String getRimSize()
{
return rimSize;
}
public void setWeight(Long weight)
public void setWeight(String weight)
{
this.weight = weight;
}
public Long getWeight()
public String getWeight()
{
return weight;
}
public void setSectionWidth(Long sectionWidth)
public void setSectionWidth(String sectionWidth)
{
this.sectionWidth = sectionWidth;
}
public Long getSectionWidth()
public String getSectionWidth()
{
return sectionWidth;
}
public void setOuterDiameter(Long outerDiameter)
public void setOuterDiameter(String outerDiameter)
{
this.outerDiameter = outerDiameter;
}
public Long getOuterDiameter()
public String getOuterDiameter()
{
return outerDiameter;
}
public void setFlattening(Long flattening)
public void setFlattening(String flattening)
{
this.flattening = flattening;
}
public Long getFlattening()
public String getFlattening()
{
return flattening;
}
@ -427,21 +427,21 @@ public class BaseTyre extends BaseEntity
{
return innerTube;
}
public void setPatternDepth(Long patternDepth)
public void setPatternDepth(String patternDepth)
{
this.patternDepth = patternDepth;
}
public Long getPatternDepth()
public String getPatternDepth()
{
return patternDepth;
}
public void setCtn(Long ctn)
public void setCtn(String ctn)
{
this.ctn = ctn;
}
public Long getCtn()
public String getCtn()
{
return ctn;
}

@ -0,0 +1,138 @@
package com.ruoyi.basetyre.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.math.BigDecimal;
/**
* base_tyre_historical_records
*
* @author Yangwl
* @date 2023-03-13
*/
public class BaseTyreHistoricalRecords extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private String id;
/** 轮胎ID */
@Excel(name = "轮胎ID")
private String tyreId;
/** 轮胎位置 */
@Excel(name = "轮胎位置")
private String tyrePosition;
/** 轮胎位置(数字型) */
@Excel(name = "轮胎位置(数字型)")
private Long tyrePositionNum;
/** 车辆ID */
@Excel(name = "车辆ID")
private String carId;
/** 车牌号 */
@Excel(name = "车牌号")
private String carLicense;
/** 操作类型 1,上胎 2,换胎 3,卸胎 4,花纹变更 */
@Excel(name = "操作类型 1,上胎 2,换胎 3,卸胎 4,花纹变更")
private Long type;
/** 花纹深度 */
@Excel(name = "花纹深度")
private BigDecimal textureDepth;
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setTyreId(String tyreId)
{
this.tyreId = tyreId;
}
public String getTyreId()
{
return tyreId;
}
public void setTyrePosition(String tyrePosition)
{
this.tyrePosition = tyrePosition;
}
public String getTyrePosition()
{
return tyrePosition;
}
public void setTyrePositionNum(Long tyrePositionNum)
{
this.tyrePositionNum = tyrePositionNum;
}
public Long getTyrePositionNum()
{
return tyrePositionNum;
}
public void setCarId(String carId)
{
this.carId = carId;
}
public String getCarId()
{
return carId;
}
public void setCarLicense(String carLicense)
{
this.carLicense = carLicense;
}
public String getCarLicense()
{
return carLicense;
}
public void setType(Long type)
{
this.type = type;
}
public Long getType()
{
return type;
}
public void setTextureDepth(BigDecimal textureDepth)
{
this.textureDepth = textureDepth;
}
public BigDecimal getTextureDepth()
{
return textureDepth;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("tyreId", getTyreId())
.append("tyrePosition", getTyrePosition())
.append("tyrePositionNum", getTyrePositionNum())
.append("carId", getCarId())
.append("carLicense", getCarLicense())
.append("type", getType())
.append("textureDepth", getTextureDepth())
.append("createTime", getCreateTime())
.toString();
}
}

@ -0,0 +1,34 @@
package com.ruoyi.basetyre.domain.vo;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class CarTyres {
//车辆id
private String carId;
//车牌号
private String carLicense;
//轮胎id
private String tyreId;
//轮胎
private String outerTireNumber;
//所安装轮位
private String tyrePosition;
//品牌
private String brand;
//规格
private String size;
//当前传感器
private String sensorId;
//当前花纹深度
private BigDecimal currentTextureDepth;
//操作类型 1,上胎 2,换胎 3,卸胎 4,花纹变更
private String type;
}

@ -0,0 +1,13 @@
package com.ruoyi.basetyre.domain.vo;
import lombok.Data;
import java.util.Date;
@Data
public class TyresLife {
private Date datetime;
private String description;
private String carLicence;
private String carPosition;
}

@ -0,0 +1,61 @@
package com.ruoyi.basetyre.mapper;
import java.util.List;
import com.ruoyi.basetyre.domain.BaseCarGpsRecord;
/**
* GPSMapper
*
* @author Yangwl
* @date 2023-03-14
*/
public interface BaseCarGpsRecordMapper
{
/**
* GPS
*
* @param id GPS
* @return GPS
*/
public BaseCarGpsRecord selectBaseCarGpsRecordById(String id);
/**
* GPS
*
* @param baseCarGpsRecord GPS
* @return GPS
*/
public List<BaseCarGpsRecord> selectBaseCarGpsRecordList(BaseCarGpsRecord baseCarGpsRecord);
/**
* GPS
*
* @param baseCarGpsRecord GPS
* @return
*/
public int insertBaseCarGpsRecord(BaseCarGpsRecord baseCarGpsRecord);
/**
* GPS
*
* @param baseCarGpsRecord GPS
* @return
*/
public int updateBaseCarGpsRecord(BaseCarGpsRecord baseCarGpsRecord);
/**
* GPS
*
* @param id GPS
* @return
*/
public int deleteBaseCarGpsRecordById(String id);
/**
* GPS
*
* @param ids
* @return
*/
public int deleteBaseCarGpsRecordByIds(String[] ids);
}

@ -2,6 +2,7 @@ package com.ruoyi.basetyre.mapper;
import java.util.List;
import com.ruoyi.basetyre.domain.BaseCar;
import com.ruoyi.basetyre.domain.vo.CarTyres;
/**
* Mapper
@ -62,4 +63,8 @@ public interface BaseCarMapper
List<BaseCar> queryList(BaseCar baseCar);
List<BaseCar> selectGpsCarList(BaseCar baseCar);
int updateCarGPS(BaseCar baseCar);
List<CarTyres> selectCarTyres(BaseCar baseCar);
}

@ -0,0 +1,61 @@
package com.ruoyi.basetyre.mapper;
import java.util.List;
import com.ruoyi.basetyre.domain.BaseTyreHistoricalRecords;
/**
* Mapper
*
* @author Yangwl
* @date 2023-03-13
*/
public interface BaseTyreHistoricalRecordsMapper
{
/**
*
*
* @param id
* @return
*/
public BaseTyreHistoricalRecords selectBaseTyreHistoricalRecordsById(String id);
/**
*
*
* @param baseTyreHistoricalRecords
* @return
*/
public List<BaseTyreHistoricalRecords> selectBaseTyreHistoricalRecordsList(BaseTyreHistoricalRecords baseTyreHistoricalRecords);
/**
*
*
* @param baseTyreHistoricalRecords
* @return
*/
public int insertBaseTyreHistoricalRecords(BaseTyreHistoricalRecords baseTyreHistoricalRecords);
/**
*
*
* @param baseTyreHistoricalRecords
* @return
*/
public int updateBaseTyreHistoricalRecords(BaseTyreHistoricalRecords baseTyreHistoricalRecords);
/**
*
*
* @param id
* @return
*/
public int deleteBaseTyreHistoricalRecordsById(String id);
/**
*
*
* @param ids
* @return
*/
public int deleteBaseTyreHistoricalRecordsByIds(String[] ids);
}

@ -1,7 +1,12 @@
package com.ruoyi.basetyre.mapper;
import java.util.List;
import java.util.Map;
import com.ruoyi.basetyre.domain.BaseTyre;
import com.ruoyi.basetyre.domain.vo.CarTyres;
import com.ruoyi.common.core.domain.AjaxResult;
/**
* Mapper
@ -9,7 +14,7 @@ import com.ruoyi.basetyre.domain.BaseTyre;
* @author Yangwl
* @date 2023-02-27
*/
public interface BaseTyreMapper
public interface BaseTyreMapper
{
/**
*
@ -58,4 +63,15 @@ public interface BaseTyreMapper
* @return
*/
public int deleteBaseTyreByIds(String[] ids);
boolean insertBaseTyreList(List<BaseTyre> baseTyresVOSList);
BaseTyre getTyreInfoById(String outerTireNumber);
void UnInstallTyre(BaseTyre baseTyre);
List<Map<String, Object>> getTyreLife(String outerTireNumber);
BaseTyre checkBaseTyreUnique(String outerTireNumber);
}

@ -1,7 +1,11 @@
package com.ruoyi.basetyre.redislistener;
import com.alibaba.fastjson2.JSON;
import com.ruoyi.basetyre.domain.BaseCar;
import com.ruoyi.basetyre.domain.BaseCarGpsRecord;
import com.ruoyi.basetyre.domain.CollectMachineGps;
import com.ruoyi.basetyre.service.IBaseCarGpsRecordService;
import com.ruoyi.basetyre.service.IBaseCarService;
import com.ruoyi.basetyre.service.ICollectMachineGpsService;
import com.ruoyi.common.t808.model.T0200;
import com.ruoyi.common.t808.model.T0704;
@ -13,8 +17,14 @@ import org.springframework.data.redis.connection.MessageListener;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.List;
@Component
@ -24,6 +34,10 @@ public class RedisMessageListener implements MessageListener {
private RedisTemplate redisTemplate;
@Autowired
private ICollectMachineGpsService iCollectMachineGpsService;
@Autowired
private IBaseCarService iBaseCarService;
@Autowired
private IBaseCarGpsRecordService iBaseCarGpsRecordService;
@Override
public void onMessage(Message message, byte[] pattern) {
@ -37,6 +51,7 @@ public class RedisMessageListener implements MessageListener {
Object channel = redisTemplate.getStringSerializer().deserialize(channelByte);
// 渠道名称转换
String patternStr = new String(pattern);
System.out.println(message);
System.out.println(patternStr);
System.out.println("---频道---: " + channel);
System.out.println("---消息内容---: " + msg);
@ -65,10 +80,28 @@ public class RedisMessageListener implements MessageListener {
collectMachineGps.setAltitude((long) t0200.getAltitude());
collectMachineGps.setSpeed((long) t0200.getSpeed());
collectMachineGps.setCreateTime(DateUtils.getNowDate());
//插入GPS记录表
iCollectMachineGpsService.insertCollectMachineGps(collectMachineGps);
//插入车辆GPS记录表
BaseCarGpsRecord baseCarGpsRecord=new BaseCarGpsRecord();
baseCarGpsRecord.setId(UUID.randomUUID().toString());
// baseCarGpsRecord.setFireState((long) 1);
baseCarGpsRecord.setLatitude(((double)t0200.getLatitude()/1000000));
baseCarGpsRecord.setLongitude(((double)t0200.getLongitude()/1000000));
baseCarGpsRecord.setGpsDate(t0200.getDeviceTime().toLocalDate());
baseCarGpsRecord.setGpsTime(t0200.getDeviceTime().toLocalTime());
baseCarGpsRecord.setCreateTime(DateUtils.getNowDate());
iBaseCarGpsRecordService.insertBaseCarGpsRecord(baseCarGpsRecord);
//更新车辆最新位置
BaseCar baseCar = new BaseCar();
baseCar.setLatitude(((double)t0200.getLatitude()/1000000));
baseCar.setLongitude(((double)t0200.getLongitude()/1000000));
baseCar.setDeviceId(t0200.getClientId());
iBaseCarService.updateCarGPS(baseCar);
break;
}
}
}

@ -0,0 +1,61 @@
package com.ruoyi.basetyre.service;
import java.util.List;
import com.ruoyi.basetyre.domain.BaseCarGpsRecord;
/**
* GPSService
*
* @author Yangwl
* @date 2023-03-14
*/
public interface IBaseCarGpsRecordService
{
/**
* GPS
*
* @param id GPS
* @return GPS
*/
public BaseCarGpsRecord selectBaseCarGpsRecordById(String id);
/**
* GPS
*
* @param baseCarGpsRecord GPS
* @return GPS
*/
public List<BaseCarGpsRecord> selectBaseCarGpsRecordList(BaseCarGpsRecord baseCarGpsRecord);
/**
* GPS
*
* @param baseCarGpsRecord GPS
* @return
*/
public int insertBaseCarGpsRecord(BaseCarGpsRecord baseCarGpsRecord);
/**
* GPS
*
* @param baseCarGpsRecord GPS
* @return
*/
public int updateBaseCarGpsRecord(BaseCarGpsRecord baseCarGpsRecord);
/**
* GPS
*
* @param ids GPS
* @return
*/
public int deleteBaseCarGpsRecordByIds(String[] ids);
/**
* GPS
*
* @param id GPS
* @return
*/
public int deleteBaseCarGpsRecordById(String id);
}

@ -2,6 +2,7 @@ package com.ruoyi.basetyre.service;
import java.util.List;
import com.ruoyi.basetyre.domain.BaseCar;
import com.ruoyi.basetyre.domain.vo.CarTyres;
/**
* Service
@ -79,4 +80,8 @@ public interface IBaseCarService
public String checkCarLicenseUnique(BaseCar baseCar);
List<BaseCar> selectGpsCarList(BaseCar baseCar);
int updateCarGPS(BaseCar baseCar);
List<CarTyres> selectCarTyres(BaseCar baseCar);
}

@ -0,0 +1,61 @@
package com.ruoyi.basetyre.service;
import java.util.List;
import com.ruoyi.basetyre.domain.BaseTyreHistoricalRecords;
/**
* Service
*
* @author Yangwl
* @date 2023-03-13
*/
public interface IBaseTyreHistoricalRecordsService
{
/**
*
*
* @param id
* @return
*/
public BaseTyreHistoricalRecords selectBaseTyreHistoricalRecordsById(String id);
/**
*
*
* @param baseTyreHistoricalRecords
* @return
*/
public List<BaseTyreHistoricalRecords> selectBaseTyreHistoricalRecordsList(BaseTyreHistoricalRecords baseTyreHistoricalRecords);
/**
*
*
* @param baseTyreHistoricalRecords
* @return
*/
public int insertBaseTyreHistoricalRecords(BaseTyreHistoricalRecords baseTyreHistoricalRecords);
/**
*
*
* @param baseTyreHistoricalRecords
* @return
*/
public int updateBaseTyreHistoricalRecords(BaseTyreHistoricalRecords baseTyreHistoricalRecords);
/**
*
*
* @param ids
* @return
*/
public int deleteBaseTyreHistoricalRecordsByIds(String[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteBaseTyreHistoricalRecordsById(String id);
}

@ -1,7 +1,11 @@
package com.ruoyi.basetyre.service;
import java.util.List;
import com.ruoyi.basetyre.domain.BaseTyre;
import com.ruoyi.basetyre.domain.vo.CarTyres;
import com.ruoyi.common.core.domain.AjaxResult;
/**
* Service
@ -9,7 +13,7 @@ import com.ruoyi.basetyre.domain.BaseTyre;
* @author Yangwl
* @date 2023-02-27
*/
public interface IBaseTyreService
public interface IBaseTyreService
{
/**
*
@ -58,4 +62,16 @@ public interface IBaseTyreService
* @return
*/
public int deleteBaseTyreById(String id);
public AjaxResult insertBaseTyreList(BaseTyre baseTyre);
AjaxResult tyreInstall(CarTyres carTyres);
public BaseTyre getTyreInfoById(String outerTireNumber);
public AjaxResult TyreUnInstall(CarTyres carTyres);
AjaxResult getTyreLife(String outerTireNumber);
String checkBaseTyreUnique(BaseTyre baseTyre);
}

@ -0,0 +1,95 @@
package com.ruoyi.basetyre.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.basetyre.mapper.BaseCarGpsRecordMapper;
import com.ruoyi.basetyre.domain.BaseCarGpsRecord;
import com.ruoyi.basetyre.service.IBaseCarGpsRecordService;
/**
* GPSService
*
* @author Yangwl
* @date 2023-03-14
*/
@Service
public class BaseCarGpsRecordServiceImpl implements IBaseCarGpsRecordService
{
@Autowired
private BaseCarGpsRecordMapper baseCarGpsRecordMapper;
/**
* GPS
*
* @param id GPS
* @return GPS
*/
@Override
public BaseCarGpsRecord selectBaseCarGpsRecordById(String id)
{
return baseCarGpsRecordMapper.selectBaseCarGpsRecordById(id);
}
/**
* GPS
*
* @param baseCarGpsRecord GPS
* @return GPS
*/
@Override
public List<BaseCarGpsRecord> selectBaseCarGpsRecordList(BaseCarGpsRecord baseCarGpsRecord)
{
return baseCarGpsRecordMapper.selectBaseCarGpsRecordList(baseCarGpsRecord);
}
/**
* GPS
*
* @param baseCarGpsRecord GPS
* @return
*/
@Override
public int insertBaseCarGpsRecord(BaseCarGpsRecord baseCarGpsRecord)
{
baseCarGpsRecord.setCreateTime(DateUtils.getNowDate());
return baseCarGpsRecordMapper.insertBaseCarGpsRecord(baseCarGpsRecord);
}
/**
* GPS
*
* @param baseCarGpsRecord GPS
* @return
*/
@Override
public int updateBaseCarGpsRecord(BaseCarGpsRecord baseCarGpsRecord)
{
return baseCarGpsRecordMapper.updateBaseCarGpsRecord(baseCarGpsRecord);
}
/**
* GPS
*
* @param ids GPS
* @return
*/
@Override
public int deleteBaseCarGpsRecordByIds(String[] ids)
{
return baseCarGpsRecordMapper.deleteBaseCarGpsRecordByIds(ids);
}
/**
* GPS
*
* @param id GPS
* @return
*/
@Override
public int deleteBaseCarGpsRecordById(String id)
{
return baseCarGpsRecordMapper.deleteBaseCarGpsRecordById(id);
}
}

@ -3,6 +3,7 @@ package com.ruoyi.basetyre.service.impl;
import java.util.List;
import java.util.UUID;
import com.ruoyi.basetyre.domain.vo.CarTyres;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
@ -120,4 +121,14 @@ public class BaseCarServiceImpl implements IBaseCarService
public List<BaseCar> selectGpsCarList(BaseCar baseCar) {
return baseCarMapper.selectGpsCarList(baseCar);
}
@Override
public int updateCarGPS(BaseCar baseCar) {
return baseCarMapper.updateCarGPS(baseCar);
}
@Override
public List<CarTyres> selectCarTyres(BaseCar baseCar) {
return baseCarMapper.selectCarTyres(baseCar);
}
}

@ -0,0 +1,96 @@
package com.ruoyi.basetyre.service.impl;
import java.util.List;
import com.ruoyi.basetyre.mapper.BaseTyreHistoricalRecordsMapper;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.basetyre.domain.BaseTyreHistoricalRecords;
import com.ruoyi.basetyre.service.IBaseTyreHistoricalRecordsService;
/**
* Service
*
* @author Yangwl
* @date 2023-03-13
*/
@Service
public class BaseTyreHistoricalRecordsServiceImpl implements IBaseTyreHistoricalRecordsService
{
@Autowired
private BaseTyreHistoricalRecordsMapper baseTyreHistoricalRecordsMapper;
/**
*
*
* @param id
* @return
*/
@Override
public BaseTyreHistoricalRecords selectBaseTyreHistoricalRecordsById(String id)
{
return baseTyreHistoricalRecordsMapper.selectBaseTyreHistoricalRecordsById(id);
}
/**
*
*
* @param baseTyreHistoricalRecords
* @return
*/
@Override
public List<BaseTyreHistoricalRecords> selectBaseTyreHistoricalRecordsList(BaseTyreHistoricalRecords baseTyreHistoricalRecords)
{
return baseTyreHistoricalRecordsMapper.selectBaseTyreHistoricalRecordsList(baseTyreHistoricalRecords);
}
/**
*
*
* @param baseTyreHistoricalRecords
* @return
*/
@Override
public int insertBaseTyreHistoricalRecords(BaseTyreHistoricalRecords baseTyreHistoricalRecords)
{
baseTyreHistoricalRecords.setCreateTime(DateUtils.getNowDate());
return baseTyreHistoricalRecordsMapper.insertBaseTyreHistoricalRecords(baseTyreHistoricalRecords);
}
/**
*
*
* @param baseTyreHistoricalRecords
* @return
*/
@Override
public int updateBaseTyreHistoricalRecords(BaseTyreHistoricalRecords baseTyreHistoricalRecords)
{
return baseTyreHistoricalRecordsMapper.updateBaseTyreHistoricalRecords(baseTyreHistoricalRecords);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteBaseTyreHistoricalRecordsByIds(String[] ids)
{
return baseTyreHistoricalRecordsMapper.deleteBaseTyreHistoricalRecordsByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteBaseTyreHistoricalRecordsById(String id)
{
return baseTyreHistoricalRecordsMapper.deleteBaseTyreHistoricalRecordsById(id);
}
}

@ -1,28 +1,56 @@
package com.ruoyi.basetyre.service.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
import com.ruoyi.basetyre.domain.BaseDevice;
import com.ruoyi.basetyre.domain.BaseTyreHistoricalRecords;
import com.ruoyi.basetyre.domain.vo.CarTyres;
import com.ruoyi.basetyre.domain.vo.TyresLife;
import com.ruoyi.basetyre.mapper.BaseDeviceMapper;
import com.ruoyi.basetyre.mapper.BaseTyreHistoricalRecordsMapper;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.basetyre.mapper.BaseTyreMapper;
import com.ruoyi.basetyre.domain.BaseTyre;
import com.ruoyi.basetyre.service.IBaseTyreService;
import javax.annotation.Resource;
/**
* Service
*
*
* @author Yangwl
* @date 2023-02-27
*/
@Service
public class BaseTyreServiceImpl implements IBaseTyreService
public class BaseTyreServiceImpl implements IBaseTyreService
{
@Autowired
private BaseTyreMapper baseTyreMapper;
@Resource
private SqlSessionFactory sqlSessionFactory;
@Autowired
private BaseTyreHistoricalRecordsMapper baseTyreHistoricalRecordsMapper;
@Autowired
private BaseDeviceMapper baseDeviceMapper;
/**
*
*
*
* @param id
* @return
*/
@ -34,44 +62,55 @@ public class BaseTyreServiceImpl implements IBaseTyreService
/**
*
*
*
* @param baseTyre
* @return
*/
@Override
public List<BaseTyre> selectBaseTyreList(BaseTyre baseTyre)
{
baseTyre.setIsDelete((long) 0);
return baseTyreMapper.selectBaseTyreList(baseTyre);
}
/**
*
*
*
* @param baseTyre
* @return
*/
@Override
public int insertBaseTyre(BaseTyre baseTyre)
{
LoginUser loginUser=SecurityUtils.getLoginUser();
baseTyre.setId(UUID.randomUUID().toString());
baseTyre.setCreateTime(DateUtils.getNowDate());
baseTyre.setCreateName(loginUser.getUsername());
baseTyre.setCreateBy(loginUser.getUserId().toString());
baseTyre.setIsDelete((long) 0);
return baseTyreMapper.insertBaseTyre(baseTyre);
}
/**
*
*
*
* @param baseTyre
* @return
*/
@Override
public int updateBaseTyre(BaseTyre baseTyre)
{
LoginUser loginUser=SecurityUtils.getLoginUser();
baseTyre.setModifyTime(DateUtils.getNowDate());
baseTyre.setModifyBy(loginUser.getUserId().toString());
baseTyre.setModifyName(loginUser.getUsername());
return baseTyreMapper.updateBaseTyre(baseTyre);
}
/**
*
*
*
* @param ids
* @return
*/
@ -83,7 +122,7 @@ public class BaseTyreServiceImpl implements IBaseTyreService
/**
*
*
*
* @param id
* @return
*/
@ -92,4 +131,193 @@ public class BaseTyreServiceImpl implements IBaseTyreService
{
return baseTyreMapper.deleteBaseTyreById(id);
}
@Override
public AjaxResult insertBaseTyreList(BaseTyre baseTyre) {
try {
LoginUser loginUser= SecurityUtils.getLoginUser();
baseTyre.setId(UUID.randomUUID().toString());
baseTyre.setIsDelete((long) 0);
baseTyre.setCreateTime(DateUtils.getNowDate());
baseTyre.setCreateName(loginUser.getUsername());
baseTyre.setCreateBy(loginUser.getUserId().toString());
baseTyreMapper.insertBaseTyre(baseTyre);
return AjaxResult.success();
}catch (Exception e){
e.printStackTrace();
return AjaxResult.error(e.getMessage());
}
}
// boolean flag = false;
// List<BaseTyre> BaseTyresVOS = baseTyreList.stream().map(baseTyre -> {
// BaseTyre baseTyreVO = new BaseTyre();
// BeanUtils.copyProperties(baseTyre, baseTyreVO);
// baseTyreVO.setId(UUID.randomUUID().toString());
// baseTyreVO.setIsDelete((long) 0);
// baseTyreVO.setCreateTime(DateUtils.getNowDate());
// baseTyreVO.setCreateName("MOM");
// return baseTyreVO;
// }).collect(Collectors.toList());
// try {
// flag = baseTyreMapper.insertBaseTyreList(BaseTyresVOS);
// if (flag){
// return AjaxResult.success();
// }else {
// return AjaxResult.error();
// }
//
// } catch (Exception e) {
// return AjaxResult.error(e.getMessage());
// }
// SqlSession sqlSession=sqlSessionFactory.openSession(ExecutorType.BATCH);
// try{
// baseTyreMapper=sqlSession.getMapper(BaseTyreMapper.class);
// BaseTyresVOS.stream().forEach(e->{
// baseTyreMapper.insertBaseTyre(e);
// });
// sqlSession.clearCache();
// sqlSession.commit();
// }catch(Exception e){
// e.printStackTrace();
// }finally{
// sqlSession.close();
// }}
@Override
public AjaxResult tyreInstall(CarTyres carTyres) {
BaseTyre baseTyre=new BaseTyre();
LoginUser loginUser= SecurityUtils.getLoginUser();
/**
*
*/
//传感器是否存在
if (StringUtils.isEmpty(carTyres.getSensorId())){
//传感器是否存在
BaseDevice baseDevice=new BaseDevice();
baseDevice.setInternetThingsNo(carTyres.getSensorId());
List<BaseDevice> baseDeviceList = baseDeviceMapper.selectBaseDeviceList(baseDevice);
if (baseDeviceList==null || baseDeviceList.size()==0){
return AjaxResult.error("系统无传感器信息!");
}
}
try {
//执行安装更换操作
baseTyre.setId(carTyres.getTyreId());
baseTyre.setCarLicense(carTyres.getCarLicense());
baseTyre.setCarId(carTyres.getCarId());
baseTyre.setSensorId(carTyres.getSensorId());
baseTyre.setTyrePosition(carTyres.getTyrePosition());
baseTyre.setCurrentTextureDepth(carTyres.getCurrentTextureDepth());
baseTyre.setModifyId(loginUser.getUserId().toString());
baseTyre.setModifyBy(loginUser.getUsername());
baseTyre.setModifyName(loginUser.getUsername());
baseTyre.setModifyTime(DateUtils.getNowDate());
BaseTyre baseT=baseTyreMapper.selectBaseTyreById(carTyres.getTyreId());
Long type = Long.valueOf(carTyres.getType());
if (!StringUtils.isEmpty(baseT.getCarLicense()) && !StringUtils.isEmpty(baseT.getTyrePosition()) && !carTyres.getType().equals("4")){
type=Long.valueOf(2);
}
baseTyreMapper.updateBaseTyre(baseTyre);
//生成安装更换记录
BaseTyreHistoricalRecords baseTyreHistoricalRecords=new BaseTyreHistoricalRecords();
baseTyreHistoricalRecords.setId(UUID.randomUUID().toString());
baseTyreHistoricalRecords.setTyreId(carTyres.getTyreId());
baseTyreHistoricalRecords.setTyrePosition(carTyres.getTyrePosition());
baseTyreHistoricalRecords.setCarId(carTyres.getCarId());
baseTyreHistoricalRecords.setCarLicense(carTyres.getCarLicense());
/**
*
*/
baseTyreHistoricalRecords.setType(type);
baseTyreHistoricalRecords.setTextureDepth(carTyres.getCurrentTextureDepth());
baseTyreHistoricalRecords.setCreateTime(DateUtils.getNowDate());
baseTyreHistoricalRecordsMapper.insertBaseTyreHistoricalRecords(baseTyreHistoricalRecords);
}catch (Exception e){
return AjaxResult.error(e.getMessage());
}
return AjaxResult.success();
}
@Override
public AjaxResult TyreUnInstall(CarTyres carTyres) {
BaseTyre baseTyre=new BaseTyre();
LoginUser loginUser= SecurityUtils.getLoginUser();
try {
//卸胎解绑
baseTyre.setId(carTyres.getTyreId());
baseTyre.setCurrentTextureDepth(carTyres.getCurrentTextureDepth());
baseTyre.setModifyId(loginUser.getUserId().toString());
baseTyre.setModifyBy(loginUser.getUsername());
baseTyre.setModifyName(loginUser.getUsername());
baseTyre.setModifyTime(DateUtils.getNowDate());
baseTyreMapper.UnInstallTyre(baseTyre);
//生成记录
BaseTyreHistoricalRecords baseTyreHistoricalRecords=new BaseTyreHistoricalRecords();
baseTyreHistoricalRecords.setId(UUID.randomUUID().toString());
baseTyreHistoricalRecords.setTyreId(carTyres.getTyreId());
baseTyreHistoricalRecords.setTyrePosition(carTyres.getTyrePosition());
baseTyreHistoricalRecords.setCarId(carTyres.getCarId());
baseTyreHistoricalRecords.setCarLicense(carTyres.getCarLicense());
baseTyreHistoricalRecords.setType(Long.valueOf(carTyres.getType()));
baseTyreHistoricalRecords.setTextureDepth(carTyres.getCurrentTextureDepth());
baseTyreHistoricalRecords.setCreateTime(DateUtils.getNowDate());
baseTyreHistoricalRecordsMapper.insertBaseTyreHistoricalRecords(baseTyreHistoricalRecords);
}catch (Exception e){
return AjaxResult.error(e.getMessage());
}
return AjaxResult.success();
}
@Override
public AjaxResult getTyreLife(String outerTireNumber) {
try {
BaseTyre baseTyre=baseTyreMapper.getTyreInfoById(outerTireNumber);
TyresLife tyresLife = new TyresLife();
tyresLife.setDatetime(baseTyre.getCreateTime());
tyresLife.setDescription("MOM数据下发");
List<TyresLife> lifeList=new ArrayList<>();
lifeList.add(tyresLife);
BaseTyreHistoricalRecords baseTyreHistoricalRecords=new BaseTyreHistoricalRecords();
baseTyreHistoricalRecords.setTyreId(baseTyre.getId());
List<BaseTyreHistoricalRecords> list = baseTyreHistoricalRecordsMapper.selectBaseTyreHistoricalRecordsList(baseTyreHistoricalRecords);
for (BaseTyreHistoricalRecords bthr: list) {
TyresLife tyresLifeVo = new TyresLife();
tyresLifeVo.setDatetime(bthr.getCreateTime());
tyresLifeVo.setDescription(String.valueOf(bthr.getType()));
tyresLifeVo.setCarLicence(bthr.getCarLicense());
tyresLifeVo.setCarPosition(bthr.getTyrePosition());
lifeList.add(tyresLifeVo);
}
return AjaxResult.success(lifeList);
}catch (Exception e){
return AjaxResult.error(e.getMessage());
}
}
@Override
public String checkBaseTyreUnique(BaseTyre baseTyre) {
BaseTyre info = baseTyreMapper.checkBaseTyreUnique(baseTyre.getOuterTireNumber());
if (StringUtils.isNotNull(info) && baseTyre.getOuterTireNumber().equals(info.getOuterTireNumber()))
{
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
@Override
public BaseTyre getTyreInfoById(String outerTireNumber) {
return baseTyreMapper.getTyreInfoById(outerTireNumber);
}
}

@ -0,0 +1,107 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.basetyre.mapper.BaseCarGpsRecordMapper">
<resultMap type="BaseCarGpsRecord" id="BaseCarGpsRecordResult">
<result property="id" column="id" />
<result property="tyreFacCode" column="tyre_fac_code" />
<result property="companyCode" column="company_code" />
<result property="carId" column="car_id" />
<result property="deviceId" column="device_id" />
<result property="fireState" column="fire_state" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="gpsDate" column="gps_date" />
<result property="gpsTime" column="gps_time" />
<result property="carOnlineMileage" column="car_online_mileage" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectBaseCarGpsRecordVo">
select id, tyre_fac_code, company_code, car_id, device_id, fire_state, longitude, latitude, gps_date, gps_time, car_online_mileage, create_time from base_car_gps_record
</sql>
<select id="selectBaseCarGpsRecordList" parameterType="BaseCarGpsRecord" resultMap="BaseCarGpsRecordResult">
<include refid="selectBaseCarGpsRecordVo"/>
<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="carId != null and carId != ''"> and car_id = #{carId}</if>
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
<if test="fireState != null "> and fire_state = #{fireState}</if>
<if test="longitude != null "> and longitude = #{longitude}</if>
<if test="latitude != null "> and latitude = #{latitude}</if>
<if test="gpsDate != null "> and gps_date = #{gpsDate}</if>
<if test="gpsTime != null "> and gps_time = #{gpsTime}</if>
<if test="carOnlineMileage != null "> and car_online_mileage = #{carOnlineMileage}</if>
</where>
</select>
<select id="selectBaseCarGpsRecordById" parameterType="String" resultMap="BaseCarGpsRecordResult">
<include refid="selectBaseCarGpsRecordVo"/>
where id = #{id}
</select>
<insert id="insertBaseCarGpsRecord" parameterType="BaseCarGpsRecord">
insert into base_car_gps_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="tyreFacCode != null">tyre_fac_code,</if>
<if test="companyCode != null">company_code,</if>
<if test="carId != null">car_id,</if>
<if test="deviceId != null">device_id,</if>
<if test="fireState != null">fire_state,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="gpsDate != null">gps_date,</if>
<if test="gpsTime != null">gps_time,</if>
<if test="carOnlineMileage != null">car_online_mileage,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="tyreFacCode != null">#{tyreFacCode},</if>
<if test="companyCode != null">#{companyCode},</if>
<if test="carId != null">#{carId},</if>
<if test="deviceId != null">#{deviceId},</if>
<if test="fireState != null">#{fireState},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="gpsDate != null">#{gpsDate},</if>
<if test="gpsTime != null">#{gpsTime},</if>
<if test="carOnlineMileage != null">#{carOnlineMileage},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateBaseCarGpsRecord" parameterType="BaseCarGpsRecord">
update base_car_gps_record
<trim prefix="SET" suffixOverrides=",">
<if test="tyreFacCode != null">tyre_fac_code = #{tyreFacCode},</if>
<if test="companyCode != null">company_code = #{companyCode},</if>
<if test="carId != null">car_id = #{carId},</if>
<if test="deviceId != null">device_id = #{deviceId},</if>
<if test="fireState != null">fire_state = #{fireState},</if>
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</if>
<if test="gpsDate != null">gps_date = #{gpsDate},</if>
<if test="gpsTime != null">gps_time = #{gpsTime},</if>
<if test="carOnlineMileage != null">car_online_mileage = #{carOnlineMileage},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBaseCarGpsRecordById" parameterType="String">
delete from base_car_gps_record where id = #{id}
</delete>
<delete id="deleteBaseCarGpsRecordByIds" parameterType="String">
delete from base_car_gps_record where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="companyCode" column="company_code" />
<result property="carQueueId" column="car_queue_id" />
<result property="carTypeId" column="car_type_id" />
<result property="cartype" column="cartype" />
<result property="carLicense" column="car_license" />
<result property="carLicenseIn" column="car_license_in" />
<result property="carLicenseParent" column="car_license_parent" />
@ -34,6 +35,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="modifyBy" column="modify_by" />
<result property="state" column="state" />
<result property="laseRuntime" column="last_run_time" />
<collection property="TyreList" javaType="java.util.List" resultMap="baseTyreList" />
</resultMap>
<resultMap type="BaseTyre" id="baseTyreList">
<result property="id" column="id" />
<result property="outerTireNumber" column="outer_tire_number" />
<result property="pattern" column="pattern" />
<result property="currentTextureDepth" column="current_texture_depth" />
<result property="state" column="state" />
<result property="tyrePosition" column="tyre_position" />
</resultMap>
<resultMap type="CarTyres" id="CarTyreResult">
<result property="tyreId" column="id" />
<result property="outerTireNumber" column="outer_tire_number" />
<result property="tyrePosition" column="tyre_position" />
<result property="brand" column="brand" />
<result property="size" column="size" />
<result property="sensorId" column="sensor_id" />
<result property="currentTextureDepth" column="current_texture_depth" />
</resultMap>
<sql id="selectBaseCarVo">
@ -56,7 +76,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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>
<if test="id != null and id != ''"> and bc.id = #{id} </if>
<if test="carLicense != null and carLicense != ''"> and bc.car_license like concat('%', #{carLicense}, '%') </if>
</where>
</select>
@ -98,12 +120,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectGpsCarList" resultMap="BaseCarResult" parameterType="BaseCar">
SELECT
bc.*,
bd.state,
bd.last_run_time
bc.*,
bd.state,
bd.last_run_time,
bt.id,
bt.outer_tire_number,
bt.pattern,
bt.current_texture_depth,
bt.state,
bt.tyre_position,
bct.title as cartype
FROM
base_car bc
LEFT JOIN base_device bd ON bc.device_id = bd.internet_things_no
base_car bc
LEFT JOIN base_device bd ON bc.device_id = bd.internet_things_no
LEFT JOIN base_car_type bct ON bc.car_type_id=bct.id
LEFT JOIN base_tyre bt on bt.car_id=bc.id
<where>
bc.is_delete != '1'
@ -112,6 +143,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="queueId != null "> and bc.car_queue_id = #{queueId}</if>
</where>
</select>
<select id="selectCarTyres" parameterType="BaseCar" resultMap="CarTyreResult">
select id,outer_tire_number,tyre_position,brand,size,sensor_id,current_texture_depth from base_tyre le
where car_license = #{carLicense}
</select>
<insert id="insertBaseCar" parameterType="BaseCar">
insert into base_car
@ -206,6 +241,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="modifyBy != null">modify_by = #{modifyBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBaseCarById" parameterType="String">
@ -220,5 +256,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- </delete>-->
<update id="deleteBaseCarByIds" parameterType="String">
</update>
<update id="updateCarGPS" parameterType="BaseCar">
update base_car
<trim prefix="SET" suffixOverrides=",">
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</if>
</trim>
<where>
<if test="deviceId != null"> and device_id = #{deviceId}</if>
<if test="carLicense != null"> and car_license = #{carLicense}</if>
</where>
</update>
</mapper>

@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.basetyre.mapper.BaseTyreHistoricalRecordsMapper">
<resultMap type="BaseTyreHistoricalRecords" id="BaseTyreHistoricalRecordsResult">
<result property="id" column="id" />
<result property="tyreId" column="tyre_id" />
<result property="tyrePosition" column="tyre_position" />
<result property="tyrePositionNum" column="tyre_position_num" />
<result property="carId" column="car_id" />
<result property="carLicense" column="car_license" />
<result property="type" column="type" />
<result property="textureDepth" column="texture_depth" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectBaseTyreHistoricalRecordsVo">
select id, tyre_id, tyre_position, tyre_position_num, car_id, car_license, type, texture_depth, create_time from base_tyre_historical_records
</sql>
<select id="selectBaseTyreHistoricalRecordsList" parameterType="BaseTyreHistoricalRecords" resultMap="BaseTyreHistoricalRecordsResult">
<include refid="selectBaseTyreHistoricalRecordsVo"/>
<where>
<if test="tyreId != null and tyreId != ''"> and tyre_id = #{tyreId}</if>
<if test="tyrePosition != null and tyrePosition != ''"> and tyre_position = #{tyrePosition}</if>
<if test="tyrePositionNum != null "> and tyre_position_num = #{tyrePositionNum}</if>
<if test="carId != null and carId != ''"> and car_id = #{carId}</if>
<if test="carLicense != null and carLicense != ''"> and car_license = #{carLicense}</if>
<if test="type != null "> and type = #{type}</if>
<if test="textureDepth != null "> and texture_depth = #{textureDepth}</if>
</where>
</select>
<select id="selectBaseTyreHistoricalRecordsById" parameterType="String" resultMap="BaseTyreHistoricalRecordsResult">
<include refid="selectBaseTyreHistoricalRecordsVo"/>
where id = #{id}
</select>
<insert id="insertBaseTyreHistoricalRecords" parameterType="BaseTyreHistoricalRecords">
insert into base_tyre_historical_records
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="tyreId != null">tyre_id,</if>
<if test="tyrePosition != null">tyre_position,</if>
<if test="tyrePositionNum != null">tyre_position_num,</if>
<if test="carId != null">car_id,</if>
<if test="carLicense != null">car_license,</if>
<if test="type != null">type,</if>
<if test="textureDepth != null">texture_depth,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="tyreId != null">#{tyreId},</if>
<if test="tyrePosition != null">#{tyrePosition},</if>
<if test="tyrePositionNum != null">#{tyrePositionNum},</if>
<if test="carId != null">#{carId},</if>
<if test="carLicense != null">#{carLicense},</if>
<if test="type != null">#{type},</if>
<if test="textureDepth != null">#{textureDepth},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateBaseTyreHistoricalRecords" parameterType="BaseTyreHistoricalRecords">
update base_tyre_historical_records
<trim prefix="SET" suffixOverrides=",">
<if test="tyreId != null">tyre_id = #{tyreId},</if>
<if test="tyrePosition != null">tyre_position = #{tyrePosition},</if>
<if test="tyrePositionNum != null">tyre_position_num = #{tyrePositionNum},</if>
<if test="carId != null">car_id = #{carId},</if>
<if test="carLicense != null">car_license = #{carLicense},</if>
<if test="type != null">type = #{type},</if>
<if test="textureDepth != null">texture_depth = #{textureDepth},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBaseTyreHistoricalRecordsById" parameterType="String">
delete from base_tyre_historical_records where id = #{id}
</delete>
<delete id="deleteBaseTyreHistoricalRecordsByIds" parameterType="String">
delete from base_tyre_historical_records where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -108,14 +108,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="modifyId != null and modifyId != ''"> and modify_id = #{modifyId}</if>
<if test="modifyBy != null and modifyBy != ''"> and modify_by = #{modifyBy}</if>
<if test="modifyName != null and modifyName != ''"> and modify__name like concat('%', #{modifyName}, '%')</if>
</where>
</select>
<select id="selectBaseTyreById" parameterType="String" resultMap="BaseTyreResult">
<include refid="selectBaseTyreVo"/>
where id = #{id}
</select>
<select id="getTyreInfoById" parameterType="String" resultMap="BaseTyreResult">
<include refid="selectBaseTyreVo"/>
where outer_tire_number = #{outerTireNumber}
</select>
<select id="getTyreLife" resultType="java.util.Map">
</select>
<select id="checkBaseTyreUnique" resultType="com.ruoyi.basetyre.domain.BaseTyre">
select id, outer_tire_number as outerTireNumber
from base_tyre
where outer_tire_number = #{outerTireNumber}
and is_delete = '0'
</select>
<insert id="insertBaseTyre" parameterType="BaseTyre">
insert into base_tyre
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -221,6 +236,70 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<insert id="insertBaseTyreList" parameterType="java.util.List">
insert into base_tyre (id, tyre_factory, outer_tire_number, material_code, material_name,
quality_status, unit, material_type, material_group, product_group, brand, category, size,
pattern, cons_pattern, hierarchy, speed_level, load_index, rim_size, weight, section_width,
outer_diameter, flattening, enhanced, inner_tube, pattern_depth, ctn, type, cert_info, customs_spe,
fe_code, fe_desc, produce_factory, car_id, car_license, tyre_position, sensor_id, current_texture_depth,
state, is_delete, create_time, create_id, create_by, create_name )
values
<foreach collection="list" item="t" index="index" separator=",">
<trim prefix="(" suffix=")">
#{t.id},
#{t.tyreFactory},
#{t.outerTireNumber},
#{t.materialCode},
#{t.materialName},
#{t.qualityStatus},
#{t.unit},
#{t.materialType},
#{t.materialGroup},
#{t.productGroup},
#{t.brand},
#{t.category},
#{t.size},
#{t.pattern},
#{t.consPattern},
#{t.hierarchy},
#{t.speedLevel},
#{t.loadIndex},
#{t.rimSize},
#{t.weight},
#{t.sectionWidth},
#{t.outerDiameter},
#{t.flattening},
#{t.enhanced},
#{t.innerTube},
#{t.patternDepth},
#{t.ctn},
#{t.type},
#{t.certInfo},
#{t.customsSpe},
#{t.feCode},
#{t.feDesc},
#{t.produceFactory},
#{t.carId},
#{t.carLicense},
#{t.tyrePosition},
#{t.sensorId},
#{t.currentTextureDepth},
#{t.state},
#{t.isDelete},
#{t.createTime},
#{t.createId},
#{t.createBy},
#{t.createName}
</trim>
</foreach>
</insert>
<!-- <insert id="insertBaseTyreList" parameterType="java.util.List">-->
<!-- insert into base_tyre(id)-->
<!-- <foreach collection ="list" item="baseTyreVO" separator =",">-->
<!-- (#{baseTyreVO.id})-->
<!-- </foreach >-->
<!-- </insert>-->
<update id="updateBaseTyre" parameterType="BaseTyre">
update base_tyre
@ -276,15 +355,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
where id = #{id}
</update>
<update id="UnInstallTyre" parameterType="BaseTyre">
update base_tyre set car_license=null,car_id=null ,sensor_id=null ,tyre_position=null ,modify_time = #{modifyTime},modify_id = #{modifyId},modify_by = #{modifyBy},modify__name = #{modifyName},current_texture_depth = #{currentTextureDepth} where id = #{id}
</update>
<delete id="deleteBaseTyreById" parameterType="String">
delete from base_tyre where id = #{id}
</delete>
<delete id="deleteBaseTyreByIds" parameterType="String">
delete from base_tyre where id in
<!-- <delete id="deleteBaseTyreById" parameterType="String">-->
<!-- delete from base_tyre where id = #{id}-->
<!-- </delete>-->
<!-- -->
<update id="deleteBaseTyreById" parameterType="String">
update base_tyre set is_delete = '1' where id = #{id}
</update>
<update id="deleteBaseTyreByIds" parameterType="String">
update base_tyre set is_delete = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</update>
</mapper>

@ -147,6 +147,13 @@
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.3.5</version>
</dependency>
</dependencies>

@ -6,6 +6,6 @@ VITE_APP_ENV = 'production'
# 若依管理系统/生产环境
VITE_APP_BASE_API = 'http://10.11.41.249:8080/dev-api'
# VITE_APP_BASE_API = 'http://47.94.93.46:80/dev-api'
# 是否在打包时开启压缩,支持 gzip 和 brotli
VITE_BUILD_COMPRESS = gzip

@ -12,7 +12,7 @@ export function listBasetyre(query) {
// 查询基础信息详细
export function getBasetyre(id) {
return request({
url: '/basetyre/basetyre/' + id,
url: '/basetyre/tyre/' + id,
method: 'get'
})
}
@ -20,7 +20,7 @@ export function getBasetyre(id) {
// 新增信息
export function addBasetyre(data) {
return request({
url: '/basetyre/basetyre',
url: '/basetyre/tyre',
method: 'post',
data: data
})
@ -29,7 +29,7 @@ export function addBasetyre(data) {
// 修改信息
export function updateBasetyre(data) {
return request({
url: '/basetyre/basetyre',
url: '/basetyre/tyre',
method: 'put',
data: data
})
@ -38,7 +38,7 @@ export function updateBasetyre(data) {
// 删除轮胎基础信息
export function delBasetyre(id) {
return request({
url: '/basetyre/basetyre/' + id,
url: '/basetyre/tyre/' + id,
method: 'delete'
})
}

@ -0,0 +1,313 @@
<template>
<div class="app-container">
<!-- 搜索栏-->
<el-form v-show="showSearch" ref="queryRef" :inline="true" :label-width=" locale ? '90px':'140px'"
:model="queryParams">
<el-form-item :label="t('test.test.internationalization1')" prop="internationalization1">
<el-input
v-model="queryParams.internationalization1"
:placeholder=" t('common.pleaseEnter') + t('test.test.internationalization1')"
clearable
style="width: 200px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-form>
<!-- 顶部操作按钮-->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
v-hasPermi="['test:test:add']"
icon="Plus"
plain
type="primary"
@click="handleAdd"
>{{ t('option.add') }}
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['test:test:edit']"
:disabled="single"
icon="Edit"
plain
type="success"
@click="handleUpdate"
>{{ t('option.edit') }}
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['test:test:remove']"
:disabled="multiple"
icon="Delete"
plain
type="danger"
@click="handleDelete"
>{{ t('option.remove') }}
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['test:test:export']"
icon="Download"
plain
type="warning"
@click="handleExport"
>{{ t('option.export') }}
</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</div>
</template>
<script name="Test" setup>
import {addTest, delTest, getTest, listTest, updateTest} from "@/api/test/test";
import {useI18n} from 'vue-i18n';
import Cookies from "js-cookie";
const {t} = useI18n();
const locale = (Cookies.get('language') || 'zhCn') === 'zhCn'
const {proxy} = getCurrentInstance();
//
const postList = ref([]);
//
const open = ref(false);
//
const loading = ref(true);
//
const showSearch = ref(true);
// id
const ids = ref([]);
//
const single = ref(true);
//
const multiple = ref(true);
//
const total = ref(0);
//
const title = ref("");
//
const queryParams = ref({
pageNum: 1,
pageSize: 10,
internationalization1: undefined,
internationalization2: undefined,
internationalization3: undefined,
internationalization4: undefined,
internationalization5: undefined,
internationalization6: undefined,
internationalization7: undefined,
internationalization8: undefined,
internationalization9: undefined,
internationalization10: undefined,
internationalization11: undefined,
internationalization12: undefined,
internationalization13: undefined,
internationalization14: undefined,
internationalization15: undefined,
internationalization16: undefined,
internationalization17: undefined,
internationalization18: undefined,
internationalization19: undefined,
internationalization20: undefined,
isDelete: undefined,
createTime: undefined,
createId: undefined,
createBy: undefined,
createName: undefined,
modifyTime: undefined,
modifyId: undefined,
modifyBy: undefined,
modifyName: undefined,
})
//
const rules = {
brand: [{required: true, message: "轮胎品牌不能为空", trigger: "blur"}],
type: [{required: true, message: "轮胎型号不能为空", trigger: "blur"}],
serialNumber: [{required: true, message: "轮胎编号不能为空", trigger: "blur"}],
depth: [{required: true, message: "花纹深度不能为空", trigger: "blur"}],
}
//
const form = ref({
id: null,
internationalization1: null,
internationalization2: null,
internationalization3: null,
internationalization4: null,
internationalization5: null,
internationalization6: null,
internationalization7: null,
internationalization8: null,
internationalization9: null,
internationalization10: null,
internationalization11: null,
internationalization12: null,
internationalization13: null,
internationalization14: null,
internationalization15: null,
internationalization16: null,
internationalization17: null,
internationalization18: null,
internationalization19: null,
internationalization20: null,
isDelete: null,
createTime: null,
createId: null,
createBy: null,
createName: null,
modifyTime: null,
modifyId: null,
modifyBy: null,
modifyName: null,
});
/** 查询岗位列表 */
function getList() {
loading.value = true;
listTest(queryParams.value).then(response => {
postList.value = response.rows;
total.value = response.total;
}).finally(() => {
loading.value = false;
});
}
/** 取消按钮 */
function cancel() {
open.value = false;
reset();
}
/** 表单重置 */
function reset() {
form.value = {
id: null,
internationalization1: null,
internationalization2: null,
internationalization3: null,
internationalization4: null,
internationalization5: null,
internationalization6: null,
internationalization7: null,
internationalization8: null,
internationalization9: null,
internationalization10: null,
internationalization11: null,
internationalization12: null,
internationalization13: null,
internationalization14: null,
internationalization15: null,
internationalization16: null,
internationalization17: null,
internationalization18: null,
internationalization19: null,
internationalization20: null,
isDelete: null,
createTime: null,
createId: null,
createBy: null,
createName: null,
modifyTime: null,
modifyId: null,
modifyBy: null,
modifyName: null,
};
proxy.resetForm("postRef");
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
const resetQuery = () => {
proxy.resetForm("queryRef");
handleQuery();
}
/** 多选框选中数据 */
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.id);
single.value = selection.length !== 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
function handleAdd() {
reset();
open.value = true;
title.value = t('test.test.addTitle');
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
const postId = row.id || ids.value;
getTest(postId).then(response => {
form.value = response.data;
open.value = true;
title.value = t('test.test.editTitle');
});
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["postRef"].validate(valid => {
if (valid) {
if (form.value.id != undefined) {
updateTest(form.value).then(response => {
proxy.$modal.msgSuccess(t('option.modificationSuccessful'));
open.value = false;
getList();
});
} else {
addTest(form.value).then(response => {
proxy.$modal.msgSuccess(t('option.addedSuccessfully'));
open.value = false;
getList();
});
}
}
});
}
/** 删除按钮操作 */
function handleDelete(row) {
const postIds = row.postId || ids.value;
proxy.$modal.confirm(t('option.confirmDeletion', {
key: t('test.test.internationalization1'),
value: postIds
})).then(function () {
return delTest(postIds);
}).then(() => {
getList();
proxy.$modal.msgSuccess(t('option.successfullyDeleted'));
}).catch(() => {
});
}
/** 导出按钮操作 */
function handleExport() {
proxy.download("system/post/export", {
...queryParams.value
}, `post_${new Date().getTime()}.xlsx`);
}
getList();
</script>

@ -115,7 +115,6 @@
<!-- <el-table-column :label="t('tireManagement.tireFactoryCode')" align="center" prop="tyreFacCode" width="150"/>-->
<!-- <el-table-column :label="t('tireManagement.enterpriseCode')" align="center" prop="companyCode" width="150"/>-->
<el-table-column label="外胎号" align="center" prop="outerTireNumber" width="150"/>
<el-table-column label="条码号" align="center" prop="feCode" width="150"/>
<el-table-column label="品牌" align="center" prop="brand" width="150"/>
<el-table-column label="规格型号" align="center" prop="size" width="150"/>
<el-table-column label="花纹" align="center" prop="pattern" wXXXidth="150"/>
@ -162,6 +161,7 @@
<!-- </el-button>-->
</template>
</el-table-column>
.
</el-table>
<!-- 分页-->
@ -179,22 +179,19 @@
<el-form-item prop="id" v-if="false">
<el-input v-model="form.id"/>
</el-form-item>
<el-form-item :label="t('tireManagement.tireNo')" prop="tureCode">
<el-input v-model="form.tureCode" :placeholder="t('common.pleaseEnter') + t('tireManagement.tireNo')" />
</el-form-item>
<el-form-item label="品牌" prop="tureCode">
<el-input v-model="form.tureCode" />
<el-form-item label="胎号" prop="outerTireNumber">
<el-input v-model="form.outerTireNumber" />
</el-form-item>
<el-form-item label="花纹" prop="tureCode">
<el-input v-model="form.tureCode" />
<el-form-item label="品牌" prop="brand">
<el-input v-model="form.brand" />
</el-form-item>
<el-form-item label="规格型号" prop="tureCode">
<el-input v-model="form.tureCode" />
<el-form-item label="规格型号" prop="size">
<el-input v-model="form.size" />
</el-form-item>
<el-form-item :label="t('tireManagement.tireSensorID')" prop="sensorId">
<el-input v-model="form.sensorId" :placeholder="t('common.pleaseEnter') + t('tireManagement.tireSensorID')"/>
</el-form-item>
<el-form-item label="花纹" prop="pattern">
<el-input v-model="form.pattern" />
</el-form-item>
<el-form-item :label="t('tireManagement.treadDepth')" prop="currentTextureDepth">
<el-input-number
v-model="form.currentTextureDepth"
@ -278,9 +275,9 @@ const queryParams = ref({
//
const rules = {
tureCode: [{required: true, message: "胎号不能为空", trigger: "blur"}],
type: [{required: true, message: "轮胎型号不能为空", trigger: "blur"}],
serialNumber: [{required: true, message: "轮胎编号不能为空", trigger: "blur"}],
outerTireNumber: [{required: true, message: "胎号不能为空", trigger: "blur"}],
// type: [{required: true, message: "", trigger: "blur"}],
// serialNumber: [{required: true, message: "", trigger: "blur"}],
}
//

@ -31,8 +31,8 @@ export default defineConfig(({mode, command}) => {
proxy: {
// https://cn.vitejs.dev/config/#server-proxy
'/dev-api': {
target: 'http://10.10.42.32:8080',
// target: 'http://localhost:8080',
// target: 'http://10.10.42.32:8080',
target: 'http://localhost:8080',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, '')
}

Loading…
Cancel
Save