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