Merge branch 'main' of http://git.hivekion.com:3000/liyudong/simulation-backend
This commit is contained in:
commit
ad420b3e8c
|
|
@ -0,0 +1,65 @@
|
|||
package com.hivekion.baseData.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.hivekion.baseData.domain.TblEntity;
|
||||
import com.hivekion.baseData.domain.tblhospitalVo.HospitalSearchVo;
|
||||
import com.hivekion.baseData.domain.tblhospitalVo.HospitalViewVo;
|
||||
import com.hivekion.baseData.domain.tblresourceVo.ResourcesTypeVo;
|
||||
import com.hivekion.baseData.service.ITblEntityService;
|
||||
import com.hivekion.common.annotation.AutoLog;
|
||||
import com.hivekion.common.entity.PagedResultVo;
|
||||
import com.hivekion.common.entity.ResponseData;
|
||||
import com.hivekion.common.enums.OperationTypeEnum;
|
||||
import com.hivekion.scenario.entity.Resource;
|
||||
import com.hivekion.scenario.service.IResourceService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/basedata/hospital")
|
||||
|
||||
@Api(value = "医院", tags = {"装备管理-医院"})
|
||||
public class TblHospitalController {
|
||||
|
||||
@Autowired
|
||||
private IResourceService service;
|
||||
|
||||
@Autowired
|
||||
private ITblEntityService entityService;
|
||||
|
||||
@PostMapping("/getList")
|
||||
@ApiOperation(value = "获取医院列表", notes = "")
|
||||
@AutoLog(value = "获取医院列表", operationType = OperationTypeEnum.SELECT, module = "基础数据/医院")
|
||||
public PagedResultVo<HospitalViewVo> getList(@RequestBody HospitalSearchVo vo) {
|
||||
PagedResultVo<Resource> resources = this.service.listAllBuildResourceByTypeWithPage(7,vo);
|
||||
PagedResultVo<HospitalViewVo> hospitalViewVoPagedResultVo = new PagedResultVo<>();
|
||||
List<HospitalViewVo> hospitalViewVos = CollectionUtil.newArrayList();
|
||||
|
||||
resources.getData().stream().forEach(resource -> {
|
||||
HospitalViewVo hospitalViewVo = new HospitalViewVo();
|
||||
BeanUtil.copyProperties(resource,hospitalViewVo);
|
||||
JSONObject jsonObject= (JSONObject) JSON.parse(resource.getResourceAttribut());
|
||||
hospitalViewVo.setDoctorNum(jsonObject.get("doctor_num").toString());
|
||||
hospitalViewVo.setHospitalBed(jsonObject.get("hospital_bed").toString());
|
||||
hospitalViewVo.setNurseNum(jsonObject.get("nurse_num").toString());
|
||||
hospitalViewVo.setResourceType("hospital");
|
||||
|
||||
// resource.getResourceAttribut()
|
||||
hospitalViewVos.add(hospitalViewVo);
|
||||
});
|
||||
hospitalViewVoPagedResultVo.setData(hospitalViewVos);
|
||||
return hospitalViewVoPagedResultVo;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,118 @@
|
|||
package com.hivekion.baseData.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.hivekion.baseData.domain.TblAircraftVo.ImgAircraftImageInfoVo;
|
||||
import com.hivekion.baseData.domain.TblAircraftVo.TblAircraftAddInputVo;
|
||||
import com.hivekion.baseData.domain.TblAircraftVo.TblAircraftModelVo;
|
||||
import com.hivekion.baseData.domain.tblhospitalVo.HospitalSearchVo;
|
||||
import com.hivekion.baseData.domain.tblhospitalVo.HospitalViewVo;
|
||||
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.IImgVehicleImageService;
|
||||
import com.hivekion.common.annotation.AutoLog;
|
||||
import com.hivekion.common.entity.PagedResultVo;
|
||||
import com.hivekion.common.enums.OperationTypeEnum;
|
||||
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.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/basedata/vehicle")
|
||||
|
||||
@Api(value = "车辆", tags = {"装备管理-车辆"})
|
||||
public class TblVehicleController {
|
||||
|
||||
@Autowired
|
||||
private IVehicleService vehicleService;
|
||||
|
||||
@Autowired
|
||||
private IImgVehicleImageService iImgVehicleImageService;
|
||||
|
||||
@PostMapping("/getList")
|
||||
@ApiOperation(value = "获取车辆列表", notes = "")
|
||||
@AutoLog(value = "获取车辆列表", operationType = OperationTypeEnum.SELECT, module = "基础数据/车辆")
|
||||
public PagedResultVo<VehicleViewVo> getList(@RequestBody VehicleSearchVo vo) {
|
||||
Page<Vehicle> page = new Page<>(vo.getPageNum(), vo.getPageSize());
|
||||
LambdaQueryWrapper<Vehicle> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
||||
lambdaQueryWrapper.eq(StringUtils.isNotEmpty(vo.getVehicleType()),Vehicle::getVehicleType,vo.getVehicleType());
|
||||
IPage<Vehicle> vehicleList = this.vehicleService.page(page,lambdaQueryWrapper);
|
||||
PagedResultVo<VehicleViewVo> vehicleViewVoPagedResultVo = new PagedResultVo<>();
|
||||
List<VehicleViewVo> vehicleViewVos = CollectionUtil.newArrayList();
|
||||
|
||||
vehicleList.getRecords().stream().forEach(vehicle -> {
|
||||
VehicleViewVo vehicleViewVo = new VehicleViewVo();
|
||||
BeanUtil.copyProperties(vehicle,vehicleViewVo);
|
||||
vehicleViewVo.setId(vehicle.getId());
|
||||
|
||||
// resource.getResourceAttribut()
|
||||
vehicleViewVos.add(vehicleViewVo);
|
||||
});
|
||||
vehicleViewVoPagedResultVo.setData(vehicleViewVos);
|
||||
return vehicleViewVoPagedResultVo;
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getInfo")
|
||||
@ApiOperation(value = "获取车辆详细信息", notes = "")
|
||||
@AutoLog(value = "获取车辆详细信息", operationType = OperationTypeEnum.SELECT, module = "基础数据/车辆信息")
|
||||
public VehicleViewVo getInfo(Integer id, boolean doFlag) {
|
||||
return vehicleService.getInfo(id,doFlag);
|
||||
}
|
||||
|
||||
@DeleteMapping("/remove")
|
||||
@ApiOperation(value = "删除车辆", notes = "")
|
||||
@AutoLog(value = "删除车辆", operationType = OperationTypeEnum.DELETE, module = "基础数据/车辆信息")
|
||||
public Boolean remove(String Guid) {
|
||||
return vehicleService.remove(Guid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
|
||||
@GetMapping("/getimglist")
|
||||
@ApiOperation(value = "获取车辆图片", notes = "")
|
||||
@AutoLog(value = "获取车辆图片", operationType = OperationTypeEnum.SELECT, module = "基础数据/获取车辆图片")
|
||||
public ImgVehicleImageInfoVo getImgList(Integer Id) throws IOException {
|
||||
return iImgVehicleImageService.getInfo(Id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成新Id
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getNewId")
|
||||
@ApiOperation(value = "获取新id", notes = "")
|
||||
@AutoLog(value = "获取新id", operationType = OperationTypeEnum.SELECT, module = "基础数据/获取新id")
|
||||
public Integer getNewId() {
|
||||
return vehicleService.getNewId();
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
@ApiOperation(value = "新增车辆信息", notes = "")
|
||||
@AutoLog(value = "新增车辆信息", operationType = OperationTypeEnum.INSERT, module = "基础数据/新增车辆信息")
|
||||
public boolean add(@RequestBody VehicleAddInputVo inputVo) throws Exception {
|
||||
// service.checkAircraft(inputVo);
|
||||
return vehicleService.add(inputVo);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package com.hivekion.baseData.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.hivekion.baseData.domain.tblhospitalVo.HospitalSearchVo;
|
||||
import com.hivekion.baseData.domain.tblhospitalVo.HospitalViewVo;
|
||||
import com.hivekion.baseData.domain.tblwarehouseVo.WarehouseSearchVo;
|
||||
import com.hivekion.baseData.domain.tblwarehouseVo.WarehouseViewVo;
|
||||
import com.hivekion.common.annotation.AutoLog;
|
||||
import com.hivekion.common.entity.PagedResultVo;
|
||||
import com.hivekion.common.enums.OperationTypeEnum;
|
||||
import com.hivekion.scenario.entity.Resource;
|
||||
import com.hivekion.scenario.service.IResourceService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/basedata/warehouse")
|
||||
|
||||
@Api(value = "仓库", tags = {"装备管理-仓库"})
|
||||
public class TblWareHouseController {
|
||||
|
||||
@Autowired
|
||||
private IResourceService service;
|
||||
@PostMapping("/getList")
|
||||
@ApiOperation(value = "获取仓库列表", notes = "")
|
||||
@AutoLog(value = "获取仓库列表", operationType = OperationTypeEnum.SELECT, module = "基础数据/仓库")
|
||||
public PagedResultVo<WarehouseViewVo> getList(@RequestBody WarehouseSearchVo vo) {
|
||||
PagedResultVo<Resource> resources = this.service.listAllBuildResourceByTypeWithPage(8,vo);
|
||||
PagedResultVo<WarehouseViewVo> warehouseViewVoPagedResultVo = new PagedResultVo<>();
|
||||
List<WarehouseViewVo> warehouseViewVos = CollectionUtil.newArrayList();
|
||||
resources.getData().stream().forEach(resource -> {
|
||||
WarehouseViewVo warehouseViewVo = new WarehouseViewVo();
|
||||
BeanUtil.copyProperties(resource,warehouseViewVo);
|
||||
JSONObject jsonObject= (JSONObject) JSON.parse(resource.getResourceAttribut());
|
||||
warehouseViewVo.setMedicalNum(jsonObject.get("medical_num").toString());
|
||||
warehouseViewVo.setFuelNum(jsonObject.get("fuel_num").toString());
|
||||
warehouseViewVo.setAmmunitionNum(jsonObject.get("ammunition_num").toString());
|
||||
warehouseViewVos.add(warehouseViewVo);
|
||||
});
|
||||
warehouseViewVoPagedResultVo.setData(warehouseViewVos);
|
||||
return warehouseViewVoPagedResultVo;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.hivekion.baseData.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.hivekion.baseData.domain.TblEntity;
|
||||
import com.hivekion.baseData.entity.Fightpowerhierarchy;
|
||||
import com.hivekion.baseData.service.FightpowerhierarchyService;
|
||||
|
|
@ -40,7 +41,9 @@ public class TreeController {
|
|||
public ResponseData<List<TreeNode>> armamentTree(
|
||||
@ApiParam(value = "父节点ID,指定从哪个节点开始返回装备树") Integer id) {
|
||||
List<TreeNode> nodeList = new ArrayList<>();
|
||||
List<TblEntity> list = tblEntityService.list();
|
||||
|
||||
List<TblEntity> list = tblEntityService.list(new QueryWrapper<TblEntity>().notIn("ENTITYTYPE","DataModel")
|
||||
.notIn("PARENTID",-3));
|
||||
//排序
|
||||
list.sort((a, b) -> {
|
||||
if (a.getDisplayIndex() == null) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
package com.hivekion.baseData.domain;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ImgVehicleImage {
|
||||
|
||||
private Integer id;
|
||||
private String guid;
|
||||
private byte[] icon;
|
||||
private byte[] image;
|
||||
private String model3D;
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
package com.hivekion.baseData.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
// // import com.gitee.sunchenbin.mybatis.actable.annotation.ColumnComment;
|
||||
|
|
@ -17,9 +19,10 @@ import org.springframework.format.annotation.DateTimeFormat;
|
|||
@TableName(value = "tbl_entity")
|
||||
public class TblEntity extends TreeEntity {
|
||||
|
||||
@TableField
|
||||
|
||||
|
||||
@CreatedBy
|
||||
@TableId(value = "ID", type = IdType.AUTO)
|
||||
private Integer Id;
|
||||
@TableField(value="entitytype")
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ import java.util.Date;
|
|||
@Data
|
||||
public class TblEntityAddInputVo {
|
||||
|
||||
// private Integer Id;
|
||||
// private String EntityType;
|
||||
private Integer Id;
|
||||
private String entityType;
|
||||
private String EntityName;
|
||||
private Integer ParentId;
|
||||
// private String DisplayIndex;
|
||||
|
|
|
|||
|
|
@ -7,4 +7,5 @@ public class TblEntityUpdateNameVo {
|
|||
private Integer id;
|
||||
private String EntityName;
|
||||
private Integer ParentId;
|
||||
private String EntityType;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
package com.hivekion.baseData.domain.tblhospitalVo;
|
||||
|
||||
import com.hivekion.common.entity.SearchInputVo;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HospitalSearchVo extends SearchInputVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.hivekion.baseData.domain.tblhospitalVo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class HospitalViewVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
private Integer id;
|
||||
|
||||
|
||||
private String resourceName;
|
||||
|
||||
|
||||
private String icon;
|
||||
|
||||
|
||||
private String lat;
|
||||
|
||||
private String lng;
|
||||
|
||||
private String resourceAttribut;
|
||||
|
||||
private String doctorNum;
|
||||
private String nurseNum;
|
||||
private String hospitalBed;
|
||||
|
||||
private String resourceType;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.hivekion.baseData.domain.tblresourceVo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ResourcesTypeVo {
|
||||
|
||||
private String resourceTypeCode;
|
||||
private String resourceTypeName;
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.hivekion.baseData.domain.tblvehicleVo;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ImgVehicleImageInfoVo {
|
||||
|
||||
private Integer id;
|
||||
private String guid;
|
||||
private String icon;
|
||||
private String image;
|
||||
private String model3D;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package com.hivekion.baseData.domain.tblvehicleVo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class VehicleAddInputVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@JsonProperty(value = "ID")
|
||||
private Integer id;
|
||||
|
||||
|
||||
private String vehicleName;
|
||||
|
||||
|
||||
private String vehicleSpreed;
|
||||
|
||||
|
||||
private String vehicleType;
|
||||
|
||||
|
||||
private Integer fuelAbility;
|
||||
|
||||
|
||||
private Integer medicalAbility;
|
||||
|
||||
|
||||
private Integer ammunitionAbility;
|
||||
|
||||
|
||||
private Integer vehicleUse;
|
||||
|
||||
|
||||
private String IconType;
|
||||
|
||||
private String Model3D;
|
||||
|
||||
private String Description;
|
||||
|
||||
private Integer ParentDirId;
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.hivekion.baseData.domain.tblvehicleVo;
|
||||
|
||||
import com.hivekion.common.entity.SearchInputVo;
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@Data
|
||||
public class VehicleSearchVo extends SearchInputVo {
|
||||
|
||||
private String vehicleType;
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.hivekion.baseData.domain.tblvehicleVo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class VehicleViewVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@JsonProperty("ID")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
private String vehicleName;
|
||||
|
||||
@ApiModelProperty("速度")
|
||||
private String vehicleSpreed;
|
||||
|
||||
@ApiModelProperty("类型")
|
||||
private String vehicleType;
|
||||
|
||||
@ApiModelProperty("运油能力")
|
||||
private Integer fuelAbility;
|
||||
|
||||
@ApiModelProperty("运药能力")
|
||||
private Integer medicalAbility;
|
||||
|
||||
@ApiModelProperty("运弹药能力")
|
||||
private Integer ammunitionAbility;
|
||||
|
||||
private Integer vehicleUse;
|
||||
|
||||
private String Guid;
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.hivekion.baseData.domain.tblwarehouseVo;
|
||||
|
||||
import com.hivekion.common.entity.SearchInputVo;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WarehouseSearchVo extends SearchInputVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.hivekion.baseData.domain.tblwarehouseVo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class WarehouseViewVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer id;
|
||||
|
||||
|
||||
private String resourceName;
|
||||
|
||||
|
||||
private String icon;
|
||||
|
||||
|
||||
private String lat;
|
||||
|
||||
private String lng;
|
||||
|
||||
private String resourceAttribut;
|
||||
|
||||
private String medicalNum;
|
||||
private String fuelNum;
|
||||
private String ammunitionNum;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.hivekion.baseData.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.hivekion.baseData.domain.ImgAircraftImage;
|
||||
import com.hivekion.baseData.domain.ImgVehicleImage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface ImgVehicleImageMapper extends BaseMapper<ImgVehicleImage> {
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.hivekion.baseData.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.hivekion.baseData.domain.ImgAircraftImage;
|
||||
import com.hivekion.baseData.domain.ImgVehicleImage;
|
||||
import com.hivekion.baseData.domain.TblAircraftVo.ImgAircraftImageInfoVo;
|
||||
import com.hivekion.baseData.domain.tblvehicleVo.ImgVehicleImageInfoVo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public interface IImgVehicleImageService extends IService<ImgVehicleImage> {
|
||||
ImgVehicleImageInfoVo getInfo(Integer id);
|
||||
// boolean add(ImgAircraftImageAddInputVo vo);
|
||||
boolean add(MultipartFile file, Integer id) throws IOException;
|
||||
boolean remove(String Guid);
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.hivekion.baseData.service.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.hivekion.baseData.domain.ImgVehicleImage;
|
||||
import com.hivekion.baseData.domain.tblvehicleVo.ImgVehicleImageInfoVo;
|
||||
import com.hivekion.baseData.mapper.ImgVehicleImageMapper;
|
||||
import com.hivekion.baseData.service.IImgVehicleImageService;
|
||||
import com.hivekion.common.exception.BusinessException;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Base64Utils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
@Service
|
||||
public class ImgVehicleImageServiceImpl extends ServiceImpl<ImgVehicleImageMapper, ImgVehicleImage> implements IImgVehicleImageService {
|
||||
@Override
|
||||
public ImgVehicleImageInfoVo getInfo(Integer id){
|
||||
ImgVehicleImage img = this.getById(id);
|
||||
if(img==null){
|
||||
throw new BusinessException(500,"未找到该图片信息");
|
||||
}
|
||||
ImgVehicleImageInfoVo vo = new ImgVehicleImageInfoVo();
|
||||
BeanUtils.copyProperties(img,vo);
|
||||
// vo.setImage(Base64.byteArrayToAltBase64(img.getImage()));
|
||||
vo.setImage(Base64Utils.encodeToString(img.getImage()));
|
||||
return vo;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public boolean add(ImgAircraftImageAddInputVo vo) {
|
||||
// ImgAircraftImage img = new ImgAircraftImage();
|
||||
// BeanUtils.copyProperties(vo,img);
|
||||
// img.setImage(Base64Utils.decodeFromString(vo.getImage()));
|
||||
//// img.setImage(Base64.altBase64ToByteArray(vo.getImage()));
|
||||
// img.setGuid("hsfw-dataaircraft-" +String.format("%12d",vo.getId()).replace(" ", "0"));
|
||||
// return this.saveOrUpdate(img);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean add(MultipartFile file, Integer id) throws IOException {
|
||||
byte[] bytes = file.getBytes();
|
||||
ImgVehicleImage img = new ImgVehicleImage();
|
||||
img.setImage(bytes);
|
||||
// img.setImage(Base64.altBase64ToByteArray(vo.getImage()));
|
||||
img.setId(id);
|
||||
img.setGuid("hsfw-dataaircraft-" +String.format("%12d",id).replace(" ", "0"));
|
||||
|
||||
return this.saveOrUpdate(img);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove(String Guid) {
|
||||
LambdaQueryWrapper<ImgVehicleImage> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ImgVehicleImage::getGuid,Guid);
|
||||
return this.remove(wrapper);
|
||||
}
|
||||
}
|
||||
|
|
@ -60,13 +60,21 @@ public class TblEntityServiceImpl extends ServiceImpl<TblEntityMapper, TblEntity
|
|||
Long s = System.currentTimeMillis();
|
||||
Date date = new Date(s);
|
||||
entity.setCreateTime(date);
|
||||
entity.setEntityType(getParentID(vo.getParentId()));
|
||||
if(vo.getParentId() != -1) {
|
||||
entity.setEntityType(getParentID(vo.getParentId()));
|
||||
}else{
|
||||
entity.setEntityType(vo.getEntityType());
|
||||
}
|
||||
if (checkNameUnique(String.valueOf(entity.getId()), entity.getEntityName(), vo.getParentId())) {
|
||||
throw new BusinessException(500, "该名称已存在");
|
||||
} else {
|
||||
LambdaUpdateWrapper<TblEntity> tWrapper = new LambdaUpdateWrapper<TblEntity>()
|
||||
.eq(TblEntity::getId, entity.getId());
|
||||
return this.saveOrUpdate(entity, tWrapper);
|
||||
if(entity.getId() != null) {
|
||||
LambdaUpdateWrapper<TblEntity> tWrapper = new LambdaUpdateWrapper<TblEntity>()
|
||||
.eq(TblEntity::getId, entity.getId());
|
||||
return this.saveOrUpdate(entity);
|
||||
}else{
|
||||
return this.save(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,4 +38,6 @@ public class ResourceController {
|
|||
return vehicleList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,42 @@ public class Vehicle implements Serializable {
|
|||
@TableField(value = "upd_oper")
|
||||
private String updOper;
|
||||
|
||||
@ApiModelProperty("车辆用途")
|
||||
@TableField(value = "vehicle_use")
|
||||
private Integer vehicleUse;
|
||||
|
||||
@TableField("IconType")
|
||||
// // @ColumnType(value = MySqlTypeConstant.VARCHAR, length = 10)
|
||||
// // @ColumnComment("二维标准军标名称")
|
||||
private String IconType;
|
||||
|
||||
@TableField
|
||||
// // @ColumnType(value = MySqlTypeConstant.LONGTEXT)
|
||||
// // @ColumnComment("三维模型存储路径,没有设置则将使用通用模型。")
|
||||
private String Model3D;
|
||||
@TableField
|
||||
// // @ColumnType(value = MySqlTypeConstant.LONGTEXT)
|
||||
// // @ColumnComment("对飞机的详细描述")
|
||||
private String Description;
|
||||
|
||||
@TableField
|
||||
// // @ColumnType(value = MySqlTypeConstant.INT, length = 11)
|
||||
// // @ColumnComment("用于数据库浏览时对装备分类使用,在模型中暂时没有使用。")
|
||||
private Integer ParentId;
|
||||
|
||||
@TableField
|
||||
// // @ColumnType(value = MySqlTypeConstant.VARCHAR, length = 36)
|
||||
// // @ColumnComment("Guid")
|
||||
private String Guid;
|
||||
|
||||
public String getGuid() {
|
||||
return Guid;
|
||||
}
|
||||
|
||||
public void setGuid(String guid) {
|
||||
Guid = guid;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
|
@ -128,18 +164,64 @@ public class Vehicle implements Serializable {
|
|||
this.updOper = updOper;
|
||||
}
|
||||
|
||||
public Integer getVehicleUse() {
|
||||
return vehicleUse;
|
||||
}
|
||||
|
||||
public void setVehicleUse(Integer vehicleUse) {
|
||||
this.vehicleUse = vehicleUse;
|
||||
}
|
||||
|
||||
public String getIconType() {
|
||||
return IconType;
|
||||
}
|
||||
|
||||
public void setIconType(String iconType) {
|
||||
IconType = iconType;
|
||||
}
|
||||
|
||||
public String getModel3D() {
|
||||
return Model3D;
|
||||
}
|
||||
|
||||
public void setModel3D(String model3D) {
|
||||
Model3D = model3D;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return Description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
Description = description;
|
||||
}
|
||||
|
||||
public Integer getParentId() {
|
||||
return ParentId;
|
||||
}
|
||||
|
||||
public void setParentId(Integer parentId) {
|
||||
ParentId = parentId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Vehicle{" +
|
||||
"id = " + id +
|
||||
", vehicleName = " + vehicleName +
|
||||
", vehicleSpreed = " + vehicleSpreed +
|
||||
", vehicleType = " + vehicleType +
|
||||
", fuelAbility = " + fuelAbility +
|
||||
", medicalAbility = " + medicalAbility +
|
||||
", ammunitionAbility = " + ammunitionAbility +
|
||||
", createOper = " + createOper +
|
||||
", updOper = " + updOper +
|
||||
"}";
|
||||
"id=" + id +
|
||||
", vehicleName='" + vehicleName + '\'' +
|
||||
", vehicleSpreed='" + vehicleSpreed + '\'' +
|
||||
", vehicleType='" + vehicleType + '\'' +
|
||||
", fuelAbility=" + fuelAbility +
|
||||
", medicalAbility=" + medicalAbility +
|
||||
", ammunitionAbility=" + ammunitionAbility +
|
||||
", createOper='" + createOper + '\'' +
|
||||
", updOper='" + updOper + '\'' +
|
||||
", vehicleUse=" + vehicleUse +
|
||||
", IconType='" + IconType + '\'' +
|
||||
", Model3D='" + Model3D + '\'' +
|
||||
", Description='" + Description + '\'' +
|
||||
", ParentId=" + ParentId +
|
||||
", Guid='" + Guid + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,16 @@
|
|||
package com.hivekion.scenario.service;
|
||||
|
||||
import com.hivekion.baseData.domain.tblhospitalVo.HospitalSearchVo;
|
||||
import com.hivekion.baseData.domain.tblhospitalVo.HospitalViewVo;
|
||||
import com.hivekion.common.entity.PagedResultVo;
|
||||
import com.hivekion.common.entity.SearchInputVo;
|
||||
import com.hivekion.scenario.entity.Resource;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.hivekion.scenario.entity.Vehicle;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
|
@ -19,6 +24,8 @@ public interface IResourceService extends IService<Resource> {
|
|||
|
||||
public List<Resource> listAllBuildResourceByType(Integer type);
|
||||
|
||||
public PagedResultVo<Resource> listAllBuildResourceByTypeWithPage(Integer type, SearchInputVo hospitalSearchVo);
|
||||
|
||||
public Map<Integer,Resource> listBuildResourceByType(Integer type);
|
||||
|
||||
public List<Vehicle> listAllVehiclesByType(Integer type,Integer resourceId);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
package com.hivekion.scenario.service;
|
||||
|
||||
import com.hivekion.baseData.domain.TblAircraftVo.TblAircraftAddInputVo;
|
||||
import com.hivekion.baseData.domain.TblAircraftVo.TblAircraftModelVo;
|
||||
import com.hivekion.baseData.domain.tblvehicleVo.VehicleAddInputVo;
|
||||
import com.hivekion.baseData.domain.tblvehicleVo.VehicleViewVo;
|
||||
import com.hivekion.scenario.entity.Vehicle;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
|
|
@ -13,4 +17,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
*/
|
||||
public interface IVehicleService extends IService<Vehicle> {
|
||||
|
||||
VehicleViewVo getInfo(Integer id, boolean doFlag);
|
||||
|
||||
Integer getNewId();
|
||||
|
||||
boolean remove(String Guid);
|
||||
|
||||
boolean add(VehicleAddInputVo vo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,19 @@
|
|||
package com.hivekion.scenario.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.hivekion.baseData.domain.TblFuel;
|
||||
import com.hivekion.baseData.domain.TblFuelVo.TblFuelViewVo;
|
||||
import com.hivekion.baseData.domain.tblhospitalVo.HospitalSearchVo;
|
||||
import com.hivekion.baseData.domain.tblwarehouseVo.WarehouseSearchVo;
|
||||
import com.hivekion.baseData.domain.tblwarehouseVo.WarehouseViewVo;
|
||||
import com.hivekion.common.entity.PagedResultVo;
|
||||
import com.hivekion.common.entity.SearchInputVo;
|
||||
import com.hivekion.scenario.entity.Resource;
|
||||
import com.hivekion.scenario.entity.ResourceVehicleRela;
|
||||
import com.hivekion.scenario.entity.Vehicle;
|
||||
|
|
@ -9,6 +22,7 @@ import com.hivekion.scenario.service.IResourceService;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.hivekion.scenario.service.IResourceVehicleRelaService;
|
||||
import com.hivekion.scenario.service.IVehicleService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
|
@ -44,6 +58,27 @@ public class ResourceServiceImpl extends ServiceImpl<ResourceMapper, Resource> i
|
|||
return this.resourceMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PagedResultVo<Resource> listAllBuildResourceByTypeWithPage(Integer type, SearchInputVo searchInputVo) {
|
||||
if(type.intValue() == 7){
|
||||
HospitalSearchVo hospitalSearchVo = (HospitalSearchVo) searchInputVo;
|
||||
}
|
||||
if(type.intValue() ==8){
|
||||
WarehouseSearchVo warehouseViewVo = (WarehouseSearchVo) searchInputVo;
|
||||
}
|
||||
Page<Resource> page = new Page<>(searchInputVo.getPageNum(), searchInputVo.getPageSize());
|
||||
page.addOrder(new OrderItem("id", true));
|
||||
LambdaQueryWrapper<Resource> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
||||
lambdaQueryWrapper.eq(Resource::getResourceType,type);
|
||||
IPage<Resource> data = this.page(page,lambdaQueryWrapper);
|
||||
Integer total = (int) data.getTotal();
|
||||
PagedResultVo<Resource> result = new PagedResultVo<>(searchInputVo, total, data
|
||||
.getRecords());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Map<Integer, Resource> listBuildResourceByType(Integer type) {
|
||||
QueryWrapper<Resource> queryWrapper = new QueryWrapper<>();
|
||||
|
|
|
|||
|
|
@ -1,11 +1,27 @@
|
|||
package com.hivekion.scenario.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.hivekion.baseData.domain.TblAircraft;
|
||||
import com.hivekion.baseData.domain.TblEntity;
|
||||
import com.hivekion.baseData.domain.tblvehicleVo.VehicleAddInputVo;
|
||||
import com.hivekion.baseData.domain.tblvehicleVo.VehicleViewVo;
|
||||
import com.hivekion.baseData.service.ITblEntityService;
|
||||
import com.hivekion.common.exception.BusinessException;
|
||||
import com.hivekion.scenario.entity.Vehicle;
|
||||
import com.hivekion.scenario.mapper.VehicleMapper;
|
||||
import com.hivekion.scenario.service.IVehicleService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 车辆信息表 服务实现类
|
||||
|
|
@ -17,4 +33,55 @@ import org.springframework.stereotype.Service;
|
|||
@Service
|
||||
public class VehicleServiceImpl extends ServiceImpl<VehicleMapper, Vehicle> implements IVehicleService {
|
||||
|
||||
@Autowired
|
||||
private ITblEntityService entityService;
|
||||
|
||||
@Override
|
||||
public VehicleViewVo getInfo(Integer id, boolean doFlag) {
|
||||
LambdaQueryWrapper<Vehicle> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
||||
lambdaQueryWrapper.eq(id != null,Vehicle::getId,id);
|
||||
Vehicle vehicle = this.baseMapper.selectOne(lambdaQueryWrapper);
|
||||
VehicleViewVo vehicleViewVo = new VehicleViewVo();
|
||||
if(!Objects.isNull(vehicle)){
|
||||
BeanUtil.copyProperties(vehicle,vehicleViewVo);
|
||||
vehicleViewVo.setId(vehicleViewVo.getId());
|
||||
}
|
||||
return vehicleViewVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getNewId() {
|
||||
LambdaQueryWrapper<Vehicle> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.orderByDesc(Vehicle::getId);
|
||||
List<Vehicle> list = baseMapper.selectList(wrapper);
|
||||
Integer newId = list.get(0).getId() + 1;
|
||||
return newId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove(String Guid) {
|
||||
LambdaQueryWrapper<Vehicle> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(Vehicle::getGuid, Guid);
|
||||
|
||||
return this.remove(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean add(VehicleAddInputVo vo) {
|
||||
LambdaQueryWrapper<TblEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(TblEntity::getParentId,vo.getParentDirId());
|
||||
List<TblEntity> aircraft = entityService.list(wrapper);
|
||||
if (aircraft.size()!=0){
|
||||
throw new BusinessException(500,"所属分类不是最终分类,请选择最终分类");
|
||||
}
|
||||
|
||||
Vehicle vehicle = new Vehicle();
|
||||
BeanUtils.copyProperties(vo, vehicle);
|
||||
vehicle.setParentId(vo.getParentDirId());
|
||||
vehicle.setGuid("dataaircraft-" + String.format("%12d", vo.getId()).replace(" ", "0"));
|
||||
LambdaUpdateWrapper<Vehicle> tWrapper = new LambdaUpdateWrapper<Vehicle>()
|
||||
.eq(Vehicle::getGuid, vehicle.getGuid());
|
||||
System.out.println(vehicle.toString());
|
||||
return this.save(vehicle);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user