ecology_maven/com/api/aiyh_quanshi/service/Impl/CancelMetingServiceImpl.java

74 lines
2.9 KiB
Java
Raw Normal View History

2021-11-14 15:29:16 +08:00
package com.api.aiyh_quanshi.service.Impl;
import aiyh.utils.zwl.common.ToolUtil;
import com.weaverboot.frame.ioc.anno.classAnno.WeaIocReplaceComponent;
import com.weaverboot.frame.ioc.anno.methodAnno.WeaReplaceAfter;
import com.weaverboot.frame.ioc.anno.methodAnno.WeaReplaceBefore;
import com.weaverboot.frame.ioc.handler.replace.weaReplaceParam.impl.WeaAfterReplaceParam;
import com.weaverboot.frame.ioc.handler.replace.weaReplaceParam.impl.WeaBeforeReplaceParam;
import weaver.aiyh_quanshi.RequestApi;
import weaver.aiyh_quanshi.entity.QsResponse;
import weaver.conn.RecordSet;
import java.util.Map;
/**
*
*/
@WeaIocReplaceComponent("cancelMetingService")
public class CancelMetingServiceImpl {
ToolUtil toolUtil = new ToolUtil();
RequestApi requestApi = new RequestApi();
boolean flag = true;
/**
*
* @WeaReplaceBefore,valueapi
* orderapi
* WeaBeforeReplaceParam requestresponsemapapi
*/
@WeaReplaceBefore(value = "/api/meeting/base/cancelMeeting", order = 1, description = "会议接口前拦截")
public void before(WeaBeforeReplaceParam weaBeforeReplaceParam) {
// 获取会议id
Map paramMap = weaBeforeReplaceParam.getParamMap();
String id = String.valueOf(paramMap.get("meetingid"));
// 通过会议id获取全时会议id
String query = "select * from meeting where id = ?";
RecordSet rs = new RecordSet();
rs.executeQuery(query, id);
rs.next();
String quanShiId = rs.getString("quan_shi_id");
String hrmId = rs.getString("contacter");
query = "select * from hrmresource where id = ?";
rs.executeQuery(query, hrmId);
rs.next();
String creatorEmail = rs.getString("email");
// 通过全时会议id对会议进行取消
QsResponse qsResponse = requestApi.cancelConference(quanShiId, creatorEmail);
if(!"0".equals(qsResponse.getStatus())){
// 取消失败
flag = false;
}
}
/**
*
* WeaReplaceAfter
* String
* WeaAfterReplaceParamdataString
* return
*/
@WeaReplaceAfter(value = "/api/meeting/base/cancelMeeting", order = 1)
public String after(WeaAfterReplaceParam weaAfterReplaceParam) {
//这个就是接口执行完的报文
String data = weaAfterReplaceParam.getData();
if(!flag){
// 取消会议失败
}else{
}
return data;
}
}