Merge branch 'master' of http://git.estsh.com/i3-IMPP/i3plus-pojo
# Conflicts: # modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/sqlpack/WmsHqlPack.javayun-zuoyi
commit
1263460ced
@ -0,0 +1,49 @@
|
||||
package cn.estsh.i3plus.pojo.platform.sqlpack;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.tool.BsonPackTool;
|
||||
import cn.estsh.i3plus.pojo.platform.bean.LogOperate;
|
||||
import cn.estsh.i3plus.pojo.platform.bean.LogSystem;
|
||||
import com.mongodb.BasicDBObject;
|
||||
import com.mongodb.client.model.Filters;
|
||||
import org.bson.conversions.Bson;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @Description : Bson对象封装
|
||||
* @Reference :
|
||||
* @Author : yunhao
|
||||
* @CreateDate : 2018-11-08 13:15
|
||||
* @Modify:
|
||||
**/
|
||||
public class CoreBsonPack {
|
||||
|
||||
/**
|
||||
* 日志复杂查询
|
||||
* @param logSystem
|
||||
* @return
|
||||
*/
|
||||
public static Bson packBsonByLogSystem(LogSystem logSystem){
|
||||
Bson bson = new BasicDBObject();
|
||||
|
||||
bson = BsonPackTool.getNumEqualPack(logSystem.getLogLevel(),"logLevel",bson);
|
||||
bson = BsonPackTool.getNumEqualPack(logSystem.getLogModuleId(),"logModuleId",bson);
|
||||
bson = BsonPackTool.timeBuilder(logSystem.getCreateDatetime(),"createDatetime",bson,false,false);
|
||||
bson = BsonPackTool.getStringLikerPack(logSystem.getRemoteIp(),"remoteIp",bson);
|
||||
bson = BsonPackTool.getStringLikerPack(logSystem.getRequestUrl(),"requestUrl",bson);
|
||||
bson = BsonPackTool.getStringLikerPack(logSystem.getLogMethod(),"logMethod",bson);
|
||||
|
||||
return bson;
|
||||
}
|
||||
|
||||
public static Bson packBsonByLogOperate(LogOperate logOperate){
|
||||
Bson bson = new BasicDBObject();
|
||||
|
||||
bson = BsonPackTool.getNumEqualPack(logOperate.getOperateTypeId(),"operateTypeId",bson);
|
||||
bson = BsonPackTool.getNumEqualPack(logOperate.getOperateModuleId(),"operateModuleId",bson);
|
||||
bson = BsonPackTool.timeBuilder(logOperate.getCreateDatetime(),"createDatetime",bson,false,false);
|
||||
bson = BsonPackTool.getStringLikerPack(logOperate.getCreateUser(),"createUser",bson);
|
||||
|
||||
return bson;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue