记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
33abfb67
Commit
33abfb67
authored
Jan 17, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交 资金接口
parent
c4fac190
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
18 deletions
+50
-18
IGoblinStoreMoneyService.java
...rvice/goblin/service/manage/IGoblinStoreMoneyService.java
+2
-1
GoblinStoreMoneyController.java
.../goblin/controller/manage/GoblinStoreMoneyController.java
+6
-2
GoblinStoreMoneyServiceImpl.java
...blin/service/impl/manage/GoblinStoreMoneyServiceImpl.java
+8
-3
GoblinMongoUtils.java
...a/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
+34
-12
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/service/manage/IGoblinStoreMoneyService.java
View file @
33abfb67
...
...
@@ -9,10 +9,11 @@ import org.springframework.web.bind.annotation.RequestParam;
import
javax.validation.Valid
;
import
java.math.BigDecimal
;
import
java.util.HashMap
;
public
interface
IGoblinStoreMoneyService
{
ResponseDto
<
BigDecimal
>
money
(
);
ResponseDto
<
HashMap
<
String
,
String
>>
money
(
String
spuId
);
ResponseDto
<
PageInfo
<
GoblinOrderLogVo
>>
getSpuList
(
String
spuName
,
String
st
,
String
et
,
int
page
);
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/manage/GoblinStoreMoneyController.java
View file @
33abfb67
...
...
@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import
org.springframework.web.bind.annotation.RestController
;
import
java.math.BigDecimal
;
import
java.util.HashMap
;
@ApiSupport
(
order
=
149102
)
...
...
@@ -29,9 +30,12 @@ public class GoblinStoreMoneyController {
@GetMapping
(
"money"
)
@ApiOperation
(
"商品资金总收入"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"spuId"
,
value
=
"spuId"
),
})
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
public
ResponseDto
<
BigDecimal
>
money
(
)
{
return
goblinStoreMoneyService
.
money
();
public
ResponseDto
<
HashMap
<
String
,
String
>>
money
(
@RequestParam
(
value
=
"spuId"
,
required
=
false
)
String
spuId
)
{
return
goblinStoreMoneyService
.
money
(
spuId
);
}
@GetMapping
(
"spu/list"
)
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinStoreMoneyServiceImpl.java
View file @
33abfb67
package
com
.
liquidnet
.
service
.
goblin
.
service
.
impl
.
manage
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.vo.GoblinOrderLogVo
;
...
...
@@ -24,14 +25,18 @@ public class GoblinStoreMoneyServiceImpl implements IGoblinStoreMoneyService {
GoblinMongoUtils
mongoUtils
;
@Override
public
ResponseDto
<
BigDecimal
>
money
(
)
{
public
ResponseDto
<
HashMap
<
String
,
String
>>
money
(
String
spuId
)
{
String
uid
=
CurrentUtil
.
getCurrentUid
();
GoblinStoreInfoVo
vo
=
redisUtils
.
getStoreInfoVoByUid
(
uid
);
if
(
vo
==
null
)
{
return
ResponseDto
.
failure
(
"店铺不存在"
);
}
BigDecimal
price
=
mongoUtils
.
storeMoney
(
vo
.
getStoreId
());
return
ResponseDto
.
success
(
price
);
String
data
=
mongoUtils
.
storeMoney
(
vo
.
getStoreId
(),
spuId
);
String
[]
array
=
data
.
split
(
","
);
HashMap
<
String
,
String
>
map
=
CollectionUtil
.
mapStringString
();
map
.
put
(
"name"
,
array
[
0
]);
map
.
put
(
"price"
,
array
[
1
]);
return
ResponseDto
.
success
(
map
);
}
@Override
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
View file @
33abfb67
...
...
@@ -504,7 +504,7 @@ public class GoblinMongoUtils {
}
//修改 订单退款数据
public
UpdateResult
updateGoblinBackOrderVo
(
String
backOrderId
,
GoblinBackOrderVo
data
)
{
public
UpdateResult
updateGoblinBackOrderVo
(
String
backOrderId
,
GoblinBackOrderVo
data
)
{
BasicDBObject
object
=
ObjectUtil
.
cloneBasicDBObject
().
append
(
"$set"
,
mongoConverter
.
convertToMongoType
(
data
));
return
mongoTemplate
.
getCollection
(
GoblinBackOrderVo
.
class
.
getSimpleName
()).
updateOne
(
Query
.
query
(
Criteria
.
where
(
"backOrderId"
).
is
(
backOrderId
)).
getQueryObject
(),
...
...
@@ -517,19 +517,41 @@ public class GoblinMongoUtils {
}
//店铺总收入
public
BigDecimal
storeMoney
(
String
storeId
)
{
public
String
storeMoney
(
String
storeId
,
String
spuId
)
{
String
spuName
=
"店铺总收入"
;
Criteria
criteria
=
Criteria
.
where
(
"status"
).
in
(
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_11
.
getValue
(),
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_22
.
getValue
(),
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_28
.
getValue
()).
and
(
"storeId"
).
is
(
storeId
);
Aggregation
aggregation
=
Aggregation
.
newAggregation
(
Aggregation
aggregation
;
if
(
spuId
!=
null
)
{
criteria
=
criteria
.
and
(
"spuId"
).
is
(
spuId
);
Query
query
=
Query
.
query
(
Criteria
.
where
(
"spuId"
).
is
(
spuId
));
query
.
fields
().
include
(
"name"
);
GoblinGoodsInfoVo
spuIdAndName
=
mongoTemplate
.
findOne
(
query
,
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
if
(
spuIdAndName
==
null
)
{
return
","
+
BigDecimal
.
ZERO
;
}
else
{
spuName
=
spuIdAndName
.
getName
();
}
aggregation
=
Aggregation
.
newAggregation
(
Aggregation
.
match
(
criteria
),
Aggregation
.
group
(
"spuId"
)
.
first
(
"spuId"
).
as
(
"spuId"
)
.
first
(
"skuPriceActual"
).
as
(
"skuPriceActual"
)
.
sum
(
"skuPriceActualBig"
).
as
(
"skuPriceActualBig"
));
}
else
{
aggregation
=
Aggregation
.
newAggregation
(
Aggregation
.
match
(
criteria
),
Aggregation
.
group
(
"storeId"
)
.
first
(
"storeId"
).
as
(
"storeId"
)
.
first
(
"skuPriceActual"
).
as
(
"skuPriceActual"
)
.
sum
(
"skuPriceActualBig"
).
as
(
"skuPriceActualBig"
)
);
.
sum
(
"skuPriceActualBig"
).
as
(
"skuPriceActualBig"
));
}
AggregationResults
<
GoblinOrderLogVo
>
outputType
=
mongoTemplate
.
aggregate
(
aggregation
,
GoblinOrderLogVo
.
class
.
getSimpleName
(),
GoblinOrderLogVo
.
class
);
List
<
GoblinOrderLogVo
>
dataList
=
new
ArrayList
(
outputType
.
getMappedResults
());
return
dataList
.
get
(
0
).
getSkuPriceActualBig
();
if
(
dataList
.
size
()
>
0
)
{
return
spuName
+
","
+
dataList
.
get
(
0
).
getSkuPriceActualBig
();
}
else
{
return
","
+
BigDecimal
.
ZERO
;
}
}
//资金列表
...
...
@@ -541,7 +563,7 @@ public class GoblinMongoUtils {
Criteria
criteria
=
Criteria
.
where
(
"status"
).
in
(
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_11
.
getValue
(),
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_22
.
getValue
(),
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_28
.
getValue
()).
and
(
"storeId"
).
is
(
storeId
);
if
(
spuName
!=
null
)
{
//根据spu名称查询spuId
Query
query
=
Query
.
query
(
Criteria
.
where
(
"name"
).
regex
(
".*?"
+
spuName
+
".*"
).
and
(
"storeId"
).
is
(
storeId
));
Query
query
=
Query
.
query
(
Criteria
.
where
(
"name"
).
regex
(
".*?"
+
spuName
+
".*"
).
and
(
"storeId"
).
is
(
storeId
));
query
.
fields
().
include
(
"spuId"
).
include
(
"name"
);
spuIdAndName
=
mongoTemplate
.
find
(
query
,
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
criteria
=
criteria
.
and
(
"spuId"
).
in
(
spuIdAndName
.
stream
().
map
(
GoblinGoodsInfoVo:
:
getSpuId
).
collect
(
Collectors
.
toList
()));
...
...
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