Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Springboot Plus
Commits
4dd5b49f
Commit
4dd5b49f
authored
Aug 27, 2021
by
闲.大赋
Committed by
Gitee
Aug 27, 2021
Browse files
!40 支持beetlsql3,多数据源
Merge pull request !40 from Andnnl/master
parents
5906a809
dab16bb3
Changes
45
Show whitespace changes
Inline
Side-by-side
admin-core/src/main/java/com/ibeetl/admin/core/dao/CoreRoleFunctionDao.java
View file @
4dd5b49f
...
...
@@ -11,7 +11,7 @@ import java.util.List;
public
interface
CoreRoleFunctionDao
extends
BaseMapper
<
CoreRoleFunction
>
{
List
<
CoreRoleFunction
>
getRoleFunction
(
Long
userId
,
Long
orgId
,
List
<
CoreRoleFunction
>
getRoleFunction
(
Long
userId
,
Long
orgId
,
String
code
);
List
<
String
>
getRoleChildrenFunction
(
Long
userId
,
Long
orgId
,
...
...
admin-core/src/main/java/com/ibeetl/admin/core/dao/CoreRoleMenuDao.java
View file @
4dd5b49f
...
...
@@ -13,14 +13,16 @@ public interface CoreRoleMenuDao extends BaseMapper<CoreRoleMenu> {
/**
* 根据用户ID,机构ID查询菜单
*
* @param userId 用户id
* @param orgId 机构id
* @return
*/
List
<
Long
>
queryMenuByUser
(
Long
userId
,
Long
orgId
);
List
<
Long
>
queryMenuByUser
(
Long
userId
,
Long
orgId
);
/**
* 根据菜单id删除角色和菜单关系
*
* @param ids
*/
@Update
...
...
admin-core/src/main/java/com/ibeetl/admin/core/dao/CoreUserDao.java
View file @
4dd5b49f
package
com.ibeetl.admin.core.dao
;
import
com.ibeetl.admin.core.entity.CoreUser
;
import
org.beetl.sql.mapper.BaseMapper
;
import
org.beetl.sql.mapper.annotation.SqlResource
;
...
...
@@ -13,10 +12,11 @@ public interface CoreUserDao extends BaseMapper<CoreUser> {
/**
* 根据角色编码查询用户集合
*
* @param roleCode 角色编码
* @return
*/
List
<
CoreUser
>
getUserByRole
(
String
roleCode
);
List
<
CoreUser
>
getUserByRole
(
String
roleCode
);
}
admin-core/src/main/java/com/ibeetl/admin/core/dao/CoreUserRoleDao.java
View file @
4dd5b49f
package
com.ibeetl.admin.core.dao
;
import
com.ibeetl.admin.core.entity.CoreUserRole
;
import
org.beetl.sql.mapper.BaseMapper
;
import
org.beetl.sql.mapper.annotation.SqlResource
;
...
...
admin-core/src/main/java/com/ibeetl/admin/core/dao/CoreWorkflowDao.java
View file @
4dd5b49f
...
...
@@ -9,6 +9,7 @@ import java.util.List;
/**
* 业务侧工作流的基本功能,工作流的一些功能将在业务侧完成,比如选人操作
*
* @author lijiazhi
*/
@SqlResource
(
"core.workflow"
)
...
...
@@ -16,6 +17,7 @@ public interface CoreWorkflowDao extends BaseMapper {
/**
* 根据角色id,机构id查询用户集合
*
* @param roleId 角色id
* @param orgs 机构id
* @return
...
...
admin-core/src/main/java/com/ibeetl/admin/core/entity/CoreAudit.java
View file @
4dd5b49f
...
...
@@ -14,7 +14,7 @@ import org.beetl.sql.annotation.entity.SeqID;
public
class
CoreAudit
extends
BaseEntity
{
@SeqID
(
name
=
"ORACLE_AUDIT_SEQ_NAME"
)
//
@SeqID(name = "ORACLE_AUDIT_SEQ_NAME")
@AutoID
@NotNull
(
message
=
"ID不能为空"
,
groups
=
ValidateConfig
.
UPDATE
.
class
)
protected
Long
id
;
...
...
admin-core/src/main/java/com/ibeetl/admin/core/entity/CoreDict.java
View file @
4dd5b49f
...
...
@@ -19,7 +19,7 @@ import org.beetl.sql.annotation.entity.SeqID;
public
class
CoreDict
extends
BaseEntity
{
@NotNull
(
message
=
"ID不能为空"
,
groups
=
ValidateConfig
.
UPDATE
.
class
)
@SeqID
(
name
=
ORACLE_CORE_SEQ_NAME
)
//
@SeqID(name = ORACLE_CORE_SEQ_NAME)
@AutoID
private
Long
id
;
...
...
admin-core/src/main/java/com/ibeetl/admin/core/entity/CoreFile.java
View file @
4dd5b49f
...
...
@@ -13,7 +13,7 @@ import org.beetl.sql.annotation.entity.SeqID;
*/
public
class
CoreFile
extends
BaseEntity
{
@NotNull
(
message
=
"ID不能为空"
,
groups
=
ValidateConfig
.
UPDATE
.
class
)
@SeqID
(
name
=
ORACLE_FILE_SEQ_NAME
)
//
@SeqID(name = ORACLE_FILE_SEQ_NAME)
@AutoID
private
Long
id
;
// 文件名称
...
...
admin-core/src/main/java/com/ibeetl/admin/core/entity/CoreFunction.java
View file @
4dd5b49f
...
...
@@ -17,7 +17,7 @@ import org.beetl.sql.annotation.entity.UpdateIgnore;
public
class
CoreFunction
extends
BaseEntity
{
@NotNull
(
message
=
"ID不能为空"
,
groups
=
ValidateConfig
.
UPDATE
.
class
)
@SeqID
(
name
=
ORACLE_CORE_SEQ_NAME
)
//
@SeqID(name = ORACLE_CORE_SEQ_NAME)
@AutoID
protected
Long
id
;
...
...
admin-core/src/main/java/com/ibeetl/admin/core/entity/CoreMenu.java
View file @
4dd5b49f
...
...
@@ -24,7 +24,7 @@ public class CoreMenu extends BaseEntity {
public
static
final
String
TYPE_MENUITEM
=
"MENU_M"
;
@NotNull
(
message
=
"ID不能为空"
,
groups
=
ValidateConfig
.
UPDATE
.
class
)
@SeqID
(
name
=
ORACLE_CORE_SEQ_NAME
)
//
@SeqID(name = ORACLE_CORE_SEQ_NAME)
@AutoID
protected
Long
id
;
...
...
admin-core/src/main/java/com/ibeetl/admin/core/entity/CoreOrg.java
View file @
4dd5b49f
...
...
@@ -27,7 +27,7 @@ public class CoreOrg extends BaseEntity {
// 自增id
@NotNull
(
message
=
"ID不能为空"
,
groups
=
ValidateConfig
.
UPDATE
.
class
)
@SeqID
(
name
=
ORACLE_CORE_SEQ_NAME
)
//
@SeqID(name = ORACLE_CORE_SEQ_NAME)
@AutoID
private
Long
id
;
...
...
admin-core/src/main/java/com/ibeetl/admin/core/entity/CoreRole.java
View file @
4dd5b49f
...
...
@@ -19,7 +19,7 @@ import org.beetl.sql.annotation.entity.SeqID;
public
class
CoreRole
extends
BaseEntity
{
@NotNull
(
message
=
"ID不能为空"
,
groups
=
ValidateConfig
.
UPDATE
.
class
)
@SeqID
(
name
=
ORACLE_CORE_SEQ_NAME
)
//
@SeqID(name = ORACLE_CORE_SEQ_NAME)
@AutoID
protected
Long
id
;
...
...
admin-core/src/main/java/com/ibeetl/admin/core/entity/CoreRoleFunction.java
View file @
4dd5b49f
...
...
@@ -17,7 +17,7 @@ import org.beetl.sql.annotation.entity.SeqID;
*/
public
class
CoreRoleFunction
extends
BaseEntity
{
@NotNull
(
message
=
"ID不能为空"
,
groups
=
ValidateConfig
.
UPDATE
.
class
)
@SeqID
(
name
=
ORACLE_CORE_SEQ_NAME
)
//
@SeqID(name = ORACLE_CORE_SEQ_NAME)
@AutoID
protected
Long
id
;
// 删除标识
...
...
admin-core/src/main/java/com/ibeetl/admin/core/entity/CoreRoleMenu.java
View file @
4dd5b49f
...
...
@@ -15,7 +15,7 @@ import org.beetl.sql.annotation.entity.SeqID;
*/
public
class
CoreRoleMenu
extends
BaseEntity
{
@NotNull
(
message
=
"ID不能为空"
,
groups
=
ValidateConfig
.
UPDATE
.
class
)
@SeqID
(
name
=
ORACLE_CORE_SEQ_NAME
)
//
@SeqID(name = ORACLE_CORE_SEQ_NAME)
@AutoID
protected
Long
id
;
...
...
admin-core/src/main/java/com/ibeetl/admin/core/entity/CoreUser.java
View file @
4dd5b49f
...
...
@@ -25,7 +25,7 @@ public class CoreUser extends BaseEntity {
@NotNull
(
message
=
"ID不能为空"
,
groups
=
ValidateConfig
.
UPDATE
.
class
)
@SeqID
(
name
=
ORACLE_CORE_SEQ_NAME
)
//
@SeqID(name = ORACLE_CORE_SEQ_NAME)
@AutoID
protected
Long
id
;
// 删除标识
...
...
admin-core/src/main/java/com/ibeetl/admin/core/entity/CoreUserRole.java
View file @
4dd5b49f
...
...
@@ -16,7 +16,7 @@ import javax.validation.constraints.NotNull;
public
class
CoreUserRole
extends
BaseEntity
{
@SeqID
(
name
=
"ORACLE_CORE_SEQ_NAME"
)
//
@SeqID(name = "ORACLE_CORE_SEQ_NAME")
@AutoID
private
Long
id
;
// 授权机构id
...
...
admin-core/src/main/java/com/ibeetl/admin/core/service/CoreCodeGenService.java
View file @
4dd5b49f
...
...
@@ -19,6 +19,7 @@ import org.beetl.sql.core.SQLManager;
import
org.beetl.sql.core.meta.MetadataManager
;
import
org.beetl.sql.core.meta.SchemaMetadataManager
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.stereotype.Service
;
import
com.ibeetl.admin.core.entity.CoreFunction
;
...
...
@@ -34,6 +35,7 @@ import com.ibeetl.admin.core.gen.model.Entity;
@Service
public
class
CoreCodeGenService
{
@Autowired
@Qualifier
(
"coreSqlManager"
)
SQLManager
sqlManager
;
@Autowired
CorePlatformService
platformService
;
...
...
admin-core/src/main/java/com/ibeetl/admin/core/service/CorePlatformService.java
View file @
4dd5b49f
...
...
@@ -10,6 +10,7 @@ import org.beetl.sql.core.SQLManager;
import
org.beetl.sql.core.engine.SQLPlaceholderST
;
import
org.beetl.sql.core.engine.template.BeetlTemplateEngine
;
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.Cacheable
;
import
org.springframework.stereotype.Service
;
...
...
@@ -97,6 +98,7 @@ public class CorePlatformService {
CoreFunctionDao
sysFunctionDao
;
@Autowired
@Qualifier
(
"coreSqlManager"
)
SQLManager
sqlManager
;
@Autowired
...
...
admin-core/src/main/java/com/ibeetl/admin/core/service/CoreUserService.java
View file @
4dd5b49f
...
...
@@ -4,6 +4,7 @@ import java.util.List;
import
org.beetl.sql.core.SQLManager
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -30,7 +31,9 @@ public class CoreUserService {
@Autowired
PasswordEncryptService
passwordEncryptService
;
@Autowired
SQLManager
sqlManager
;
@Autowired
@Qualifier
(
"coreSqlManager"
)
SQLManager
sqlManager
;
public
UserLoginInfo
login
(
String
userName
,
String
password
){
CoreUser
query
=
new
CoreUser
();
...
...
admin-core/src/main/resources/codeTemplate/java/controller.java
View file @
4dd5b49f
...
...
@@ -96,12 +96,17 @@ public class ${entity.name}Controller{
\
@PostMapping
(
MODEL
+
"/list.json"
)
\
@Function
(
"${basicfunctionCode}.query"
)
\
@ResponseBody
public
JsonResult
<
PageQuery
>
list
(
$
{
entity
.
name
}
Query
condtion
)
public
JsonResult
<
PageResult
<
$
{
entity
.
name
}>>
list
(
$
{
entity
.
name
}
Query
condition
)
{
PageResult
<
$
{
entity
.
name
}>
pageResult
=
$
{
service
}.
queryByCondition
(
condition
);
return
JsonResult
.
success
(
pageResult
);
}
/* public JsonResult<PageQuery> list(${entity.name}Query condtion)
{
PageQuery page = condtion.getPageQuery();
${service}.queryByCondition(page);
return JsonResult.success(page);
}
}
*/
\
@PostMapping
(
MODEL
+
"/add.json"
)
\
@Function
(
"${basicfunctionCode}.add"
)
...
...
@@ -151,20 +156,26 @@ public class ${entity.name}Controller{
\
@PostMapping
(
MODEL
+
"/excel/export.json"
)
\
@Function
(
"${basicfunctionCode}.export"
)
\
@ResponseBody
public
JsonResult
<
String
>
export
(
HttpServletResponse
response
,
$
{
entity
.
name
}
Query
condtion
)
{
public
JsonResult
<
String
>
export
(
HttpServletResponse
response
,
$
{
entity
.
name
}
Query
cond
i
tion
)
{
/**
* 1)需要用你自己编写一个的excel模板
* 2)通常excel导出需要关联更多数据,因此${service}.queryByCondition方法经常不符合需求,需要重写一个为模板导出的查询
* 3)参考ConsoleDictController来实现模板导入导出
*/
String
excelTemplate
=
"excelTemplates/${target.urlBase}/${entity.code}/你的excel模板文件名字.xls"
;
PageQuery
<
$
{
entity
.
name
}>
page
=
condtion
.
getPageQuery
();
// PageQuery<${entity.name}> page = condtion.getPageQuery();
//PageRequest<${entity.name}> page=condition.getPageRequest();
condition
.
setPage
(
1
);
condition
.
setLimit
(
Integer
.
MAX_VALUE
);
//取出全部符合条件的
page
.
setPageSize
(
Integer
.
MAX_VALUE
);
page
.
setPageNumber
(
1
);
page
.
setTotalRow
(
Integer
.
MAX_VALUE
);
// page.setPageSize(Integer.MAX_VALUE);
// page.setPageNumber(1);
// page.setTotalRow(Integer.MAX_VALUE);
//本次导出需要的数据
PageResult
<
$
{
entity
.
name
}>
pageResult
=
$
{
service
}.
queryByCondition
(
condition
);
//本次导出需要的数据
List
<
$
{
entity
.
name
}>
list
=
$
{
service
}.
queryByCondition
(
page
).
getList
();
List
<
$
{
entity
.
name
}>
list
=
pageResult
.
getList
();
// List<${entity.name}> list =${service}.queryByCondition(page).getList();
try
(
InputStream
is
=
Thread
.
currentThread
().
getContextClassLoader
().
getResourceAsStream
(
excelTemplate
))
{
if
(
is
==
null
)
{
throw
new
PlatformException
(
"模板资源不存在:"
+
excelTemplate
);
...
...
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment