| | |
| | | import com.panzhihua.service_property.dao.ComPropertyAlarmSettingDao; |
| | | import com.panzhihua.service_property.service.ComPropertyAlarmSettingService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | public class ComPropertyAlarmSettingServiceImpl extends ServiceImpl<ComPropertyAlarmSettingDao, ComPropertyAlarmSetting> implements ComPropertyAlarmSettingService { |
| | | @Resource |
| | | private ComPropertyAlarmSettingDao comPropertyAlarmSettingDao; |
| | | @Resource |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | @Override |
| | | public R pageList(CommonPage commonPage) { |
| | | return null; |
| | |
| | | public R getByCommunityId(Long communityId) { |
| | | return R.ok(comPropertyAlarmSettingDao.getByCommunityId(communityId)); |
| | | } |
| | | |
| | | @Override |
| | | public R insert(ComPropertyAlarmSetting comPropertyAlarmSetting) { |
| | | boolean result=this.saveOrUpdate(comPropertyAlarmSetting); |
| | | if(result){ |
| | | if(stringRedisTemplate.hasKey(comPropertyAlarmSetting.getCommunityId().toString())){ |
| | | stringRedisTemplate.boundValueOps(comPropertyAlarmSetting.getCommunityId().toString()).set(comPropertyAlarmSetting.getTriggerTime().toString()); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | return R.fail(); |
| | | } |
| | | } |