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
6c0122e6
Commit
6c0122e6
authored
Jan 14, 2025
by
李驰骋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户登录、默认值调整
parent
84153a28
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
76 additions
and
100 deletions
+76
-100
InvtaCreateParams.java
...com/topsunit/scanservice/ximai/dto/InvtaCreateParams.java
+6
-6
InvtbCreateParams.java
...com/topsunit/scanservice/ximai/dto/InvtbCreateParams.java
+15
-15
LoginResult.java
.../java/com/topsunit/scanservice/ximai/dto/LoginResult.java
+3
-32
ExAccountInfo.java
.../com/topsunit/scanservice/ximai/entity/ExAccountInfo.java
+5
-1
EntityChangeListener.java
...nservice/ximai/entity/listeners/EntityChangeListener.java
+4
-1
AuthenticationInterceptor.java
...scanservice/ximai/security/AuthenticationInterceptor.java
+3
-4
CurrentActorManager.java
...sunit/scanservice/ximai/security/CurrentActorManager.java
+7
-0
CurrentActorSetter.java
...psunit/scanservice/ximai/security/CurrentActorSetter.java
+1
-0
TokenService.java
...com/topsunit/scanservice/ximai/security/TokenService.java
+14
-34
CmsmvService.java
.../com/topsunit/scanservice/ximai/service/CmsmvService.java
+14
-5
InvtaService.java
.../com/topsunit/scanservice/ximai/service/InvtaService.java
+4
-2
No files found.
src/main/java/com/topsunit/scanservice/ximai/dto/InvtaCreateParams.java
View file @
6c0122e6
...
@@ -51,13 +51,13 @@ public class InvtaCreateParams {
...
@@ -51,13 +51,13 @@ public class InvtaCreateParams {
@ApiModelProperty
(
"单据日期"
)
@ApiModelProperty
(
"单据日期"
)
private
String
ta014
;
private
String
ta014
;
@ApiModelProperty
(
"审核者"
)
@ApiModelProperty
(
"审核者"
)
private
String
ta015
;
private
String
ta015
=
""
;
@ApiModelProperty
(
"总包装数量"
)
@ApiModelProperty
(
"总包装数量"
)
private
BigDecimal
ta016
;
private
BigDecimal
ta016
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"签核状态码"
)
@ApiModelProperty
(
"签核状态码"
)
private
String
ta017
=
"N"
;
private
String
ta017
=
"N"
;
@ApiModelProperty
(
"海关手册"
)
@ApiModelProperty
(
"海关手册"
)
private
String
ta018
;
private
String
ta018
=
""
;
@ApiModelProperty
(
"审批意见"
)
@ApiModelProperty
(
"审批意见"
)
private
String
ta019
;
private
String
ta019
;
@ApiModelProperty
(
"不合格原因"
)
@ApiModelProperty
(
"不合格原因"
)
...
@@ -65,11 +65,11 @@ public class InvtaCreateParams {
...
@@ -65,11 +65,11 @@ public class InvtaCreateParams {
@ApiModelProperty
(
"传送次数"
)
@ApiModelProperty
(
"传送次数"
)
private
Integer
ta021
=
0
;
private
Integer
ta021
=
0
;
@ApiModelProperty
(
"汇入日期"
)
@ApiModelProperty
(
"汇入日期"
)
private
String
ta022
;
private
String
ta022
=
""
;
@ApiModelProperty
(
"门店编号"
)
@ApiModelProperty
(
"门店编号"
)
private
String
ta023
;
private
String
ta023
=
""
;
@ApiModelProperty
(
"对方汇出日期"
)
@ApiModelProperty
(
"对方汇出日期"
)
private
String
ta024
;
private
String
ta024
=
""
;
@ApiModelProperty
(
"单据来源"
)
@ApiModelProperty
(
"单据来源"
)
private
String
ta025
=
"1"
;
private
String
ta025
=
"1"
;
@ApiModelProperty
(
"批号"
)
@ApiModelProperty
(
"批号"
)
...
...
src/main/java/com/topsunit/scanservice/ximai/dto/InvtbCreateParams.java
View file @
6c0122e6
...
@@ -36,48 +36,48 @@ public class InvtbCreateParams {
...
@@ -36,48 +36,48 @@ public class InvtbCreateParams {
@ApiModelProperty
(
"库存数量"
)
@ApiModelProperty
(
"库存数量"
)
private
BigDecimal
tb009
;
private
BigDecimal
tb009
;
@ApiModelProperty
(
"单位成本"
)
@ApiModelProperty
(
"单位成本"
)
private
BigDecimal
tb010
;
private
BigDecimal
tb010
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"金额"
)
@ApiModelProperty
(
"金额"
)
private
BigDecimal
tb011
;
private
BigDecimal
tb011
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"转出库"
)
@ApiModelProperty
(
"转出库"
)
private
String
tb012
;
private
String
tb012
;
@ApiModelProperty
(
"转入库"
)
@ApiModelProperty
(
"转入库"
)
private
String
tb013
;
private
String
tb013
=
""
;
@ApiModelProperty
(
"批号"
)
@ApiModelProperty
(
"批号"
)
private
String
tb014
=
"********************"
;
private
String
tb014
=
"********************"
;
@ApiModelProperty
(
"有效日期"
)
@ApiModelProperty
(
"有效日期"
)
private
String
tb015
;
private
String
tb015
=
""
;
@ApiModelProperty
(
"复检日期"
)
@ApiModelProperty
(
"复检日期"
)
private
String
tb016
;
private
String
tb016
=
""
;
@ApiModelProperty
(
"备注"
)
@ApiModelProperty
(
"备注"
)
private
String
tb017
;
private
String
tb017
=
""
;
@ApiModelProperty
(
"审核码"
)
@ApiModelProperty
(
"审核码"
)
private
String
tb018
=
"N"
;
private
String
tb018
=
"N"
;
@ApiModelProperty
(
"预留字段"
)
@ApiModelProperty
(
"预留字段"
)
private
String
tb019
;
private
String
tb019
;
@ApiModelProperty
(
"小单位"
)
@ApiModelProperty
(
"小单位"
)
private
String
tb020
;
private
String
tb020
=
""
;
@ApiModelProperty
(
"项目编号"
)
@ApiModelProperty
(
"项目编号"
)
private
String
tb021
=
"********************"
;
private
String
tb021
=
"********************"
;
@ApiModelProperty
(
"包装数量"
)
@ApiModelProperty
(
"包装数量"
)
private
BigDecimal
tb022
=
BigDecimal
.
ZERO
;
private
BigDecimal
tb022
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"包装单位"
)
@ApiModelProperty
(
"包装单位"
)
private
String
tb023
;
private
String
tb023
=
""
;
@ApiModelProperty
(
"存储位置"
)
@ApiModelProperty
(
"存储位置"
)
private
String
tb024
;
private
String
tb024
=
""
;
@ApiModelProperty
(
"已销毁数量"
)
@ApiModelProperty
(
"已销毁数量"
)
private
BigDecimal
tb025
;
private
BigDecimal
tb025
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"件装"
)
@ApiModelProperty
(
"件装"
)
private
BigDecimal
tb026
;
private
BigDecimal
tb026
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"件数"
)
@ApiModelProperty
(
"件数"
)
private
BigDecimal
tb027
;
private
BigDecimal
tb027
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"批号说明"
)
@ApiModelProperty
(
"批号说明"
)
private
String
tb028
;
private
String
tb028
=
""
;
@ApiModelProperty
(
"转出库位"
)
@ApiModelProperty
(
"转出库位"
)
private
String
tb029
;
private
String
tb029
;
@ApiModelProperty
(
"转入库位"
)
@ApiModelProperty
(
"转入库位"
)
private
String
tb030
;
private
String
tb030
=
""
;
@ApiModelProperty
(
"生产日期"
)
@ApiModelProperty
(
"生产日期"
)
private
String
tb031
;
private
String
tb031
=
""
;
}
}
src/main/java/com/topsunit/scanservice/ximai/dto/LoginResult.java
View file @
6c0122e6
package
com
.
topsunit
.
scanservice
.
ximai
.
dto
;
package
com
.
topsunit
.
scanservice
.
ximai
.
dto
;
import
lombok.Data
;
/**
/**
* <p>Title: LoginResult</p>
* <p>Title: LoginResult</p>
* <p>Description: 登陆结果</p>
* <p>Description: 登陆结果</p>
...
@@ -8,6 +10,7 @@ package com.topsunit.scanservice.ximai.dto;
...
@@ -8,6 +10,7 @@ package com.topsunit.scanservice.ximai.dto;
* @version V1.0
* @version V1.0
* @date 2021/10/19
* @date 2021/10/19
*/
*/
@Data
public
class
LoginResult
{
public
class
LoginResult
{
/**
/**
* 员工编号
* 员工编号
...
@@ -25,36 +28,4 @@ public class LoginResult {
...
@@ -25,36 +28,4 @@ public class LoginResult {
* token
* token
*/
*/
private
String
token
;
private
String
token
;
public
String
getMv001
()
{
return
mv001
;
}
public
void
setMv001
(
String
mv001
)
{
this
.
mv001
=
mv001
;
}
public
String
getMv002
()
{
return
mv002
;
}
public
void
setMv002
(
String
mv002
)
{
this
.
mv002
=
mv002
;
}
public
String
getMv004
()
{
return
mv004
;
}
public
void
setMv004
(
String
mv004
)
{
this
.
mv004
=
mv004
;
}
public
String
getToken
()
{
return
token
;
}
public
void
setToken
(
String
token
)
{
this
.
token
=
token
;
}
}
}
src/main/java/com/topsunit/scanservice/ximai/entity/ExAccountInfo.java
View file @
6c0122e6
...
@@ -21,12 +21,16 @@ import javax.persistence.Table;
...
@@ -21,12 +21,16 @@ import javax.persistence.Table;
@Table
(
name
=
"EX_ACCOUNT_INFO"
)
@Table
(
name
=
"EX_ACCOUNT_INFO"
)
public
class
ExAccountInfo
{
public
class
ExAccountInfo
{
@Id
@Id
String
id
;
Integer
id
;
@ApiModelProperty
(
"套账名称"
)
@ApiModelProperty
(
"套账名称"
)
@Column
(
name
=
"ACCOUNT_NAME"
)
@Column
(
name
=
"ACCOUNT_NAME"
)
String
accountName
;
String
accountName
;
@ApiModelProperty
(
"套账编码"
)
@Column
(
name
=
"ACCOUNT_CODE"
)
String
accountCode
;
@ApiModelProperty
(
"接口地睛"
)
@ApiModelProperty
(
"接口地睛"
)
@Column
(
name
=
"API_URL"
)
@Column
(
name
=
"API_URL"
)
String
apiUrl
;
String
apiUrl
;
...
...
src/main/java/com/topsunit/scanservice/ximai/entity/listeners/EntityChangeListener.java
View file @
6c0122e6
...
@@ -26,6 +26,9 @@ public class EntityChangeListener implements ApplicationContextAware {
...
@@ -26,6 +26,9 @@ public class EntityChangeListener implements ApplicationContextAware {
private
Cmsmv
getCurrentActor
(){
private
Cmsmv
getCurrentActor
(){
return
applicationContext
.
getBean
(
CurrentActorSetter
.
class
).
getActor
();
return
applicationContext
.
getBean
(
CurrentActorSetter
.
class
).
getActor
();
}
}
private
String
getCurrentActorStr
(){
return
applicationContext
.
getBean
(
CurrentActorSetter
.
class
).
getActorStr
();
}
private
String
getCompany
(){
private
String
getCompany
(){
return
applicationContext
.
getBean
(
CurrentActorSetter
.
class
).
getCompany
();
return
applicationContext
.
getBean
(
CurrentActorSetter
.
class
).
getCompany
();
}
}
...
@@ -37,8 +40,8 @@ public class EntityChangeListener implements ApplicationContextAware {
...
@@ -37,8 +40,8 @@ public class EntityChangeListener implements ApplicationContextAware {
Cmsmv
currentActor
=
getCurrentActor
();
Cmsmv
currentActor
=
getCurrentActor
();
String
company
=
getCompany
();
String
company
=
getCompany
();
entity
.
setCompany
(
company
);
entity
.
setCompany
(
company
);
entity
.
setCreator
(
getCurrentActorStr
());
if
(
currentActor
!=
null
)
{
if
(
currentActor
!=
null
)
{
entity
.
setCreator
(
currentActor
.
getMv001
());
entity
.
setUsr_group
(
currentActor
.
getUsr_group
());
entity
.
setUsr_group
(
currentActor
.
getUsr_group
());
}
}
entity
.
setCreateDate
(
DateUtil
.
currentDateTimeString
());
entity
.
setCreateDate
(
DateUtil
.
currentDateTimeString
());
...
...
src/main/java/com/topsunit/scanservice/ximai/security/AuthenticationInterceptor.java
View file @
6c0122e6
...
@@ -71,11 +71,10 @@ public class AuthenticationInterceptor implements HandlerInterceptor {
...
@@ -71,11 +71,10 @@ public class AuthenticationInterceptor implements HandlerInterceptor {
if
(
authorization
==
null
||
authorization
.
isEmpty
())
{
if
(
authorization
==
null
||
authorization
.
isEmpty
())
{
throw
new
RuntimeException
(
"无Authorization,请登录"
);
throw
new
RuntimeException
(
"无Authorization,请登录"
);
}
}
if
(!
authorization
.
startsWith
(
"Bearer "
))
{
String
token
=
authorization
;
throw
new
RuntimeException
(
"不支持的验证方式,请使用Bearer Token"
);
if
(
authorization
.
startsWith
(
"Bearer "
))
{
token
=
authorization
.
substring
(
7
);
}
}
String
token
=
authorization
.
substring
(
7
);
TokenAudience
tokenAudience
=
tokenManger
.
getTokenAudience
(
token
);
TokenAudience
tokenAudience
=
tokenManger
.
getTokenAudience
(
token
);
CurrentActorSetter
currentActorSetter
=
applicationContext
.
getBean
(
CurrentActorSetter
.
class
);
CurrentActorSetter
currentActorSetter
=
applicationContext
.
getBean
(
CurrentActorSetter
.
class
);
currentActorSetter
.
setActor
(
tokenAudience
.
getActorId
());
currentActorSetter
.
setActor
(
tokenAudience
.
getActorId
());
...
...
src/main/java/com/topsunit/scanservice/ximai/security/CurrentActorManager.java
View file @
6c0122e6
...
@@ -20,6 +20,7 @@ public class CurrentActorManager implements CurrentActorSetter {
...
@@ -20,6 +20,7 @@ public class CurrentActorManager implements CurrentActorSetter {
private
Cmsmv
cmsmv
;
private
Cmsmv
cmsmv
;
private
String
company
;
private
String
company
;
private
String
usr_group
;
private
String
usr_group
;
private
String
actor
;
private
final
CmsmvDao
cmsmvDao
;
private
final
CmsmvDao
cmsmvDao
;
private
final
AdmmfDao
admmfDao
;
private
final
AdmmfDao
admmfDao
;
...
@@ -35,9 +36,15 @@ public class CurrentActorManager implements CurrentActorSetter {
...
@@ -35,9 +36,15 @@ public class CurrentActorManager implements CurrentActorSetter {
@Override
@Override
public
void
setActor
(
String
id
)
{
public
void
setActor
(
String
id
)
{
this
.
actor
=
id
;
cmsmvDao
.
findById
(
id
).
ifPresent
(
i
->
cmsmv
=
i
);
cmsmvDao
.
findById
(
id
).
ifPresent
(
i
->
cmsmv
=
i
);
}
}
@Override
public
String
getActorStr
()
{
return
actor
;
}
@Override
@Override
public
void
setCompany
(
String
company
)
{
public
void
setCompany
(
String
company
)
{
this
.
company
=
company
;
this
.
company
=
company
;
...
...
src/main/java/com/topsunit/scanservice/ximai/security/CurrentActorSetter.java
View file @
6c0122e6
...
@@ -13,6 +13,7 @@ import com.topsunit.scanservice.ximai.entity.Cmsmv;
...
@@ -13,6 +13,7 @@ import com.topsunit.scanservice.ximai.entity.Cmsmv;
public
interface
CurrentActorSetter
{
public
interface
CurrentActorSetter
{
void
setActor
(
String
id
);
void
setActor
(
String
id
);
Cmsmv
getActor
();
Cmsmv
getActor
();
String
getActorStr
();
void
setCompany
(
String
company
);
void
setCompany
(
String
company
);
String
getCompany
();
String
getCompany
();
...
...
src/main/java/com/topsunit/scanservice/ximai/security/TokenService.java
View file @
6c0122e6
package
com
.
topsunit
.
scanservice
.
ximai
.
security
;
package
com
.
topsunit
.
scanservice
.
ximai
.
security
;
import
com.auth0.jwt.JWT
;
import
com.auth0.jwt.algorithms.Algorithm
;
import
com.topsunit.scanservice.ximai.common.AppConfig
;
import
com.topsunit.scanservice.ximai.common.AppConfig
;
import
com.topsunit.scanservice.ximai.common.Constants
;
import
com.topsunit.scanservice.ximai.common.Constants
;
import
com.topsunit.scanservice.ximai.common.TopsunitException
;
import
com.topsunit.scanservice.ximai.common.TopsunitException
;
...
@@ -12,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -12,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
...
@@ -27,39 +30,6 @@ public class TokenService
...
@@ -27,39 +30,6 @@ public class TokenService
AppConfig
appConfig
;
AppConfig
appConfig
;
/**
* 获取用户身份信息
*
* @return 用户信息
*/
public
LoginResult
getLoginUser
(
HttpServletRequest
request
)
{
LoginResult
rst
=
new
LoginResult
();
// 获取请求携带的令牌
String
token
=
getToken
(
request
);
if
(
StringUtils
.
isNotEmpty
(
token
))
{
try
{
Claims
claims
=
parseToken
(
token
);
// 解析对应的权限以及用户信息
String
uuid
=
(
String
)
claims
.
get
(
Constants
.
LOGIN_USER_KEY
);
String
userName
=
(
String
)
claims
.
get
(
Constants
.
JWT_USERNAME
);
String
userKey
=
getTokenKey
(
uuid
);
rst
.
setMv001
(
userName
);
rst
.
setMv002
(
userName
);
rst
.
setToken
(
token
);
return
rst
;
}
catch
(
Exception
e
)
{
throw
new
TopsunitException
(
e
);
}
}
return
null
;
}
/**
/**
* 从令牌中获取数据声明
* 从令牌中获取数据声明
*
*
...
@@ -74,6 +44,15 @@ public class TokenService
...
@@ -74,6 +44,15 @@ public class TokenService
.
getBody
();
.
getBody
();
}
}
public
String
generate
(
String
id
,
String
company
)
{
Date
expiresAt
=
new
Date
(
System
.
currentTimeMillis
()
+
appConfig
.
getTokenExpires
());
return
JWT
.
create
()
.
withAudience
(
id
,
company
)
.
withExpiresAt
(
expiresAt
)
.
sign
(
Algorithm
.
HMAC256
((
id
).
toString
()));
}
/**
/**
* 从令牌中获取用户名
* 从令牌中获取用户名
*
*
...
@@ -119,9 +98,10 @@ public class TokenService
...
@@ -119,9 +98,10 @@ public class TokenService
try
try
{
{
Claims
claims
=
parseToken
(
token
);
Claims
claims
=
parseToken
(
token
);
// 解析对应的权限以及用户信息
// 解析对应的权限以及用户信息
String
uuid
=
(
String
)
claims
.
get
(
Constants
.
LOGIN_USER_KEY
);
String
uuid
=
(
String
)
claims
.
get
(
Constants
.
LOGIN_USER_KEY
);
String
userName
=
(
String
)
claims
.
get
(
Constants
.
JWT_USERNAME
);
String
userName
=
(
String
)
claims
.
get
(
Constants
.
JWT_USERNAME
);
String
userKey
=
getTokenKey
(
uuid
);
String
userKey
=
getTokenKey
(
uuid
);
rst
.
setMv001
(
userName
);
rst
.
setMv001
(
userName
);
rst
.
setMv002
(
userName
);
rst
.
setMv002
(
userName
);
...
...
src/main/java/com/topsunit/scanservice/ximai/service/CmsmvService.java
View file @
6c0122e6
...
@@ -5,18 +5,18 @@ import com.topsunit.scanservice.ximai.common.AppConfig;
...
@@ -5,18 +5,18 @@ import com.topsunit.scanservice.ximai.common.AppConfig;
import
com.topsunit.scanservice.ximai.common.StringUtil
;
import
com.topsunit.scanservice.ximai.common.StringUtil
;
import
com.topsunit.scanservice.ximai.common.TopsunitException
;
import
com.topsunit.scanservice.ximai.common.TopsunitException
;
import
com.topsunit.scanservice.ximai.dao.CmsmvDao
;
import
com.topsunit.scanservice.ximai.dao.CmsmvDao
;
import
com.topsunit.scanservice.ximai.dao.ExAccountInfoDao
;
import
com.topsunit.scanservice.ximai.dto.ChangePasswordParams
;
import
com.topsunit.scanservice.ximai.dto.ChangePasswordParams
;
import
com.topsunit.scanservice.ximai.dto.LoginParams
;
import
com.topsunit.scanservice.ximai.dto.LoginParams
;
import
com.topsunit.scanservice.ximai.dto.LoginResult
;
import
com.topsunit.scanservice.ximai.dto.LoginResult
;
import
com.topsunit.scanservice.ximai.dto.SetPasswordParams
;
import
com.topsunit.scanservice.ximai.dto.SetPasswordParams
;
import
com.topsunit.scanservice.ximai.dto.mapper.LoginMapper
;
import
com.topsunit.scanservice.ximai.dto.mapper.LoginMapper
;
import
com.topsunit.scanservice.ximai.entity.Cmsmv
;
import
com.topsunit.scanservice.ximai.entity.Cmsmv
;
import
com.topsunit.scanservice.ximai.security.CurrentActor
;
import
com.topsunit.scanservice.ximai.entity.ExAccountInfo
;
import
com.topsunit.scanservice.ximai.security.Encryptor
;
import
com.topsunit.scanservice.ximai.security.*
;
import
com.topsunit.scanservice.ximai.security.TokenManger
;
import
com.topsunit.scanservice.ximai.security.TokenService
;
import
com.topsunit.scanservice.ximai.webapi.MesLoginService
;
import
com.topsunit.scanservice.ximai.webapi.MesLoginService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -41,7 +41,11 @@ public class CmsmvService {
...
@@ -41,7 +41,11 @@ public class CmsmvService {
private
final
Encryptor
encryptor
;
private
final
Encryptor
encryptor
;
private
final
AppConfig
appConfig
;
private
final
AppConfig
appConfig
;
@Autowired
@Autowired
private
ExAccountInfoDao
exAccountInfoDao
;
@Autowired
private
TokenService
tokenService
;
private
TokenService
tokenService
;
@Autowired
ApplicationContext
applicationContext
;
public
CmsmvService
(
CmsmvDao
cmsmvDao
,
LoginMapper
loginMapper
,
TokenManger
tokenManger
,
CurrentActor
currentActor
,
Encryptor
encryptor
,
AppConfig
appConfig
)
{
public
CmsmvService
(
CmsmvDao
cmsmvDao
,
LoginMapper
loginMapper
,
TokenManger
tokenManger
,
CurrentActor
currentActor
,
Encryptor
encryptor
,
AppConfig
appConfig
)
{
this
.
cmsmvDao
=
cmsmvDao
;
this
.
cmsmvDao
=
cmsmvDao
;
...
@@ -75,10 +79,15 @@ public class CmsmvService {
...
@@ -75,10 +79,15 @@ public class CmsmvService {
public
LoginResult
loginByMes
(
LoginParams
loginParams
)
{
public
LoginResult
loginByMes
(
LoginParams
loginParams
)
{
com
.
topsunit
.
scanservice
.
ximai
.
webapi
.
dto
.
LoginParams
loginParams2
=
BeanUtil
.
copyProperties
(
loginParams
,
com
.
topsunit
.
scanservice
.
ximai
.
webapi
.
dto
.
LoginParams
.
class
);
com
.
topsunit
.
scanservice
.
ximai
.
webapi
.
dto
.
LoginParams
loginParams2
=
BeanUtil
.
copyProperties
(
loginParams
,
com
.
topsunit
.
scanservice
.
ximai
.
webapi
.
dto
.
LoginParams
.
class
);
com
.
topsunit
.
scanservice
.
ximai
.
webapi
.
dto
.
LoginResult
loginResult2
=
mesLoginService
.
login
(
loginParams2
);
com
.
topsunit
.
scanservice
.
ximai
.
webapi
.
dto
.
LoginResult
loginResult2
=
mesLoginService
.
login
(
loginParams2
);
ExAccountInfo
exAccountInfo
=
exAccountInfoDao
.
findById
(
Integer
.
valueOf
(
loginParams
.
getCompany
())).
orElseThrow
(()->
new
TopsunitException
(
"未找到登录账套"
));
if
(
loginResult2
.
getCode
()==
500
){
if
(
loginResult2
.
getCode
()==
500
){
throw
new
TopsunitException
(
loginResult2
.
getMsg
());
throw
new
TopsunitException
(
loginResult2
.
getMsg
());
}
}
return
tokenService
.
getUserByToken
(
loginResult2
.
getToken
());
//生成扫码自生token
String
newToken
=
tokenManger
.
generate
(
loginParams
.
getUsername
(),
exAccountInfo
.
getAccountCode
());
LoginResult
loginResult
=
tokenService
.
getUserByToken
(
loginResult2
.
getToken
());
loginResult
.
setToken
(
newToken
);
return
loginResult
;
}
}
@Transactional
@Transactional
...
...
src/main/java/com/topsunit/scanservice/ximai/service/InvtaService.java
View file @
6c0122e6
...
@@ -103,8 +103,9 @@ public class InvtaService {
...
@@ -103,8 +103,9 @@ public class InvtaService {
}
else
{
}
else
{
invta
.
setTa009
(
"11"
);
invta
.
setTa009
(
"11"
);
}
}
invta
.
setTa003
(
DateUtil
.
currentDateString
());
String
currDate
=
DateUtil
.
currentDateString
();
invta
.
setTa003
(
currDate
);
invta
.
setTa014
(
currDate
);
int
i
=
1
;
int
i
=
1
;
BigDecimal
total
=
BigDecimal
.
ZERO
;
BigDecimal
total
=
BigDecimal
.
ZERO
;
for
(
StockTransactionParams
detail
:
data
){
for
(
StockTransactionParams
detail
:
data
){
...
@@ -126,6 +127,7 @@ public class InvtaService {
...
@@ -126,6 +127,7 @@ public class InvtaService {
invtb
.
setTb009
(
detail
.
getQuantity
());
invtb
.
setTb009
(
detail
.
getQuantity
());
//盘点仓库、库位
//盘点仓库、库位
invtb
.
setTb012
(
detail
.
getWarehouse
());
invtb
.
setTb012
(
detail
.
getWarehouse
());
invtb
.
setTb019
(
currDate
);
invtb
.
setTb029
(
detail
.
getLocation
());
invtb
.
setTb029
(
detail
.
getLocation
());
//判断调拨库位是否与当前一致
//判断调拨库位是否与当前一致
if
(
StringUtils
.
isNotEmpty
(
detail
.
getAllocateWarehouse
())
&&
if
(
StringUtils
.
isNotEmpty
(
detail
.
getAllocateWarehouse
())
&&
...
...
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