新代码
This commit is contained in:
parent
1d87663752
commit
f3f947e57b
|
@ -0,0 +1,18 @@
|
|||
package com.hivekion.basedata.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author liDongYu
|
||||
* @since 2025-09-18
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/basedata/imgVehicleImage")
|
||||
public class ImgVehicleImageController {
|
||||
|
||||
}
|
|
@ -19,6 +19,7 @@ import com.hivekion.baseData.domain.tblvehicleVo.ImgVehicleImageInfoVo;
|
|||
import com.hivekion.baseData.domain.tblvehicleVo.VehicleAddInputVo;
|
||||
import com.hivekion.baseData.domain.tblvehicleVo.VehicleSearchVo;
|
||||
import com.hivekion.baseData.domain.tblvehicleVo.VehicleViewVo;
|
||||
import com.hivekion.baseData.service.IImgAircraftImageService;
|
||||
import com.hivekion.baseData.service.IImgVehicleImageService;
|
||||
import com.hivekion.common.annotation.AutoLog;
|
||||
import com.hivekion.common.entity.PagedResultVo;
|
||||
|
@ -27,10 +28,13 @@ import com.hivekion.scenario.entity.Resource;
|
|||
import com.hivekion.scenario.entity.Vehicle;
|
||||
import com.hivekion.scenario.service.IVehicleService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
@ -47,6 +51,9 @@ public class TblVehicleController {
|
|||
@Autowired
|
||||
private IImgVehicleImageService iImgVehicleImageService;
|
||||
|
||||
@Autowired
|
||||
private IImgVehicleImageService imageService;
|
||||
|
||||
@PostMapping("/getList")
|
||||
@ApiOperation(value = "获取车辆列表", notes = "")
|
||||
@AutoLog(value = "获取车辆列表", operationType = OperationTypeEnum.SELECT, module = "基础数据/车辆")
|
||||
|
@ -96,6 +103,19 @@ public class TblVehicleController {
|
|||
return iImgVehicleImageService.getInfo(Id);
|
||||
}
|
||||
|
||||
@PostMapping("/addimg")
|
||||
@ApiOperation(value = "新增车辆图片", notes = "")
|
||||
@AutoLog(value = "新增车辆图片", operationType = OperationTypeEnum.INSERT, module = "基础数据/新增车辆图片")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id",
|
||||
value = "id",
|
||||
required = true
|
||||
)
|
||||
})
|
||||
public boolean addImgList(@RequestPart("file") MultipartFile file, Integer id) throws IOException {
|
||||
return imageService.add(file,id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成新Id
|
||||
*
|
||||
|
|
|
@ -12,10 +12,10 @@ public class VehicleViewVo implements Serializable {
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@JsonProperty("ID")
|
||||
private Integer id;
|
||||
private Integer Id;
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
private String vehicleName;
|
||||
@JsonProperty("Name")
|
||||
private String Name;
|
||||
|
||||
@ApiModelProperty("速度")
|
||||
private String vehicleSpreed;
|
||||
|
|
|
@ -0,0 +1,82 @@
|
|||
package com.hivekion.basedata.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author liDongYu
|
||||
* @since 2025-09-18
|
||||
*/
|
||||
@TableName("IMG_VEHICLE_IMAGE")
|
||||
@ApiModel(value = "ImgVehicleImage对象", description = "")
|
||||
public class ImgVehicleImage implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String guid;
|
||||
|
||||
private byte[] icon;
|
||||
|
||||
private byte[] image;
|
||||
|
||||
private String model3d;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getGuid() {
|
||||
return guid;
|
||||
}
|
||||
|
||||
public void setGuid(String guid) {
|
||||
this.guid = guid;
|
||||
}
|
||||
|
||||
public byte[] getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(byte[] icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public byte[] getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public void setImage(byte[] image) {
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
public String getModel3d() {
|
||||
return model3d;
|
||||
}
|
||||
|
||||
public void setModel3d(String model3d) {
|
||||
this.model3d = model3d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ImgVehicleImage{" +
|
||||
"id = " + id +
|
||||
", guid = " + guid +
|
||||
", icon = " + icon +
|
||||
", image = " + image +
|
||||
", model3d = " + model3d +
|
||||
"}";
|
||||
}
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
package com.hivekion.common;
|
||||
|
||||
import com.hivekion.common.exception.BusinessException;
|
||||
import com.sun.javafx.binding.StringFormatter;
|
||||
import java.time.Duration;
|
||||
|
||||
|
||||
import net.sourceforge.pinyin4j.PinyinHelper;
|
||||
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
|
||||
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
|
||||
|
@ -10,6 +10,9 @@ import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
|
|||
import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType;
|
||||
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
|
||||
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.time.Duration;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
@ -17,6 +20,7 @@ import java.util.stream.Collectors;
|
|||
* 一些公用的方法集
|
||||
*/
|
||||
public class utils {
|
||||
|
||||
/**
|
||||
* 取差集
|
||||
*/
|
||||
|
@ -95,7 +99,7 @@ public class utils {
|
|||
long hours = duration.toHours();
|
||||
long minutes = duration.minusHours(hours).toMinutes();
|
||||
long seconds = duration.minusHours(hours).minusMinutes(minutes).getSeconds();
|
||||
return StringFormatter.format("%d小时%d分钟%d秒\n", hours, minutes, seconds).get();
|
||||
return MessageFormat.format("{0}小时{1}分钟{2}秒", hours, minutes, seconds);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
|
|
@ -21,12 +21,12 @@ public class Vehicle implements Serializable {
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("物理主键id")
|
||||
@TableField(value = "id")
|
||||
private Integer id;
|
||||
@TableField(value = "ID")
|
||||
private Integer Id;
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
@TableField(value="vehicle_name")
|
||||
private String vehicleName;
|
||||
@TableField(value="NAME")
|
||||
private String Name;
|
||||
|
||||
@ApiModelProperty("速度")
|
||||
@TableField(value = "vehicle_spreed")
|
||||
|
@ -93,19 +93,19 @@ public class Vehicle implements Serializable {
|
|||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
return Id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public String getVehicleName() {
|
||||
return vehicleName;
|
||||
public String getName() {
|
||||
return Name;
|
||||
}
|
||||
|
||||
public void setVehicleName(String vehicleName) {
|
||||
this.vehicleName = vehicleName;
|
||||
public void setName(String name) {
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public String getVehicleSpreed() {
|
||||
|
@ -207,8 +207,8 @@ public class Vehicle implements Serializable {
|
|||
@Override
|
||||
public String toString() {
|
||||
return "Vehicle{" +
|
||||
"id=" + id +
|
||||
", vehicleName='" + vehicleName + '\'' +
|
||||
"id=" + Id +
|
||||
", vehicleName='" + Name + '\'' +
|
||||
", vehicleSpreed='" + vehicleSpreed + '\'' +
|
||||
", vehicleType='" + vehicleType + '\'' +
|
||||
", fuelAbility=" + fuelAbility +
|
||||
|
|
5
src/main/resources/mapper/tbl/ImgVehicleImageMapper.xml
Normal file
5
src/main/resources/mapper/tbl/ImgVehicleImageMapper.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?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.hivekion.baseData.mapper.ImgVehicleImageMapper">
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user