Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
asset-distribution
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
data-spider
asset-distribution
Commits
8909822d
Commit
8909822d
authored
Jul 29, 2019
by
liwenbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加日志
parent
a5406afd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
AssetController.java
...tgroup/asset/distribution/controller/AssetController.java
+4
-1
AssetServiceImpl.java
...set/distribution/service/asset/impl/AssetServiceImpl.java
+12
-2
No files found.
src/main/java/com/quantgroup/asset/distribution/controller/AssetController.java
View file @
8909822d
...
@@ -38,7 +38,10 @@ public class AssetController {
...
@@ -38,7 +38,10 @@ public class AssetController {
String
authKey
=
request
.
getHeader
(
"as_auth_key"
);
String
authKey
=
request
.
getHeader
(
"as_auth_key"
);
log
.
info
(
"资产入库分发开始, assetForm : {}, authKey : {}"
,
JSON
.
toJSONString
(
assetForm
),
authKey
);
log
.
info
(
"资产入库分发开始, assetForm : {}, authKey : {}"
,
JSON
.
toJSONString
(
assetForm
),
authKey
);
boolean
check
=
assetService
.
checkAssetForm
(
assetForm
);
boolean
check
=
assetService
.
checkAssetForm
(
assetForm
);
if
(!
check
)
{
return
GlobalResponse
.
create
(
AssetResponse
.
ASSET_FORM_IS_ERROR
);
}
if
(!
check
)
{
log
.
info
(
"资产入库入参错误, assetForm : {}, authKey : {}, 耗时 : {}"
,
JSON
.
toJSONString
(
assetForm
),
authKey
,
stopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
return
GlobalResponse
.
create
(
AssetResponse
.
ASSET_FORM_IS_ERROR
);
}
assetService
.
assetsIn
(
assetForm
);
assetService
.
assetsIn
(
assetForm
);
log
.
info
(
"资产入库分发结束, assetForm : {}, authKey : {}, response : {}, 耗时 : {}"
,
JSON
.
toJSONString
(
assetForm
),
authKey
,
JSON
.
toJSONString
(
AssetResponse
.
SUCCESS
),
stopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
log
.
info
(
"资产入库分发结束, assetForm : {}, authKey : {}, response : {}, 耗时 : {}"
,
JSON
.
toJSONString
(
assetForm
),
authKey
,
JSON
.
toJSONString
(
AssetResponse
.
SUCCESS
),
stopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
return
GlobalResponse
.
create
(
AssetResponse
.
SUCCESS
);
return
GlobalResponse
.
create
(
AssetResponse
.
SUCCESS
);
...
...
src/main/java/com/quantgroup/asset/distribution/service/asset/impl/AssetServiceImpl.java
View file @
8909822d
...
@@ -94,10 +94,14 @@ public class AssetServiceImpl implements IAssetService{
...
@@ -94,10 +94,14 @@ public class AssetServiceImpl implements IAssetService{
@Override
@Override
public
boolean
checkAssetForm
(
AssetForm
assetForm
)
{
public
boolean
checkAssetForm
(
AssetForm
assetForm
)
{
// auditResult和deadLine必填
// auditResult和deadLine必填
if
(
StringUtils
.
isEmpty
(
assetForm
.
getAuditResult
())
||
StringUtils
.
isEmpty
(
assetForm
.
getDeadLine
()))
{
return
false
;
}
if
(
StringUtils
.
isEmpty
(
assetForm
.
getAuditResult
())
||
StringUtils
.
isEmpty
(
assetForm
.
getDeadLine
()))
{
log
.
info
(
"资产入库auditResult或deadLine为空, uuid : {}, bizNo : {}"
,
assetForm
.
getUuid
(),
assetForm
.
getBizNo
());
return
false
;
}
if
(
"true"
.
equals
(
assetForm
.
getAuditResult
()))
{
if
(
"true"
.
equals
(
assetForm
.
getAuditResult
()))
{
if
(
StringUtils
.
isEmpty
(
assetForm
.
getFinanceProducts
())
||
StringUtils
.
isEmpty
(
assetForm
.
getAmount
()))
{
if
(
StringUtils
.
isEmpty
(
assetForm
.
getFinanceProducts
())
||
StringUtils
.
isEmpty
(
assetForm
.
getAmount
()))
{
// auditResult为true,金融产品集和amount不能为空
// auditResult为true,金融产品集和amount不能为空
log
.
info
(
"资产入库auditResult为true时, 金融产品集或amount为空, uuid : {}, bizNo : {}"
,
assetForm
.
getUuid
(),
assetForm
.
getBizNo
());
return
false
;
return
false
;
}
}
BigDecimal
amount
=
new
BigDecimal
(
assetForm
.
getAmount
());
BigDecimal
amount
=
new
BigDecimal
(
assetForm
.
getAmount
());
...
@@ -110,6 +114,7 @@ public class AssetServiceImpl implements IAssetService{
...
@@ -110,6 +114,7 @@ public class AssetServiceImpl implements IAssetService{
BigDecimal
cha
=
max
.
subtract
(
min
);
BigDecimal
cha
=
max
.
subtract
(
min
);
// 0 <= max - min <= 1
// 0 <= max - min <= 1
if
(!(
cha
.
compareTo
(
BigDecimal
.
ZERO
)
>
-
1
&&
cha
.
compareTo
(
BigDecimal
.
ONE
)
<
1
))
{
if
(!(
cha
.
compareTo
(
BigDecimal
.
ZERO
)
>
-
1
&&
cha
.
compareTo
(
BigDecimal
.
ONE
)
<
1
))
{
log
.
info
(
"资产入库,金融产品集不符合(0 <= max - min <= 1)规则, uuid : {}, bizNo : {}"
,
assetForm
.
getUuid
(),
assetForm
.
getBizNo
());
return
false
;
return
false
;
}
}
if
(
floor
==
null
||
min
.
compareTo
(
floor
)
<
0
)
{
if
(
floor
==
null
||
min
.
compareTo
(
floor
)
<
0
)
{
...
@@ -117,7 +122,8 @@ public class AssetServiceImpl implements IAssetService{
...
@@ -117,7 +122,8 @@ public class AssetServiceImpl implements IAssetService{
}
}
}
}
// amount >= floor
// amount >= floor
if
(
amount
.
compareTo
(
floor
)
<
1
)
{
if
(
amount
.
compareTo
(
floor
)
<
0
)
{
log
.
info
(
"资产入库,金融产品及不符合(amount >= floor)规则, uuid : {}, bizNo : {}"
,
assetForm
.
getUuid
(),
assetForm
.
getBizNo
());
return
false
;
return
false
;
}
}
}
}
...
@@ -133,5 +139,9 @@ public class AssetServiceImpl implements IAssetService{
...
@@ -133,5 +139,9 @@ public class AssetServiceImpl implements IAssetService{
}
else
{
}
else
{
System
.
out
.
println
(
false
);
System
.
out
.
println
(
false
);
}
}
BigDecimal
amount
=
new
BigDecimal
(
"10000"
);
BigDecimal
floor
=
new
BigDecimal
(
"9999"
);
System
.
out
.
println
(
amount
.
compareTo
(
floor
));
}
}
}
}
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