From 70d2a5d0f9c6951b2d4cac954041ed73582ff7eb Mon Sep 17 00:00:00 2001 From: liujie <1793218484@qq.com> Date: 星期一, 09 六月 2025 11:54:00 +0800 Subject: [PATCH] 6.9新增登录失败冻结逻辑 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/SysConfServiceImpl.java | 90 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 90 insertions(+), 0 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/SysConfServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/SysConfServiceImpl.java index 34ff0c0..39f8f05 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/SysConfServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/SysConfServiceImpl.java @@ -1,13 +1,19 @@ package com.panzhihua.service_community.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.panzhihua.common.constants.NeighborCircleConstants; +import com.panzhihua.common.model.vos.community.CommunityPublicityVO; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.panzhihua.common.model.vos.R; import com.panzhihua.service_community.dao.SysConfMapper; import com.panzhihua.service_community.model.dos.SysConfDO; import com.panzhihua.service_community.service.SysConfService; import lombok.extern.slf4j.Slf4j; + +import java.util.Date; /** * @auther lyq @@ -18,4 +24,88 @@ @Service public class SysConfServiceImpl extends ServiceImpl<SysConfMapper, SysConfDO> implements SysConfService { + /** + * 根据系统code以及社区id查询配置表value值 + * @param key 系统code + * @param communityId 社区id + * @return 系统配置value值 + */ + @Override + public R getSysConfValue(String key, Long communityId){ + return R.ok(this.baseMapper.getSysConfValue(key,communityId)); + } + + /** + * 新增系统code配置数据 + * @param key 系统code + * @param communityId 社区id + * @return 新增结果 + */ + @Override + public R addSysConfValue(String key, Long communityId,String name,String value){ + SysConfDO confDO = new SysConfDO(); + confDO.setCode(key); + confDO.setCreateAt(new Date()); + confDO.setCommunityId(communityId); + confDO.setValue(value); + confDO.setName(name); + if(this.baseMapper.insert(confDO) > 0){ + return R.ok(confDO.getValue()); + }else{ + return R.fail(); + } + } + + @Override + public R editSysConfValue(Long communityId, Integer status){ + String key = NeighborCircleConstants.NEIGHBOR_CIRCLE_AUTO_EXAMINE; + + SysConfDO confDO = this.baseMapper.selectOne(new QueryWrapper<SysConfDO>().lambda().eq(SysConfDO::getCommunityId,communityId) + .eq(SysConfDO::getCode,key + communityId)); + if(confDO == null){ + return R.fail("未查询到该系统配置"); + } + confDO.setCommunityId(communityId); + confDO.setCode(key + communityId); + confDO.setValue(status+""); + if(this.baseMapper.updateById(confDO) > 0){ + return R.ok(confDO.getValue()); + }else{ + return R.fail(); + } + } + + + + + @Override + public CommunityPublicityVO getData(String communityId) { + return baseMapper.getData(communityId); + } + + @Override + public int addDate(CommunityPublicityVO item) + { + CommunityPublicityVO vo=baseMapper.getData(item.getCommunityId()); + if(vo==null) + { + return baseMapper.addDate(item); + } + else + { + return baseMapper.editDate(item); + } + } + + @Override + public int editDate(CommunityPublicityVO item) { + return baseMapper.editDate(item); + } + + @Override + public int deleteData(String communityId) { + return baseMapper.deleteData(communityId); + } + + } -- Gitblit v1.7.1