调整接口
This commit is contained in:
parent
af814fb1e1
commit
34bc27681d
@ -1,21 +1,21 @@
|
|||||||
package com.stdiet.custom.service.impl;
|
package com.stdiet.custom.service.impl;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.stdiet.common.utils.DateUtils;
|
import com.stdiet.common.utils.DateUtils;
|
||||||
import com.stdiet.common.utils.StringUtils;
|
import com.stdiet.common.utils.StringUtils;
|
||||||
import com.stdiet.custom.domain.*;
|
import com.stdiet.custom.domain.*;
|
||||||
import com.stdiet.custom.domain.entityEnum.MessageNoticeEnum;
|
import com.stdiet.custom.domain.entityEnum.MessageNoticeEnum;
|
||||||
import com.stdiet.custom.dto.response.MessageNoticeResponse;
|
import com.stdiet.custom.dto.response.MessageNoticeResponse;
|
||||||
|
import com.stdiet.custom.mapper.SysMessageNoticeMapper;
|
||||||
import com.stdiet.custom.service.ISysCustomerService;
|
import com.stdiet.custom.service.ISysCustomerService;
|
||||||
|
import com.stdiet.custom.service.ISysMessageNoticeService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.stdiet.custom.mapper.SysMessageNoticeMapper;
|
|
||||||
import com.stdiet.custom.service.ISysMessageNoticeService;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 客户消息通知Service业务层处理
|
* 客户消息通知Service业务层处理
|
||||||
@ -24,8 +24,7 @@ import com.stdiet.custom.service.ISysMessageNoticeService;
|
|||||||
* @date 2021-04-26
|
* @date 2021-04-26
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysMessageNoticeServiceImpl implements ISysMessageNoticeService
|
public class SysMessageNoticeServiceImpl implements ISysMessageNoticeService {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysMessageNoticeMapper sysMessageNoticeMapper;
|
private SysMessageNoticeMapper sysMessageNoticeMapper;
|
||||||
|
|
||||||
@ -39,8 +38,7 @@ public class SysMessageNoticeServiceImpl implements ISysMessageNoticeService
|
|||||||
* @return 客户消息通知
|
* @return 客户消息通知
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysMessageNotice selectSysMessageNoticeById(Long id)
|
public SysMessageNotice selectSysMessageNoticeById(Long id) {
|
||||||
{
|
|
||||||
return sysMessageNoticeMapper.selectSysMessageNoticeById(id);
|
return sysMessageNoticeMapper.selectSysMessageNoticeById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,8 +49,7 @@ public class SysMessageNoticeServiceImpl implements ISysMessageNoticeService
|
|||||||
* @return 客户消息通知
|
* @return 客户消息通知
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysMessageNotice> selectSysMessageNoticeList(SysMessageNotice sysMessageNotice)
|
public List<SysMessageNotice> selectSysMessageNoticeList(SysMessageNotice sysMessageNotice) {
|
||||||
{
|
|
||||||
return sysMessageNoticeMapper.selectSysMessageNoticeList(sysMessageNotice);
|
return sysMessageNoticeMapper.selectSysMessageNoticeList(sysMessageNotice);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,8 +60,7 @@ public class SysMessageNoticeServiceImpl implements ISysMessageNoticeService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertSysMessageNotice(SysMessageNotice sysMessageNotice)
|
public int insertSysMessageNotice(SysMessageNotice sysMessageNotice) {
|
||||||
{
|
|
||||||
sysMessageNotice.setCreateTime(DateUtils.getNowDate());
|
sysMessageNotice.setCreateTime(DateUtils.getNowDate());
|
||||||
return sysMessageNoticeMapper.insertSysMessageNotice(sysMessageNotice);
|
return sysMessageNoticeMapper.insertSysMessageNotice(sysMessageNotice);
|
||||||
}
|
}
|
||||||
@ -76,8 +72,7 @@ public class SysMessageNoticeServiceImpl implements ISysMessageNoticeService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateSysMessageNotice(SysMessageNotice sysMessageNotice)
|
public int updateSysMessageNotice(SysMessageNotice sysMessageNotice) {
|
||||||
{
|
|
||||||
sysMessageNotice.setUpdateTime(DateUtils.getNowDate());
|
sysMessageNotice.setUpdateTime(DateUtils.getNowDate());
|
||||||
return sysMessageNoticeMapper.updateSysMessageNotice(sysMessageNotice);
|
return sysMessageNoticeMapper.updateSysMessageNotice(sysMessageNotice);
|
||||||
}
|
}
|
||||||
@ -89,8 +84,7 @@ public class SysMessageNoticeServiceImpl implements ISysMessageNoticeService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteSysMessageNoticeByIds(Long[] ids)
|
public int deleteSysMessageNoticeByIds(Long[] ids) {
|
||||||
{
|
|
||||||
return sysMessageNoticeMapper.deleteSysMessageNoticeByIds(ids);
|
return sysMessageNoticeMapper.deleteSysMessageNoticeByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,13 +95,13 @@ public class SysMessageNoticeServiceImpl implements ISysMessageNoticeService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteSysMessageNoticeById(Long id)
|
public int deleteSysMessageNoticeById(Long id) {
|
||||||
{
|
|
||||||
return sysMessageNoticeMapper.deleteSysMessageNoticeById(id);
|
return sysMessageNoticeMapper.deleteSysMessageNoticeById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据客户ID查询客户信息(包含私有信息以及公共消息)
|
* 根据客户ID查询客户信息(包含私有信息以及公共消息)
|
||||||
|
*
|
||||||
* @param sysMessageNotice
|
* @param sysMessageNotice
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -124,6 +118,7 @@ public class SysMessageNoticeServiceImpl implements ISysMessageNoticeService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 消息发送
|
* 消息发送
|
||||||
|
*
|
||||||
* @param messageNoticeEnum
|
* @param messageNoticeEnum
|
||||||
* @param sysMessageNotice
|
* @param sysMessageNotice
|
||||||
* @return
|
* @return
|
||||||
@ -137,6 +132,7 @@ public class SysMessageNoticeServiceImpl implements ISysMessageNoticeService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据客户ID查询客户消息数量
|
* 根据客户ID查询客户消息数量
|
||||||
|
*
|
||||||
* @param sysMessageNotice
|
* @param sysMessageNotice
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -147,6 +143,7 @@ public class SysMessageNoticeServiceImpl implements ISysMessageNoticeService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送打卡点评消息
|
* 发送打卡点评消息
|
||||||
|
*
|
||||||
* @param sysWxUserLog
|
* @param sysWxUserLog
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@ -171,6 +168,7 @@ public class SysMessageNoticeServiceImpl implements ISysMessageNoticeService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送打卡动态点赞消息
|
* 发送打卡动态点赞消息
|
||||||
|
*
|
||||||
* @param sysWxUserLog
|
* @param sysWxUserLog
|
||||||
* @param openId 点赞用户openid
|
* @param openId 点赞用户openid
|
||||||
*/
|
*/
|
||||||
@ -261,6 +259,7 @@ public class SysMessageNoticeServiceImpl implements ISysMessageNoticeService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据客户ID查询打卡点评消息以及未读消息数量(包含点评营养师信息、客户信息、点评内容)
|
* 根据客户ID查询打卡点评消息以及未读消息数量(包含点评营养师信息、客户信息、点评内容)
|
||||||
|
*
|
||||||
* @param cusId 客户ID
|
* @param cusId 客户ID
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -273,6 +272,13 @@ public class SysMessageNoticeServiceImpl implements ISysMessageNoticeService
|
|||||||
unReadPunchMessageNum = sysMessageNoticeMapper.getUnReadPunchMessageNum(cusId);
|
unReadPunchMessageNum = sysMessageNoticeMapper.getUnReadPunchMessageNum(cusId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (Map<String, Object> obj : punchMessageList) {
|
||||||
|
String dietAvatar = ((String) obj.get("dietAvatar"));
|
||||||
|
if (!dietAvatar.startsWith("http")) {
|
||||||
|
obj.put("dietAvatar", "https://manage.stdiet.cn/prod-api" + dietAvatar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Map<String, Object> result = new HashMap<>();
|
Map<String, Object> result = new HashMap<>();
|
||||||
result.put("data", punchMessageList);
|
result.put("data", punchMessageList);
|
||||||
result.put("unReadNum", unReadPunchMessageNum);
|
result.put("unReadNum", unReadPunchMessageNum);
|
||||||
@ -281,6 +287,7 @@ public class SysMessageNoticeServiceImpl implements ISysMessageNoticeService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据客户ID查询点赞消息列表
|
* 根据客户ID查询点赞消息列表
|
||||||
|
*
|
||||||
* @param cusId 客户ID
|
* @param cusId 客户ID
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -300,6 +307,7 @@ public class SysMessageNoticeServiceImpl implements ISysMessageNoticeService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据客户ID查询服务消息(食谱发送消息、执行反馈回复消息)
|
* 根据客户ID查询服务消息(食谱发送消息、执行反馈回复消息)
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@ -175,7 +175,7 @@
|
|||||||
<!-- 根据客户ID查询点赞消息 -->
|
<!-- 根据客户ID查询点赞消息 -->
|
||||||
<select id="getPunchDynamicThumbsUpMessage" parameterType="Long" resultType="Map">
|
<select id="getPunchDynamicThumbsUpMessage" parameterType="Long" resultType="Map">
|
||||||
select message.id,message.read_type as readType, message.message_type as messageType,DATE_FORMAT(message.create_time,'%Y-%m-%d %H:%i') as createTime, log.id as punchId, log.health_manifesto as healthManifesto,
|
select message.id,message.read_type as readType, message.message_type as messageType,DATE_FORMAT(message.create_time,'%Y-%m-%d %H:%i') as createTime, log.id as punchId, log.health_manifesto as healthManifesto,
|
||||||
thumbsUpUser.nick_name as thumbsUpUserNickName,thumbsUpUser.avatar_url as thumbsUpUserAvatar, punchUser.nick_name as cusNickName, punchUser.avatar_url as cusAvatarUrl
|
thumbsUpUser.nick_name as thumbsUpUserNickName,thumbsUpUser.avatar_url as thumbsUpUserAvatar, punchUser.nick_name as cusNickName, punchUser.avatar_url as cusAvatar
|
||||||
from
|
from
|
||||||
(
|
(
|
||||||
select id,message_customer,message_type,message_title,message_content,message_key,read_type,create_time from sys_message_notice
|
select id,message_customer,message_type,message_title,message_content,message_key,read_type,create_time from sys_message_notice
|
||||||
|
Loading…
x
Reference in New Issue
Block a user