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

消息通知修改

parent 8025bc57
......@@ -144,8 +144,14 @@ public class SysNoticeController extends BaseController
@PostMapping("/deleteNoticeByRelationId")
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());
webSocketServer.sendMessage(String.valueOf(notice.getCurrentUserId()));
noticeList.forEach(item ->{
webSocketServer.sendMessage(String.valueOf(item.getUserId()));
});
return toAjax(rows);
}
......@@ -156,14 +162,17 @@ public class SysNoticeController extends BaseController
private int updateNoticeByRelationId(SysNotice notice){
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();
deleteNotice.setStatus("1");
deleteNotice.setRelationId(notice.getRelationId());
int rows = noticeService.updateNoticeByRelationId(deleteNotice);
String currentUserId = String.valueOf(notice.getCurrentUserId());
if(StringUtils.isNotEmpty(currentUserId)){
webSocketServer.sendMessage(currentUserId);
}
noticeList.forEach(item ->{
webSocketServer.sendMessage(String.valueOf(item.getUserId()));
});
return rows;
}
return 0;
......
......@@ -58,8 +58,6 @@ public class SysNotice extends BaseEntity
private boolean isStart;
/**用于消息刷新*/
private Long currentUserId;
public void setNoticeId(Integer noticeId)
{
......@@ -156,14 +154,6 @@ public class SysNotice extends BaseEntity
isStart = start;
}
public Long getCurrentUserId() {
return currentUserId;
}
public void setCurrentUserId(Long currentUserId) {
this.currentUserId = currentUserId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
......@@ -82,9 +82,9 @@
if(this.debitData.debitStatus == "1"){
settlementDebitCredit(this.$refs.currentCom.submitSuggestion()).then(res =>{
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{
noticeIsReadByRelationId({relationId:this.debitInfo.debitId,currentUserId:this.$store.state.user.userId});
noticeIsReadByRelationId({relationId:this.debitInfo.debitId});
}
this.dealResponse(res);
})
......@@ -99,7 +99,7 @@
}
updateCredit(this.$refs.currentCom.submitSuggestion()).then(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 {
//通知下一个人
noticeNext(res){
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) {
......@@ -509,7 +509,7 @@ export default {
}).then(function() {
return delCredit(debitIds);
}).then(() => {
deleteNoticeByRelationId({relationId:debitIds,currentUserId:this.$store.state.user.userId});
deleteNoticeByRelationId({relationId:debitIds});
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
......
......@@ -80,10 +80,9 @@
this.$emit("getList");
this.$message.success("审核成功!");
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{
console.log("sfsfdsfd------")
noticeIsReadByRelationId({relationId:this.purchaseInfo.purchaseId,currentUserId:this.$store.state.user.userId});
noticeIsReadByRelationId({relationId:this.purchaseInfo.purchaseId});
}
}else{
this.$message.error("审核失败!");
......@@ -97,7 +96,7 @@
this.open = false;
this.$emit("getList");
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{
this.$message.error("提交失败!");
}
......
......@@ -506,7 +506,7 @@ export default {
//通知下一个人
noticeNext(res){
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) {
......@@ -518,7 +518,7 @@ export default {
}).then(function() {
return delPurchase(purchaseIds);
}).then(() => {
deleteNoticeByRelationId({relationId:purchaseIds,currentUserId:this.$store.state.user.userId});
deleteNoticeByRelationId({relationId:purchaseIds});
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
......
......@@ -80,9 +80,9 @@
this.$emit("getList");
this.$message.success("审核成功!");
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 {
noticeIsReadByRelationId({relationId:this.purchaseInfo.purchaseId,currentUserId:this.$store.state.user.userId});
noticeIsReadByRelationId({relationId:this.purchaseInfo.purchaseId});
}
}else{
this.$message.error("审核失败!");
......@@ -96,7 +96,7 @@
this.open = false;
this.$emit("getList");
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{
this.$message.error("提交失败!");
}
......
......@@ -393,7 +393,7 @@ export default {
//通知下一个人
noticeNext(res){
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) {
......@@ -405,7 +405,7 @@ export default {
}).then(function() {
return delPurchase(purchaseIds);
}).then(() => {
deleteNoticeByRelationId({relationId:purchaseIds,currentUserId:this.$store.state.user.userId});
deleteNoticeByRelationId({relationId:purchaseIds});
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
......
......@@ -115,9 +115,9 @@
this.$emit("getList");
this.$message.success("复核成功!");
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{
noticeIsReadByRelationId({relationId:this.tradeInfo.tradeId,currentUserId:this.$store.state.user.userId});
noticeIsReadByRelationId({relationId:this.tradeInfo.tradeId});
}
}else{
this.$message.error("复核失败!");
......@@ -133,12 +133,12 @@
that.$message.success("提交成功!");
if(this.$refs.currentCom.submitSuggestion().tradeStatus == "1"){
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"){
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{
......
......@@ -581,7 +581,7 @@ export default {
this.msgSuccess("新增成功");
this.open = false;
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 {
return delProject(tradeIds);
})
.then(() => {
deleteNoticeByRelationId({relationId:tradeIds,currentUserId:this.$store.state.user.userId});
deleteNoticeByRelationId({relationId:tradeIds});
this.getList();
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