Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
b1d64791
提交
b1d64791
authored
9月 27, 2023
作者:
huyufan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
处理BUG,增加日志
上级
9eb3cc0b
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
23 行增加
和
19 行删除
+23
-19
ThreeGoodsOrderStrategy.java
...lx/performance/strategy/impl/ThreeGoodsOrderStrategy.java
+10
-2
JobTest.java
...rmance-web/src/test/java/com/clx/performance/JobTest.java
+13
-17
没有找到文件。
performance-web/src/main/java/com/clx/performance/strategy/impl/ThreeGoodsOrderStrategy.java
浏览文件 @
b1d64791
...
@@ -6,6 +6,7 @@ import com.clx.order.param.feign.UpdateOrderInfoResidueWeightParam;
...
@@ -6,6 +6,7 @@ import com.clx.order.param.feign.UpdateOrderInfoResidueWeightParam;
import
com.clx.order.params.OrderGoodsChildParams
;
import
com.clx.order.params.OrderGoodsChildParams
;
import
com.clx.order.params.OrderGoodsParams
;
import
com.clx.order.params.OrderGoodsParams
;
import
com.clx.order.vo.feign.FeignOrderVO
;
import
com.clx.order.vo.feign.FeignOrderVO
;
import
com.clx.order.vo.feign.OrderOwnTruckVo
;
import
com.clx.performance.component.GoodsOrderStrategyContext
;
import
com.clx.performance.component.GoodsOrderStrategyContext
;
import
com.clx.performance.component.OrderGoodsIdGenerate
;
import
com.clx.performance.component.OrderGoodsIdGenerate
;
import
com.clx.performance.component.OrderGoodsStatusLazyComponent
;
import
com.clx.performance.component.OrderGoodsStatusLazyComponent
;
...
@@ -32,6 +33,7 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -32,6 +33,7 @@ import org.springframework.transaction.annotation.Transactional;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
/**
* 自由车辆
* 自由车辆
...
@@ -65,6 +67,7 @@ public class ThreeGoodsOrderStrategy implements GoodsOrderStrategy, Initializing
...
@@ -65,6 +67,7 @@ public class ThreeGoodsOrderStrategy implements GoodsOrderStrategy, Initializing
@Autowired
@Autowired
private
OrderGoodsStatusLazyComponent
orderGoodsStatusLazyComponent
;
private
OrderGoodsStatusLazyComponent
orderGoodsStatusLazyComponent
;
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
LocalDateTime
goodsOrderProcess
(
OrderGoodsParams
orderGoodsParams
,
FeignOrderVO
orderInfo
,
LocalDateTime
now
)
{
public
LocalDateTime
goodsOrderProcess
(
OrderGoodsParams
orderGoodsParams
,
FeignOrderVO
orderInfo
,
LocalDateTime
now
)
{
...
@@ -148,8 +151,13 @@ public class ThreeGoodsOrderStrategy implements GoodsOrderStrategy, Initializing
...
@@ -148,8 +151,13 @@ public class ThreeGoodsOrderStrategy implements GoodsOrderStrategy, Initializing
orderGoods
.
setModifiedTime
(
now
);
orderGoods
.
setModifiedTime
(
now
);
orderGoods
.
setUserName
(
loginUserInfo
.
getUserName
());
orderGoods
.
setUserName
(
loginUserInfo
.
getUserName
());
orderGoods
.
setUserNo
(
loginUserInfo
.
getUserNo
());
orderGoods
.
setUserNo
(
loginUserInfo
.
getUserNo
());
if
(
CollectionUtil
.
isNotEmpty
(
child
.
getTruckList
()))
{
List
<
OrderOwnTruckVo
>
orderOwnTruckVos
=
orderFeign
.
selectTruckListFeign
(
orderNo
);
orderGoodsTruckBindDao
.
saveBatchEntity
(
orderNo
,
orderNoPrefix
+
beginOrderGoodsId
,
child
.
getTruckList
(),
now
);
if
(
orderOwnTruckVos
==
null
||
orderOwnTruckVos
.
isEmpty
())
{
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
HTTP_ERROR
,
"全部自由车辆列表数据为空"
);
}
List
<
String
>
collect
=
orderOwnTruckVos
.
stream
().
map
(
OrderOwnTruckVo:
:
getTruckNo
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtil
.
isNotEmpty
(
collect
))
{
orderGoodsTruckBindDao
.
saveBatchEntity
(
orderNo
,
orderNoPrefix
+
beginOrderGoodsId
,
collect
,
now
);
}
}
mqMap
.
put
(
orderNoPrefix
+
beginOrderGoodsId
,
postedTime
);
mqMap
.
put
(
orderNoPrefix
+
beginOrderGoodsId
,
postedTime
);
orderGoodsStatusLazyComponent
.
expireProduce
(
orderGoods
.
getLastArriveSendTime
(),
orderNoPrefix
+
beginOrderGoodsId
);
orderGoodsStatusLazyComponent
.
expireProduce
(
orderGoods
.
getLastArriveSendTime
(),
orderNoPrefix
+
beginOrderGoodsId
);
...
...
performance-web/src/test/java/com/clx/performance/JobTest.java
浏览文件 @
b1d64791
package
com
.
clx
.
performance
;
package
com
.
clx
.
performance
;
import
com.clx.order.enums.OrderEnum
;
import
com.clx.order.feign.OrderFeign
;
import
com.clx.order.feign.OrderFeign
;
import
com.clx.order.param.feign.UpdateOrderInfoParam
;
import
com.clx.order.param.feign.UpdateOrderInfoResidueWeightParam
;
import
com.clx.order.param.feign.UpdateOrderInfoResidueWeightParam
;
import
com.clx.order.vo.feign.FeignOrderVO
;
import
com.clx.order.vo.feign.OrderOwnTruckVo
;
import
com.clx.performance.component.OrderGoodsStatusLazyComponent
;
import
com.clx.performance.component.OrderGoodsStatusLazyComponent
;
import
com.clx.performance.constant.RabbitKeyConstants
;
import
com.clx.performance.constant.RabbitKeyConstants
;
import
com.clx.performance.constant.RedisConstants
;
import
com.clx.performance.constant.RedisConstants
;
import
com.clx.performance.dao.OrderGoodsDao
;
import
com.clx.performance.dao.OrderGoodsDao
;
import
com.clx.performance.enums.OrderGoodsStatusEnum
;
import
com.clx.performance.enums.OrderGoodsTruckBindEnum
;
import
com.clx.performance.mapper.OrderGoodsMapper
;
import
com.clx.performance.mapper.OrderGoodsMapper
;
import
com.clx.performance.model.OrderGoods
;
import
com.clx.performance.model.OrderGoods
;
import
com.msl.common.base.Optional
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
import
org.springframework.amqp.core.Message
;
import
org.springframework.amqp.core.Message
;
...
@@ -21,8 +28,11 @@ import org.springframework.test.context.junit4.SpringRunner;
...
@@ -21,8 +28,11 @@ import org.springframework.test.context.junit4.SpringRunner;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.time.ZoneOffset
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
@SpringBootTest
@SpringBootTest
@RunWith
(
SpringRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
...
@@ -44,22 +54,8 @@ public class JobTest {
...
@@ -44,22 +54,8 @@ public class JobTest {
private
OrderGoodsDao
orderGoodsDao
;
private
OrderGoodsDao
orderGoodsDao
;
@Test
@Test
public
void
test1
()
{
public
void
test1
()
{
List
<
OrderGoods
>
list
=
orderGoodsDao
.
getOrderGoodsListByOrderNoAndLastArriveSendTime
(
"PT2023092700023"
,
LocalDateTime
.
now
());
List
<
OrderOwnTruckVo
>
orderOwnTruckVos
=
orderFeign
.
selectTruckListFeign
(
"PT2023092700041"
);
BigDecimal
childSum
=
list
.
stream
().
map
(
OrderGoods:
:
getExtractWeight
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
List
<
String
>
collect
=
orderOwnTruckVos
.
stream
().
map
(
OrderOwnTruckVo:
:
getTruckNo
).
collect
(
Collectors
.
toList
());
System
.
out
.
println
();
System
.
out
.
println
(
collect
);
// UpdateOrderInfoResidueWeightParam param = new UpdateOrderInfoResidueWeightParam();
// param.setOrderId(150);
// param.setUpdateType("1");
// param.setResidueWeight(new BigDecimal(200));
// orderFeign.updateOrderInfoResidueWeight(param);
// Message message = MessageBuilder.withBody("PT2023091900049".getBytes()).build();
// message.getMessageProperties().setExpiration("10000");
// rabbitTemplate.send(
// RabbitKeyConstants.ORDER_GOODS_ON_EXCHANGE, RabbitKeyConstants.ORDER_GOODS_ON_ROUTE_KEY, message
// );
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论