Commit 8bb63e3a authored by suhuiguang's avatar suhuiguang

Merge branch 'dev_upgrade' of http://172.16.10.76/station/YeeAmosFireAutoSysRoot into dev_upgrade

parents ac2285e8 340b3168
...@@ -50,9 +50,11 @@ public class FireEquimtPointController extends BaseController { ...@@ -50,9 +50,11 @@ public class FireEquimtPointController extends BaseController {
if (fireEquipmentPoint == null if (fireEquipmentPoint == null
|| StringUtils.isEmpty(fireEquipmentPoint.getName()) || StringUtils.isEmpty(fireEquipmentPoint.getName())
|| StringUtils.isEmpty(fireEquipmentPoint.getType()) || StringUtils.isEmpty(fireEquipmentPoint.getType())
|| StringUtils.isEmpty(fireEquipmentPoint.getCode())){ || StringUtils.isEmpty(fireEquipmentPoint.getCode())
|| ("ANALOGUE".equals(fireEquipmentPoint.getType()) && StringUtils.isEmpty(fireEquipmentPoint.getUnit()))){
return CommonResponseUtil.failure("请检查必填字段"); return CommonResponseUtil.failure("请检查必填字段");
}; };
ReginParams reginParams =getSelectedOrgInfo(); ReginParams reginParams =getSelectedOrgInfo();
String compCode=getOrgCode(reginParams); String compCode=getOrgCode(reginParams);
fireEquipmentPoint.setOrgCode(compCode); fireEquipmentPoint.setOrgCode(compCode);
......
...@@ -7,13 +7,13 @@ import java.net.URLConnection; ...@@ -7,13 +7,13 @@ import java.net.URLConnection;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.itextpdf.text.pdf.PdfStructTreeController.returnType;
import com.yeejoin.amos.fas.core.util.CommonResponse; import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil; import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
...@@ -25,6 +25,10 @@ import io.swagger.annotations.ApiOperation; ...@@ -25,6 +25,10 @@ import io.swagger.annotations.ApiOperation;
@Api(tags="天气api") @Api(tags="天气api")
public class WeatherController extends BaseController { public class WeatherController extends BaseController {
@Value("${param.weather.url}")
private String weatherUrl;
@ApiOperation(httpMethod = "GET",value = "天气查询", notes = "天气查询") @ApiOperation(httpMethod = "GET",value = "天气查询", notes = "天气查询")
@GetMapping("/{address}") @GetMapping("/{address}")
public CommonResponse getWeather(@PathVariable("address") String address) { public CommonResponse getWeather(@PathVariable("address") String address) {
...@@ -32,7 +36,7 @@ public class WeatherController extends BaseController { ...@@ -32,7 +36,7 @@ public class WeatherController extends BaseController {
String result = ""; String result = "";
BufferedReader in = null; BufferedReader in = null;
try { try {
String urlNameString = "http://t.weather.sojson.com/api/weather/city/" + address; String urlNameString = weatherUrl + address;
URL realUrl = new URL(urlNameString); URL realUrl = new URL(urlNameString);
// 打开和URL之间的连接 // 打开和URL之间的连接
......
package com.yeejoin.amos.fas.business.dao.repository; package com.yeejoin.amos.fas.business.dao.repository;
import com.yeejoin.amos.fas.dao.entity.EquipmentFireEquipment; import com.yeejoin.amos.fas.dao.entity.EquipmentFireEquipment;
import org.springframework.data.jpa.repository.Modifying;
import java.util.List;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
@Repository("iEquipmentFireEquipmentDao") @Repository("iEquipmentFireEquipmentDao")
public interface IEquipmentFireEquipmentDao extends BaseDao<EquipmentFireEquipment, Long> { public interface IEquipmentFireEquipmentDao extends BaseDao<EquipmentFireEquipment, Long> {
...@@ -16,8 +21,15 @@ public interface IEquipmentFireEquipmentDao extends BaseDao<EquipmentFireEquipme ...@@ -16,8 +21,15 @@ public interface IEquipmentFireEquipmentDao extends BaseDao<EquipmentFireEquipme
*/ */
@Query(value = "select count(1) from f_equipment_fire_equipment WHERE equipment_id = ?1 and fire_equipment_id = ?2", nativeQuery = true) @Query(value = "select count(1) from f_equipment_fire_equipment WHERE equipment_id = ?1 and fire_equipment_id = ?2", nativeQuery = true)
int findByEqmtIdAndFireEqmtId(Long equipmentId, Long fireEquipmentId); int findByEqmtIdAndFireEqmtId(Long equipmentId, Long fireEquipmentId);
List<EquipmentFireEquipment> findAllByEquipmentId(Long equipmentId);
@Query(value = "SELECT count(1) FROM `f_equipment_fire_equipment` WHERE fire_equipment_id in ?1", nativeQuery = true) @Query(value = "SELECT count(1) FROM `f_equipment_fire_equipment` WHERE fire_equipment_id in ?1", nativeQuery = true)
int countImpEquipByIds(String[] ids); int countImpEquipByIds(String[] ids);
@Transactional
@Modifying
@Query(value = "delete FROM `f_equipment_fire_equipment` WHERE equipment_id = ?1", nativeQuery = true)
void deleteByEquipmentId(Long id);
} }
...@@ -124,6 +124,7 @@ public class EquipmentServiceImpl implements IEquipmentService { ...@@ -124,6 +124,7 @@ public class EquipmentServiceImpl implements IEquipmentService {
} }
@Override @Override
@Transactional
public String[] delete(String[] idArray) throws Exception { public String[] delete(String[] idArray) throws Exception {
for (String id : idArray) { for (String id : idArray) {
Optional<Equipment> equipment1 = iEquipmentDao.findById(Long.parseLong(id)); Optional<Equipment> equipment1 = iEquipmentDao.findById(Long.parseLong(id));
...@@ -132,10 +133,18 @@ public class EquipmentServiceImpl implements IEquipmentService { ...@@ -132,10 +133,18 @@ public class EquipmentServiceImpl implements IEquipmentService {
equipment=equipment1.get(); equipment=equipment1.get();
} }
if (equipment != null) { if (equipment != null) {
List<EquipmentFireEquipment> eqFireEqs = equipmentFireEquipmentDao.findAllByEquipmentId(equipment.getId());
if(!eqFireEqs.isEmpty()){
equipmentFireEquipmentDao.deleteAll(eqFireEqs);
}
this.iEquipmentDao.deleteById(Long.parseLong(id)); this.iEquipmentDao.deleteById(Long.parseLong(id));
} else { } else {
throw new Exception("找不到指定的对象:" + id); throw new Exception("找不到指定的对象:" + id);
} }
//删除重点设备关联关系
equipmentFireEquipmentDao.deleteByEquipmentId(Long.valueOf(id));
} }
return idArray; return idArray;
......
spring.application.name = Amos-autosys-sqy spring.application.name = Amos-autosys
server.port = 8083 server.port = 8083
...@@ -52,3 +52,4 @@ windows.img.path = F:\\ ...@@ -52,3 +52,4 @@ windows.img.path = F:\\
linux.img.path = / linux.img.path = /
param.safetyIndexChange.cron = 0 0 2 * * ? param.safetyIndexChange.cron = 0 0 2 * * ?
param.weather.url = http://t.weather.sojson.com/api/weather/city/
...@@ -568,7 +568,17 @@ ...@@ -568,7 +568,17 @@
</select> </select>
<select id="getImpEqu3dPoints" resultType="com.yeejoin.amos.fas.business.vo.View3dNodeVo"> <select id="getImpEqu3dPoints" resultType="com.yeejoin.amos.fas.business.vo.View3dNodeVo">
SELECT id,name,code,ue4_location,ue4_rotation,'monitorEquipment' as type,'monitorEquipment' as level, SELECT id,name,code,ue4_location,ue4_rotation,
case
when equip_classify= 0 then 'monitorEquipment'
when equip_classify= 2 then 'video'
when equip_classify= 3 then 'fireEquipment'
end as type,
case
when equip_classify= 0 then 'monitorEquipment'
when equip_classify= 2 then 'video'
when equip_classify= 3 then 'fireEquipment'
end as level,
null as relationKeys, null as relationKeys,
CASE CASE
WHEN ( WHEN (
...@@ -595,6 +605,7 @@ ...@@ -595,6 +605,7 @@
WHERE fe.id IN ( WHERE fe.id IN (
select fire_equipment_id from f_equipment_fire_equipment select fire_equipment_id from f_equipment_fire_equipment
) AND (org_code = #{orgCode} OR org_code LIKE CONCAT(#{orgCode},'-%')) ) AND (org_code = #{orgCode} OR org_code LIKE CONCAT(#{orgCode},'-%'))
AND fe.equip_classify <![CDATA[ <> ]]> 1
UNION ALL UNION ALL
SELECT e.id,e.name,e.code,e.ue4_location,e.ue4_rotation,'impEquipment' as type,'impEquipment' as level, SELECT e.id,e.name,e.code,e.ue4_location,e.ue4_rotation,'impEquipment' as type,'impEquipment' as level,
TMP.relationKeys, TMP.relationKeys,
...@@ -662,7 +673,15 @@ ...@@ -662,7 +673,15 @@
FROM f_water_resource FROM f_water_resource
WHERE org_code = #{orgCode} OR org_code like CONCAT(#{orgCode},'-%') WHERE org_code = #{orgCode} OR org_code like CONCAT(#{orgCode},'-%')
UNION ALL UNION ALL
SELECT id,name,code,ue4_location,ue4_rotation,'fireChamber' as type,'fireChamber' as level, SELECT id,name,code,ue4_location,ue4_rotation,
case
when type = 1 then 'fireChamber'
when type = 2 then 'fireFoamRoom'
end as type,
case
when type = 1 then 'fireChamber'
when type = 2 then 'fireFoamRoom'
end as level,
null as relationKeys, null as relationKeys,
CASE CASE
WHEN ( WHEN (
...@@ -686,7 +705,7 @@ ...@@ -686,7 +705,7 @@
END position, END position,
concat('fireChamber-',id) as `key` concat('fireChamber-',id) as `key`
FROM f_fire_station FROM f_fire_station
WHERE type = 1 AND org_code = #{orgCode} OR org_code LIKE CONCAT(#{orgCode},'-%') WHERE org_code = #{orgCode} OR org_code LIKE CONCAT(#{orgCode},'-%')
UNION ALL UNION ALL
SELECT id,name,car_num as code,ue4_location,ue4_rotation,'fireCar' as type,'fireCar' as level, SELECT id,name,car_num as code,ue4_location,ue4_rotation,'fireCar' as type,'fireCar' as level,
null as relationKeys, null as relationKeys,
......
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