记得上下班打卡 | 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
e8b557d5
Commit
e8b557d5
authored
Mar 23, 2022
by
周焕
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pre' into 'master'
Pre See merge request
!199
parents
447ae015
a2f16442
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
389 additions
and
174 deletions
+389
-174
IGoblinOrderAppService.java
...uidnet/service/goblin/service/IGoblinOrderAppService.java
+1
-1
IGoblinOrderService.java
...liquidnet/service/goblin/service/IGoblinOrderService.java
+4
-0
IGoblinStoreMoneyService.java
...rvice/goblin/service/manage/IGoblinStoreMoneyService.java
+1
-1
GoblinSelfCategoryAdminController.java
...er/zhengzai/goblin/GoblinSelfCategoryAdminController.java
+1
-0
liquidnet-service-order.yml
...t-bus-config/liquidnet-config/liquidnet-service-order.yml
+1
-0
GoblinStoreZhengzaiController.java
...vice/goblin/controller/GoblinStoreZhengzaiController.java
+6
-6
GoblinStoreMgtGoodsController.java
...blin/controller/manage/GoblinStoreMgtGoodsController.java
+1
-1
GoblinStoreMoneyController.java
.../goblin/controller/manage/GoblinStoreMoneyController.java
+6
-2
GoblinFrontServiceImpl.java
...t/service/goblin/service/impl/GoblinFrontServiceImpl.java
+1
-1
GoblinOrderAppServiceImpl.java
...ervice/goblin/service/impl/GoblinOrderAppServiceImpl.java
+129
-126
GoblinStoreMoneyServiceImpl.java
...blin/service/impl/manage/GoblinStoreMoneyServiceImpl.java
+2
-2
GoblinMongoUtils.java
...a/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
+24
-10
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+3
-3
GoblinOrderController.java
...idnet/service/order/controller/GoblinOrderController.java
+8
-0
GoblinOrderServiceImpl.java
...et/service/order/service/impl/GoblinOrderServiceImpl.java
+135
-3
PlatformGoblinGoodsTaskController.java
...roller/goblin/task/PlatformGoblinGoodsTaskController.java
+1
-1
DataController.java
...net/service/platform/controller/kylin/DataController.java
+6
-6
PlatformGoblinGoodsService.java
...tform/service/impl/goblin/PlatformGoblinGoodsService.java
+8
-2
DataImpl.java
...quidnet/service/platform/service/impl/kylin/DataImpl.java
+51
-9
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/service/IGoblinOrderAppService.java
View file @
e8b557d5
...
...
@@ -24,7 +24,7 @@ public interface IGoblinOrderAppService {
ResponseDto
<
List
<
GoblinBackOrderVo
>>
refundDetails
(
String
orderId
);
String
huiFuSync
(
HttpServletRequest
request
);
//
String huiFuSync(HttpServletRequest request);
ResponseDto
<
List
<
GoblinMailVo
>>
getMail
(
String
orderId
,
String
mailId
);
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/service/IGoblinOrderService.java
View file @
e8b557d5
...
...
@@ -8,6 +8,7 @@ import com.liquidnet.service.goblin.param.PayAgainParam;
import
com.liquidnet.service.goblin.param.RefundCallbackParam
;
import
com.liquidnet.service.goblin.param.SyncOrderParam
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
public
interface
IGoblinOrderService
{
...
...
@@ -24,4 +25,7 @@ public interface IGoblinOrderService {
ResponseDto
<
Integer
>
checkOrderResultMaterCode
(
String
materCode
);
String
huiFuSync
(
HttpServletRequest
request
);
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/service/manage/IGoblinStoreMoneyService.java
View file @
e8b557d5
...
...
@@ -13,7 +13,7 @@ import java.util.HashMap;
public
interface
IGoblinStoreMoneyService
{
ResponseDto
<
HashMap
<
String
,
String
>>
money
(
String
spuId
);
ResponseDto
<
HashMap
<
String
,
String
>>
money
(
String
spuId
,
String
st
,
String
et
);
ResponseDto
<
PageInfo
<
GoblinOrderLogVo
>>
getSpuList
(
String
spuName
,
String
st
,
String
et
,
int
page
);
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/goblin/GoblinSelfCategoryAdminController.java
View file @
e8b557d5
...
...
@@ -76,6 +76,7 @@ public class GoblinSelfCategoryAdminController extends BaseController {
return
AjaxResult
.
warn
(
"无效参数"
);
}
queryWrapper
.
eq
(
GoblinSelfGoodsCategory:
:
getGrade
,
grade
);
queryWrapper
.
eq
(
GoblinSelfGoodsCategory:
:
getDelFlg
,
"0"
);
queryWrapper
.
select
(
GoblinSelfGoodsCategory:
:
getCateId
,
GoblinSelfGoodsCategory:
:
getName
,
GoblinSelfGoodsCategory:
:
getIcon
,
GoblinSelfGoodsCategory:
:
getNeIsbn
);
queryWrapper
.
orderByAsc
(
GoblinSelfGoodsCategory:
:
getCateId
);
...
...
liquidnet-bus-config/liquidnet-config/liquidnet-service-order.yml
View file @
e8b557d5
...
...
@@ -102,6 +102,7 @@ global-auth:
-
${liquidnet.info.context}/order/syncOrder
-
${liquidnet.info.context}/goblin/syncOrder
-
${liquidnet.info.context}/goblin/refundSyncOrder
-
${liquidnet.info.context}/goblin/paySuccess
# -----------------------------------------------------------
# -----------------------------------------------------------
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinStoreZhengzaiController.java
View file @
e8b557d5
...
...
@@ -79,10 +79,10 @@ public class GoblinStoreZhengzaiController {
return
goblinOrderAppService
.
orderDetails
(
orderId
,
null
);
}
@PostMapping
(
"paySuccess"
)
@ApiOperation
(
"汇付支付成功回调"
)
@ResponseBody
public
String
refundDetails
(
HttpServletRequest
request
)
{
return
goblinOrderAppService
.
huiFuSync
(
request
);
}
//
@PostMapping("paySuccess")
//
@ApiOperation("汇付支付成功回调")
//
@ResponseBody
//
public String refundDetails(HttpServletRequest request) {
//
return goblinOrderAppService.huiFuSync(request);
//
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/manage/GoblinStoreMgtGoodsController.java
View file @
e8b557d5
...
...
@@ -280,7 +280,7 @@ public class GoblinStoreMgtGoodsController {
{
// 标签处理
List
<
String
>
goodsTagIdList
=
storeMgtGoodsAddParam
.
getTagList
(),
goodsExtagIdList
=
storeMgtGoodsAddParam
.
getExtagList
(),
goodsArtagIdList
=
storeMgtGoodsAddParam
.
get
Ex
tagList
();
goodsArtagIdList
=
storeMgtGoodsAddParam
.
get
Ar
tagList
();
if
(!
CollectionUtils
.
isEmpty
(
goodsTagIdList
))
{
List
<
GoblinSelfTagVo
>
selfGoodsTagVos
=
goblinRedisUtils
.
getSelfTagVos
();
List
<
GoblinGoodsTagVo
>
goodsTagVoList
=
ObjectUtil
.
getGoblinGoodsTagVoArrayList
();
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/manage/GoblinStoreMoneyController.java
View file @
e8b557d5
...
...
@@ -32,10 +32,14 @@ public class GoblinStoreMoneyController {
@ApiOperation
(
"商品资金总收入"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"spuId"
,
value
=
"spuId"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"st"
,
value
=
"开始时间"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"et"
,
value
=
"截至时间"
),
})
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
public
ResponseDto
<
HashMap
<
String
,
String
>>
money
(
@RequestParam
(
value
=
"spuId"
,
required
=
false
)
String
spuId
)
{
return
goblinStoreMoneyService
.
money
(
spuId
);
public
ResponseDto
<
HashMap
<
String
,
String
>>
money
(
@RequestParam
(
value
=
"spuId"
,
required
=
false
)
String
spuId
,
@RequestParam
(
value
=
"st"
,
required
=
false
)
String
st
,
@RequestParam
(
value
=
"et"
,
required
=
false
)
String
et
)
{
return
goblinStoreMoneyService
.
money
(
spuId
,
st
,
et
);
}
@GetMapping
(
"spu/list"
)
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinFrontServiceImpl.java
View file @
e8b557d5
...
...
@@ -520,7 +520,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
Pattern
pattern
=
Pattern
.
compile
(
"^.*"
+
name
+
".*$"
,
Pattern
.
CASE_INSENSITIVE
);
query
.
addCriteria
(
Criteria
.
where
(
"name"
).
regex
(
pattern
));
}
query
.
with
(
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"
coun
t"
));
query
.
with
(
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"
shelvesA
t"
));
// 查询总数
List
<
GoblinGoodsInfoVo
>
list
=
mongoTemplate
.
find
(
query
,
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
// 计算库存
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinOrderAppServiceImpl.java
View file @
e8b557d5
This diff is collapsed.
Click to expand it.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinStoreMoneyServiceImpl.java
View file @
e8b557d5
...
...
@@ -25,13 +25,13 @@ public class GoblinStoreMoneyServiceImpl implements IGoblinStoreMoneyService {
GoblinMongoUtils
mongoUtils
;
@Override
public
ResponseDto
<
HashMap
<
String
,
String
>>
money
(
String
spuId
)
{
public
ResponseDto
<
HashMap
<
String
,
String
>>
money
(
String
spuId
,
String
st
,
String
et
)
{
String
uid
=
CurrentUtil
.
getCurrentUid
();
GoblinStoreInfoVo
vo
=
redisUtils
.
getStoreInfoVoByUid
(
uid
);
if
(
vo
==
null
)
{
return
ResponseDto
.
failure
(
"店铺不存在"
);
}
String
data
=
mongoUtils
.
storeMoney
(
vo
.
getStoreId
(),
spuId
);
String
data
=
mongoUtils
.
storeMoney
(
vo
.
getStoreId
(),
spuId
,
st
,
et
);
String
[]
array
=
data
.
split
(
","
);
HashMap
<
String
,
String
>
map
=
CollectionUtil
.
mapStringString
();
map
.
put
(
"name"
,
array
[
0
]);
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
View file @
e8b557d5
...
...
@@ -43,6 +43,8 @@ import java.util.List;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
import
static
com
.
liquidnet
.
commons
.
lang
.
util
.
DateUtil
.
DTF_YMD_HMS
;
@Component
public
class
GoblinMongoUtils
{
@Autowired
...
...
@@ -445,6 +447,7 @@ public class GoblinMongoUtils {
return
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"storeId"
).
is
(
storeId
).
and
(
"name"
).
is
(
name
).
and
(
"delFlg"
).
is
(
"0"
)),
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
}
public
long
countMgtGoodsInfoVo
(
String
name
)
{
return
mongoTemplate
.
count
(
Query
.
query
(
Criteria
.
where
(
"name"
).
is
(
name
).
and
(
"delFlg"
).
is
(
"0"
)),
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
...
...
@@ -806,9 +809,14 @@ public class GoblinMongoUtils {
}
//店铺总收入
public
String
storeMoney
(
String
storeId
,
String
spuId
)
{
public
String
storeMoney
(
String
storeId
,
String
spuId
,
String
st
,
String
et
)
{
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
);
if
(
st
!=
null
&&
et
!=
null
)
{
LocalDateTime
stDateTime
=
LocalDateTime
.
parse
(
st
,
DTF_YMD_HMS
);
LocalDateTime
etDateTime
=
LocalDateTime
.
parse
(
et
,
DTF_YMD_HMS
);
criteria
=
criteria
.
and
(
"createdAt"
).
gte
(
stDateTime
).
lt
(
etDateTime
);
}
Aggregation
aggregation
;
if
(
spuId
!=
null
)
{
criteria
=
criteria
.
and
(
"spuId"
).
is
(
spuId
);
...
...
@@ -857,10 +865,12 @@ public class GoblinMongoUtils {
List
<
GoblinGoodsInfoVo
>
spuIdAndName
=
null
;
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
(
st
!=
null
&&
et
!=
null
)
{
criteria
=
criteria
.
and
(
"createdAt"
).
gte
(
st
).
lt
(
et
);
LocalDateTime
stDateTime
=
LocalDateTime
.
parse
(
st
,
DTF_YMD_HMS
);
LocalDateTime
etDateTime
=
LocalDateTime
.
parse
(
et
,
DTF_YMD_HMS
);
criteria
=
criteria
.
and
(
"createdAt"
).
gte
(
stDateTime
).
lt
(
etDateTime
);
}
//查询总数量
Query
countQuery
=
Query
.
query
(
criteria
);
Query
countQuery
=
Query
.
query
(
criteria
)
.
with
(
Sort
.
by
(
Sort
.
Order
.
desc
(
"createdAt"
)))
;
countQuery
.
fields
().
include
(
"spuId"
);
List
<
GoblinOrderLogVo
>
countList
=
mongoTemplate
.
find
(
countQuery
,
GoblinOrderLogVo
.
class
,
GoblinOrderLogVo
.
class
.
getSimpleName
());
List
<
String
>
spuIdList
=
countList
.
stream
().
map
(
GoblinOrderLogVo:
:
getSpuId
).
distinct
().
collect
(
Collectors
.
toList
());
...
...
@@ -870,7 +880,7 @@ public class GoblinMongoUtils {
}
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
))
.
with
(
Sort
.
by
(
Sort
.
Order
.
desc
(
"createdAt"
)))
;
query
.
fields
().
include
(
"spuId"
).
include
(
"name"
);
spuIdAndName
=
mongoTemplate
.
find
(
query
,
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
spuIdList
=
spuIdAndName
.
stream
().
map
(
GoblinGoodsInfoVo:
:
getSpuId
).
collect
(
Collectors
.
toList
());
...
...
@@ -878,7 +888,7 @@ public class GoblinMongoUtils {
finalCount
=
spuIdList
.
size
();
}
}
if
(
finalCount
>
0
)
{
if
(
finalCount
>
0
)
{
spuIdList
=
spuIdList
.
subList
(
skipCount
,
finalCount
);
}
criteria
=
criteria
.
and
(
"spuId"
).
in
(
spuIdList
);
...
...
@@ -886,10 +896,12 @@ public class GoblinMongoUtils {
//查询聚合数据
Aggregation
aggregation
=
Aggregation
.
newAggregation
(
Aggregation
.
match
(
criteria
),
Aggregation
.
project
(
"spuId"
,
"skuPriceActual"
),
Aggregation
.
project
(
"spuId"
,
"skuPriceActual"
,
"orderType"
),
Aggregation
.
group
(
"spuId"
)
.
first
(
"spuId"
).
as
(
"spuId"
)
.
sum
(
"skuPriceActual"
).
as
(
"skuPriceActual"
)
.
first
(
"orderType"
).
as
(
"orderType"
)
.
sum
(
"skuPriceActual"
).
as
(
"skuPriceActual"
),
Aggregation
.
sort
(
Sort
.
by
(
Sort
.
Order
.
desc
(
"spuId"
)))
);
AggregationResults
<
GoblinOrderLogVo
>
outputType
=
mongoTemplate
.
aggregate
(
aggregation
,
GoblinOrderLogVo
.
class
.
getSimpleName
(),
GoblinOrderLogVo
.
class
);
List
<
GoblinOrderLogVo
>
dataList
=
new
ArrayList
(
outputType
.
getMappedResults
());
...
...
@@ -920,7 +932,9 @@ public class GoblinMongoUtils {
int
skipCount
=
((
page
-
1
)
*
size
);
Criteria
criteria
=
Criteria
.
where
(
"spuId"
).
is
(
spuId
);
if
(
st
!=
null
&&
et
!=
null
)
{
criteria
=
criteria
.
and
(
"createdAt"
).
gte
(
st
).
lt
(
et
);
LocalDateTime
stDateTime
=
LocalDateTime
.
parse
(
st
,
DTF_YMD_HMS
);
LocalDateTime
etDateTime
=
LocalDateTime
.
parse
(
et
,
DTF_YMD_HMS
);
criteria
=
criteria
.
and
(
"createdAt"
).
gte
(
stDateTime
).
lt
(
etDateTime
);
}
if
(
orderCode
!=
null
)
{
criteria
=
criteria
.
and
(
"orderCode"
).
is
(
orderCode
);
...
...
@@ -940,7 +954,7 @@ public class GoblinMongoUtils {
criteria
=
criteria
.
and
(
"orderType"
).
is
(
"zhengzai"
).
and
(
"status"
).
in
(
22
,
28
);
break
;
}
}
else
{
}
else
{
criteria
=
criteria
.
and
(
"status"
).
in
(
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_11
.
getValue
(),
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_22
.
getValue
(),
...
...
@@ -1192,7 +1206,7 @@ public class GoblinMongoUtils {
//根据艺人标签和演出查询商品
public
List
<
GoblinGoodsInfoVo
>
getMusicTagPGoods
(
String
musicTag
,
String
performanceId
)
{
Query
query
=
Query
.
query
(
Criteria
.
where
(
"
ex
tagVoList.tagName"
).
is
(
musicTag
)
Query
query
=
Query
.
query
(
Criteria
.
where
(
"
ar
tagVoList.tagName"
).
is
(
musicTag
)
.
and
(
"delFlg"
).
is
(
"0"
).
and
(
"shelvesStatus"
).
is
(
"3"
));
return
mongoTemplate
.
find
(
query
,
GoblinGoodsInfoVo
.
class
,
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
View file @
e8b557d5
...
...
@@ -1216,9 +1216,9 @@ public class GoblinRedisUtils {
// String rk = GoblinRedisConst.REDIS_ZZ_MUSIC_TAG.concat(musicTag + ":").concat(performanceId);
// Object obj = redisUtil.get(rk);
// if (obj == null) {
listVo
=
goblinMongoUtils
.
getMusicTagPGoods
(
musicTag
,
performanceId
);
// redisUtil.set(rk, listVo);
return
listVo
;
listVo
=
goblinMongoUtils
.
getMusicTagPGoods
(
musicTag
,
performanceId
);
// redisUtil.set(rk, listVo
, 60 * 30
);
return
listVo
;
// } else {
// return (List<GoblinGoodsInfoVo>) obj;
// }
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/controller/GoblinOrderController.java
View file @
e8b557d5
...
...
@@ -14,6 +14,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.validation.Valid
;
@Slf4j
...
...
@@ -53,6 +54,13 @@ public class GoblinOrderController {
return
goblinAppOrderService
.
refundSyncOrder
(
refundCallbackParam
);
}
@PostMapping
(
"paySuccess"
)
@ApiOperation
(
"汇付支付成功回调"
)
@ResponseBody
public
String
refundDetails
(
HttpServletRequest
request
)
{
return
goblinAppOrderService
.
huiFuSync
(
request
);
}
@PostMapping
(
"payAgain"
)
@ApiOperation
(
"再次支付"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/service/impl/GoblinOrderServiceImpl.java
View file @
e8b557d5
package
com
.
liquidnet
.
service
.
order
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.liquidnet.commons.lang.util.*
;
import
com.liquidnet.service.base.ErrorMapping
;
...
...
@@ -29,6 +30,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
import
javax.servlet.http.HttpServletRequest
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
...
...
@@ -37,8 +39,7 @@ import java.util.LinkedList;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
liquidnet
.
commons
.
lang
.
util
.
DateUtil
.
DTF_YMD_HMS
;
import
static
com
.
liquidnet
.
commons
.
lang
.
util
.
DateUtil
.
getNowTime
;
import
static
com
.
liquidnet
.
commons
.
lang
.
util
.
DateUtil
.*;
@Service
@Slf4j
...
...
@@ -385,7 +386,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
orderAttr
.
setOrderId
(
orderId
);
if
(!
writeOffCode
.
equals
(
"EMPTY"
))
{
orderAttr
.
setExpressContacts
(
addressesVo
.
getName
());
orderAttr
.
setExpressAddress
(
addressesVo
.
getProvince
()
+
"
,"
+
addressesVo
.
getCounty
()
+
","
+
addressesVo
.
getCi
ty
());
orderAttr
.
setExpressAddress
(
addressesVo
.
getProvince
()
+
"
"
+
addressesVo
.
getCity
()
+
" "
+
addressesVo
.
getCoun
ty
());
orderAttr
.
setExpressAddressDetail
(
addressesVo
.
getAddress
());
orderAttr
.
setExpressPhone
(
addressesVo
.
getPhone
());
orderAttr
.
setExpressType
(
1
);
...
...
@@ -1033,4 +1034,135 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
}
return
"success"
;
}
@Override
public
String
huiFuSync
(
HttpServletRequest
request
)
{
try
{
// 验签请参data
String
responseData
=
request
.
getParameter
(
"resp_data"
);
// 验签请参sign
String
sign
=
request
.
getParameter
(
"sign"
);
// 使用汇付公钥验签
// if (!RsaUtils.verify(responseData, PUBLIC_KEY, sign)) {
// // 验签失败处理
// return "";
// }
JSONObject
dataObj
=
JSON
.
parseObject
(
responseData
);
String
subRespCode
=
dataObj
.
getString
(
"sub_resp_code"
);
String
reqSeqId
=
dataObj
.
getString
(
"req_seq_id"
);
String
orderMasterCode
=
dataObj
.
getString
(
"mer_ord_id"
);
String
payCode
=
dataObj
.
getString
(
"mer_ord_id"
);
String
paymentType
=
dataObj
.
getString
(
"trans_type"
);
String
paymentId
=
dataObj
.
getString
(
"hf_seq_id"
);
String
paymentAt
=
dataObj
.
getString
(
"end_time"
);
if
(
"00000000"
.
equals
(
subRespCode
))
{
log
.
debug
(
"SYNC PARAM = "
+
responseData
);
//支付时间
LocalDateTime
now
=
LocalDateTime
.
now
();
String
[]
array
=
redisUtils
.
getMasterCode
(
orderMasterCode
);
String
uid
=
"zhengzai"
;
BigDecimal
priceActual
=
BigDecimal
.
ZERO
;
for
(
String
orderId
:
array
)
{
GoblinStoreOrderVo
orderVo
=
redisUtils
.
getGoblinOrder
(
orderId
);
if
(
orderVo
.
getStatus
()
==
GoblinStatusConst
.
Status
.
ORDER_STATUS_4
.
getValue
())
{
continue
;
}
uid
=
orderVo
.
getUserId
();
priceActual
=
priceActual
.
add
(
orderVo
.
getPriceActual
());
if
(
orderVo
==
null
)
{
log
.
error
(
"订单号:"
+
orderMasterCode
+
" 订单不存在"
);
return
"fail"
;
//订单不存在
}
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
LinkedList
<
Object
[]>
sqlDataOrder
=
CollectionUtil
.
linkedListObjectArr
();
LinkedList
<
Object
[]>
sqlDataSku
=
CollectionUtil
.
linkedListObjectArr
();
GoblinStoreOrder
storeOrder
=
GoblinStoreOrder
.
getNew
();
storeOrder
.
setPaymentType
(
paymentType
);
storeOrder
.
setPaymentId
(
paymentId
);
storeOrder
.
setPayCode
(
payCode
);
LocalDateTime
payTime
=
LocalDateTime
.
parse
(
paymentAt
,
DTFYMDHMS
);
storeOrder
.
setPayTime
(
payTime
);
if
(
orderVo
.
getWriteOffCode
().
equals
(
"EMPTY"
))
{
storeOrder
.
setWriteOffCode
(
IDGenerator
.
getWriteOffCode
());
}
else
{
storeOrder
.
setWriteOffCode
(
""
);
}
storeOrder
.
setStatus
(
GoblinStatusConst
.
Status
.
ORDER_STATUS_4
.
getValue
());
storeOrder
.
setUpdatedAt
(
now
);
sqls
.
add
(
SqlMapping
.
get
(
"goblin_order.pay.order"
));
sqlDataOrder
.
add
(
new
Object
[]{
storeOrder
.
getPaymentType
(),
storeOrder
.
getPaymentId
(),
storeOrder
.
getPayCode
(),
storeOrder
.
getPayTime
(),
storeOrder
.
getWriteOffCode
(),
storeOrder
.
getStatus
(),
storeOrder
.
getUpdatedAt
(),
orderId
,
now
,
now
});
sqls
.
add
(
SqlMapping
.
get
(
"goblin_order.pay.sku"
));
List
<
String
>
skuList
=
orderVo
.
getOrderSkuVoIds
();
for
(
String
orderSkuVoIds
:
skuList
)
{
GoblinOrderSkuVo
orderSkuVo
=
redisUtils
.
getGoblinOrderSkuVo
(
orderSkuVoIds
);
//增加销量
redisUtils
.
incrSkuSaleCount
(
orderSkuVo
.
getSpuId
(),
orderSkuVo
.
getSkuId
(),
orderSkuVo
.
getNum
());
orderSkuVo
.
setStatus
(
GoblinStatusConst
.
Status
.
ORDER_STATUS_4
.
getValue
());
//redis
redisUtils
.
setGoblinOrderSku
(
orderSkuVo
.
getOrderSkuId
(),
orderSkuVo
);
//mongo
mongoUtils
.
updateGoblinOrderSkuVo
(
orderSkuVo
.
getOrderSkuId
(),
orderSkuVo
);
//mongo 添加操作日志
GoblinOrderLogVo
logVo
=
GoblinOrderLogVo
.
getNew
();
logVo
.
setOrderId
(
orderVo
.
getOrderId
());
logVo
.
setOrderCode
(
orderVo
.
getOrderCode
());
logVo
.
setPayCode
(
orderVo
.
getPayCode
());
logVo
.
setStoreId
(
orderVo
.
getStoreId
());
if
(
orderSkuVo
.
getSkuId
().
indexOf
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_ZHENGZAI
.
getValue
())
>
0
)
{
logVo
.
setOrderType
(
"zhengzai"
);
}
else
{
logVo
.
setOrderType
(
"order"
);
}
logVo
.
setSpuId
(
orderSkuVo
.
getSpuId
());
logVo
.
setSkuId
(
orderSkuVo
.
getSkuId
());
logVo
.
setSkuPriceActual
(
orderSkuVo
.
getSkuPriceActual
().
multiply
(
new
BigDecimal
(
100
)).
longValue
());
logVo
.
setStatus
(
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_11
.
getValue
());
logVo
.
setRemark
(
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_11
.
getDesc
());
logVo
.
setOperationId
(
uid
);
logVo
.
setOperationName
(
orderVo
.
getUserName
());
logVo
.
setOperationType
(
GoblinStatusConst
.
Type
.
OPERATION_TYPE_1
.
getValue
());
logVo
.
setCreatedAt
(
LocalDateTime
.
now
());
mongoUtils
.
insertGoblinOrderLogVo
(
logVo
);
//mysql
sqlDataSku
.
add
(
new
Object
[]{
orderSkuVo
.
getStatus
(),
now
,
orderSkuVo
.
getOrderSkuId
(),
now
,
now
});
}
//redis
orderVo
.
setPayCode
(
storeOrder
.
getPayCode
());
orderVo
.
setPayTime
(
payTime
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
)));
orderVo
.
setWriteOffCode
(
storeOrder
.
getWriteOffCode
());
orderVo
.
setStatus
(
storeOrder
.
getStatus
());
orderVo
.
setPaymentId
(
paymentId
);
orderVo
.
setPaymentType
(
paymentType
);
orderVo
.
setOrderSkuVoIds
(
skuList
);
redisUtils
.
setGoblinOrder
(
orderId
,
orderVo
);
redisUtils
.
setOffCode
(
orderVo
.
getWriteOffCode
(),
orderVo
.
getMasterOrderCode
());
// //删除未支付订单
// redisUtils.removeGoblinOrder(orderVo.getRandomKey() + "", orderId);
//mongo
mongoUtils
.
updateGoblinStoreOrderVo
(
orderId
,
orderVo
);
//mysql
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
GOBLIN_ORDER_CREATE_PAY
.
getKey
(),
SqlMapping
.
gets
(
sqls
,
sqlDataOrder
,
sqlDataSku
));
}
//加分
if
(
orderUtils
.
noZhengzaiOrder
(
uid
))
{
orderUtils
.
doTask
(
uid
,
priceActual
);
}
}
else
{
// 业务处理失败
log
.
info
(
"处理失败"
);
}
return
"RECV_ORD_ID_"
+
reqSeqId
;
}
catch
(
Exception
e
)
{
log
.
info
(
"异步回调开始,参数,request={},异常={}"
,
request
,
e
);
e
.
printStackTrace
();
}
return
""
;
}
}
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/controller/goblin/task/PlatformGoblinGoodsTaskController.java
View file @
e8b557d5
...
...
@@ -54,7 +54,7 @@ public class PlatformGoblinGoodsTaskController {
try
{
platformGoblinGoodsService
.
shelvesProcessing
(
spuIdList
);
}
catch
(
Exception
e
)
{
log
.
error
(
"
商品上架处理[totalCount={},spuIdList={}]"
,
totalCount
,
JsonUtils
.
toJson
(
spuIdList
));
log
.
error
(
"
Ex.商品上架处理[totalCount={},spuIdList={}],{}"
,
totalCount
,
JsonUtils
.
toJson
(
spuIdList
),
e
.
getMessage
(
));
return
ResponseDto
.
failure
(
String
.
format
(
"商品上架处理失败[totalCount=%s]"
,
totalCount
));
}
}
...
...
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/controller/kylin/DataController.java
View file @
e8b557d5
...
...
@@ -19,12 +19,12 @@ public class DataController {
private
DataImpl
data
;
@PostMapping
(
"phpGoodsOrder"
)
@ApiOperation
(
"php今年订单迁移"
)
public
ResponseDto
<
Boolean
>
fieldData
()
{
data
.
fieldData
();
return
ResponseDto
.
success
();
}
//
@PostMapping("phpGoodsOrder")
//
@ApiOperation("php今年订单迁移")
//
public ResponseDto<Boolean> fieldData() {
//
data.fieldData();
//
return ResponseDto.success();
//
}
// @PostMapping("fieldData")
// @ApiOperation("场地数据迁移")
...
...
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/goblin/PlatformGoblinGoodsService.java
View file @
e8b557d5
...
...
@@ -51,9 +51,10 @@ public class PlatformGoblinGoodsService extends ServiceImpl<GoblinGoodsMapper, G
updateSkuWrapper
.
in
(
GoblinGoodsSku:
:
getSpuId
,
spuIdList
);
updateSkuWrapper
.
eq
(
GoblinGoodsSku:
:
getDelFlg
,
"0"
);
LiquidnetServiceException
liquidnetServiceException
=
new
LiquidnetServiceException
();
if
(
goblinGoodsSkuMapper
.
update
(
updateSku
,
updateSkuWrapper
)
>
0
)
{
UpdateResult
updateSpuResult
=
mongoTemplate
.
getCollection
(
GoblinGoodsInfoVo
.
class
.
getSimpleName
()).
updateMany
(
Query
.
query
(
Criteria
.
where
(
"spuId"
).
in
(
spuIdList
).
and
(
"shelvesStatus"
).
i
s
(
"0
"
).
and
(
"shelvesHandle"
).
is
(
"3"
)).
getQueryObject
(),
Query
.
query
(
Criteria
.
where
(
"spuId"
).
in
(
spuIdList
).
and
(
"shelvesStatus"
).
i
n
(
"0"
,
"1
"
).
and
(
"shelvesHandle"
).
is
(
"3"
)).
getQueryObject
(),
Update
.
update
(
"shelvesStatus"
,
"3"
).
set
(
"shelvesAt"
,
now
).
getUpdateObject
()
);
if
(
updateSpuResult
.
getModifiedCount
()
>
0
)
{
...
...
@@ -83,10 +84,15 @@ public class PlatformGoblinGoodsService extends ServiceImpl<GoblinGoodsMapper, G
Query
.
query
(
Criteria
.
where
(
"spuId"
).
in
(
spuIdList
).
and
(
"shelvesAt"
).
is
(
now
)).
getQueryObject
(),
Update
.
update
(
"shelvesStatus"
,
"0"
).
set
(
"shelvesAt"
,
of
).
getUpdateObject
()
);
liquidnetServiceException
.
setMessage
(
"更新失败:Mongo.GoblinGoodsSkuInfoVo"
);
}
}
else
{
liquidnetServiceException
.
setMessage
(
"更新失败:Mongo.GoblinGoodsInfoVo"
);
}
}
else
{
liquidnetServiceException
.
setMessage
(
"更新失败:Mysql.GoblinGoodsSku"
);
}
throw
new
LiquidnetServiceException
()
;
throw
liquidnetServiceException
;
}
}
}
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/kylin/DataImpl.java
View file @
e8b557d5
...
...
@@ -9,6 +9,7 @@ import com.liquidnet.service.base.ResponseDto;
import
com.liquidnet.service.feign.stone.api.FeignStoneIntegralClient
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.constant.GoblinStatusConst
;
import
com.liquidnet.service.goblin.dto.vo.GoblinMailVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinOrderAttrVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinOrderSkuVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinStoreOrderVo
;
...
...
@@ -74,7 +75,7 @@ public class DataImpl {
" m.matter_num as 'master_order_code',\n"
+
" m.matter_num as 'order_code',\n"
+
" m.out_trade_no as 'pay_code',\n"
+
"
ifnull(user_id, user_id_new)
as 'user_id',\n"
+
"
m.user_id_new
as 'user_id',\n"
+
" m.matter_amount as 'price_total',\n"
+
" (m.matter_amount - m.coupon_type2_price) as 'price_actual',\n"
+
" m.price_send as 'price_express',\n"
+
...
...
@@ -93,10 +94,14 @@ public class DataImpl {
" m.post_phone as 'express_phone',\n"
+
" m.post_address as 'express_address',\n"
+
" m.post_address as 'express_address_detail',\n"
+
" m.created_at as 'created_at'\n"
+
"from matters as m\n"
+
" m.created_at as 'created_at',\n"
+
" e.name as 'logistics_company',\n"
+
" e.status as 'express_status',\n"
+
" e.number as 'mail_no',\n"
+
" e.created_at as 'delivery_time'\n"
+
"from matters as m left join expresses as e on e.order_id = m.id and e.order_type = 'order_product'\n"
+
"where m.status = 1\n"
+
" and m.created_at >= '2022-01-01 00:00:00'"
;
" and m.created_at >= '2022-01-01 00:00:00'
group by m.id;
"
;
Connection
connection
=
DriverManager
.
getConnection
(
SQL_URL
,
SQL_USER
,
SQL_PWD
);
//查询数据
PreparedStatement
preparedStatement
=
connection
.
prepareStatement
(
sql
);
...
...
@@ -107,7 +112,18 @@ public class DataImpl {
orderVo
.
setStoreId
(
"dab4742921ba3555700896c4fafbee5b"
);
orderVo
.
setStoreName
(
"摩登天空自营店"
);
orderVo
.
setPayCountdownMinute
(
5
);
orderVo
.
setStatus
(
GoblinStatusConst
.
Status
.
ORDER_STATUS_4
.
getValue
());
//判断快递状态
String
express_status
=
row
.
getString
(
"express_status"
);
if
(
express_status
==
null
)
{
orderVo
.
setStatus
(
GoblinStatusConst
.
Status
.
ORDER_STATUS_2
.
getValue
());
}
else
{
if
(
express_status
.
equals
(
"3"
))
{
orderVo
.
setStatus
(
GoblinStatusConst
.
Status
.
ORDER_STATUS_4
.
getValue
());
}
else
{
orderVo
.
setStatus
(
GoblinStatusConst
.
Status
.
ORDER_STATUS_3
.
getValue
());
}
}
orderVo
.
setOrderId
(
row
.
getString
(
"order_id"
));
orderVo
.
setMasterOrderCode
(
row
.
getString
(
"master_order_code"
));
orderVo
.
setOrderCode
(
row
.
getString
(
"order_code"
));
...
...
@@ -163,7 +179,7 @@ public class DataImpl {
while
(
rowSku
.
next
())
{
GoblinOrderSkuVo
skuVo
=
GoblinOrderSkuVo
.
getNew
();
skuVo
.
setOrderId
(
orderVo
.
getOrderId
());
skuVo
.
setStatus
(
GoblinStatusConst
.
Status
.
ORDER_STATUS_4
.
getValue
());
skuVo
.
setStatus
(
orderVo
.
getStatus
());
skuVo
.
setOrderSkuId
(
rowSku
.
getString
(
"order_sku_id"
));
skuVo
.
setSpuId
(
rowSku
.
getString
(
"spu_id"
));
skuVo
.
setSkuId
(
rowSku
.
getString
(
"sku_id"
));
...
...
@@ -172,15 +188,27 @@ public class DataImpl {
skuVo
.
setSkuPriceActual
(
rowSku
.
getBigDecimal
(
"sku_price_actual"
));
skuVo
.
setSkuName
(
rowSku
.
getString
(
"sku_specs"
));
skuVo
.
setSkuImage
(
rowSku
.
getString
(
"sku_image"
));
skuVo
.
setSkuSpecs
(
"[{\"specName\":\""
+
rowSku
.
getString
(
"sku_name"
)+
"\",\"specVname\":\""
+
rowSku
.
getString
(
"sku_specs"
)+
"\"}]"
);
//
skuVo
.
setSkuSpecs
(
"[{\"specName\":\""
+
rowSku
.
getString
(
"sku_name"
)
+
"\",\"specVname\":\""
+
rowSku
.
getString
(
"sku_specs"
)
+
"\"}]"
);
//
skuVo
.
setSpuName
(
rowSku
.
getString
(
"spu_name"
));
skuVo
.
setCreatedAt
(
orderVo
.
getCreatedAt
());
setGoblinOrderSku
(
skuVo
.
getOrderSkuId
(),
skuVo
);
orderSkuIds
.
add
(
skuVo
.
getOrderSkuId
());
}
//判断快递
if
(
express_status
!=
null
)
{
GoblinMailVo
mailVo
=
GoblinMailVo
.
getNew
();
mailVo
.
setMailId
(
IDGenerator
.
nextTimeId2
());
mailVo
.
setOrderId
(
orderVo
.
getOrderId
());
mailVo
.
setMailNo
(
row
.
getString
(
"mail_no"
));
mailVo
.
setDeliveryTime
(
row
.
getString
(
"delivery_time"
));
mailVo
.
setLogisticsCompany
(
row
.
getString
(
"logistics_company"
));
mailVo
.
setOrderSkuVoIds
(
orderSkuIds
);
setGoblinMail
(
orderVo
.
getOrderId
(),
mailVo
);
}
orderVo
.
setOrderSkuVoIds
(
orderSkuIds
);
setGoblinOrder
(
orderVo
.
getOrderId
(),
orderVo
);
addOrderList
(
orderVo
.
getUserId
(),
orderVo
.
getOrderId
());
setGoblinOrder
(
orderVo
.
getOrderId
(),
orderVo
);
// addOrderList(orderVo.getUserId(),
orderVo.getOrderId());
rowSku
.
close
();
preparedStatementSku
.
close
();
...
...
@@ -227,4 +255,18 @@ public class DataImpl {
return
(
List
<
String
>)
obj
;
}
}
// 赋值 快递vo
public
void
setGoblinMail
(
String
orderId
,
GoblinMailVo
vo
)
{
String
redisKey
=
GoblinRedisConst
.
REDIS_GOBLIN_MAIL
.
concat
(
orderId
);
List
<
GoblinMailVo
>
list
=
goblinMailVoList
();
list
.
add
(
vo
);
redisDataSourceUtil
.
getRedisKylinUtil
().
set
(
redisKey
,
list
);
}
private
static
final
ArrayList
<
GoblinMailVo
>
goblinMailVo
=
new
ArrayList
<>();
public
static
ArrayList
<
GoblinMailVo
>
goblinMailVoList
()
{
return
(
ArrayList
<
GoblinMailVo
>)
goblinMailVo
.
clone
();
}
}
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