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
f10b3385
Commit
f10b3385
authored
Dec 31, 2020
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
51a75a1f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
8 deletions
+69
-8
GtDataRestClient.java
.../java/com/upyuns/platform/rs/gtdata/GtDataRestClient.java
+1
-1
ImageDataVO.java
...a/com/upyuns/platform/rs/datacenter/pojo/ImageDataVO.java
+1
-3
WebsiteScheduleTask.java
...m/upyuns/platform/rs/website/job/WebsiteScheduleTask.java
+66
-3
ConfirmOrderService.java
...yuns/platform/rs/website/service/ConfirmOrderService.java
+1
-1
No files found.
ace-common/src/main/java/com/upyuns/platform/rs/gtdata/GtDataRestClient.java
View file @
f10b3385
...
@@ -185,7 +185,7 @@ public class GtDataRestClient {
...
@@ -185,7 +185,7 @@ public class GtDataRestClient {
String
resourceUrl
=
""
;
String
resourceUrl
=
""
;
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}
&
"
,
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
())),
...
...
rs-datacenter/rs-datacenter-api/src/main/java/com/upyuns/platform/rs/datacenter/pojo/ImageDataVO.java
View file @
f10b3385
...
@@ -9,8 +9,6 @@ import java.math.BigDecimal;
...
@@ -9,8 +9,6 @@ import java.math.BigDecimal;
@Data
@Data
public
class
ImageDataVO
extends
RscpAreaImageTotal
{
public
class
ImageDataVO
extends
RscpAreaImageTotal
{
BigDecimal
price
=
BigDecimal
.
ZERO
;
BigDecimal
price
=
BigDecimal
.
ZERO
;
String
imageFilePath
;
public
void
setPrice
(
BigDecimal
price
)
{
this
.
price
=
price
;
}
}
}
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/job/WebsiteScheduleTask.java
View file @
f10b3385
package
com
.
upyuns
.
platform
.
rs
.
website
.
job
;
package
com
.
upyuns
.
platform
.
rs
.
website
.
job
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.upyuns.platform.rs.datacenter.fegin.DatacenterFeign
;
import
com.upyuns.platform.rs.datacenter.pojo.ImageDataVO
;
import
com.upyuns.platform.rs.website.biz.ImageInfoRelationBiz
;
import
com.upyuns.platform.rs.website.biz.IndustryApplicationInfoBiz
;
import
com.upyuns.platform.rs.website.biz.OrderInfoBiz
;
import
com.upyuns.platform.rs.website.biz.OrderInfoBiz
;
import
com.upyuns.platform.rs.website.biz.OrderItemBiz
;
import
com.upyuns.platform.rs.website.dto.order.OldeliveryJson
;
import
com.upyuns.platform.rs.website.entity.ImageInfoRelation
;
import
com.upyuns.platform.rs.website.entity.IndustryApplicationInfo
;
import
com.upyuns.platform.rs.website.entity.OrderInfo
;
import
com.upyuns.platform.rs.website.entity.OrderInfo
;
import
com.upyuns.platform.rs.website.entity.OrderItem
;
import
com.upyuns.platform.rs.website.type.ItemTypeEnum
;
import
com.upyuns.platform.rs.website.type.OrderStatusEnum
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
...
@@ -9,6 +23,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
...
@@ -9,6 +23,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
java.util.List
;
import
java.util.List
;
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
;
...
@@ -21,6 +36,23 @@ public class WebsiteScheduleTask {
...
@@ -21,6 +36,23 @@ public class WebsiteScheduleTask {
@Autowired
@Autowired
OrderInfoBiz
orderInfoBiz
;
OrderInfoBiz
orderInfoBiz
;
@Autowired
OrderItemBiz
orderItemBiz
;
@Autowired
ImageInfoRelationBiz
imageInfoRelationBiz
;
@Autowired
IndustryApplicationInfoBiz
industryApplicationInfoBiz
;
@Autowired
DatacenterFeign
datacenterFeign
;
public
static
final
int
ITEM_STANDARD_DATA
=
ItemTypeEnum
.
STANDARD_DATA
.
getType
();
public
static
final
int
ITEM_INDUSTRY_INFO
=
ItemTypeEnum
.
INDUSTRY_INFO
.
getType
();
public
static
final
int
ITEM_IMAGE_STORAGE
=
ItemTypeEnum
.
IMAGE_STORAGE
.
getType
();
//3.添加定时任务
//3.添加定时任务
@Scheduled
(
cron
=
"0/5 * * * * ?"
)
@Scheduled
(
cron
=
"0/5 * * * * ?"
)
//或直接指定时间间隔,例如:5秒
//或直接指定时间间隔,例如:5秒
...
@@ -34,8 +66,39 @@ public class WebsiteScheduleTask {
...
@@ -34,8 +66,39 @@ public class WebsiteScheduleTask {
return
w
;
return
w
;
});
});
// list.forEach(orderInfo -> {
list
.
forEach
(
orderInfo
->
{
// if(orderInfo.getType().)
List
<
OldeliveryJson
>
jsons
=
CollUtil
.
newArrayList
();
// });
List
<
OrderItem
>
items
=
orderItemBiz
.
selectList
(
new
OrderItem
(){{
setOrderId
(
orderInfo
.
getOrderId
());
}});
items
.
forEach
(
it
->
{
if
(
ITEM_STANDARD_DATA
==
it
.
getType
())
{
List
<
ImageDataVO
>
imageDataVOS
=
datacenterFeign
.
queryByIds
(
it
.
getDetailId
()+
""
).
getData
();
imageDataVOS
.
forEach
(
vo
->
{
jsons
.
add
(
new
OldeliveryJson
(){{
setName
(
vo
.
getName
());
setPath
(
vo
.
getImageFilePath
());
}});
});
}
else
if
(
ITEM_INDUSTRY_INFO
==
it
.
getType
())
{
IndustryApplicationInfo
iai
=
industryApplicationInfoBiz
.
selectById
(
it
.
getDetailId
().
intValue
());
jsons
.
add
(
new
OldeliveryJson
(){{
setName
(
it
.
getName
());
setPath
(
iai
.
getSourceFile
());
}});
}
else
if
(
ITEM_IMAGE_STORAGE
==
it
.
getType
())
{
ImageInfoRelation
iir
=
imageInfoRelationBiz
.
selectById
(
it
.
getDetailId
().
intValue
());
jsons
.
add
(
new
OldeliveryJson
(){{
setName
(
it
.
getName
());
setPath
(
iir
.
getFileWidth
());
}});
}
});
orderInfoBiz
.
updateSelectiveById
(
new
OrderInfo
(){{
setOrderId
(
orderInfo
.
getOrderId
());
setStatus
(
OrderStatusEnum
.
ORDER_RECEIVED
.
getType
());
setOldeliveryJson
(
JSONUtil
.
toJsonStr
(
jsons
));
}});
});
}
}
}
}
\ No newline at end of file
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/service/ConfirmOrderService.java
View file @
f10b3385
...
@@ -68,7 +68,7 @@ public class ConfirmOrderService {
...
@@ -68,7 +68,7 @@ public class ConfirmOrderService {
List
<
ItemInfoVo
>
itemInfoVoList
=
new
ArrayList
<>();
List
<
ItemInfoVo
>
itemInfoVoList
=
new
ArrayList
<>();
AtomicReference
<
Integer
>
number
=
new
AtomicReference
<>(
0
);
AtomicReference
<
Integer
>
number
=
new
AtomicReference
<>(
0
);
AtomicReference
<
Double
>
amount
=
new
AtomicReference
<>((
double
)
0
);
AtomicReference
<
Double
>
amount
=
new
AtomicReference
<>((
double
)
0
);
itemInfoDtoList
.
parallelStream
().
forEach
(
itemInfoDto
->
{
itemInfoDtoList
.
forEach
(
itemInfoDto
->
{
if
(
itemInfoDto
.
getType
().
equals
(
OrderTypeEnum
.
STANDARD_DATA
.
getType
()))
{
if
(
itemInfoDto
.
getType
().
equals
(
OrderTypeEnum
.
STANDARD_DATA
.
getType
()))
{
List
<
ImageDataVO
>
imageDataVOList
=
datacenterFeign
.
queryByIds
(
itemInfoDto
.
getId
()
+
""
).
getData
();
List
<
ImageDataVO
>
imageDataVOList
=
datacenterFeign
.
queryByIds
(
itemInfoDto
.
getId
()
+
""
).
getData
();
if
(
imageDataVOList
!=
null
&&
imageDataVOList
.
size
()
>
0
)
{
if
(
imageDataVOList
!=
null
&&
imageDataVOList
.
size
()
>
0
)
{
...
...
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