消息通知

This commit is contained in:
gongjiale 2024-10-16 22:36:01 +08:00
parent 43bc1fb506
commit 1c6e360d91
6 changed files with 67 additions and 10 deletions

View File

@ -20,6 +20,8 @@ public class SendMessageDTO extends BaseEntity {
* 接收人 * 接收人
*/ */
private String readList; private String readList;
private Boolean isSendPhone;
/** /**
* 发送内容 * 发送内容
*/ */
@ -29,6 +31,8 @@ public class SendMessageDTO extends BaseEntity {
private List<String> readerList; private List<String> readerList;
private List<String> phoneList;
public String getSender() { public String getSender() {
return sender; return sender;
} }
@ -73,6 +77,22 @@ public class SendMessageDTO extends BaseEntity {
return sendType; return sendType;
} }
public Boolean getIsSendPhone() {
return isSendPhone;
}
public void setIsSendPhone(Boolean sendPhone) {
isSendPhone = sendPhone;
}
public List<String> getPhoneList() {
return phoneList;
}
public void setPhoneList(List<String> phoneList) {
this.phoneList = phoneList;
}
public void setSendType(String sendType) { public void setSendType(String sendType) {
this.sendType = sendType; this.sendType = sendType;
} }

View File

@ -31,7 +31,15 @@ public class SysSendInfoServiceImpl implements ISysSendInfoService {
readList.forEach(reader -> { readList.forEach(reader -> {
sysSendInfoMapper.sendMessage(sendMessageDTO,reader); sysSendInfoMapper.sendMessage(sendMessageDTO,reader);
}); });
//todo 调用发送短信接口 if(sendMessageDTO.getIsSendPhone() !=null && sendMessageDTO.getIsSendPhone()){//发送短信
List<String> phoneList= sendMessageDTO.getPhoneList();
String phone = String.join(",", phoneList);
String msg=sendMessageDTO.getSendText();
String dwdm="SGJT-山港集团";
//todo 调用发送短信接口
}
return 1; return 1;

View File

@ -41,7 +41,7 @@
</select> </select>
<update id="readMsg"> <update id="readMsg">
update sys_send_info set read_time=now(),is_read='1' update sys_send_info set read_time=sysdate,is_read='1'
where id=#{id} where id=#{id}
</update> </update>

View File

@ -73,3 +73,10 @@ export function readMsg(id) {
method: 'get', method: 'get',
}) })
} }
//查看消息详情
export function getMsgDetail(id) {
return request({
url: '/sendInfo/getMsgDetail/'+id,
method: 'get',
})
}

View File

@ -11,8 +11,13 @@
<el-input type="textarea" :rows="2" placeholder="请输入消息内容..." v-model="shareContent"> <el-input type="textarea" :rows="2" placeholder="请输入消息内容..." v-model="shareContent">
</el-input> </el-input>
</div> </div>
<div> <el-button class="agreeButton" @click="sendMsg">发送</el-button></div>
<user-select v-if="isShowUser" :isShowUser="isShowUser" @closeUser="closeUser" @chooseUser="chooseUser" /> <user-select v-if="isShowUser" :isShowUser="isShowUser" @closeUser="closeUser" @chooseUser="chooseUser" />
<div style="margin-left:5px;height: 50px;"> <el-checkbox v-model="isSendPhone">同时发送短信</el-checkbox></div>
<div style="margin-left:5px;height: 50px;"> <el-button class="agreeButton" @click="sendMsg">发送</el-button></div>
</el-dialog> </el-dialog>
</template> </template>
@ -54,8 +59,10 @@ export default {
}, },
data() { data() {
return { return {
isSendPhone:false,
isShowUser: false, isShowUser: false,
userList: [], userList: [],
phoneList:[],
shareContent: "", shareContent: "",
openConfig1: false, openConfig1: false,
} }
@ -63,10 +70,15 @@ export default {
methods: { methods: {
sendMsg() { sendMsg() {
let readList = [] let readList = []
this.phoneList=[]
this.userList.forEach(element => { this.userList.forEach(element => {
readList.push(element.userName) readList.push(element.userName)
this.phoneList.push(element.phonenumber)
}); });
let params = { let params = {
phoneList :this.phoneList,
isSendPhone:this.isSendPhone,
//readList: JSON.stringify(readList), //readList: JSON.stringify(readList),
readerList: readList, readerList: readList,
sendText: this.shareContent, sendText: this.shareContent,

View File

@ -1,4 +1,3 @@
<template> <template>
<el-dialog title="选择联系人" :visible.sync="openConfig1" :before-close="handleClose"> <el-dialog title="选择联系人" :visible.sync="openConfig1" :before-close="handleClose">
<el-form :model="userParams" size="small" :inline="true" label-width="100px"> <el-form :model="userParams" size="small" :inline="true" label-width="100px">
@ -8,6 +7,9 @@
<el-form-item label="用户昵称" prop="nickName"> <el-form-item label="用户昵称" prop="nickName">
<el-input v-model="userParams.nickName" placeholder="请输入用户昵称" /> <el-input v-model="userParams.nickName" placeholder="请输入用户昵称" />
</el-form-item> </el-form-item>
<el-form-item>
<el-button class="agreeButton" @click="quetyList()">搜索</el-button>
</el-form-item>
</el-form> </el-form>
<el-table :data="userList" @selection-change="handleSelectionChange"> <el-table :data="userList" @selection-change="handleSelectionChange">
@ -17,12 +19,14 @@
<el-table-column label="企业" align="center" prop="deptName" /> <el-table-column label="企业" align="center" prop="deptName" />
<el-table-column label="用户手机号" align="center" prop="phonenumber" /> <el-table-column label="用户手机号" align="center" prop="phonenumber" />
</el-table> </el-table>
<pagination v-show="total > 0" :total="total" :page.sync="userParams.pageNum" :limit.sync="userParams.pageSize" <pagination style="margin-bottom: 10px;" v-show="total > 0" :total="total" :page.sync="userParams.pageNum"
@pagination="getList" /> :limit.sync="userParams.pageSize" @pagination="getList" />
<div> <el-button class="agreeButton" @click="confirm">确定</el-button></div> <div style="height: 80px; margin: 10px; display: flex; justify-content: center; align-items: center;">
<el-button class="agreeButton" @click="confirm">确定</el-button>
</div>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { listUser } from "@/api/system/user"; import { listUser } from "@/api/system/user";
export default { export default {
@ -83,6 +87,13 @@ export default {
handleSelectionChange(val) { handleSelectionChange(val) {
this.selectList = val; this.selectList = val;
}, },
quetyList() {
listUser(this.userParams).then(response => {
this.userList = response.rows;
this.total = response.total;
}
);
},
getList() { getList() {
listUser(this.addDateRange(this.userParams)).then(response => { listUser(this.addDateRange(this.userParams)).then(response => {
this.userList = response.rows; this.userList = response.rows;
@ -171,5 +182,4 @@ export default {
border-color: #65a5f9; border-color: #65a5f9;
color: #FFF; color: #FFF;
} }
</style> </style>