Commit f8358767 authored by KeYong's avatar KeYong

修改现场bug

parent 9a39ef03
...@@ -6,6 +6,7 @@ import com.yeejoin.amos.fas.business.service.intfc.IFireCarService; ...@@ -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.IFireEquipService;
import com.yeejoin.amos.fas.business.service.intfc.IWaterResourceService; import com.yeejoin.amos.fas.business.service.intfc.IWaterResourceService;
import com.yeejoin.amos.fas.business.util.CommonPageParamUtil; 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.FireCarDetailVo;
import com.yeejoin.amos.fas.business.vo.ReginParams; import com.yeejoin.amos.fas.business.vo.ReginParams;
import com.yeejoin.amos.fas.config.Permission; import com.yeejoin.amos.fas.config.Permission;
...@@ -48,8 +49,8 @@ public class FireSourceController extends BaseController { ...@@ -48,8 +49,8 @@ public class FireSourceController extends BaseController {
@ApiOperation(httpMethod = "POST", value = "添加消防装备", notes = "添加消防装备") @ApiOperation(httpMethod = "POST", value = "添加消防装备", notes = "添加消防装备")
@RequestMapping(value = "", produces = "application/json;charset=UTF-8", method = RequestMethod.POST) @RequestMapping(value = "", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse create(@RequestBody FireEquipment fireEquipment) throws Exception { 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()); Boolean existByCode = iFireEquipService.isExistByCode(fireEquipment.getCode());
if(existByCode){ if(existByCode){
return CommonResponseUtil.failure("设备编号重复,请重试!"); return CommonResponseUtil.failure("设备编号重复,请重试!");
...@@ -60,11 +61,11 @@ public class FireSourceController extends BaseController { ...@@ -60,11 +61,11 @@ public class FireSourceController extends BaseController {
fireEquipment.setCreateBy(getUserId()); fireEquipment.setCreateBy(getUserId());
fireEquipment.setCreateDate(new Date()); fireEquipment.setCreateDate(new Date());
fireEquipment.setOrgCode(compCode); fireEquipment.setOrgCode(compCode);
//设备状态默认为正常 //设备状态默认为正常
fireEquipment.setEquipStatus(0); fireEquipment.setEquipStatus(0);
return CommonResponseUtil.success(iFireEquipService.save(fireEquipment)); return CommonResponseUtil.success(iFireEquipService.save(fireEquipment));
} }
...@@ -214,7 +215,7 @@ public class FireSourceController extends BaseController { ...@@ -214,7 +215,7 @@ public class FireSourceController extends BaseController {
@ApiParam(value = "设备编号", required = true) @RequestParam String type) throws Exception { @ApiParam(value = "设备编号", required = true) @RequestParam String type) throws Exception {
try{ 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) { }catch (Exception e) {
log.error(e.getMessage(),e); log.error(e.getMessage(),e);
return CommonResponseUtil.failure("消防装备明细查询失败" + e.getMessage()); return CommonResponseUtil.failure("消防装备明细查询失败" + e.getMessage());
......
...@@ -395,7 +395,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -395,7 +395,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
* @param appKey * @param appKey
* @param product * @param product
* @param token * @param token
* @param failed * @param
* @param rId * @param rId
* @return String * @return String
* @throws <br> * @throws <br>
...@@ -1164,7 +1164,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1164,7 +1164,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
/** /**
* 设备消息规则推送 * 设备消息规则推送
* *
* @param protalData * @param
*/ */
@Async @Async
void fireEquipRuleMessagePush(AlarmParam deviceData, Toke toke) { void fireEquipRuleMessagePush(AlarmParam deviceData, Toke toke) {
...@@ -1468,7 +1468,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1468,7 +1468,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
String maxlevel = map.get("max_level") != null ? map.get("max_level").toString() : "0.0"; 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 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 (hashOperations.size("Analogue") > 0) {
if (ObjectUtils.isEmpty(map.get("code")) || !hashOperations.hasKey("Analogue", map.get("code"))) { if (ObjectUtils.isEmpty(map.get("code")) || !hashOperations.hasKey("Analogue", map.get("code"))) {
map.put("level", level); map.put("level", level);
...@@ -1476,10 +1477,10 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1476,10 +1477,10 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
continue; continue;
} }
EquipCommunicationData data = (EquipCommunicationData) hashOperations.get("Analogue", map.get("code")); 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("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 { } else {
map.put("level", level); map.put("level", level);
map.put("volume", volume); map.put("volume", volume);
......
...@@ -675,12 +675,13 @@ ...@@ -675,12 +675,13 @@
building.area_measure AS area, building.area_measure AS area,
building.`code`, building.`code`,
building.`name`, building.`name`,
building.height AS 'value' building.height AS 'value',
building.design_capacity AS designCapacity
FROM FROM
wl_building building wl_building building
LEFT JOIN wl_equipment_category category ON building.equipment_code = category.id -- LEFT JOIN wl_equipment_category category ON building.equipment_code = category.id
WHERE -- WHERE
category.CODE = 93020000 -- category.CODE = 93020000
) wr ) wr
GROUP BY GROUP BY
wr.alarm_level, 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