Merge branch 'jihan_0920_护理服务、商城、积分兑换、在线问诊功能分支' into dev_gy_0920

# Conflicts:
#	xinelu-nurse-applet/src/main/java/com/xinelu/applet/mapper/chatrecord/ChatRecordMapper.java
#	xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/chatRecord/IChatRecordService.java
#	xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/chatRecord/impl/ChatRecordServiceImpl.java
#	xinelu-nurse-applet/src/main/resources/mapper/applet/chatrecord/ChatRecordMapper.xml
This commit is contained in:
mengkuiliang 2023-10-25 14:44:37 +08:00
commit dc1b4c681e
18 changed files with 122 additions and 34 deletions

View File

@ -40,6 +40,11 @@ public class MessageTemplate {
*/
private String msgType;
/**
* 消息类型(文字/图片)
*/
private String messageType;
/**
* 发送时间
* */

View File

@ -112,7 +112,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
// 过滤请求
.authorizeRequests()
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
.antMatchers("/login", "/register", "/captchaImage","/newapp/login/appLogin").anonymous()
.antMatchers("/login", "/register", "/captchaImage","/newapp/login/appLogin","/system/hospitalPerson/*").anonymous()
// 静态资源可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()

View File

@ -12,12 +12,14 @@ import com.xinelu.common.core.domain.R;
import com.xinelu.common.enums.BusinessType;
import com.xinelu.common.socket.WebSocketUtils;
import com.xinelu.manage.domain.chatRecord.ChatRecord;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import java.util.Objects;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
@ -33,6 +35,7 @@ import org.springframework.web.multipart.MultipartFile;
* @author wanghao
* @create 2023/9/26 0026
*/
@Api(tags = "消息控制器")
@RestController
@RequestMapping("/nurseApplet/chatRecord")
public class ChatRecordController extends BaseController {
@ -62,7 +65,8 @@ public class ChatRecordController extends BaseController {
@PostMapping("/sendMessage")
@Transactional
public AjaxResult sendMessage(@RequestBody ChatRecordDTO chatRecordDTO) {
if (chatRecordService.insertChatRecord(chatRecordDTO) > 0) {
chatRecordDTO.setMessageCategory("3");
if (chatRecordService.insertChatRecord(chatRecordDTO) > 0) {
// 判断接收人是否在线
if (WebSocketUtils.clients.get(chatRecordDTO.getRecipientId().toString()) == null) {
return AjaxResult.success();
@ -96,4 +100,13 @@ public class ChatRecordController extends BaseController {
}
return R.ok(chatRecordService.getMegVoList(messageDto));
}
@ApiOperation("删除消息")
@GetMapping("/deleteMegs")
public R<String> deleteMegs(@RequestBody List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return R.fail("请选择要删除的消息!");
}
return chatRecordService.deleteMegs(ids) > 0 ? R.ok("删除成功") : R.fail("删除失败");
}
}

View File

@ -22,6 +22,9 @@ public class ChatRecordDTO extends BaseEntity implements Serializable {
private static final long serialVersionUID = -3911806583514536587L;
@ApiModelProperty("消息类别 1通知公告2健康推送3在线咨询 4消息通知")
private String messageCategory;
/**
* 聊天记录业务主键(问诊表id)
*/
@ -86,11 +89,6 @@ public class ChatRecordDTO extends BaseEntity implements Serializable {
*/
private String title;
/**
* 消息类别 1通知公告2健康推送3在线咨询 4消息通知
*/
private String messageCategory;
@ApiModelProperty("通知适用人群0全部人群")
private String crowds;

View File

@ -25,7 +25,7 @@ public interface ChatRecordMapper {
* @param id 图文咨询-聊天记录主键
* @return 图文咨询-聊天记录
*/
public ChatRecord selectChatRecordById(Long id);
ChatRecord selectChatRecordById(Long id);
/**
* 查询图文咨询-聊天记录列表
@ -33,7 +33,7 @@ public interface ChatRecordMapper {
* @param chatRecord 图文咨询-聊天记录
* @return 图文咨询-聊天记录集合
*/
public List<ChatRecord> selectChatRecordList(ChatRecord chatRecord);
List<ChatRecord> selectChatRecordList(ChatRecord chatRecord);
/**
* 新增图文咨询-聊天记录
@ -41,7 +41,7 @@ public interface ChatRecordMapper {
* @param chatRecord 图文咨询-聊天记录
* @return 结果
*/
public int insertChatRecord(ChatRecord chatRecord);
int insertChatRecord(ChatRecord chatRecord);
/**
* 修改图文咨询-聊天记录
@ -49,7 +49,7 @@ public interface ChatRecordMapper {
* @param chatRecord 图文咨询-聊天记录
* @return 结果
*/
public int updateChatRecord(ChatRecord chatRecord);
int updateChatRecord(ChatRecord chatRecord);
/**
* 删除图文咨询-聊天记录
@ -57,7 +57,7 @@ public interface ChatRecordMapper {
* @param id 图文咨询-聊天记录主键
* @return 结果
*/
public int deleteChatRecordById(Long id);
int deleteChatRecordById(Long id);
/**
* 批量删除图文咨询-聊天记录
@ -65,10 +65,12 @@ public interface ChatRecordMapper {
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteChatRecordByIds(Long[] ids);
int deleteChatRecordByIds(Long[] ids);
Integer updateReadStatus(MarkReadDto markReadDto);
int deleteMegs(@Param("ids") List<Long> ids);
/**
* @Author mengkuiliang
* @Description 查询健康知识推送列表
@ -104,4 +106,5 @@ public interface ChatRecordMapper {
* @return void
**/
void updateChatRecordOfNo(ChatRecord entity);
}

View File

@ -1,5 +1,6 @@
package com.xinelu.applet.mapper.newapp;
import com.xinelu.applet.vo.newapp.LoginStatusVo;
import org.apache.ibatis.annotations.Param;
public interface NewAppLoginMapper {
@ -10,5 +11,5 @@ public interface NewAppLoginMapper {
* @param personPassword
* @return
*/
int login(@Param("personAccount") String personAccount, @Param("personPassword") String personPassword);
LoginStatusVo login(@Param("personAccount") String personAccount, @Param("personPassword") String personPassword);
}

View File

@ -26,7 +26,7 @@ public interface IChatRecordService {
* @param id 图文咨询-聊天记录主键
* @return 图文咨询-聊天记录
*/
public ChatRecord selectChatRecordById(Long id);
ChatRecord selectChatRecordById(Long id);
/**
* 查询图文咨询-聊天记录列表
@ -34,7 +34,7 @@ public interface IChatRecordService {
* @param chatRecord 图文咨询-聊天记录
* @return 图文咨询-聊天记录集合
*/
public List<ChatRecord> selectChatRecordList(ChatRecord chatRecord);
List<ChatRecord> selectChatRecordList(ChatRecord chatRecord);
/**
* 新增图文咨询-聊天记录
@ -42,7 +42,7 @@ public interface IChatRecordService {
* @param chatRecordDTO 图文咨询-聊天记录
* @return 结果
*/
public int insertChatRecord(ChatRecordDTO chatRecordDTO);
int insertChatRecord(ChatRecordDTO chatRecordDTO);
Boolean sendMessage(ChatRecordDTO chatRecordDTO);
@ -52,7 +52,7 @@ public interface IChatRecordService {
* @param chatRecord 图文咨询-聊天记录
* @return 结果
*/
public int updateChatRecord(ChatRecord chatRecord);
int updateChatRecord(ChatRecord chatRecord);
/**
* 批量删除图文咨询-聊天记录
@ -60,7 +60,7 @@ public interface IChatRecordService {
* @param ids 需要删除的图文咨询-聊天记录主键集合
* @return 结果
*/
public int deleteChatRecordByIds(Long[] ids);
int deleteChatRecordByIds(Long[] ids);
/**
* 删除图文咨询-聊天记录信息
@ -68,7 +68,7 @@ public interface IChatRecordService {
* @param id 图文咨询-聊天记录主键
* @return 结果
*/
public int deleteChatRecordById(Long id);
int deleteChatRecordById(Long id);
/**
@ -77,10 +77,13 @@ public interface IChatRecordService {
* @param multipartFile,consultationId 文件,问诊id
* @return 结果
*/
public AjaxResult uploadChatRecordFile(MultipartFile multipartFile, Long consultationId) throws IOException, InvalidExtensionException;
AjaxResult uploadChatRecordFile(MultipartFile multipartFile, Long consultationId) throws IOException, InvalidExtensionException;
List<MessageCenterVo> getMegVoList(MessageSearchDto messageDto);
Integer deleteMegs(List<Long> ids);
/**
* @Author mengkuiliang
* @Description 查询健康知识推送列表
@ -116,4 +119,5 @@ public interface IChatRecordService {
* @return void
**/
void updateChatRecordOfNo(ChatRecord entity);
}

View File

@ -10,7 +10,6 @@ import com.xinelu.applet.vo.chatrecord.MessageCenterVo;
import com.xinelu.applet.vo.chatrecord.MessageVo;
import com.xinelu.common.config.XinELuConfig;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.domain.R;
import com.xinelu.common.core.dto.MessageTemplate;
import com.xinelu.common.enums.MessageContentType;
import com.xinelu.common.exception.ServiceException;
@ -24,6 +23,7 @@ import com.xinelu.common.utils.uuid.IdUtils;
import com.xinelu.manage.domain.chatRecord.ChatRecord;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -86,6 +86,9 @@ public class ChatRecordServiceImpl implements IChatRecordService {
ChatRecord record = new ChatRecord();
BeanUtils.copyBeanProp(record, chatRecord);
record.setMessageNo(IdUtils.fastSimpleUUID());
record.setReadStatus("0");
record.setSendTime(new Date());
record.setDelFlag(0);
return chatRecordMapper.insertChatRecord(record);
}
@ -97,6 +100,7 @@ public class ChatRecordServiceImpl implements IChatRecordService {
msg.setFromKey(chatRecord.getSenderId().toString());
msg.setToKey(chatRecord.getRecipientId().toString());
msg.setMsgType(MessageContentType.CHAT.name());
msg.setMessageType(chatRecord.getMessageType());
msg.setSendTime(chatRecord.getSendTime());
return WebSocketUtils.sendMessage(chatRecord.getRecipientId().toString(), msg);
}
@ -220,6 +224,10 @@ public class ChatRecordServiceImpl implements IChatRecordService {
return messageCenterVos;
}
@Override public Integer deleteMegs(List<Long> ids) {
return chatRecordMapper.deleteMegs(ids);
}
/**
* @Author mengkuiliang
* @Description 查询健康知识推送列表
@ -274,4 +282,5 @@ public class ChatRecordServiceImpl implements IChatRecordService {
public void updateChatRecordOfNo(ChatRecord entity) {
chatRecordMapper.updateChatRecordOfNo(entity);
}
}

View File

@ -2,9 +2,11 @@ package com.xinelu.applet.service.newapp.impl;
import com.xinelu.applet.mapper.newapp.NewAppLoginMapper;
import com.xinelu.applet.service.newapp.NewAppLoginService;
import com.xinelu.applet.vo.newapp.LoginStatusVo;
import com.xinelu.common.core.domain.AjaxResult;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
@Service
public class NewAppLoginServiceImpl implements NewAppLoginService {
@ -20,9 +22,13 @@ public class NewAppLoginServiceImpl implements NewAppLoginService {
*/
@Override
public AjaxResult login(String personAccount, String personPassword) {
int count = newAppLoginMapper.login(personAccount, personPassword);
if (count>0){
return AjaxResult.success("登录成功!");
LoginStatusVo loginStatusVo = newAppLoginMapper.login(personAccount, personPassword);
HashMap<String, String> hashMap = new HashMap<>();
if (loginStatusVo.getCount()>0){
hashMap.put("status",loginStatusVo.getStatus());
hashMap.put("id",loginStatusVo.getId()+"");
hashMap.put("str","登录成功!");
return AjaxResult.success(hashMap);
}else {
return AjaxResult.error("账号或密码错误!");
}

View File

@ -0,0 +1,14 @@
package com.xinelu.applet.vo.newapp;
import lombok.Data;
import java.io.Serializable;
@Data
public class LoginStatusVo implements Serializable {
private Integer count;
private Integer id;
//1家医医生 2泉医医生 3专病医生
private String status;
}

View File

@ -13,6 +13,7 @@ import java.io.Serializable;
@Data
public class AppLoginVO implements Serializable {
private static final long serialVersionUID = 1820130502268738492L;
/**
* 返回提示信息
*/
@ -42,4 +43,4 @@ public class AppLoginVO implements Serializable {
* 用户手机号
*/
private String phone;
}
}

View File

@ -68,7 +68,7 @@
select
<include refid="Message_Vo_List"/>
from chat_record
where del_flag = '0' and (recipient_id = #{recipientId} or sender_id = #{recipientId})
where del_flag = 0 and (recipient_id = #{recipientId} or sender_id = #{recipientId})
<if test="messageCategory != null">
and message_category = #{messageCategory}
</if>
@ -91,7 +91,7 @@
recipient_id,
recipient_name
from chat_record
where del_flag = '0'
where del_flag = 0
and message_category = '3'
and ((sender_id = #{bindingNo} and recipient_id = #{doctorNo})
or (sender_id = #{doctorNo} and recipient_id = #{bindingNo}))
@ -100,7 +100,7 @@
<select id="selectChatRecordList" parameterType="ChatRecord" resultMap="ChatRecordResult">
<include refid="selectChatRecordVo"/>
where del_flag = '0'
where del_flag = 0
and consultation_id = #{consultationId}
and (
(sender_id = #{senderId} and recipient_id = #{recipientId})
@ -281,7 +281,7 @@
<if test="crowds != null">crowds =
#{crowds},
</if>
<if test="crowdsName != null">crowds_name
<if test="crowdsName != null">crowds_name =
#{crowdsName},
</if>
<if test="senderId != null">sender_id =
@ -346,7 +346,7 @@
read_time = #{readTime},
</if>
</trim>
where del_flag = '0' and read_status = '0' and recipient_id = #{recipientId}
where del_flag = 0 and read_status = '0' and recipient_id = #{recipientId}
</update>
<!-- 更新通知 -->
@ -392,4 +392,17 @@
<delete id="del">
delete from chat_record where message_no = #{messageNo}
</delete>
<update id="deleteMegs">
update chat_record set del_flag = 1
<where>
<if test="ids != null">
id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
</update>
</mapper>

View File

@ -69,6 +69,8 @@
ci.doctor_name,
ci.problem_description,
ci.create_time,
(SELECT content FROM chat_record cr WHERE cr.consultation_id = ci.id ORDER BY create_time DESC LIMIT 1) as content,
(SELECT message_type FROM chat_record cr WHERE cr.consultation_id = ci.id ORDER BY create_time DESC LIMIT 1) as messageType,
(SELECT COUNT(cr.id) FROM chat_record cr WHERE cr.consultation_id = ci.id AND read_status = '0'
<if test="patientId != null ">
and sender_id= ci.doctor_id

View File

@ -4,9 +4,9 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xinelu.applet.mapper.newapp.NewAppLoginMapper">
<select id="login" resultType="int">
<select id="login" resultType="com.xinelu.applet.vo.newapp.LoginStatusVo">
select
count(1)
count(1) count, status,id
from hospital_person_info
<where>
<if test="personAccount != null">

View File

@ -81,7 +81,7 @@ public class HospitalPersonInfoController extends BaseController {
* 获取健康咨询-科室人员信息详细信息
*/
@ApiOperation("获取健康咨询-科室人员信息详细信息")
@PreAuthorize("@ss.hasPermi('system:hospitalPerson:query')")
//@PreAuthorize("@ss.hasPermi('system:hospitalPerson:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(hospitalPersonInfoService.selectHospitalPersonInfoById(id));

View File

@ -85,6 +85,8 @@ public class HospitalPersonInfo extends BaseDomain implements Serializable {
@NotBlank(message = "科室人员地址不能为空!", groups = {Insert.class, Update.class})
@Length(max = 300, message = "科室人员地址不能超过300位", groups = {Insert.class, Update.class})
private String personAddress;
/**性别*/
private String sex;
/**
* 身份证号

View File

@ -118,6 +118,15 @@ public class ConsultationInfoVO extends BaseEntity implements Serializable {
*/
private String medicalRecord;
/**
* 最近一次内容
*/
private String content;
/**
* 内容类型
*/
private String messageType;
/**
* 是否删除标识01
*/
@ -152,6 +161,8 @@ public class ConsultationInfoVO extends BaseEntity implements Serializable {
.append("medicalRecord", getMedicalRecord())
.append("delFlag", getDelFlag())
.append("messageCount", getMessageCount())
.append("content", getContent())
.append("messageType", getMessageType())
.toString();
}
}

View File

@ -35,12 +35,15 @@
<result property="personName" column="person_name"/>
<result property="personPhone" column="person_phone"/>
<result property="personAddress" column="person_address"/>
<result property="sex" column="sex"/>
<result property="cardNo" column="card_no"/>
<result property="academicTitle" column="academic_title"/>
<result property="consultingFee" column="consulting_fee"/>
<result property="personIntroduce" column="person_introduce"/>
<result property="personSort" column="person_sort"/>
<result property="personPictureUrl" column="person_picture_url"/>
<result property="personAccount" column="person_account"/>
<result property="personPassword" column="person_password"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
@ -206,12 +209,15 @@
hpi.person_name,
hpi.person_phone,
hpi.person_address,
hpi.sex,
hpi.card_no,
hpi.academic_title,
hpi.consulting_fee,
hpi.person_introduce,
hpi.person_sort,
hpi.person_picture_url,
hpi.person_account,
hpi.person_password,
hpi.create_by,
hpi.create_time,
hpi.update_by,