Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rs-cloud-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周健威
rs-cloud-platform
Commits
f68a9d83
Commit
f68a9d83
authored
Jan 04, 2021
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
953a7154
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
107 additions
and
27 deletions
+107
-27
GdLoginVO.java
...rc/main/java/com/upyuns/platform/rs/gtdata/GdLoginVO.java
+9
-0
GtDataRestClient.java
.../java/com/upyuns/platform/rs/gtdata/GtDataRestClient.java
+36
-19
AppUserLogin.java
...om/github/wxiaoqi/security/admin/entity/AppUserLogin.java
+1
-1
AppUserDTO.java
...m/github/wxiaoqi/security/admin/feign/dto/AppUserDTO.java
+9
-0
pom.xml
rs-datacenter/rs-datacenter-server/pom.xml
+6
-0
GtdataController.java
.../upyuns/platform/rs/datacenter/rest/GtdataController.java
+26
-2
UserOrderDto.java
...java/com/upyuns/platform/rs/website/dto/UserOrderDto.java
+5
-0
OrderInfo.java
...java/com/upyuns/platform/rs/website/entity/OrderInfo.java
+6
-0
OrderInfoBiz.java
...java/com/upyuns/platform/rs/website/biz/OrderInfoBiz.java
+3
-0
WebsiteScheduleTask.java
...m/upyuns/platform/rs/website/job/WebsiteScheduleTask.java
+6
-5
No files found.
ace-common/src/main/java/com/upyuns/platform/rs/gtdata/GdLoginVO.java
0 → 100644
View file @
f68a9d83
package
com
.
upyuns
.
platform
.
rs
.
gtdata
;
import
lombok.Data
;
@Data
public
class
GdLoginVO
{
private
String
time
;
private
String
sign
;
}
ace-common/src/main/java/com/upyuns/platform/rs/gtdata/GtDataRestClient.java
View file @
f68a9d83
...
@@ -139,7 +139,7 @@ public class GtDataRestClient {
...
@@ -139,7 +139,7 @@ public class GtDataRestClient {
*
*
*/
*/
public
Map
<
String
,
Object
>
getToken
()
{
public
Map
<
String
,
Object
>
getToken
()
{
return
getToken
(
gtDataUsername
);
return
getToken
(
gtDataUsername
,
""
);
}
}
/**
/**
...
@@ -150,9 +150,14 @@ public class GtDataRestClient {
...
@@ -150,9 +150,14 @@ public class GtDataRestClient {
* @return
* @return
*
*
*/
*/
public
Map
<
String
,
Object
>
getToken
(
String
username
)
{
public
Map
<
String
,
Object
>
getToken
(
String
username
,
String
rsign
)
{
String
resourceUrl
=
MessageFormat
.
format
(
"{0}?op=GETTOKEN&user={1}"
,
if
(
StrUtil
.
isNotBlank
(
rsign
)){
baseUrl
,
username
);
rsign
=
"&rsign="
+
rsign
;
}
else
{
rsign
=
""
;
}
String
resourceUrl
=
MessageFormat
.
format
(
"{0}?op=GETTOKEN&user={1}{2}"
,
baseUrl
,
username
,
rsign
);
return
restGet
(
resourceUrl
);
return
restGet
(
resourceUrl
);
}
}
...
@@ -166,7 +171,7 @@ public class GtDataRestClient {
...
@@ -166,7 +171,7 @@ public class GtDataRestClient {
*
*
*/
*/
public
Map
<
String
,
Object
>
login
(
String
token
,
String
time
)
{
public
Map
<
String
,
Object
>
login
(
String
token
,
String
time
)
{
return
login
(
gtDataUsername
,
gtDataPassword
,
token
,
time
);
return
login
(
gtDataUsername
,
gtDataPassword
,
token
,
time
,
""
);
}
}
/**
/**
...
@@ -181,15 +186,20 @@ public class GtDataRestClient {
...
@@ -181,15 +186,20 @@ public class GtDataRestClient {
*
*
*/
*/
public
Map
<
String
,
Object
>
login
(
String
username
,
String
password
,
public
Map
<
String
,
Object
>
login
(
String
username
,
String
password
,
String
token
,
String
time
)
{
String
token
,
String
time
,
String
rsign
)
{
String
resourceUrl
=
""
;
String
resourceUrl
=
""
;
if
(
StrUtil
.
isNotBlank
(
rsign
)){
rsign
=
"&rsign="
+
rsign
;
}
else
{
rsign
=
""
;
}
try
{
try
{
resourceUrl
=
MessageFormat
.
format
(
resourceUrl
=
MessageFormat
.
format
(
"{0}?op=LOGIN&user={1}&pass={2}&token={3}&time={4}
&
"
,
"{0}?op=LOGIN&user={1}&pass={2}&token={3}&time={4}
{5}
"
,
baseUrl
,
username
,
baseUrl
,
username
,
Encodes
.
encodeHex
(
Digests
.
md5
((
Encodes
.
encodeHex
(
Digests
Encodes
.
encodeHex
(
Digests
.
md5
((
Encodes
.
encodeHex
(
Digests
.
md5
(
password
.
getBytes
()))
+
token
).
getBytes
())),
.
md5
(
password
.
getBytes
()))
+
token
).
getBytes
())),
token
,
time
);
token
,
time
,
rsign
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
logger
.
error
(
"password to md5 error."
,
e
);
logger
.
error
(
"password to md5 error."
,
e
);
}
}
...
@@ -783,10 +793,15 @@ public class GtDataRestClient {
...
@@ -783,10 +793,15 @@ public class GtDataRestClient {
* @return url
* @return url
*
*
*/
*/
public
String
openUrl
(
String
path
)
{
public
String
openUrl
(
String
path
,
String
sign
,
String
time
,
String
rsign
)
{
if
(
StrUtil
.
isNotBlank
(
rsign
)){
rsign
=
"&rsign="
+
rsign
;
}
else
{
rsign
=
""
;
}
String
resourceUrl
=
MessageFormat
String
resourceUrl
=
MessageFormat
.
format
(
"{0}{1}?op=OPEN&sign={2}&time={3}"
,
gtDataUrl
,
path
,
.
format
(
"{0}{1}?op=OPEN&sign={2}&time={3}
{4}
"
,
gtDataUrl
,
path
,
defaultSign
,
defaultTime
);
sign
,
time
,
rsign
);
return
resourceUrl
;
return
resourceUrl
;
}
}
...
@@ -1632,21 +1647,23 @@ public class GtDataRestClient {
...
@@ -1632,21 +1647,23 @@ public class GtDataRestClient {
* Description: 子用户登陆并更新认证信息
* Description: 子用户登陆并更新认证信息
*
*
*/
*/
p
rotected
void
sonUserlogin
(
)
throws
GtDataRestException
{
p
ublic
GdLoginVO
rsignUserlogin
(
String
user
,
String
pass
)
throws
GtDataRestException
{
Map
<
String
,
Object
>
tokenMap
=
getToken
();
Map
<
String
,
Object
>
tokenMap
=
getToken
(
user
,
user
);
default
Token
=
(
String
)
tokenMap
.
get
(
"token"
);
String
user
Token
=
(
String
)
tokenMap
.
get
(
"token"
);
default
Time
=
(
String
)
tokenMap
.
get
(
"time"
);
String
user
Time
=
(
String
)
tokenMap
.
get
(
"time"
);
if
(
200
!=
(
Integer
)
tokenMap
.
get
(
"HttpStatusCode"
))
{
if
(
200
!=
(
Integer
)
tokenMap
.
get
(
"HttpStatusCode"
))
{
throw
new
GtDataRestException
((
String
)
tokenMap
.
get
(
"errorCode"
));
throw
new
GtDataRestException
((
String
)
tokenMap
.
get
(
"errorCode"
));
}
}
Map
<
String
,
Object
>
loginMap
=
login
(
defaultToken
,
defaultTime
);
Map
<
String
,
Object
>
loginMap
=
login
(
user
,
pass
,
userToken
,
userTime
,
user
);
defaultTime
=
(
String
)
loginMap
.
get
(
"time"
);
GdLoginVO
gdLoginVO
=
new
GdLoginVO
(){{
defaultSign
=
(
String
)
loginMap
.
get
(
"sign"
);
setTime
((
String
)
loginMap
.
get
(
"time"
));
setSign
((
String
)
loginMap
.
get
(
"sign"
));
}};
if
(
200
!=
(
Integer
)
loginMap
.
get
(
"HttpStatusCode"
))
{
if
(
200
!=
(
Integer
)
loginMap
.
get
(
"HttpStatusCode"
))
{
throw
new
GtDataRestException
((
String
)
loginMap
.
get
(
"errorCode"
));
throw
new
GtDataRestException
((
String
)
loginMap
.
get
(
"errorCode"
));
}
}
return
gdLoginVO
;
}
}
/**
/**
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/AppUserLogin.java
View file @
f68a9d83
...
@@ -47,7 +47,7 @@ public class AppUserLogin {
...
@@ -47,7 +47,7 @@ public class AppUserLogin {
private
Long
lastTime
;
private
Long
lastTime
;
/**
/**
*
最后登录时间
*
data密码加密前
*/
*/
@Column
(
name
=
"gtdata_pass"
)
@Column
(
name
=
"gtdata_pass"
)
private
String
gtdataPass
;
private
String
gtdataPass
;
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/feign/dto/AppUserDTO.java
View file @
f68a9d83
...
@@ -4,6 +4,8 @@ import cn.hutool.core.util.StrUtil;
...
@@ -4,6 +4,8 @@ import cn.hutool.core.util.StrUtil;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
javax.persistence.Column
;
/**
/**
* 用户详情信息表
* 用户详情信息表
*/
*/
...
@@ -106,6 +108,13 @@ public class AppUserDTO {
...
@@ -106,6 +108,13 @@ public class AppUserDTO {
//用户分公司id
//用户分公司id
private
Integer
parentCompanyId
;
private
Integer
parentCompanyId
;
/**
* data密码加密前
*/
@Column
(
name
=
"gtdata_pass"
)
private
String
gtdataPass
;
public
String
obtainRealname
()
{
public
String
obtainRealname
()
{
if
(
StrUtil
.
isBlank
(
getRealname
()))
{
if
(
StrUtil
.
isBlank
(
getRealname
()))
{
return
"匿名"
;
return
"匿名"
;
...
...
rs-datacenter/rs-datacenter-server/pom.xml
View file @
f68a9d83
...
@@ -15,6 +15,12 @@
...
@@ -15,6 +15,12 @@
<artifactId>
rs-datacenter-server
</artifactId>
<artifactId>
rs-datacenter-server
</artifactId>
<dependencies>
<dependencies>
<dependency>
<groupId>
com.github.wxiaoqi
</groupId>
<artifactId>
ace-admin-api
</artifactId>
<version>
2.0-rscp-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<dependency>
<groupId>
com.upyuns.platform.rs
</groupId>
<groupId>
com.upyuns.platform.rs
</groupId>
<artifactId>
rs-datacenter-api
</artifactId>
<artifactId>
rs-datacenter-api
</artifactId>
...
...
rs-datacenter/rs-datacenter-server/src/main/java/com/upyuns/platform/rs/datacenter/rest/GtdataController.java
View file @
f68a9d83
package
com
.
upyuns
.
platform
.
rs
.
datacenter
.
rest
;
package
com
.
upyuns
.
platform
.
rs
.
datacenter
.
rest
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.github.wxiaoqi.security.admin.entity.AppUserLogin
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.rest.CommonBaseController
;
import
com.github.wxiaoqi.security.common.rest.CommonBaseController
;
import
com.github.wxiaoqi.security.common.util.MD5
;
import
com.upyuns.platform.rs.datacenter.entity.RscpAreaInfo
;
import
com.upyuns.platform.rs.datacenter.entity.RscpAreaInfo
;
import
com.upyuns.platform.rs.gtdata.GdLoginVO
;
import
com.upyuns.platform.rs.gtdata.GtDataRestClient
;
import
com.upyuns.platform.rs.gtdata.GtDataRestClient
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -25,10 +30,18 @@ import java.util.Map;
...
@@ -25,10 +30,18 @@ import java.util.Map;
@RestController
@RestController
@Slf4j
@Slf4j
@RequestMapping
(
"/web/gtdata/"
)
@RequestMapping
(
"/web/gtdata/"
)
public
class
GtdataController
extends
CommonBaseController
{
public
class
GtdataController
extends
CommonBaseController
implements
UserRestInterface
{
@Autowired
@Autowired
GtDataRestClient
gtDataRestClient
;
GtDataRestClient
gtDataRestClient
;
@Autowired
UserFeign
userFeign
;
@Override
public
UserFeign
getUserFeign
()
{
return
userFeign
;
}
public
static
final
String
uploadP
=
"/rscloudmart/bg/upload/"
;
public
static
final
String
uploadP
=
"/rscloudmart/bg/upload/"
;
@RequestMapping
(
value
=
"/app/unauth/image/**"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/app/unauth/image/**"
,
method
=
RequestMethod
.
GET
)
...
@@ -54,7 +67,18 @@ public class GtdataController extends CommonBaseController {
...
@@ -54,7 +67,18 @@ public class GtdataController extends CommonBaseController {
public
ObjectRestResponse
download
()
throws
Exception
{
public
ObjectRestResponse
download
()
throws
Exception
{
String
url
=
request
.
getRequestURI
();
String
url
=
request
.
getRequestURI
();
String
fileName
=
url
.
substring
(
url
.
lastIndexOf
(
"/web/gtdata/app/unauth/download/"
)+
32
);
String
fileName
=
url
.
substring
(
url
.
lastIndexOf
(
"/web/gtdata/app/unauth/download/"
)+
32
);
return
ObjectRestResponse
.
succ
(
gtDataRestClient
.
openUrl
(
uploadP
+
fileName
));
GdLoginVO
gdLoginVO
=
gtDataRestClient
.
rsignUserlogin
(
getAppUser
().
getUserid
()+
""
,
getAppUser
().
getGtdataPass
());
return
ObjectRestResponse
.
succ
(
gtDataRestClient
.
openUrl
(
uploadP
+
fileName
,
gdLoginVO
.
getSign
(),
gdLoginVO
.
getTime
(),
getAppUser
().
getUserid
()+
""
));
}
@RequestMapping
(
value
=
"/app/unauth/register"
,
method
=
RequestMethod
.
GET
)
@IgnoreUserToken
public
ObjectRestResponse
dataRegister
(
AppUserLogin
appUserLogin
)
throws
Exception
{
String
gtdataPass
=
MD5
.
GetMD5StringLower
(
appUserLogin
.
getId
().
toString
());
Map
<
String
,
Object
>
result
=
gtDataRestClient
.
register
(
appUserLogin
.
getId
()+
""
,
MD5
.
GetMD5StringLower
(
gtdataPass
),
(
1024L
*
1024L
*
1024L
*
100
)+
""
);
result
.
put
(
"gtdataPass"
,
gtdataPass
);
return
ObjectRestResponse
.
succ
(
result
);
}
}
public
void
downloadVideoById
(
String
fileName
,
String
filePath
,
HttpServletResponse
response
)
throws
Exception
{
public
void
downloadVideoById
(
String
fileName
,
String
filePath
,
HttpServletResponse
response
)
throws
Exception
{
...
...
rs-website/rs-website-api/src/main/java/com/upyuns/platform/rs/website/dto/UserOrderDto.java
View file @
f68a9d83
...
@@ -65,4 +65,9 @@ public class UserOrderDto extends PageParam {
...
@@ -65,4 +65,9 @@ public class UserOrderDto extends PageParam {
* 发票状态: 1、未开发票,2、已开发票, 3、已发货, 4、已收货、5、退回, 6、已完成
* 发票状态: 1、未开发票,2、已开发票, 3、已发货, 4、已收货、5、退回, 6、已完成
*/
*/
Integer
invoiceStatus
;
Integer
invoiceStatus
;
/**
* 卫星标识
*/
String
satellite
;
}
}
rs-website/rs-website-api/src/main/java/com/upyuns/platform/rs/website/entity/OrderInfo.java
View file @
f68a9d83
...
@@ -261,9 +261,15 @@ public class OrderInfo implements Serializable {
...
@@ -261,9 +261,15 @@ public class OrderInfo implements Serializable {
*/
*/
String
oldeliveryJson
;
String
oldeliveryJson
;
/**
* 卫星标识
*/
String
satellite
;
@Transient
@Transient
private
List
<
OrderItem
>
orderItemList
;
private
List
<
OrderItem
>
orderItemList
;
@Transient
@Transient
OrderEInvoice
orderEInvoice
;
OrderEInvoice
orderEInvoice
;
}
}
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/biz/OrderInfoBiz.java
View file @
f68a9d83
...
@@ -159,6 +159,9 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
...
@@ -159,6 +159,9 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
Query
query
=
new
Query
(
userOrderDto
);
Query
query
=
new
Query
(
userOrderDto
);
Example
example
=
new
Example
(
OrderInfo
.
class
);
Example
example
=
new
Example
(
OrderInfo
.
class
);
Example
.
Criteria
orderInfoCriteria
=
example
.
createCriteria
();
Example
.
Criteria
orderInfoCriteria
=
example
.
createCriteria
();
if
(
userOrderDto
.
getSatellite
()
!=
null
)
{
orderInfoCriteria
.
andLike
(
"satellite"
,
"%"
+
userOrderDto
.
getSatellite
()
+
"%"
);
}
if
(
userOrderDto
.
getStatus
()
!=
null
)
{
if
(
userOrderDto
.
getStatus
()
!=
null
)
{
orderInfoCriteria
.
andEqualTo
(
"status"
,
userOrderDto
.
getStatus
());
orderInfoCriteria
.
andEqualTo
(
"status"
,
userOrderDto
.
getStatus
());
}
}
...
...
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/job/WebsiteScheduleTask.java
View file @
f68a9d83
...
@@ -28,10 +28,11 @@ import java.util.stream.Collectors;
...
@@ -28,10 +28,11 @@ import java.util.stream.Collectors;
import
static
com
.
upyuns
.
platform
.
rs
.
website
.
entity
.
OrderInfo
.
SENDTYPE_OL
;
import
static
com
.
upyuns
.
platform
.
rs
.
website
.
entity
.
OrderInfo
.
SENDTYPE_OL
;
import
static
com
.
upyuns
.
platform
.
rs
.
website
.
type
.
OrderStatusEnum
.
ORDER_PAID
;
import
static
com
.
upyuns
.
platform
.
rs
.
website
.
type
.
OrderStatusEnum
.
ORDER_PAID
;
import
static
com
.
upyuns
.
platform
.
rs
.
website
.
type
.
OrderStatusEnum
.
ORDER_SEND
;
//
@Configuration //1.主要用于标记配置类,兼备Component的效果。
@Configuration
//1.主要用于标记配置类,兼备Component的效果。
//
@EnableScheduling // 2.开启定时任务
@EnableScheduling
// 2.开启定时任务
//
@Slf4j
@Slf4j
public
class
WebsiteScheduleTask
{
public
class
WebsiteScheduleTask
{
@Autowired
@Autowired
...
@@ -58,14 +59,14 @@ public class WebsiteScheduleTask {
...
@@ -58,14 +59,14 @@ public class WebsiteScheduleTask {
//3.添加定时任务
//3.添加定时任务
@Scheduled
(
cron
=
"0/5 * * * * ?"
)
//
@Scheduled(cron = "0/5 * * * * ?")
//或直接指定时间间隔,例如:5秒
//或直接指定时间间隔,例如:5秒
//@Scheduled(fixedRate=5000)
//@Scheduled(fixedRate=5000)
public
void
configureTasks
()
{
public
void
configureTasks
()
{
//查询是否有线上并且代发货的订单
//查询是否有线上并且代发货的订单
//log.info("执行静态定时任务时间: " + LocalDateTime.now());
//log.info("执行静态定时任务时间: " + LocalDateTime.now());
List
<
OrderInfo
>
list
=
orderInfoBiz
.
selectByWeekend
(
w
->
{
List
<
OrderInfo
>
list
=
orderInfoBiz
.
selectByWeekend
(
w
->
{
w
.
andEqualTo
(
OrderInfo:
:
getStatus
,
ORDER_
PAI
D
.
getType
());
w
.
andEqualTo
(
OrderInfo:
:
getStatus
,
ORDER_
SEN
D
.
getType
());
w
.
andEqualTo
(
OrderInfo:
:
getSendType
,
SENDTYPE_OL
);
w
.
andEqualTo
(
OrderInfo:
:
getSendType
,
SENDTYPE_OL
);
return
w
;
return
w
;
});
});
...
...
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