Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
b99f753c
提交
b99f753c
authored
7月 16, 2024
作者:
刘海泉
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增履约进度表相关接口
上级
efea642a
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
135 行增加
和
27 行删除
+135
-27
OrderChildEnum.java
...c/main/java/com/clx/performance/enums/OrderChildEnum.java
+2
-1
CarrierPerformanceProgressController.java
...ller/pc/carrier/CarrierPerformanceProgressController.java
+5
-5
PerformanceProgressDao.java
.../java/com/clx/performance/dao/PerformanceProgressDao.java
+2
-0
PerformanceProgressDaoImpl.java
.../clx/performance/dao/impl/PerformanceProgressDaoImpl.java
+15
-2
PerformanceProgressLogService.java
...lx/performance/service/PerformanceProgressLogService.java
+5
-0
PerformanceProgressService.java
...m/clx/performance/service/PerformanceProgressService.java
+1
-1
PerformanceProgressLogServiceImpl.java
...mance/service/impl/PerformanceProgressLogServiceImpl.java
+13
-0
PerformanceProgressServiceImpl.java
...formance/service/impl/PerformanceProgressServiceImpl.java
+92
-18
没有找到文件。
performance-api/src/main/java/com/clx/performance/enums/OrderChildEnum.java
浏览文件 @
b99f753c
...
...
@@ -179,7 +179,8 @@ public enum OrderChildEnum {
public
static
ConcurrentHashMap
<
Integer
,
String
>
map
=
new
ConcurrentHashMap
();
static
{
for
(
OrderChildEnum
.
Status
orderChildStatusEnum
:
OrderChildEnum
.
Status
.
values
()){
for
(
OrderChildEnum
.
Status
orderChildStatusEnum
:
OrderChildEnum
.
Status
.
values
()){
map
.
put
(
orderChildStatusEnum
.
getCode
(),
orderChildStatusEnum
.
getName
());
}
}
...
...
performance-web/src/main/java/com/clx/performance/controller/pc/carrier/CarrierPerformanceProgressController.java
浏览文件 @
b99f753c
...
...
@@ -47,10 +47,10 @@ public class CarrierPerformanceProgressController {
@ApiOperation
(
value
=
"进行中数据调整顺序"
,
notes
=
"<br>By:刘海泉"
)
@GetMapping
(
"/updateAdjustOrder"
)
public
Result
<
Object
>
updateAdjustOrder
(
@RequestParam
(
"adjustOrderOneId"
)
@NotBlank
(
message
=
"调整订单1的id不能为空"
)
Integer
adjustOrder
One
Id
,
@RequestParam
(
"adjustOrderTwoId"
)
@NotBlank
(
message
=
"调整订单2的id不能为空"
)
Integer
adjustOrder
Two
Id
@RequestParam
(
"adjustOrderOneId"
)
@NotBlank
(
message
=
"调整订单1的id不能为空"
)
Integer
adjustOrderId
,
@RequestParam
(
"adjustOrderTwoId"
)
@NotBlank
(
message
=
"调整订单2的id不能为空"
)
Integer
adjustOrder
Before
Id
)
{
performanceProgressService
.
updateAdjustOrder
(
adjustOrder
OneId
,
adjustOrderTwo
Id
);
performanceProgressService
.
updateAdjustOrder
(
adjustOrder
Id
,
adjustOrderBefore
Id
);
return
Result
.
ok
();
}
...
...
@@ -64,7 +64,7 @@ public class CarrierPerformanceProgressController {
}
@ApiOperation
(
value
=
"
编辑履约进度
"
,
notes
=
"<br>By:刘海泉"
)
@ApiOperation
(
value
=
"
获取履约进度详情
"
,
notes
=
"<br>By:刘海泉"
)
@GetMapping
(
"/getPerformanceProgressDetail"
)
public
Result
<
PerformanceProgressDetailVO
>
getPerformanceProgressDetail
(
@RequestParam
(
"id"
)
@NotNull
(
message
=
"id不能为空"
)
Integer
id
)
{
PerformanceProgressDetailVO
vo
=
performanceProgressService
.
getPerformanceProgressDetail
(
id
);
...
...
@@ -72,7 +72,7 @@ public class CarrierPerformanceProgressController {
}
@ApiOperation
(
value
=
"
编辑履约进度
"
,
notes
=
"<br>By:刘海泉"
)
@ApiOperation
(
value
=
"
获取履约进度编辑日志列表
"
,
notes
=
"<br>By:刘海泉"
)
@GetMapping
(
"/getOperationLog"
)
public
Result
<
List
<
PerformanceProgressOperationLogVO
>>
getOperationLog
(
@RequestParam
(
"orderNo"
)
@NotBlank
(
message
=
"订单编号不能为空"
)
String
orderNo
)
{
List
<
PerformanceProgressOperationLogVO
>
list
=
performanceProgressService
.
getOperationLog
(
orderNo
);
...
...
performance-web/src/main/java/com/clx/performance/dao/PerformanceProgressDao.java
浏览文件 @
b99f753c
...
...
@@ -15,4 +15,6 @@ import java.util.List;
*/
public
interface
PerformanceProgressDao
extends
BaseDao
<
PerformanceProgressMapper
,
PerformanceProgress
,
Integer
>
{
IPage
<
PerformanceProgress
>
pagePerformanceProgress
(
List
<
Integer
>
statusList
,
PagePerformanceProgress
param
);
void
updateRecordOrder
(
Integer
seq
,
boolean
isUp
);
}
performance-web/src/main/java/com/clx/performance/dao/impl/PerformanceProgressDaoImpl.java
浏览文件 @
b99f753c
package
com
.
clx
.
performance
.
dao
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.clx.performance.dao.PerformanceProgressDao
;
...
...
@@ -24,8 +25,20 @@ public class PerformanceProgressDaoImpl extends BaseDaoImpl<PerformanceProgressM
Page
<
PerformanceProgress
>
page
=
Page
.
of
(
param
.
getPage
(),
param
.
getPageSize
());
LambdaQueryWrapper
<
PerformanceProgress
>
query
=
new
LambdaQueryWrapper
<>();
query
.
in
(
PerformanceProgress
::
getOrderStatus
,
statusList
);
//最新接单的seq最大,所以这里
升
序排序
query
.
orderBy
A
sc
(
PerformanceProgress
::
getSeq
);
//最新接单的seq最大,所以这里
降
序排序
query
.
orderBy
De
sc
(
PerformanceProgress
::
getSeq
);
return
baseMapper
.
selectPage
(
page
,
query
);
}
@Override
public
void
updateRecordOrder
(
Integer
seq
,
boolean
isUp
)
{
LambdaUpdateWrapper
<
PerformanceProgress
>
update
=
new
LambdaUpdateWrapper
<>();
if
(
isUp
){
update
.
gt
(
PerformanceProgress
::
getSeq
,
seq
);
}
else
{
update
.
ge
(
PerformanceProgress
::
getSeq
,
seq
);
}
update
.
setSql
(
"seq = seq + 1"
);
baseMapper
.
update
(
null
,
update
);
}
}
performance-web/src/main/java/com/clx/performance/service/PerformanceProgressLogService.java
浏览文件 @
b99f753c
package
com
.
clx
.
performance
.
service
;
import
com.clx.performance.enums.PerformanceProgressEnum
;
import
com.clx.performance.model.PerformanceProgressLog
;
/**
* @author kavin
* Date 2024-07-12
* Time 16:02
*/
public
interface
PerformanceProgressLogService
{
PerformanceProgressLog
generateLog
(
String
orderNo
,
PerformanceProgressEnum
.
LogType
logType
,
Object
content
,
Long
userNo
,
String
userName
);
}
performance-web/src/main/java/com/clx/performance/service/PerformanceProgressService.java
浏览文件 @
b99f753c
...
...
@@ -18,7 +18,7 @@ import java.util.List;
public
interface
PerformanceProgressService
{
IPage
<
PerformanceProgressVO
>
pagePerformanceProgress
(
PagePerformanceProgress
param
);
void
updateAdjustOrder
(
Integer
adjustOrder
OneId
,
Integer
adjustOrderTwo
Id
);
void
updateAdjustOrder
(
Integer
adjustOrder
Id
,
Integer
adjustOrderBefore
Id
);
void
saveOrUpdatePerformanceProgress
(
PerformanceProgress
item
);
...
...
performance-web/src/main/java/com/clx/performance/service/impl/PerformanceProgressLogServiceImpl.java
浏览文件 @
b99f753c
package
com
.
clx
.
performance
.
service
.
impl
;
import
com.clx.performance.enums.PerformanceProgressEnum
;
import
com.clx.performance.model.PerformanceProgressLog
;
import
com.clx.performance.service.PerformanceProgressLogService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
...
...
@@ -12,4 +14,15 @@ import org.springframework.stereotype.Service;
@Service
@Slf4j
public
class
PerformanceProgressLogServiceImpl
implements
PerformanceProgressLogService
{
@Override
public
PerformanceProgressLog
generateLog
(
String
orderNo
,
PerformanceProgressEnum
.
LogType
logType
,
Object
content
,
Long
userNo
,
String
userName
)
{
PerformanceProgressLog
log
=
new
PerformanceProgressLog
();
log
.
setOrderNo
(
orderNo
);
log
.
setOperateType
(
logType
.
getCode
());
log
.
setOperateContent
(
logType
.
getName
()
+
":"
+
content
);
log
.
setCreateBy
(
userNo
);
log
.
setCreateName
(
userName
);
return
log
;
}
}
performance-web/src/main/java/com/clx/performance/service/impl/PerformanceProgressServiceImpl.java
浏览文件 @
b99f753c
...
...
@@ -11,6 +11,7 @@ import com.clx.performance.model.PerformanceProgress;
import
com.clx.performance.model.PerformanceProgressLog
;
import
com.clx.performance.param.pc.carrier.PagePerformanceProgress
;
import
com.clx.performance.param.pc.carrier.UpdatePerformanceProgressParam
;
import
com.clx.performance.service.PerformanceProgressLogService
;
import
com.clx.performance.service.PerformanceProgressService
;
import
com.clx.performance.struct.PerformanceProgressLogStruct
;
import
com.clx.performance.struct.PerformanceProgressStruct
;
...
...
@@ -23,6 +24,7 @@ import lombok.AllArgsConstructor;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
...
...
@@ -43,6 +45,7 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi
private
final
PerformanceProgressStruct
performanceProgressStruct
;
private
final
PerformanceProgressLogDao
performanceProgressLogDao
;
private
final
PerformanceProgressLogStruct
performanceProgressLogStruct
;
private
final
PerformanceProgressLogService
performanceProgressLogService
;
public
static
List
<
Integer
>
inProcessStatusList
;
...
...
@@ -118,28 +121,35 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi
return
returnPage
;
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
updateAdjustOrder
(
Integer
adjustOrder
OneId
,
Integer
adjustOrderTwo
Id
)
{
Optional
<
PerformanceProgress
>
one
=
performanceProgressDao
.
getEntityByKey
(
adjustOrderOneId
);
Optional
<
PerformanceProgress
>
two
=
performanceProgressDao
.
getEntityByKey
(
adjustOrder
Two
Id
);
public
void
updateAdjustOrder
(
Integer
adjustOrder
Id
,
Integer
adjustOrderBefore
Id
)
{
Optional
<
PerformanceProgress
>
one
=
performanceProgressDao
.
getEntityByKey
(
adjustOrderId
);
//如果上调,这条记录传的是移动数据后面的记录id,如果下调,这条记录传的是移动数据前面的记录id
Optional
<
PerformanceProgress
>
two
=
performanceProgressDao
.
getEntityByKey
(
adjustOrder
Before
Id
);
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
);
boolean
isUp
=
false
;
//通过seq判断是上调还是下调
if
(
one
.
get
().
getSeq
()
<
two
.
get
().
getSeq
()){
isUp
=
true
;
}
//上调:大于two 这条记录的seq + 1 ; 下调:大于等于two这条记录的seq + 1 ;
performanceProgressDao
.
updateRecordOrder
(
two
.
get
().
getSeq
(),
isUp
);
if
(
isUp
){
//上调
//调整的记录使用 two 的seq + 1;
PerformanceProgress
updateOne
=
new
PerformanceProgress
();
updateOne
.
setId
(
one
.
get
().
getId
());
updateOne
.
setSeq
(
two
.
get
().
getSeq
()
+
1
);
performanceProgressDao
.
updateEntityByKey
(
updateOne
);
}
else
{
//下调
//调整的记录使用 two 的seq;
PerformanceProgress
updateOne
=
new
PerformanceProgress
();
updateOne
.
setId
(
one
.
get
().
getId
());
updateOne
.
setSeq
(
two
.
get
().
getSeq
());
performanceProgressDao
.
updateEntityByKey
(
updateOne
);
}
}
//通过dts监听订单、货单、运单表进行更新履约进度表的数据
...
...
@@ -155,9 +165,73 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
updatePerformanceProgress
(
UpdatePerformanceProgressParam
param
,
Long
userNo
,
String
userName
)
{
PerformanceProgress
item
=
performanceProgressDao
.
getEntityByKey
(
param
.
getId
()).
orElseThrow
(
ResultEnum
.
DATA_NOT_FIND
);
PerformanceProgress
update
=
new
PerformanceProgress
();
List
<
PerformanceProgressLog
>
logs
=
new
ArrayList
<>();
boolean
change
=
false
;
if
(
Objects
.
nonNull
(
item
.
getTodayExpectComplete
())
&&
Objects
.
nonNull
(
param
.
getTodayExpectComplete
())
&&
item
.
getTodayExpectComplete
().
compareTo
(
param
.
getTodayExpectComplete
())
!=
0
){
PerformanceProgressLog
log
=
performanceProgressLogService
.
generateLog
(
item
.
getOrderNo
(),
PerformanceProgressEnum
.
LogType
.
TODAY_EXPECT_COMPLETE
,
param
.
getTodayExpectComplete
(),
userNo
,
userName
);
update
.
setTodayExpectComplete
(
param
.
getTodayExpectComplete
());
logs
.
add
(
log
);
change
=
true
;
}
if
(
Objects
.
equals
(
item
.
getTradeRequireArriveStationTime
(),
param
.
getTradeRequireArriveStationTime
())){
PerformanceProgressLog
log
=
performanceProgressLogService
.
generateLog
(
item
.
getOrderNo
(),
PerformanceProgressEnum
.
LogType
.
TRADE_REQUIRE_ARRIVE_STATION_TIME
,
param
.
getTradeRequireArriveStationTime
(),
userNo
,
userName
);
update
.
setTradeRequireArriveStationTime
(
param
.
getTradeRequireArriveStationTime
());
logs
.
add
(
log
);
change
=
true
;
}
if
(
Objects
.
equals
(
item
.
getTransportExpectArriveStationTime
(),
param
.
getTransportExpectArriveStationTime
())){
PerformanceProgressLog
log
=
performanceProgressLogService
.
generateLog
(
item
.
getOrderNo
(),
PerformanceProgressEnum
.
LogType
.
TRADE_REQUIRE_ARRIVE_STATION_TIME
,
param
.
getTransportExpectArriveStationTime
(),
userNo
,
userName
);
update
.
setTransportExpectArriveStationTime
(
param
.
getTransportExpectArriveStationTime
());
logs
.
add
(
log
);
change
=
true
;
}
if
(
Objects
.
equals
(
item
.
getAbnormalRemark
(),
param
.
getAbnormalRemark
())){
PerformanceProgressLog
log
=
performanceProgressLogService
.
generateLog
(
item
.
getOrderNo
(),
PerformanceProgressEnum
.
LogType
.
ABNORMAL_REMARK
,
param
.
getAbnormalRemark
(),
userNo
,
userName
);
update
.
setAbnormalRemark
(
param
.
getAbnormalRemark
());
logs
.
add
(
log
);
change
=
true
;
}
if
(
Objects
.
equals
(
item
.
getPerformanceAbnormalReason
(),
param
.
getPerformanceAbnormalReason
())){
PerformanceProgressLog
log
=
performanceProgressLogService
.
generateLog
(
item
.
getOrderNo
(),
PerformanceProgressEnum
.
LogType
.
PERFORMANCE_ABNORMAL_REASON
,
param
.
getPerformanceAbnormalReason
(),
userNo
,
userName
);
update
.
setPerformanceAbnormalReason
(
param
.
getPerformanceAbnormalReason
());
logs
.
add
(
log
);
change
=
true
;
}
if
(
Objects
.
equals
(
item
.
getDispatchFollow
(),
param
.
getDispatchFollow
())){
PerformanceProgressLog
log
=
performanceProgressLogService
.
generateLog
(
item
.
getOrderNo
(),
PerformanceProgressEnum
.
LogType
.
DISPATCH_FOLLOW
,
param
.
getDispatchFollow
(),
userNo
,
userName
);
update
.
setDispatchFollow
(
param
.
getDispatchFollow
());
logs
.
add
(
log
);
change
=
true
;
}
if
(
change
){
performanceProgressDao
.
updateEntityByKey
(
update
);
performanceProgressLogDao
.
saveBatchList
(
logs
);
}
}
@Override
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论