|
@@ -128,8 +128,8 @@ namespace MySystem.Areas.Api.Controllers.v1.pos
|
|
|
}
|
|
}
|
|
|
public AppResultJson ConfirmApplyDo(string value)
|
|
public AppResultJson ConfirmApplyDo(string value)
|
|
|
{
|
|
{
|
|
|
- function.WriteLog("\r\n\r\n" + DateTime.Now.ToString(), "机具申请-确认申请-V2");
|
|
|
|
|
- function.WriteLog(value, "机具申请-确认申请-V2");
|
|
|
|
|
|
|
+ Utils.WriteLog("\r\n\r\n" + DateTime.Now.ToString(), "机具申请-确认申请-V2");
|
|
|
|
|
+ Utils.WriteLog(value, "机具申请-确认申请-V2");
|
|
|
JsonData data = JsonMapper.ToObject(value);
|
|
JsonData data = JsonMapper.ToObject(value);
|
|
|
int UserId = int.Parse(function.CheckInt(data["UserId"].ToString())); //创客
|
|
int UserId = int.Parse(function.CheckInt(data["UserId"].ToString())); //创客
|
|
|
int Kind = int.Parse(function.CheckInt(data["Kind"].ToString())); //申请类型,1-机具SN,2-200兑换码,3-300券
|
|
int Kind = int.Parse(function.CheckInt(data["Kind"].ToString())); //申请类型,1-机具SN,2-200兑换码,3-300券
|
|
@@ -149,7 +149,7 @@ namespace MySystem.Areas.Api.Controllers.v1.pos
|
|
|
int StoreId = int.Parse(function.CheckInt(data["StoreId"].ToString())); //仓库
|
|
int StoreId = int.Parse(function.CheckInt(data["StoreId"].ToString())); //仓库
|
|
|
var brand = maindb.KqProducts.ToList();
|
|
var brand = maindb.KqProducts.ToList();
|
|
|
string SnIdString = "";
|
|
string SnIdString = "";
|
|
|
- function.WriteLog("SnIdString:" + SnIdString, "机具申请-确认申请-V2");
|
|
|
|
|
|
|
+ Utils.WriteLog("SnIdString:" + SnIdString, "机具申请-确认申请-V2");
|
|
|
int DeliveryType = int.Parse(function.CheckInt(data["DeliveryType"].ToString())); //提货类型
|
|
int DeliveryType = int.Parse(function.CheckInt(data["DeliveryType"].ToString())); //提货类型
|
|
|
string Remark = data["Remark"].ToString(); //订单备注
|
|
string Remark = data["Remark"].ToString(); //订单备注
|
|
|
int AddressId = int.Parse(function.CheckInt(data["AddressId"].ToString())); //收货地址Id
|
|
int AddressId = int.Parse(function.CheckInt(data["AddressId"].ToString())); //收货地址Id
|
|
@@ -199,7 +199,7 @@ namespace MySystem.Areas.Api.Controllers.v1.pos
|
|
|
{
|
|
{
|
|
|
return new AppResultJson() { Status = "-1", Info = "请选择机具" };
|
|
return new AppResultJson() { Status = "-1", Info = "请选择机具" };
|
|
|
}
|
|
}
|
|
|
- function.WriteLog("Kind:" + Kind, "机具申请-确认申请-V2");
|
|
|
|
|
|
|
+ Utils.WriteLog("Kind:" + Kind, "机具申请-确认申请-V2");
|
|
|
string ApplyNo = "BA" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
|
|
string ApplyNo = "BA" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
|
|
|
int BrandId = int.Parse(function.CheckInt(ProductType));
|
|
int BrandId = int.Parse(function.CheckInt(ProductType));
|
|
|
KqProducts protype = KqProductsDbconn.Instance.GetList().FirstOrDefault(m => m.Id == BrandId) ?? new KqProducts();
|
|
KqProducts protype = KqProductsDbconn.Instance.GetList().FirstOrDefault(m => m.Id == BrandId) ?? new KqProducts();
|
|
@@ -236,8 +236,8 @@ namespace MySystem.Areas.Api.Controllers.v1.pos
|
|
|
OperateId = OpId,
|
|
OperateId = OpId,
|
|
|
}).Entity;
|
|
}).Entity;
|
|
|
maindb.SaveChanges();
|
|
maindb.SaveChanges();
|
|
|
- function.WriteLog("in", "机具申请-确认申请-V2");
|
|
|
|
|
- function.WriteLog("applyid:" + query.Id, "首页-客小爽产品-机具管理-机具申请-确认申请");
|
|
|
|
|
|
|
+ Utils.WriteLog("in", "机具申请-确认申请-V2");
|
|
|
|
|
+ Utils.WriteLog("applyid:" + query.Id, "首页-客小爽产品-机具管理-机具申请-确认申请");
|
|
|
RedisDbconn.Instance.ReleaseLock("MachineApply:" + UserId);
|
|
RedisDbconn.Instance.ReleaseLock("MachineApply:" + UserId);
|
|
|
Products product = ProductsDbconn.Instance.Get(protype.QueryCount) ?? new Products();
|
|
Products product = ProductsDbconn.Instance.Get(protype.QueryCount) ?? new Products();
|
|
|
Orders order = maindb.Orders.Add(new Orders()
|
|
Orders order = maindb.Orders.Add(new Orders()
|
|
@@ -267,8 +267,8 @@ namespace MySystem.Areas.Api.Controllers.v1.pos
|
|
|
OpId = OpId,
|
|
OpId = OpId,
|
|
|
}).Entity;
|
|
}).Entity;
|
|
|
maindb.SaveChanges();
|
|
maindb.SaveChanges();
|
|
|
- function.WriteLog("in2", "机具申请-确认申请-V2");
|
|
|
|
|
- function.WriteLog("orderid:" + order.Id, "首页-客小爽产品-机具管理-机具申请-确认申请");
|
|
|
|
|
|
|
+ Utils.WriteLog("in2", "机具申请-确认申请-V2");
|
|
|
|
|
+ Utils.WriteLog("orderid:" + order.Id, "首页-客小爽产品-机具管理-机具申请-确认申请");
|
|
|
MachineApply edit = maindb.MachineApply.FirstOrDefault(m => m.Id == query.Id);
|
|
MachineApply edit = maindb.MachineApply.FirstOrDefault(m => m.Id == query.Id);
|
|
|
if (edit != null)
|
|
if (edit != null)
|
|
|
{
|
|
{
|
|
@@ -295,8 +295,8 @@ namespace MySystem.Areas.Api.Controllers.v1.pos
|
|
|
OrderIds = order.Id.ToString(),
|
|
OrderIds = order.Id.ToString(),
|
|
|
}).Entity;
|
|
}).Entity;
|
|
|
maindb.SaveChanges();
|
|
maindb.SaveChanges();
|
|
|
- function.WriteLog("2", "首页-客小爽产品-机具管理-机具申请-确认申请");
|
|
|
|
|
- function.WriteLog("ok\r\n\r\n", "首页-客小爽产品-机具管理-机具申请-确认申请");
|
|
|
|
|
|
|
+ Utils.WriteLog("2", "首页-客小爽产品-机具管理-机具申请-确认申请");
|
|
|
|
|
+ Utils.WriteLog("ok\r\n\r\n", "首页-客小爽产品-机具管理-机具申请-确认申请");
|
|
|
return new AppResultJson() { Status = "1", Info = "", Data = Obj };
|
|
return new AppResultJson() { Status = "1", Info = "", Data = Obj };
|
|
|
}
|
|
}
|
|
|
return new AppResultJson() { Status = "-1", Info = "请选择机具", Data = Obj };
|
|
return new AppResultJson() { Status = "-1", Info = "请选择机具", Data = Obj };
|
|
@@ -329,7 +329,7 @@ namespace MySystem.Areas.Api.Controllers.v1.pos
|
|
|
{
|
|
{
|
|
|
return new AppResultJson() { Status = "-1", Info = "请选择兑换码" };
|
|
return new AppResultJson() { Status = "-1", Info = "请选择兑换码" };
|
|
|
}
|
|
}
|
|
|
- function.WriteLog("Kind:" + Kind, "机具申请-确认申请-V2");
|
|
|
|
|
|
|
+ Utils.WriteLog("Kind:" + Kind, "机具申请-确认申请-V2");
|
|
|
string ApplyNo = "BA" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
|
|
string ApplyNo = "BA" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
|
|
|
int BrandId = int.Parse(function.CheckInt(ProductType));
|
|
int BrandId = int.Parse(function.CheckInt(ProductType));
|
|
|
KqProducts protype = KqProductsDbconn.Instance.GetList().FirstOrDefault(m => m.Id == BrandId) ?? new KqProducts();
|
|
KqProducts protype = KqProductsDbconn.Instance.GetList().FirstOrDefault(m => m.Id == BrandId) ?? new KqProducts();
|
|
@@ -373,7 +373,7 @@ namespace MySystem.Areas.Api.Controllers.v1.pos
|
|
|
}).Entity;
|
|
}).Entity;
|
|
|
maindb.SaveChanges();
|
|
maindb.SaveChanges();
|
|
|
RedisDbconn.Instance.ReleaseLock("MachineApply:" + UserId);
|
|
RedisDbconn.Instance.ReleaseLock("MachineApply:" + UserId);
|
|
|
- function.WriteLog("in", "机具申请-确认申请-V2");
|
|
|
|
|
|
|
+ Utils.WriteLog("in", "机具申请-确认申请-V2");
|
|
|
Products product = ProductsDbconn.Instance.Get(protype.Sort) ?? new Products();
|
|
Products product = ProductsDbconn.Instance.Get(protype.Sort) ?? new Products();
|
|
|
Orders order = maindb.Orders.Add(new Orders()
|
|
Orders order = maindb.Orders.Add(new Orders()
|
|
|
{
|
|
{
|
|
@@ -401,7 +401,7 @@ namespace MySystem.Areas.Api.Controllers.v1.pos
|
|
|
OpId = OpId,
|
|
OpId = OpId,
|
|
|
}).Entity;
|
|
}).Entity;
|
|
|
maindb.SaveChanges();
|
|
maindb.SaveChanges();
|
|
|
- function.WriteLog("in2", "机具申请-确认申请-V2");
|
|
|
|
|
|
|
+ Utils.WriteLog("in2", "机具申请-确认申请-V2");
|
|
|
MachineApply edit = maindb.MachineApply.FirstOrDefault(m => m.Id == query.Id);
|
|
MachineApply edit = maindb.MachineApply.FirstOrDefault(m => m.Id == query.Id);
|
|
|
if (edit != null)
|
|
if (edit != null)
|
|
|
{
|
|
{
|