Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
14f96fbd
提交
14f96fbd
authored
11月 07, 2023
作者:
aiqingguo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
司机上报积分统计
上级
a4efddbb
显示空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
332 行增加
和
48 行删除
+332
-48
CollectTruckWaitEnum.java
...m/clx/performance/enums/collect/CollectTruckWaitEnum.java
+3
-2
IntegralRecordEnum.java
...om/clx/performance/enums/integral/IntegralRecordEnum.java
+60
-0
AppDriverCollectTruckController.java
...mance/controller/app/AppDriverCollectTruckController.java
+11
-11
IntegralRecordDao.java
.../main/java/com/clx/performance/dao/IntegralRecordDao.java
+3
-0
IntegralRecordDaoImpl.java
...a/com/clx/performance/dao/impl/IntegralRecordDaoImpl.java
+10
-1
IntegraRecordMapper.java
.../java/com/clx/performance/mapper/IntegraRecordMapper.java
+9
-1
IntegralRecord.java
...c/main/java/com/clx/performance/model/IntegralRecord.java
+21
-8
IntegralRecordService.java
...va/com/clx/performance/service/IntegralRecordService.java
+3
-0
CollectLineReportService.java
...performance/service/collect/CollectLineReportService.java
+5
-4
CollectTruckService.java
.../clx/performance/service/collect/CollectTruckService.java
+1
-1
IntegralMqHandlerServiceImpl.java
...erformance/service/impl/IntegralMqHandlerServiceImpl.java
+7
-6
IntegralRecordServiceImpl.java
...x/performance/service/impl/IntegralRecordServiceImpl.java
+43
-1
CollectLineReportServiceImpl.java
...ce/service/impl/collect/CollectLineReportServiceImpl.java
+41
-9
CollectTrafficCongestionServiceImpl.java
...ice/impl/collect/CollectTrafficCongestionServiceImpl.java
+16
-1
CollectTruckRefuelServiceImpl.java
...e/service/impl/collect/CollectTruckRefuelServiceImpl.java
+18
-0
CollectTruckServiceImpl.java
...ormance/service/impl/collect/CollectTruckServiceImpl.java
+43
-2
CollectWaitReportServiceImpl.java
...ce/service/impl/collect/CollectWaitReportServiceImpl.java
+38
-1
没有找到文件。
performance-api/src/main/java/com/clx/performance/enums/collect/CollectTruckWaitEnum.java
浏览文件 @
14f96fbd
...
...
@@ -25,8 +25,9 @@ public enum CollectTruckWaitEnum {
@Getter
@AllArgsConstructor
public
enum
waitType
{
LOAD
(
1
,
"装车类型"
),
UNLOAD
(
2
,
"卸车类型"
);
NO
(
1
,
"无需排队"
),
INNER
(
2
,
"场内需要排队"
),
OUTER
(
3
,
"厂外需要排队"
);
private
final
Integer
code
;
private
final
String
msg
;
...
...
performance-api/src/main/java/com/clx/performance/enums/integral/IntegralRecordEnum.java
0 → 100644
浏览文件 @
14f96fbd
package
com
.
clx
.
performance
.
enums
.
integral
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Optional
;
public
enum
IntegralRecordEnum
{
;
@Getter
@AllArgsConstructor
public
enum
Type
{
SYSTEM
(
1
,
"系统"
),
PROTECTION
(
2
,
"保护分"
),
PROTECTION_CANCEL
(
3
,
"保护分取消"
),
SETTLEMENT
(
4
,
"结算分"
),
BASE
(
5
,
"基础分"
),
ORDER_CHILD_COMPLETE
(
11
,
"运单完成"
),
ORDER_CHILD_COMPLETE_NUM
(
12
,
"运单完成数量"
),
ORDER_CHILD_COMPLETE_WATER
(
13
,
"流水单"
),
ORDER_CHILD_COMPLETE_SUPPORT
(
14
,
"支援单"
),
ORDER_CHILD_COMPLETE_TIMEOUT
(
15
,
"运单完成超时"
),
ORDER_CHILD_CANCEL
(
21
,
"运单取消"
),
ORDER_CHILD_CANCEL_TIMEOUT
(
22
,
"运单取消超时"
),
REPORT_TRUCK_INFO
(
50
,
"提交基础信息"
),
REPORT_REFUEL
(
51
,
"油表上报"
),
REPORT_TRAFFIC
(
52
,
"上报交通拥堵"
),
REPORT_SEND_ADDRESS_WAIT
(
53
,
"上报货源地需要排队"
),
REPORT_SEND_ADDRESS_NO_WAIT
(
54
,
"上报货源地无需排队"
),
REPORT_RECEIVE_ADDRESS_WAIT
(
55
,
"上报目的地需要排队"
),
REPORT_RECEIVE_ADDRESS_NO_WAIT
(
56
,
"上报目的地无需排队"
),
REPORT_QUALITY
(
57
,
"上报煤炭质量问题"
),
REPORT_ABNORMAL
(
58
,
"上报拉运异常问题"
),
;
private
Integer
value
;
private
String
msg
;
}
// 取消
public
static
final
List
<
Integer
>
DRIVER_REPORT_lIST
=
Arrays
.
asList
(
Type
.
REPORT_TRUCK_INFO
.
value
,
Type
.
REPORT_REFUEL
.
value
,
Type
.
REPORT_TRAFFIC
.
value
,
Type
.
REPORT_SEND_ADDRESS_WAIT
.
value
,
Type
.
REPORT_SEND_ADDRESS_NO_WAIT
.
value
,
Type
.
REPORT_RECEIVE_ADDRESS_WAIT
.
value
,
Type
.
REPORT_RECEIVE_ADDRESS_NO_WAIT
.
value
,
Type
.
REPORT_QUALITY
.
value
,
Type
.
REPORT_ABNORMAL
.
value
);
}
performance-web/src/main/java/com/clx/performance/controller/app/AppDriverCollectTruckController.java
浏览文件 @
14f96fbd
package
com
.
clx
.
performance
.
controller
.
app
;
import
com.clx.performance.param.app.collect.*
;
import
com.clx.performance.service.collect.CollectTruck
Report
Service
;
import
com.clx.performance.service.collect.CollectTruckService
;
import
com.clx.performance.vo.app.collect.AppCollectTruckVO
;
import
com.msl.common.result.Result
;
import
io.swagger.annotations.Api
;
...
...
@@ -21,12 +21,12 @@ import javax.validation.constraints.NotBlank;
@AllArgsConstructor
public
class
AppDriverCollectTruckController
{
private
final
CollectTruck
ReportService
collectTruckReport
Service
;
private
final
CollectTruck
Service
collectTruck
Service
;
@ApiOperation
(
value
=
"更新卸车方式"
,
notes
=
"<br>By:艾庆国"
)
@PostMapping
(
"/updateUnloadType"
)
public
Result
<
Void
>
updateUnloadType
(
@RequestBody
@Validated
CollectTruckUnloadTypeUpdateParam
param
)
{
collectTruck
Report
Service
.
updateUnloadType
(
param
);
collectTruckService
.
updateUnloadType
(
param
);
return
Result
.
ok
();
}
...
...
@@ -34,7 +34,7 @@ public class AppDriverCollectTruckController {
@ApiOperation
(
value
=
"更新车贷情况"
,
notes
=
"<br>By:艾庆国"
)
@PostMapping
(
"/updateAutoLoanStatus"
)
public
Result
<
Void
>
updateAutoLoanStatus
(
@RequestBody
@Validated
CollectAutoLoanStatusUpdateParam
param
)
{
collectTruck
Report
Service
.
updateAutoLoanStatus
(
param
);
collectTruckService
.
updateAutoLoanStatus
(
param
);
return
Result
.
ok
();
}
...
...
@@ -42,7 +42,7 @@ public class AppDriverCollectTruckController {
@ApiOperation
(
value
=
"更新车辆停放位置"
,
notes
=
"<br>By:艾庆国"
)
@PostMapping
(
"/updateParkAddress"
)
public
Result
<
Void
>
updateParkAddress
(
@RequestBody
@Validated
CollectTruckReportParkAddressUpdateParam
param
)
{
collectTruck
Report
Service
.
updateParkAddress
(
param
);
collectTruckService
.
updateParkAddress
(
param
);
return
Result
.
ok
();
}
...
...
@@ -50,7 +50,7 @@ public class AppDriverCollectTruckController {
@ApiOperation
(
value
=
"更新拉运方式"
,
notes
=
"<br>By:艾庆国"
)
@PostMapping
(
"/updateOverTonnageType"
)
public
Result
<
Void
>
updateOverTonnageType
(
@RequestBody
@Validated
CollectTruckReportOverTonnageTypeUpdateParam
param
)
{
collectTruck
Report
Service
.
updateOverTonnageType
(
param
);
collectTruckService
.
updateOverTonnageType
(
param
);
return
Result
.
ok
();
}
...
...
@@ -58,14 +58,14 @@ public class AppDriverCollectTruckController {
@ApiOperation
(
value
=
"更新接受距常驻地最远距离"
,
notes
=
"<br>By:艾庆国"
)
@PostMapping
(
"/updateUsualPlaceDistanceMax"
)
public
Result
<
Void
>
updateDistanceUsualPlaceMax
(
@RequestBody
@Validated
CollectTruckReportDistanceUsualPlaceMaxUpdateParam
param
)
{
collectTruck
Report
Service
.
updateDistanceUsualPlaceMax
(
param
);
collectTruckService
.
updateDistanceUsualPlaceMax
(
param
);
return
Result
.
ok
();
}
@ApiOperation
(
value
=
"更新单次任务接受最远距离"
,
notes
=
"<br>By:艾庆国"
)
@PostMapping
(
"/updateLineDistanceMax"
)
public
Result
<
Void
>
updateDistanceLineMax
(
@RequestBody
@Validated
CollectTruckReportDistanceLineMaxUpdateParam
param
)
{
collectTruck
Report
Service
.
updateDistanceLineMax
(
param
);
collectTruckService
.
updateDistanceLineMax
(
param
);
return
Result
.
ok
();
}
...
...
@@ -73,7 +73,7 @@ public class AppDriverCollectTruckController {
@ApiOperation
(
value
=
"更新接受距货源地最远距离"
,
notes
=
"<br>By:艾庆国"
)
@PostMapping
(
"/updateSendAddressDistanceMax"
)
public
Result
<
Void
>
updateDistanceSendAddressMax
(
@RequestBody
@Validated
CollectTruckReportDistanceSendAddressMaxUpdateParam
param
)
{
collectTruck
Report
Service
.
updateDistanceSendAddressMax
(
param
);
collectTruckService
.
updateDistanceSendAddressMax
(
param
);
return
Result
.
ok
();
}
...
...
@@ -81,7 +81,7 @@ public class AppDriverCollectTruckController {
@ApiOperation
(
value
=
"更新拉运货物意愿"
,
notes
=
"<br>By:艾庆国"
)
@PostMapping
(
"/updateGoodsType"
)
public
Result
<
Void
>
updateGoodsType
(
@RequestBody
@Validated
CollectTruckReportGoodsTypeUpdateParam
param
)
{
collectTruck
Report
Service
.
updateGoodsType
(
param
);
collectTruckService
.
updateGoodsType
(
param
);
return
Result
.
ok
();
}
...
...
@@ -90,7 +90,7 @@ public class AppDriverCollectTruckController {
@GetMapping
(
"/getReportInfo"
)
public
Result
<
AppCollectTruckVO
>
getReportInfo
(
@Validated
@NotBlank
(
message
=
"车牌不能为空"
)
String
truckNo
)
{
return
Result
.
ok
(
collectTruck
Report
Service
.
getReportInfo
(
truckNo
));
return
Result
.
ok
(
collectTruckService
.
getReportInfo
(
truckNo
));
}
...
...
performance-web/src/main/java/com/clx/performance/dao/IntegralRecordDao.java
浏览文件 @
14f96fbd
...
...
@@ -8,6 +8,8 @@ import com.clx.performance.vo.pc.IntegralRecordVO;
import
com.msl.common.dao.BaseDao
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* @Author: aiqinguo
* @Description: 积分记录
...
...
@@ -21,6 +23,7 @@ public interface IntegralRecordDao extends BaseDao<IntegraRecordMapper, Integral
Integer
sumIntegral
(
@Param
(
"statisticsId"
)
Integer
statisticsId
);
IntegralRecord
selectByStatisticsIdAndType
(
@Param
(
"statisticsId"
)
Integer
statisticsId
,
@Param
(
"type"
)
Integer
type
);
int
sumByStatisticsIdAndTypes
(
@Param
(
"statisticsId"
)
Integer
statisticsId
,
@Param
(
"list"
)
List
<
Integer
>
typeList
);
Integer
sumByStatisticsIdAndTypeAndTime
(
@Param
(
"statisticsId"
)
Integer
statisticsId
,
@Param
(
"type"
)
Integer
type
,
...
...
performance-web/src/main/java/com/clx/performance/dao/impl/IntegralRecordDaoImpl.java
浏览文件 @
14f96fbd
...
...
@@ -11,6 +11,8 @@ import com.msl.common.base.Optional;
import
com.msl.common.dao.impl.BaseDaoImpl
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* @Author: aiqinguo
...
...
@@ -37,7 +39,14 @@ public class IntegralRecordDaoImpl extends BaseDaoImpl<IntegraRecordMapper, Inte
public
IntegralRecord
selectByStatisticsIdAndType
(
Integer
statisticsId
,
Integer
type
)
{
return
getOne
(
lQrWrapper
()
.
eq
(
IntegralRecord:
:
getStatisticsId
,
statisticsId
)
.
eq
(
IntegralRecord:
:
getType
,
type
));
.
eq
(
IntegralRecord:
:
getType
,
type
)
.
orderByDesc
(
IntegralRecord:
:
getCreateTime
)
);
}
@Override
public
int
sumByStatisticsIdAndTypes
(
Integer
statisticsId
,
List
<
Integer
>
typeList
)
{
return
baseMapper
.
sumByStatisticsIdAndTypes
(
statisticsId
,
typeList
);
}
@Override
...
...
performance-web/src/main/java/com/clx/performance/mapper/IntegraRecordMapper.java
浏览文件 @
14f96fbd
...
...
@@ -6,13 +6,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.clx.performance.model.IntegralRecord
;
import
com.clx.performance.param.pc.pageIntegralStatisticsDetailParam
;
import
com.clx.performance.sqlProvider.IntegralRecordSqlProvider
;
import
com.clx.performance.sqlProvider.IntegralTruckSqlProvider
;
import
com.clx.performance.vo.pc.IntegralRecordVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
org.apache.ibatis.annotations.SelectProvider
;
import
java.util.List
;
/**
* @Author: aiqinguo
* @Description: 积分记录
...
...
@@ -34,6 +35,13 @@ public interface IntegraRecordMapper extends BaseMapper<IntegralRecord> {
@Param
(
"type"
)
Integer
type
,
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"endTime"
)
String
endTime
);
@Select
(
"<script>select sum(integral) from integral_record where "
+
" type in <foreach collection='list' item='item' open='(' separator=',' close=')'>#{item}</foreach> "
+
" and statistics_id = #{statisticsId}"
+
"</script>"
)
int
sumByStatisticsIdAndTypes
(
@Param
(
"statisticsId"
)
Integer
statisticsId
,
@Param
(
"list"
)
List
<
Integer
>
typeList
);
@Select
(
"select count(1) from integral_record where statistics_id = #{statisticsId} and type = #{type} and create_time >= #{beginTime} and create_time < #{endTime}"
)
Integer
countByStatisticsIdAndTypeAndTime
(
@Param
(
"statisticsId"
)
Integer
statisticsId
,
@Param
(
"type"
)
Integer
type
,
...
...
performance-web/src/main/java/com/clx/performance/model/IntegralRecord.java
浏览文件 @
14f96fbd
...
...
@@ -5,7 +5,10 @@ import com.baomidou.mybatisplus.annotation.TableId;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.msl.common.config.KeyColumn
;
import
com.msl.common.model.HasKey
;
import
lombok.*
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
import
lombok.Setter
;
import
java.time.LocalDateTime
;
...
...
@@ -43,14 +46,24 @@ public class IntegralRecord implements HasKey<Integer> {
SETTLEMENT
(
4
,
"结算分"
),
BASE
(
5
,
"基础分"
),
ORDER_CHILD_COMPLETE
(
11
,
"运单完成"
),
ORDER_CHILD_COMPLETE_NUM
(
12
,
"运单完成数量"
),
ORDER_CHILD_COMPLETE_WATER
(
13
,
"流水单"
),
ORDER_CHILD_COMPLETE_SUPPORT
(
14
,
"支援单"
),
ORDER_CHILD_COMPLETE_TIMEOUT
(
15
,
"运单完成超时"
),
// ORDER_CHILD_COMPLETE(11, "运单完成"),
// ORDER_CHILD_COMPLETE_NUM(12, "运单完成数量"),
// ORDER_CHILD_COMPLETE_WATER(13, "流水单"),
// ORDER_CHILD_COMPLETE_SUPPORT(14, "支援单"),
// ORDER_CHILD_COMPLETE_TIMEOUT(15, "运单完成超时"),
//
// ORDER_CHILD_CANCEL(21, "运单取消"),
// ORDER_CHILD_CANCEL_TIMEOUT(22, "运单取消超时"),
ORDER_CHILD_CANCEL
(
21
,
"运单取消"
),
ORDER_CHILD_CANCEL_TIMEOUT
(
22
,
"运单取消超时"
),
// REPORT_TRUCK_INFO(50, "提交基础信息"),
// REPORT_REFUEL(51, "油表上报"),
// REPORT_TRAFFIC(52, "上报交通拥堵"),
// REPORT_SEND_ADDRESS_WAIT(53, "上报货源地需要排队"),
// REPORT_SEND_ADDRESS_NO_WAIT(54, "上报货源地无需排队"),
// REPORT_RECEIVE_ADDRESS_WAIT(55, "上报目的地需要排队"),
// REPORT_RECEIVE_ADDRESS_NO_WAIT(56, "上报目的地无需排队"),
// REPORT_QUALITY(57, "上报煤炭质量问题"),
// REPORT_ABNORMAL(58, "上报拉运异常问题"),
;
private
Integer
value
;
...
...
performance-web/src/main/java/com/clx/performance/service/IntegralRecordService.java
浏览文件 @
14f96fbd
...
...
@@ -2,6 +2,7 @@ package com.clx.performance.service;
import
com.clx.performance.model.IntegralRecord
;
import
com.clx.performance.param.pc.IntegralRecordAddParam
;
import
com.clx.performance.vo.pc.integral.AppIntegralRuleVO
;
import
java.time.LocalDateTime
;
...
...
@@ -9,6 +10,8 @@ public interface IntegralRecordService {
void
addRecord
(
IntegralRecordAddParam
param
);
void
addRecord
(
AppIntegralRuleVO
ruleInfo
,
String
truckNo
,
Integer
type
,
Integer
integral
,
String
remark
);
IntegralRecord
save
(
Integer
statisticsId
,
LocalDateTime
statisticsDate
,
String
truckNo
,
Integer
type
,
Integer
integral
,
String
remark
);
}
performance-web/src/main/java/com/clx/performance/service/collect/CollectLineReportService.java
浏览文件 @
14f96fbd
package
com
.
clx
.
performance
.
service
.
collect
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.clx.performance.model.collect.CollectLineReport
;
import
com.clx.performance.param.app.collect.*
;
import
com.clx.performance.param.pc.carrier.*
;
import
com.clx.performance.vo.pc.collect.CollectLineReportVO
;
...
...
@@ -10,11 +11,11 @@ public interface CollectLineReportService {
void
saveSendAddressReport
(
CollectLineReportSendAddressSaveParam
param
);
void
saveAbnormalReport
(
CollectLineReportAbnormalSaveParam
param
);
void
saveSendAddressAbnormalReport
(
CollectLineReportSendAddressAbnormalSaveParam
param
);
void
saveLoadAbnormalReport
(
CollectLineReportLoadAbnormalSaveParam
param
);
void
saveReceiveAddressAbnormalReport
(
CollectLineReportReceiveAddressAbnormalSaveParam
param
);
CollectLineReport
saveSendAddressAbnormalReport
(
CollectLineReportSendAddressAbnormalSaveParam
param
);
CollectLineReport
saveLoadAbnormalReport
(
CollectLineReportLoadAbnormalSaveParam
param
);
CollectLineReport
saveReceiveAddressAbnormalReport
(
CollectLineReportReceiveAddressAbnormalSaveParam
param
);
void
saveNoTakeOrderAbnormalReport
(
CollectLineReportNoTakeOrderAbnormalSaveParam
param
);
void
saveLoadUnloadAbnormalReport
(
CollectLineReportLoadUnloadAbnormalSaveParam
param
);
CollectLineReport
saveLoadUnloadAbnormalReport
(
CollectLineReportLoadUnloadAbnormalSaveParam
param
);
void
saveOtherReport
(
CollectLineReportOtherSaveParam
param
);
...
...
performance-web/src/main/java/com/clx/performance/service/collect/CollectTruck
Report
Service.java
→
performance-web/src/main/java/com/clx/performance/service/collect/CollectTruckService.java
浏览文件 @
14f96fbd
...
...
@@ -3,7 +3,7 @@ package com.clx.performance.service.collect;
import
com.clx.performance.param.app.collect.*
;
import
com.clx.performance.vo.app.collect.AppCollectTruckVO
;
public
interface
CollectTruck
Report
Service
{
public
interface
CollectTruckService
{
void
updateUnloadType
(
CollectTruckUnloadTypeUpdateParam
param
);
void
updateAutoLoanStatus
(
CollectAutoLoanStatusUpdateParam
param
);
...
...
performance-web/src/main/java/com/clx/performance/service/impl/IntegralMqHandlerServiceImpl.java
浏览文件 @
14f96fbd
...
...
@@ -2,6 +2,7 @@ package com.clx.performance.service.impl;
import
com.clx.performance.dao.*
;
import
com.clx.performance.enums.OrderChildEnum
;
import
com.clx.performance.enums.integral.IntegralRecordEnum
;
import
com.clx.performance.model.*
;
import
com.clx.performance.param.mq.*
;
import
com.clx.performance.service.*
;
...
...
@@ -412,7 +413,7 @@ public class IntegralMqHandlerServiceImpl implements IntegralMqHandlerService {
completeNumIntegral
=
0
;
}
if
(
completeNumIntegral
>
0
){
integralRecordService
.
save
(
statistics
.
getId
(),
statistics
.
getStatisticsDate
(),
statistics
.
getTruckNo
(),
IntegralRecord
.
t
ype
.
ORDER_CHILD_COMPLETE_NUM
.
getValue
(),
completeNumIntegral
,
completeNumIntegralRemark
);
integralRecordService
.
save
(
statistics
.
getId
(),
statistics
.
getStatisticsDate
(),
statistics
.
getTruckNo
(),
IntegralRecord
Enum
.
T
ype
.
ORDER_CHILD_COMPLETE_NUM
.
getValue
(),
completeNumIntegral
,
completeNumIntegralRemark
);
}
// 奖励积分(低价)(下期启用)
...
...
@@ -458,7 +459,7 @@ public class IntegralMqHandlerServiceImpl implements IntegralMqHandlerService {
sendAddressTimeoutIntegral
=
-
ruleInfo
.
getOrderChildTimeoutRule
().
getIntegralSendAddressTimeout
();
}
if
(
sendAddressTimeoutIntegral
<
0
){
integralRecordService
.
save
(
statistics
.
getId
(),
statistics
.
getStatisticsDate
(),
statistics
.
getTruckNo
(),
IntegralRecord
.
t
ype
.
ORDER_CHILD_COMPLETE_TIMEOUT
.
getValue
(),
sendAddressTimeoutIntegral
,
"未按时到达货源地减分"
);
integralRecordService
.
save
(
statistics
.
getId
(),
statistics
.
getStatisticsDate
(),
statistics
.
getTruckNo
(),
IntegralRecord
Enum
.
T
ype
.
ORDER_CHILD_COMPLETE_TIMEOUT
.
getValue
(),
sendAddressTimeoutIntegral
,
"未按时到达货源地减分"
);
}
int
receiveAddressTimeoutIntegral
=
0
;
...
...
@@ -466,7 +467,7 @@ public class IntegralMqHandlerServiceImpl implements IntegralMqHandlerService {
receiveAddressTimeoutIntegral
=
-
ruleInfo
.
getOrderChildTimeoutRule
().
getIntegralSendAddressTimeout
();
}
if
(
receiveAddressTimeoutIntegral
<
0
){
integralRecordService
.
save
(
statistics
.
getId
(),
statistics
.
getStatisticsDate
(),
statistics
.
getTruckNo
(),
IntegralRecord
.
t
ype
.
ORDER_CHILD_COMPLETE_TIMEOUT
.
getValue
(),
receiveAddressTimeoutIntegral
,
"未按时到达目的地减分"
);
integralRecordService
.
save
(
statistics
.
getId
(),
statistics
.
getStatisticsDate
(),
statistics
.
getTruckNo
(),
IntegralRecord
Enum
.
T
ype
.
ORDER_CHILD_COMPLETE_TIMEOUT
.
getValue
(),
receiveAddressTimeoutIntegral
,
"未按时到达目的地减分"
);
}
integralSum
=
completeIntegral
+
completeNumIntegral
+
waterOrderIntegral
+
supportOrderIntegral
+
sendAddressTimeoutIntegral
+
receiveAddressTimeoutIntegral
;
...
...
@@ -504,7 +505,7 @@ public class IntegralMqHandlerServiceImpl implements IntegralMqHandlerService {
// }
if
(
cancelIntegral
<
0
){
integralRecordService
.
save
(
statistics
.
getId
(),
statistics
.
getStatisticsDate
(),
statistics
.
getTruckNo
(),
IntegralRecord
.
t
ype
.
ORDER_CHILD_CANCEL
.
getValue
(),
cancelIntegral
,
cancelIntegralRemark
);
integralRecordService
.
save
(
statistics
.
getId
(),
statistics
.
getStatisticsDate
(),
statistics
.
getTruckNo
(),
IntegralRecord
Enum
.
T
ype
.
ORDER_CHILD_CANCEL
.
getValue
(),
cancelIntegral
,
cancelIntegralRemark
);
}
...
...
@@ -525,7 +526,7 @@ public class IntegralMqHandlerServiceImpl implements IntegralMqHandlerService {
sendAddressTimeoutIntegral
=
-
ruleInfo
.
getOrderChildTimeoutRule
().
getIntegralSendAddressTimeout
();
}
if
(
sendAddressTimeoutIntegral
<
0
){
integralRecordService
.
save
(
statistics
.
getId
(),
statistics
.
getStatisticsDate
(),
statistics
.
getTruckNo
(),
IntegralRecord
.
t
ype
.
ORDER_CHILD_CANCEL_TIMEOUT
.
getValue
(),
sendAddressTimeoutIntegral
,
"未按时到达货源地减分"
);
integralRecordService
.
save
(
statistics
.
getId
(),
statistics
.
getStatisticsDate
(),
statistics
.
getTruckNo
(),
IntegralRecord
Enum
.
T
ype
.
ORDER_CHILD_CANCEL_TIMEOUT
.
getValue
(),
sendAddressTimeoutIntegral
,
"未按时到达货源地减分"
);
}
int
receiveAddressTimeoutIntegral
=
0
;
...
...
@@ -537,7 +538,7 @@ public class IntegralMqHandlerServiceImpl implements IntegralMqHandlerService {
}
if
(
receiveAddressTimeoutIntegral
<
0
){
integralRecordService
.
save
(
statistics
.
getId
(),
statistics
.
getStatisticsDate
(),
statistics
.
getTruckNo
(),
IntegralRecord
.
t
ype
.
ORDER_CHILD_CANCEL_TIMEOUT
.
getValue
(),
receiveAddressTimeoutIntegral
,
"未按时到达目的地减分"
);
integralRecordService
.
save
(
statistics
.
getId
(),
statistics
.
getStatisticsDate
(),
statistics
.
getTruckNo
(),
IntegralRecord
Enum
.
T
ype
.
ORDER_CHILD_CANCEL_TIMEOUT
.
getValue
(),
receiveAddressTimeoutIntegral
,
"未按时到达目的地减分"
);
}
integralSum
=
cancelIntegral
+
sendAddressTimeoutIntegral
+
receiveAddressTimeoutIntegral
;
...
...
performance-web/src/main/java/com/clx/performance/service/impl/IntegralRecordServiceImpl.java
浏览文件 @
14f96fbd
...
...
@@ -4,6 +4,7 @@ import com.clx.performance.dao.IntegralRecordDao;
import
com.clx.performance.dao.IntegralStatisticsDao
;
import
com.clx.performance.dao.IntegralTruckDao
;
import
com.clx.performance.enums.PerformanceResultEnum
;
import
com.clx.performance.enums.integral.IntegralRecordEnum
;
import
com.clx.performance.model.IntegralRecord
;
import
com.clx.performance.model.IntegralStatistics
;
import
com.clx.performance.model.IntegralTruck
;
...
...
@@ -11,10 +12,12 @@ import com.clx.performance.param.pc.IntegralRecordAddParam;
import
com.clx.performance.service.IntegralMqService
;
import
com.clx.performance.service.IntegralRecordService
;
import
com.clx.performance.utils.LocalDateTimeUtils
;
import
com.clx.performance.vo.pc.integral.AppIntegralRuleVO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
@Slf4j
...
...
@@ -50,7 +53,46 @@ public class IntegralRecordServiceImpl implements IntegralRecordService {
integralTruckDao
.
updateIntegral
(
truck
);
// 新增积分记录
IntegralRecord
record
=
save
(
statistics
.
getId
(),
statistics
.
getStatisticsDate
(),
statistics
.
getTruckNo
(),
IntegralRecord
.
type
.
SYSTEM
.
getValue
(),
param
.
getIntegral
(),
param
.
getRemark
());
IntegralRecord
record
=
save
(
statistics
.
getId
(),
statistics
.
getStatisticsDate
(),
statistics
.
getTruckNo
(),
IntegralRecordEnum
.
Type
.
SYSTEM
.
getValue
(),
param
.
getIntegral
(),
param
.
getRemark
());
// 发送mq (新增积分记录)
integralMqService
.
integralRecordAdd
(
record
.
getStatisticsId
(),
record
.
getTruckNo
(),
record
.
getType
(),
record
.
getIntegral
(),
record
.
getRemark
());
}
@Override
public
void
addRecord
(
AppIntegralRuleVO
ruleInfo
,
String
truckNo
,
Integer
type
,
Integer
integral
,
String
remark
)
{
String
statisticsDate
=
LocalDateTimeUtils
.
getWeekStart
();
IntegralTruck
truck
=
integralTruckDao
.
getByTruckNo
(
truckNo
).
orNull
();
if
(
truck
==
null
)
{
return
;}
// 查找最新统计
IntegralStatistics
statistics
=
integralStatisticsDao
.
selectByTruckNoAndStatisticsDate
(
truckNo
,
statisticsDate
).
orNull
();
if
(
statistics
==
null
)
{
return
;}
IntegralRecord
integralRecord
=
integralRecordDao
.
selectByStatisticsIdAndType
(
statistics
.
getId
(),
type
);
if
(
integralRecord
!=
null
&&
integralRecord
.
getCreateTime
().
plusSeconds
(
ruleInfo
.
getDriverReportRule
().
getReportLimit
().
multiply
(
new
BigDecimal
(
3600
)).
intValue
()).
isAfter
(
LocalDateTime
.
now
())){
log
.
info
(
"上报频繁,本次无效, truckNo:{}, type:{}, integral:{}, remark:{}"
,
truckNo
,
type
,
integral
,
remark
);
return
;
}
int
sum
=
integralRecordDao
.
sumByStatisticsIdAndTypes
(
statistics
.
getId
(),
IntegralRecordEnum
.
DRIVER_REPORT_lIST
);
if
(
sum
>
ruleInfo
.
getDriverReportRule
().
getIntegralLimit
()){
log
.
info
(
"上报积分超上限,本次无效, truckNo:{}, type:{}, integral:{}, remark:{}"
,
truckNo
,
type
,
integral
,
remark
);
return
;
}
// 更新积分
statistics
.
setIntegral
(
statistics
.
getIntegral
()+
integral
);
integralStatisticsDao
.
updateIntegral
(
statistics
);
truck
.
setIntegral
(
statistics
.
getIntegral
());
integralTruckDao
.
updateIntegral
(
truck
);
// 新增积分记录
IntegralRecord
record
=
save
(
statistics
.
getId
(),
statistics
.
getStatisticsDate
(),
statistics
.
getTruckNo
(),
type
,
integral
,
remark
);
// 发送mq (新增积分记录)
integralMqService
.
integralRecordAdd
(
record
.
getStatisticsId
(),
record
.
getTruckNo
(),
record
.
getType
(),
record
.
getIntegral
(),
record
.
getRemark
());
...
...
performance-web/src/main/java/com/clx/performance/service/impl/collect/CollectLineReportServiceImpl.java
浏览文件 @
14f96fbd
...
...
@@ -5,13 +5,17 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.clx.performance.dao.OrderChildDao
;
import
com.clx.performance.dao.collect.CollectLineReportDao
;
import
com.clx.performance.enums.PerformanceResultEnum
;
import
com.clx.performance.enums.integral.IntegralRecordEnum
;
import
com.clx.performance.model.OrderChild
;
import
com.clx.performance.model.collect.CollectLineReport
;
import
com.clx.performance.param.app.collect.*
;
import
com.clx.performance.param.pc.carrier.*
;
import
com.clx.performance.service.IntegralRecordService
;
import
com.clx.performance.service.collect.CollectLineReportService
;
import
com.clx.performance.service.integral.IntegralRuleService
;
import
com.clx.performance.struct.collect.CollectLineReportStruct
;
import
com.clx.performance.vo.pc.collect.CollectLineReportVO
;
import
com.clx.performance.vo.pc.integral.AppIntegralRuleVO
;
import
com.msl.user.data.UserSessionData
;
import
com.msl.user.utils.TokenUtil
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -32,7 +36,10 @@ public class CollectLineReportServiceImpl implements CollectLineReportService {
@Autowired
private
CollectLineReportStruct
collectLineReportStruct
;
@Autowired
private
IntegralRuleService
integralRuleService
;
@Autowired
private
IntegralRecordService
integralRecordService
;
@Override
public
void
saveSendAddressReport
(
CollectLineReportSendAddressSaveParam
param
)
{
...
...
@@ -65,22 +72,31 @@ public class CollectLineReportServiceImpl implements CollectLineReportService {
@Override
public
void
saveAbnormalReport
(
CollectLineReportAbnormalSaveParam
param
)
{
CollectLineReport
collectLineReport
=
null
;
if
(
Objects
.
equals
(
param
.
getReportType
(),
CollectLineReport
.
ReportType
.
UNABLE_TO_SEND_ADDRESS
.
getCode
())){
saveSendAddressAbnormalReport
(
new
CollectLineReportSendAddressAbnormalSaveParam
(
param
.
getChildNo
(),
param
.
getRemark
()));
collectLineReport
=
saveSendAddressAbnormalReport
(
new
CollectLineReportSendAddressAbnormalSaveParam
(
param
.
getChildNo
(),
param
.
getRemark
()));
}
else
if
(
Objects
.
equals
(
param
.
getReportType
(),
CollectLineReport
.
ReportType
.
UNABLE_LOAD
.
getCode
())){
saveLoadAbnormalReport
(
new
CollectLineReportLoadAbnormalSaveParam
(
param
.
getChildNo
(),
param
.
getRemark
()));
collectLineReport
=
saveLoadAbnormalReport
(
new
CollectLineReportLoadAbnormalSaveParam
(
param
.
getChildNo
(),
param
.
getRemark
()));
}
else
if
(
Objects
.
equals
(
param
.
getReportType
(),
CollectLineReport
.
ReportType
.
UNABLE_TO_RECEIVE_ADDRESS
.
getCode
())){
saveReceiveAddressAbnormalReport
(
new
CollectLineReportReceiveAddressAbnormalSaveParam
(
param
.
getChildNo
(),
param
.
getRemark
()));
collectLineReport
=
saveReceiveAddressAbnormalReport
(
new
CollectLineReportReceiveAddressAbnormalSaveParam
(
param
.
getChildNo
(),
param
.
getRemark
()));
}
else
if
(
Objects
.
equals
(
param
.
getReportType
(),
CollectLineReport
.
ReportType
.
LOAD_UNLOAD
.
getCode
())){
saveLoadUnloadAbnormalReport
(
new
CollectLineReportLoadUnloadAbnormalSaveParam
(
param
.
getChildNo
(),
param
.
getRemark
()));
collectLineReport
=
saveLoadUnloadAbnormalReport
(
new
CollectLineReportLoadUnloadAbnormalSaveParam
(
param
.
getChildNo
(),
param
.
getRemark
()));
}
// 查找规则
AppIntegralRuleVO
ruleInfo
=
integralRuleService
.
getRuleInfo
();
// 报存积分
integralRecordService
.
addRecord
(
ruleInfo
,
collectLineReport
.
getTruckNo
(),
IntegralRecordEnum
.
Type
.
REPORT_ABNORMAL
.
getValue
(),
ruleInfo
.
getDriverReportRule
().
getIntegralQuality
(),
IntegralRecordEnum
.
Type
.
REPORT_ABNORMAL
.
getMsg
());
}
@Override
public
void
saveSendAddressAbnormalReport
(
CollectLineReportSendAddressAbnormalSaveParam
param
)
{
public
CollectLineReport
saveSendAddressAbnormalReport
(
CollectLineReportSendAddressAbnormalSaveParam
param
)
{
UserSessionData
loginUserInfo
=
TokenUtil
.
getLoginUserInfo
();
Long
userNo
=
loginUserInfo
.
getUserNo
();
...
...
@@ -106,10 +122,12 @@ public class CollectLineReportServiceImpl implements CollectLineReportService {
collectLineReport
.
setReportTime
(
LocalDateTime
.
now
());
collectLineReport
.
setCreateTime
(
collectLineReport
.
getReportTime
());
collectLineReportDao
.
saveEntity
(
collectLineReport
);
return
collectLineReport
;
}
@Override
public
void
saveLoadAbnormalReport
(
CollectLineReportLoadAbnormalSaveParam
param
)
{
public
CollectLineReport
saveLoadAbnormalReport
(
CollectLineReportLoadAbnormalSaveParam
param
)
{
UserSessionData
loginUserInfo
=
TokenUtil
.
getLoginUserInfo
();
Long
userNo
=
loginUserInfo
.
getUserNo
();
...
...
@@ -135,10 +153,12 @@ public class CollectLineReportServiceImpl implements CollectLineReportService {
collectLineReport
.
setReportTime
(
LocalDateTime
.
now
());
collectLineReport
.
setCreateTime
(
collectLineReport
.
getReportTime
());
collectLineReportDao
.
saveEntity
(
collectLineReport
);
return
collectLineReport
;
}
@Override
public
void
saveReceiveAddressAbnormalReport
(
CollectLineReportReceiveAddressAbnormalSaveParam
param
)
{
public
CollectLineReport
saveReceiveAddressAbnormalReport
(
CollectLineReportReceiveAddressAbnormalSaveParam
param
)
{
UserSessionData
loginUserInfo
=
TokenUtil
.
getLoginUserInfo
();
Long
userNo
=
loginUserInfo
.
getUserNo
();
...
...
@@ -164,10 +184,12 @@ public class CollectLineReportServiceImpl implements CollectLineReportService {
collectLineReport
.
setReportTime
(
LocalDateTime
.
now
());
collectLineReport
.
setCreateTime
(
collectLineReport
.
getReportTime
());
collectLineReportDao
.
saveEntity
(
collectLineReport
);
return
collectLineReport
;
}
@Override
public
void
saveLoadUnloadAbnormalReport
(
CollectLineReportLoadUnloadAbnormalSaveParam
param
)
{
public
CollectLineReport
saveLoadUnloadAbnormalReport
(
CollectLineReportLoadUnloadAbnormalSaveParam
param
)
{
UserSessionData
loginUserInfo
=
TokenUtil
.
getLoginUserInfo
();
Long
userNo
=
loginUserInfo
.
getUserNo
();
...
...
@@ -192,6 +214,8 @@ public class CollectLineReportServiceImpl implements CollectLineReportService {
collectLineReport
.
setReportTime
(
LocalDateTime
.
now
());
collectLineReport
.
setCreateTime
(
collectLineReport
.
getReportTime
());
collectLineReportDao
.
saveEntity
(
collectLineReport
);
return
collectLineReport
;
}
...
...
@@ -273,6 +297,14 @@ public class CollectLineReportServiceImpl implements CollectLineReportService {
collectLineReport
.
setReportTime
(
LocalDateTime
.
now
());
collectLineReport
.
setCreateTime
(
collectLineReport
.
getReportTime
());
collectLineReportDao
.
saveEntity
(
collectLineReport
);
// 查找规则
AppIntegralRuleVO
ruleInfo
=
integralRuleService
.
getRuleInfo
();
// 报存积分
integralRecordService
.
addRecord
(
ruleInfo
,
collectLineReport
.
getTruckNo
(),
IntegralRecordEnum
.
Type
.
REPORT_QUALITY
.
getValue
(),
ruleInfo
.
getDriverReportRule
().
getIntegralQuality
(),
IntegralRecordEnum
.
Type
.
REPORT_QUALITY
.
getMsg
());
}
@Override
...
...
performance-web/src/main/java/com/clx/performance/service/impl/collect/CollectTrafficCongestionServiceImpl.java
浏览文件 @
14f96fbd
...
...
@@ -4,14 +4,18 @@ import com.alibaba.fastjson.JSON;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.clx.performance.dao.collect.CollectTrafficCongestionDao
;
import
com.clx.performance.enums.PerformanceResultEnum
;
import
com.clx.performance.enums.integral.IntegralRecordEnum
;
import
com.clx.performance.model.collect.CollectTrafficCongestion
;
import
com.clx.performance.param.app.collect.CollectTrafficCongestionAuditParam
;
import
com.clx.performance.param.app.collect.CollectTrafficCongestionSaveParam
;
import
com.clx.performance.param.app.collect.PageCollectTraficCongestionParam
;
import
com.clx.performance.param.pc.carrier.CarrierPageCollectTraficCongestionParam
;
import
com.clx.performance.service.IntegralRecordService
;
import
com.clx.performance.service.collect.CollectTrafficCongestionService
;
import
com.clx.performance.service.integral.IntegralRuleService
;
import
com.clx.performance.struct.collect.CollectTrafficCongestionStruct
;
import
com.clx.performance.vo.pc.collect.CollectTrafficCongestionVO
;
import
com.clx.performance.vo.pc.integral.AppIntegralRuleVO
;
import
com.msl.user.data.UserSessionData
;
import
com.msl.user.utils.TokenUtil
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -30,7 +34,10 @@ public class CollectTrafficCongestionServiceImpl implements CollectTrafficConges
@Autowired
private
CollectTrafficCongestionStruct
collectTrafficCongestionStruct
;
@Autowired
private
IntegralRecordService
integralRecordService
;
@Autowired
private
IntegralRuleService
integralRuleService
;
@Override
public
void
saveTrafficReport
(
CollectTrafficCongestionSaveParam
param
)
{
...
...
@@ -67,6 +74,14 @@ public class CollectTrafficCongestionServiceImpl implements CollectTrafficConges
collectTrafficCongestion
.
setReportTime
(
LocalDateTime
.
now
());
collectTrafficCongestion
.
setCreateTime
(
collectTrafficCongestion
.
getReportTime
());
collectTrafficCongestionDao
.
saveEntity
(
collectTrafficCongestion
);
// 查找规则
AppIntegralRuleVO
ruleInfo
=
integralRuleService
.
getRuleInfo
();
// 报存积分
integralRecordService
.
addRecord
(
ruleInfo
,
collectTrafficCongestion
.
getTruckNo
(),
IntegralRecordEnum
.
Type
.
REPORT_TRAFFIC
.
getValue
(),
ruleInfo
.
getDriverReportRule
().
getIntegralTraffic
(),
IntegralRecordEnum
.
Type
.
REPORT_TRAFFIC
.
getMsg
());
}
@Override
...
...
performance-web/src/main/java/com/clx/performance/service/impl/collect/CollectTruckRefuelServiceImpl.java
浏览文件 @
14f96fbd
...
...
@@ -5,19 +5,24 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.clx.performance.dao.OrderChildDao
;
import
com.clx.performance.dao.collect.CollectTruckRefuelDao
;
import
com.clx.performance.enums.PerformanceResultEnum
;
import
com.clx.performance.enums.integral.IntegralRecordEnum
;
import
com.clx.performance.model.OrderChild
;
import
com.clx.performance.model.collect.CollectTruckRefuel
;
import
com.clx.performance.param.app.collect.CollectTruckRefuelSaveParam
;
import
com.clx.performance.param.app.collect.PageCollectTruckRefuelParam
;
import
com.clx.performance.param.pc.carrier.CarrierPageCollectTruckRefuelParam
;
import
com.clx.performance.service.IntegralRecordService
;
import
com.clx.performance.service.collect.CollectTruckRefuelService
;
import
com.clx.performance.service.integral.IntegralRuleService
;
import
com.clx.performance.struct.collect.CollectTruckRefuelStruct
;
import
com.clx.performance.vo.pc.collect.CollectTruckRefuelVO
;
import
com.clx.performance.vo.pc.integral.AppIntegralRuleVO
;
import
com.msl.user.data.UserSessionData
;
import
com.msl.user.utils.TokenUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.time.LocalDateTime
;
...
...
@@ -34,7 +39,12 @@ public class CollectTruckRefuelServiceImpl implements CollectTruckRefuelService
@Autowired
private
CollectTruckRefuelStruct
collectTruckRefuelStruct
;
@Autowired
private
IntegralRuleService
integralRuleService
;
@Autowired
private
IntegralRecordService
integralRecordService
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
saveRefuelReport
(
CollectTruckRefuelSaveParam
param
)
{
UserSessionData
loginUserInfo
=
TokenUtil
.
getLoginUserInfo
();
...
...
@@ -62,6 +72,14 @@ public class CollectTruckRefuelServiceImpl implements CollectTruckRefuelService
collectTruckRefuel
.
setCreateTime
(
collectTruckRefuel
.
getReportTime
());
collectTruckRefuelDao
.
saveEntity
(
collectTruckRefuel
);
// 查找规则
AppIntegralRuleVO
ruleInfo
=
integralRuleService
.
getRuleInfo
();
// 报存积分
integralRecordService
.
addRecord
(
ruleInfo
,
collectTruckRefuel
.
getTruckNo
(),
IntegralRecordEnum
.
Type
.
REPORT_REFUEL
.
getValue
(),
ruleInfo
.
getDriverReportRule
().
getIntegralRefuel
(),
IntegralRecordEnum
.
Type
.
REPORT_REFUEL
.
getMsg
());
}
@Override
...
...
performance-web/src/main/java/com/clx/performance/service/impl/collect/CollectTruck
Report
ServiceImpl.java
→
performance-web/src/main/java/com/clx/performance/service/impl/collect/CollectTruckServiceImpl.java
浏览文件 @
14f96fbd
package
com
.
clx
.
performance
.
service
.
impl
.
collect
;
import
com.clx.performance.dao.collect.CollectTruckDao
;
import
com.clx.performance.enums.integral.IntegralRecordEnum
;
import
com.clx.performance.model.collect.CollectTruck
;
import
com.clx.performance.param.app.collect.*
;
import
com.clx.performance.service.collect.CollectTruckReportService
;
import
com.clx.performance.service.IntegralRecordService
;
import
com.clx.performance.service.collect.CollectTruckService
;
import
com.clx.performance.service.integral.IntegralRuleService
;
import
com.clx.performance.struct.collect.CollectTruckStruct
;
import
com.clx.performance.vo.app.collect.AppCollectTruckVO
;
import
com.clx.performance.vo.pc.integral.AppIntegralRuleVO
;
import
com.msl.user.data.UserSessionData
;
import
com.msl.user.utils.TokenUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
@Slf4j
@Service
public
class
CollectTruck
ReportServiceImpl
implements
CollectTruckReport
Service
{
public
class
CollectTruck
ServiceImpl
implements
CollectTruck
Service
{
@Autowired
private
CollectTruckDao
collectTruckDao
;
@Autowired
private
CollectTruckStruct
collectTruckStruct
;
@Autowired
private
IntegralRecordService
integralRecordService
;
@Autowired
private
IntegralRuleService
integralRuleService
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
updateUnloadType
(
CollectTruckUnloadTypeUpdateParam
param
)
{
UserSessionData
loginUserInfo
=
TokenUtil
.
getLoginUserInfo
();
...
...
@@ -37,8 +47,16 @@ public class CollectTruckReportServiceImpl implements CollectTruckReportService
truck
.
setUnloadType
(
param
.
getUnloadType
());
collectTruckDao
.
update
(
truck
);
// 查找规则
AppIntegralRuleVO
ruleInfo
=
integralRuleService
.
getRuleInfo
();
// 报存积分
integralRecordService
.
addRecord
(
ruleInfo
,
truck
.
getTruckNo
(),
IntegralRecordEnum
.
Type
.
REPORT_TRUCK_INFO
.
getValue
(),
ruleInfo
.
getDriverReportRule
().
getIntegralTruck
(),
IntegralRecordEnum
.
Type
.
REPORT_TRUCK_INFO
.
getMsg
());
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
updateAutoLoanStatus
(
CollectAutoLoanStatusUpdateParam
param
)
{
UserSessionData
loginUserInfo
=
TokenUtil
.
getLoginUserInfo
();
...
...
@@ -55,8 +73,17 @@ public class CollectTruckReportServiceImpl implements CollectTruckReportService
truck
.
setAutoLoanStatus
(
param
.
getAutoLoanStatus
());
truck
.
setAutoLoanMonth
(
param
.
getAutoLoanMonth
());
collectTruckDao
.
update
(
truck
);
// 查找规则
AppIntegralRuleVO
ruleInfo
=
integralRuleService
.
getRuleInfo
();
// 报存积分
integralRecordService
.
addRecord
(
ruleInfo
,
truck
.
getTruckNo
(),
IntegralRecordEnum
.
Type
.
REPORT_TRUCK_INFO
.
getValue
(),
ruleInfo
.
getDriverReportRule
().
getIntegralTruck
(),
IntegralRecordEnum
.
Type
.
REPORT_TRUCK_INFO
.
getMsg
());
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
updateParkAddress
(
CollectTruckReportParkAddressUpdateParam
param
)
{
UserSessionData
loginUserInfo
=
TokenUtil
.
getLoginUserInfo
();
...
...
@@ -72,8 +99,17 @@ public class CollectTruckReportServiceImpl implements CollectTruckReportService
truck
.
setParkAddress
(
param
.
getParkAddress
());
collectTruckDao
.
update
(
truck
);
// 查找规则
AppIntegralRuleVO
ruleInfo
=
integralRuleService
.
getRuleInfo
();
// 报存积分
integralRecordService
.
addRecord
(
ruleInfo
,
truck
.
getTruckNo
(),
IntegralRecordEnum
.
Type
.
REPORT_TRUCK_INFO
.
getValue
(),
ruleInfo
.
getDriverReportRule
().
getIntegralTruck
(),
IntegralRecordEnum
.
Type
.
REPORT_TRUCK_INFO
.
getMsg
());
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
updateOverTonnageType
(
CollectTruckReportOverTonnageTypeUpdateParam
param
)
{
UserSessionData
loginUserInfo
=
TokenUtil
.
getLoginUserInfo
();
...
...
@@ -91,6 +127,7 @@ public class CollectTruckReportServiceImpl implements CollectTruckReportService
collectTruckDao
.
update
(
truck
);
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
updateDistanceUsualPlaceMax
(
CollectTruckReportDistanceUsualPlaceMaxUpdateParam
param
)
{
UserSessionData
loginUserInfo
=
TokenUtil
.
getLoginUserInfo
();
...
...
@@ -108,6 +145,7 @@ public class CollectTruckReportServiceImpl implements CollectTruckReportService
collectTruckDao
.
update
(
truck
);
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
updateDistanceLineMax
(
CollectTruckReportDistanceLineMaxUpdateParam
param
)
{
UserSessionData
loginUserInfo
=
TokenUtil
.
getLoginUserInfo
();
...
...
@@ -125,6 +163,7 @@ public class CollectTruckReportServiceImpl implements CollectTruckReportService
collectTruckDao
.
update
(
truck
);
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
updateDistanceSendAddressMax
(
CollectTruckReportDistanceSendAddressMaxUpdateParam
param
)
{
UserSessionData
loginUserInfo
=
TokenUtil
.
getLoginUserInfo
();
...
...
@@ -142,6 +181,7 @@ public class CollectTruckReportServiceImpl implements CollectTruckReportService
collectTruckDao
.
update
(
truck
);
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
updateGoodsType
(
CollectTruckReportGoodsTypeUpdateParam
param
)
{
UserSessionData
loginUserInfo
=
TokenUtil
.
getLoginUserInfo
();
...
...
@@ -159,6 +199,7 @@ public class CollectTruckReportServiceImpl implements CollectTruckReportService
collectTruckDao
.
update
(
truck
);
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
AppCollectTruckVO
getReportInfo
(
String
truckNo
)
{
UserSessionData
loginUserInfo
=
TokenUtil
.
getLoginUserInfo
();
...
...
performance-web/src/main/java/com/clx/performance/service/impl/collect/CollectWaitReportServiceImpl.java
浏览文件 @
14f96fbd
...
...
@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.clx.performance.dao.OrderChildDao
;
import
com.clx.performance.dao.collect.CollectTruckWaitDao
;
import
com.clx.performance.enums.PerformanceResultEnum
;
import
com.clx.performance.enums.collect.CollectTruckWaitEnum
;
import
com.clx.performance.enums.integral.IntegralRecordEnum
;
import
com.clx.performance.model.OrderChild
;
import
com.clx.performance.model.collect.CollectTruckWait
;
import
com.clx.performance.param.app.collect.CollectLineReportTruckWaitAuditParam
;
...
...
@@ -12,9 +14,12 @@ import com.clx.performance.param.app.collect.CollectWaitReportReceiveAddressSave
import
com.clx.performance.param.app.collect.CollectWaitReportSendAddressSaveParam
;
import
com.clx.performance.param.app.collect.PageCollectTruckWaitParam
;
import
com.clx.performance.param.pc.carrier.CarrierPageCollectTruckWaitParam
;
import
com.clx.performance.service.IntegralRecordService
;
import
com.clx.performance.service.collect.CollectWaitReportService
;
import
com.clx.performance.service.integral.IntegralRuleService
;
import
com.clx.performance.struct.collect.CollectTruckWaitStruct
;
import
com.clx.performance.vo.pc.collect.CollectTruckWaitVO
;
import
com.clx.performance.vo.pc.integral.AppIntegralRuleVO
;
import
com.msl.user.data.UserSessionData
;
import
com.msl.user.utils.TokenUtil
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -22,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.util.Objects
;
@Slf4j
@Service
...
...
@@ -34,7 +40,10 @@ public class CollectWaitReportServiceImpl implements CollectWaitReportService {
@Autowired
private
CollectTruckWaitStruct
collectTruckWaitStruct
;
@Autowired
private
IntegralRuleService
integralRuleService
;
@Autowired
private
IntegralRecordService
integralRecordService
;
@Override
public
void
saveSendAddressReport
(
CollectWaitReportSendAddressSaveParam
param
)
{
...
...
@@ -62,6 +71,20 @@ public class CollectWaitReportServiceImpl implements CollectWaitReportService {
collectTruckWait
.
setReportTime
(
LocalDateTime
.
now
());
collectTruckWait
.
setCreateTime
(
collectTruckWait
.
getReportTime
());
collectTruckWaitDao
.
saveEntity
(
collectTruckWait
);
// 查找规则
AppIntegralRuleVO
ruleInfo
=
integralRuleService
.
getRuleInfo
();
// 报存积分
if
(
Objects
.
equals
(
collectTruckWait
.
getWaitType
(),
CollectTruckWaitEnum
.
waitType
.
INNER
.
getCode
())
||
Objects
.
equals
(
collectTruckWait
.
getWaitType
(),
CollectTruckWaitEnum
.
waitType
.
OUTER
.
getCode
())
)
{
integralRecordService
.
addRecord
(
ruleInfo
,
collectTruckWait
.
getTruckNo
(),
IntegralRecordEnum
.
Type
.
REPORT_SEND_ADDRESS_WAIT
.
getValue
(),
ruleInfo
.
getDriverReportRule
().
getIntegralSendAddressWait
(),
IntegralRecordEnum
.
Type
.
REPORT_SEND_ADDRESS_WAIT
.
getMsg
());
}
else
{
integralRecordService
.
addRecord
(
ruleInfo
,
collectTruckWait
.
getTruckNo
(),
IntegralRecordEnum
.
Type
.
REPORT_SEND_ADDRESS_NO_WAIT
.
getValue
(),
ruleInfo
.
getDriverReportRule
().
getIntegralSendAddressNoWait
(),
IntegralRecordEnum
.
Type
.
REPORT_SEND_ADDRESS_NO_WAIT
.
getMsg
());
}
}
@Override
...
...
@@ -90,6 +113,20 @@ public class CollectWaitReportServiceImpl implements CollectWaitReportService {
collectTruckWait
.
setReportTime
(
LocalDateTime
.
now
());
collectTruckWait
.
setCreateTime
(
collectTruckWait
.
getReportTime
());
collectTruckWaitDao
.
saveEntity
(
collectTruckWait
);
// 查找规则
AppIntegralRuleVO
ruleInfo
=
integralRuleService
.
getRuleInfo
();
// 报存积分
if
(
Objects
.
equals
(
collectTruckWait
.
getWaitType
(),
CollectTruckWaitEnum
.
waitType
.
INNER
.
getCode
())
||
Objects
.
equals
(
collectTruckWait
.
getWaitType
(),
CollectTruckWaitEnum
.
waitType
.
OUTER
.
getCode
())
)
{
integralRecordService
.
addRecord
(
ruleInfo
,
collectTruckWait
.
getTruckNo
(),
IntegralRecordEnum
.
Type
.
REPORT_RECEIVE_ADDRESS_WAIT
.
getValue
(),
ruleInfo
.
getDriverReportRule
().
getIntegralReceiveAddressWait
(),
IntegralRecordEnum
.
Type
.
REPORT_RECEIVE_ADDRESS_WAIT
.
getMsg
());
}
else
{
integralRecordService
.
addRecord
(
ruleInfo
,
collectTruckWait
.
getTruckNo
(),
IntegralRecordEnum
.
Type
.
REPORT_RECEIVE_ADDRESS_NO_WAIT
.
getValue
(),
ruleInfo
.
getDriverReportRule
().
getIntegralReceiveAddressNoWait
(),
IntegralRecordEnum
.
Type
.
REPORT_RECEIVE_ADDRESS_NO_WAIT
.
getMsg
());
}
}
@Override
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论