Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
76ad0fb7
Commit
76ad0fb7
authored
May 30, 2023
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目订单提醒实现
parent
89d28a83
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
304 additions
and
0 deletions
+304
-0
pom.xml
pom.xml
+1
-0
MsgInfo.java
.../main/java/com/yifu/cloud/plus/v1/msg/entity/MsgInfo.java
+59
-0
EkpAlertVo.java
...c/main/java/com/yifu/cloud/plus/v1/msg/vo/EkpAlertVo.java
+30
-0
MsgMapper.java
...ain/java/com/yifu/cloud/plus/v1/msg/mapper/MsgMapper.java
+42
-0
MsgService.java
...n/java/com/yifu/cloud/plus/v1/msg/service/MsgService.java
+18
-0
MsgImpl.java
...java/com/yifu/cloud/plus/v1/msg/service/impl/MsgImpl.java
+65
-0
MsgMapper.xml
...-msg/yifu-msg-biz/src/main/resources/mapper/MsgMapper.xml
+89
-0
No files found.
pom.xml
View file @
76ad0fb7
...
...
@@ -104,6 +104,7 @@
<module>
yifu-order
</module>
<module>
yifu-mail
</module>
<module>
yifu-business
</module>
<module>
yifu-msg
</module>
</modules>
<dependencyManagement>
...
...
yifu-msg/yifu-msg-api/src/main/java/com/yifu/cloud/plus/v1/msg/entity/MsgInfo.java
0 → 100644
View file @
76ad0fb7
package
com
.
yifu
.
cloud
.
plus
.
v1
.
msg
.
entity
;
import
cn.hutool.core.date.DateTime
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.write.style.HeadFontStyle
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* @Author fxj
* @Date 2023/5/30
* @Description
* @Version 1.0
*/
@Data
@TableName
(
"msg_info"
)
@EqualsAndHashCode
()
@Schema
(
description
=
"EKP消息提醒"
)
public
class
MsgInfo
{
/**
* id
**/
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
private
String
id
;
/**
* 创建时间
**/
private
DateTime
createTime
;
/**
* 订单ID
**/
private
String
orderId
;
/**
* url
**/
private
String
url
;
/**
* 订单号
**/
private
String
orderNo
;
/**
* 通知类型: 0 接单 1 超时 2变更
**/
private
String
alertType
;
/**
* 是否已读 0 是 1 否
**/
private
String
read
;
/**
* 通知人
**/
private
String
alertUser
;
}
yifu-msg/yifu-msg-api/src/main/java/com/yifu/cloud/plus/v1/msg/vo/EkpAlertVo.java
0 → 100644
View file @
76ad0fb7
package
com
.
yifu
.
cloud
.
plus
.
v1
.
msg
.
vo
;
import
lombok.Data
;
/**
* @Author fxj
* @Date 2023/5/30
* @Description
* @Version 1.0
*/
@Data
public
class
EkpAlertVo
{
/**
* 类型 0 接单 1 超时 2变更
**/
private
String
type
;
/**
* 订单号
**/
private
String
orderId
;
/**
* 表单类型:0 项目订单
**/
private
String
item
;
/**
* 提醒人
**/
private
String
alertUser
;
}
yifu-msg/yifu-msg-biz/src/main/java/com/yifu/cloud/plus/v1/msg/mapper/MsgMapper.java
0 → 100644
View file @
76ad0fb7
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
msg
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.msg.entity.MsgInfo
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* @Author fxj
* @Description EKP 消息表
* @Date 16:20 2023/5/30
* @Param
* @return
**/
@Mapper
public
interface
MsgMapper
extends
BaseMapper
<
MsgInfo
>
{
IPage
<
MsgInfo
>
getmsgInfoPage
(
Page
<
MsgInfo
>
page
,
@Param
(
"msgInfo"
)
MsgInfo
msgInfo
);
MsgInfo
getMsgByOrderId
(
@Param
(
"orderId"
)
String
orderId
);
}
yifu-msg/yifu-msg-biz/src/main/java/com/yifu/cloud/plus/v1/msg/service/MsgService.java
0 → 100644
View file @
76ad0fb7
package
com
.
yifu
.
cloud
.
plus
.
v1
.
msg
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.msg.entity.MsgInfo
;
import
com.yifu.cloud.plus.v1.msg.vo.EkpAlertVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
java.util.List
;
/**
* @Author fxj
* @Date 2023/5/30
* @Description
* @Version 1.0
*/
public
interface
MsgService
extends
IService
<
MsgInfo
>
{
R
<
Boolean
>
createMsg
(
List
<
EkpAlertVo
>
list
);
}
yifu-msg/yifu-msg-biz/src/main/java/com/yifu/cloud/plus/v1/msg/service/impl/MsgImpl.java
0 → 100644
View file @
76ad0fb7
package
com
.
yifu
.
cloud
.
plus
.
v1
.
msg
.
service
.
impl
;
import
cn.hutool.core.date.DateTime
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.msg.constant.MesConstants
;
import
com.yifu.cloud.plus.v1.msg.entity.MsgInfo
;
import
com.yifu.cloud.plus.v1.msg.mapper.MsgMapper
;
import
com.yifu.cloud.plus.v1.msg.service.MsgService
;
import
com.yifu.cloud.plus.v1.msg.vo.EkpAlertVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @Author fxj
* @Date 2023/5/30
* @Description
* @Version 1.0
*/
@RequiredArgsConstructor
@Service
public
class
MsgImpl
extends
ServiceImpl
<
MsgMapper
,
MsgInfo
>
implements
MsgService
{
@Override
public
R
<
Boolean
>
createMsg
(
List
<
EkpAlertVo
>
list
)
{
if
(
Common
.
isNotNull
(
list
)){
EkpAlertVo
vo
=
list
.
get
(
CommonConstants
.
ZERO_INT
);
if
(
Common
.
isEmpty
(
vo
.
getItem
())
||
Common
.
isEmpty
(
vo
.
getType
())
||
Common
.
isEmpty
(
vo
.
getOrderId
())
||
Common
.
isEmpty
(
vo
.
getAlertUser
())){
return
R
.
failed
(
CommonConstants
.
PARAM_INFO_ERROR
);
}
MsgInfo
save
=
null
;
// 项目订单处理
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
vo
.
getItem
())){
// 接单提醒
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
vo
.
getType
())){
save
=
baseMapper
.
getMsgByOrderId
(
vo
.
getOrderId
());
if
(
Common
.
isNotNull
(
save
)){
save
.
setCreateTime
(
DateTime
.
now
());
save
.
setUrl
(
MesConstants
.
ORDER_URL_PATH
+
vo
.
getOrderId
());
baseMapper
.
insert
(
save
);
}
}
// 变更提醒
if
(
CommonConstants
.
TWO_STRING
.
equals
(
vo
.
getType
())){
save
=
baseMapper
.
getMsgByOrderId
(
vo
.
getOrderId
());
if
(
Common
.
isNotNull
(
save
)){
save
.
setCreateTime
(
DateTime
.
now
());
save
.
setUrl
(
MesConstants
.
ORDER_URL_PATH
+
save
.
getOrderId
());
save
.
setAlertType
(
CommonConstants
.
TWO_STRING
);
baseMapper
.
insert
(
save
);
}
}
}
}
else
{
return
R
.
failed
(
CommonConstants
.
PARAM_INFO_ERROR
);
}
return
null
;
}
}
yifu-msg/yifu-msg-biz/src/main/resources/mapper/MsgMapper.xml
0 → 100644
View file @
76ad0fb7
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yifu.cloud.plus.v1.msg.mapper.MsgMapper"
>
<resultMap
id=
"msgInfoMap"
type=
"com.yifu.cloud.plus.v1.msg.entity.MsgInfo"
>
<id
property=
"id"
column=
"ID"
/>
<result
property=
"createTime"
column=
"CREATE_TIME"
/>
<result
property=
"orderId"
column=
"ORDER_ID"
/>
<result
property=
"url"
column=
"URL"
/>
<result
property=
"orderNo"
column=
"ORDER_NO"
/>
<result
property=
"alertType"
column=
"ALERT_TYPE"
/>
<result
property=
"read"
column=
"READ"
/>
<result
property=
"alertUser"
column=
"ALERT_USER"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
a.ID,
a.CREATE_TIME,
a.ORDER_ID,
a.URL,
a.ORDER_NO,
a.ALERT_TYPE,
a.READ,
a.ALERT_USER
</sql>
<sql
id=
"msgInfo_where"
>
<if
test=
"msgInfo != null"
>
<if
test=
"msgInfo.id != null and msgInfo.id.trim() != ''"
>
AND a.ID = #{msgInfo.id}
</if>
<if
test=
"msgInfo.orderId != null and msgInfo.orderId.trim() != ''"
>
AND a.ORDER_ID = #{msgInfo.orderId}
</if>
<if
test=
"msgInfo.alertType != null and msgInfo.alertType.trim() != ''"
>
AND a.ALERT_TYPE = #{msgInfo.alertType}
</if>
<if
test=
"msgInfo.read != null and msgInfo.read.trim() != ''"
>
AND a.READ = #{msgInfo.read}
</if>
<if
test=
"msgInfo.alertUser != null and msgInfo.alertUser.trim() != ''"
>
AND a.ALERT_USER = #{msgInfo.alertUser}
</if>
</if>
</sql>
<!--msgInfo简单分页查询-->
<select
id=
"getmsgInfoPage"
resultMap=
"msgInfoMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM msg_info a
<where>
1=1
<include
refid=
"msgInfo_where"
/>
</where>
order by a.CREATE_TIME desc
</select>
<select
id=
"getMsgByOrderId"
resultType=
"com.yifu.cloud.plus.v1.msg.entity.MsgInfo"
>
SELECT
p.fd_name alertUser,
a.fd_3ac901c5184274 orderNo,
a.fd_id orderId,
'0' as alertType
FROM
ekp_ea33075576149bb8a4f5 a
LEFT JOIN sys_org_element p on a.fd_3b0aff6781fa86 = p.fd_id
WHERE
a.ORDER_ID = #{orderId} limit 1
</select>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment