Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bb
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abs_pom
bb
Commits
af0f00bb
Commit
af0f00bb
authored
Apr 21, 2020
by
zhaoyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增资产包默认筛选条件
parent
9f4d4d8c
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
66 additions
and
29 deletions
+66
-29
app/biz/service/src/main/java/com/abssqr/plat/biz/api/astPool/AstPoolServiceImpl.java
+18
-3
app/common/dal/dalgen/AbssqrCoreTables/ABS_AST_POOL.xml
+4
-4
app/common/dal/src/main/java/com/abssqr/plat/common/dal/mysql/auto/dao/AstPoolDAO.java
+3
-3
app/common/dal/src/main/java/com/abssqr/plat/common/dal/mysql/auto/mapper/AstPoolDOMapper.java
+2
-2
app/common/dal/src/main/resources/com/abssqr/plat/common/dal/mysql/auto/mapper/AstPoolDOMapper.xml
+3
-3
app/common/facade/src/main/java/com/abssqr/plat/common/facade/enums/AstScreenRelTypeEnum.java
+1
-3
app/common/facade/src/main/java/com/abssqr/plat/common/facade/param/astPool/AstPoolOprParam.java
+5
-5
app/common/model/src/main/java/com/abssqr/plat/common/model/convertor/web/AstPackParamConvert.java
+1
-1
app/common/model/src/main/java/com/abssqr/plat/common/model/repo/astPool/impl/AstPoolRepositoryImpl.java
+1
-1
app/core/service/src/main/java/com/abssqr/plat/core/service/ast/AstPackManager.java
+28
-4
No files found.
app/biz/service/src/main/java/com/abssqr/plat/biz/api/astPool/AstPoolServiceImpl.java
View file @
af0f00bb
...
...
@@ -30,25 +30,35 @@ public class AstPoolServiceImpl extends ServiceSupport implements AstPoolService
@Autowired
AstPackManager
astPackManager
;
/**
* 新增资产池
* @param astPoolOprParam
* @return
*/
@Override
public
int
add
(
@Valid
AstPoolOprParam
astPoolOprParam
)
{
return
super
.
doOpr
(
astPoolOprParam
,()->{
AstPoolEntity
astPoolEntity
=
new
AstPoolEntity
();
astPoolEntity
.
setAstTypeEnum
(
AstTypeEnum
.
getByCode
(
astPoolOprParam
.
getAstType
Code
()));
astPoolEntity
.
setAstTypeEnum
(
AstTypeEnum
.
getByCode
(
astPoolOprParam
.
getAstType
()));
//如果前端传入产品编号为空则将资产类型编号作为产品编号
if
(
StringUtils
.
isEmpty
(
astPoolEntity
.
getProdNo
())){
astPoolEntity
.
setProdNo
(
astPoolOprParam
.
getAstType
Code
());
astPoolEntity
.
setProdNo
(
astPoolOprParam
.
getAstType
());
}
astPoolEntity
.
setAstPoolNo
(
SequenceUtil
.
genId
(
IdTypeEnum
.
AST_POOL_CODE
));
astPoolEntity
.
setAstPoolName
(
astPoolOprParam
.
getAstPoolName
());
VarChecker
.
checkArgument
(
astPoolRepository
.
checkAstPool
(
astPoolEntity
),
"资产池名称/资产池编号重复"
);
//创建默认资产包
astPackManager
.
craeteDefaultPack
(
astPool
OprParam
.
getProdNo
(),
astPoolEntity
.
getAstTypeEnum
());
astPackManager
.
craeteDefaultPack
(
astPool
Entity
.
getAstPoolNo
(),
astPoolEntity
.
getAstTypeEnum
(),
astPoolEntity
.
getProdNo
());
return
astPoolRepository
.
create
(
astPoolEntity
);
});
}
/**
* 分页查询资产池列表
* @param astPoolPageQryParam
* @return
*/
@Override
public
BasePage
<
AstPoolVO
>
page
(
@Valid
AstPoolPageQryParam
astPoolPageQryParam
)
{
return
super
.
doQry
(
astPoolPageQryParam
,()->{
...
...
@@ -62,6 +72,11 @@ public class AstPoolServiceImpl extends ServiceSupport implements AstPoolService
}
/**
* 查询资产池详情
* @param astPoolNo
* @return
*/
@Override
public
AstPoolVO
get
(
String
astPoolNo
)
{
return
super
.
doQry
(
new
BaseStringParam
(
astPoolNo
),()->{
...
...
app/common/dal/dalgen/AbssqrCoreTables/ABS_AST_POOL.xml
View file @
af0f00bb
...
...
@@ -30,7 +30,7 @@
, #{astPoolNo,jdbcType=VARCHAR}
, sysdate
, #{astPoolName,jdbcType=VARCHAR}
, #{astType
Code
,jdbcType=VARCHAR}
, #{astType,jdbcType=VARCHAR}
, #{prodNo,jdbcType=VARCHAR}
, sysdate
)
...
...
@@ -55,7 +55,7 @@
, #{item.astPoolNo,jdbcType=VARCHAR}
, sysdate
, #{item.astPoolName,jdbcType=VARCHAR}
, #{item.astType
Code
,jdbcType=VARCHAR}
, #{item.astType,jdbcType=VARCHAR}
, #{item.prodNo,jdbcType=VARCHAR}
, sysdate
)
...
...
@@ -69,7 +69,7 @@
SET
AST_POOL_NO = #{astPoolNo,jdbcType=VARCHAR}
,AST_POOL_NAME = #{astPoolName,jdbcType=VARCHAR}
,AST_TYPE = #{astType
Code
,jdbcType=VARCHAR}
,AST_TYPE = #{astType,jdbcType=VARCHAR}
,GMT_MODIFIED = sysdate
WHERE
ID = #{id,jdbcType=DECIMAL}
...
...
@@ -82,7 +82,7 @@
SELECT COUNT(1) AS cnt
FROM ABS_AST_POOL
WHERE AST_POOL_NAME = #{astPoolName,jdbcType=VARCHAR}
OR
AST_POOL_NO= #{astPool
No,jdbcType=VARCHAR}
OR
PROD_NO= #{prod
No,jdbcType=VARCHAR}
]]>
</operation>
...
...
app/common/dal/src/main/java/com/abssqr/plat/common/dal/mysql/auto/dao/AstPoolDAO.java
View file @
af0f00bb
...
...
@@ -40,13 +40,13 @@ public class AstPoolDAO{
}
/**
* desc:查询是否有重复资产池名称和资产池编码的资产池.<br/>
* @param
astPoolNo astPool
No
* @param
prodNo prod
No
* @param astPoolName astPoolName
* @return Long
*/
public
Long
getDupliCnt
(
String
astPool
No
,
String
astPoolName
){
return
astPoolDOMapper
.
getDupliCnt
(
astPool
No
,
astPoolName
);
public
Long
getDupliCnt
(
String
prod
No
,
String
astPoolName
){
return
astPoolDOMapper
.
getDupliCnt
(
prod
No
,
astPoolName
);
}
/**
* desc:分页查找资产池.<br/>
...
...
app/common/dal/src/main/java/com/abssqr/plat/common/dal/mysql/auto/mapper/AstPoolDOMapper.java
View file @
af0f00bb
...
...
@@ -27,11 +27,11 @@ public interface AstPoolDOMapper{
int
insertBatch
(
List
<
AstPoolDO
>
list
);
/**
* desc:查询是否有重复资产池名称和资产池编码的资产池.<br/>
* @param
astPoolNo astPool
No
* @param
prodNo prod
No
* @param astPoolName astPoolName
* @return Long
*/
Long
getDupliCnt
(
@Param
(
"
astPoolNo"
)
String
astPool
No
,
@Param
(
"astPoolName"
)
String
astPoolName
);
Long
getDupliCnt
(
@Param
(
"
prodNo"
)
String
prod
No
,
@Param
(
"astPoolName"
)
String
astPoolName
);
/**
* desc:分页查找资产池.<br/>
* @param astPool astPool
...
...
app/common/dal/src/main/resources/com/abssqr/plat/common/dal/mysql/auto/mapper/AstPoolDOMapper.xml
View file @
af0f00bb
...
...
@@ -41,7 +41,7 @@
, #{astPoolNo,jdbcType=VARCHAR}
, sysdate
, #{astPoolName,jdbcType=VARCHAR}
, #{astType
Code
,jdbcType=VARCHAR}
, #{astType,jdbcType=VARCHAR}
, #{prodNo,jdbcType=VARCHAR}
, sysdate
)
...
...
@@ -66,7 +66,7 @@
, #{item.astPoolNo,jdbcType=VARCHAR}
, sysdate
, #{item.astPoolName,jdbcType=VARCHAR}
, #{item.astType
Code
,jdbcType=VARCHAR}
, #{item.astType,jdbcType=VARCHAR}
, #{item.prodNo,jdbcType=VARCHAR}
, sysdate
)
...
...
@@ -80,7 +80,7 @@
SELECT /*MS-ABS-AST-POOL-GETDUPLICNT*/ COUNT(1) AS cnt
FROM ABS_AST_POOL
WHERE AST_POOL_NAME = #{astPoolName,jdbcType=VARCHAR}
OR
AST_POOL_NO= #{astPool
No,jdbcType=VARCHAR}
OR
PROD_NO= #{prod
No,jdbcType=VARCHAR}
]]>
</select>
...
...
app/common/facade/src/main/java/com/abssqr/plat/common/facade/enums/AstScreenRelTypeEnum.java
View file @
af0f00bb
...
...
@@ -16,9 +16,7 @@ import java.util.Map;
* @version com.abssqr.plat.common.facade.enums: AstScreenRelTypeEnum.java, v 0.1 2020-04-18 6:30 PM xiachenxiang Exp $
*/
public
enum
AstScreenRelTypeEnum
implements
IEnum
{
PACK
(
"PACK"
,
"资产打包"
),
;
PACK
(
"PACK"
,
"资产打包"
);
private
static
final
Map
<
String
,
AstScreenRelTypeEnum
>
codeMap
=
new
HashMap
<
String
,
AstScreenRelTypeEnum
>();
...
...
app/common/facade/src/main/java/com/abssqr/plat/common/facade/param/astPool/AstPoolOprParam.java
View file @
af0f00bb
...
...
@@ -11,7 +11,7 @@ public class AstPoolOprParam extends BaseOprParam{
private
String
astPoolName
;
@VldEnums
(
enumClass
=
AstTypeEnum
.
class
,
message
=
"不支持的资产类型"
)
private
String
astType
Code
;
private
String
astType
;
@VldString
(
nullable
=
true
,
maxLength
=
30
)
private
String
prodNo
;
...
...
@@ -24,12 +24,12 @@ public class AstPoolOprParam extends BaseOprParam{
this
.
astPoolName
=
astPoolName
;
}
public
String
getAstType
Code
()
{
return
astType
Code
;
public
String
getAstType
()
{
return
astType
;
}
public
void
setAstType
Code
(
String
astTypeCod
e
)
{
this
.
astType
Code
=
astTypeCod
e
;
public
void
setAstType
(
String
astTyp
e
)
{
this
.
astType
=
astTyp
e
;
}
public
String
getProdNo
()
{
...
...
app/common/model/src/main/java/com/abssqr/plat/common/model/convertor/web/AstPackParamConvert.java
View file @
af0f00bb
...
...
@@ -41,7 +41,7 @@ public class AstPackParamConvert {
result
.
getScreenRuleList
().
add
(
rule
);
//relNo 关联编号
rule
.
setRelNo
(
param
.
getPackNo
());
//relType 关联类型 1.资产打包 PACK
//relType 关联类型 1.资产打包 PACK
,2数据仓库 DW
rule
.
setRelType
(
AstScreenRelTypeEnum
.
PACK
);
//ruleType 规则类型
rule
.
setRuleType
(
AstScreenRuleTypeEnum
.
getByCode
(
item
.
getRuleType
()));
...
...
app/common/model/src/main/java/com/abssqr/plat/common/model/repo/astPool/impl/AstPoolRepositoryImpl.java
View file @
af0f00bb
...
...
@@ -48,7 +48,7 @@ public class AstPoolRepositoryImpl implements AstPoolRepository {
@Override
public
boolean
checkAstPool
(
AstPoolEntity
astPoolEntity
)
{
Long
dupliCnt
=
astPoolDAO
.
getDupliCnt
(
astPoolEntity
.
get
AstPoolNo
(),
astPoolEntity
.
getAstPoolName
());
Long
dupliCnt
=
astPoolDAO
.
getDupliCnt
(
astPoolEntity
.
get
ProdNo
(),
astPoolEntity
.
getAstPoolName
());
if
(
dupliCnt
!=
null
&&
dupliCnt
>
1
){
return
false
;
}
...
...
app/core/service/src/main/java/com/abssqr/plat/core/service/ast/AstPackManager.java
View file @
af0f00bb
...
...
@@ -5,9 +5,8 @@
package
com
.
abssqr
.
plat
.
core
.
service
.
ast
;
import
com.abssqr.plat.common.facade.enums.AstPackStatusEnum
;
import
com.abssqr.plat.common.facade.enums.AstPackTypeEnum
;
import
com.abssqr.plat.common.facade.enums.CommonTaskTypeEnum
;
import
com.abssqr.plat.common.facade.enums.*
;
import
com.abssqr.plat.common.facade.model.rule.AstScreenRule
;
import
com.abssqr.plat.common.facade.param.ast.AstPackOprParam
;
import
com.abssqr.plat.common.model.convertor.web.AstPackParamConvert
;
import
com.abssqr.plat.common.model.domain.ast.AstPack
;
...
...
@@ -18,9 +17,12 @@ import com.abssqr.plat.common.model.repo.task.CommonTaskRepository;
import
com.abssqr.plat.core.service.util.CommonTaskUtil
;
import
com.general.system.common.util.VarChecker
;
import
org.assertj.core.util.Lists
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
/**
* @author xiachenxiang
* @version com.abssqr.plat.core.service.ast: AstPackManager.java, v 0.1 2020-04-18 4:16 PM xiachenxiang Exp $
...
...
@@ -59,12 +61,34 @@ public class AstPackManager {
return
param
.
getPackNo
();
}
public
void
craeteDefaultPack
(
String
astPoolNo
)
{
/**
* 创建产品默认的资产池
* @param astPoolNo
* @param astTypeEnum
*/
public
void
craeteDefaultPack
(
String
astPoolNo
,
AstTypeEnum
astTypeEnum
,
String
prodNo
)
{
AstPack
astPack
=
new
AstPack
();
astPack
.
setAstPoolNo
(
astPoolNo
);
astPack
.
setPackNo
(
astPoolNo
);
astPack
.
setPackType
(
AstPackTypeEnum
.
DEFAULT
);
astPack
.
setStatus
(
AstPackStatusEnum
.
INIT
);
astPack
.
setAstType
(
astTypeEnum
);
createDefaultScreenRule
(
prodNo
,
astPack
.
getPackNo
());
astPackRepository
.
insert
(
astPack
);
}
/**
* 创建产品默认的筛选规则(去数据仓库筛选产品编码对应的的资产)
* @param prodNo
* @param packNo
*/
//TODO 加筛选规则
public
void
createDefaultScreenRule
(
String
prodNo
,
String
packNo
){
AstScreenRule
astScreenRule
=
new
AstScreenRule
();
astScreenRule
.
setRelNo
(
packNo
);
astScreenRule
.
setRelType
(
AstScreenRelTypeEnum
.
PACK
);
astScreenRule
.
setRightCondition
(
AstScRuleRightCondEnum
.
eq
);
astScreenRule
.
setRightValue
(
prodNo
);
astScreenRuleRepo
.
insertBatch
(
Lists
.
newArrayList
(
astScreenRule
));
}
}
Write
Preview
Markdown
is supported
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