Commit f8358767 authored by KeYong's avatar KeYong

修改现场bug

parent 9a39ef03
......@@ -6,6 +6,7 @@ import com.yeejoin.amos.fas.business.service.intfc.IFireCarService;
import com.yeejoin.amos.fas.business.service.intfc.IFireEquipService;
import com.yeejoin.amos.fas.business.service.intfc.IWaterResourceService;
import com.yeejoin.amos.fas.business.util.CommonPageParamUtil;
import com.yeejoin.amos.fas.business.util.StringUtil;
import com.yeejoin.amos.fas.business.vo.FireCarDetailVo;
import com.yeejoin.amos.fas.business.vo.ReginParams;
import com.yeejoin.amos.fas.config.Permission;
......@@ -49,7 +50,7 @@ public class FireSourceController extends BaseController {
@RequestMapping(value = "", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse create(@RequestBody FireEquipment fireEquipment) throws Exception {
if(fireEquipment.getId() == 0l) {//新增
if(fireEquipment.getId() == 0l && StringUtil.isNotEmpty(fireEquipment.getCode())) {//新增
Boolean existByCode = iFireEquipService.isExistByCode(fireEquipment.getCode());
if(existByCode){
return CommonResponseUtil.failure("设备编号重复,请重试!");
......@@ -214,7 +215,7 @@ public class FireSourceController extends BaseController {
@ApiParam(value = "设备编号", required = true) @RequestParam String type) throws Exception {
try{
return CommonResponseUtil.success(iFireEquipService.queryForDetail(type, Long.valueOf(id)));
return CommonResponseUtil.success(iFireEquipService.queryForDetail(type, Long.valueOf(StringUtil.isNotEmpty(id) ? id : "0")));
}catch (Exception e) {
log.error(e.getMessage(),e);
return CommonResponseUtil.failure("消防装备明细查询失败" + e.getMessage());
......
......@@ -395,7 +395,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
* @param appKey
* @param product
* @param token
* @param failed
* @param
* @param rId
* @return String
* @throws <br>
......@@ -1164,7 +1164,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
/**
* 设备消息规则推送
*
* @param protalData
* @param
*/
@Async
void fireEquipRuleMessagePush(AlarmParam deviceData, Toke toke) {
......@@ -1468,7 +1468,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
String maxlevel = map.get("max_level") != null ? map.get("max_level").toString() : "0.0";
String level = map.get("value") != null && StringUtil.isNumeric(map.get("value").toString()) ? String.format("%.2f", (Double.valueOf(map.get("value").toString()))) : maxlevel;
String volume = String.format("%.2f", Double.valueOf(level) * area);
String designCapacity = map.get("designCapacity") != null && StringUtil.isNumeric(map.get("designCapacity").toString()) ? String.format("%.2f", (Double.valueOf(map.get("designCapacity").toString()))) : "4800.00";
String volume = String.format("%.2f", Double.valueOf(designCapacity));
if (hashOperations.size("Analogue") > 0) {
if (ObjectUtils.isEmpty(map.get("code")) || !hashOperations.hasKey("Analogue", map.get("code"))) {
map.put("level", level);
......@@ -1477,9 +1478,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
EquipCommunicationData data = (EquipCommunicationData) hashOperations.get("Analogue", map.get("code"));
map.put("level", ObjectUtils.isEmpty(data.getState()) ?level:data.getState());
map.put("level", ObjectUtils.isEmpty(data.getState()) ? level : data.getState());
map.put("value", map.get("level").toString());
map.put("volume", String.format("%.2f", (Double.valueOf(map.get("level").toString()) * area)));
map.put("volume", String.format("%.2f", Double.valueOf(map.get("designCapacity").toString())));
} else {
map.put("level", level);
map.put("volume", volume);
......
......@@ -675,12 +675,13 @@
building.area_measure AS area,
building.`code`,
building.`name`,
building.height AS 'value'
building.height AS 'value',
building.design_capacity AS designCapacity
FROM
wl_building building
LEFT JOIN wl_equipment_category category ON building.equipment_code = category.id
WHERE
category.CODE = 93020000
-- LEFT JOIN wl_equipment_category category ON building.equipment_code = category.id
-- WHERE
-- category.CODE = 93020000
) wr
GROUP BY
wr.alarm_level,
......
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