优化消息通知模块的接口
This commit is contained in:
@@ -494,6 +494,7 @@ public class UserController {
|
|||||||
data.put("expireTime", Tools.parseDateToStr(tenant.getExpireTime()));
|
data.put("expireTime", Tools.parseDateToStr(tenant.getExpireTime()));
|
||||||
data.put("userCurrentNum", userCurrentNum);
|
data.put("userCurrentNum", userCurrentNum);
|
||||||
data.put("userNumLimit", tenant.getUserNumLimit());
|
data.put("userNumLimit", tenant.getUserNumLimit());
|
||||||
|
data.put("tenantId", tenant.getTenantId());
|
||||||
res.code = 200;
|
res.code = 200;
|
||||||
res.data = data;
|
res.data = data;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -9,19 +9,17 @@ import java.util.List;
|
|||||||
public interface MsgMapperEx {
|
public interface MsgMapperEx {
|
||||||
|
|
||||||
List<MsgEx> selectByConditionMsg(
|
List<MsgEx> selectByConditionMsg(
|
||||||
|
@Param("userId") Long userId,
|
||||||
@Param("name") String name,
|
@Param("name") String name,
|
||||||
@Param("offset") Integer offset,
|
@Param("offset") Integer offset,
|
||||||
@Param("rows") Integer rows);
|
@Param("rows") Integer rows);
|
||||||
|
|
||||||
Long countsByMsg(
|
Long countsByMsg(
|
||||||
|
@Param("userId") Long userId,
|
||||||
@Param("name") String name);
|
@Param("name") String name);
|
||||||
|
|
||||||
int batchDeleteMsgByIds(@Param("ids") String ids[]);
|
int batchDeleteMsgByIds(@Param("ids") String ids[]);
|
||||||
|
|
||||||
int insertSelectiveByTask(Msg record);
|
|
||||||
|
|
||||||
int checkIsNameExistByTask(@Param("msgTitle") String msgTitle);
|
|
||||||
|
|
||||||
Long getMsgCountByStatus(
|
Long getMsgCountByStatus(
|
||||||
@Param("status") String status,
|
@Param("status") String status,
|
||||||
@Param("userId") Long userId);
|
@Param("userId") Long userId);
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public class MsgService {
|
|||||||
try{
|
try{
|
||||||
User userInfo = userService.getCurrentUser();
|
User userInfo = userService.getCurrentUser();
|
||||||
if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
|
if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
|
||||||
list = msgMapperEx.selectByConditionMsg(name, offset, rows);
|
list = msgMapperEx.selectByConditionMsg(userInfo.getId(), name, offset, rows);
|
||||||
if (null != list) {
|
if (null != list) {
|
||||||
for (MsgEx msgEx : list) {
|
for (MsgEx msgEx : list) {
|
||||||
if (msgEx.getCreateTime() != null) {
|
if (msgEx.getCreateTime() != null) {
|
||||||
@@ -105,7 +105,7 @@ public class MsgService {
|
|||||||
try{
|
try{
|
||||||
User userInfo = userService.getCurrentUser();
|
User userInfo = userService.getCurrentUser();
|
||||||
if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
|
if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
|
||||||
result = msgMapperEx.countsByMsg(name);
|
result = msgMapperEx.countsByMsg(userInfo.getId(), name);
|
||||||
}
|
}
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||||
@@ -235,7 +235,8 @@ public class MsgService {
|
|||||||
User userInfo = userService.getCurrentUser();
|
User userInfo = userService.getCurrentUser();
|
||||||
if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
|
if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
|
||||||
MsgExample example = new MsgExample();
|
MsgExample example = new MsgExample();
|
||||||
example.createCriteria().andStatusEqualTo(status).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
example.createCriteria().andStatusEqualTo(status).andUserIdEqualTo(userInfo.getId())
|
||||||
|
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||||
List<Msg> list = msgMapper.selectByExample(example);
|
List<Msg> list = msgMapper.selectByExample(example);
|
||||||
if (null != list) {
|
if (null != list) {
|
||||||
for (Msg msg : list) {
|
for (Msg msg : list) {
|
||||||
|
|||||||
@@ -8,6 +8,9 @@
|
|||||||
FROM jsh_msg
|
FROM jsh_msg
|
||||||
WHERE 1=1
|
WHERE 1=1
|
||||||
and ifnull(delete_Flag,'0') !='1'
|
and ifnull(delete_Flag,'0') !='1'
|
||||||
|
<if test="userId != null">
|
||||||
|
and user_id = #{userId}
|
||||||
|
</if>
|
||||||
<if test="name != null">
|
<if test="name != null">
|
||||||
<bind name="bindName" value="'%'+name+'%'"/>
|
<bind name="bindName" value="'%'+name+'%'"/>
|
||||||
and msg_title like #{bindName}
|
and msg_title like #{bindName}
|
||||||
@@ -17,17 +20,22 @@
|
|||||||
limit #{offset},#{rows}
|
limit #{offset},#{rows}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="countsByMsg" resultType="java.lang.Long">
|
<select id="countsByMsg" resultType="java.lang.Long">
|
||||||
SELECT
|
SELECT
|
||||||
COUNT(id)
|
COUNT(id)
|
||||||
FROM jsh_msg
|
FROM jsh_msg
|
||||||
WHERE 1=1
|
WHERE 1=1
|
||||||
and ifnull(delete_Flag,'0') !='1'
|
and ifnull(delete_Flag,'0') !='1'
|
||||||
|
<if test="userId != null">
|
||||||
|
and user_id = #{userId}
|
||||||
|
</if>
|
||||||
<if test="name != null">
|
<if test="name != null">
|
||||||
<bind name="bindName" value="'%'+name+'%'"/>
|
<bind name="bindName" value="'%'+name+'%'"/>
|
||||||
and msg_title like #{bindName}
|
and msg_title like #{bindName}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<update id="batchDeleteMsgByIds">
|
<update id="batchDeleteMsgByIds">
|
||||||
update jsh_msg
|
update jsh_msg
|
||||||
set delete_Flag='1'
|
set delete_Flag='1'
|
||||||
@@ -39,29 +47,6 @@
|
|||||||
)
|
)
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<insert id="insertSelectiveByTask" parameterType="com.jsh.erp.datasource.entities.Msg">
|
|
||||||
insert into jsh_msg(msg_title,msg_content,create_time,type,status,tenant_id)
|
|
||||||
values (
|
|
||||||
#{msgTitle,jdbcType=VARCHAR},
|
|
||||||
#{msgContent,jdbcType=VARCHAR},
|
|
||||||
#{createTime,jdbcType=TIMESTAMP},
|
|
||||||
#{type,jdbcType=VARCHAR},
|
|
||||||
#{status,jdbcType=VARCHAR},
|
|
||||||
#{tenantId,jdbcType=BIGINT}
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<select id="checkIsNameExistByTask" resultType="java.lang.Integer">
|
|
||||||
SELECT
|
|
||||||
COUNT(id)
|
|
||||||
FROM jsh_msg
|
|
||||||
WHERE 1=1
|
|
||||||
and ifnull(delete_Flag,'0') !='1'
|
|
||||||
<if test="msgTitle != null">
|
|
||||||
and msg_title = #{msgTitle}
|
|
||||||
</if>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="getMsgCountByStatus" resultType="java.lang.Long">
|
<select id="getMsgCountByStatus" resultType="java.lang.Long">
|
||||||
SELECT
|
SELECT
|
||||||
COUNT(id)
|
COUNT(id)
|
||||||
@@ -71,5 +56,8 @@
|
|||||||
<if test="status != null">
|
<if test="status != null">
|
||||||
and status = #{status}
|
and status = #{status}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="userId != null">
|
||||||
|
and user_id = #{userId}
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user