Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rpc-dj-strategy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 0213a979
authored
Jan 21, 2026
by
谢海旭
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
v5.6.0版本 策略中心:展业助手-全局提醒、优秀案例-列表、优秀案例-详情、查询任务型策略详情、更新业务策略推送消息
1 parent
465f7959
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
165 additions
and
14 deletions
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/enums/StrategyErrorEnum.java
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/model/StrategyStaffMessage.java
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/remote/StrategyStaffMessageRemote.java
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/mapper/StrategyStaffMessageMapper.java
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/remote/StrategyStaffMessageRemoteImpl.java
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/service/StrategyStaffMessageService.java
rpc-dj-strategy/src/main/resources/META-INF/orm/StrategyStaffMessageMapper.xml
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/enums/StrategyErrorEnum.java
View file @
0213a97
...
...
@@ -22,6 +22,7 @@ public enum StrategyErrorEnum implements ErrorEnum {
STRATEGY_NOT_EXISTS
(
"11010001"
,
"策略不存在"
),
STRATEGY_TYPE_NOT_SUPPORTED
(
"11010002"
,
"策略类型不支持"
),
BUSINESS_EXCEPTION
(
"11010003"
,
"业务异常"
),
;
...
...
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/model/StrategyStaffMessage.java
View file @
0213a97
...
...
@@ -3,9 +3,9 @@ package cn.com.glsx.dj.strategy.model;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.util.Date
;
import
javax.persistence.*
;
/**
* 策略-人员-消息关联表
...
...
@@ -13,6 +13,7 @@ import javax.persistence.*;
@Data
@Table
(
name
=
"dj_car_life_strategy_staff_message"
)
public
class
StrategyStaffMessage
implements
Serializable
{
/**
* 主键ID
*/
...
...
@@ -23,100 +24,105 @@ public class StrategyStaffMessage implements Serializable {
/**
* 策略ID,关联dj_car_life_strategy_info表
*/
@ApiModelProperty
(
notes
=
"策略ID,关联dj_car_life_strategy_info表"
)
@Column
(
name
=
"strategy_id"
)
@ApiModelProperty
(
notes
=
"策略ID,关联dj_car_life_strategy_info表"
)
private
Integer
strategyId
;
/**
* 人员UUID
*/
@ApiModelProperty
(
notes
=
"人员UUID"
)
@Column
(
name
=
"uuid"
)
@ApiModelProperty
(
notes
=
"人员UUID"
)
private
String
uuid
;
/**
* 人员手机号
*/
@ApiModelProperty
(
notes
=
"人员手机号"
)
@Column
(
name
=
"phone"
)
@ApiModelProperty
(
notes
=
"人员手机号"
)
private
String
phone
;
/**
* 人员姓名
*/
@ApiModelProperty
(
notes
=
"人员姓名"
)
@Column
(
name
=
"staff_name"
)
@ApiModelProperty
(
notes
=
"人员姓名"
)
private
String
staffName
;
/**
* 消息ID,关联pad_message_box表
*/
@ApiModelProperty
(
notes
=
"消息ID,关联pad_message_box表"
)
@Column
(
name
=
"message_id"
)
@ApiModelProperty
(
notes
=
"消息ID,关联pad_message_box表"
)
private
Integer
messageId
;
/**
* 推送状态,0-推送失败,1-已推送
*/
@ApiModelProperty
(
notes
=
"推送状态,0-推送失败,1-已推送"
)
@Column
(
name
=
"push_status"
)
@ApiModelProperty
(
notes
=
"推送状态,0-推送失败,1-已推送"
)
private
Integer
pushStatus
;
/**
* 阅读状态,0-未读,1-已读
*/
@ApiModelProperty
(
notes
=
"阅读状态,0-未读,1-已读"
)
@Column
(
name
=
"read_status"
)
@ApiModelProperty
(
notes
=
"阅读状态,0-未读,1-已读"
)
private
Integer
readStatus
;
/**
* 阅读时间
*/
@ApiModelProperty
(
notes
=
"阅读时间"
)
@Column
(
name
=
"read_time"
)
@ApiModelProperty
(
notes
=
"阅读时间"
)
private
Date
readTime
;
/**
* 阅读次数
*/
@ApiModelProperty
(
notes
=
"阅读次数"
)
@Column
(
name
=
"read_count"
)
@ApiModelProperty
(
notes
=
"阅读次数"
)
private
Integer
readCount
;
/**
* 最新阅读时间
*/
@ApiModelProperty
(
notes
=
"最新阅读时间"
)
@Column
(
name
=
"latest_read_time"
)
@ApiModelProperty
(
notes
=
"最新阅读时间"
)
private
Date
latestReadTime
;
/**
* 创建人
*/
@Column
(
name
=
"created_by"
)
@ApiModelProperty
(
notes
=
"创建人"
)
private
String
createdBy
;
/**
* 创建时间
*/
@Column
(
name
=
"created_date"
)
@ApiModelProperty
(
notes
=
"创建时间"
)
private
Date
createdDate
;
/**
* 修改人
*/
@Column
(
name
=
"updated_by"
)
@ApiModelProperty
(
notes
=
"修改人"
)
private
String
updatedBy
;
/**
* 修改时间
*/
@Column
(
name
=
"updated_date"
)
@ApiModelProperty
(
notes
=
"修改时间"
)
private
Date
updatedDate
;
/**
* 删除标识(D:已删除;N:未删除)
*/
@Column
(
name
=
"deleted_flag"
)
@ApiModelProperty
(
notes
=
"删除标识(D:已删除;N:未删除)"
)
private
String
deletedFlag
;
}
\ No newline at end of file
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/remote/StrategyStaffMessageRemote.java
0 → 100644
View file @
0213a97
package
cn
.
com
.
glsx
.
dj
.
strategy
.
remote
;
import
cn.com.glsx.framework.core.annotation.ApiMethod
;
import
cn.com.glsx.framework.core.annotation.ApiParam
;
import
cn.com.glsx.framework.core.annotation.ApiResponse
;
import
cn.com.glsx.framework.core.annotation.ApiService
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
@ApiService
(
value
=
"策略人员消息关联服务"
,
owner
=
"strategy"
)
public
interface
StrategyStaffMessageRemote
{
@ApiMethod
(
"根据消息盒子ID和手机号更新业务消息记录的已读状态"
)
@ApiParam
(
name
=
"messageId"
,
notes
=
"消息盒子ID"
,
dataType
=
ApiParam
.
DataTypeEnum
.
OBJECT
,
required
=
true
)
@ApiResponse
(
"是否更新成功"
)
RpcResponse
<
Boolean
>
updateReadStatusByMessageId
(
Integer
messageId
);
@ApiMethod
(
"通过MessageId查询业务消息详情"
)
@ApiParam
(
name
=
"messageId"
,
notes
=
"消息ID"
,
dataType
=
ApiParam
.
DataTypeEnum
.
OBJECT
,
required
=
true
)
@ApiResponse
(
"业务消息详情对象"
)
RpcResponse
<
Object
>
getBusinessMessageDetailByMessageId
(
Integer
messageId
);
}
\ No newline at end of file
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/mapper/StrategyStaffMessageMapper.java
View file @
0213a97
...
...
@@ -2,8 +2,16 @@ package cn.com.glsx.dj.strategy.mapper;
import
cn.com.glsx.dj.strategy.model.StrategyStaffMessage
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.oreframework.datasource.mybatis.mapper.OreMapper
;
@Mapper
public
interface
StrategyStaffMessageMapper
extends
OreMapper
<
StrategyStaffMessage
>
{
/**
* 根据消息ID和手机号更新阅读状态
* @param messageId 消息ID
* @return 更新记录数
*/
int
updateReadStatusByMessageId
(
@Param
(
"messageId"
)
Integer
messageId
);
}
\ No newline at end of file
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/remote/StrategyStaffMessageRemoteImpl.java
0 → 100644
View file @
0213a97
package
cn
.
com
.
glsx
.
dj
.
strategy
.
remote
;
import
cn.com.glsx.dj.strategy.enums.StrategyErrorEnum
;
import
cn.com.glsx.dj.strategy.service.StrategyStaffMessageService
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.dubbo.config.annotation.DubboService
;
import
org.springframework.beans.factory.annotation.Autowired
;
@Slf4j
@DubboService
(
protocol
=
"dubbo"
,
version
=
"1.0.0"
,
timeout
=
30000
)
public
class
StrategyStaffMessageRemoteImpl
implements
StrategyStaffMessageRemote
{
@Autowired
private
StrategyStaffMessageService
strategyStaffMessageService
;
@Override
public
RpcResponse
<
Boolean
>
updateReadStatusByMessageId
(
Integer
messageId
)
{
try
{
Boolean
result
=
strategyStaffMessageService
.
updateReadStatusByMessageId
(
messageId
);
return
RpcResponse
.
success
(
result
);
}
catch
(
Exception
e
)
{
log
.
error
(
"根据消息盒子ID和手机号更新业务消息记录的已读状态失败,messageId={}"
,
messageId
,
e
);
throw
new
RpcServiceException
(
StrategyErrorEnum
.
BUSINESS_EXCEPTION
,
"更新策略人员消息阅读状态失败"
);
}
}
@Override
public
RpcResponse
<
Object
>
getBusinessMessageDetailByMessageId
(
Integer
messageId
)
{
try
{
Object
result
=
strategyStaffMessageService
.
getBusinessMessageDetailByMessageId
(
messageId
);
return
RpcResponse
.
success
(
result
);
}
catch
(
Exception
e
)
{
log
.
error
(
"通过MessageId查询业务消息详情失败,messageId={}"
,
messageId
,
e
);
throw
new
RpcServiceException
(
StrategyErrorEnum
.
BUSINESS_EXCEPTION
,
"查询策略人员消息详情失败"
);
}
}
}
\ No newline at end of file
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/service/StrategyStaffMessageService.java
0 → 100644
View file @
0213a97
package
cn
.
com
.
glsx
.
dj
.
strategy
.
service
;
import
cn.com.glsx.dj.strategy.enums.StrategyTypeEnum
;
import
cn.com.glsx.dj.strategy.mapper.StrategyInfoMapper
;
import
cn.com.glsx.dj.strategy.mapper.StrategyStaffMessageMapper
;
import
cn.com.glsx.dj.strategy.model.StrategyInfo
;
import
cn.com.glsx.dj.strategy.model.StrategyStaffMessage
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
@Service
@Slf4j
public
class
StrategyStaffMessageService
{
@Autowired
private
StrategyStaffMessageMapper
strategyStaffMessageMapper
;
@Autowired
private
StrategyInfoMapper
strategyInfoMapper
;
/**
* 根据消息盒子ID和手机号更新业务消息记录的已读状态
* @param messageId 消息盒子ID
* @return 是否更新成功
*/
@Transactional
public
Boolean
updateReadStatusByMessageId
(
Integer
messageId
)
{
int
rowsAffected
=
strategyStaffMessageMapper
.
updateReadStatusByMessageId
(
messageId
);
log
.
info
(
"更新策略人员消息阅读状态,消息ID:{},影响行数:{}"
,
messageId
,
rowsAffected
);
return
rowsAffected
>
0
;
}
/**
* 根据消息ID查询业务消息详情
* @param messageId 消息ID
* @return 业务消息详情
*/
public
Object
getBusinessMessageDetailByMessageId
(
Integer
messageId
)
{
StrategyStaffMessage
example
=
new
StrategyStaffMessage
();
example
.
setMessageId
(
messageId
);
example
.
setDeletedFlag
(
"N"
);
StrategyStaffMessage
staffMessage
=
strategyStaffMessageMapper
.
selectOne
(
example
);
if
(
staffMessage
==
null
)
{
log
.
warn
(
"未找到对应的消息记录,messageId:{}"
,
messageId
);
return
null
;
}
Integer
strategyId
=
staffMessage
.
getStrategyId
();
StrategyInfo
strategyInfo
=
strategyInfoMapper
.
selectByPrimaryKey
(
strategyId
);
if
(
strategyInfo
==
null
)
{
log
.
warn
(
"未找到对应的策略详情,strategyId:{}"
,
strategyId
);
return
null
;
}
if
(
StrategyTypeEnum
.
TASK
.
equals
(
strategyInfo
.
getStrategyType
()))
{
return
strategyInfo
;
}
else
{
// 其他类型,返回null TODO 待实现 0-学习类,1-优秀录音分享类,剩余类型暂时无推送消息
return
null
;
}
}
}
\ No newline at end of file
rpc-dj-strategy/src/main/resources/META-INF/orm/StrategyStaffMessageMapper.xml
View file @
0213a97
...
...
@@ -22,12 +22,23 @@
<result
column=
"updated_date"
property=
"updatedDate"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"deleted_flag"
property=
"deletedFlag"
jdbcType=
"CHAR"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<!--
WARNING - @mbg.generated
-->
id, strategy_id, uuid, phone, staff_name, message_id, push_status, read_status,
read_time, read_count, latest_read_time, created_by, created_date, updated_by,
updated_date, deleted_flag
id, strategy_id, uuid, phone, staff_name, message_id, push_status, read_status, read_time,
read_count, latest_read_time, created_by, created_date, updated_by, updated_date, deleted_flag
</sql>
<update
id=
"updateReadStatusByMessageId"
>
UPDATE dj_car_life_strategy_staff_message
SET read_status = 1,
read_time = NOW(),
latest_read_time = NOW(),
read_count = IFNULL(read_count, 0) + 1,
updated_date = NOW()
WHERE message_id = #{messageId,jdbcType=INTEGER}
AND deleted_flag = 'N'
</update>
</mapper>
\ No newline at end of file
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