Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
E
erp-service
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ximai
erp-service
Commits
d9ff29d1
Commit
d9ff29d1
authored
Jan 15, 2025
by
李驰骋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
请求参数日志添加
参数默认调整
parent
afa83024
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
99 additions
and
16 deletions
+99
-16
ControllerLoggingAspect.java
...nit/scanservice/ximai/common/ControllerLoggingAspect.java
+56
-0
PurccCreateParams.java
...com/topsunit/scanservice/ximai/dto/PurccCreateParams.java
+4
-2
CmsmvService.java
.../com/topsunit/scanservice/ximai/service/CmsmvService.java
+3
-0
CopthService.java
.../com/topsunit/scanservice/ximai/service/CopthService.java
+3
-0
CoptoService.java
.../com/topsunit/scanservice/ximai/service/CoptoService.java
+16
-0
PurccService.java
.../com/topsunit/scanservice/ximai/service/PurccService.java
+1
-0
application-demo.yml
src/main/resources/application-demo.yml
+1
-3
application-dev.yml
src/main/resources/application-dev.yml
+6
-4
application-test-sh.yml
src/main/resources/application-test-sh.yml
+5
-5
application.yml
src/main/resources/application.yml
+1
-1
messages.properties
src/main/resources/i18n/messages.properties
+3
-1
No files found.
src/main/java/com/topsunit/scanservice/ximai/common/ControllerLoggingAspect.java
0 → 100644
View file @
d9ff29d1
package
com
.
topsunit
.
scanservice
.
ximai
.
common
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Before
;
import
org.aspectj.lang.annotation.Pointcut
;
import
org.aspectj.lang.reflect.MethodSignature
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Component
;
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.Arrays
;
import
java.util.HashMap
;
import
java.util.Map
;
@Aspect
@Component
public
class
ControllerLoggingAspect
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
"com.topsunit.scanservice.ximai.controller"
);
// 定义切点,拦截控制器中的所有方法
@Pointcut
(
"execution(* com.topsunit.scanservice.ximai.controller..*(..))"
)
public
void
controllerPointcut
()
{
}
// 在控制器方法执行前添加日志记录
@Before
(
"controllerPointcut()"
)
public
void
logBefore
(
JoinPoint
joinPoint
)
{
if
(
logger
.
isDebugEnabled
())
{
ServletRequestAttributes
attributes
=
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
HttpServletRequest
request
=
attributes
.
getRequest
();
StringBuilder
logMessage
=
new
StringBuilder
();
logMessage
.
append
(
"Request to "
).
append
(
request
.
getRequestURI
()).
append
(
" | Method: "
).
append
(
request
.
getMethod
()).
append
(
"\n"
);
logMessage
.
append
(
"Parameters: "
);
MethodSignature
signature
=
(
MethodSignature
)
joinPoint
.
getSignature
();
Method
method
=
signature
.
getMethod
();
Parameter
[]
parameters
=
method
.
getParameters
();
Map
<
String
,
Object
>
parameterMap
=
new
HashMap
<>();
for
(
int
i
=
0
;
i
<
parameters
.
length
;
i
++)
{
Parameter
parameter
=
parameters
[
i
];
String
parameterName
=
parameter
.
getName
();
Object
value
=
joinPoint
.
getArgs
()[
i
];
parameterMap
.
put
(
parameterName
,
value
);
}
logMessage
.
append
(
parameterMap
);
logger
.
debug
(
logMessage
.
toString
());
}
}
}
src/main/java/com/topsunit/scanservice/ximai/dto/PurccCreateParams.java
View file @
d9ff29d1
...
@@ -34,19 +34,21 @@ public class PurccCreateParams {
...
@@ -34,19 +34,21 @@ public class PurccCreateParams {
@ApiModelProperty
(
"供货商号"
)
@ApiModelProperty
(
"供货商号"
)
private
String
cc005
;
private
String
cc005
;
@ApiModelProperty
(
""
)
@ApiModelProperty
(
""
)
private
String
cc006
;
private
String
cc006
=
""
;
@ApiModelProperty
(
"打印方式"
)
@ApiModelProperty
(
"打印方式"
)
private
String
cc008
=
"1"
;
private
String
cc008
=
"1"
;
@ApiModelProperty
(
"审核状态"
)
@ApiModelProperty
(
"审核状态"
)
private
String
cc009
=
"N"
;
private
String
cc009
=
"N"
;
@ApiModelProperty
(
"单据日期"
)
@ApiModelProperty
(
"单据日期"
)
private
String
cc010
;
private
String
cc010
;
@ApiModelProperty
(
""
)
private
String
cc011
=
""
;
@ApiModelProperty
(
"供货商名称"
)
@ApiModelProperty
(
"供货商名称"
)
private
String
cc012
;
private
String
cc012
;
@ApiModelProperty
(
"表身到货总数量"
)
@ApiModelProperty
(
"表身到货总数量"
)
private
BigDecimal
cc013
;
private
BigDecimal
cc013
;
@ApiModelProperty
(
""
)
@ApiModelProperty
(
""
)
private
String
cc026
;
private
String
cc026
=
""
;
@ApiModelProperty
(
"库房标识"
)
@ApiModelProperty
(
"库房标识"
)
private
String
udf01
;
private
String
udf01
;
@ApiModelProperty
(
"到货明细"
)
@ApiModelProperty
(
"到货明细"
)
...
...
src/main/java/com/topsunit/scanservice/ximai/service/CmsmvService.java
View file @
d9ff29d1
...
@@ -87,6 +87,9 @@ public class CmsmvService {
...
@@ -87,6 +87,9 @@ public class CmsmvService {
throw
new
TopsunitException
(
loginResult2
.
getMsg
());
throw
new
TopsunitException
(
loginResult2
.
getMsg
());
}
}
LoginResult
loginResult
=
tokenService
.
getUserByToken
(
loginResult2
.
getToken
());
LoginResult
loginResult
=
tokenService
.
getUserByToken
(
loginResult2
.
getToken
());
if
(
StringUtil
.
isNullOrEmpty
(
exAccountInfo
.
getAccountCode
())){
throw
new
TopsunitException
(
MessageUtils
.
getMessage
(
"请维护账套数据库编码"
));
}
//生成扫码自生token
//生成扫码自生token
String
newToken
=
tokenManger
.
generate
(
loginParams
.
getUsername
(),
loginResult
.
getLocal
(),
exAccountInfo
.
getAccountCode
());
String
newToken
=
tokenManger
.
generate
(
loginParams
.
getUsername
(),
loginResult
.
getLocal
(),
exAccountInfo
.
getAccountCode
());
loginResult
.
setToken
(
newToken
);
loginResult
.
setToken
(
newToken
);
...
...
src/main/java/com/topsunit/scanservice/ximai/service/CopthService.java
View file @
d9ff29d1
package
com
.
topsunit
.
scanservice
.
ximai
.
service
;
package
com
.
topsunit
.
scanservice
.
ximai
.
service
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.topsunit.scanservice.ximai.common.DateUtil
;
import
com.topsunit.scanservice.ximai.common.DateUtil
;
import
com.topsunit.scanservice.ximai.common.TopsunitException
;
import
com.topsunit.scanservice.ximai.common.TopsunitException
;
import
com.topsunit.scanservice.ximai.dao.CoptgDao
;
import
com.topsunit.scanservice.ximai.dao.CoptgDao
;
...
@@ -52,6 +53,8 @@ public class CopthService {
...
@@ -52,6 +53,8 @@ public class CopthService {
coptg
.
setTg044
(
coptn
.
getTn030
());
coptg
.
setTg044
(
coptn
.
getTn030
());
int
i
=
1
;
int
i
=
1
;
for
(
StockSaleOutParams
.
StockSaleOutDetail
s
:
params
.
getData
()){
for
(
StockSaleOutParams
.
StockSaleOutDetail
s
:
params
.
getData
()){
s
.
setWarehouse
(
StrUtil
.
trim
(
s
.
getWarehouse
()));
s
.
setLocation
(
StrUtil
.
trim
(
s
.
getLocation
()));
//查询出货通知单明细
//查询出货通知单明细
Copto
copto
=
coptoDao
.
findFirstByTo001AndTo002AndTo007
(
"251"
,
params
.
getApplyNo
(),
s
.
getMaterialNo
())
Copto
copto
=
coptoDao
.
findFirstByTo001AndTo002AndTo007
(
"251"
,
params
.
getApplyNo
(),
s
.
getMaterialNo
())
.
orElseThrow
(()->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到出货通知单明细:{0},{1}"
,
params
.
getApplyNo
(),
s
.
getMaterialNo
())));
.
orElseThrow
(()->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到出货通知单明细:{0},{1}"
,
params
.
getApplyNo
(),
s
.
getMaterialNo
())));
...
...
src/main/java/com/topsunit/scanservice/ximai/service/CoptoService.java
View file @
d9ff29d1
...
@@ -2,6 +2,7 @@ package com.topsunit.scanservice.ximai.service;
...
@@ -2,6 +2,7 @@ package com.topsunit.scanservice.ximai.service;
import
cn.hutool.core.util.NumberUtil
;
import
cn.hutool.core.util.NumberUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.topsunit.scanservice.ximai.common.TopsunitException
;
import
com.topsunit.scanservice.ximai.dao.CoptgDao
;
import
com.topsunit.scanservice.ximai.dao.CoptgDao
;
import
com.topsunit.scanservice.ximai.dao.CopthDao
;
import
com.topsunit.scanservice.ximai.dao.CopthDao
;
import
com.topsunit.scanservice.ximai.dao.CoptoDao
;
import
com.topsunit.scanservice.ximai.dao.CoptoDao
;
...
@@ -9,6 +10,7 @@ import com.topsunit.scanservice.ximai.dto.StockSaleOutDto;
...
@@ -9,6 +10,7 @@ import com.topsunit.scanservice.ximai.dto.StockSaleOutDto;
import
com.topsunit.scanservice.ximai.dto.StockSaleOutQueryParams
;
import
com.topsunit.scanservice.ximai.dto.StockSaleOutQueryParams
;
import
com.topsunit.scanservice.ximai.entity.Copth
;
import
com.topsunit.scanservice.ximai.entity.Copth
;
import
com.topsunit.scanservice.ximai.entity.Copto
;
import
com.topsunit.scanservice.ximai.entity.Copto
;
import
com.topsunit.scanservice.ximai.utils.MessageUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -27,10 +29,18 @@ public class CoptoService {
...
@@ -27,10 +29,18 @@ public class CoptoService {
@Autowired
@Autowired
private
CopthDao
copthDao
;
private
CopthDao
copthDao
;
/**
* 查询出货通知单
* @param params
* @return
*/
public
StockSaleOutDto
getStockSaleOutDto
(
StockSaleOutQueryParams
params
){
public
StockSaleOutDto
getStockSaleOutDto
(
StockSaleOutQueryParams
params
){
StockSaleOutDto
rst
=
new
StockSaleOutDto
();
StockSaleOutDto
rst
=
new
StockSaleOutDto
();
List
<
StockSaleOutDto
.
StockSaleOutDetail
>
data
=
new
ArrayList
<>();
List
<
StockSaleOutDto
.
StockSaleOutDetail
>
data
=
new
ArrayList
<>();
List
<
Copto
>
list
=
coptoDao
.
findByTo001AndTo002
(
"251"
,
params
.
getSaleOutNo
());
List
<
Copto
>
list
=
coptoDao
.
findByTo001AndTo002
(
"251"
,
params
.
getSaleOutNo
());
if
(
list
.
isEmpty
()){
throw
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到出货通知单:"
)+
params
.
getSaleOutNo
());
}
//查询已出库通知单数据,扣减相应数量
//查询已出库通知单数据,扣减相应数量
Map
<
String
,
List
<
Copth
>>
copthMap
=
copthDao
.
findByTh045AndTh046
(
"251"
,
params
.
getSaleOutNo
()).
stream
()
Map
<
String
,
List
<
Copth
>>
copthMap
=
copthDao
.
findByTh045AndTh046
(
"251"
,
params
.
getSaleOutNo
()).
stream
()
.
collect
(
Collectors
.
groupingBy
(
s
->
StrUtil
.
trim
(
s
.
getTh004
())));
.
collect
(
Collectors
.
groupingBy
(
s
->
StrUtil
.
trim
(
s
.
getTh004
())));
...
@@ -49,12 +59,18 @@ public class CoptoService {
...
@@ -49,12 +59,18 @@ public class CoptoService {
}
else
{
}
else
{
saleOutDetail
.
setDeliverQuantity
(
s
.
getTo024
());
saleOutDetail
.
setDeliverQuantity
(
s
.
getTo024
());
}
}
if
(
saleOutDetail
.
getDeliverQuantity
().
compareTo
(
BigDecimal
.
ZERO
)<=
0
){
return
;
}
saleOutDetail
.
setPlanOutDate
(
s
.
getUdf01
());
saleOutDetail
.
setPlanOutDate
(
s
.
getUdf01
());
saleOutDetail
.
setMaterialName
(
StrUtil
.
trim
(
s
.
getTo008
()));
saleOutDetail
.
setMaterialName
(
StrUtil
.
trim
(
s
.
getTo008
()));
saleOutDetail
.
setMaterialNo
(
StrUtil
.
trim
(
s
.
getTo007
()));
saleOutDetail
.
setMaterialNo
(
StrUtil
.
trim
(
s
.
getTo007
()));
saleOutDetail
.
setUnit
(
StrUtil
.
trim
(
s
.
getTo010
()));
saleOutDetail
.
setUnit
(
StrUtil
.
trim
(
s
.
getTo010
()));
data
.
add
(
saleOutDetail
);
data
.
add
(
saleOutDetail
);
});
});
if
(
data
.
isEmpty
()){
throw
new
TopsunitException
(
MessageUtils
.
getMessage
(
"通知单{0}已全部出库"
,
params
.
getSaleOutNo
()));
}
rst
.
setData
(
data
);
rst
.
setData
(
data
);
rst
.
setApplyNo
(
params
.
getSaleOutNo
());
rst
.
setApplyNo
(
params
.
getSaleOutNo
());
return
rst
;
return
rst
;
...
...
src/main/java/com/topsunit/scanservice/ximai/service/PurccService.java
View file @
d9ff29d1
...
@@ -270,6 +270,7 @@ public class PurccService {
...
@@ -270,6 +270,7 @@ public class PurccService {
purcd
.
setCd013
(
detail
.
getArrivalQuantity
());
purcd
.
setCd013
(
detail
.
getArrivalQuantity
());
purcd
.
setCd015
(
purtd
.
getTd009
());
purcd
.
setCd015
(
purtd
.
getTd009
());
purcd
.
setCd016
(
purtd
.
getTd007
());
purcd
.
setCd016
(
purtd
.
getTd007
());
purcd
.
setCd021
(
invmb
.
getMb004
());
purcdDao
.
save
(
purcd
);
purcdDao
.
save
(
purcd
);
sumQuantity
=
sumQuantity
.
add
(
detail
.
getArrivalQuantity
());
sumQuantity
=
sumQuantity
.
add
(
detail
.
getArrivalQuantity
());
i
++;
i
++;
...
...
src/main/resources/application-demo.yml
View file @
d9ff29d1
...
@@ -14,9 +14,7 @@ server:
...
@@ -14,9 +14,7 @@ server:
logging
:
logging
:
level
:
level
:
root
:
info
root
:
info
org
:
org.springframework.web
:
TRACE
springframework
:
web
:
info
com.topsunit
:
info
com.topsunit
:
info
spring
:
spring
:
messages
:
messages
:
...
...
src/main/resources/application-dev.yml
View file @
d9ff29d1
...
@@ -14,10 +14,12 @@ server:
...
@@ -14,10 +14,12 @@ server:
logging
:
logging
:
level
:
level
:
root
:
warn
root
:
warn
org
:
com
:
springframework
:
topsunit
:
web
:
debug
scanservice
:
com.topsunit
:
debug
ximai
:
controller
:
debug
com.topsunit
:
info
druid
:
druid
:
sql
:
sql
:
Statement
:
debug
Statement
:
debug
...
...
src/main/resources/application-test-sh.yml
View file @
d9ff29d1
...
@@ -14,12 +14,12 @@ server:
...
@@ -14,12 +14,12 @@ server:
logging
:
logging
:
level
:
level
:
root
:
info
root
:
info
org
:
com
:
springframework
:
topsunit
:
web
:
info
scanservice
:
ximai
:
controller
:
debug
com.topsunit
:
info
com.topsunit
:
info
org.springframework.web.servlet.DispatcherServlet
:
DEBUG
org.springframework.web.filter.CommonsRequestLoggingFilter
:
DEBUG
file
:
file
:
name
:
logs/erp-service.log
name
:
logs/erp-service.log
spring
:
spring
:
...
...
src/main/resources/application.yml
View file @
d9ff29d1
spring
:
spring
:
profiles
:
profiles
:
active
:
active
:
-
dev
-
test-sh
\ No newline at end of file
\ No newline at end of file
src/main/resources/i18n/messages.properties
View file @
d9ff29d1
...
@@ -36,4 +36,6 @@
...
@@ -36,4 +36,6 @@
品号{0}批号{1}库存不足。=品号{0}批号{1}库存不足。
品号{0}批号{1}库存不足。=品号{0}批号{1}库存不足。
未找到采购订单{0},{1}=未找到采购订单{0},{1}
未找到采购订单{0},{1}=未找到采购订单{0},{1}
未找到采购订单{0},{1},{2}=未找到采购订单{0},{1},{2}
未找到采购订单{0},{1},{2}=未找到采购订单{0},{1},{2}
未找到工单:{0},{1}=未找到工单:{0},{1}
未找到工单:{0},{1}=未找到工单:{0},{1}
\ No newline at end of file
请维护账套数据库编码=请维护账套数据库编码
通知单{0}已全部出库=通知单{0}已全部出库
\ No newline at end of file
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