Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
cdc9d7c2
提交
cdc9d7c2
authored
6月 19, 2024
作者:
艾庆国
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'refs/heads/v16.3_line_warn_20240528' into test
Former-commit-id:
7407643b
上级
e57d433d
fdd7116f
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
29 行增加
和
5 行删除
+29
-5
RedisConstants.java
...ain/java/com/clx/performance/constant/RedisConstants.java
+6
-0
LineWarnWeatherWarnServiceImpl.java
...service/impl/linewarn/LineWarnWeatherWarnServiceImpl.java
+23
-5
没有找到文件。
performance-web/src/main/java/com/clx/performance/constant/RedisConstants.java
浏览文件 @
cdc9d7c2
...
@@ -36,4 +36,10 @@ public class RedisConstants {
...
@@ -36,4 +36,10 @@ public class RedisConstants {
public
static
final
String
MESSAGE_RESET_PASSWORD_TOKEN
=
"message:resetpassword:token:"
;
public
static
final
String
MESSAGE_RESET_PASSWORD_TOKEN
=
"message:resetpassword:token:"
;
/**
* 线路天气预警
*/
public
static
final
String
LINE_WARN_WEATHER
=
"clx-performance:lineWarn:weather:"
;
}
}
performance-web/src/main/java/com/clx/performance/service/impl/linewarn/LineWarnWeatherWarnServiceImpl.java
浏览文件 @
cdc9d7c2
package
com
.
clx
.
performance
.
service
.
impl
.
linewarn
;
package
com
.
clx
.
performance
.
service
.
impl
.
linewarn
;
import
com.clx.order.vo.feign.FeignAddressVO
;
import
com.clx.order.vo.feign.FeignAddressVO
;
import
com.clx.performance.constant.RedisConstants
;
import
com.clx.performance.dao.linewarn.LineWarnConfigDao
;
import
com.clx.performance.dao.linewarn.LineWarnConfigDao
;
import
com.clx.performance.dao.linewarn.LineWarnInfoDao
;
import
com.clx.performance.dao.linewarn.LineWarnInfoDao
;
import
com.clx.performance.dto.linewarn.LineWarnCommonInfoDTO
;
import
com.clx.performance.dto.linewarn.LineWarnCommonInfoDTO
;
import
com.clx.performance.enums.linewarn.LineWarnConfigEnum
;
import
com.clx.performance.enums.linewarn.LineWarnConfigEnum
;
import
com.clx.performance.enums.linewarn.LineWarnInfoEnum
;
import
com.clx.performance.enums.linewarn.LineWarnInfoEnum
;
import
com.clx.performance.extranal.order.InternalReportService
;
import
com.clx.performance.extranal.user.AddressService
;
import
com.clx.performance.extranal.user.AddressService
;
import
com.clx.performance.model.OrderGoods
;
import
com.clx.performance.model.OrderGoods
;
import
com.clx.performance.model.linewarn.LineWarnConfig
;
import
com.clx.performance.model.linewarn.LineWarnConfig
;
...
@@ -18,19 +18,20 @@ import com.msl.common.base.Optional;
...
@@ -18,19 +18,20 @@ import com.msl.common.base.Optional;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Objects
;
import
java.util.concurrent.TimeUnit
;
@Slf4j
@Slf4j
@Service
@Service
public
class
LineWarnWeatherWarnServiceImpl
implements
LineWarnWeatherWarnService
{
public
class
LineWarnWeatherWarnServiceImpl
implements
LineWarnWeatherWarnService
{
@Autowired
@Autowired
private
LineWarnConfigDao
lineWarnConfigDao
;
private
LineWarnConfigDao
lineWarnConfigDao
;
@Autowired
private
InternalReportService
internalReportService
;
@Autowired
@Autowired
private
LineWarnCommonService
lineWarnCommonService
;
private
LineWarnCommonService
lineWarnCommonService
;
@Autowired
@Autowired
...
@@ -39,10 +40,15 @@ public class LineWarnWeatherWarnServiceImpl implements LineWarnWeatherWarnServic
...
@@ -39,10 +40,15 @@ public class LineWarnWeatherWarnServiceImpl implements LineWarnWeatherWarnServic
private
GdUtils
gdUtils
;
private
GdUtils
gdUtils
;
@Autowired
@Autowired
private
AddressService
addressService
;
private
AddressService
addressService
;
@Autowired
private
RedisTemplate
<
String
,
String
>
redisTemplate
;
@Override
@Override
public
void
weatherWarn
(
OrderGoods
orderGoods
,
LineWarnCommonInfoDTO
lineWarnCommonInfo
)
{
public
void
weatherWarn
(
OrderGoods
orderGoods
,
LineWarnCommonInfoDTO
lineWarnCommonInfo
)
{
Boolean
flag
=
redisTemplate
.
opsForValue
().
setIfAbsent
(
RedisConstants
.
LINE_WARN_WEATHER
+
orderGoods
.
getOrderGoodsNo
(),
orderGoods
.
getOrderGoodsNo
(),
1
,
TimeUnit
.
HOURS
);
if
(!
flag
)
{
return
;}
List
<
LineWarnConfig
>
lineWarnConfigList
=
lineWarnConfigDao
List
<
LineWarnConfig
>
lineWarnConfigList
=
lineWarnConfigDao
.
listByWarnType
(
LineWarnConfigEnum
.
WarnType
.
WEATHER
.
getCode
());
.
listByWarnType
(
LineWarnConfigEnum
.
WarnType
.
WEATHER
.
getCode
());
if
(
lineWarnConfigList
.
isEmpty
())
{
return
;}
if
(
lineWarnConfigList
.
isEmpty
())
{
return
;}
...
@@ -65,6 +71,7 @@ public class LineWarnWeatherWarnServiceImpl implements LineWarnWeatherWarnServic
...
@@ -65,6 +71,7 @@ public class LineWarnWeatherWarnServiceImpl implements LineWarnWeatherWarnServic
boolean
suspend
=
lineWarnCommonService
.
suspendCheck
(
lineWarnInfo
);
boolean
suspend
=
lineWarnCommonService
.
suspendCheck
(
lineWarnInfo
);
if
(
suspend
)
{
return
;}
if
(
suspend
)
{
return
;}
String
weatherAll
=
""
;
Optional
<
FeignAddressVO
>
addressOptional
=
addressService
Optional
<
FeignAddressVO
>
addressOptional
=
addressService
.
getSendAndReceiveAddress
(
orderGoods
.
getSendAddressId
(),
orderGoods
.
getReceiveAddressId
());
.
getSendAndReceiveAddress
(
orderGoods
.
getSendAddressId
(),
orderGoods
.
getReceiveAddressId
());
if
(
addressOptional
.
isEmpty
())
{
return
;}
if
(
addressOptional
.
isEmpty
())
{
return
;}
...
@@ -76,6 +83,7 @@ public class LineWarnWeatherWarnServiceImpl implements LineWarnWeatherWarnServic
...
@@ -76,6 +83,7 @@ public class LineWarnWeatherWarnServiceImpl implements LineWarnWeatherWarnServic
String
weather
=
gdUtils
.
getWeather
(
cityCode
);
String
weather
=
gdUtils
.
getWeather
(
cityCode
);
if
(
weatherCheck
(
weather
)){
if
(
weatherCheck
(
weather
)){
weatherAll
=
weather
;
// 更新
// 更新
lineWarnCommonService
.
lineWarnInfoUpdate
(
orderGoods
,
lineWarnInfo
,
lineWarnConfig
,
weather
);
lineWarnCommonService
.
lineWarnInfoUpdate
(
orderGoods
,
lineWarnInfo
,
lineWarnConfig
,
weather
);
}
}
...
@@ -85,11 +93,21 @@ public class LineWarnWeatherWarnServiceImpl implements LineWarnWeatherWarnServic
...
@@ -85,11 +93,21 @@ public class LineWarnWeatherWarnServiceImpl implements LineWarnWeatherWarnServic
feignAddressVO
.
getReceiveAddress
().
getLatitude
());
feignAddressVO
.
getReceiveAddress
().
getLatitude
());
String
weather
=
gdUtils
.
getWeather
(
cityCode
);
String
weather
=
gdUtils
.
getWeather
(
cityCode
);
if
(
weatherCheck
(
weather
)){
if
(
weatherCheck
(
weather
)){
// 更新
if
(
StringUtils
.
isBlank
(
weatherAll
)){
weatherAll
=
weather
;}
lineWarnCommonService
.
lineWarnInfoUpdate
(
orderGoods
,
lineWarnInfo
,
lineWarnConfig
,
weather
);
else
{
//不相同,逗号分隔
if
(!
weatherAll
.
equals
(
weather
)){
weatherAll
=
weatherAll
+
","
+
weather
;
}
}
}
}
}
}
if
(
StringUtils
.
isNotBlank
(
weatherAll
)){
// 更新
lineWarnCommonService
.
lineWarnInfoUpdate
(
orderGoods
,
lineWarnInfo
,
lineWarnConfig
,
weatherAll
);
}
}
}
/**
/**
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论