Commit 93485df5 authored by 耿迪迪's avatar 耿迪迪

审批过程消息通知标记

parent f6e51aac
......@@ -85,7 +85,11 @@ public class TDebitCreditController extends BaseController
if(!itAccountService.checkAccountCanTrade(tDebitCredit.getLendDeptId(),tDebitCredit.getLittleTotal())){
return AjaxResult.error("出借部门账户可用金额不足!");
}
return toAjax(tDebitCreditService.insertTDebitCredit(tDebitCredit));
int rows = tDebitCreditService.insertTDebitCredit(tDebitCredit);
if(rows > 0){
return AjaxResult.success(tDebitCredit);
}
return AjaxResult.error();
}
/**
......
......@@ -144,6 +144,13 @@ public class SysNoticeController extends BaseController
@PostMapping("/deleteNoticeByRelationId")
public AjaxResult deleteNoticeByRelationId(@RequestBody SysNotice notice){
int rows = noticeService.deleteNoticeByRelationId(notice.getRelationId());
webSocketServer.sendMessage(String.valueOf(notice.getCurrentUserId()));
return toAjax(rows);
}
@PostMapping("/noticeIsReadByRelationId")
public AjaxResult noticeIsReadByRelationId(@RequestBody SysNotice notice){
return toAjax(updateNoticeByRelationId(notice));
}
......@@ -152,8 +159,14 @@ public class SysNoticeController extends BaseController
SysNotice deleteNotice = new SysNotice();
deleteNotice.setStatus("1");
deleteNotice.setRelationId(notice.getRelationId());
return noticeService.updateNoticeByRelationId(deleteNotice);
int rows = noticeService.updateNoticeByRelationId(deleteNotice);
String currentUserId = String.valueOf(notice.getCurrentUserId());
if(StringUtils.isNotEmpty(currentUserId)){
webSocketServer.sendMessage(currentUserId);
}
return rows;
}
return 0;
}
}
......@@ -108,7 +108,11 @@ public class TPurchaseController extends BaseController
if(!itAccountService.checkAccountCanTrade(user.getDeptId(),tPurchase.getTotal())){
return AjaxResult.error("账户可用金额不足!");
}
return toAjax(tPurchaseService.insertTPurchase(tPurchase));
int rows = tPurchaseService.insertTPurchase(tPurchase);
if(rows >0){
return AjaxResult.success(tPurchase);
}
return AjaxResult.error();
}
/**
......
......@@ -58,6 +58,9 @@ public class SysNotice extends BaseEntity
private boolean isStart;
/**用于消息刷新*/
private Long currentUserId;
public void setNoticeId(Integer noticeId)
{
this.noticeId = noticeId;
......@@ -153,6 +156,14 @@ 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)
......
......@@ -64,4 +64,6 @@ public interface SysNoticeMapper
* @return
*/
int updateNoticeByRelationId(SysNotice notice);
int deleteNoticeByRelationId(Long relationId);
}
......@@ -64,4 +64,6 @@ public interface ISysNoticeService
* @return
*/
int updateNoticeByRelationId(SysNotice notice);
int deleteNoticeByRelationId(Long relationId);
}
......@@ -99,4 +99,9 @@ public class SysNoticeServiceImpl implements ISysNoticeService
public int updateNoticeByRelationId(SysNotice notice){
return noticeMapper.updateNoticeByRelationId(notice);
}
@Override
public int deleteNoticeByRelationId(Long relationId){
return noticeMapper.deleteNoticeByRelationId(relationId);
}
}
......@@ -97,10 +97,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where p.purchase_id = #{purchaseId}
</select>
<insert id="insertTPurchase" parameterType="TPurchase">
<insert id="insertTPurchase" parameterType="TPurchase" useGeneratedKeys="true" keyProperty="purchaseId">
insert into t_purchase
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="purchaseId != null">purchase_id,</if>
<if test="purchaseDeptId != null">purchase_dept_id,</if>
<if test="purchaseType != null">purchase_type,</if>
<if test="handledByUserId != null">handled_by_user_id,</if>
......@@ -122,7 +121,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="approvedTime != null">approved_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="purchaseId != null">#{purchaseId},</if>
<if test="purchaseDeptId != null">#{purchaseDeptId},</if>
<if test="purchaseType != null">#{purchaseType},</if>
<if test="handledByUserId != null">#{handledByUserId},</if>
......
......@@ -122,4 +122,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
where relation_id = #{relationId} AND status = '0'
</update>
<delete id="deleteNoticeByRelationId" parameterType="Long">
delete from sys_notice where relation_id = #{relationId}
</delete>
</mapper>
\ No newline at end of file
......@@ -59,3 +59,11 @@ export function deleteNoticeByRelationId(data) {
data: data
})
}
export function noticeIsReadByRelationId(data) {
return request({
url: '/system/notice/noticeIsReadByRelationId',
method: 'post',
data: data
})
}
......@@ -20,7 +20,7 @@
import confirm from "./Confirm";
import calculate from "./Calculate";
import repay from "./Repay"
import { sendNotice } from "@/api/system/notice";
import { sendNotice,noticeIsReadByRelationId } from "@/api/system/notice";
export default {
name: "operator-button",
components:{
......@@ -82,7 +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});
sendNotice({noticeTitle:"您的借贷申请被驳回",noticeType:"1",noticeContent:"您的借贷申请被驳回",userId:this.debitInfo.operatorId,relationType:"4",relationId:this.debitInfo.debitId,currentUserId:this.$store.state.user.userId});
}else{
noticeIsReadByRelationId({relationId:this.debitInfo.debitId,currentUserId:this.$store.state.user.userId});
}
this.dealResponse(res);
})
......@@ -97,7 +99,7 @@
}
updateCredit(this.$refs.currentCom.submitSuggestion()).then(res =>{
this.dealResponse(res);
sendNotice({noticeTitle:"您有新借贷待审核",noticeType:"1",noticeContent:"您有新借贷待审核",roles:"calculator"})
sendNotice({noticeTitle:"您有新借贷待审核",noticeType:"1",noticeContent:"您有新借贷待审核",roles:"calculator",relationType:"4",relationId:this.debitInfo.debitId,currentUserId:this.$store.state.user.userId})
})
},
......
......@@ -281,7 +281,7 @@ import { treeselect } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import TableList from "./components/TableList";
import { sendNotice } from "@/api/system/notice";
import { sendNotice, deleteNoticeByRelationId } from "@/api/system/notice";
export default {
name: "Credit",
components: {
......@@ -484,20 +484,20 @@ export default {
this.form.debitDeptId = this.$store.state.user.deptId;
this.form.operatorId = this.$store.state.user.userId;
this.form.dayRate = 0.08/360;
addCredit(this.form).then(response => {
addCredit(this.form).then(res => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
this.noticeNext();
this.noticeNext(res);
});
}
}
});
},
//通知下一个人
noticeNext(){
noticeNext(res){
sendNotice({noticeTitle:"您有新借贷待确认",noticeType:"1",noticeContent:"您有新借贷待确认",
deptId:this.form.lendDeptId,roles:"deptLeader"})
deptId:this.form.lendDeptId,roles:"deptLeader",relationType:"4",relationId:res.data.debitId,isStart:true,currentUserId:this.$store.state.user.userId})
},
/** 删除按钮操作 */
handleDelete(row) {
......@@ -509,6 +509,7 @@ export default {
}).then(function() {
return delCredit(debitIds);
}).then(() => {
deleteNoticeByRelationId({relationId:debitIds,currentUserId:this.$store.state.user.userId});
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
......
......@@ -16,7 +16,7 @@
import calculate from "./Calculate";
import confirm from "./Confirm";
import purchaseDetail from "./PurchaseDetail";
import { sendNotice } from "@/api/system/notice";
import { sendNotice, noticeIsReadByRelationId } from "@/api/system/notice";
export default {
name: "operator-button",
components:{
......@@ -80,7 +80,10 @@
this.$emit("getList");
this.$message.success("审核成功!");
if(this.$refs.currentCom.submitSuggestion().purchaseStatus == '3'){
sendNotice({noticeTitle:"您的物品采购申请被驳回",noticeType:"1",noticeContent:"您的物品采购申请被驳回",userId:this.purchaseInfo.handledByUserId});
sendNotice({noticeTitle:"您的物品采购申请被驳回",noticeType:"1",noticeContent:"您的物品采购申请被驳回",userId:this.purchaseInfo.handledByUserId,relationType:"2",relationId:this.purchaseInfo.purchaseId,currentUserId:this.$store.state.user.userId});
}else{
console.log("sfsfdsfd------")
noticeIsReadByRelationId({relationId:this.purchaseInfo.purchaseId,currentUserId:this.$store.state.user.userId});
}
}else{
this.$message.error("审核失败!");
......@@ -94,7 +97,7 @@
this.open = false;
this.$emit("getList");
this.$message.success("提交成功!");
sendNotice({noticeTitle:"您有新物品采购信息待审批",noticeType:"1",noticeContent:"您有新物品采购信息待审批",roles:"calculator"})
sendNotice({noticeTitle:"您有新物品采购信息待审批",noticeType:"1",noticeContent:"您有新物品采购信息待审批",roles:"calculator",relationType:"2",relationId:this.purchaseInfo.purchaseId,currentUserId:this.$store.state.user.userId})
}else{
this.$message.error("提交失败!");
}
......
......@@ -285,7 +285,7 @@
import { listPurchase, getPurchase, delPurchase, addPurchase, updatePurchase, exportPurchase } from "@/api/transaction/purchase";
import { selectTransactorByDeptId } from "@/api/system/user";
import OperatorButton from "./components/OperatorButton";
import { sendNotice } from "@/api/system/notice";
import { sendNotice, deleteNoticeByRelationId } from "@/api/system/notice";
export default {
name: "Purchase",
components: {
......@@ -493,20 +493,20 @@ export default {
this.getList();
});
} else {
addPurchase(this.form).then(response => {
addPurchase(this.form).then(res => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
this.noticeNext();
this.noticeNext(res);
});
}
}
});
},
//通知下一个人
noticeNext(){
noticeNext(res){
sendNotice({noticeTitle:"您有新物品采购信息待确认",noticeType:"1",noticeContent:"您有新物品采购信息待确认",
deptId:this.$store.state.user.deptId,roles:"deptLeader"})
deptId:this.$store.state.user.deptId,roles:"deptLeader",relationType:"2",relationId:res.data.purchaseId,isStart:true,currentUserId:this.$store.state.user.userId})
},
/** 删除按钮操作 */
handleDelete(row) {
......@@ -518,6 +518,7 @@ export default {
}).then(function() {
return delPurchase(purchaseIds);
}).then(() => {
deleteNoticeByRelationId({relationId:purchaseIds,currentUserId:this.$store.state.user.userId});
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
......
......@@ -16,7 +16,7 @@
import calculate from "./Calculate";
import confirm from "./Confirm";
import purchaseDetail from "./PurchaseDetail";
import { sendNotice } from "@/api/system/notice";
import { sendNotice, noticeIsReadByRelationId } from "@/api/system/notice";
export default {
name: "operator-button",
components:{
......@@ -80,7 +80,9 @@
this.$emit("getList");
this.$message.success("审核成功!");
if(this.$refs.currentCom.submitSuggestion().purchaseStatus == '3'){
sendNotice({noticeTitle:"您的服务费用申请被驳回",noticeType:"1",noticeContent:"您的服务费用申请被驳回",userId:this.purchaseInfo.handledByUserId});
sendNotice({noticeTitle:"您的服务费用申请被驳回",noticeType:"1",noticeContent:"您的服务费用申请被驳回",userId:this.purchaseInfo.handledByUserId,relationType:"3",relationId:this.purchaseInfo.purchaseId,currentUserId:this.$store.state.user.userId});
}else {
noticeIsReadByRelationId({relationId:this.purchaseInfo.purchaseId,currentUserId:this.$store.state.user.userId});
}
}else{
this.$message.error("审核失败!");
......@@ -94,7 +96,7 @@
this.open = false;
this.$emit("getList");
this.$message.success("提交成功!");
sendNotice({noticeTitle:"您有新服务费用信息待审批",noticeType:"1",noticeContent:"您有新服务费用信息待审批",roles:"calculator"})
sendNotice({noticeTitle:"您有新服务费用信息待审批",noticeType:"1",noticeContent:"您有新服务费用信息待审批",roles:"calculator",relationType:"3",relationId:this.purchaseInfo.purchaseId,currentUserId:this.$store.state.user.userId})
}else{
this.$message.error("提交失败!");
}
......
......@@ -218,7 +218,7 @@
import { listPurchase, getPurchase, delPurchase, addPurchase, updatePurchase, exportPurchase } from "@/api/transaction/purchase";
import { selectTransactorByDeptId } from "@/api/system/user";
import OperatorButton from "./components/OperatorButton";
import { sendNotice } from "@/api/system/notice";
import { sendNotice, deleteNoticeByRelationId } from "@/api/system/notice";
export default {
name: "Purchase",
components: {
......@@ -380,20 +380,20 @@ export default {
this.getList();
});
} else {
addPurchase(this.form).then(response => {
addPurchase(this.form).then(res => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
this.noticeNext();
this.noticeNext(res);
});
}
}
});
},
//通知下一个人
noticeNext(){
noticeNext(res){
sendNotice({noticeTitle:"您有新服务费用信息待确认",noticeType:"1",noticeContent:"您有新服务费用信息待确认",
deptId:this.$store.state.user.deptId,roles:"deptLeader"})
deptId:this.$store.state.user.deptId,roles:"deptLeader",relationType:"3",relationId:res.data.purchaseId,isStart:true,currentUserId:this.$store.state.user.userId})
},
/** 删除按钮操作 */
handleDelete(row) {
......@@ -405,6 +405,7 @@ export default {
}).then(function() {
return delPurchase(purchaseIds);
}).then(() => {
deleteNoticeByRelationId({relationId:purchaseIds,currentUserId:this.$store.state.user.userId});
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
......
......@@ -17,7 +17,7 @@
import evaluate from "./Evaluate";
import confirm from "./Confirm";
import approval from "./Approval";
import { sendNotice } from "@/api/system/notice";
import { sendNotice, noticeIsReadByRelationId } from "@/api/system/notice";
export default {
name: "operator-button",
components:{
......@@ -115,7 +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})
sendNotice({noticeTitle:"您有新交易项目被驳回",noticeType:"1",noticeContent:"您有新交易项目被驳回",userId:this.tradeInfo.applyId,relationType:"1",relationId:this.tradeInfo.tradeId,currentUserId:this.$store.state.user.userId})
}else{
noticeIsReadByRelationId({relationId:this.tradeInfo.tradeId,currentUserId:this.$store.state.user.userId});
}
}else{
this.$message.error("复核失败!");
......@@ -131,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})
deptId:this.tradeInfo.tradeDeptId,roles:"deptLeader",relationType:"1",relationId:this.tradeInfo.tradeId,currentUserId:this.$store.state.user.userId})
}
if(this.$refs.currentCom.submitSuggestion().tradeStatus == "2"){
sendNotice({noticeTitle:"您有新交易项目待确认",noticeType:"1",noticeContent:"您有新交易项目待确认",
deptId:this.tradeInfo.applyDeptId,roles:"deptLeader",relationType:"1",relationId:this.tradeInfo.tradeId})
deptId:this.tradeInfo.applyDeptId,roles:"deptLeader",relationType:"1",relationId:this.tradeInfo.tradeId,currentUserId:this.$store.state.user.userId})
}
}else{
......
......@@ -356,7 +356,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import FileUpload from "@/components/MultipleFileUpload";
import uploadfile from "@/assets/uploadfile.png";
import TableList from "./components/TableList";
import { sendNotice, deleteNoticeByRelationId } from "@/api/system/notice";
import { sendNotice, deleteNoticeByRelationId} from "@/api/system/notice";
export default {
name: "Project",
components: {
......@@ -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})
sendNotice({noticeTitle:"您有新交易项目待评价",noticeType:"1",noticeContent:"您有新交易项目待评价",userId:this.form.tradeTransactor,relationType:"1",relationId:res.data.tradeId,isStart:true,currentUserId:this.$store.state.user.userId})
});
}
}
......@@ -600,10 +600,10 @@ export default {
}
)
.then(function () {
deleteNoticeByRelationId({relationId:tradeIds});
return delProject(tradeIds);
})
.then(() => {
deleteNoticeByRelationId({relationId:tradeIds,currentUserId:this.$store.state.user.userId});
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