1.设备故障状态合并到设备状态中,设备状态接口修改
2.警情处理完成后修改设备状态为正常,修改警情处理接口
| | |
| | | import org.springblade.jfpt.animalheat.service.AnimalHeatService; |
| | | import org.springblade.common.entity.AlarmExcel; |
| | | import org.springblade.jfpt.equipment.feign.DeptFeignApi; |
| | | import org.springblade.jfpt.equipment.service.IEquipmentService; |
| | | import org.springblade.jfpt.healthcode.service.IhealthcodeService; |
| | | import org.springblade.jfpt.operation.entity.Operation; |
| | | import org.springblade.jfpt.operation.service.IOperationService; |
| | |
| | | private ParcelService parcelService; |
| | | |
| | | private final DeptFeignApi deptFeignApi; |
| | | |
| | | private IEquipmentService iEquipmentService; |
| | | |
| | | /** |
| | | * 详情 |
| | |
| | | alarmService.updateJtype(operation.getJid(),operation.getJtype(),operation.getBz(),operation.getSecurityArr()); |
| | | alarmService.updatePoliceStatus(operation.getRid(),"0"); |
| | | operationService.save(operation); |
| | | //如果警情处理完成,则修改设备状态为正常 |
| | | if (null!=operation.getJtype() && operation.getJtype().equals("2")){ |
| | | String state ="处理完成"; |
| | | iEquipmentService.updateExstate(state,null,operation.getDeviceNumber()); |
| | | } |
| | | return R.success("修改成功"); |
| | | } |
| | | |
| | |
| | | List<Map<String, Object>> selectInfos(String deviceNumber); |
| | | void updateChannel(String heartbeat, String deviceNumber); |
| | | void updateexpireTime(String expireTime, String deviceNumber); |
| | | void updateExstate(String state,String reason, String deviceNumber); |
| | | |
| | | /** |
| | | * 修改设备状态 2021-5-6 arsn修改 |
| | | * @param dtype 设备状态 |
| | | * @param reason 原因 |
| | | * @param deviceNumber 设备编号 |
| | | */ |
| | | void updateExstate(String dtype,String reason, String deviceNumber); |
| | | Integer selectEqCz(); |
| | | Integer selectEqCd(); |
| | | List<Map<String, Object>> selectEqCy(String time); |
| | |
| | | </update> |
| | | |
| | | <update id="updateExstate"> |
| | | update sys_equipment SET state=#{state},reason=#{reason} where deviceNumber=#{deviceNumber} |
| | | update sys_equipment SET dtype=#{dtype},reason=#{reason} where deviceNumber=#{deviceNumber} |
| | | </update> |
| | | |
| | | <!--查询设备在线数量--> |
| | |
| | | import org.springblade.system.cache.SysCache; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | |
| | | baseMapper.updateexpireTime(expireTime,deviceNumber); |
| | | } |
| | | |
| | | /** |
| | | * 修改设备状态 2021-5-6 arsn修改 |
| | | * @param state 设备状态 |
| | | * @param reason 原因 |
| | | * @param deviceNumber 设备编号 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateExstate(String state, String reason, String deviceNumber) { |
| | | baseMapper.updateExstate(state, reason, deviceNumber); |
| | | if(state.equals("系统故障")){ |
| | | String dType = "3"; |
| | | baseMapper.updateExstate(dType, reason, deviceNumber); |
| | | } |
| | | if(state.equals("处理完成")){ |
| | | String dType = "1"; |
| | | baseMapper.updateExstate(dType, reason, deviceNumber); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | private String rid; |
| | | private String bz; |
| | | private String securityArr; |
| | | /** |
| | | * 设备编码 |
| | | */ |
| | | private String deviceNumber; |
| | | |
| | | } |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; |
| | | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | import java.util.List; |
| | | |