Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
ad1d4c08
提交
ad1d4c08
authored
11月 09, 2023
作者:
aiqingguo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
线路统计增加Feign
上级
36358ac4
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
114 行增加
和
50 行删除
+114
-50
OrderChildFeign.java
.../main/java/com/clx/performance/feign/OrderChildFeign.java
+20
-0
OrderChildLineStatisticsVO.java
...x/performance/vo/pc/child/OrderChildLineStatisticsVO.java
+33
-0
OrderChildFeignController.java
...rformance/controller/feign/OrderChildFeignController.java
+18
-4
TempController.java
...a/com/clx/performance/controller/temp/TempController.java
+4
-6
OrderChildDao.java
.../src/main/java/com/clx/performance/dao/OrderChildDao.java
+5
-6
OrderChildDaoImpl.java
.../java/com/clx/performance/dao/impl/OrderChildDaoImpl.java
+4
-5
OrderChildMapper.java
...ain/java/com/clx/performance/mapper/OrderChildMapper.java
+10
-9
CarrierOrderChildService.java
...x/performance/service/child/CarrierOrderChildService.java
+0
-10
FeignOrderChildService.java
...clx/performance/service/child/FeignOrderChildService.java
+10
-0
FeignOrderChildServiceImpl.java
...rmance/service/impl/child/FeignOrderChildServiceImpl.java
+10
-10
没有找到文件。
performance-api/src/main/java/com/clx/performance/feign/OrderChildFeign.java
0 → 100644
浏览文件 @
ad1d4c08
package
com
.
clx
.
performance
.
feign
;
import
com.clx.performance.vo.pc.child.OrderChildLineStatisticsVO
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
javax.validation.constraints.NotBlank
;
@FeignClient
(
name
=
"clx-performance"
)
public
interface
OrderChildFeign
{
/**
* 线路运单统计
*/
@RequestMapping
(
value
=
"clx-performance/feign/orderChild/lineStatistics"
,
method
=
RequestMethod
.
GET
)
OrderChildLineStatisticsVO
lineStatistics
(
@NotBlank
(
message
=
"发货地址不可为空"
)
Integer
sendSystemAddressId
,
@NotBlank
(
message
=
"收货货地址不可为空"
)
Integer
receiveSystemAddressId
);
}
performance-api/src/main/java/com/clx/performance/vo/pc/child/OrderChildLineStatisticsVO.java
0 → 100644
浏览文件 @
ad1d4c08
package
com
.
clx
.
performance
.
vo
.
pc
.
child
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
import
lombok.Setter
;
import
java.math.BigDecimal
;
/**
* @ClassName
* @Description
* @Author kavin
* @Date 2023/10/10 10:44
* @Version 1.0
*/
@ApiModel
(
description
=
"线路统计"
)
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public
class
OrderChildLineStatisticsVO
{
@ApiModelProperty
(
"磅差率均值"
)
private
BigDecimal
poundDifferenceRatioAvg
;
@ApiModelProperty
(
"时长均值"
)
private
Integer
timeAvg
;
}
performance-web/src/main/java/com/clx/performance/controller/feign/OrderChildFeignController.java
浏览文件 @
ad1d4c08
...
...
@@ -3,15 +3,16 @@ package com.clx.performance.controller.feign;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.clx.performance.model.OrderChild
;
import
com.clx.performance.service.OrderChildService
;
import
com.clx.performance.service.child.FeignOrderChildService
;
import
com.clx.performance.vo.pc.child.OrderChildLineStatisticsVO
;
import
com.msl.common.result.Result
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.AllArgsConstructor
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
...
...
@@ -24,6 +25,9 @@ public class OrderChildFeignController {
private
final
OrderChildService
orderChildService
;
private
final
FeignOrderChildService
feignOrderChildService
;
@GetMapping
({
"/getOrderChildTotalByUserNo"
})
Integer
getTrucksByOrderGoodsNo
(
@RequestParam
(
"userNo"
)
@NotNull
(
message
=
"用户编号不可为空"
)
Long
userNo
)
{
Integer
totalByUserNo
=
orderChildService
.
getOrderChildTotalByUserNo
(
userNo
);
...
...
@@ -45,4 +49,14 @@ public class OrderChildFeignController {
return
Result
.
ok
(
false
);
}
}
@ApiOperation
(
value
=
"线路运单统计"
,
notes
=
"<br>By:艾庆国"
)
@RequestMapping
(
value
=
"/lineStatistics"
,
method
=
RequestMethod
.
GET
)
Result
<
OrderChildLineStatisticsVO
>
lineStatistics
(
@NotBlank
(
message
=
"发货地址不可为空"
)
Integer
sendSystemAddressId
,
@NotBlank
(
message
=
"收货货地址不可为空"
)
Integer
receiveSystemAddressId
){
return
Result
.
ok
(
feignOrderChildService
.
getLineStatistics
(
sendSystemAddressId
,
receiveSystemAddressId
));
}
}
performance-web/src/main/java/com/clx/performance/controller/temp/TempController.java
浏览文件 @
ad1d4c08
package
com
.
clx
.
performance
.
controller
.
temp
;
import
com.clx.performance.service.TempService
;
import
com.clx.performance.service.child.CarrierOrderChildService
;
import
com.clx.performance.service.child.FeignOrderChildService
;
import
com.clx.performance.vo.pc.child.OrderChildLineStatisticsVO
;
import
com.msl.common.result.Result
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -10,8 +11,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.HashMap
;
/**
* @Author: aiqingguo
...
...
@@ -27,14 +26,13 @@ public class TempController {
@Autowired
private
TempService
tempService
;
@Autowired
private
Carrier
OrderChildService
carrierOrderChildService
;
private
Feign
OrderChildService
carrierOrderChildService
;
@ApiOperation
(
value
=
"test"
,
notes
=
"<br>By:艾庆国"
)
@RequestMapping
(
value
=
"/test"
,
method
=
RequestMethod
.
GET
)
public
Result
<
HashMap
>
test
(
Integer
sendAddressId
,
Integer
receiveAddressId
)
{
public
Result
<
OrderChildLineStatisticsVO
>
test
(
Integer
sendAddressId
,
Integer
receiveAddressId
)
{
return
Result
.
ok
(
carrierOrderChildService
.
getLineStatistics
(
sendAddressId
,
receiveAddressId
));
}
...
...
performance-web/src/main/java/com/clx/performance/dao/OrderChildDao.java
浏览文件 @
ad1d4c08
...
...
@@ -109,12 +109,11 @@ public interface OrderChildDao extends BaseDao<OrderChildMapper, OrderChild, Int
List
<
OrderChild
>
selectInTransitOrderChildByOrderGoodsNo
(
String
orderGoodsNo
);
BigDecimal
getLinePoundDifferenceAvg
(
@Param
(
"sendAddressId"
)
Integer
sendAddressId
,
@Param
(
"receiveAddressId"
)
Integer
receiveAddressId
,
@Param
(
"beginTime"
)
String
beginTime
);
Integer
getLineArriveSendAddressToUnloadTimeAvg
(
@Param
(
"sendAddressId"
)
Integer
sendAddressId
,
@Param
(
"receiveAddressId"
)
Integer
receiveAddressId
,
BigDecimal
getLinePoundDifferenceRatioAvg
(
@Param
(
"sendSystemAddressId"
)
Integer
sendSystemAddressId
,
@Param
(
"receiveSystemAddressId"
)
Integer
receiveSystemAddressId
,
@Param
(
"beginTime"
)
String
beginTime
);
Integer
getLineArriveSendAddressToUnloadTimeAvg
(
@Param
(
"sendSystemAddressId"
)
Integer
sendSystemAddressId
,
@Param
(
"receiveSystemAddressId"
)
Integer
receiveSystemAddressId
,
@Param
(
"beginTime"
)
String
beginTime
);
void
updateSendSystemAddress
(
Integer
ownerAddressId
,
Integer
systemAddressId
);
...
...
performance-web/src/main/java/com/clx/performance/dao/impl/OrderChildDaoImpl.java
浏览文件 @
ad1d4c08
...
...
@@ -9,7 +9,6 @@ import com.clx.performance.dao.OrderChildDao;
import
com.clx.performance.enums.OrderChildEnum
;
import
com.clx.performance.mapper.OrderChildMapper
;
import
com.clx.performance.model.OrderChild
;
import
com.clx.performance.model.OrderGoods
;
import
com.clx.performance.param.app.PageOrderChildOfDriverParam
;
import
com.clx.performance.param.app.PageOrderChildOfDriverSearchParam
;
import
com.clx.performance.param.pc.PageCarrierOrderChildParam
;
...
...
@@ -376,13 +375,13 @@ public class OrderChildDaoImpl extends BaseDaoImpl<OrderChildMapper, OrderChild,
);
}
@Override
public
BigDecimal
getLinePoundDifference
Avg
(
Integer
sendAddressId
,
Integer
receive
AddressId
,
String
beginTime
)
{
return
baseMapper
.
getLinePoundDifference
Avg
(
sendAddressId
,
receive
AddressId
,
beginTime
);
public
BigDecimal
getLinePoundDifference
RatioAvg
(
Integer
sendSystemAddressId
,
Integer
receiveSystem
AddressId
,
String
beginTime
)
{
return
baseMapper
.
getLinePoundDifference
RatioAvg
(
sendSystemAddressId
,
receiveSystem
AddressId
,
beginTime
);
}
@Override
public
Integer
getLineArriveSendAddressToUnloadTimeAvg
(
Integer
send
AddressId
,
Integer
receive
AddressId
,
String
beginTime
)
{
return
baseMapper
.
getLineArriveSendAddressToUnloadTimeAvg
(
send
AddressId
,
receive
AddressId
,
beginTime
);
public
Integer
getLineArriveSendAddressToUnloadTimeAvg
(
Integer
send
SystemAddressId
,
Integer
receiveSystem
AddressId
,
String
beginTime
)
{
return
baseMapper
.
getLineArriveSendAddressToUnloadTimeAvg
(
send
SystemAddressId
,
receiveSystem
AddressId
,
beginTime
);
}
...
...
performance-web/src/main/java/com/clx/performance/mapper/OrderChildMapper.java
浏览文件 @
ad1d4c08
...
...
@@ -49,21 +49,21 @@ public interface OrderChildMapper extends BaseMapper<OrderChild> {
Integer
updateOrderGoodsSetResidueWeight
(
@Param
(
value
=
"status"
)
Integer
status
,
@Param
(
value
=
"ids"
)
List
<
Integer
>
ids
);
@Select
(
"select AVG((load_net-unload_net)/load_net) from order_child "
+
" where send_
address_id = #{send
AddressId} "
+
" and receive_
address_id = #{receive
AddressId} "
+
" where send_
system_address_id = #{sendSystem
AddressId} "
+
" and receive_
system_address_id = #{receiveSystem
AddressId} "
+
" and status >= 90 and status <= 100 "
+
" and pay_time >= #{beginTime}"
)
BigDecimal
getLinePoundDifference
Avg
(
@Param
(
"sendAddressId"
)
Integer
send
AddressId
,
@Param
(
"receiveAddressId"
)
Integer
receive
AddressId
,
@Param
(
"beginTime"
)
String
beginTime
);
BigDecimal
getLinePoundDifference
RatioAvg
(
@Param
(
"sendSystemAddressId"
)
Integer
sendSystem
AddressId
,
@Param
(
"receiveSystemAddressId"
)
Integer
receiveSystem
AddressId
,
@Param
(
"beginTime"
)
String
beginTime
);
@Select
(
"select AVG(TIMESTAMPDIFF(SECOND, arrive_send_time, unload_time)) from order_child "
+
" where send_
address_id = #{send
AddressId} "
+
" and receive_
address_id = #{receive
AddressId} "
+
" where send_
system_address_id = #{sendSystem
AddressId} "
+
" and receive_
system_address_id = #{receiveSystem
AddressId} "
+
" and status >= 90 and status <= 100 "
+
" and pay_time >= #{beginTime}"
)
Integer
getLineArriveSendAddressToUnloadTimeAvg
(
@Param
(
"send
AddressId"
)
Integer
send
AddressId
,
@Param
(
"receive
AddressId"
)
Integer
receive
AddressId
,
Integer
getLineArriveSendAddressToUnloadTimeAvg
(
@Param
(
"send
SystemAddressId"
)
Integer
sendSystem
AddressId
,
@Param
(
"receive
SystemAddressId"
)
Integer
receiveSystem
AddressId
,
@Param
(
"beginTime"
)
String
beginTime
);
}
\ No newline at end of file
performance-web/src/main/java/com/clx/performance/service/child/CarrierOrderChildService.java
deleted
100644 → 0
浏览文件 @
36358ac4
package
com
.
clx
.
performance
.
service
.
child
;
import
java.util.HashMap
;
public
interface
CarrierOrderChildService
{
HashMap
<
String
,
Object
>
getLineStatistics
(
Integer
sendAddressId
,
Integer
receiveAddressId
);
}
performance-web/src/main/java/com/clx/performance/service/child/FeignOrderChildService.java
0 → 100644
浏览文件 @
ad1d4c08
package
com
.
clx
.
performance
.
service
.
child
;
import
com.clx.performance.vo.pc.child.OrderChildLineStatisticsVO
;
public
interface
FeignOrderChildService
{
OrderChildLineStatisticsVO
getLineStatistics
(
Integer
sendSystemAddressId
,
Integer
receiveSystemAddressId
);
}
performance-web/src/main/java/com/clx/performance/service/impl/child/
Carrier
OrderChildServiceImpl.java
→
performance-web/src/main/java/com/clx/performance/service/impl/child/
Feign
OrderChildServiceImpl.java
浏览文件 @
ad1d4c08
package
com
.
clx
.
performance
.
service
.
impl
.
child
;
import
com.clx.performance.dao.OrderChildDao
;
import
com.clx.performance.service.child.
Carrier
OrderChildService
;
import
com.clx.performance.service.child.
Feign
OrderChildService
;
import
com.clx.performance.utils.LocalDateTimeUtils
;
import
com.clx.performance.vo.pc.child.OrderChildLineStatisticsVO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -10,31 +11,30 @@ import org.springframework.stereotype.Service;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.time.LocalDateTime
;
import
java.util.HashMap
;
@Slf4j
@Service
public
class
CarrierOrderChildServiceImpl
implements
Carrier
OrderChildService
{
public
class
FeignOrderChildServiceImpl
implements
Feign
OrderChildService
{
@Autowired
private
OrderChildDao
orderChildDao
;
@Override
public
HashMap
<
String
,
Object
>
getLineStatistics
(
Integer
sendAddressId
,
Integer
receive
AddressId
)
{
public
OrderChildLineStatisticsVO
getLineStatistics
(
Integer
sendSystemAddressId
,
Integer
receiveSystem
AddressId
)
{
// 磅差
String
beginTime
=
LocalDateTimeUtils
.
getStringDayStart
(
LocalDateTime
.
now
().
minusDays
(
7
));
BigDecimal
linePoundDifference
Avg
=
orderChildDao
.
getLinePoundDifferenceAvg
(
sendAddressId
,
receive
AddressId
,
beginTime
);
BigDecimal
linePoundDifference
RatioAvg
=
orderChildDao
.
getLinePoundDifferenceRatioAvg
(
sendSystemAddressId
,
receiveSystem
AddressId
,
beginTime
);
// 时长
beginTime
=
LocalDateTimeUtils
.
getStringDayStart
(
LocalDateTime
.
now
().
minusMonths
(
1
));
Integer
timeAvg
=
orderChildDao
.
getLineArriveSendAddressToUnloadTimeAvg
(
send
AddressId
,
receive
AddressId
,
beginTime
);
Integer
timeAvg
=
orderChildDao
.
getLineArriveSendAddressToUnloadTimeAvg
(
send
SystemAddressId
,
receiveSystem
AddressId
,
beginTime
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>
();
OrderChildLineStatisticsVO
vo
=
new
OrderChildLineStatisticsVO
();
map
.
put
(
"poundDifferenceAvg"
,
linePoundDifferenceAvg
==
null
?
null
:
linePoundDifference
Avg
.
setScale
(
4
,
RoundingMode
.
HALF_UP
).
movePointRight
(
2
));
map
.
put
(
"timeAvg"
,
timeAvg
==
null
?
null
:
timeAvg
/
60
);
vo
.
setPoundDifferenceRatioAvg
(
linePoundDifferenceRatioAvg
==
null
?
null
:
linePoundDifferenceRatio
Avg
.
setScale
(
4
,
RoundingMode
.
HALF_UP
).
movePointRight
(
2
));
vo
.
setTimeAvg
(
timeAvg
==
null
?
null
:
timeAvg
/
60
);
return
map
;
return
vo
;
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论