Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rpc-mindworkplate
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b4a8ae93
authored
Jan 21, 2026
by
谢海旭
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
202601月底版本 策略中心:兜底目标、策略列表
1 parent
00ee072a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
84 additions
and
1 deletions
rpc-dj-mindworkplate-api/src/main/java/cn/com/glsx/dj/mindworkplate/remote/EarlyWarningMsgRemote.java
rpc-dj-mindworkplate/src/main/java/cn/com/glsx/dj/mindworkplate/mapper/EarlyWarningThresholdConfigHistoryMapper.java
rpc-dj-mindworkplate/src/main/java/cn/com/glsx/dj/mindworkplate/remote/EarlyWarningMsgRemoteImpl.java
rpc-dj-mindworkplate/src/main/java/cn/com/glsx/dj/mindworkplate/service/EarlyWarningThresholdConfigService.java
rpc-dj-mindworkplate/src/main/resources/META-INF/orm/EarlyWarningThresholdConfigHistoryMapper.xml
rpc-dj-mindworkplate-api/src/main/java/cn/com/glsx/dj/mindworkplate/remote/EarlyWarningMsgRemote.java
View file @
b4a8ae9
package
cn
.
com
.
glsx
.
dj
.
mindworkplate
.
remote
;
package
cn
.
com
.
glsx
.
dj
.
mindworkplate
.
remote
;
import
cn.com.glsx.dj.mindworkplate.dto.*
;
import
cn.com.glsx.dj.mindworkplate.dto.*
;
import
cn.com.glsx.dj.mindworkplate.dto.warning.EarlyWarningThresholdConfigHistoryDTO
;
import
cn.com.glsx.dj.mindworkplate.model.warning.WarningMsg
;
import
cn.com.glsx.dj.mindworkplate.model.warning.WarningMsg
;
import
cn.com.glsx.dj.mindworkplate.model.warning.WarningMsgResponse
;
import
cn.com.glsx.dj.mindworkplate.model.warning.WarningMsgResponse
;
import
cn.com.glsx.framework.core.annotation.ApiMethod
;
import
cn.com.glsx.framework.core.annotation.ApiMethod
;
...
@@ -76,4 +77,9 @@ public interface EarlyWarningMsgRemote {
...
@@ -76,4 +77,9 @@ public interface EarlyWarningMsgRemote {
@ApiParam
(
name
=
"month"
,
notes
=
"月份 格式yyyy-mm"
,
dataType
=
ApiParam
.
DataTypeEnum
.
OBJECT
,
required
=
true
)
@ApiParam
(
name
=
"month"
,
notes
=
"月份 格式yyyy-mm"
,
dataType
=
ApiParam
.
DataTypeEnum
.
OBJECT
,
required
=
true
)
@ApiResponse
(
"查询月份内中的门店的预警明细 1.兜底预警 2.丢店预警(展业预警)"
)
@ApiResponse
(
"查询月份内中的门店的预警明细 1.兜底预警 2.丢店预警(展业预警)"
)
RpcResponse
<
Map
<
Integer
,
List
<
WarningMsgResponse
>>>
findWarnMsgListByMonth
(
MerchantDdWarningMsgRequestDTO
merchantDdWarningMsgRequestDTO
);
RpcResponse
<
Map
<
Integer
,
List
<
WarningMsgResponse
>>>
findWarnMsgListByMonth
(
MerchantDdWarningMsgRequestDTO
merchantDdWarningMsgRequestDTO
);
@ApiMethod
(
"策略中心-门店分析-历史兜底指标"
)
@ApiParam
(
name
=
"merchantNo"
,
notes
=
"商户号"
,
dataType
=
ApiParam
.
DataTypeEnum
.
STRING
,
required
=
true
)
@ApiResponse
(
"返回门店历史兜底指标数据"
)
RpcResponse
<
List
<
EarlyWarningThresholdConfigHistoryDTO
>>
listMerchantAnalysisIndexHistory
(
String
merchantNo
);
}
}
rpc-dj-mindworkplate/src/main/java/cn/com/glsx/dj/mindworkplate/mapper/EarlyWarningThresholdConfigHistoryMapper.java
View file @
b4a8ae9
...
@@ -3,6 +3,9 @@ package cn.com.glsx.dj.mindworkplate.mapper;
...
@@ -3,6 +3,9 @@ package cn.com.glsx.dj.mindworkplate.mapper;
import
cn.com.glsx.dj.mindworkplate.model.EarlyWarningThresholdConfigHistory
;
import
cn.com.glsx.dj.mindworkplate.model.EarlyWarningThresholdConfigHistory
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.oreframework.datasource.mybatis.mapper.OreMapper
;
import
org.oreframework.datasource.mybatis.mapper.OreMapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
@Mapper
@Mapper
public
interface
EarlyWarningThresholdConfigHistoryMapper
extends
OreMapper
<
EarlyWarningThresholdConfigHistory
>
{
public
interface
EarlyWarningThresholdConfigHistoryMapper
extends
OreMapper
<
EarlyWarningThresholdConfigHistory
>
{
...
@@ -12,4 +15,12 @@ public interface EarlyWarningThresholdConfigHistoryMapper extends OreMapper<Earl
...
@@ -12,4 +15,12 @@ public interface EarlyWarningThresholdConfigHistoryMapper extends OreMapper<Earl
* @return 插入条数
* @return 插入条数
*/
*/
int
backupConfigToHistory
();
int
backupConfigToHistory
();
/**
* 根据商户号查询历史指标数据,按月份倒序排列
*
* @param merchantNo 商户号
* @return 历史指标数据列表
*/
List
<
EarlyWarningThresholdConfigHistory
>
selectByMerchantNoOrderByMonthDesc
(
@Param
(
"merchantNo"
)
String
merchantNo
);
}
}
rpc-dj-mindworkplate/src/main/java/cn/com/glsx/dj/mindworkplate/remote/EarlyWarningMsgRemoteImpl.java
View file @
b4a8ae9
package
cn
.
com
.
glsx
.
dj
.
mindworkplate
.
remote
;
package
cn
.
com
.
glsx
.
dj
.
mindworkplate
.
remote
;
import
cn.com.glsx.dj.mindworkplate.dto.*
;
import
cn.com.glsx.dj.mindworkplate.dto.*
;
import
cn.com.glsx.dj.mindworkplate.dto.warning.EarlyWarningThresholdConfigHistoryDTO
;
import
cn.com.glsx.dj.mindworkplate.model.warning.WarningMsg
;
import
cn.com.glsx.dj.mindworkplate.model.warning.WarningMsg
;
import
cn.com.glsx.dj.mindworkplate.model.warning.WarningMsgResponse
;
import
cn.com.glsx.dj.mindworkplate.model.warning.WarningMsgResponse
;
import
cn.com.glsx.dj.mindworkplate.service.EarlyWarningThresholdConfigService
;
import
cn.com.glsx.dj.mindworkplate.service.warning.WarningMsgService
;
import
cn.com.glsx.dj.mindworkplate.service.warning.WarningMsgService
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.Page
;
import
java.util.Map
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.dubbo.config.annotation.DubboService
;
import
org.apache.dubbo.config.annotation.DubboService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -29,6 +31,9 @@ public class EarlyWarningMsgRemoteImpl implements EarlyWarningMsgRemote{
...
@@ -29,6 +31,9 @@ public class EarlyWarningMsgRemoteImpl implements EarlyWarningMsgRemote{
@Autowired
@Autowired
private
WarningMsgService
warningMsgService
;
private
WarningMsgService
warningMsgService
;
@Autowired
private
EarlyWarningThresholdConfigService
earlyWarningThresholdConfigService
;
@Override
@Override
public
RpcResponse
<
RpcPagination
<
EarlyWarningMsgDTO
>>
listStaffWaringMsgWithPage
(
RpcPagination
<
EarlyWarningMsgDTO
>
pagination
)
{
public
RpcResponse
<
RpcPagination
<
EarlyWarningMsgDTO
>>
listStaffWaringMsgWithPage
(
RpcPagination
<
EarlyWarningMsgDTO
>
pagination
)
{
try
{
try
{
...
@@ -151,4 +156,18 @@ public class EarlyWarningMsgRemoteImpl implements EarlyWarningMsgRemote{
...
@@ -151,4 +156,18 @@ public class EarlyWarningMsgRemoteImpl implements EarlyWarningMsgRemote{
return
RpcResponse
.
error
(
e
);
return
RpcResponse
.
error
(
e
);
}
}
}
}
@Override
public
RpcResponse
<
List
<
EarlyWarningThresholdConfigHistoryDTO
>>
listMerchantAnalysisIndexHistory
(
String
merchantNo
)
{
try
{
List
<
EarlyWarningThresholdConfigHistoryDTO
>
result
=
earlyWarningThresholdConfigService
.
listMerchantAnalysisIndexHistory
(
merchantNo
);
return
RpcResponse
.
success
(
result
);
}
catch
(
RpcServiceException
e
){
log
.
error
(
e
.
getMessage
(),
e
);
return
RpcResponse
.
error
(
e
);
}
catch
(
Exception
e
){
log
.
error
(
e
.
getMessage
(),
e
);
return
RpcResponse
.
error
(
e
);
}
}
}
}
rpc-dj-mindworkplate/src/main/java/cn/com/glsx/dj/mindworkplate/service/EarlyWarningThresholdConfigService.java
View file @
b4a8ae9
package
cn
.
com
.
glsx
.
dj
.
mindworkplate
.
service
;
package
cn
.
com
.
glsx
.
dj
.
mindworkplate
.
service
;
import
cn.com.glsx.dj.mindworkplate.dto.warning.EarlyWarningThresholdConfigHistoryDTO
;
import
cn.com.glsx.dj.mindworkplate.mapper.EarlyWarningThresholdConfigHistoryMapper
;
import
cn.com.glsx.dj.mindworkplate.mapper.EarlyWarningThresholdConfigHistoryMapper
;
import
cn.com.glsx.dj.mindworkplate.mapper.EarlyWarningThresholdConfigMapper
;
import
cn.com.glsx.dj.mindworkplate.mapper.EarlyWarningThresholdConfigMapper
;
import
cn.com.glsx.dj.mindworkplate.mapper.EarlyWarningThresholdRangeConfigMapper
;
import
cn.com.glsx.dj.mindworkplate.mapper.EarlyWarningThresholdRangeConfigMapper
;
import
cn.com.glsx.dj.mindworkplate.model.EarlyWarningThresholdConfig
;
import
cn.com.glsx.dj.mindworkplate.model.EarlyWarningThresholdConfig
;
import
cn.com.glsx.dj.mindworkplate.model.EarlyWarningThresholdConfigHistory
;
import
cn.com.glsx.dj.mindworkplate.model.EarlyWarningThresholdRangeConfig
;
import
cn.com.glsx.dj.mindworkplate.model.EarlyWarningThresholdRangeConfig
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
@Slf4j
@Slf4j
@Service
@Service
...
@@ -104,4 +109,36 @@ public class EarlyWarningThresholdConfigService {
...
@@ -104,4 +109,36 @@ public class EarlyWarningThresholdConfigService {
throw
new
RuntimeException
(
"备份门店指标记录失败: "
+
e
.
getMessage
(),
e
);
throw
new
RuntimeException
(
"备份门店指标记录失败: "
+
e
.
getMessage
(),
e
);
}
}
}
}
/**
* 查询门店历史兜底指标
*
* @param merchantNo 请求参数
* @return 历史指标数据列表
*/
public
List
<
EarlyWarningThresholdConfigHistoryDTO
>
listMerchantAnalysisIndexHistory
(
String
merchantNo
)
{
// 查询历史指标数据,按月份倒序排列
List
<
EarlyWarningThresholdConfigHistory
>
historyList
=
earlyWarningThresholdConfigHistoryMapper
.
selectByMerchantNoOrderByMonthDesc
(
merchantNo
);
// 转换为DTO并设置月份显示格式
List
<
EarlyWarningThresholdConfigHistoryDTO
>
dtoList
=
new
ArrayList
<>();
for
(
EarlyWarningThresholdConfigHistory
history
:
historyList
)
{
EarlyWarningThresholdConfigHistoryDTO
dto
=
new
EarlyWarningThresholdConfigHistoryDTO
();
BeanUtils
.
copyProperties
(
history
,
dto
);
// 将月份格式转换为 yyyy年MM月 格式
String
recordYearMonth
=
history
.
getRecordYearMonth
();
if
(
recordYearMonth
!=
null
&&
recordYearMonth
.
length
()
>=
7
)
{
String
year
=
recordYearMonth
.
substring
(
0
,
4
);
String
month
=
recordYearMonth
.
substring
(
5
,
7
);
String
displayMonth
=
year
+
"年"
+
month
+
"月"
;
dto
.
setRecordYearMonth
(
displayMonth
);
}
dtoList
.
add
(
dto
);
}
return
dtoList
;
}
}
}
rpc-dj-mindworkplate/src/main/resources/META-INF/orm/EarlyWarningThresholdConfigHistoryMapper.xml
View file @
b4a8ae9
...
@@ -53,4 +53,14 @@
...
@@ -53,4 +53,14 @@
FROM early_warning_threshold_config
FROM early_warning_threshold_config
WHERE deleted_flag = 'N'
WHERE deleted_flag = 'N'
</insert>
</insert>
<!-- 根据商户号查询历史指标数据,按月份倒序排列 -->
<select
id=
"selectByMerchantNoOrderByMonthDesc"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM early_warning_threshold_config_history
WHERE merchant_no = #{merchantNo,jdbcType=VARCHAR}
AND deleted_flag = 'N'
ORDER BY record_year_month DESC
</select>
</mapper>
</mapper>
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment