Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
7fe1dbd9
提交
7fe1dbd9
authored
11月 08, 2023
作者:
aiqingguo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
运单统计
上级
9a617c3b
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
129 行增加
和
4 行删除
+129
-4
CarrierOrderChildController.java
...troller/pc/child/carrier/CarrierOrderChildController.java
+23
-0
TempController.java
...a/com/clx/performance/controller/temp/TempController.java
+10
-2
OrderChildDao.java
.../src/main/java/com/clx/performance/dao/OrderChildDao.java
+9
-0
OrderChildDaoImpl.java
.../java/com/clx/performance/dao/impl/OrderChildDaoImpl.java
+13
-0
OrderChildMapper.java
...ain/java/com/clx/performance/mapper/OrderChildMapper.java
+20
-2
CarrierOrderChildService.java
...x/performance/service/child/CarrierOrderChildService.java
+10
-0
CarrierOrderChildServiceImpl.java
...ance/service/impl/child/CarrierOrderChildServiceImpl.java
+40
-0
LocalDateTimeUtils.java
...in/java/com/clx/performance/utils/LocalDateTimeUtils.java
+4
-0
没有找到文件。
performance-web/src/main/java/com/clx/performance/controller/pc/child/carrier/CarrierOrderChildController.java
0 → 100644
浏览文件 @
7fe1dbd9
package
com
.
clx
.
performance
.
controller
.
pc
.
child
.
carrier
;
import
com.clx.performance.service.child.CarrierOrderChildService
;
import
io.swagger.annotations.Api
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@Slf4j
@RestController
@RequestMapping
(
value
=
"/pc/carrier/orderChild/"
)
@Validated
@Api
(
tags
=
"承运PC-运单"
)
@AllArgsConstructor
public
class
CarrierOrderChildController
{
private
final
CarrierOrderChildService
carrierOrderChildService
;
}
performance-web/src/main/java/com/clx/performance/controller/temp/TempController.java
浏览文件 @
7fe1dbd9
package
com
.
clx
.
performance
.
controller
.
temp
;
import
com.clx.performance.service.TempService
;
import
com.clx.performance.service.child.CarrierOrderChildService
;
import
com.msl.common.result.Result
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -9,6 +10,8 @@ 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
...
...
@@ -23,13 +26,18 @@ public class TempController {
@Autowired
private
TempService
tempService
;
@Autowired
private
CarrierOrderChildService
carrierOrderChildService
;
@ApiOperation
(
value
=
"test"
,
notes
=
"<br>By:艾庆国"
)
@RequestMapping
(
value
=
"/test"
,
method
=
RequestMethod
.
GET
)
public
Result
<
Void
>
test
()
{
return
Result
.
ok
();
public
Result
<
HashMap
>
test
(
Integer
sendAddressId
,
Integer
receiveAddressId
)
{
carrierOrderChildService
.
getLineStatistics
(
sendAddressId
,
sendAddressId
);
return
Result
.
ok
(
carrierOrderChildService
.
getLineStatistics
(
sendAddressId
,
sendAddressId
));
}
@ApiOperation
(
value
=
"更新网运标识"
,
notes
=
"<br>By:艾庆国"
)
...
...
performance-web/src/main/java/com/clx/performance/dao/OrderChildDao.java
浏览文件 @
7fe1dbd9
...
...
@@ -16,6 +16,7 @@ import com.msl.common.base.Optional;
import
com.msl.common.dao.BaseDao
;
import
org.apache.ibatis.annotations.Param
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.List
;
...
...
@@ -108,4 +109,12 @@ 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
);
int
getLineArriveSendAddressToUnloadTimeAvg
(
@Param
(
"sendAddressId"
)
Integer
sendAddressId
,
@Param
(
"receiveAddressId"
)
Integer
receiveAddressId
,
@Param
(
"beginTime"
)
String
beginTime
);
}
performance-web/src/main/java/com/clx/performance/dao/impl/OrderChildDaoImpl.java
浏览文件 @
7fe1dbd9
...
...
@@ -22,6 +22,7 @@ import com.msl.common.dao.impl.BaseDaoImpl;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Repository
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.List
;
...
...
@@ -372,4 +373,16 @@ public class OrderChildDaoImpl extends BaseDaoImpl<OrderChildMapper, OrderChild,
return
baseMapper
.
selectList
(
lQrWrapper
().
eq
(
OrderChild:
:
getOrderGoodsNo
,
orderGoodsNo
)
.
lt
(
OrderChild:
:
getStatus
,
OrderChildEnum
.
Status
.
COMPLETE
.
getCode
())
);
}
@Override
public
BigDecimal
getLinePoundDifferenceAvg
(
Integer
sendAddressId
,
Integer
receiveAddressId
,
String
beginTime
)
{
return
baseMapper
.
getLinePoundDifferenceAvg
(
sendAddressId
,
receiveAddressId
,
beginTime
);
}
@Override
public
int
getLineArriveSendAddressToUnloadTimeAvg
(
Integer
sendAddressId
,
Integer
receiveAddressId
,
String
beginTime
)
{
return
baseMapper
.
getLineArriveSendAddressToUnloadTimeAvg
(
sendAddressId
,
receiveAddressId
,
beginTime
);
}
}
performance-web/src/main/java/com/clx/performance/mapper/OrderChildMapper.java
浏览文件 @
7fe1dbd9
...
...
@@ -3,19 +3,18 @@ package com.clx.performance.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.clx.performance.enums.OrderChildEnum
;
import
com.clx.performance.model.OrderChild
;
import
com.clx.performance.param.app.PageOrderChildOfDriverParam
;
import
com.clx.performance.param.app.PageOrderChildOfDriverSearchParam
;
import
com.clx.performance.param.pc.PageCarrierOrderChildParam
;
import
com.clx.performance.param.pc.PagePoundAuditParam
;
import
com.clx.performance.sqlProvider.OrderChildSqlProvider
;
import
com.clx.performance.sqlProvider.OrderGoodsSqlProvider
;
import
com.clx.performance.vo.app.OrderChildVO
;
import
com.clx.performance.vo.pc.PageCarrierOrderChildVO
;
import
com.clx.performance.vo.pc.PageOrderChildPoundAuditVO
;
import
org.apache.ibatis.annotations.*
;
import
java.math.BigDecimal
;
import
java.util.List
;
...
...
@@ -48,4 +47,22 @@ public interface OrderChildMapper extends BaseMapper<OrderChild> {
@UpdateProvider
(
type
=
OrderChildSqlProvider
.
class
,
method
=
"batchUpdateOrderChildStatus"
)
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 = #{sendAddressId} "
+
" and receive_address_id = #{receiveAddressId} "
+
" and status >= 90 and status <= 100 "
+
" and pay_time >= #{beginTime}"
)
BigDecimal
getLinePoundDifferenceAvg
(
@Param
(
"sendAddressId"
)
Integer
sendAddressId
,
@Param
(
"receiveAddressId"
)
Integer
receiveAddressId
,
@Param
(
"beginTime"
)
String
beginTime
);
@Select
(
"select AVG(TIMESTAMPDIFF(SECOND, unload_time, arrive_send_time)) from order_child "
+
" where send_address_id = #{sendAddressId} "
+
" and receive_address_id = #{receiveAddressId} "
+
" and status >= 90 and status <= 100 "
+
" and pay_time >= #{beginTime}"
)
int
getLineArriveSendAddressToUnloadTimeAvg
(
@Param
(
"sendAddressId"
)
Integer
sendAddressId
,
@Param
(
"receiveAddressId"
)
Integer
receiveAddressId
,
@Param
(
"beginTime"
)
String
beginTime
);
}
\ No newline at end of file
performance-web/src/main/java/com/clx/performance/service/child/CarrierOrderChildService.java
0 → 100644
浏览文件 @
7fe1dbd9
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/impl/child/CarrierOrderChildServiceImpl.java
0 → 100644
浏览文件 @
7fe1dbd9
package
com
.
clx
.
performance
.
service
.
impl
.
child
;
import
com.clx.performance.dao.OrderChildDao
;
import
com.clx.performance.service.child.CarrierOrderChildService
;
import
com.clx.performance.utils.LocalDateTimeUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
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
CarrierOrderChildService
{
@Autowired
private
OrderChildDao
orderChildDao
;
@Override
public
HashMap
<
String
,
Object
>
getLineStatistics
(
Integer
sendAddressId
,
Integer
receiveAddressId
)
{
// 磅差
String
beginTime
=
LocalDateTimeUtils
.
getStringDayStart
(
LocalDateTime
.
now
().
minusDays
(
7
));
BigDecimal
linePoundDifferenceAvg
=
orderChildDao
.
getLinePoundDifferenceAvg
(
sendAddressId
,
receiveAddressId
,
beginTime
);
// 时长
beginTime
=
LocalDateTimeUtils
.
getStringDayStart
(
LocalDateTime
.
now
().
minusMonths
(
1
));
int
timeAvg
=
orderChildDao
.
getLineArriveSendAddressToUnloadTimeAvg
(
sendAddressId
,
receiveAddressId
,
beginTime
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"poundDifferenceAvg"
,
linePoundDifferenceAvg
.
setScale
(
2
,
RoundingMode
.
HALF_UP
));
map
.
put
(
"timeAvg"
,
timeAvg
/
60
);
return
map
;
}
}
performance-web/src/main/java/com/clx/performance/utils/LocalDateTimeUtils.java
浏览文件 @
7fe1dbd9
...
...
@@ -155,6 +155,10 @@ public class LocalDateTimeUtils {
return
formatTime
(
parseTime
(
time
).
withHour
(
0
).
withMinute
(
0
).
withSecond
(
0
).
withNano
(
0
));
}
public
static
String
getStringDayStart
(
LocalDateTime
time
)
{
return
formatTime
(
time
.
withHour
(
0
).
withMinute
(
0
).
withSecond
(
0
).
withNano
(
0
));
}
public
static
LocalDateTime
getDayStart
(
String
time
)
{
return
parseTime
(
time
).
withHour
(
0
).
withMinute
(
0
).
withSecond
(
0
).
withNano
(
0
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论