Commit 8e6e78be authored by 耿迪迪's avatar 耿迪迪

消息通知修改

parent 8025bc57
...@@ -144,8 +144,14 @@ public class SysNoticeController extends BaseController ...@@ -144,8 +144,14 @@ public class SysNoticeController extends BaseController
@PostMapping("/deleteNoticeByRelationId") @PostMapping("/deleteNoticeByRelationId")
public AjaxResult deleteNoticeByRelationId(@RequestBody SysNotice notice){ public AjaxResult deleteNoticeByRelationId(@RequestBody SysNotice notice){
SysNotice noticeInfo = new SysNotice();
noticeInfo.setStatus("0");
noticeInfo.setRelationId(notice.getRelationId());
List<SysNotice> noticeList = noticeService.selectNoticeList(noticeInfo);
int rows = noticeService.deleteNoticeByRelationId(notice.getRelationId()); int rows = noticeService.deleteNoticeByRelationId(notice.getRelationId());
webSocketServer.sendMessage(String.valueOf(notice.getCurrentUserId())); noticeList.forEach(item ->{
webSocketServer.sendMessage(String.valueOf(item.getUserId()));
});
return toAjax(rows); return toAjax(rows);
} }
...@@ -156,14 +162,17 @@ public class SysNoticeController extends BaseController ...@@ -156,14 +162,17 @@ public class SysNoticeController extends BaseController
private int updateNoticeByRelationId(SysNotice notice){ private int updateNoticeByRelationId(SysNotice notice){
if(StringUtils.isNotEmpty(String.valueOf(notice.getRelationId())) && !notice.isStart()){ if(StringUtils.isNotEmpty(String.valueOf(notice.getRelationId())) && !notice.isStart()){
SysNotice noticeInfo = new SysNotice();
noticeInfo.setStatus("0");
noticeInfo.setRelationId(notice.getRelationId());
List<SysNotice> noticeList = noticeService.selectNoticeList(noticeInfo);
SysNotice deleteNotice = new SysNotice(); SysNotice deleteNotice = new SysNotice();
deleteNotice.setStatus("1"); deleteNotice.setStatus("1");
deleteNotice.setRelationId(notice.getRelationId()); deleteNotice.setRelationId(notice.getRelationId());
int rows = noticeService.updateNoticeByRelationId(deleteNotice); int rows = noticeService.updateNoticeByRelationId(deleteNotice);
String currentUserId = String.valueOf(notice.getCurrentUserId()); noticeList.forEach(item ->{
if(StringUtils.isNotEmpty(currentUserId)){ webSocketServer.sendMessage(String.valueOf(item.getUserId()));
webSocketServer.sendMessage(currentUserId); });
}
return rows; return rows;
} }
return 0; return 0;
......
...@@ -58,8 +58,6 @@ public class SysNotice extends BaseEntity ...@@ -58,8 +58,6 @@ public class SysNotice extends BaseEntity
private boolean isStart; private boolean isStart;
/**用于消息刷新*/
private Long currentUserId;
public void setNoticeId(Integer noticeId) public void setNoticeId(Integer noticeId)
{ {
...@@ -156,14 +154,6 @@ public class SysNotice extends BaseEntity ...@@ -156,14 +154,6 @@ public class SysNotice extends BaseEntity
isStart = start; isStart = start;
} }
public Long getCurrentUserId() {
return currentUserId;
}
public void setCurrentUserId(Long currentUserId) {
this.currentUserId = currentUserId;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
...@@ -82,9 +82,9 @@ ...@@ -82,9 +82,9 @@
if(this.debitData.debitStatus == "1"){ if(this.debitData.debitStatus == "1"){
settlementDebitCredit(this.$refs.currentCom.submitSuggestion()).then(res =>{ settlementDebitCredit(this.$refs.currentCom.submitSuggestion()).then(res =>{
if(this.$refs.currentCom.submitSuggestion().debitStatus == '4'){ if(this.$refs.currentCom.submitSuggestion().debitStatus == '4'){
sendNotice({noticeTitle:"您的借贷申请被驳回",noticeType:"1",noticeContent:"您的借贷申请被驳回",userId:this.debitInfo.operatorId,relationType:"4",relationId:this.debitInfo.debitId,currentUserId:this.$store.state.user.userId}); sendNotice({noticeTitle:"您的借贷申请被驳回",noticeType:"1",noticeContent:"您的借贷申请被驳回",userId:this.debitInfo.operatorId,relationType:"4",relationId:this.debitInfo.debitId});
}else{ }else{
noticeIsReadByRelationId({relationId:this.debitInfo.debitId,currentUserId:this.$store.state.user.userId}); noticeIsReadByRelationId({relationId:this.debitInfo.debitId});
} }
this.dealResponse(res); this.dealResponse(res);
}) })
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
} }
updateCredit(this.$refs.currentCom.submitSuggestion()).then(res =>{ updateCredit(this.$refs.currentCom.submitSuggestion()).then(res =>{
this.dealResponse(res); this.dealResponse(res);
sendNotice({noticeTitle:"您有新借贷待审核",noticeType:"1",noticeContent:"您有新借贷待审核",roles:"calculator",relationType:"4",relationId:this.debitInfo.debitId,currentUserId:this.$store.state.user.userId}) sendNotice({noticeTitle:"您有新借贷待审核",noticeType:"1",noticeContent:"您有新借贷待审核",roles:"calculator",relationType:"4",relationId:this.debitInfo.debitId})
}) })
}, },
......
...@@ -497,7 +497,7 @@ export default { ...@@ -497,7 +497,7 @@ export default {
//通知下一个人 //通知下一个人
noticeNext(res){ noticeNext(res){
sendNotice({noticeTitle:"您有新借贷待确认",noticeType:"1",noticeContent:"您有新借贷待确认", sendNotice({noticeTitle:"您有新借贷待确认",noticeType:"1",noticeContent:"您有新借贷待确认",
deptId:this.form.lendDeptId,roles:"deptLeader",relationType:"4",relationId:res.data.debitId,isStart:true,currentUserId:this.$store.state.user.userId}) deptId:this.form.lendDeptId,roles:"deptLeader",relationType:"4",relationId:res.data.debitId,isStart:true})
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
...@@ -509,7 +509,7 @@ export default { ...@@ -509,7 +509,7 @@ export default {
}).then(function() { }).then(function() {
return delCredit(debitIds); return delCredit(debitIds);
}).then(() => { }).then(() => {
deleteNoticeByRelationId({relationId:debitIds,currentUserId:this.$store.state.user.userId}); deleteNoticeByRelationId({relationId:debitIds});
this.getList(); this.getList();
this.msgSuccess("删除成功"); this.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => {});
......
...@@ -80,10 +80,9 @@ ...@@ -80,10 +80,9 @@
this.$emit("getList"); this.$emit("getList");
this.$message.success("审核成功!"); this.$message.success("审核成功!");
if(this.$refs.currentCom.submitSuggestion().purchaseStatus == '3'){ if(this.$refs.currentCom.submitSuggestion().purchaseStatus == '3'){
sendNotice({noticeTitle:"您的物品采购申请被驳回",noticeType:"1",noticeContent:"您的物品采购申请被驳回",userId:this.purchaseInfo.handledByUserId,relationType:"2",relationId:this.purchaseInfo.purchaseId,currentUserId:this.$store.state.user.userId}); sendNotice({noticeTitle:"您的物品采购申请被驳回",noticeType:"1",noticeContent:"您的物品采购申请被驳回",userId:this.purchaseInfo.handledByUserId,relationType:"2",relationId:this.purchaseInfo.purchaseId});
}else{ }else{
console.log("sfsfdsfd------") noticeIsReadByRelationId({relationId:this.purchaseInfo.purchaseId});
noticeIsReadByRelationId({relationId:this.purchaseInfo.purchaseId,currentUserId:this.$store.state.user.userId});
} }
}else{ }else{
this.$message.error("审核失败!"); this.$message.error("审核失败!");
...@@ -97,7 +96,7 @@ ...@@ -97,7 +96,7 @@
this.open = false; this.open = false;
this.$emit("getList"); this.$emit("getList");
this.$message.success("提交成功!"); this.$message.success("提交成功!");
sendNotice({noticeTitle:"您有新物品采购信息待审批",noticeType:"1",noticeContent:"您有新物品采购信息待审批",roles:"calculator",relationType:"2",relationId:this.purchaseInfo.purchaseId,currentUserId:this.$store.state.user.userId}) sendNotice({noticeTitle:"您有新物品采购信息待审批",noticeType:"1",noticeContent:"您有新物品采购信息待审批",roles:"calculator",relationType:"2",relationId:this.purchaseInfo.purchaseId})
}else{ }else{
this.$message.error("提交失败!"); this.$message.error("提交失败!");
} }
......
...@@ -506,7 +506,7 @@ export default { ...@@ -506,7 +506,7 @@ export default {
//通知下一个人 //通知下一个人
noticeNext(res){ noticeNext(res){
sendNotice({noticeTitle:"您有新物品采购信息待确认",noticeType:"1",noticeContent:"您有新物品采购信息待确认", sendNotice({noticeTitle:"您有新物品采购信息待确认",noticeType:"1",noticeContent:"您有新物品采购信息待确认",
deptId:this.$store.state.user.deptId,roles:"deptLeader",relationType:"2",relationId:res.data.purchaseId,isStart:true,currentUserId:this.$store.state.user.userId}) deptId:this.$store.state.user.deptId,roles:"deptLeader",relationType:"2",relationId:res.data.purchaseId,isStart:true})
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
...@@ -518,7 +518,7 @@ export default { ...@@ -518,7 +518,7 @@ export default {
}).then(function() { }).then(function() {
return delPurchase(purchaseIds); return delPurchase(purchaseIds);
}).then(() => { }).then(() => {
deleteNoticeByRelationId({relationId:purchaseIds,currentUserId:this.$store.state.user.userId}); deleteNoticeByRelationId({relationId:purchaseIds});
this.getList(); this.getList();
this.msgSuccess("删除成功"); this.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => {});
......
...@@ -80,9 +80,9 @@ ...@@ -80,9 +80,9 @@
this.$emit("getList"); this.$emit("getList");
this.$message.success("审核成功!"); this.$message.success("审核成功!");
if(this.$refs.currentCom.submitSuggestion().purchaseStatus == '3'){ if(this.$refs.currentCom.submitSuggestion().purchaseStatus == '3'){
sendNotice({noticeTitle:"您的服务费用申请被驳回",noticeType:"1",noticeContent:"您的服务费用申请被驳回",userId:this.purchaseInfo.handledByUserId,relationType:"3",relationId:this.purchaseInfo.purchaseId,currentUserId:this.$store.state.user.userId}); sendNotice({noticeTitle:"您的服务费用申请被驳回",noticeType:"1",noticeContent:"您的服务费用申请被驳回",userId:this.purchaseInfo.handledByUserId,relationType:"3",relationId:this.purchaseInfo.purchaseId});
}else { }else {
noticeIsReadByRelationId({relationId:this.purchaseInfo.purchaseId,currentUserId:this.$store.state.user.userId}); noticeIsReadByRelationId({relationId:this.purchaseInfo.purchaseId});
} }
}else{ }else{
this.$message.error("审核失败!"); this.$message.error("审核失败!");
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
this.open = false; this.open = false;
this.$emit("getList"); this.$emit("getList");
this.$message.success("提交成功!"); this.$message.success("提交成功!");
sendNotice({noticeTitle:"您有新服务费用信息待审批",noticeType:"1",noticeContent:"您有新服务费用信息待审批",roles:"calculator",relationType:"3",relationId:this.purchaseInfo.purchaseId,currentUserId:this.$store.state.user.userId}) sendNotice({noticeTitle:"您有新服务费用信息待审批",noticeType:"1",noticeContent:"您有新服务费用信息待审批",roles:"calculator",relationType:"3",relationId:this.purchaseInfo.purchaseId})
}else{ }else{
this.$message.error("提交失败!"); this.$message.error("提交失败!");
} }
......
...@@ -393,7 +393,7 @@ export default { ...@@ -393,7 +393,7 @@ export default {
//通知下一个人 //通知下一个人
noticeNext(res){ noticeNext(res){
sendNotice({noticeTitle:"您有新服务费用信息待确认",noticeType:"1",noticeContent:"您有新服务费用信息待确认", sendNotice({noticeTitle:"您有新服务费用信息待确认",noticeType:"1",noticeContent:"您有新服务费用信息待确认",
deptId:this.$store.state.user.deptId,roles:"deptLeader",relationType:"3",relationId:res.data.purchaseId,isStart:true,currentUserId:this.$store.state.user.userId}) deptId:this.$store.state.user.deptId,roles:"deptLeader",relationType:"3",relationId:res.data.purchaseId,isStart:true})
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
...@@ -405,7 +405,7 @@ export default { ...@@ -405,7 +405,7 @@ export default {
}).then(function() { }).then(function() {
return delPurchase(purchaseIds); return delPurchase(purchaseIds);
}).then(() => { }).then(() => {
deleteNoticeByRelationId({relationId:purchaseIds,currentUserId:this.$store.state.user.userId}); deleteNoticeByRelationId({relationId:purchaseIds});
this.getList(); this.getList();
this.msgSuccess("删除成功"); this.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => {});
......
...@@ -115,9 +115,9 @@ ...@@ -115,9 +115,9 @@
this.$emit("getList"); this.$emit("getList");
this.$message.success("复核成功!"); this.$message.success("复核成功!");
if(this.$refs.currentCom.submitSuggestion().tradeStatus == "4"){ if(this.$refs.currentCom.submitSuggestion().tradeStatus == "4"){
sendNotice({noticeTitle:"您有新交易项目被驳回",noticeType:"1",noticeContent:"您有新交易项目被驳回",userId:this.tradeInfo.applyId,relationType:"1",relationId:this.tradeInfo.tradeId,currentUserId:this.$store.state.user.userId}) sendNotice({noticeTitle:"您有新交易项目被驳回",noticeType:"1",noticeContent:"您有新交易项目被驳回",userId:this.tradeInfo.applyId,relationType:"1",relationId:this.tradeInfo.tradeId})
}else{ }else{
noticeIsReadByRelationId({relationId:this.tradeInfo.tradeId,currentUserId:this.$store.state.user.userId}); noticeIsReadByRelationId({relationId:this.tradeInfo.tradeId});
} }
}else{ }else{
this.$message.error("复核失败!"); this.$message.error("复核失败!");
...@@ -133,12 +133,12 @@ ...@@ -133,12 +133,12 @@
that.$message.success("提交成功!"); that.$message.success("提交成功!");
if(this.$refs.currentCom.submitSuggestion().tradeStatus == "1"){ if(this.$refs.currentCom.submitSuggestion().tradeStatus == "1"){
sendNotice({noticeTitle:"您有新交易项目待确认",noticeType:"1",noticeContent:"您有新交易项目待确认", sendNotice({noticeTitle:"您有新交易项目待确认",noticeType:"1",noticeContent:"您有新交易项目待确认",
deptId:this.tradeInfo.tradeDeptId,roles:"deptLeader",relationType:"1",relationId:this.tradeInfo.tradeId,currentUserId:this.$store.state.user.userId}) deptId:this.tradeInfo.tradeDeptId,roles:"deptLeader",relationType:"1",relationId:this.tradeInfo.tradeId})
} }
if(this.$refs.currentCom.submitSuggestion().tradeStatus == "2"){ if(this.$refs.currentCom.submitSuggestion().tradeStatus == "2"){
sendNotice({noticeTitle:"您有新交易项目待确认",noticeType:"1",noticeContent:"您有新交易项目待确认", sendNotice({noticeTitle:"您有新交易项目待确认",noticeType:"1",noticeContent:"您有新交易项目待确认",
deptId:this.tradeInfo.applyDeptId,roles:"deptLeader",relationType:"1",relationId:this.tradeInfo.tradeId,currentUserId:this.$store.state.user.userId}) deptId:this.tradeInfo.applyDeptId,roles:"deptLeader",relationType:"1",relationId:this.tradeInfo.tradeId})
} }
}else{ }else{
......
...@@ -581,7 +581,7 @@ export default { ...@@ -581,7 +581,7 @@ export default {
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
sendNotice({noticeTitle:"您有新交易项目待评价",noticeType:"1",noticeContent:"您有新交易项目待评价",userId:this.form.tradeTransactor,relationType:"1",relationId:res.data.tradeId,isStart:true,currentUserId:this.$store.state.user.userId}) sendNotice({noticeTitle:"您有新交易项目待评价",noticeType:"1",noticeContent:"您有新交易项目待评价",userId:this.form.tradeTransactor,relationType:"1",relationId:res.data.tradeId,isStart:true})
}); });
} }
} }
...@@ -603,7 +603,7 @@ export default { ...@@ -603,7 +603,7 @@ export default {
return delProject(tradeIds); return delProject(tradeIds);
}) })
.then(() => { .then(() => {
deleteNoticeByRelationId({relationId:tradeIds,currentUserId:this.$store.state.user.userId}); deleteNoticeByRelationId({relationId:tradeIds});
this.getList(); this.getList();
this.msgSuccess("删除成功"); this.msgSuccess("删除成功");
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment