Commit 3eff261c authored by 赵啸非's avatar 赵啸非

添加新的菜单权限模块

parent 56287fc9
Pipeline #2947 failed with stages
......@@ -44,4 +44,11 @@ public interface ParamService extends ICRUDCacheService<ParamEntity, Long>, IPar
*/
Map<String, String> getParamBySecondOrganize(String firstOrganize,String secondOrganize, String... excludeParamKeys);
/**
* 通过Key设置参数值 value
* @param key
* @param value
* @return
*/
void setValueByKey(String key,String value);
}
\ No newline at end of file
......@@ -13,6 +13,7 @@ import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
......@@ -190,4 +191,29 @@ public class ParamServiceImpl extends AbstractCRUDCacheServiceImpl<ParamDao, Par
}
}
@Override
public void setValueByKey(String key, String value) {
List<ParamEntity> list = this.getCacheList();
ParamEntity entity = null;
for(ParamEntity paramEntity:list){
if(key.equals(paramEntity.getParamKey())){
entity = paramEntity;
break;
}
}
if(entity!=null){
entity.setParamValue(String.valueOf(value));
this.update(entity);
}else {
entity = new ParamEntity();
entity.setParamValue(String.valueOf(value));
entity.setParamKey(key);
entity.setName("key");
entity.setCreateTime(new Date());
entity.setCreateUserId(1l);
entity.setCreateUserName("系统管理员");
this.save(entity);
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.base.system.menu.dao.ibatis.MenuDaoImpl">
<!-- 获取列表 -->
<select id="getListByUserId" parameterType="paramDto" resultMap="MenuEntity-Map">
select <include refid="_columns"/>
from mortals_xhx_menu as a
where a.authType in(0,1,2) or a.id IN
(select menuId
from mortals_xhx_role_auth as b
left join mortals_xhx_role_user as c
on b.roleId=c.roleId
where c.userId=#{condition.userId})
</select>
</mapper>
\ No newline at end of file
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