|
@@ -43,11 +43,11 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
|
|
|
|
|
string Condition = "";
|
|
string Condition = "";
|
|
|
Condition += "ChangeNo:\"" + data.ChangeNo + "\",";
|
|
Condition += "ChangeNo:\"" + data.ChangeNo + "\",";
|
|
|
-Condition += "BackProductType:\"" + data.BackProductType + "\",";
|
|
|
|
|
-Condition += "BackDeviceStatus:\"" + data.BackDeviceStatus + "\",";
|
|
|
|
|
|
|
+ Condition += "BackProductType:\"" + data.BackProductType + "\",";
|
|
|
|
|
+ Condition += "BackDeviceStatus:\"" + data.BackDeviceStatus + "\",";
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(Condition))
|
|
if (!string.IsNullOrEmpty(Condition))
|
|
|
- {
|
|
|
|
|
|
|
+ {
|
|
|
Condition = Condition.TrimEnd(',');
|
|
Condition = Condition.TrimEnd(',');
|
|
|
Condition = ", where: {" + Condition + "}";
|
|
Condition = ", where: {" + Condition + "}";
|
|
|
}
|
|
}
|
|
@@ -65,20 +65,20 @@ Condition += "BackDeviceStatus:\"" + data.BackDeviceStatus + "\",";
|
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
|
public JsonResult IndexData(MachineChangeDetail data, int page = 1, int limit = 30)
|
|
public JsonResult IndexData(MachineChangeDetail data, int page = 1, int limit = 30)
|
|
|
{
|
|
{
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
Fields.Add("ChangeId", "1");
|
|
Fields.Add("ChangeId", "1");
|
|
|
|
|
|
|
|
Fields.Add("ChangeNo", "2"); //订单号
|
|
Fields.Add("ChangeNo", "2"); //订单号
|
|
|
-Fields.Add("CreateDate", "3"); //时间
|
|
|
|
|
-Fields.Add("BackProductType", "1"); //退回产品类型
|
|
|
|
|
-Fields.Add("BackDeviceStatus", "1"); //设备状态
|
|
|
|
|
|
|
+ Fields.Add("CreateDate", "3"); //时间
|
|
|
|
|
+ Fields.Add("BackProductType", "1"); //退回产品类型
|
|
|
|
|
+ Fields.Add("BackDeviceStatus", "1"); //设备状态
|
|
|
|
|
|
|
|
Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("MachineChangeDetail", Fields, "Id desc", "0", page, limit, " and Status>-1");
|
|
Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("MachineChangeDetail", Fields, "Id desc", "0", page, limit, " and Status>-1");
|
|
|
List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
foreach (Dictionary<string, object> dic in diclist)
|
|
foreach (Dictionary<string, object> dic in diclist)
|
|
|
{
|
|
{
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
return Json(obj);
|
|
return Json(obj);
|
|
|
}
|
|
}
|
|
@@ -116,7 +116,7 @@ Fields.Add("BackDeviceStatus", "1"); //设备状态
|
|
|
Fields.Add("ChangeId", data.ChangeId);
|
|
Fields.Add("ChangeId", data.ChangeId);
|
|
|
|
|
|
|
|
Fields.Add("BackProductType", data.BackProductType); //退回产品类型
|
|
Fields.Add("BackProductType", data.BackProductType); //退回产品类型
|
|
|
-Fields.Add("Remark", data.Remark); //备注
|
|
|
|
|
|
|
+ Fields.Add("Remark", data.Remark); //备注
|
|
|
|
|
|
|
|
Fields.Add("SeoTitle", data.SeoTitle);
|
|
Fields.Add("SeoTitle", data.SeoTitle);
|
|
|
Fields.Add("SeoKeyword", data.SeoKeyword);
|
|
Fields.Add("SeoKeyword", data.SeoKeyword);
|
|
@@ -124,7 +124,7 @@ Fields.Add("Remark", data.Remark); //备注
|
|
|
int Id = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Add("MachineChangeDetail", Fields, 0);
|
|
int Id = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Add("MachineChangeDetail", Fields, 0);
|
|
|
AddSysLog(data.Id.ToString(), "MachineChangeDetail", "add");
|
|
AddSysLog(data.Id.ToString(), "MachineChangeDetail", "add");
|
|
|
db.SaveChanges();
|
|
db.SaveChanges();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
return "success";
|
|
return "success";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -163,15 +163,15 @@ Fields.Add("Remark", data.Remark); //备注
|
|
|
Fields.Add("ChangeId", data.ChangeId);
|
|
Fields.Add("ChangeId", data.ChangeId);
|
|
|
|
|
|
|
|
Fields.Add("BackProductType", data.BackProductType); //退回产品类型
|
|
Fields.Add("BackProductType", data.BackProductType); //退回产品类型
|
|
|
-Fields.Add("Remark", data.Remark); //备注
|
|
|
|
|
|
|
+ Fields.Add("Remark", data.Remark); //备注
|
|
|
|
|
|
|
|
Fields.Add("SeoTitle", data.SeoTitle);
|
|
Fields.Add("SeoTitle", data.SeoTitle);
|
|
|
Fields.Add("SeoKeyword", data.SeoKeyword);
|
|
Fields.Add("SeoKeyword", data.SeoKeyword);
|
|
|
Fields.Add("SeoDescription", data.SeoDescription);
|
|
Fields.Add("SeoDescription", data.SeoDescription);
|
|
|
new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("MachineChangeDetail", Fields, data.Id);
|
|
new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("MachineChangeDetail", Fields, data.Id);
|
|
|
- AddSysLog(data.Id.ToString(),"MachineChangeDetail","update");
|
|
|
|
|
|
|
+ AddSysLog(data.Id.ToString(), "MachineChangeDetail", "update");
|
|
|
db.SaveChanges();
|
|
db.SaveChanges();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
return "success";
|
|
return "success";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -186,7 +186,7 @@ Fields.Add("Remark", data.Remark); //备注
|
|
|
public string Delete(string Id)
|
|
public string Delete(string Id)
|
|
|
{
|
|
{
|
|
|
string[] idlist = Id.Split(new char[] { ',' });
|
|
string[] idlist = Id.Split(new char[] { ',' });
|
|
|
- AddSysLog(Id,"MachineChangeDetail","del");
|
|
|
|
|
|
|
+ AddSysLog(Id, "MachineChangeDetail", "del");
|
|
|
foreach (string subid in idlist)
|
|
foreach (string subid in idlist)
|
|
|
{
|
|
{
|
|
|
int id = int.Parse(subid);
|
|
int id = int.Parse(subid);
|
|
@@ -195,7 +195,7 @@ Fields.Add("Remark", data.Remark); //备注
|
|
|
new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("MachineChangeDetail", Fields, id);
|
|
new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("MachineChangeDetail", Fields, id);
|
|
|
}
|
|
}
|
|
|
db.SaveChanges();
|
|
db.SaveChanges();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
return "success";
|
|
return "success";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -210,7 +210,7 @@ Fields.Add("Remark", data.Remark); //备注
|
|
|
public string Open(string Id)
|
|
public string Open(string Id)
|
|
|
{
|
|
{
|
|
|
string[] idlist = Id.Split(new char[] { ',' });
|
|
string[] idlist = Id.Split(new char[] { ',' });
|
|
|
- AddSysLog(Id,"MachineChangeDetail","open");
|
|
|
|
|
|
|
+ AddSysLog(Id, "MachineChangeDetail", "open");
|
|
|
foreach (string subid in idlist)
|
|
foreach (string subid in idlist)
|
|
|
{
|
|
{
|
|
|
int id = int.Parse(subid);
|
|
int id = int.Parse(subid);
|
|
@@ -233,7 +233,7 @@ Fields.Add("Remark", data.Remark); //备注
|
|
|
public string Close(string Id)
|
|
public string Close(string Id)
|
|
|
{
|
|
{
|
|
|
string[] idlist = Id.Split(new char[] { ',' });
|
|
string[] idlist = Id.Split(new char[] { ',' });
|
|
|
- AddSysLog(Id,"MachineChangeDetail","close");
|
|
|
|
|
|
|
+ AddSysLog(Id, "MachineChangeDetail", "close");
|
|
|
foreach (string subid in idlist)
|
|
foreach (string subid in idlist)
|
|
|
{
|
|
{
|
|
|
int id = int.Parse(subid);
|
|
int id = int.Parse(subid);
|
|
@@ -255,7 +255,7 @@ Fields.Add("Remark", data.Remark); //备注
|
|
|
public string Sort(int Id, int Sort)
|
|
public string Sort(int Id, int Sort)
|
|
|
{
|
|
{
|
|
|
new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Sort("MachineChangeDetail", Sort, Id);
|
|
new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Sort("MachineChangeDetail", Sort, Id);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
AddSysLog(Id.ToString(), "MachineChangeDetail", "sort");
|
|
AddSysLog(Id.ToString(), "MachineChangeDetail", "sort");
|
|
|
return "success";
|
|
return "success";
|
|
|
}
|
|
}
|
|
@@ -270,15 +270,15 @@ Fields.Add("Remark", data.Remark); //备注
|
|
|
{
|
|
{
|
|
|
ExcelData = HttpUtility.UrlDecode(ExcelData);
|
|
ExcelData = HttpUtility.UrlDecode(ExcelData);
|
|
|
JsonData list = JsonMapper.ToObject(ExcelData);
|
|
JsonData list = JsonMapper.ToObject(ExcelData);
|
|
|
- for (int i = 1; i < list.Count;i++ )
|
|
|
|
|
|
|
+ for (int i = 1; i < list.Count; i++)
|
|
|
{
|
|
{
|
|
|
JsonData dr = list[i];
|
|
JsonData dr = list[i];
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
db.MachineChangeDetail.Add(new MachineChangeDetail()
|
|
db.MachineChangeDetail.Add(new MachineChangeDetail()
|
|
|
{
|
|
{
|
|
|
CreateDate = DateTime.Now,
|
|
CreateDate = DateTime.Now,
|
|
|
UpdateDate = DateTime.Now,
|
|
UpdateDate = DateTime.Now,
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
});
|
|
});
|
|
|
db.SaveChanges();
|
|
db.SaveChanges();
|
|
|
}
|
|
}
|
|
@@ -297,15 +297,15 @@ Fields.Add("Remark", data.Remark); //备注
|
|
|
{
|
|
{
|
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
Fields.Add("ChangeNo", "2"); //订单号
|
|
Fields.Add("ChangeNo", "2"); //订单号
|
|
|
-Fields.Add("CreateDate", "3"); //时间
|
|
|
|
|
-Fields.Add("BackProductType", "1"); //退回产品类型
|
|
|
|
|
-Fields.Add("BackDeviceStatus", "1"); //设备状态
|
|
|
|
|
|
|
+ Fields.Add("CreateDate", "3"); //时间
|
|
|
|
|
+ Fields.Add("BackProductType", "1"); //退回产品类型
|
|
|
|
|
+ Fields.Add("BackDeviceStatus", "1"); //设备状态
|
|
|
|
|
|
|
|
Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("MachineChangeDetail", Fields, "Id desc", "0", 1, 20000, "", "", false);
|
|
Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("MachineChangeDetail", Fields, "Id desc", "0", 1, 20000, "", "", false);
|
|
|
List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
foreach (Dictionary<string, object> dic in diclist)
|
|
foreach (Dictionary<string, object> dic in diclist)
|
|
|
{
|
|
{
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Dictionary<string, object> result = new Dictionary<string, object>();
|
|
Dictionary<string, object> result = new Dictionary<string, object>();
|
|
@@ -313,7 +313,7 @@ Fields.Add("BackDeviceStatus", "1"); //设备状态
|
|
|
result.Add("Info", "Excel报表-" + DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss") + ".xlsx");
|
|
result.Add("Info", "Excel报表-" + DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss") + ".xlsx");
|
|
|
result.Add("Obj", diclist);
|
|
result.Add("Obj", diclist);
|
|
|
Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
|
|
Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
result.Add("Fields", ReturnFields);
|
|
result.Add("Fields", ReturnFields);
|
|
|
AddSysLog("0", "MachineChangeDetail", "ExportExcel");
|
|
AddSysLog("0", "MachineChangeDetail", "ExportExcel");
|
|
|
return Json(result);
|
|
return Json(result);
|