Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
a5e86c2f
提交
a5e86c2f
authored
7月 16, 2024
作者:
刘海泉
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
提交履约进度表相关接口
上级
3270b245
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
204 行增加
和
3 行删除
+204
-3
PerformanceProgressTabEnum.java
...com/clx/performance/enums/PerformanceProgressTabEnum.java
+39
-0
PerformanceProgressDao.java
.../java/com/clx/performance/dao/PerformanceProgressDao.java
+6
-1
PerformanceProgressDaoImpl.java
.../clx/performance/dao/impl/PerformanceProgressDaoImpl.java
+16
-1
PerformanceProgressService.java
...m/clx/performance/service/PerformanceProgressService.java
+6
-0
PerformanceProgressServiceImpl.java
...formance/service/impl/PerformanceProgressServiceImpl.java
+123
-1
PerformanceProgressStruct.java
...com/clx/performance/struct/PerformanceProgressStruct.java
+14
-0
没有找到文件。
performance-api/src/main/java/com/clx/performance/enums/PerformanceProgressTabEnum.java
0 → 100644
浏览文件 @
a5e86c2f
package
com
.
clx
.
performance
.
enums
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
java.util.Arrays
;
import
java.util.Optional
;
public
enum
PerformanceProgressTabEnum
{
;
//1:进行中的线路(不分页) 2:已结束线路 3:全部线路
@Getter
@AllArgsConstructor
public
enum
Type
{
IN_PROCESS
(
1
,
"进行中的线路"
),
END
(
2
,
"已结束线路"
),
ALL
(
3
,
"全部线路"
),
;
private
final
Integer
code
;
private
final
String
name
;
public
static
Optional
<
Type
>
getByCode
(
Integer
code
)
{
return
Arrays
.
stream
(
values
()).
filter
(
e
->
e
.
code
.
equals
(
code
)).
findFirst
();
}
public
static
String
getMsgByCode
(
int
code
)
{
return
getByCode
(
code
).
map
(
Type:
:
getName
).
orElse
(
null
);
}
}
}
performance-web/src/main/java/com/clx/performance/dao/PerformanceProgressDao.java
浏览文件 @
a5e86c2f
package
com
.
clx
.
performance
.
dao
;
import
com.
msl.common.dao.BaseDao
;
import
com.
baomidou.mybatisplus.core.metadata.IPage
;
import
com.clx.performance.mapper.PerformanceProgressMapper
;
import
com.clx.performance.model.PerformanceProgress
;
import
com.clx.performance.param.pc.carrier.PagePerformanceProgress
;
import
com.msl.common.dao.BaseDao
;
import
java.util.List
;
/**
* @author kavin
...
...
@@ -10,4 +14,5 @@ import com.clx.performance.model.PerformanceProgress;
* Time 16:02
*/
public
interface
PerformanceProgressDao
extends
BaseDao
<
PerformanceProgressMapper
,
PerformanceProgress
,
Integer
>
{
IPage
<
PerformanceProgress
>
pagePerformanceProgress
(
List
<
Integer
>
statusList
,
PagePerformanceProgress
param
);
}
performance-web/src/main/java/com/clx/performance/dao/impl/PerformanceProgressDaoImpl.java
浏览文件 @
a5e86c2f
package
com
.
clx
.
performance
.
dao
.
impl
;
import
com.msl.common.dao.impl.BaseDaoImpl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.clx.performance.dao.PerformanceProgressDao
;
import
com.clx.performance.mapper.PerformanceProgressMapper
;
import
com.clx.performance.model.PerformanceProgress
;
import
com.clx.performance.param.pc.carrier.PagePerformanceProgress
;
import
com.msl.common.dao.impl.BaseDaoImpl
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* @author kavin
* Date 2024-07-12
...
...
@@ -13,4 +19,13 @@ import org.springframework.stereotype.Repository;
*/
@Repository
public
class
PerformanceProgressDaoImpl
extends
BaseDaoImpl
<
PerformanceProgressMapper
,
PerformanceProgress
,
Integer
>
implements
PerformanceProgressDao
{
@Override
public
IPage
<
PerformanceProgress
>
pagePerformanceProgress
(
List
<
Integer
>
statusList
,
PagePerformanceProgress
param
){
Page
<
PerformanceProgress
>
page
=
Page
.
of
(
param
.
getPage
(),
param
.
getPageSize
());
LambdaQueryWrapper
<
PerformanceProgress
>
query
=
new
LambdaQueryWrapper
<>();
query
.
in
(
PerformanceProgress
::
getOrderStatus
,
statusList
);
//最新接单的seq最大,所以这里升序排序
query
.
orderByAsc
(
PerformanceProgress
::
getSeq
);
return
baseMapper
.
selectPage
(
page
,
query
);
}
}
performance-web/src/main/java/com/clx/performance/service/PerformanceProgressService.java
浏览文件 @
a5e86c2f
package
com
.
clx
.
performance
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.clx.performance.model.PerformanceProgress
;
import
com.clx.performance.param.pc.carrier.PagePerformanceProgress
;
import
com.clx.performance.vo.pc.PerformanceProgressVO
;
...
...
@@ -13,4 +14,9 @@ public interface PerformanceProgressService {
IPage
<
PerformanceProgressVO
>
pagePerformanceProgress
(
PagePerformanceProgress
param
);
void
updateAdjustOrder
(
Integer
adjustOrderOneId
,
Integer
adjustOrderTwoId
);
void
saveOrUpdatePerformanceProgress
(
PerformanceProgress
item
);
}
performance-web/src/main/java/com/clx/performance/service/impl/PerformanceProgressServiceImpl.java
浏览文件 @
a5e86c2f
package
com
.
clx
.
performance
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.clx.performance.dao.PerformanceProgressDao
;
import
com.clx.performance.enums.OrderEnum
;
import
com.clx.performance.enums.PerformanceProgressTabEnum
;
import
com.clx.performance.enums.ResultEnum
;
import
com.clx.performance.model.PerformanceProgress
;
import
com.clx.performance.param.pc.carrier.PagePerformanceProgress
;
import
com.clx.performance.service.PerformanceProgressService
;
import
com.clx.performance.struct.PerformanceProgressStruct
;
import
com.clx.performance.vo.pc.PerformanceProgressVO
;
import
com.msl.common.base.Optional
;
import
com.msl.common.exception.ServiceSystemException
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Objects
;
/**
* @author kavin
* Date 2024-07-12
...
...
@@ -14,14 +30,120 @@ import org.springframework.stereotype.Service;
*/
@Service
@Slf4j
@AllArgsConstructor
public
class
PerformanceProgressServiceImpl
implements
PerformanceProgressService
{
private
final
PerformanceProgressDao
performanceProgressDao
;
private
final
PerformanceProgressStruct
performanceProgressStruct
;
public
static
List
<
Integer
>
inProcessStatusList
;
public
static
List
<
Integer
>
endStatusList
;
public
static
List
<
Integer
>
allStatusList
;
static
{
inProcessStatusList
=
Arrays
.
asList
(
OrderEnum
.
Status
.
PLATFORM_UNDERTAKING
.
getCode
(),
OrderEnum
.
Status
.
SUSPEND
.
getCode
(),
OrderEnum
.
Status
.
ON_ORDER
.
getCode
(),
OrderEnum
.
Status
.
IN_TRANSIT
.
getCode
());
endStatusList
=
Arrays
.
asList
(
OrderEnum
.
Status
.
SUCCESS
.
getCode
(),
OrderEnum
.
Status
.
COMPLETED
.
getCode
());
allStatusList
=
Arrays
.
asList
(
OrderEnum
.
Status
.
PLATFORM_UNDERTAKING
.
getCode
(),
OrderEnum
.
Status
.
SUSPEND
.
getCode
(),
OrderEnum
.
Status
.
ON_ORDER
.
getCode
(),
OrderEnum
.
Status
.
IN_TRANSIT
.
getCode
(),
OrderEnum
.
Status
.
SUCCESS
.
getCode
(),
OrderEnum
.
Status
.
COMPLETED
.
getCode
());
}
@Override
public
IPage
<
PerformanceProgressVO
>
pagePerformanceProgress
(
PagePerformanceProgress
param
)
{
return
null
;
IPage
<
PerformanceProgress
>
page
=
new
Page
<>();
IPage
<
PerformanceProgressVO
>
returnPage
=
new
Page
<>();
if
(
Objects
.
equals
(
param
.
getTab
(),
PerformanceProgressTabEnum
.
Type
.
IN_PROCESS
.
getCode
())){
param
.
setPage
(
1
);
param
.
setPageSize
(
10000
);
page
=
performanceProgressDao
.
pagePerformanceProgress
(
inProcessStatusList
,
param
);
}
else
if
(
Objects
.
equals
(
param
.
getTab
(),
PerformanceProgressTabEnum
.
Type
.
END
.
getCode
())){
page
=
performanceProgressDao
.
pagePerformanceProgress
(
endStatusList
,
param
);
}
else
if
(
Objects
.
equals
(
param
.
getTab
(),
PerformanceProgressTabEnum
.
Type
.
ALL
.
getCode
())){
page
=
performanceProgressDao
.
pagePerformanceProgress
(
allStatusList
,
param
);
}
if
(
CollectionUtils
.
isEmpty
(
page
.
getRecords
())){
return
returnPage
;
}
List
<
PerformanceProgressVO
>
records
=
performanceProgressStruct
.
convertList
(
page
.
getRecords
());
returnPage
.
setPages
(
page
.
getPages
());
returnPage
.
setTotal
(
page
.
getTotal
());
returnPage
.
setRecords
(
records
);
//如果查询的是 已结束线路,则不需要计算,直接返回
if
(
Objects
.
equals
(
param
.
getTab
(),
PerformanceProgressTabEnum
.
Type
.
END
.
getCode
())){
return
returnPage
;
}
returnPage
.
getRecords
().
forEach
(
item
->{
//TODO 进行订单运费预估调用 开发批量调用的接口。 订单完结完成后把运费预估查询出来的数据存入到数据库,后续不再实时查询
if
(
inProcessStatusList
.
contains
(
item
.
getOrderStatus
())){
//进行中的订单线路
}
});
return
returnPage
;
}
@Override
public
void
updateAdjustOrder
(
Integer
adjustOrderOneId
,
Integer
adjustOrderTwoId
)
{
Optional
<
PerformanceProgress
>
one
=
performanceProgressDao
.
getEntityByKey
(
adjustOrderOneId
);
Optional
<
PerformanceProgress
>
two
=
performanceProgressDao
.
getEntityByKey
(
adjustOrderTwoId
);
if
(!
one
.
isPresent
()
||
!
two
.
isPresent
()){
throw
new
ServiceSystemException
(
ResultEnum
.
DATA_NOT_FIND
);
}
PerformanceProgress
updateOne
=
new
PerformanceProgress
();
updateOne
.
setId
(
one
.
get
().
getId
());
updateOne
.
setSeq
(
two
.
get
().
getSeq
());
PerformanceProgress
updateTwo
=
new
PerformanceProgress
();
updateTwo
.
setId
(
two
.
get
().
getId
());
updateTwo
.
setSeq
(
one
.
get
().
getSeq
());
List
<
PerformanceProgress
>
list
=
new
ArrayList
<>();
list
.
add
(
updateOne
);
list
.
add
(
updateTwo
);
performanceProgressDao
.
updateBatchList
(
list
);
}
//通过dts监听订单、货单、运单表进行更新履约进度表的数据
@Override
public
void
saveOrUpdatePerformanceProgress
(
PerformanceProgress
item
)
{
Optional
<
PerformanceProgress
>
optional
=
performanceProgressDao
.
getOneByField
(
PerformanceProgress:
:
getOrderNo
,
item
.
getOrderNo
());
if
(
optional
.
isPresent
()){
item
.
setId
(
optional
.
get
().
getId
());
performanceProgressDao
.
updateEntityByKey
(
item
);
}
else
{
performanceProgressDao
.
saveEntity
(
item
);
}
}
}
performance-web/src/main/java/com/clx/performance/struct/PerformanceProgressStruct.java
0 → 100644
浏览文件 @
a5e86c2f
package
com
.
clx
.
performance
.
struct
;
import
com.clx.performance.model.PerformanceProgress
;
import
com.clx.performance.vo.pc.PerformanceProgressVO
;
import
com.msl.common.utils.DateStructUtil
;
import
com.msl.common.utils.DateUtils
;
import
org.mapstruct.Mapper
;
import
java.util.List
;
@Mapper
(
componentModel
=
"spring"
,
uses
=
DateStructUtil
.
class
,
imports
=
{
DateUtils
.
class
})
public
interface
PerformanceProgressStruct
{
List
<
PerformanceProgressVO
>
convertList
(
List
<
PerformanceProgress
>
records
);
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论