Commit f98c6d80 authored by 单奇雲's avatar 单奇雲

新增接口

parent bb374985
......@@ -7,17 +7,17 @@ import java.util.Map;
public enum ResourceTypeDefEnum {
riskSource("风险点","riskSource"),
patrol("巡检点","patrol"),
impEquipment("重点设备","impEquipment"),
monitorEquipment("探测器","monitorEquipment"),
hydrant("消火栓","hydrant"),
pool("消防水池","pool"),
fireCar("消防车","fireCar"),
fireEquipment("灭火器材","fireEquipment"),
fireChamber("消防小室","fireChamber"),
fireFoamRoom("消防泡沫间","fireFoamRoom"),
video("视频设备","video");
riskSource("风险点","riskSource","风险点","riskSource"),
patrol("巡检点","patrol","巡检点","patrol"),
impEquipment("重点设备","impEquipment","重点设备","impEquipment"),
monitorEquipment("探测器","monitorEquipment","探测器","monitorEquipment"),
hydrant("消火栓","hydrant","消防设备","fireEquipment"),
pool("消防水池","pool","消防设备","fireEquipment"),
fireCar("消防车","fireCar","消防设备","fireEquipment"),
fireEquipment("灭火器材","fireEquipment","消防设备","fireEquipment"),
fireChamber("消防小室","fireChamber","消防设备","fireEquipment"),
fireFoamRoom("消防泡沫间","fireFoamRoom","消防设备","fireEquipment"),
video("视频设备","video","摄像头","video");
/**
* 名称,描述
......@@ -28,9 +28,15 @@ public enum ResourceTypeDefEnum {
*/
private String code;
private ResourceTypeDefEnum(String name,String code){
private String typeName;
private String typeCode;
private ResourceTypeDefEnum(String name,String code,String typeName,String typeCode){
this.name = name;
this.code = code;
this.typeName = typeName;
this.typeCode = typeCode;
}
public static ResourceTypeDefEnum getEnum(String code) {
......@@ -55,6 +61,19 @@ public enum ResourceTypeDefEnum {
return list;
}
public static List<Map<String,String>> getTypeList() {
List<Map<String,String>> list = new ArrayList<>();
for(ResourceTypeDefEnum e : ResourceTypeDefEnum.values()) {
Map<String,String> reso = new HashMap<>();
reso.put("name",e.getTypeName());
reso.put("code",e.getTypeCode());
if(!list.contains(reso)){
list.add(reso);
}
}
return list;
}
public String getName() {
return name;
}
......@@ -70,5 +89,22 @@ public enum ResourceTypeDefEnum {
public void setCode(String code) {
this.code = code;
}
public String getTypeName() {
return typeName;
}
public void setTypeName(String typeName) {
this.typeName = typeName;
}
public String getTypeCode() {
return typeCode;
}
public void setTypeCode(String typeCode) {
this.typeCode = typeCode;
}
}
package com.yeejoin.amos.fas.business.bo;
import javax.validation.constraints.NotNull;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ApiModel(description = "绑定区域参数实体")
public class BindRegionBo extends BasePointPositionBo{
/**
* 区域id
*/
@NotNull
@ApiModelProperty("区域id")
private Long riskSourceId;
public Long getRiskSourceId() {
return riskSourceId;
}
public void setRiskSourceId(Long riskSourceId) {
this.riskSourceId = riskSourceId;
}
}
package com.yeejoin.amos.fas.business.controller;
import com.yeejoin.amos.fas.business.bo.BindPointBo;
import com.yeejoin.amos.fas.business.bo.BindRegionBo;
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;
......@@ -52,11 +53,30 @@ public class View3dController extends BaseController{
return CommonResponseUtil.success(riskSourceService.findRegionById(id,orgCode));
}
@ApiOperation(value = "区域详情查询", notes = "区域详情查询")
@ApiOperation(value = "区域绑定", notes = "区域绑定")
@PostMapping(value="region/bind")
public CommonResponse getRegionBind() {
public CommonResponse batchSaveRegionUe4(@ApiParam(name = "区域参数列表",required = true) @RequestBody List<BindRegionBo> regionBoList) {
try {
riskSourceService.batchSaveRegionUe4(regionBoList);
} catch (Exception e) {
return CommonResponseUtil.failure(e.getMessage());
}
return CommonResponseUtil.success();
}
@ApiOperation(value = "点类型查询", notes = "点类型查询")
@GetMapping(value = "point/type")
public CommonResponse getPointType() {
return CommonResponseUtil.success(view3dService.getPointType());
}
@ApiOperation(value = "按照分类查询点树", notes = "按照分类查询点树")
@GetMapping(value = "point/type/{type}")
public CommonResponse getPointTreeByType(@PathVariable("type") String type) {
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
return CommonResponseUtil.success(view3dService.getPointTreeByType(type,orgCode));
}
}
package com.yeejoin.amos.fas.business.dao.mapper;
import com.yeejoin.amos.fas.business.param.CommonPageInfoParam;
import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse;
import com.yeejoin.amos.fas.core.common.response.RiskSourceTreeResponse;
import com.yeejoin.amos.fas.dao.entity.RiskSource;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.yeejoin.amos.fas.business.bo.BindRegionBo;
import com.yeejoin.amos.fas.business.param.CommonPageInfoParam;
import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse;
import com.yeejoin.amos.fas.core.common.response.RiskSourceTreeResponse;
import com.yeejoin.amos.fas.dao.entity.RiskSource;
public interface RiskSourceMapper extends BaseMapper {
/**
......@@ -100,4 +102,6 @@ public interface RiskSourceMapper extends BaseMapper {
List<RegionTreeResponse> getRegionList(String orgCode);
HashMap<String, Object> findRegionById(@Param("id")Long id,@Param("orgCode")String orgCode);
void batchSaveRegionUe4(List<BindRegionBo> regionBoList);
}
package com.yeejoin.amos.fas.business.dao.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse;
public interface View3dMapper extends BaseMapper{
List<RegionTreeResponse> getPointTreeByType(@Param("type")String type,@Param("orgCode")String orgCode);
}
package com.yeejoin.amos.fas.business.service.impl;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.component.cache.Redis;
import org.typroject.tyboot.component.cache.enumeration.CacheType;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.yeejoin.amos.fas.business.bo.BindRegionBo;
import com.yeejoin.amos.fas.business.constants.FasConstant;
import com.yeejoin.amos.fas.business.dao.mapper.FireEquipMapper;
import com.yeejoin.amos.fas.business.dao.mapper.FireEquipPointMapper;
......@@ -72,42 +110,6 @@ import com.yeejoin.amos.fas.dao.entity.RpnChangeLog;
import com.yeejoin.amos.fas.exception.YeeException;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.component.cache.Redis;
import org.typroject.tyboot.component.cache.enumeration.CacheType;
import javax.annotation.PostConstruct;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@Service("riskSourceService")
public class RiskSourceServiceImpl implements IRiskSourceService {
......@@ -1779,7 +1781,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
return regionDetail;
}
@Override
public void batchSaveRegionUe4(List<BindRegionBo> regionBoList) {
riskSourceMapper.batchSaveRegionUe4(regionBoList);
}
}
package com.yeejoin.amos.fas.business.service.impl;
import com.yeejoin.amos.fas.business.bo.BindPointBo;
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 java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.List;
import com.yeejoin.amos.fas.business.bo.BindPointBo;
import com.yeejoin.amos.fas.business.dao.mapper.View3dMapper;
import com.yeejoin.amos.fas.business.service.intfc.IView3dService;
import com.yeejoin.amos.fas.common.enums.ResourceTypeDefEnum;
import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
/**
* @author DELL
*/
@Service("view3dService")
public class View3dServiceImpl implements IView3dService {
@Autowired
private View3dMapper view3dMapper;
@Override
@Transactional(rollbackFor = Exception.class)
public CommonResponse setPoint3dPosition(List<BindPointBo> pointBoList) {
......@@ -30,4 +40,14 @@ public class View3dServiceImpl implements IView3dService {
public void savePointPositionByType(String pointType,BindPointBo pointBo){
}
@Override
public List<Map<String, String>> getPointType() {
return ResourceTypeDefEnum.getTypeList();
}
@Override
public List<RegionTreeResponse> getPointTreeByType(String type,String orgCode) {
return view3dMapper.getPointTreeByType(type,orgCode);
}
}
package com.yeejoin.amos.fas.business.service.intfc;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.data.domain.Page;
import com.yeejoin.amos.fas.business.bo.BindRegionBo;
import com.yeejoin.amos.fas.business.param.AlarmParam;
import com.yeejoin.amos.fas.business.param.CommonPageInfoParam;
import com.yeejoin.amos.fas.business.param.FmeaBindParam;
......@@ -12,11 +19,6 @@ import com.yeejoin.amos.fas.core.common.response.RiskSourceTreeResponse;
import com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint;
import com.yeejoin.amos.fas.dao.entity.FmeaPointInputitem;
import com.yeejoin.amos.fas.dao.entity.RiskSource;
import org.springframework.data.domain.Page;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public interface IRiskSourceService {
......@@ -118,4 +120,6 @@ public interface IRiskSourceService {
HashMap<String, Object> findRegionById(Long id,String orgCode);
void batchSaveRegionUe4(List<BindRegionBo> regionBoList);
}
package com.yeejoin.amos.fas.business.service.intfc;
import com.yeejoin.amos.fas.business.bo.BindPointBo;
import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import java.util.List;
import java.util.Map;
/**
* @author DELL
......@@ -11,4 +13,8 @@ import java.util.List;
public interface IView3dService {
CommonResponse setPoint3dPosition(List<BindPointBo> pointBoList);
List<Map<String, String>> getPointType();
List<RegionTreeResponse> getPointTreeByType(String type,String orgCode);
}
......@@ -692,4 +692,22 @@
where id=#{id} AND org_code like CONCAT(#{orgCode},'%')
</select>
<update id="batchSaveRegionUe4" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
update f_risk_source
<set >
<if test="item.ue4Location != null" >
ue4_location = #{item.ue4Location,jdbcType=VARCHAR},
</if>
<if test="item.ue4Rotation != null" >
ue4_rotation = #{item.ue4Rotation,jdbcType=VARCHAR},
</if>
<if test="item.ue4Extent != null" >
ue4_extent = #{item.ue4Extent,jdbcType=VARCHAR},
</if>
</set>
where id = #{item.riskSourceId,jdbcType=BIGINT}
</foreach>
</update>
</mapper>
\ No newline at end of file
<?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.View3dMapper">
<select id="getPointTreeByType" resultType="com.yeejoin.amos.fas.core.common.response.RegionTreeResponse">
select
R.id,R.name,R.code,R.parent_id,R.ue4_location,R.ue4_rotation,R.ue4_extent,
IF(ISNULL(IF(trim(R.ue4_rotation)='',NULL,R.ue4_rotation)) OR ISNULL(IF(trim(R.ue4_location)='',NULL,R.ue4_location)),0,1) as is_bind
from f_risk_source R
where 1=1
<if test="type == 'riskSource'">
</if>
<if test="type == 'patrol'">
</if>
<if test="type == 'impEquipment'">
</if>
<if test="type == 'monitorEquipment'">
</if>
<if test="type == 'fireEquipment'">
</if>
<if test="type == 'video'">
</if>
<if test="orgCode != null">
AND org_code like CONCAT(#{orgCode},'%')
</if>
</select>
</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