Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
order-group-application
order-group
Commits
0a4528f5
Commit
0a4528f5
authored
Jun 17, 2021
by
周晓航
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'qa' of gitlab.freemud.com:order-group-application/order-group into qa
parents
9ce13600
4c405242
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
455 additions
and
73 deletions
+455
-73
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
+1
-1
order-application-service/src/main/java/cn/freemud/annotations/LogIgnore.java
+45
-0
order-application-service/src/main/java/cn/freemud/annotations/LogIgnoreFeign.java
+32
-0
order-application-service/src/main/java/cn/freemud/aop/IsConvertEnAspect.java
+0
-23
order-application-service/src/main/java/cn/freemud/aop/LogIgnoreAspect.java
+197
-0
order-application-service/src/main/java/cn/freemud/aop/LogIgnoreFeignAspect.java
+125
-0
order-application-service/src/main/java/cn/freemud/aop/WebAspect.java
+0
-20
order-application-service/src/main/java/cn/freemud/constant/ResponseCodeKeyConstant.java
+17
-1
order-application-service/src/main/java/cn/freemud/controller/OrderController.java
+0
-0
order-application-service/src/main/java/cn/freemud/enums/ResponseResult.java
+1
-1
order-application-service/src/main/java/cn/freemud/service/thirdparty/DeliveryFeiginClient.java
+10
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CouponServiceImpl.java
+1
-6
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ItemServiceImpl.java
+0
-2
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
+1
-6
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationSharingDiscountService.java
+0
-7
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/CouponOnlineClient.java
+4
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/CustomScoreClient.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/CustomerApplicationClient.java
+2
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/CustomerExtendClient.java
+4
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/MemberToolsClient.java
+4
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/ProductClient.java
+5
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/StockClient.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/StoreItemClient.java
+4
-4
No files found.
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
View file @
0a4528f5
...
@@ -3179,7 +3179,7 @@ public class OrderAdapter {
...
@@ -3179,7 +3179,7 @@ public class OrderAdapter {
orderPayDto
.
setPayCode
(
PayChannelType
.
TIKTOKPAY
.
getEbcode
());
orderPayDto
.
setPayCode
(
PayChannelType
.
TIKTOKPAY
.
getEbcode
());
}
}
orderPayDto
.
setFoodOrderType
(
getFoodOrderType
(
orderBean
.
getOrderType
()));
orderPayDto
.
setFoodOrderType
(
getFoodOrderType
(
orderBean
.
getOrderType
()));
orderPayDto
.
setMerchantDiscount
(
orderBean
.
getOriginalAmount
().
longValue
()-
orderBean
.
getAmount
());
//
orderPayDto.setMerchantDiscount(orderBean.getOriginalAmount().longValue()-orderBean.getAmount());
return
orderPayDto
;
return
orderPayDto
;
}
}
...
...
order-application-service/src/main/java/cn/freemud/annotations/LogIgnore.java
0 → 100644
View file @
0a4528f5
package
cn
.
freemud
.
annotations
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
/**
* @author wanghanghang
*/
@Retention
(
RetentionPolicy
.
RUNTIME
)
public
@interface
LogIgnore
{
/**
* 是否打印日志,true打印,false不打印,注意设置成false状态码和状态码信息都不会打印
*
* @return
*/
boolean
printLog
()
default
true
;
/**
* printLog 设置成true的时候,可以排除哪些状态码的响应不用打印响应报文,只会打印状态码
* 默认成功100
* @return
*/
String
[]
excludeSuccessCodes
()
default
"100"
;
/**
* statusCodeFieldName 默认返回状态码字段为code
*
* @return
*/
String
codeFieldName
()
default
"code"
;
/**
* statusCodeFieldName 默认返回状态码字段为message
*
* @return
*/
String
messageFieldName
()
default
"message"
;
/**
* logMessage 日志打印
* @return
*/
String
logMessage
()
default
""
;
}
order-application-service/src/main/java/cn/freemud/annotations/LogIgnoreFeign.java
0 → 100644
View file @
0a4528f5
package
cn
.
freemud
.
annotations
;
import
java.lang.annotation.*
;
/**
* @author freemud
*/
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Target
(
value
=
{
ElementType
.
METHOD
})
@Documented
@Inherited
public
@interface
LogIgnoreFeign
{
/**
* 是否打印日志,true打印,false不打印,注意设置成false状态码和状态码信息都不会打印
* @return
*/
boolean
printLog
()
default
true
;
/**
* printLog 设置成true的时候,可以排除哪些状态码的响应不用打印响应报文,只会打印状态码
*
* @return
*/
String
[]
excludeStatusCodes
()
default
"100"
;
String
statusCodeFieldName
()
default
"code"
;
String
messageFieldName
()
default
"message"
;
}
order-application-service/src/main/java/cn/freemud/aop/IsConvertEnAspect.java
View file @
0a4528f5
...
@@ -61,34 +61,11 @@ public class IsConvertEnAspect implements Ordered {
...
@@ -61,34 +61,11 @@ public class IsConvertEnAspect implements Ordered {
return
baseResponse
;
return
baseResponse
;
}
}
private
HttpServletRequest
currentRequest
()
{
private
HttpServletRequest
currentRequest
()
{
ServletRequestAttributes
servletRequestAttributes
=
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
ServletRequestAttributes
servletRequestAttributes
=
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
return
Optional
.
ofNullable
(
servletRequestAttributes
).
map
(
ServletRequestAttributes:
:
getRequest
).
orElse
(
null
);
return
Optional
.
ofNullable
(
servletRequestAttributes
).
map
(
ServletRequestAttributes:
:
getRequest
).
orElse
(
null
);
}
}
/**
* 备用方法,避免code或者message信息不统一
* 过滤返参code是否在excludeStatusCodes存在
*
* @param excludeStatusCodes
* @param statusCodeValue
* @return
*/
private
boolean
containStatusCode
(
String
[]
excludeStatusCodes
,
String
statusCodeValue
)
{
if
(
excludeStatusCodes
==
null
||
excludeStatusCodes
.
length
==
0
)
{
return
false
;
}
for
(
int
i
=
0
;
i
<
excludeStatusCodes
.
length
;
i
++)
{
if
(
excludeStatusCodes
[
i
].
equals
(
statusCodeValue
))
{
return
true
;
}
}
return
false
;
}
@Override
@Override
public
int
getOrder
()
{
public
int
getOrder
()
{
return
0
;
return
0
;
...
...
order-application-service/src/main/java/cn/freemud/aop/LogIgnoreAspect.java
0 → 100644
View file @
0a4528f5
package
cn
.
freemud
.
aop
;
import
cn.freemud.annotations.LogIgnore
;
import
com.alibaba.fastjson.JSON
;
import
com.freemud.application.sdk.api.base.SDKCommonBaseContextWare
;
import
com.freemud.application.sdk.api.exception.IgnoreErrorAnnotation
;
import
com.freemud.application.sdk.api.log.ApiLog
;
import
com.freemud.application.sdk.api.log.ErrorLog
;
import
com.freemud.application.sdk.api.log.LogParams
;
import
com.freemud.application.sdk.api.log.LogThreadLocal
;
import
com.freemud.application.sdk.api.service.EmailAlertService
;
import
com.google.common.collect.Lists
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.Signature
;
import
org.aspectj.lang.annotation.AfterThrowing
;
import
org.aspectj.lang.annotation.Around
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Pointcut
;
import
org.aspectj.lang.reflect.MethodSignature
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.Ordered
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
javax.servlet.http.HttpServletRequest
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Parameter
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.UUID
;
/**
* @author freemud_whh
*/
@Aspect
@Component
public
class
LogIgnoreAspect
implements
Ordered
{
@Autowired
private
EmailAlertService
emailAlertService
;
/**
* 是否打印响应报文日志,默认是false,若为true会覆盖注解里面的{@link LogIgnore}配置,输出响应报文里面所有的信息
*/
@Value
(
"${print-response-body-log-order-application-service:false}"
)
private
volatile
boolean
printResponseBodyLog
=
false
;
/**
* 即使printResponseBodyLog设置为true, 该参数中包含的url也会被过滤且不打印日志
*/
@Value
(
"${exclude-print-body-log-methods:findNearPickUpStores,getMenuCategory}"
)
private
volatile
List
<
String
>
excludePrintBodyLogMethods
=
Lists
.
newArrayList
();
@Pointcut
(
"@annotation(cn.freemud.annotations.LogIgnore)"
)
public
void
pointcut
()
{
}
@Around
(
"pointcut()"
)
public
Object
doAroundAdvice
(
ProceedingJoinPoint
joinPoint
)
throws
Throwable
{
long
startTime
=
System
.
currentTimeMillis
();
StringBuilder
logMethod
=
new
StringBuilder
(
joinPoint
.
getSignature
().
getDeclaringTypeName
());
logMethod
.
append
(
"."
);
logMethod
.
append
(
joinPoint
.
getSignature
().
getName
());
Signature
sig
=
joinPoint
.
getSignature
();
MethodSignature
msig
=
null
;
if
(!(
sig
instanceof
MethodSignature
))
{
throw
new
IllegalArgumentException
(
"非法参数使用 "
);
}
else
{
msig
=
(
MethodSignature
)
sig
;
Object
target
=
joinPoint
.
getTarget
();
Method
currentMethod
=
target
.
getClass
().
getMethod
(
msig
.
getName
(),
msig
.
getParameterTypes
());
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
if
(
ApiLog
.
isDebugEnabled
())
{
ApiLog
.
debug
(
"获取tracking的值====>{}"
,
new
Object
[]{
request
.
getHeader
(
"x-transaction-id"
)});
}
LogThreadLocal
.
setTrackingNo
(
StringUtils
.
isEmpty
(
request
.
getHeader
(
"x-transaction-id"
))
?
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
)
:
request
.
getHeader
(
"x-transaction-id"
));
List
logArgs
=
this
.
getLogArgs
(
currentMethod
,
joinPoint
);
String
requestData
=
JSON
.
toJSONString
(
logArgs
);
LogIgnore
logIgnore
=
currentMethod
.
getAnnotation
(
LogIgnore
.
class
);
Object
object
=
joinPoint
.
proceed
();
Object
logObj
=
object
;
if
(
logIgnore
!=
null
&&
logIgnore
.
printLog
())
{
if
(!
this
.
printResponseBodyLog
||
excludePrintBodyLogMethods
.
contains
(
logIgnore
.
logMessage
()))
{
String
statusCodeValue
=
BeanUtils
.
getProperty
(
object
,
logIgnore
.
codeFieldName
());
String
messageValue
=
BeanUtils
.
getProperty
(
object
,
logIgnore
.
messageFieldName
());
String
[]
excludeStatusCodes
=
logIgnore
.
excludeSuccessCodes
();
//当排除了这个状态码不打印响应的具体内容只会打印状态码和状态描述信息
//当返回code在不打印的范围,则将打印信息变更为只打印code和message
if
(
this
.
containStatusCode
(
excludeStatusCodes
,
statusCodeValue
))
{
logObj
=
object
.
getClass
().
newInstance
();
BeanUtils
.
setProperty
(
logObj
,
logIgnore
.
codeFieldName
(),
statusCodeValue
);
BeanUtils
.
setProperty
(
logObj
,
logIgnore
.
messageFieldName
(),
messageValue
);
}
}
}
ApiLog
.
infoConvertJson
(
logMethod
.
toString
(),
logIgnore
.
logMessage
(),
request
,
startTime
,
System
.
currentTimeMillis
(),
requestData
,
logObj
);
LogThreadLocal
.
removeTrackingNo
();
return
object
;
}
}
/**
* 过滤返参code是否在excludeStatusCodes存在
*
* @param excludeStatusCodes
* @param statusCodeValue
* @return
*/
private
boolean
containStatusCode
(
String
[]
excludeStatusCodes
,
String
statusCodeValue
)
{
if
(
excludeStatusCodes
==
null
||
excludeStatusCodes
.
length
==
0
)
{
return
false
;
}
for
(
int
i
=
0
;
i
<
excludeStatusCodes
.
length
;
i
++)
{
if
(
excludeStatusCodes
[
i
].
equals
(
statusCodeValue
))
{
return
true
;
}
}
return
false
;
}
/**
* 系统异常时,AfterThrowing在ApiAnnotation注解中已经处理。
* 此处先注释,暂不删除,代码保留
*
* @param joinPoint
* @return
*/
@AfterThrowing
(
pointcut
=
"pointcut()"
,
throwing
=
"e"
)
public
void
doAfterThrowing
(
JoinPoint
joinPoint
,
Exception
e
)
{
long
startTime
=
System
.
currentTimeMillis
();
Signature
sig
=
joinPoint
.
getSignature
();
Method
currentMethod
=
null
;
MethodSignature
msig
=
null
;
if
(!(
sig
instanceof
MethodSignature
))
{
throw
new
IllegalArgumentException
(
"非法参数使用"
);
}
else
{
msig
=
(
MethodSignature
)
sig
;
Object
target
=
joinPoint
.
getTarget
();
try
{
currentMethod
=
target
.
getClass
().
getMethod
(
msig
.
getName
(),
msig
.
getParameterTypes
());
}
catch
(
NoSuchMethodException
var19
)
{
var19
.
printStackTrace
();
}
StringBuilder
logMethod
=
new
StringBuilder
(
joinPoint
.
getSignature
().
getDeclaringTypeName
());
logMethod
.
append
(
"."
);
logMethod
.
append
(
joinPoint
.
getSignature
().
getName
());
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
try
{
Class
<?>
clz
=
e
.
getClass
();
boolean
clzHasAnno
=
clz
.
isAnnotationPresent
(
IgnoreErrorAnnotation
.
class
);
if
(!
clzHasAnno
)
{
this
.
emailAlertService
.
sendEmailAlert
(
"系统全局异常"
,
e
);
}
}
catch
(
Exception
var17
)
{
ErrorLog
.
errorConvertJson
(
SDKCommonBaseContextWare
.
getAppName
(),
logMethod
.
toString
(),
"出错:"
+
e
.
getMessage
(),
request
,
startTime
,
System
.
currentTimeMillis
(),
this
.
getLogArgs
(
currentMethod
,
joinPoint
),
var17
);
}
finally
{
ErrorLog
.
errorConvertJson
(
SDKCommonBaseContextWare
.
getAppName
(),
logMethod
.
toString
(),
"出错:"
+
e
.
getMessage
(),
request
,
startTime
,
System
.
currentTimeMillis
(),
this
.
getLogArgs
(
currentMethod
,
joinPoint
),
e
);
LogThreadLocal
.
removeTrackingNo
();
}
}
}
private
List
getLogArgs
(
Method
method
,
JoinPoint
joinPoint
)
{
if
(
method
==
null
)
{
return
null
;
}
else
{
Object
[]
args
=
joinPoint
.
getArgs
();
if
(
args
!=
null
&&
args
.
length
!=
0
)
{
List
logArgs
=
new
ArrayList
();
Parameter
[]
parameters
=
method
.
getParameters
();
for
(
int
j
=
0
;
j
<
parameters
.
length
;
++
j
)
{
Parameter
parameter
=
parameters
[
j
];
LogParams
logParams
=
(
LogParams
)
parameter
.
getAnnotation
(
LogParams
.
class
);
if
(
logParams
!=
null
)
{
logArgs
.
add
(
args
[
j
]);
}
}
return
logArgs
;
}
else
{
return
null
;
}
}
}
@Override
public
int
getOrder
()
{
return
0
;
}
}
order-application-service/src/main/java/cn/freemud/aop/LogIgnoreFeignAspect.java
0 → 100644
View file @
0a4528f5
package
cn
.
freemud
.
aop
;
import
cn.freemud.annotations.LogIgnore
;
import
cn.freemud.annotations.LogIgnoreFeign
;
import
cn.freemud.entities.vo.ThirdPartLogVo
;
import
cn.freemud.utils.LogUtil
;
import
com.freemud.application.sdk.api.base.SDKCommonBaseContextWare
;
import
com.freemud.application.sdk.api.log.LogThreadLocal
;
import
com.freemud.application.sdk.api.log.ThirdPartyLog
;
import
lombok.extern.slf4j.Slf4j
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.Signature
;
import
org.aspectj.lang.annotation.Around
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Pointcut
;
import
org.aspectj.lang.reflect.MethodSignature
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.StringUtils
;
import
java.lang.reflect.Method
;
/**
* @author freemud
* @title: LogIgnoreFeignAop
* @projectName order-group
* @description: TODO
* @date 2021/6/9上午10:53
*/
@Aspect
@Component
@Slf4j
public
class
LogIgnoreFeignAspect
{
/**
* 是否打印响应报文日志,默认是false,若为true会覆盖注解里面的{@link LogIgnore}配置,输出响应报文里面所有的信息
*/
@Value
(
"${print-feign-response-body-log-order-application-service:true}"
)
private
volatile
boolean
printFeignResponseBodyLog
=
true
;
@Pointcut
(
"execution(* cn.freemud.service.thirdparty..*.*(..))"
)
public
void
clientLog
()
{
}
@Around
(
"clientLog()"
)
public
Object
doAround
(
ProceedingJoinPoint
joinPoint
)
throws
Throwable
{
long
start
=
System
.
currentTimeMillis
();
Object
result
=
null
;
try
{
result
=
joinPoint
.
proceed
();
}
catch
(
Exception
ex
)
{
ThirdPartLogVo
thirdPartLogVo
=
LogUtil
.
createThirdPartLogVo
(
joinPoint
);
LogUtil
.
thirdPartError
(
start
,
System
.
currentTimeMillis
(),
thirdPartLogVo
,
null
);
throw
ex
;
}
try
{
Signature
sig
=
joinPoint
.
getSignature
();
MethodSignature
msig
=
null
;
if
(
sig
instanceof
MethodSignature
)
{
msig
=
(
MethodSignature
)
sig
;
Method
currentMethod
=
sig
.
getDeclaringType
().
getDeclaredMethod
(
msig
.
getName
(),
msig
.
getParameterTypes
());
Object
logReult
=
result
;
ThirdPartLogVo
thirdPartLogVo
=
LogUtil
.
createThirdPartLogVo
(
joinPoint
);
// 打印第三方出参日志
if
(!
this
.
printFeignResponseBodyLog
)
{
LogIgnoreFeign
logIgnore
=
currentMethod
.
getAnnotation
(
LogIgnoreFeign
.
class
);
if
(
logIgnore
!=
null
&&
logIgnore
.
printLog
())
{
String
statusCodeValue
=
org
.
apache
.
commons
.
beanutils
.
BeanUtils
.
getProperty
(
result
,
logIgnore
.
statusCodeFieldName
());
String
messageValue
=
org
.
apache
.
commons
.
beanutils
.
BeanUtils
.
getProperty
(
result
,
logIgnore
.
messageFieldName
());
String
[]
excludeStatusCodes
=
logIgnore
.
excludeStatusCodes
();
//当排除了这个状态码不打印响应的具体内容只会打印状态码和状态描述信息
if
(!
StringUtils
.
isEmpty
(
statusCodeValue
)
&&
this
.
containStatusCode
(
excludeStatusCodes
,
statusCodeValue
))
{
logReult
=
result
.
getClass
().
newInstance
();
org
.
apache
.
commons
.
beanutils
.
BeanUtils
.
setProperty
(
logReult
,
logIgnore
.
statusCodeFieldName
(),
statusCodeValue
);
org
.
apache
.
commons
.
beanutils
.
BeanUtils
.
setProperty
(
logReult
,
logIgnore
.
messageFieldName
(),
messageValue
);
}
}
}
ThirdPartyLog
.
infoConvertJson
(
LogThreadLocal
.
getTrackingNo
(),
SDKCommonBaseContextWare
.
getAppName
(),
start
,
System
.
currentTimeMillis
(),
thirdPartLogVo
.
getUri
(),
thirdPartLogVo
.
getRequestBody
(),
logReult
);
}
}
catch
(
Exception
e
)
{
LogUtil
.
error
(
"WebAspect Feign Log Ignore error {}"
,
""
,
""
,
e
);
}
return
result
;
}
// @Around("clientLog()")
// public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable {
// long start = System.currentTimeMillis();
// Object result = null;
// try {
// result = joinPoint.proceed();
// } catch (Exception ex) {
// ThirdPartLogVo thirdPartLogVo = LogUtil.createThirdPartLogVo(joinPoint);
// LogUtil.thirdPartError(start, System.currentTimeMillis(), thirdPartLogVo, null);
// throw ex;
// }
// ThirdPartLogVo thirdPartLogVo = LogUtil.createThirdPartLogVo(joinPoint);
// // 打印第三方出参日志
// ThirdPartyLog.infoConvertJson(LogThreadLocal.getTrackingNo(), SDKCommonBaseContextWare.getAppName(),start,System.currentTimeMillis(),
// thirdPartLogVo.getUri(),thirdPartLogVo.getRequestBody(),result);
// return result;
// }
/**
* 过滤返参code是否在excludeStatusCodes存在
*
* @param excludeStatusCodes
* @param statusCodeValue
* @return
*/
private
boolean
containStatusCode
(
String
[]
excludeStatusCodes
,
String
statusCodeValue
)
{
if
(
excludeStatusCodes
==
null
||
excludeStatusCodes
.
length
==
0
)
{
return
false
;
}
for
(
int
i
=
0
;
i
<
excludeStatusCodes
.
length
;
i
++)
{
if
(
excludeStatusCodes
[
i
].
equals
(
statusCodeValue
))
{
return
true
;
}
}
return
false
;
}
}
order-application-service/src/main/java/cn/freemud/aop/WebAspect.java
View file @
0a4528f5
...
@@ -133,27 +133,7 @@ public class WebAspect {
...
@@ -133,27 +133,7 @@ public class WebAspect {
return
result
;
return
result
;
}
}
@Pointcut
(
"execution(* cn.freemud.service.thirdparty..*.*(..)) || execution(* cn.freemud.service.mccafe.thirdparty..*.*(..)) || execution(* cn.freemud.management.thirdparty..*.*(..))"
)
public
void
clientLog
()
{
}
@Around
(
"clientLog()"
)
public
Object
doAround
(
ProceedingJoinPoint
joinPoint
)
throws
Throwable
{
long
start
=
System
.
currentTimeMillis
();
Object
result
=
null
;
try
{
result
=
joinPoint
.
proceed
();
}
catch
(
Exception
ex
)
{
ThirdPartLogVo
thirdPartLogVo
=
LogUtil
.
createThirdPartLogVo
(
joinPoint
);
LogUtil
.
thirdPartError
(
start
,
System
.
currentTimeMillis
(),
thirdPartLogVo
,
null
);
throw
ex
;
}
ThirdPartLogVo
thirdPartLogVo
=
LogUtil
.
createThirdPartLogVo
(
joinPoint
);
// 打印第三方出参日志
ThirdPartyLog
.
infoConvertJson
(
LogThreadLocal
.
getTrackingNo
(),
SDKCommonBaseContextWare
.
getAppName
(),
start
,
System
.
currentTimeMillis
(),
thirdPartLogVo
.
getUri
(),
thirdPartLogVo
.
getRequestBody
(),
result
);
return
result
;
}
public
String
getNotFilterUrl
(
String
redisKey
,
String
configKey
)
{
public
String
getNotFilterUrl
(
String
redisKey
,
String
configKey
)
{
String
notFilterUrl
;
String
notFilterUrl
;
...
...
order-application-service/src/main/java/cn/freemud/constant/ResponseCodeKeyConstant.java
View file @
0a4528f5
...
@@ -19,12 +19,28 @@ import java.util.HashSet;
...
@@ -19,12 +19,28 @@ import java.util.HashSet;
import
java.util.Set
;
import
java.util.Set
;
public
class
ResponseCodeKeyConstant
{
public
class
ResponseCodeKeyConstant
{
public
final
static
String
CODE
=
"code"
;
public
final
static
String
CODE
=
"code"
;
public
final
static
String
ERR_CODE
=
"errcod
e"
;
public
final
static
String
MESSAGE
=
"messag
e"
;
public
final
static
String
STATUS_CODE
=
"statusCode"
;
public
final
static
String
STATUS_CODE
=
"statusCode"
;
public
static
final
String
MEG
=
"meg"
;
public
static
final
String
MSG
=
"msg"
;
/**
* errcode名称来源根据 ProductInfosDto
*/
public
final
static
String
ERR_CODE
=
"errcode"
;
/**
* errmsg名称来源根据 ProductInfosDto
*/
public
static
final
String
ERR_MSG
=
"errmsg"
;
private
final
static
Set
<
String
>
responseCodeKeySet
=
new
HashSet
<>();
private
final
static
Set
<
String
>
responseCodeKeySet
=
new
HashSet
<>();
...
...
order-application-service/src/main/java/cn/freemud/controller/OrderController.java
View file @
0a4528f5
This diff is collapsed.
Click to expand it.
order-application-service/src/main/java/cn/freemud/enums/ResponseResult.java
View file @
0a4528f5
...
@@ -269,7 +269,7 @@ public enum ResponseResult {
...
@@ -269,7 +269,7 @@ public enum ResponseResult {
* 用于标识虚拟商品是否限制购买数量订单识别状态码 80102 - 80110
* 用于标识虚拟商品是否限制购买数量订单识别状态码 80102 - 80110
*/
*/
USER_BUY_PRODUCT_MORE_THAN_THE_NUMBER
(
"80102"
,
"虚拟商品限制购买数量超过最大购买数"
,
""
),
USER_BUY_PRODUCT_MORE_THAN_THE_NUMBER
(
"80102"
,
"虚拟商品限制购买数量超过最大购买数"
,
""
),
USER_BUY_PRODUCT_ALREADY
(
"80103"
,
"
限购商品购买达到上限
"
,
""
),
USER_BUY_PRODUCT_ALREADY
(
"80103"
,
"
只能购买一次哦,您已经购买过了
"
,
""
),
;
;
...
...
order-application-service/src/main/java/cn/freemud/service/thirdparty/DeliveryFeiginClient.java
View file @
0a4528f5
package
cn
.
freemud
.
service
.
thirdparty
;
package
cn
.
freemud
.
service
.
thirdparty
;
import
cn.freemud.annotations.LogIgnoreFeign
;
import
cn.freemud.constant.ResponseCodeKeyConstant
;
import
cn.freemud.entities.dto.MCCafeDeliveryBaseResponse
;
import
cn.freemud.entities.dto.MCCafeDeliveryBaseResponse
;
import
cn.freemud.entities.dto.delivery.*
;
import
cn.freemud.entities.dto.delivery.*
;
import
cn.freemud.entities.dto.delivery.QueryDeliveryAmountRequestDto
;
import
cn.freemud.entities.dto.delivery.QueryDeliveryAmountRequestDto
;
...
@@ -14,27 +16,35 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -14,27 +16,35 @@ import org.springframework.web.bind.annotation.RequestBody;
public
interface
DeliveryFeiginClient
{
public
interface
DeliveryFeiginClient
{
@PostMapping
(
"/deliveryLogisticsAmount/queryDeliveryAmount"
)
@PostMapping
(
"/deliveryLogisticsAmount/queryDeliveryAmount"
)
@LogIgnoreFeign
(
messageFieldName
=
ResponseCodeKeyConstant
.
MSG
)
QueryDeliveryAmountResponseDto
queryDeliveryAmount
(
@RequestBody
QueryDeliveryAmountRequestDto
request
);
QueryDeliveryAmountResponseDto
queryDeliveryAmount
(
@RequestBody
QueryDeliveryAmountRequestDto
request
);
@PostMapping
(
"/delivery/orderRemind"
)
@PostMapping
(
"/delivery/orderRemind"
)
@LogIgnoreFeign
(
messageFieldName
=
ResponseCodeKeyConstant
.
MSG
)
QueryDeliveryAmountResponseDto
orderRemind
(
@RequestBody
OrderRemindRequestDto
request
);
QueryDeliveryAmountResponseDto
orderRemind
(
@RequestBody
OrderRemindRequestDto
request
);
@PostMapping
(
"/delivery/listFreeRider"
)
@PostMapping
(
"/delivery/listFreeRider"
)
@LogIgnoreFeign
(
messageFieldName
=
ResponseCodeKeyConstant
.
MSG
)
MCCafeDeliveryBaseResponse
<
ResRiderTrackDto
>
listFreeRider
(
@RequestBody
QueryLocusRiderTrackDto
request
);
MCCafeDeliveryBaseResponse
<
ResRiderTrackDto
>
listFreeRider
(
@RequestBody
QueryLocusRiderTrackDto
request
);
@PostMapping
(
"/delivery/create"
)
@PostMapping
(
"/delivery/create"
)
@LogIgnoreFeign
(
messageFieldName
=
ResponseCodeKeyConstant
.
MSG
)
CreateDeliveryOrderResponseDto
deliveryOrderAdd
(
@RequestBody
CreateDeliveryVo
request
);
CreateDeliveryOrderResponseDto
deliveryOrderAdd
(
@RequestBody
CreateDeliveryVo
request
);
@PostMapping
(
"/delivery/getDeliveryStatusAndRiderPosition"
)
@PostMapping
(
"/delivery/getDeliveryStatusAndRiderPosition"
)
@LogIgnoreFeign
(
messageFieldName
=
ResponseCodeKeyConstant
.
MSG
)
DeliveryBaseResponse
<
DeliveryStatusAndRiderPositionDto
>
getDeliveryStatusAndRiderPosition
(
@RequestBody
QueryDeliveryBaseRequest
queryDeliveryBaseRequest
);
DeliveryBaseResponse
<
DeliveryStatusAndRiderPositionDto
>
getDeliveryStatusAndRiderPosition
(
@RequestBody
QueryDeliveryBaseRequest
queryDeliveryBaseRequest
);
@PostMapping
(
"/delivery/getThirdDeliveryFlag"
)
@PostMapping
(
"/delivery/getThirdDeliveryFlag"
)
@LogIgnoreFeign
(
messageFieldName
=
ResponseCodeKeyConstant
.
MSG
)
DeliveryBaseResponse
<
GetDeliveryFlagResponseDto
>
getThirdDeliveryFlag
(
@RequestBody
GetDeliveryFlagRequest
getDeliveryFlagRequest
);
DeliveryBaseResponse
<
GetDeliveryFlagResponseDto
>
getThirdDeliveryFlag
(
@RequestBody
GetDeliveryFlagRequest
getDeliveryFlagRequest
);
@PostMapping
(
"/delivery/queryDeliveryTemplate"
)
@PostMapping
(
"/delivery/queryDeliveryTemplate"
)
@LogIgnoreFeign
(
messageFieldName
=
ResponseCodeKeyConstant
.
MSG
)
QueryDeliveryTemplateResponse
queryDeliveryTemplate
(
@RequestBody
QueryDeliveryTemplateRequest
queryDeliveryTemplateRequest
);
QueryDeliveryTemplateResponse
queryDeliveryTemplate
(
@RequestBody
QueryDeliveryTemplateRequest
queryDeliveryTemplateRequest
);
@PostMapping
(
"/delivery/isFreightRefundSupported"
)
@PostMapping
(
"/delivery/isFreightRefundSupported"
)
@LogIgnoreFeign
(
messageFieldName
=
ResponseCodeKeyConstant
.
MSG
)
QueryFreightRefundSupportedResponse
isFreightRefundSupported
(
@RequestBody
QueryFreightRefundSupportedVo
queryDeliveryTemplateVo
);
QueryFreightRefundSupportedResponse
isFreightRefundSupported
(
@RequestBody
QueryFreightRefundSupportedVo
queryDeliveryTemplateVo
);
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CouponServiceImpl.java
View file @
0a4528f5
...
@@ -269,7 +269,6 @@ public class CouponServiceImpl implements CouponService {
...
@@ -269,7 +269,6 @@ public class CouponServiceImpl implements CouponService {
@Override
@Override
public
GetCouponDetailResponseDto
getMemberCoupon
(
GetMemberCouponRequestVo
requestVo
)
{
public
GetCouponDetailResponseDto
getMemberCoupon
(
GetMemberCouponRequestVo
requestVo
)
{
ApiLog
.
debug
(
"getMemberCoupon:"
+
gson
.
toJson
(
requestVo
));
//TODO 券详情查券服务
//TODO 券详情查券服务
Map
<
String
,
String
>
map
=
new
TreeMap
<
String
,
String
>();
Map
<
String
,
String
>
map
=
new
TreeMap
<
String
,
String
>();
if
(
StringUtils
.
isBlank
(
requestVo
.
getPartnerId
())
||
StringUtils
.
isBlank
(
requestVo
.
getCouponCode
()))
{
if
(
StringUtils
.
isBlank
(
requestVo
.
getPartnerId
())
||
StringUtils
.
isBlank
(
requestVo
.
getCouponCode
()))
{
...
@@ -286,7 +285,6 @@ public class CouponServiceImpl implements CouponService {
...
@@ -286,7 +285,6 @@ public class CouponServiceImpl implements CouponService {
String
sign
=
SignUtil
.
createMD5Sign
(
map
,
appSecret
);
String
sign
=
SignUtil
.
createMD5Sign
(
map
,
appSecret
);
map
.
put
(
Finals
.
SIGN
,
sign
);
map
.
put
(
Finals
.
SIGN
,
sign
);
GetCouponDetailResponseDto
responseDto
=
couponOnlineClient
.
getCouponDetails
(
map
);
GetCouponDetailResponseDto
responseDto
=
couponOnlineClient
.
getCouponDetails
(
map
);
LogUtil
.
info
(
"couponOnlineClient.getCouponDetails****"
,
map
,
gson
.
toJson
(
responseDto
));
if
(
ResponseCodeConstant
.
RESPONSE_SUCCESS_1
.
equals
(
responseDto
.
getResult
()))
{
if
(
ResponseCodeConstant
.
RESPONSE_SUCCESS_1
.
equals
(
responseDto
.
getResult
()))
{
return
responseDto
;
return
responseDto
;
}
}
...
@@ -913,7 +911,7 @@ public class CouponServiceImpl implements CouponService {
...
@@ -913,7 +911,7 @@ public class CouponServiceImpl implements CouponService {
*/
*/
@Override
@Override
public
CheckSpqInfoResponseDto
checkSpqInfo
(
CheckSpqInfoRequestDto
requestDto
,
String
goodsId
)
{
public
CheckSpqInfoResponseDto
checkSpqInfo
(
CheckSpqInfoRequestDto
requestDto
,
String
goodsId
)
{
ApiLog
.
debug
(
"checkSpqInfo****"
+
gson
.
toJson
(
requestDto
));
//
ApiLog.debug("checkSpqInfo****" + gson.toJson(requestDto));
String
partnerId
=
requestDto
.
getPartnerId
();
String
partnerId
=
requestDto
.
getPartnerId
();
String
couponCode
=
requestDto
.
getCouponCode
();
String
couponCode
=
requestDto
.
getCouponCode
();
String
storeId
=
requestDto
.
getStoreId
();
String
storeId
=
requestDto
.
getStoreId
();
...
@@ -1006,7 +1004,6 @@ public class CouponServiceImpl implements CouponService {
...
@@ -1006,7 +1004,6 @@ public class CouponServiceImpl implements CouponService {
dto
.
setStockLimit
(
ObjectUtils
.
equals
(
1
,
productsVo
.
getStockLimit
()));
dto
.
setStockLimit
(
ObjectUtils
.
equals
(
1
,
productsVo
.
getStockLimit
()));
dto
.
setExtras
(
productsVo
.
getExtra
());
dto
.
setExtras
(
productsVo
.
getExtra
());
dto
.
setCouponType
(
couponType
);
dto
.
setCouponType
(
couponType
);
ApiLog
.
debug
(
"dto***"
+
dto
);
return
dto
;
return
dto
;
}
}
...
@@ -1059,7 +1056,6 @@ public class CouponServiceImpl implements CouponService {
...
@@ -1059,7 +1056,6 @@ public class CouponServiceImpl implements CouponService {
*/
*/
@Override
@Override
public
GetProductsVo
getSpqProductInfo
(
CheckSpqInfoRequestDto
requestDto
,
String
goodsId
)
{
public
GetProductsVo
getSpqProductInfo
(
CheckSpqInfoRequestDto
requestDto
,
String
goodsId
)
{
ApiLog
.
debug
(
"checkSpqInfo****"
+
gson
.
toJson
(
requestDto
));
String
partnerId
=
requestDto
.
getPartnerId
();
String
partnerId
=
requestDto
.
getPartnerId
();
String
couponCode
=
requestDto
.
getCouponCode
();
String
couponCode
=
requestDto
.
getCouponCode
();
String
storeId
=
requestDto
.
getStoreId
();
String
storeId
=
requestDto
.
getStoreId
();
...
@@ -1069,7 +1065,6 @@ public class CouponServiceImpl implements CouponService {
...
@@ -1069,7 +1065,6 @@ public class CouponServiceImpl implements CouponService {
requestVo
.
setCouponCode
(
couponCode
);
requestVo
.
setCouponCode
(
couponCode
);
requestVo
.
setStoreId
(
requestDto
.
getStoreId
());
requestVo
.
setStoreId
(
requestDto
.
getStoreId
());
GetCouponDetailResponseDto
couponDetailResponseDto
=
couponService
.
getMemberCoupon
(
requestVo
);
GetCouponDetailResponseDto
couponDetailResponseDto
=
couponService
.
getMemberCoupon
(
requestVo
);
LogUtil
.
info
(
"couponService.getMemberCoupon"
,
gson
.
toJson
(
requestVo
),
gson
.
toJson
(
couponDetailResponseDto
));
if
(
couponDetailResponseDto
==
null
||
!
couponDetailResponseDto
.
getResult
().
equals
(
ResponseCodeConstant
.
RESPONSE_SUCCESS_1
)
||
CollectionUtils
.
isEmpty
(
couponDetailResponseDto
.
getDetails
()))
{
if
(
couponDetailResponseDto
==
null
||
!
couponDetailResponseDto
.
getResult
().
equals
(
ResponseCodeConstant
.
RESPONSE_SUCCESS_1
)
||
CollectionUtils
.
isEmpty
(
couponDetailResponseDto
.
getDetails
()))
{
return
null
;
return
null
;
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ItemServiceImpl.java
View file @
0a4528f5
...
@@ -83,8 +83,6 @@ public class ItemServiceImpl implements ItemService {
...
@@ -83,8 +83,6 @@ public class ItemServiceImpl implements ItemService {
GetProductInfoDto
getProductInfoDto
=
storeItemAdapter
.
convert2ProductInfoDto
(
partnerId
,
shopId
,
ProductInfoType
.
ALL
.
getCode
(),
productIds
,
menuType
);
GetProductInfoDto
getProductInfoDto
=
storeItemAdapter
.
convert2ProductInfoDto
(
partnerId
,
shopId
,
ProductInfoType
.
ALL
.
getCode
(),
productIds
,
menuType
);
ProductInfosDto
productInfosDto
=
storeItemClient
.
listProductInfos
(
getProductInfoDto
);
ProductInfosDto
productInfosDto
=
storeItemClient
.
listProductInfos
(
getProductInfoDto
);
if
(!
RESPONSE_SUCCESS_CODE
.
equals
(
productInfosDto
.
getErrcode
())
||
CollectionUtils
.
isEmpty
(
productInfosDto
.
getData
().
getProducts
()))
{
if
(!
RESPONSE_SUCCESS_CODE
.
equals
(
productInfosDto
.
getErrcode
())
||
CollectionUtils
.
isEmpty
(
productInfosDto
.
getData
().
getProducts
()))
{
log
.
error
(
"getShoppingCartInfo checkProductValidate is error , getProductValidateDto:{} , productCheckVaildDto:{}"
,
gson
.
toJson
(
getProductValidateDto
),
gson
.
toJson
(
productInfosDto
));
return
ResponseUtil
.
error
(
ResponseResult
.
STORE_ITEM_QUERY_ERROR
);
return
ResponseUtil
.
error
(
ResponseResult
.
STORE_ITEM_QUERY_ERROR
);
}
}
List
<
String
>
productInfoIds
=
productInfosDto
.
getData
().
getProducts
().
stream
()
List
<
String
>
productInfoIds
=
productInfosDto
.
getData
().
getProducts
().
stream
()
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
View file @
0a4528f5
...
@@ -332,7 +332,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -332,7 +332,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
// 获取商品详细信息
// 获取商品详细信息
List
<
ProductBean
>
productBeanListSpuClass
=
assortmentSdkService
.
getProductsInfo
(
partnerId
,
storeId
List
<
ProductBean
>
productBeanListSpuClass
=
assortmentSdkService
.
getProductsInfo
(
partnerId
,
storeId
,
Collections
.
singletonList
(
spuId2
),
addShoppingCartGoodsRequestVo
.
getMenuType
(),
this
.
shoppingCartBaseService
);
,
Collections
.
singletonList
(
spuId2
),
addShoppingCartGoodsRequestVo
.
getMenuType
(),
this
.
shoppingCartBaseService
);
LogUtil
.
info
(
"productBeanListSpuClass"
,
spuId2
,
JSON
.
toJSONString
(
productBeanListSpuClass
));
//
LogUtil.info("productBeanListSpuClass", spuId2,JSON.toJSONString(productBeanListSpuClass));
// 没有查到商品
// 没有查到商品
if
(
productBeanListSpuClass
==
null
||
productBeanListSpuClass
.
isEmpty
()){
if
(
productBeanListSpuClass
==
null
||
productBeanListSpuClass
.
isEmpty
()){
...
@@ -691,7 +691,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -691,7 +691,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
}
buildCoupons
(
coupons
,
shoppingCartInfoRequestVo
.
getCouponCodes
());
buildCoupons
(
coupons
,
shoppingCartInfoRequestVo
.
getCouponCodes
());
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
=
shoppingCartInfoRequestVo
.
getSendGoods
();
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
=
shoppingCartInfoRequestVo
.
getSendGoods
();
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoods
=
new
ArrayList
<>();
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoods
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
sendGoodsList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
sendGoodsList
))
{
...
@@ -1480,7 +1479,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -1480,7 +1479,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
activityCalculationDiscountRequestDto
.
setProductChannel
(
BusinessTypeEnum
.
SAAS_DELIVERY
.
getCode
());
activityCalculationDiscountRequestDto
.
setProductChannel
(
BusinessTypeEnum
.
SAAS_DELIVERY
.
getCode
());
}
}
try
{
try
{
ApiLog
.
debug
(
"activityClient discount :{}"
,
JSON
.
toJSONString
(
activityCalculationDiscountRequestDto
));
activityCalculationDiscountResponseDto
=
activityClient
.
calculationDiscount
(
activityCalculationDiscountRequestDto
);
activityCalculationDiscountResponseDto
=
activityClient
.
calculationDiscount
(
activityCalculationDiscountRequestDto
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
ErrorLog
.
printErrorLog
(
"calculation_discount_error"
,
"/calculation/discount"
,
activityCalculationDiscountRequestDto
,
ex
);
ErrorLog
.
printErrorLog
(
"calculation_discount_error"
,
"/calculation/discount"
,
activityCalculationDiscountRequestDto
,
ex
);
...
@@ -1960,9 +1958,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -1960,9 +1958,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
private
void
addProductGoods
(
AddShoppingCartGoodsRequestVo
addShoppingCartGoodsRequestVo
private
void
addProductGoods
(
AddShoppingCartGoodsRequestVo
addShoppingCartGoodsRequestVo
,
CartGoods
cartGoods
,
String
spuId2
,
String
userId
,
ShoppingCartGoodsResponseVo
shoppingCartGoodsResponseVo
,
String
spuId
,
CartGoods
cartGoods
,
String
spuId2
,
String
userId
,
ShoppingCartGoodsResponseVo
shoppingCartGoodsResponseVo
,
String
spuId
,
List
<
CartGoods
>
allCartGoodsList
,
List
<
ProductBean
>
productBeanListSpuClass
,
CouponProductDto
couponProductDto
,
String
couponCode
,
Integer
todayAvailableTimes
)
{
,
List
<
CartGoods
>
allCartGoodsList
,
List
<
ProductBean
>
productBeanListSpuClass
,
CouponProductDto
couponProductDto
,
String
couponCode
,
Integer
todayAvailableTimes
)
{
// 设置商品类型为商品券
// 设置商品类型为商品券
if
(
CouponTypeEnum
.
TYPE_4
.
getCode
().
equals
(
couponProductDto
.
getType
()))
{
if
(
CouponTypeEnum
.
TYPE_4
.
getCode
().
equals
(
couponProductDto
.
getType
()))
{
cartGoods
.
setGoodsType
(
GoodsTypeEnum
.
HG_COUPON_GOODS
.
getGoodsType
());
cartGoods
.
setGoodsType
(
GoodsTypeEnum
.
HG_COUPON_GOODS
.
getGoodsType
());
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationSharingDiscountService.java
View file @
0a4528f5
...
@@ -134,7 +134,6 @@ public class CalculationSharingDiscountService {
...
@@ -134,7 +134,6 @@ public class CalculationSharingDiscountService {
CalculationSharingDiscountRequestDto
.
CalculationDiscountCoupon
coupon
=
new
CalculationSharingDiscountRequestDto
.
CalculationDiscountCoupon
();
CalculationSharingDiscountRequestDto
.
CalculationDiscountCoupon
coupon
=
new
CalculationSharingDiscountRequestDto
.
CalculationDiscountCoupon
();
coupon
.
setCode
(
checkSpqInfo
.
getCouponCode
());
coupon
.
setCode
(
checkSpqInfo
.
getCouponCode
());
coupon
.
setActivityCode
(
checkSpqInfo
.
getActiveCode
());
coupon
.
setActivityCode
(
checkSpqInfo
.
getActiveCode
());
ApiLog
.
debug
(
"coupons={},coupon={}"
,
JSON
.
toJSONString
(
coupons
),
JSON
.
toJSONString
(
coupon
));
CalculationSharingDiscountRequestDto
.
CalculationDiscountCoupon
calculationDiscountCoupon
=
coupons
.
stream
().
filter
(
p
->
coupon
.
getActivityCode
().
equals
(
p
.
getActivityCode
())
&&
coupon
.
getCode
().
equals
(
p
.
getCode
())).
findFirst
().
orElse
(
null
);
CalculationSharingDiscountRequestDto
.
CalculationDiscountCoupon
calculationDiscountCoupon
=
coupons
.
stream
().
filter
(
p
->
coupon
.
getActivityCode
().
equals
(
p
.
getActivityCode
())
&&
coupon
.
getCode
().
equals
(
p
.
getCode
())).
findFirst
().
orElse
(
null
);
if
(
calculationDiscountCoupon
==
null
){
if
(
calculationDiscountCoupon
==
null
){
coupons
.
add
(
coupon
);
coupons
.
add
(
coupon
);
...
@@ -149,7 +148,6 @@ public class CalculationSharingDiscountService {
...
@@ -149,7 +148,6 @@ public class CalculationSharingDiscountService {
}
}
}
}
if
(
GoodsTypeEnum
.
SET_MEAL_GOODS
.
getGoodsType
().
equals
(
cartGoods
.
getGoodsType
()))
{
if
(
GoodsTypeEnum
.
SET_MEAL_GOODS
.
getGoodsType
().
equals
(
cartGoods
.
getGoodsType
()))
{
if
(
CollectionUtils
.
isEmpty
(
cartGoods
.
getProductGroupList
())
&&
CollectionUtils
.
isEmpty
(
cartGoods
.
getProductComboList
()))
{
if
(
CollectionUtils
.
isEmpty
(
cartGoods
.
getProductGroupList
())
&&
CollectionUtils
.
isEmpty
(
cartGoods
.
getProductComboList
()))
{
cartGoodsList
.
remove
(
i
);
cartGoodsList
.
remove
(
i
);
...
@@ -194,22 +192,17 @@ public class CalculationSharingDiscountService {
...
@@ -194,22 +192,17 @@ public class CalculationSharingDiscountService {
calculationSharingDiscountRequestDto
.
setOrgIds
(
commonService
.
getOrgIdsForCoupon
(
partnerId
,
storeId
));
calculationSharingDiscountRequestDto
.
setOrgIds
(
commonService
.
getOrgIdsForCoupon
(
partnerId
,
storeId
));
calculationSharingDiscountRequestDto
.
setDistributionFee
(
deliveryAmount
);
calculationSharingDiscountRequestDto
.
setDistributionFee
(
deliveryAmount
);
calculationSharingDiscountRequestDto
.
setIsMember
(
isMember
);
calculationSharingDiscountRequestDto
.
setIsMember
(
isMember
);
CalculationSharingDiscountResponseDto
sharingDiscountResponseDto
;
CalculationSharingDiscountResponseDto
sharingDiscountResponseDto
;
// 构建买一送一寄杯活动用户选择信息
// 构建买一送一寄杯活动用户选择信息
ActiveService
activeService
=
activeFactory
.
getBuildChooseGoodsService
(
partnerId
);
ActiveService
activeService
=
activeFactory
.
getBuildChooseGoodsService
(
partnerId
);
activeService
.
buildChooseGoodsService
(
calculationSharingDiscountRequestDto
,
shoppingCartInfoRequestVo
==
null
?
null
:
shoppingCartInfoRequestVo
.
getChooseGoods
());
activeService
.
buildChooseGoodsService
(
calculationSharingDiscountRequestDto
,
shoppingCartInfoRequestVo
==
null
?
null
:
shoppingCartInfoRequestVo
.
getChooseGoods
());
try
{
try
{
ApiLog
.
debug
(
"start sharing discount dto={}"
,
JSON
.
toJSONString
(
calculationSharingDiscountRequestDto
));
sharingDiscountResponseDto
=
calculationClient
.
calculationSharingDiscount
(
calculationSharingDiscountRequestDto
);
sharingDiscountResponseDto
=
calculationClient
.
calculationSharingDiscount
(
calculationSharingDiscountRequestDto
);
}
}
catch
(
Exception
e
)
{
catch
(
Exception
e
)
{
ErrorLog
.
printErrorLog
(
"calculation_discount_error"
,
"/calculation/discount/sharing"
,
calculationSharingDiscountRequestDto
,
e
);
ErrorLog
.
printErrorLog
(
"calculation_discount_error"
,
"/calculation/discount/sharing"
,
calculationSharingDiscountRequestDto
,
e
);
throw
new
ServiceException
(
ResponseResult
.
OPERATE_TOO_OFTEN
);
throw
new
ServiceException
(
ResponseResult
.
OPERATE_TOO_OFTEN
);
}
}
// 返回成功
// 返回成功
if
(
sharingDiscountResponseDto
!=
null
&&
StringUtils
.
equals
(
sharingDiscountResponseDto
.
getStatusCode
(),
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
))
{
if
(
sharingDiscountResponseDto
!=
null
&&
StringUtils
.
equals
(
sharingDiscountResponseDto
.
getStatusCode
(),
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
))
{
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
result
=
sharingDiscountResponseDto
.
getResult
();
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
result
=
sharingDiscountResponseDto
.
getResult
();
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/CouponOnlineClient.java
View file @
0a4528f5
...
@@ -2,6 +2,9 @@ package cn.freemud.service.thirdparty;
...
@@ -2,6 +2,9 @@ package cn.freemud.service.thirdparty;
//import cn.freemud.constant.IgnoreFeignLogAnnotation;
//import cn.freemud.constant.IgnoreFeignLogAnnotation;
import
cn.freemud.annotations.IgnoreFeignLogAnnotation
;
import
cn.freemud.constant.ResponseCodeConstant
;
import
cn.freemud.constant.ResponseCodeKeyConstant
;
import
cn.freemud.entities.dto.GetCouponDetailResponseDto
;
import
cn.freemud.entities.dto.GetCouponDetailResponseDto
;
import
cn.freemud.interceptor.FormSupportConfig
;
import
cn.freemud.interceptor.FormSupportConfig
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
...
@@ -18,6 +21,7 @@ public interface CouponOnlineClient {
...
@@ -18,6 +21,7 @@ public interface CouponOnlineClient {
/**
/**
* 查询券详情
* 查询券详情
*/
*/
@IgnoreFeignLogAnnotation
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
statusCodeFieldName
=
ResponseCodeKeyConstant
.
STATUS_CODE
)
@PostMapping
(
value
=
"/code_v4"
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
,
@PostMapping
(
value
=
"/code_v4"
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
,
consumes
=
{
MediaType
.
APPLICATION_FORM_URLENCODED_VALUE
}
consumes
=
{
MediaType
.
APPLICATION_FORM_URLENCODED_VALUE
}
)
)
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/CustomScoreClient.java
View file @
0a4528f5
...
@@ -32,6 +32,6 @@ public interface CustomScoreClient {
...
@@ -32,6 +32,6 @@ public interface CustomScoreClient {
* 用户可用积分
* 用户可用积分
*/
*/
@PostMapping
(
value
=
"/user/scoreUseDetail"
)
@PostMapping
(
value
=
"/user/scoreUseDetail"
)
@IgnoreFeignLogAnnotation
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
statusCodeFieldName
=
ResponseCodeKeyConstant
.
CODE
,
messageFieldName
=
ResponseCodeKeyConstant
.
MESSAGE
)
@IgnoreFeignLogAnnotation
GetUserScoreUserDetailResponse
getUserScoreUseDetail
(
@RequestBody
GetUserScoreUseDetailRequest
getUserScoreUseDetailRequest
);
GetUserScoreUserDetailResponse
getUserScoreUseDetail
(
@RequestBody
GetUserScoreUseDetailRequest
getUserScoreUseDetailRequest
);
}
}
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/CustomerApplicationClient.java
View file @
0a4528f5
...
@@ -29,8 +29,10 @@ public interface CustomerApplicationClient {
...
@@ -29,8 +29,10 @@ public interface CustomerApplicationClient {
@PostMapping
(
value
=
"/membercard/getPaidRule"
)
@PostMapping
(
value
=
"/membercard/getPaidRule"
)
@IgnoreFeignLogAnnotation
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
})
BaseResponse
<
GetPaidRuleResponseDto
>
getPaidRule
(
GetPaidRuleRequestDto
getPaidRuleRequestDto
);
BaseResponse
<
GetPaidRuleResponseDto
>
getPaidRule
(
GetPaidRuleRequestDto
getPaidRuleRequestDto
);
@PostMapping
(
value
=
"/user/getSessionUserInfo"
)
@PostMapping
(
value
=
"/user/getSessionUserInfo"
)
@IgnoreFeignLogAnnotation
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
})
@IgnoreFeignLogAnnotation
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
})
BaseResponse
<
CustomerInfoVo
>
getSessionUserInfo
(
GetSessionUserInfoDto
getSessionUserInfoDto
);
BaseResponse
<
CustomerInfoVo
>
getSessionUserInfo
(
GetSessionUserInfoDto
getSessionUserInfoDto
);
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/CustomerExtendClient.java
View file @
0a4528f5
...
@@ -13,6 +13,9 @@
...
@@ -13,6 +13,9 @@
package
cn
.
freemud
.
service
.
thirdparty
;
package
cn
.
freemud
.
service
.
thirdparty
;
import
cn.freemud.annotations.IgnoreFeignLogAnnotation
;
import
cn.freemud.constant.ResponseCodeConstant
;
import
cn.freemud.constant.ResponseCodeKeyConstant
;
import
cn.freemud.entities.dto.GetMemberCouponListRequestDto
;
import
cn.freemud.entities.dto.GetMemberCouponListRequestDto
;
import
cn.freemud.entities.dto.GetMemberCouponListResponseDto
;
import
cn.freemud.entities.dto.GetMemberCouponListResponseDto
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
...
@@ -26,6 +29,7 @@ public interface CustomerExtendClient {
...
@@ -26,6 +29,7 @@ public interface CustomerExtendClient {
/**
/**
* 会员优惠券列表
* 会员优惠券列表
*/
*/
@IgnoreFeignLogAnnotation
()
@PostMapping
(
value
=
"/customerextendservice/coupon/getCoupons"
)
@PostMapping
(
value
=
"/customerextendservice/coupon/getCoupons"
)
GetMemberCouponListResponseDto
getMemberCouponListRequestDto
(
@RequestBody
GetMemberCouponListRequestDto
getMemberCouponListRequestDto
);
GetMemberCouponListResponseDto
getMemberCouponListRequestDto
(
@RequestBody
GetMemberCouponListRequestDto
getMemberCouponListRequestDto
);
}
}
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/MemberToolsClient.java
View file @
0a4528f5
package
cn
.
freemud
.
service
.
thirdparty
;
package
cn
.
freemud
.
service
.
thirdparty
;
import
cn.freemud.annotations.IgnoreFeignLogAnnotation
;
import
cn.freemud.constant.ResponseCodeConstant
;
import
cn.freemud.constant.ResponseCodeKeyConstant
;
import
cn.freemud.entities.dto.GetMemberListRequestDto
;
import
cn.freemud.entities.dto.GetMemberListRequestDto
;
import
cn.freemud.entities.dto.GetMemberListResponseDto
;
import
cn.freemud.entities.dto.GetMemberListResponseDto
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
...
@@ -17,6 +20,7 @@ public interface MemberToolsClient {
...
@@ -17,6 +20,7 @@ public interface MemberToolsClient {
/**
/**
* 根据会员手机号和商户获取会员信息
* 根据会员手机号和商户获取会员信息
*/
*/
@IgnoreFeignLogAnnotation
@PostMapping
(
value
=
"/customerservice/getMembers"
)
@PostMapping
(
value
=
"/customerservice/getMembers"
)
GetMemberListResponseDto
getMemberList
(
@RequestBody
GetMemberListRequestDto
getMemberListRequestDto
);
GetMemberListResponseDto
getMemberList
(
@RequestBody
GetMemberListRequestDto
getMemberListRequestDto
);
}
}
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/ProductClient.java
View file @
0a4528f5
package
cn
.
freemud
.
service
.
thirdparty
;
package
cn
.
freemud
.
service
.
thirdparty
;
import
cn.freemud.annotations.IgnoreFeignLogAnnotation
;
import
cn.freemud.constant.ResponseCodeConstant
;
import
cn.freemud.constant.ResponseCodeKeyConstant
;
import
cn.freemud.entities.dto.ProductBaseResponse
;
import
cn.freemud.entities.dto.ProductBaseResponse
;
import
cn.freemud.entities.dto.RequiredProductRequest
;
import
cn.freemud.entities.dto.RequiredProductRequest
;
import
cn.freemud.entities.dto.product.ValiadShopProductResponse
;
import
cn.freemud.entities.dto.product.ValiadShopProductResponse
;
...
@@ -29,10 +32,12 @@ import java.util.List;
...
@@ -29,10 +32,12 @@ import java.util.List;
public
interface
ProductClient
{
public
interface
ProductClient
{
@PostMapping
({
"/Shop/ListMenuMustProduct"
})
@PostMapping
({
"/Shop/ListMenuMustProduct"
})
@IgnoreFeignLogAnnotation
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
statusCodeFieldName
=
ResponseCodeKeyConstant
.
ERR_CODE
,
messageFieldName
=
ResponseCodeKeyConstant
.
ERR_MSG
)
ProductBaseResponse
<
List
<
String
>>
getRequiredProductList
(
@RequestBody
RequiredProductRequest
request
);
ProductBaseResponse
<
List
<
String
>>
getRequiredProductList
(
@RequestBody
RequiredProductRequest
request
);
@PostMapping
({
"/Shop/ValidateShopProduct/Reason"
})
@PostMapping
({
"/Shop/ValidateShopProduct/Reason"
})
@IgnoreFeignLogAnnotation
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
statusCodeFieldName
=
ResponseCodeKeyConstant
.
ERR_CODE
,
messageFieldName
=
ResponseCodeKeyConstant
.
ERR_MSG
)
ProductBaseResponse
<
ValiadShopProductResponse
>
validateShopProductAboutReason
(
@RequestBody
ValidateShopProductRequest
request
);
ProductBaseResponse
<
ValiadShopProductResponse
>
validateShopProductAboutReason
(
@RequestBody
ValidateShopProductRequest
request
);
}
}
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/StockClient.java
View file @
0a4528f5
...
@@ -32,7 +32,7 @@ public interface StockClient {
...
@@ -32,7 +32,7 @@ public interface StockClient {
* 前端查询多个商品库存信息
* 前端查询多个商品库存信息
*/
*/
@PostMapping
(
"/getAvailableStocks"
)
@PostMapping
(
"/getAvailableStocks"
)
@IgnoreFeignLogAnnotation
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
}
,
statusCodeFieldName
=
ResponseCodeKeyConstant
.
CODE
,
messageFieldName
=
ResponseCodeKeyConstant
.
MESSAGE
)
@IgnoreFeignLogAnnotation
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
})
GetProductStockResponseDto
getAvailableStocks
(
@RequestBody
GetProductStockRequestDto
requestDto
);
GetProductStockResponseDto
getAvailableStocks
(
@RequestBody
GetProductStockRequestDto
requestDto
);
/**
/**
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/StoreItemClient.java
View file @
0a4528f5
...
@@ -42,35 +42,35 @@ public interface StoreItemClient {
...
@@ -42,35 +42,35 @@ public interface StoreItemClient {
* 根据商品id查询门店特定时间段菜单
* 根据商品id查询门店特定时间段菜单
*/
*/
@PostMapping
(
value
=
"/Menu/GetMenuByIds"
)
@PostMapping
(
value
=
"/Menu/GetMenuByIds"
)
@IgnoreFeignLogAnnotation
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
statusCodeFieldName
=
ResponseCodeKeyConstant
.
ERR_CODE
,
messageFieldName
=
ResponseCodeKeyConstant
.
MEG
)
GetMenuByIdsResponseDto
getMenuCategoryByIds
(
@RequestBody
GetMenuCategoryByIdsDto
getMenuCategoryByIdsDto
);
GetMenuByIdsResponseDto
getMenuCategoryByIds
(
@RequestBody
GetMenuCategoryByIdsDto
getMenuCategoryByIdsDto
);
/**
/**
* 获取商品的详细信息
* 获取商品的详细信息
*/
*/
@PostMapping
(
"/Shop/ListProductInfoByIdList"
)
@PostMapping
(
"/Shop/ListProductInfoByIdList"
)
@IgnoreFeignLogAnnotation
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
statusCodeFieldName
=
ResponseCodeKeyConstant
.
ERR_CODE
,
messageFieldName
=
ResponseCodeKeyConstant
.
MEG
)
@IgnoreFeignLogAnnotation
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
statusCodeFieldName
=
ResponseCodeKeyConstant
.
ERR_CODE
,
messageFieldName
=
ResponseCodeKeyConstant
.
MEG
)
ProductInfosDto
listProductInfos
(
@RequestBody
GetProductInfoDto
getProductInfoDto
);
ProductInfosDto
listProductInfos
(
@RequestBody
GetProductInfoDto
getProductInfoDto
);
/**
/**
* 根据skuid查询spu信息
* 根据skuid查询spu信息
* @return
* @return
*/
*/
@PostMapping
(
"/Product/GetSpectionProductBySkuId"
)
@PostMapping
(
"/Product/GetSpectionProductBySkuId"
)
@IgnoreFeignLogAnnotation
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
statusCodeFieldName
=
ResponseCodeKeyConstant
.
ERR_CODE
,
messageFieldName
=
ResponseCodeKeyConstant
.
MEG
)
ProductListDto
getSpuIdsBySkuIds
(
@RequestBody
GetSpuIdsBySkuIdsDto
requestDto
);
ProductListDto
getSpuIdsBySkuIds
(
@RequestBody
GetSpuIdsBySkuIdsDto
requestDto
);
/**
/**
* 校验商品可用性
* 校验商品可用性
*/
*/
@PostMapping
(
"Shop/ValidateShopProduct"
)
@PostMapping
(
"Shop/ValidateShopProduct"
)
@IgnoreFeignLogAnnotation
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
statusCodeFieldName
=
ResponseCodeKeyConstant
.
ERR_CODE
,
messageFieldName
=
ResponseCodeKeyConstant
.
MEG
)
ProductResponseDTO
<
ValiadShopProductResponse
>
validateShopProduct
(
@RequestBody
ValidateShopProductRequest
request
);
ProductResponseDTO
<
ValiadShopProductResponse
>
validateShopProduct
(
@RequestBody
ValidateShopProductRequest
request
);
/**
/**
* 校验商品在当前门店是否可售
* 校验商品在当前门店是否可售
*/
*/
@PostMapping
(
"/Shop/validateShopContainProduct"
)
@PostMapping
(
"/Shop/validateShopContainProduct"
)
@IgnoreFeignLogAnnotation
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
statusCodeFieldName
=
ResponseCodeKeyConstant
.
ERR_CODE
,
messageFieldName
=
ResponseCodeKeyConstant
.
MEG
)
ValidateProductInfosDto
validateShopContainProduct
(
@RequestBody
GetValidateProductInfoDto
getProductInfoDto
);
ValidateProductInfosDto
validateShopContainProduct
(
@RequestBody
GetValidateProductInfoDto
getProductInfoDto
);
}
}
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