Commit cd8cb3a6 authored by andnnl's avatar andnnl
Browse files

多数据源下指定数据源@Qualifier("coreSqlManager"),删除pojo的@SeqID

parent 5906a809
...@@ -11,11 +11,11 @@ import java.util.List; ...@@ -11,11 +11,11 @@ import java.util.List;
public interface CoreRoleFunctionDao extends BaseMapper<CoreRoleFunction> { public interface CoreRoleFunctionDao extends BaseMapper<CoreRoleFunction> {
List<CoreRoleFunction> getRoleFunction( Long userId, Long orgId, List<CoreRoleFunction> getRoleFunction(Long userId, Long orgId,
String code); String code);
List<String> getRoleChildrenFunction(Long userId, Long orgId, List<String> getRoleChildrenFunction(Long userId, Long orgId,
Long parentId); Long parentId);
} }
...@@ -13,16 +13,18 @@ public interface CoreRoleMenuDao extends BaseMapper<CoreRoleMenu> { ...@@ -13,16 +13,18 @@ public interface CoreRoleMenuDao extends BaseMapper<CoreRoleMenu> {
/** /**
* 根据用户ID,机构ID查询菜单 * 根据用户ID,机构ID查询菜单
*
* @param userId 用户id * @param userId 用户id
* @param orgId 机构id * @param orgId 机构id
* @return * @return
*/ */
List<Long> queryMenuByUser( Long userId, Long orgId); List<Long> queryMenuByUser(Long userId, Long orgId);
/** /**
* 根据菜单id删除角色和菜单关系 * 根据菜单id删除角色和菜单关系
*
* @param ids * @param ids
*/ */
@Update @Update
void deleteRoleMenu(List<Long> ids); void deleteRoleMenu(List<Long> ids);
} }
package com.ibeetl.admin.core.dao; package com.ibeetl.admin.core.dao;
import com.ibeetl.admin.core.entity.CoreUser; import com.ibeetl.admin.core.entity.CoreUser;
import org.beetl.sql.mapper.BaseMapper; import org.beetl.sql.mapper.BaseMapper;
import org.beetl.sql.mapper.annotation.SqlResource; import org.beetl.sql.mapper.annotation.SqlResource;
...@@ -13,10 +12,11 @@ public interface CoreUserDao extends BaseMapper<CoreUser> { ...@@ -13,10 +12,11 @@ public interface CoreUserDao extends BaseMapper<CoreUser> {
/** /**
* 根据角色编码查询用户集合 * 根据角色编码查询用户集合
*
* @param roleCode 角色编码 * @param roleCode 角色编码
* @return * @return
*/ */
List<CoreUser> getUserByRole( String roleCode); List<CoreUser> getUserByRole(String roleCode);
} }
package com.ibeetl.admin.core.dao; package com.ibeetl.admin.core.dao;
import com.ibeetl.admin.core.entity.CoreUserRole; import com.ibeetl.admin.core.entity.CoreUserRole;
import org.beetl.sql.mapper.BaseMapper; import org.beetl.sql.mapper.BaseMapper;
import org.beetl.sql.mapper.annotation.SqlResource; import org.beetl.sql.mapper.annotation.SqlResource;
......
...@@ -9,6 +9,7 @@ import java.util.List; ...@@ -9,6 +9,7 @@ import java.util.List;
/** /**
* 业务侧工作流的基本功能,工作流的一些功能将在业务侧完成,比如选人操作 * 业务侧工作流的基本功能,工作流的一些功能将在业务侧完成,比如选人操作
*
* @author lijiazhi * @author lijiazhi
*/ */
@SqlResource("core.workflow") @SqlResource("core.workflow")
...@@ -16,6 +17,7 @@ public interface CoreWorkflowDao extends BaseMapper { ...@@ -16,6 +17,7 @@ public interface CoreWorkflowDao extends BaseMapper {
/** /**
* 根据角色id,机构id查询用户集合 * 根据角色id,机构id查询用户集合
*
* @param roleId 角色id * @param roleId 角色id
* @param orgs 机构id * @param orgs 机构id
* @return * @return
......
...@@ -14,7 +14,7 @@ import org.beetl.sql.annotation.entity.SeqID; ...@@ -14,7 +14,7 @@ import org.beetl.sql.annotation.entity.SeqID;
public class CoreAudit extends BaseEntity { public class CoreAudit extends BaseEntity {
@SeqID(name = "ORACLE_AUDIT_SEQ_NAME") //@SeqID(name = "ORACLE_AUDIT_SEQ_NAME")
@AutoID @AutoID
@NotNull(message = "ID不能为空", groups = ValidateConfig.UPDATE.class) @NotNull(message = "ID不能为空", groups = ValidateConfig.UPDATE.class)
protected Long id; protected Long id;
......
...@@ -19,7 +19,7 @@ import org.beetl.sql.annotation.entity.SeqID; ...@@ -19,7 +19,7 @@ import org.beetl.sql.annotation.entity.SeqID;
public class CoreDict extends BaseEntity { public class CoreDict extends BaseEntity {
@NotNull(message = "ID不能为空", groups = ValidateConfig.UPDATE.class) @NotNull(message = "ID不能为空", groups = ValidateConfig.UPDATE.class)
@SeqID(name = ORACLE_CORE_SEQ_NAME) //@SeqID(name = ORACLE_CORE_SEQ_NAME)
@AutoID @AutoID
private Long id; private Long id;
......
...@@ -13,7 +13,7 @@ import org.beetl.sql.annotation.entity.SeqID; ...@@ -13,7 +13,7 @@ import org.beetl.sql.annotation.entity.SeqID;
*/ */
public class CoreFile extends BaseEntity { public class CoreFile extends BaseEntity {
@NotNull(message = "ID不能为空", groups = ValidateConfig.UPDATE.class) @NotNull(message = "ID不能为空", groups = ValidateConfig.UPDATE.class)
@SeqID(name = ORACLE_FILE_SEQ_NAME) //@SeqID(name = ORACLE_FILE_SEQ_NAME)
@AutoID @AutoID
private Long id; private Long id;
// 文件名称 // 文件名称
......
...@@ -17,7 +17,7 @@ import org.beetl.sql.annotation.entity.UpdateIgnore; ...@@ -17,7 +17,7 @@ import org.beetl.sql.annotation.entity.UpdateIgnore;
public class CoreFunction extends BaseEntity { public class CoreFunction extends BaseEntity {
@NotNull(message = "ID不能为空", groups = ValidateConfig.UPDATE.class) @NotNull(message = "ID不能为空", groups = ValidateConfig.UPDATE.class)
@SeqID(name = ORACLE_CORE_SEQ_NAME) //@SeqID(name = ORACLE_CORE_SEQ_NAME)
@AutoID @AutoID
protected Long id; protected Long id;
......
...@@ -24,7 +24,7 @@ public class CoreMenu extends BaseEntity { ...@@ -24,7 +24,7 @@ public class CoreMenu extends BaseEntity {
public static final String TYPE_MENUITEM = "MENU_M"; public static final String TYPE_MENUITEM = "MENU_M";
@NotNull(message = "ID不能为空", groups = ValidateConfig.UPDATE.class) @NotNull(message = "ID不能为空", groups = ValidateConfig.UPDATE.class)
@SeqID(name = ORACLE_CORE_SEQ_NAME) //@SeqID(name = ORACLE_CORE_SEQ_NAME)
@AutoID @AutoID
protected Long id; protected Long id;
......
...@@ -27,7 +27,7 @@ public class CoreOrg extends BaseEntity { ...@@ -27,7 +27,7 @@ public class CoreOrg extends BaseEntity {
// 自增id // 自增id
@NotNull(message = "ID不能为空", groups = ValidateConfig.UPDATE.class) @NotNull(message = "ID不能为空", groups = ValidateConfig.UPDATE.class)
@SeqID(name = ORACLE_CORE_SEQ_NAME) //@SeqID(name = ORACLE_CORE_SEQ_NAME)
@AutoID @AutoID
private Long id; private Long id;
......
...@@ -19,7 +19,7 @@ import org.beetl.sql.annotation.entity.SeqID; ...@@ -19,7 +19,7 @@ import org.beetl.sql.annotation.entity.SeqID;
public class CoreRole extends BaseEntity { public class CoreRole extends BaseEntity {
@NotNull(message = "ID不能为空", groups = ValidateConfig.UPDATE.class) @NotNull(message = "ID不能为空", groups = ValidateConfig.UPDATE.class)
@SeqID(name = ORACLE_CORE_SEQ_NAME) //@SeqID(name = ORACLE_CORE_SEQ_NAME)
@AutoID @AutoID
protected Long id; protected Long id;
......
...@@ -17,7 +17,7 @@ import org.beetl.sql.annotation.entity.SeqID; ...@@ -17,7 +17,7 @@ import org.beetl.sql.annotation.entity.SeqID;
*/ */
public class CoreRoleFunction extends BaseEntity { public class CoreRoleFunction extends BaseEntity {
@NotNull(message = "ID不能为空", groups = ValidateConfig.UPDATE.class) @NotNull(message = "ID不能为空", groups = ValidateConfig.UPDATE.class)
@SeqID(name = ORACLE_CORE_SEQ_NAME) //@SeqID(name = ORACLE_CORE_SEQ_NAME)
@AutoID @AutoID
protected Long id; protected Long id;
// 删除标识 // 删除标识
......
...@@ -15,7 +15,7 @@ import org.beetl.sql.annotation.entity.SeqID; ...@@ -15,7 +15,7 @@ import org.beetl.sql.annotation.entity.SeqID;
*/ */
public class CoreRoleMenu extends BaseEntity { public class CoreRoleMenu extends BaseEntity {
@NotNull(message = "ID不能为空", groups = ValidateConfig.UPDATE.class) @NotNull(message = "ID不能为空", groups = ValidateConfig.UPDATE.class)
@SeqID(name = ORACLE_CORE_SEQ_NAME) //@SeqID(name = ORACLE_CORE_SEQ_NAME)
@AutoID @AutoID
protected Long id; protected Long id;
......
...@@ -25,7 +25,7 @@ public class CoreUser extends BaseEntity { ...@@ -25,7 +25,7 @@ public class CoreUser extends BaseEntity {
@NotNull(message = "ID不能为空", groups =ValidateConfig. UPDATE.class) @NotNull(message = "ID不能为空", groups =ValidateConfig. UPDATE.class)
@SeqID(name = ORACLE_CORE_SEQ_NAME) //@SeqID(name = ORACLE_CORE_SEQ_NAME)
@AutoID @AutoID
protected Long id; protected Long id;
// 删除标识 // 删除标识
......
...@@ -16,7 +16,7 @@ import javax.validation.constraints.NotNull; ...@@ -16,7 +16,7 @@ import javax.validation.constraints.NotNull;
public class CoreUserRole extends BaseEntity { public class CoreUserRole extends BaseEntity {
@SeqID(name = "ORACLE_CORE_SEQ_NAME") //@SeqID(name = "ORACLE_CORE_SEQ_NAME")
@AutoID @AutoID
private Long id; private Long id;
// 授权机构id // 授权机构id
......
...@@ -19,6 +19,7 @@ import org.beetl.sql.core.SQLManager; ...@@ -19,6 +19,7 @@ import org.beetl.sql.core.SQLManager;
import org.beetl.sql.core.meta.MetadataManager; import org.beetl.sql.core.meta.MetadataManager;
import org.beetl.sql.core.meta.SchemaMetadataManager; import org.beetl.sql.core.meta.SchemaMetadataManager;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ibeetl.admin.core.entity.CoreFunction; import com.ibeetl.admin.core.entity.CoreFunction;
...@@ -34,6 +35,7 @@ import com.ibeetl.admin.core.gen.model.Entity; ...@@ -34,6 +35,7 @@ import com.ibeetl.admin.core.gen.model.Entity;
@Service @Service
public class CoreCodeGenService { public class CoreCodeGenService {
@Autowired @Autowired
@Qualifier("coreSqlManager")
SQLManager sqlManager; SQLManager sqlManager;
@Autowired @Autowired
CorePlatformService platformService; CorePlatformService platformService;
......
...@@ -10,6 +10,7 @@ import org.beetl.sql.core.SQLManager; ...@@ -10,6 +10,7 @@ import org.beetl.sql.core.SQLManager;
import org.beetl.sql.core.engine.SQLPlaceholderST; import org.beetl.sql.core.engine.SQLPlaceholderST;
import org.beetl.sql.core.engine.template.BeetlTemplateEngine; import org.beetl.sql.core.engine.template.BeetlTemplateEngine;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -97,6 +98,7 @@ public class CorePlatformService { ...@@ -97,6 +98,7 @@ public class CorePlatformService {
CoreFunctionDao sysFunctionDao; CoreFunctionDao sysFunctionDao;
@Autowired @Autowired
@Qualifier("coreSqlManager")
SQLManager sqlManager; SQLManager sqlManager;
@Autowired @Autowired
......
...@@ -4,6 +4,7 @@ import java.util.List; ...@@ -4,6 +4,7 @@ import java.util.List;
import org.beetl.sql.core.SQLManager; import org.beetl.sql.core.SQLManager;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -30,7 +31,9 @@ public class CoreUserService { ...@@ -30,7 +31,9 @@ public class CoreUserService {
@Autowired @Autowired
PasswordEncryptService passwordEncryptService; PasswordEncryptService passwordEncryptService;
@Autowired SQLManager sqlManager; @Autowired
@Qualifier("coreSqlManager")
SQLManager sqlManager;
public UserLoginInfo login(String userName,String password){ public UserLoginInfo login(String userName,String password){
CoreUser query = new CoreUser(); CoreUser query = new CoreUser();
......
...@@ -34,7 +34,7 @@ public class ${className} extends BaseEntity{ ...@@ -34,7 +34,7 @@ public class ${className} extends BaseEntity{
@} @}
@if(attr.isId) { @if(attr.isId) {
\@NotNull(message = "ID不能为空", groups =ValidateConfig.UPDATE.class) \@NotNull(message = "ID不能为空", groups =ValidateConfig.UPDATE.class)
\@SeqID(name = ORACLE_CORE_SEQ_NAME) //\@SeqID(name = ORACLE_CORE_SEQ_NAME)
\@AutoID \@AutoID
@} @}
@if(isNotEmpty(attr.dictType)) { @if(isNotEmpty(attr.dictType)) {
......
Supports Markdown
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