|
@@ -362,6 +362,31 @@ removes.deleteRationLibs = function(req,res){//只删除了映射表内容 级
|
|
|
var rationName = req.body.rationName;
|
|
|
Schemas.connectMap(function(db){
|
|
|
var LibMapModel = db.model("rationlibmaps",Schemas.RationLibMapSchema);
|
|
|
+ LibMapModel.find({"DisplayName":rationName},function(err,data){
|
|
|
+ if(data.length) {
|
|
|
+ var realRationName = data[0].DBName;
|
|
|
+ db = mongoose.createConnection("192.168.1.184", realRationName, 60666);
|
|
|
+ db.dropDatabase(function(err){
|
|
|
+ if(err) callback(req,res,"drop err",false);
|
|
|
+ else{
|
|
|
+ callback(req,res,false,"ok")
|
|
|
+ /* var db = mongoose.createConnection("192.168.1.184"," rationLibMap", 60666)
|
|
|
+ var LibMapModel = db.model("rationlibmaps",Schemas.RationLibMapSchema);
|
|
|
+ LibMapModel.remove({"DisplayName":rationName},function(err){
|
|
|
+ if(err) callback(req,res,"删除错误",false);
|
|
|
+ else callback(req,res,false,"已删除");
|
|
|
+ })*/
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+}
|
|
|
+removes.deleteRationMapItem=function(req,res){
|
|
|
+ var rationName = req.body.rationName;
|
|
|
+ Schemas.connectMap(function(db){
|
|
|
+ var LibMapModel = db.model("rationlibmaps",Schemas.RationLibMapSchema);
|
|
|
LibMapModel.remove({"DisplayName":rationName},function(err){
|
|
|
if(err) callback(req,res,"删除错误",false);
|
|
|
else callback(req,res,false,"已删除");
|
|
@@ -406,7 +431,6 @@ removes.deleteGLJItem = function(req,res){
|
|
|
}
|
|
|
removes.deleteRation = function(req,res){
|
|
|
var DBName = req.body.rationName;
|
|
|
- var deltype = req.body.type;
|
|
|
var delvalue = req.body.value;
|
|
|
Schemas.connectMap(function(db){
|
|
|
var LibMapModel = db.model("rationlibmaps",Schemas.RationLibMapSchema);
|