Commit fd137860 authored by suhuiguang's avatar suhuiguang

1.修改命名规则

parent 3e833c1e
......@@ -112,14 +112,12 @@ public class Equipment extends BasicEntity {
* ue4位置
*/
@Lob
@Column(name = "ue4_location")
private String ue4Location;
/**
* ue4旋转
*/
@Lob
@Column(name = "ue4_rotation")
private String ue4Rotation;
public Equipment() {
......@@ -228,6 +226,7 @@ public class Equipment extends BasicEntity {
this.reservePlan = reservePlan;
}
@Column(name = "ue4_location")
public String getUe4Location() {
return ue4Location;
}
......@@ -236,6 +235,7 @@ public class Equipment extends BasicEntity {
this.ue4Location = ue4Location;
}
@Column(name = "ue4_rotation")
public String getUe4Rotation() {
return ue4Rotation;
}
......
......@@ -80,14 +80,12 @@ public class FireCar extends BasicEntity {
* ue4位置
*/
@Lob
@Column(name = "ue4_location")
private String ue4Location;
/**
* ue4旋转
*/
@Lob
@Column(name = "ue4_rotation")
private String ue4Rotation;
public FireCar() {
......@@ -230,6 +228,8 @@ public class FireCar extends BasicEntity {
public void setRiskSourceId(Long riskSourceId) {
this.riskSourceId = riskSourceId;
}
@Column(name = "ue4_location")
public String getUe4Location() {
return ue4Location;
}
......@@ -238,6 +238,7 @@ public class FireCar extends BasicEntity {
this.ue4Location = ue4Location;
}
@Column(name = "ue4_rotation")
public String getUe4Rotation() {
return ue4Rotation;
}
......
......@@ -125,14 +125,12 @@ public class FireEquipment extends BasicEntity {
* ue4位置
*/
@Lob
@Column(name = "ue4_location")
private String ue4Location;
/**
* ue4旋转
*/
@Lob
@Column(name = "ue4_rotation")
private String ue4Rotation;
public Long getRiskSourceId() {
......@@ -357,7 +355,7 @@ public class FireEquipment extends BasicEntity {
this.weight = weight;
}
@Column(name = "ue4_location")
public String getUe4Location() {
return ue4Location;
}
......@@ -366,6 +364,7 @@ public class FireEquipment extends BasicEntity {
this.ue4Location = ue4Location;
}
@Column(name = "ue4_rotation")
public String getUe4Rotation() {
return ue4Rotation;
}
......
......@@ -84,14 +84,12 @@ public class FireStation extends BasicEntity{
* ue4位置
*/
@Lob
@Column(name = "ue4_location")
private String ue4Location;
/**
* ue4旋转
*/
@Lob
@Column(name = "ue4_rotation")
private String ue4Rotation;
@Transient
......@@ -191,6 +189,7 @@ public class FireStation extends BasicEntity{
this.riskSourceId = riskSourceId;
}
@Column(name = "ue4_location")
public String getUe4Location() {
return ue4Location;
}
......@@ -199,6 +198,7 @@ public class FireStation extends BasicEntity{
this.ue4Location = ue4Location;
}
@Column(name = "ue4_rotation")
public String getUe4Rotation() {
return ue4Rotation;
}
......
......@@ -58,21 +58,18 @@ public class RiskSource extends BasicEntity {
* ue4位置
*/
@Lob
@Column(name = "ue4_location")
private String ue4Location;
/**
* ue4旋转
*/
@Lob
@Column(name = "ue4_rotation")
private String ue4Rotation;
/**
* ue4缩放
*/
@Lob
@Column(name = "ue4_extent")
private String ue4Extent;
private List<Fmea> fmeaList;
......@@ -222,6 +219,8 @@ public class RiskSource extends BasicEntity {
public void setIsIndoor(Boolean isIndoor) {
this.isIndoor = isIndoor;
}
@Column(name = "ue4_location")
public String getUe4Location() {
return ue4Location;
}
......@@ -230,6 +229,7 @@ public class RiskSource extends BasicEntity {
this.ue4Location = ue4Location;
}
@Column(name = "ue4_rotation")
public String getUe4Rotation() {
return ue4Rotation;
}
......@@ -238,6 +238,7 @@ public class RiskSource extends BasicEntity {
this.ue4Rotation = ue4Rotation;
}
@Column(name = "ue4_extent")
public String getUe4Extent() {
return ue4Extent;
}
......
......@@ -87,14 +87,12 @@ public class WaterResource extends BasicEntity{
* ue4位置
*/
@Lob
@Column(name = "ue4_location")
private String ue4Location;
/**
* ue4旋转
*/
@Lob
@Column(name = "ue4_rotation")
private String ue4Rotation;
public String getName() {
......@@ -193,6 +191,8 @@ public class WaterResource extends BasicEntity{
public void setCreateBy(int createBy) {
this.createBy = createBy;
}
@Column(name = "ue4_location")
public String getUe4Location() {
return ue4Location;
}
......@@ -201,6 +201,7 @@ public class WaterResource extends BasicEntity{
this.ue4Location = ue4Location;
}
@Column(name = "ue4_rotation")
public String getUe4Rotation() {
return ue4Rotation;
}
......
......@@ -21,15 +21,15 @@ import java.util.List;
@RestController
@RequestMapping("/api/view3d")
@Api(tags="view3d数据")
public class View3dController {
@Api(tags="全景监控")
public class View3dController extends BaseController {
@Autowired
private IRiskSourceService riskSourceService;
@Autowired
private IView3dService view3dService;
@ApiOperation(httpMethod = "GET", value = "点3d坐标设置", notes = "按照点类型3d坐标设置" )
@ApiOperation(httpMethod = "POST", value = "点3d坐标设置", notes = "按照点类型3d坐标设置" )
@PostMapping(value = "/point/bind",produces = "application/json;charset=UTF-8")
public CommonResponse setPoint3dPosition(@ApiParam(name = "参数",required = true) @RequestBody List<BindPointBo> pointBoList){
return view3dService.setPoint3dPosition(pointBoList);
......
package com.yeejoin.amos.fas.business.dao.mapper;
import com.yeejoin.amos.fas.business.bo.BindPointBo;
public interface PatrolMapper extends BaseMapper {
void updatePoint3dPosition(BindPointBo bo);
}
package com.yeejoin.amos.fas.business.service.impl;
import com.yeejoin.amos.fas.business.bo.BindPointBo;
import com.yeejoin.amos.fas.business.dao.mapper.PatrolMapper;
import com.yeejoin.amos.fas.business.dao.repository.*;
import com.yeejoin.amos.fas.business.service.intfc.IView3dService;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import com.yeejoin.amos.fas.dao.entity.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
......@@ -15,6 +21,25 @@ import java.util.List;
*/
@Service("view3dService")
public class View3dServiceImpl implements IView3dService {
Logger log = LoggerFactory.getLogger(View3dServiceImpl.class);
@Autowired
private IRiskSourceDao iRiskSourceDao;
@Autowired
private IFireCarDao iFireCarDao;
@Autowired
private IFireEquipmentDao iFireEquipmentDao;
@Autowired
private IFireStationDao iFireStationDao;
@Autowired
private IEquipmentDao iEquipmentDao;
@Autowired
private IWaterResourceDao iWaterResourceDao;
@Autowired
private PatrolMapper patrolMapper;
@Override
@Transactional(rollbackFor = Exception.class)
public CommonResponse setPoint3dPosition(List<BindPointBo> pointBoList) {
......@@ -24,10 +49,96 @@ public class View3dServiceImpl implements IView3dService {
pointBoList.forEach(pointBo ->{
this.savePointPositionByType(pointBo.getPointType(),pointBo);
});
return null;
return CommonResponseUtil.success();
}
public void savePointPositionByType(String pointType,BindPointBo pointBo){
switch (pointType){
case "riskSource":
this.updateRiskSourcePosition(pointBo);
break;
case "patrol":
this.updatePatrolPosition(pointBo);
break;
case "impEquipment":
this.updateEquipmentPosition(pointBo);
break;
case "monitorEquipment":
case "video":
case "fireEquipment":
this.updateFireEquipmentPosition(pointBo);
break;
case "fireCar":
this.updateFireCarPosition(pointBo);
case "fireChamber":
case "fireFoamRoom":
this.updateFireStationPosition(pointBo);
break;
case "hydrant":
case "pool":
this.updateWaterSourcePosition(pointBo);
break;
default:
log.error("不支持的类型-->" + pointType);
break;
}
}
public void updateFireCarPosition(BindPointBo pointBo) {
FireCar fireCar = iFireCarDao.getOne(pointBo.getPointId());
if(fireCar != null){
fireCar.setUe4Location(pointBo.getUe4Location());
fireCar.setUe4Rotation(pointBo.getUe4Rotation());
iFireCarDao.save(fireCar);
}
}
public void updateWaterSourcePosition(BindPointBo pointBo) {
WaterResource waterResource = iWaterResourceDao.getOne(pointBo.getPointId());
if(waterResource != null){
waterResource.setUe4Location(pointBo.getUe4Location());
waterResource.setUe4Rotation(pointBo.getUe4Rotation());
iWaterResourceDao.save(waterResource);
}
}
public void updateFireStationPosition(BindPointBo pointBo) {
FireStation fireStation = iFireStationDao.getOne(pointBo.getPointId());
if(fireStation != null){
fireStation.setUe4Location(pointBo.getUe4Location());
fireStation.setUe4Rotation(pointBo.getUe4Rotation());
iFireStationDao.save(fireStation);
}
}
public void updateFireEquipmentPosition(BindPointBo pointBo) {
FireEquipment fireEquipment = iFireEquipmentDao.getOne(pointBo.getPointId());
if(fireEquipment != null){
fireEquipment.setUe4Location(pointBo.getUe4Location());
fireEquipment.setUe4Rotation(pointBo.getUe4Rotation());
iFireEquipmentDao.save(fireEquipment);
}
}
public void updateEquipmentPosition(BindPointBo pointBo) {
Equipment equipment = iEquipmentDao.getOne(pointBo.getPointId());
if(equipment != null){
equipment.setUe4Location(pointBo.getUe4Location());
equipment.setUe4Rotation(pointBo.getUe4Rotation());
iEquipmentDao.save(equipment);
}
}
public void updatePatrolPosition(BindPointBo pointBo) {
patrolMapper.updatePoint3dPosition(pointBo);
}
public void updateRiskSourcePosition(BindPointBo pointBo) {
RiskSource riskSource = iRiskSourceDao.getOne(pointBo.getPointId());
if(riskSource != null){
riskSource.setUe4Location(pointBo.getUe4Location());
riskSource.setUe4Rotation(pointBo.getUe4Rotation());
iRiskSourceDao.save(riskSource);
}
}
}
<?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.yeejoin.amos.fas.business.dao.mapper.PatrolMapper">
<update id="updatePoint3dPosition">
update p_point
set
ue4_location = #{ue4Location},
ue4_rotation = #{ue4Rotation}
where id = #{pointId}
</update>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment