'123'
This commit is contained in:
parent
8489c7ab4e
commit
687c5ac55d
|
@ -23,7 +23,7 @@ import static com.ruoyi.common.utils.PageUtils.startPage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName QuoteController
|
* @ClassName QuoteController
|
||||||
* @Description TODO
|
* @Description 报价单Controller
|
||||||
* @Author JIAL
|
* @Author JIAL
|
||||||
* @Date 2024/3/5 12:57
|
* @Date 2024/3/5 12:57
|
||||||
* @Version 1.0
|
* @Version 1.0
|
||||||
|
|
|
@ -5,7 +5,7 @@ package com.ruoyi.web.controller.system;
|
||||||
* @package: com.ruoyi.web.controller.system
|
* @package: com.ruoyi.web.controller.system
|
||||||
* @className: ThirdPartLoginController
|
* @className: ThirdPartLoginController
|
||||||
* @author: sean
|
* @author: sean
|
||||||
* @description: TODO
|
* @description: 免密登录Controller
|
||||||
* @date: 2023/2/20 14:47
|
* @date: 2023/2/20 14:47
|
||||||
* @version: 1.0
|
* @version: 1.0
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -8,6 +8,7 @@ import java.util.stream.Collectors;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.ruoyi.common.constant.WebsocketConst;
|
import com.ruoyi.common.constant.WebsocketConst;
|
||||||
import com.ruoyi.framework.websocket.WebSocket;
|
import com.ruoyi.framework.websocket.WebSocket;
|
||||||
|
import com.ruoyi.system.domain.NoticeUserSelect;
|
||||||
import com.ruoyi.system.domain.SysNoticeUser;
|
import com.ruoyi.system.domain.SysNoticeUser;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
@ -79,7 +80,7 @@ public class SysNoticeController extends BaseController
|
||||||
Long userId = getLoginUser().getUserId();//当前登陆者
|
Long userId = getLoginUser().getUserId();//当前登陆者
|
||||||
insertNoticeUser(userId,notice,noticeService,null);
|
insertNoticeUser(userId,notice,noticeService,null);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
e.printStackTrace();
|
return error("系统异常");
|
||||||
}
|
}
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
@ -131,6 +132,14 @@ public class SysNoticeController extends BaseController
|
||||||
@GetMapping(value = "navbarNotice/{noticeId}")
|
@GetMapping(value = "navbarNotice/{noticeId}")
|
||||||
public AjaxResult getNavbarNoticeInfo(@PathVariable Long noticeId)
|
public AjaxResult getNavbarNoticeInfo(@PathVariable Long noticeId)
|
||||||
{
|
{
|
||||||
|
try{
|
||||||
|
//更新消息表 isRead字段 设置 为 1-已读
|
||||||
|
SysNotice sysNotice = noticeService.selectNoticeById(noticeId);
|
||||||
|
sysNotice.setIsRead("1");
|
||||||
|
noticeService.updateNotice(sysNotice);
|
||||||
|
}catch(Exception e){
|
||||||
|
return error("系统异常");
|
||||||
|
}
|
||||||
return success(noticeService.selectNoticeById(noticeId));
|
return success(noticeService.selectNoticeById(noticeId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,4 +196,16 @@ public class SysNoticeController extends BaseController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取对应消息对象的 人员
|
||||||
|
* @param noticeUserSelect
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/listNoticeEventUser")
|
||||||
|
public List<NoticeUserSelect> listNoticeEventUser(NoticeUserSelect noticeUserSelect)
|
||||||
|
{
|
||||||
|
List<NoticeUserSelect> list = noticeService.listNoticeEventUser(noticeUserSelect);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName QuoteMapper
|
* @ClassName QuoteMapper
|
||||||
* @Description TODO
|
* @Description 报价单Mapper
|
||||||
* @Author JIAL
|
* @Author JIAL
|
||||||
* @Date 2024/3/5 16:07
|
* @Date 2024/3/5 16:07
|
||||||
* @Version 1.0
|
* @Version 1.0
|
||||||
|
|
|
@ -8,7 +8,7 @@ import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName QuoteService
|
* @ClassName QuoteService
|
||||||
* @Description TODO
|
* @Description 报价单Service
|
||||||
* @Author JIAL
|
* @Author JIAL
|
||||||
* @Date 2024/3/5 16:06
|
* @Date 2024/3/5 16:06
|
||||||
* @Version 1.0
|
* @Version 1.0
|
||||||
|
|
|
@ -12,7 +12,7 @@ import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName QuoteServiceImpl
|
* @ClassName QuoteServiceImpl
|
||||||
* @Description TODO
|
* @Description 报价单ServiceImpl
|
||||||
* @Author JIAL
|
* @Author JIAL
|
||||||
* @Date 2024/3/5 16:07
|
* @Date 2024/3/5 16:07
|
||||||
* @Version 1.0
|
* @Version 1.0
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
|
public class NoticeUserSelect {
|
||||||
|
private String noticeEventType;
|
||||||
|
private String userName;
|
||||||
|
private String nickName;
|
||||||
|
|
||||||
|
public String getNoticeEventType() {
|
||||||
|
return noticeEventType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNoticeEventType(String noticeEventType) {
|
||||||
|
this.noticeEventType = noticeEventType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserName() {
|
||||||
|
return userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserName(String userName) {
|
||||||
|
this.userName = userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNickName() {
|
||||||
|
return nickName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNickName(String nickName) {
|
||||||
|
this.nickName = nickName;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,8 @@
|
||||||
package com.ruoyi.system.mapper;
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.system.domain.NoticeUserSelect;
|
||||||
import com.ruoyi.system.domain.SysNotice;
|
import com.ruoyi.system.domain.SysNotice;
|
||||||
import com.ruoyi.system.domain.SysNoticeUser;
|
import com.ruoyi.system.domain.SysNoticeUser;
|
||||||
|
|
||||||
|
@ -70,4 +72,11 @@ public interface SysNoticeMapper
|
||||||
* @param sysNoticeUsers
|
* @param sysNoticeUsers
|
||||||
*/
|
*/
|
||||||
void insertNoticeUserBatch(List<SysNoticeUser> sysNoticeUsers);
|
void insertNoticeUserBatch(List<SysNoticeUser> sysNoticeUsers);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取对应消息对象的 人员
|
||||||
|
* @param noticeUserSelect
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<NoticeUserSelect> listNoticeEventUser(NoticeUserSelect noticeUserSelect);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package com.ruoyi.system.service;
|
package com.ruoyi.system.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.system.domain.NoticeUserSelect;
|
||||||
import com.ruoyi.system.domain.SysNotice;
|
import com.ruoyi.system.domain.SysNotice;
|
||||||
import com.ruoyi.system.domain.SysNoticeUser;
|
import com.ruoyi.system.domain.SysNoticeUser;
|
||||||
|
|
||||||
|
@ -70,4 +72,11 @@ public interface ISysNoticeService
|
||||||
* @param sysNoticeUsers
|
* @param sysNoticeUsers
|
||||||
*/
|
*/
|
||||||
void insertNoticeUserBatch(List<SysNoticeUser> sysNoticeUsers);
|
void insertNoticeUserBatch(List<SysNoticeUser> sysNoticeUsers);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取对应消息对象的 人员
|
||||||
|
* @param noticeUserSelect
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<NoticeUserSelect> listNoticeEventUser(NoticeUserSelect noticeUserSelect);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import java.nio.charset.StandardCharsets;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.system.domain.NoticeUserSelect;
|
||||||
import com.ruoyi.system.domain.SysNoticeUser;
|
import com.ruoyi.system.domain.SysNoticeUser;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
@ -131,4 +132,14 @@ public class SysNoticeServiceImpl implements ISysNoticeService
|
||||||
public void insertNoticeUserBatch(List<SysNoticeUser> sysNoticeUsers) {
|
public void insertNoticeUserBatch(List<SysNoticeUser> sysNoticeUsers) {
|
||||||
noticeMapper.insertNoticeUserBatch(sysNoticeUsers);
|
noticeMapper.insertNoticeUserBatch(sysNoticeUsers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取对应消息对象的 人员
|
||||||
|
* @param noticeUserSelect
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<NoticeUserSelect> listNoticeEventUser(NoticeUserSelect noticeUserSelect) {
|
||||||
|
return noticeMapper.listNoticeEventUser(noticeUserSelect);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,10 +15,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by" />
|
||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time" />
|
||||||
<result property="remark" column="remark" />
|
<result property="remark" column="remark" />
|
||||||
|
<result property="isRead" column="isRead" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectNoticeVo">
|
<sql id="selectNoticeVo">
|
||||||
select notice_id, notice_title, notice_type, notice_content, status, create_by, create_time, update_by, update_time, remark
|
select notice_id, notice_title, notice_type, notice_content, status, create_by, create_time, update_by, update_time, remark, isRead
|
||||||
from sys_notice
|
from sys_notice
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
@ -70,7 +71,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="noticeContentBit != null and noticeContentBit.length != 0">notice_content = #{noticeContentBit}, </if>
|
<if test="noticeContentBit != null and noticeContentBit.length != 0">notice_content = #{noticeContentBit}, </if>
|
||||||
<if test="status != null and status != ''">status = #{status}, </if>
|
<if test="status != null and status != ''">status = #{status}, </if>
|
||||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||||
update_time = getdate()
|
update_time = getdate(),
|
||||||
|
<if test="isRead != null and isRead != ''">isRead = #{isRead}</if>
|
||||||
</set>
|
</set>
|
||||||
where notice_id = #{noticeId}
|
where notice_id = #{noticeId}
|
||||||
</update>
|
</update>
|
||||||
|
@ -109,4 +111,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<select id="listNoticeEventUser" resultType="NoticeUserSelect">
|
||||||
|
select a.notice_event_user_id userName, b.nick_name nickName
|
||||||
|
from sys_event_user a
|
||||||
|
inner join sys_user b on a.notice_event_user_id = b.user_name
|
||||||
|
where a.notice_event_type = #{noticeEventType}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -60,3 +60,12 @@ export function getNavbarNotice(noticeId) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取对应消息对象的 人员
|
||||||
|
export function listNoticeEventUser(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/notice/listNoticeEventUser',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -102,6 +102,7 @@
|
||||||
this.websocketOnclose();
|
this.websocketOnclose();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
/**获取消息数据*/
|
||||||
getList() {
|
getList() {
|
||||||
this.noticeData = [];
|
this.noticeData = [];
|
||||||
this.sysLog = [];
|
this.sysLog = [];
|
||||||
|
@ -120,11 +121,13 @@
|
||||||
},
|
},
|
||||||
handleClick(tab, event) {
|
handleClick(tab, event) {
|
||||||
},
|
},
|
||||||
|
/**获取消息详情*/
|
||||||
clickNote(data) {
|
clickNote(data) {
|
||||||
getNavbarNotice(data.noticeId).then(response => {
|
getNavbarNotice(data.noticeId).then(response => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.noteTitle = "消息详情"
|
this.noteTitle = "消息详情"
|
||||||
this.noteVisible = true
|
this.noteVisible = true
|
||||||
|
this.getList()
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
initWebSocket() {
|
initWebSocket() {
|
||||||
|
|
|
@ -254,10 +254,12 @@
|
||||||
|
|
||||||
uns.forEach(item => {
|
uns.forEach(item => {
|
||||||
if(this.allUserMap.has(item)) {
|
if(this.allUserMap.has(item)) {
|
||||||
result.push(this.allUserMap.get(item).nickName || '');
|
var json = {};
|
||||||
|
json.userName = this.allUserMap.get(item).userName || '';
|
||||||
|
json.nickName = this.allUserMap.get(item).nickName || '';
|
||||||
|
result.push(json);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -407,7 +409,7 @@
|
||||||
.leftBox_title {
|
.leftBox_title {
|
||||||
width:100%;
|
width:100%;
|
||||||
height:40px;
|
height:40px;
|
||||||
font-size: 16px;
|
/*font-size: 16px;*/
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
|
@ -531,7 +533,7 @@
|
||||||
height: 40px;
|
height: 40px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 16px;
|
/*font-size: 16px;*/
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
@ -551,7 +553,7 @@
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
font-size: 16px;
|
/*font-size: 16px;*/
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,32 +1,81 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="app-container">
|
||||||
<el-button type="primary" icon="el-icon-search" @click="open" size="mini" >打开选人组件</el-button>
|
<el-form size="small" :inline="true" label-width="100px">
|
||||||
|
<el-form-item label="消息发送对象" prop="quotCode">
|
||||||
|
<el-select v-model="noticeEventType" placeholder="请选择" clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.notice_event_user"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
@click.native="selectEvent(dict.value)"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" @click="open" size="mini" :disabled="this.noticeEventType==''">选择人员</el-button>
|
||||||
|
<el-button :disabled="this.noticeEventType==''" @click="saveNoticeEventUser">保 存</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div class="mt10">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col v-for="(item, index) in selectedPeoples" :key="index" :span="8">
|
||||||
|
<el-card class="mb20">
|
||||||
|
<div class="clearfix">
|
||||||
|
<span>{{ item.nickName }}</span>
|
||||||
|
<el-button style="float: right; padding: 3px 0" type="text">删除</el-button>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
<PeopleSelect ref="peopleSelect" :type="'multiple'" :isCheck="true" :open="peopleOpen" @cancel="peopleOpen=false" @submit="submitPeople"></PeopleSelect>
|
<PeopleSelect ref="peopleSelect" :type="'multiple'" :isCheck="true" :open="peopleOpen" @cancel="peopleOpen=false" @submit="submitPeople"></PeopleSelect>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { listNoticeEventUser } from "@/api/system/notice";
|
||||||
|
|
||||||
/** 导入选人组件 */
|
/** 导入选人组件 */
|
||||||
import PeopleSelect from "@/views/components/Tools/PeopleSelect/index.vue";
|
import PeopleSelect from "@/views/components/Tools/PeopleSelect/index.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "peopleSelect",
|
name: "peopleSelect",
|
||||||
dicts: ['sys_normal_disable'],
|
dicts: ['notice_event_user'],
|
||||||
components:{
|
components:{
|
||||||
// 注册组件
|
// 注册组件
|
||||||
'PeopleSelect': PeopleSelect
|
'PeopleSelect': PeopleSelect
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
noticeEventType: '',
|
||||||
|
|
||||||
//是否打开选人组件,默认不打开
|
//是否打开选人组件,默认不打开
|
||||||
peopleOpen:false,
|
peopleOpen:false,
|
||||||
|
|
||||||
|
selectedPeoples:[]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
//消息发送对象选择
|
||||||
|
selectEvent(type){
|
||||||
|
this.noticeEventType = type;
|
||||||
|
|
||||||
|
let params = {};
|
||||||
|
params.noticeEventType = type;
|
||||||
|
listNoticeEventUser(params).then(response => {
|
||||||
|
this.selectedPeoples = response;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//保存
|
||||||
|
saveNoticeEventUser(){
|
||||||
|
console.log(this.selectedPeoples)
|
||||||
|
},
|
||||||
|
|
||||||
//打开选人弹窗
|
//打开选人弹窗
|
||||||
open(){
|
open(){
|
||||||
this.peopleOpen=true;
|
this.peopleOpen=true;
|
||||||
|
@ -35,8 +84,25 @@
|
||||||
submitPeople(peopleList,nickNameList){
|
submitPeople(peopleList,nickNameList){
|
||||||
console.log(peopleList);
|
console.log(peopleList);
|
||||||
console.log(nickNameList);
|
console.log(nickNameList);
|
||||||
|
this.selectedPeoples = this.selectedPeoples.concat(nickNameList)
|
||||||
|
this.selectedPeoples = this.unique(this.selectedPeoples)
|
||||||
this.peopleOpen=false;
|
this.peopleOpen=false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//数组去重
|
||||||
|
unique(arr) {
|
||||||
|
const res = new Map();
|
||||||
|
return arr.filter((arr) => !res.has(arr.userName) && res.set(arr.userName, 1));
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style>
|
||||||
|
.peopleDeleteBtn {
|
||||||
|
width:20px;
|
||||||
|
height:20px;
|
||||||
|
background: url("~@/assets/peopleSelect/delete2.png") no-repeat;
|
||||||
|
background-size:100% 100%;
|
||||||
|
transition: .2s;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue