|
|
@@ -0,0 +1,941 @@
|
|
|
+/*
|
|
|
+ * 机具库
|
|
|
+ */
|
|
|
+
|
|
|
+using System;
|
|
|
+using System.Web;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Diagnostics;
|
|
|
+using System.Linq;
|
|
|
+using System.Data;
|
|
|
+using System.Threading.Tasks;
|
|
|
+using Microsoft.AspNetCore.Mvc;
|
|
|
+using Microsoft.AspNetCore.Http;
|
|
|
+using Microsoft.Extensions.Logging;
|
|
|
+using Microsoft.Extensions.Options;
|
|
|
+using MySystem.Models;
|
|
|
+using Library;
|
|
|
+using LitJson;
|
|
|
+using MySystemLib;
|
|
|
+
|
|
|
+namespace MySystem.Areas.Admin.Controllers
|
|
|
+{
|
|
|
+ [Area("Admin")]
|
|
|
+ [Route("Admin/[controller]/[action]")]
|
|
|
+ public class PosMachinesTwoChangeController : BaseController
|
|
|
+ {
|
|
|
+ public PosMachinesTwoChangeController(IHttpContextAccessor accessor, ILogger<BaseController> logger, IOptions<Setting> setting) : base(accessor, logger, setting)
|
|
|
+ {
|
|
|
+ OtherMySqlConn.connstr = ConfigurationManager.AppSettings["SqlConnStr"].ToString();
|
|
|
+ }
|
|
|
+
|
|
|
+ #region 机具库列表
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 根据条件查询机具库列表
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public IActionResult Index(PosMachinesTwo data, string right)
|
|
|
+ {
|
|
|
+ ViewBag.RightInfo = RightInfo;
|
|
|
+ ViewBag.right = right;
|
|
|
+
|
|
|
+ return View();
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 根据条件查询机具库列表
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 机具库列表
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public JsonResult IndexData(PosMachinesTwo data, string BindingStateSelect, string ActivationStateSelect, string UpFeeFlagSelect, string UserIdMakerCode, string UserIdRealName, string StoreIdCode, string StoreIdName, string ActivationDateData, string BindingDateData, int page = 1, int limit = 30)
|
|
|
+ {
|
|
|
+
|
|
|
+ Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
+
|
|
|
+ Fields.Add("PosSn", "1"); //SN编号
|
|
|
+ Fields.Add("BrandId", "0"); //品牌
|
|
|
+
|
|
|
+ string condition = " and Status>-1 AND BindingState = 1 AND DATE_SUB(CURDATE(), INTERVAL 180 DAY) >= date(BindingTime)";
|
|
|
+ //绑定状态
|
|
|
+ if (!string.IsNullOrEmpty(BindingStateSelect))
|
|
|
+ {
|
|
|
+ condition += " and BindingState=" + BindingStateSelect;
|
|
|
+ }
|
|
|
+ //激活状态
|
|
|
+ if (!string.IsNullOrEmpty(ActivationStateSelect))
|
|
|
+ {
|
|
|
+ condition += " and ActivationState=" + ActivationStateSelect;
|
|
|
+ }
|
|
|
+ //所属创客编号
|
|
|
+ if (!string.IsNullOrEmpty(UserIdMakerCode))
|
|
|
+ {
|
|
|
+ condition += " and BuyUserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
|
|
|
+ }
|
|
|
+ //所属创客真实姓名
|
|
|
+ if (!string.IsNullOrEmpty(UserIdRealName))
|
|
|
+ {
|
|
|
+ condition += " and BuyUserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
|
|
|
+ }
|
|
|
+ //所属仓库编号
|
|
|
+ if (!string.IsNullOrEmpty(StoreIdCode))
|
|
|
+ {
|
|
|
+ condition += " and StoreId in (select StoreId from StoreForCode where Code='" + StoreIdCode + "')";
|
|
|
+ }
|
|
|
+ //所属仓库名称
|
|
|
+ if (!string.IsNullOrEmpty(StoreIdName))
|
|
|
+ {
|
|
|
+ condition += " and StoreId in (select StoreId from StoreForName where Name='" + StoreIdName + "')";
|
|
|
+ }
|
|
|
+ //品牌
|
|
|
+ // condition += " and BrandId = " + data.BrandId;
|
|
|
+ if (!string.IsNullOrEmpty(UpFeeFlagSelect))
|
|
|
+ {
|
|
|
+ condition += " and UpFeeFlag = " + UpFeeFlagSelect;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(ActivationDateData))
|
|
|
+ {
|
|
|
+ string[] datelist = ActivationDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
+ string start = datelist[0];
|
|
|
+ string end = datelist[1];
|
|
|
+ condition += " and ActivationTime>='" + start + " 00:00:00' and ActivationTime<='" + end + " 23:59:59'";
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(BindingDateData))
|
|
|
+ {
|
|
|
+ string[] datelist = BindingDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
+ string start = datelist[0];
|
|
|
+ string end = datelist[1];
|
|
|
+ condition += " and BindingTime>='" + start + " 00:00:00' and BindingTime<='" + end + " 23:59:59'";
|
|
|
+ }
|
|
|
+
|
|
|
+ Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("PosMachinesTwo", Fields, "Id desc", "0", page, limit, condition);
|
|
|
+ List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
+ foreach (Dictionary<string, object> dic in diclist)
|
|
|
+ {
|
|
|
+ //绑定状态
|
|
|
+ int BindingState = int.Parse(dic["BindingState"].ToString());
|
|
|
+ if (BindingState == 0) dic["BindingState"] = "未绑定";
|
|
|
+ if (BindingState == 1) dic["BindingState"] = "已绑定";
|
|
|
+ //激活状态
|
|
|
+ int ActivationState = int.Parse(dic["ActivationState"].ToString());
|
|
|
+ if (ActivationState == 0) dic["ActivationState"] = "未激活";
|
|
|
+ if (ActivationState == 1) dic["ActivationState"] = "已激活";
|
|
|
+ //所属创客
|
|
|
+ int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
|
|
|
+ Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
|
|
|
+ dic["UserIdMakerCode"] = userid_Users.MakerCode;
|
|
|
+ dic["UserIdRealName"] = userid_Users.RealName;
|
|
|
+ dic.Remove("UserId");
|
|
|
+ //所属仓库
|
|
|
+ int StoreId = int.Parse(function.CheckInt(dic["StoreId"].ToString()));
|
|
|
+ StoreHouse storeid_StoreHouse = db.StoreHouse.FirstOrDefault(m => m.Id == StoreId) ?? new StoreHouse();
|
|
|
+ dic["StoreIdCode"] = storeid_StoreHouse.StoreNo;
|
|
|
+ dic["StoreIdName"] = storeid_StoreHouse.StoreName;
|
|
|
+ dic.Remove("StoreId");
|
|
|
+ //产品类型
|
|
|
+ dic["BrandId"] = RelationClass.GetKqProductBrandInfo(int.Parse(dic["BrandId"].ToString()));
|
|
|
+ //参加活动
|
|
|
+ dic["ActivityList"] = RelationClass.GetProfitObjectsActivesList(dic["ActivityList"].ToString());
|
|
|
+ //绑定商户
|
|
|
+ int BindMerchantId = int.Parse(function.CheckInt(dic["BindMerchantId"].ToString()));
|
|
|
+ PosMerchantInfo bindmerchantid_MerchantInfo = db.PosMerchantInfo.FirstOrDefault(m => m.Id == BindMerchantId) ?? new PosMerchantInfo();
|
|
|
+ dic["BindMerchantIdMerchantNo"] = bindmerchantid_MerchantInfo.MerchantNo;
|
|
|
+ dic["BindMerchantIdMerchantName"] = bindmerchantid_MerchantInfo.MerchantName;
|
|
|
+ dic.Remove("BindMerchantId");
|
|
|
+ //机具类型
|
|
|
+ int PosSnType = int.Parse(dic["PosSnType"].ToString());
|
|
|
+ if (PosSnType == 0) dic["PosSnType"] = "购买机具";
|
|
|
+ if (PosSnType == 1) dic["PosSnType"] = "赠送机具";
|
|
|
+ //设备类型
|
|
|
+ string DeviceType = dic["DeviceType"].ToString();
|
|
|
+ if (DeviceType == "KysSignPos") dic["DeviceType"] = "快益刷电签POS";
|
|
|
+ if (DeviceType == "KssSignPos") dic["DeviceType"] = "快闪刷电签POS";
|
|
|
+ if (DeviceType == "") dic["DeviceType"] = "";
|
|
|
+
|
|
|
+ //盟主信息
|
|
|
+ int LeaderUserId = int.Parse(function.CheckInt(dic["LeaderUserId"].ToString()));
|
|
|
+ if (LeaderUserId != 0)
|
|
|
+ {
|
|
|
+ Users users = db.Users.FirstOrDefault(m => m.Id == LeaderUserId) ?? new Users();
|
|
|
+ dic["UserInfo"] = users.MakerCode + "_" + users.RealName;
|
|
|
+ }
|
|
|
+
|
|
|
+ //是否为第一台机具
|
|
|
+ int IsFirst = int.Parse(dic["IsFirst"].ToString());
|
|
|
+ if (IsFirst == 0) dic["IsFirst"] = "否";
|
|
|
+ if (IsFirst == 1) dic["IsFirst"] = "是";
|
|
|
+
|
|
|
+ //循环开始时间
|
|
|
+ if (!string.IsNullOrEmpty(dic["RecycEndDate"].ToString()))
|
|
|
+ {
|
|
|
+ var RecycStartDate = Convert.ToDateTime(dic["RecycEndDate"].ToString()).AddMonths(-3).ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
+ dic["RecycStartDate"] = RecycStartDate;
|
|
|
+ }
|
|
|
+
|
|
|
+ //是否调升
|
|
|
+ int UpFeeFlag = int.Parse(dic["UpFeeFlag"].ToString());
|
|
|
+ if (UpFeeFlag == 0) dic["UpFeeFlag"] = "否";
|
|
|
+ if (UpFeeFlag == 1) dic["UpFeeFlag"] = "是";
|
|
|
+
|
|
|
+ //是否调降
|
|
|
+ int DownFeeFlag = int.Parse(dic["DownFeeFlag"].ToString());
|
|
|
+ if (DownFeeFlag == 0) dic["DownFeeFlag"] = "否";
|
|
|
+ if (DownFeeFlag == 1) dic["DownFeeFlag"] = "是";
|
|
|
+
|
|
|
+ //调升时间
|
|
|
+ if (!string.IsNullOrEmpty(dic["UpFeeDate"].ToString()))
|
|
|
+ {
|
|
|
+ var UpFeeDate = Convert.ToDateTime(dic["UpFeeDate"].ToString()).ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
+ dic["UpFeeDate"] = UpFeeDate;
|
|
|
+ }
|
|
|
+
|
|
|
+ //调降时间
|
|
|
+ if (!string.IsNullOrEmpty(dic["DownFeeDate"].ToString()))
|
|
|
+ {
|
|
|
+ var DownFeeDate = Convert.ToDateTime(dic["DownFeeDate"].ToString()).ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
+ dic["DownFeeDate"] = DownFeeDate;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ Dictionary<string, object> other = new Dictionary<string, object>();
|
|
|
+ int TotalCount = 0;//总机具数
|
|
|
+ string KysCount99 = "0.00";
|
|
|
+ string KssCount99 = "0.00";
|
|
|
+ string KssCoun198 = "0.00";
|
|
|
+ string KssCount298 = "0.00";
|
|
|
+ DataTable dt = OtherMySqlConn.dtable("select count(0) from PosMachinesTwo where 1=1" + condition);
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ TotalCount = int.Parse(function.CheckNum(dt.Rows[0][0].ToString()));
|
|
|
+ }
|
|
|
+ // dt = OtherMySqlConn.dtable("select sum(TotalPrice) from Orders where PayStatus=1" + condition);
|
|
|
+ // if (dt.Rows.Count > 0)
|
|
|
+ // {
|
|
|
+ // FailAmount = decimal.Parse(function.CheckNum(dt.Rows[0][0].ToString())).ToString("f2");
|
|
|
+ // }
|
|
|
+ other.Add("TotalCount", TotalCount);
|
|
|
+ other.Add("KysCount99", 0);
|
|
|
+ other.Add("KssCount99", 0);
|
|
|
+ other.Add("KssCoun198", 0);
|
|
|
+ other.Add("KssCount298", 0);
|
|
|
+ obj.Add("other", other);
|
|
|
+ return Json(obj);
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 增加机具库
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 增加或修改机具库信息
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public IActionResult Add(string right)
|
|
|
+ {
|
|
|
+ ViewBag.RightInfo = RightInfo;
|
|
|
+ ViewBag.right = right;
|
|
|
+
|
|
|
+
|
|
|
+ return View();
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 增加机具库
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 增加或修改机具库信息
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ public string Add(PosMachinesTwo data)
|
|
|
+ {
|
|
|
+ Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
+
|
|
|
+
|
|
|
+ Fields.Add("SeoTitle", data.SeoTitle);
|
|
|
+ Fields.Add("SeoKeyword", data.SeoKeyword);
|
|
|
+ Fields.Add("SeoDescription", data.SeoDescription);
|
|
|
+ int Id = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Add("PosMachinesTwo", Fields, 0);
|
|
|
+ AddSysLog(data.Id.ToString(), "PosMachinesTwo", "add");
|
|
|
+ db.SaveChanges();
|
|
|
+
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 修改机具库
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 增加或修改机具库信息
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public IActionResult Edit(string right, int Id = 0)
|
|
|
+ {
|
|
|
+ ViewBag.RightInfo = RightInfo;
|
|
|
+ ViewBag.right = right;
|
|
|
+
|
|
|
+
|
|
|
+ PosMachinesTwo editData = db.PosMachinesTwo.FirstOrDefault(m => m.Id == Id) ?? new PosMachinesTwo();
|
|
|
+ ViewBag.data = editData;
|
|
|
+ return View();
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 修改机具库
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 增加或修改机具库信息
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ public string Edit(PosMachinesTwo data)
|
|
|
+ {
|
|
|
+ Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
+ Fields.Add("PosSnType", data.PosSnType);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("PosMachinesTwo", Fields, data.Id);
|
|
|
+ AddSysLog(data.Id.ToString(), "PosMachinesTwo", "update");
|
|
|
+ db.SaveChanges();
|
|
|
+ RedisDbconn.Instance.Clear("PosMachinesTwo:" + data.Id);
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+
|
|
|
+ #region 未使用机具归位总仓
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 未使用机具归位总仓
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public IActionResult Home(string right, int Id = 0)
|
|
|
+ {
|
|
|
+ ViewBag.RightInfo = RightInfo;
|
|
|
+ ViewBag.right = right;
|
|
|
+
|
|
|
+
|
|
|
+ PosMachinesTwo editData = db.PosMachinesTwo.FirstOrDefault(m => m.Id == Id) ?? new PosMachinesTwo();
|
|
|
+ ViewBag.data = editData;
|
|
|
+ return View();
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 未使用机具归位总仓
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 未使用机具归位总仓
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ public string Home(PosMachinesTwo data)
|
|
|
+ {
|
|
|
+ Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
+ Fields.Add("SeoTitle", "");
|
|
|
+ Fields.Add("SeoKeyword", "");
|
|
|
+ Fields.Add("PosSnType", 0);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("PosMachinesTwo", Fields, data.Id);
|
|
|
+ AddSysLog(data.Id.ToString(), "PosMachinesTwo", "home");
|
|
|
+ db.SaveChanges();
|
|
|
+ RedisDbconn.Instance.Clear("PosMachinesTwo:" + data.Id);
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+
|
|
|
+ #region 删除机具库信息
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 删除机具库信息
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public string Delete(string Id)
|
|
|
+ {
|
|
|
+ string[] idlist = Id.Split(new char[] { ',' });
|
|
|
+ AddSysLog(Id, "PosMachinesTwo", "del");
|
|
|
+ foreach (string subid in idlist)
|
|
|
+ {
|
|
|
+ int id = int.Parse(subid);
|
|
|
+ Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
+ Fields.Add("Status", -1);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("PosMachinesTwo", Fields, id);
|
|
|
+ }
|
|
|
+ db.SaveChanges();
|
|
|
+
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 开启
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 开启
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public string Open(string Id)
|
|
|
+ {
|
|
|
+ string[] idlist = Id.Split(new char[] { ',' });
|
|
|
+ AddSysLog(Id, "PosMachinesTwo", "open");
|
|
|
+ foreach (string subid in idlist)
|
|
|
+ {
|
|
|
+ int id = int.Parse(subid);
|
|
|
+ Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
+ Fields.Add("Status", 1);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("PosMachinesTwo", Fields, id);
|
|
|
+ }
|
|
|
+ db.SaveChanges();
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 关闭
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 关闭
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public string Close(string Id)
|
|
|
+ {
|
|
|
+ string[] idlist = Id.Split(new char[] { ',' });
|
|
|
+ AddSysLog(Id, "PosMachinesTwo", "close");
|
|
|
+ foreach (string subid in idlist)
|
|
|
+ {
|
|
|
+ int id = int.Parse(subid);
|
|
|
+ Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
+ Fields.Add("Status", 0);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("PosMachinesTwo", Fields, id);
|
|
|
+ }
|
|
|
+ db.SaveChanges();
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 排序
|
|
|
+ /// <summary>
|
|
|
+ /// 排序
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="Id"></param>
|
|
|
+ public string Sort(int Id, int Sort)
|
|
|
+ {
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Sort("PosMachinesTwo", Sort, Id);
|
|
|
+
|
|
|
+ AddSysLog(Id.ToString(), "PosMachinesTwo", "sort");
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+
|
|
|
+ #region 批量调升费率
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 批量调升费率
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public string BatchSetting(string Id)
|
|
|
+ {
|
|
|
+ string[] idlist = Id.Split(new char[] { ',' });
|
|
|
+ AddSysLog(Id, "PosMachinesTwo", "UpFeePosMachinesTwo");
|
|
|
+ List<int> posIds = new List<int>();
|
|
|
+ List<int> upposIds = new List<int>();
|
|
|
+ string userIds = "";
|
|
|
+ foreach (string subids in idlist)
|
|
|
+ {
|
|
|
+ int id = int.Parse(subids);
|
|
|
+ var pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == id) ?? new PosMachinesTwo();
|
|
|
+ Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
+ Fields.Add("UpFeeFlag", 1);
|
|
|
+ Fields.Add("UpFeeMan", SysUserName);
|
|
|
+ Fields.Add("UpFeeDate", DateTime.Now);
|
|
|
+
|
|
|
+ if (!userIds.Contains(pos.BuyUserId.ToString()))
|
|
|
+ {
|
|
|
+ userIds += pos.BuyUserId + ",";
|
|
|
+ }
|
|
|
+
|
|
|
+ if (pos.BrandId == 1 || pos.BrandId == 3 || pos.BrandId == 6)
|
|
|
+ {
|
|
|
+
|
|
|
+
|
|
|
+ // PosId:机具Id
|
|
|
+ // Kind:1或2,1为费率0.63,2为费率0.6
|
|
|
+ // OpMan:操作人,app传创客编号,后台传SysUserName
|
|
|
+ string info = "{\"RecordId\":\"\",\"PosId\":\"" + id + "\",\"Fee\": \"" + 0.63 + "\",\"Kind\": \"" + 1 + "\",\"OpMan\": \"" + SysUserName + "\"}";
|
|
|
+ RedisDbconn.Instance.AddList("SetDepositQueue", info);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ upposIds.Add(id);
|
|
|
+ }
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("PosMachinesTwo", Fields, id);
|
|
|
+
|
|
|
+ }
|
|
|
+ string[] lists = userIds.TrimEnd(',').Split(new char[] { ',' });
|
|
|
+ int times = lists.ToList().Count;
|
|
|
+ if (upposIds.Count > 0)
|
|
|
+ {
|
|
|
+ //调升
|
|
|
+ for (int i = 0; i < times; i++)
|
|
|
+ {
|
|
|
+ var UserId = lists[i];
|
|
|
+ var posInfo = db.PosMachinesTwo.Where(m => upposIds.Contains(m.Id) && m.BuyUserId == Convert.ToInt32(UserId)).ToList();
|
|
|
+ string snhtml = "<div style='margin-bottom: .48rem;'>";
|
|
|
+ foreach (var items in posInfo)
|
|
|
+ {
|
|
|
+ var mer = db.PosMerchantInfo.FirstOrDefault(m => m.Id == items.BindMerchantId);
|
|
|
+ string Name = mer.MerchantName;
|
|
|
+ if (mer.BrandId == 2)
|
|
|
+ {
|
|
|
+ if (Name.Contains("-"))
|
|
|
+ {
|
|
|
+ Name = Name.Split('-')[1];
|
|
|
+ }
|
|
|
+ else if (Name.Contains("_"))
|
|
|
+ {
|
|
|
+ Name = Name.Split('_')[1];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var brand = db.KqProducts.FirstOrDefault(m => m.Id == items.BrandId);
|
|
|
+ snhtml += "<div style='margin-bottom: .48rem;'><div class='f16'>商户姓名:" + Name + "</div>";
|
|
|
+ snhtml += "<div class='f16'>机具品牌:" + brand.Name + "</div>";
|
|
|
+ snhtml += "<div class='f16'>SN:" + items.PosSn + "</div></div>";
|
|
|
+ }
|
|
|
+ snhtml += "</div>";
|
|
|
+ RedisDbconn.Instance.AddList("MsgPersonalQueue", Newtonsoft.Json.JsonConvert.SerializeObject(new MsgPersonal()
|
|
|
+ {
|
|
|
+ UserId = Convert.ToInt32(UserId), //创客
|
|
|
+ Title = "商户费率变更通知", //标题
|
|
|
+ Content = "<div class='f16' style='margin-bottom: .72rem'>您的部分机具已绑定超过180天,刷卡费率已自动变更为0.63%,如需调整费率,请前往我的商户-商户详情中调整费率</div>" + snhtml, //内容
|
|
|
+ Summary = "您的部分机具已绑定超过180天,刷卡费率已自动变更为0.63%,如需调整费率,请前往我的商户-商户详情中调整费率",
|
|
|
+ CreateDate = DateTime.Now,
|
|
|
+
|
|
|
+ }));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ db.SaveChanges();
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+
|
|
|
+ // #region 批量调升费率(无接口限制)
|
|
|
+
|
|
|
+ // /// <summary>
|
|
|
+ // /// 批量调升费率
|
|
|
+ // /// </summary>
|
|
|
+ // /// <returns></returns>
|
|
|
+ // public string BatchSetting(string Id)
|
|
|
+ // {
|
|
|
+ // string[] idlist = Id.Split(new char[] { ',' });
|
|
|
+ // AddSysLog(Id, "PosMachinesTwo", "UpFeePosMachinesTwo");
|
|
|
+ // List<int> posIds = new List<int>();
|
|
|
+ // List<int> upposIds = new List<int>();
|
|
|
+ // string userIds = "";
|
|
|
+ // foreach (string subids in idlist)
|
|
|
+ // {
|
|
|
+ // int id = int.Parse(subids);
|
|
|
+ // var pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == id) ?? new PosMachinesTwo();
|
|
|
+ // Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
+ // Fields.Add("UpFeeFlag", 1);
|
|
|
+ // Fields.Add("UpFeeMan", SysUserName);
|
|
|
+ // Fields.Add("UpFeeDate", DateTime.Now);
|
|
|
+
|
|
|
+ // if (!userIds.Contains(pos.BuyUserId.ToString()))
|
|
|
+ // {
|
|
|
+ // userIds += pos.BuyUserId + ",";
|
|
|
+ // }
|
|
|
+ // upposIds.Add(id);
|
|
|
+ // new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("PosMachinesTwo", Fields, id);
|
|
|
+
|
|
|
+ // }
|
|
|
+ // string[] lists = userIds.TrimEnd(',').Split(new char[] { ',' });
|
|
|
+ // int times = lists.ToList().Count;
|
|
|
+ // if (upposIds.Count > 0)
|
|
|
+ // {
|
|
|
+ // //调升
|
|
|
+ // for (int i = 0; i < times; i++)
|
|
|
+ // {
|
|
|
+ // var UserId = lists[i];
|
|
|
+ // var posInfo = db.PosMachinesTwo.Where(m => upposIds.Contains(m.Id) && m.BuyUserId == Convert.ToInt32(UserId)).ToList();
|
|
|
+ // string snhtml = "<div style='margin-bottom: .48rem;'>";
|
|
|
+ // foreach (var items in posInfo)
|
|
|
+ // {
|
|
|
+ // var mer = db.PosMerchantInfo.FirstOrDefault(m => m.Id == items.BindMerchantId);
|
|
|
+ // string Name = mer.MerchantName;
|
|
|
+ // if (mer.BrandId == 2)
|
|
|
+ // {
|
|
|
+ // if (Name.Contains("-"))
|
|
|
+ // {
|
|
|
+ // Name = Name.Split('-')[1];
|
|
|
+ // }
|
|
|
+ // else if (Name.Contains("_"))
|
|
|
+ // {
|
|
|
+ // Name = Name.Split('_')[1];
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // var brand = db.KqProducts.FirstOrDefault(m => m.Id == items.BrandId);
|
|
|
+ // snhtml += "<div style='margin-bottom: .48rem;'><div class='f16'>商户姓名:" + Name + "</div>";
|
|
|
+ // snhtml += "<div class='f16'>机具品牌:" + brand.Name + "</div>";
|
|
|
+ // snhtml += "<div class='f16'>SN:" + items.PosSn + "</div></div>";
|
|
|
+ // }
|
|
|
+ // snhtml += "</div>";
|
|
|
+ // RedisDbconn.Instance.AddList("MsgPersonalQueue", Newtonsoft.Json.JsonConvert.SerializeObject(new MsgPersonal()
|
|
|
+ // {
|
|
|
+ // UserId = Convert.ToInt32(UserId), //创客
|
|
|
+ // Title = "商户费率变更通知", //标题
|
|
|
+ // Content = "<div class='f16' style='margin-bottom: .72rem'>您的部分机具已绑定超过180天,刷卡费率已自动变更为0.63%,如需调整费率,请前往我的商户-商户详情中调整费率</div>" + snhtml, //内容
|
|
|
+ // Summary = "您的部分机具已绑定超过180天,刷卡费率已自动变更为0.63%,如需调整费率,请前往我的商户-商户详情中调整费率",
|
|
|
+ // CreateDate = DateTime.Now,
|
|
|
+
|
|
|
+ // }));
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // db.SaveChanges();
|
|
|
+ // db.Dispose();
|
|
|
+ // return "success";
|
|
|
+ // }
|
|
|
+
|
|
|
+ // #endregion
|
|
|
+
|
|
|
+
|
|
|
+ #region 导入费率调整结果
|
|
|
+ /// <summary>
|
|
|
+ /// 导入费率调整结果
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="ExcelData"></param>
|
|
|
+ public string ImportEnd(string ExcelData)
|
|
|
+ {
|
|
|
+ ExcelData = HttpUtility.UrlDecode(ExcelData);
|
|
|
+ JsonData list = JsonMapper.ToObject(ExcelData);
|
|
|
+
|
|
|
+ List<int> dnposIds = new List<int>();
|
|
|
+ string userIds = "";
|
|
|
+ string warning = "";
|
|
|
+
|
|
|
+ for (int i = 1; i < list.Count; i++)
|
|
|
+ {
|
|
|
+ JsonData dr = list[i];
|
|
|
+ string PosNo = dr[0].ToString(); // 机具Sn
|
|
|
+ var Amount = double.Parse(dr[1].ToString()); // 调整费率
|
|
|
+ int Kind = int.Parse(dr[2].ToString()); // 1 调升 2 调低
|
|
|
+ var pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == PosNo) ?? new PosMachinesTwo();
|
|
|
+ if (pos.UpFeeFlag == 1)
|
|
|
+ {
|
|
|
+ if (Kind != 2 || Amount != 0.6)
|
|
|
+ {
|
|
|
+ warning += PosNo + ",该机具调低费率数值或类型不正确,请检查好后全部重新导入";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (Kind == 2 && Amount == 0.6)
|
|
|
+ {
|
|
|
+ pos.DownFeeFlag = 1;
|
|
|
+ pos.DownFeeDate = DateTime.Now;
|
|
|
+ pos.DownFeeMan = SysUserName + "_" + SysRealName;
|
|
|
+ var poschange = db.PosMachinesFeeChangeRecord.FirstOrDefault(m => m.PosId == pos.Id);
|
|
|
+ poschange.Status = 1;
|
|
|
+ db.SaveChanges();
|
|
|
+ dnposIds.Add(pos.Id);
|
|
|
+
|
|
|
+ }
|
|
|
+ if (!userIds.Contains(pos.BuyUserId.ToString()))
|
|
|
+ {
|
|
|
+ userIds += pos.BuyUserId + ",";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ else
|
|
|
+ {
|
|
|
+ warning += PosNo + ",该机具不符合调低条件,请检查好后全部重新导入";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(warning))
|
|
|
+ {
|
|
|
+ return "waning |" + warning;
|
|
|
+ }
|
|
|
+ string[] lists = userIds.TrimEnd(',').Split(new char[] { ',' });
|
|
|
+ int times = lists.ToList().Count;
|
|
|
+ if (dnposIds.Count > 0)
|
|
|
+ {
|
|
|
+ //调降
|
|
|
+ for (int i = 0; i < times; i++)
|
|
|
+ {
|
|
|
+ var UserId = lists[i];
|
|
|
+ var posInfo = db.PosMachinesTwo.Where(m => dnposIds.Contains(m.Id) && m.BuyUserId == Convert.ToInt32(UserId)).ToList();
|
|
|
+ string snhtml = "<div style='margin-bottom: .48rem;'>";
|
|
|
+ foreach (var items in posInfo)
|
|
|
+ {
|
|
|
+ var mer = db.PosMerchantInfo.FirstOrDefault(m => m.Id == items.BindMerchantId);
|
|
|
+ string Name = mer.MerchantName;
|
|
|
+ if (mer.BrandId == 2)
|
|
|
+ {
|
|
|
+ if (Name.Contains("-"))
|
|
|
+ {
|
|
|
+ Name = Name.Split('-')[1];
|
|
|
+ }
|
|
|
+ else if (Name.Contains("_"))
|
|
|
+ {
|
|
|
+ Name = Name.Split('_')[1];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var brand = db.KqProducts.FirstOrDefault(m => m.Id == items.BrandId);
|
|
|
+ snhtml += "<div style='margin-bottom: .48rem;'><div class='f16'>商户姓名:" + Name + "</div>";
|
|
|
+ snhtml += "<div class='f16'>机具品牌:" + brand.Name + "</div>";
|
|
|
+ snhtml += "<div class='f16'>SN:" + items.PosSn + "</div>";
|
|
|
+ snhtml += "<div class='f16'>当前费率:0.6%</div>";
|
|
|
+ snhtml += "<div class='f16'>费率调整时间:" + items.DownFeeDate + "</div></div>";
|
|
|
+ }
|
|
|
+ snhtml += "</div>";
|
|
|
+ RedisDbconn.Instance.AddList("MsgPersonalQueue", Newtonsoft.Json.JsonConvert.SerializeObject(new MsgPersonal()
|
|
|
+ {
|
|
|
+ UserId = Convert.ToInt32(UserId), //创客
|
|
|
+ Title = "商户费率变更通知", //标题
|
|
|
+ Content = "<div class='f16' style='margin-bottom: .72rem'>您的商户刷卡交易费率已变更成功!</div>" + snhtml, //内容
|
|
|
+ Summary = "您的商户刷卡交易费率已变更成功!",
|
|
|
+ CreateDate = DateTime.Now,
|
|
|
+
|
|
|
+ }));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ AddSysLog("0", "PosMachinesTwoChange", "ImportEnd");
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+
|
|
|
+ #region 导入数据
|
|
|
+
|
|
|
+ public IActionResult Import(string right)
|
|
|
+ {
|
|
|
+ ViewBag.RightInfo = RightInfo;
|
|
|
+ ViewBag.right = right;
|
|
|
+ return View();
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 导入数据
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="ExcelData"></param>
|
|
|
+ [HttpPost]
|
|
|
+ public string ImportPost(string ExcelPath)
|
|
|
+ {
|
|
|
+ string key = function.MD5_16(Guid.NewGuid().ToString());
|
|
|
+ RedisDbconn.Instance.AddList("ExcelImportV2", ExcelPath + "#cut#ChangeFee#cut#" + key + "#cut#" + SysUserName);
|
|
|
+ return "success|" + key;
|
|
|
+ }
|
|
|
+ public string CheckImport(string key)
|
|
|
+ {
|
|
|
+ string result = RedisDbconn.Instance.Get<string>("CheckImport:" + key);
|
|
|
+ if (!string.IsNullOrEmpty(result))
|
|
|
+ {
|
|
|
+ string[] datalist = result.Split('|');
|
|
|
+ if (datalist[0] == "success")
|
|
|
+ {
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ return datalist[0];
|
|
|
+ }
|
|
|
+ return "0";
|
|
|
+ }
|
|
|
+ public Dictionary<string, object> CheckImportV2(string key)
|
|
|
+ {
|
|
|
+ Dictionary<string, object> Obj = new Dictionary<string, object>();
|
|
|
+ string result = RedisDbconn.Instance.Get<string>("CheckImport:" + key);
|
|
|
+ if (!string.IsNullOrEmpty(result))
|
|
|
+ {
|
|
|
+ string[] datalist = result.Split('|');
|
|
|
+ if (datalist[0] == "success")
|
|
|
+ {
|
|
|
+ List<string> errList = RedisDbconn.Instance.GetList<string>("ErrList" + key);
|
|
|
+ if (errList.Count > 0)
|
|
|
+ {
|
|
|
+ Obj.Add("status", 2);
|
|
|
+ Obj.Add("errList", errList);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Obj.Add("status", 1);
|
|
|
+ Obj.Add("data", result);
|
|
|
+ }
|
|
|
+ return Obj;
|
|
|
+ }
|
|
|
+ Obj.Add("status", 0);
|
|
|
+ Obj.Add("data", datalist[0]);
|
|
|
+ return Obj;
|
|
|
+ }
|
|
|
+ Obj.Add("status", -1);
|
|
|
+ Obj.Add("data", "执行中...");
|
|
|
+ return Obj;
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+
|
|
|
+ #region 导出Excel
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 导出Excel
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public JsonResult ExportExcel(PosMachinesTwo data, string BindingStateSelect, string ActivationStateSelect, string UserIdMakerCode, string UserIdRealName, string StoreIdCode, string StoreIdName)
|
|
|
+ {
|
|
|
+ Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
+ Fields.Add("PosSn", "1"); //SN编号
|
|
|
+ Fields.Add("BrandId", "0"); //品牌
|
|
|
+
|
|
|
+ string condition = " and Status>-1";
|
|
|
+ //绑定状态
|
|
|
+ if (!string.IsNullOrEmpty(BindingStateSelect))
|
|
|
+ {
|
|
|
+ condition += " and BindingState=" + BindingStateSelect;
|
|
|
+ }
|
|
|
+ //激活状态
|
|
|
+ if (!string.IsNullOrEmpty(ActivationStateSelect))
|
|
|
+ {
|
|
|
+ condition += " and ActivationState=" + ActivationStateSelect;
|
|
|
+ }
|
|
|
+ //所属创客创客编号
|
|
|
+ if (!string.IsNullOrEmpty(UserIdMakerCode))
|
|
|
+ {
|
|
|
+ condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
|
|
|
+ }
|
|
|
+ //所属创客真实姓名
|
|
|
+ if (!string.IsNullOrEmpty(UserIdRealName))
|
|
|
+ {
|
|
|
+ condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
|
|
|
+ }
|
|
|
+ //所属仓库编号
|
|
|
+ if (!string.IsNullOrEmpty(StoreIdCode))
|
|
|
+ {
|
|
|
+ condition += " and StoreId in (select StoreId from StoreForCode where Code='" + StoreIdCode + "')";
|
|
|
+ }
|
|
|
+ //所属仓库名称
|
|
|
+ if (!string.IsNullOrEmpty(StoreIdName))
|
|
|
+ {
|
|
|
+ condition += " and StoreId in (select StoreId from StoreForName where Name='" + StoreIdName + "')";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("PosMachinesTwo", Fields, "Id desc", "0", 1, 20000, condition, "BindingState,ActivationState,UserId,StoreId,PosSn,BrandId,ActivityList,BindMerchantId,PosSnType,DeviceType,BindingTime,UpFeeDate,DownFeeDate,ActivationTime,TransferTime", false);
|
|
|
+ List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
+ foreach (Dictionary<string, object> dic in diclist)
|
|
|
+ {
|
|
|
+ //绑定状态
|
|
|
+ int BindingState = int.Parse(dic["BindingState"].ToString());
|
|
|
+ if (BindingState == 0) dic["BindingState"] = "未绑定";
|
|
|
+ if (BindingState == 1) dic["BindingState"] = "已绑定";
|
|
|
+ //绑定时间
|
|
|
+ if (!string.IsNullOrEmpty(dic["BindingTime"].ToString()))
|
|
|
+ {
|
|
|
+ DateTime BindingTime = Convert.ToDateTime(dic["BindingTime"].ToString());
|
|
|
+ }
|
|
|
+
|
|
|
+ //激活状态
|
|
|
+ int ActivationState = int.Parse(dic["ActivationState"].ToString());
|
|
|
+ if (ActivationState == 0) dic["ActivationState"] = "未激活";
|
|
|
+ if (ActivationState == 1) dic["ActivationState"] = "已激活";
|
|
|
+ //激活时间
|
|
|
+ if (!string.IsNullOrEmpty(dic["ActivationTime"].ToString()))
|
|
|
+ {
|
|
|
+ DateTime ActivationTime = Convert.ToDateTime(dic["ActivationTime"].ToString());
|
|
|
+ }
|
|
|
+
|
|
|
+ //划拨时间
|
|
|
+ if (!string.IsNullOrEmpty(dic["TransferTime"].ToString()))
|
|
|
+ {
|
|
|
+ DateTime TransferTime = Convert.ToDateTime(dic["TransferTime"].ToString());
|
|
|
+ }
|
|
|
+ //调升时间
|
|
|
+ if (!string.IsNullOrEmpty(dic["UpFeeDate"].ToString()))
|
|
|
+ {
|
|
|
+ DateTime UpFeeDate = Convert.ToDateTime(dic["UpFeeDate"].ToString());
|
|
|
+ }
|
|
|
+
|
|
|
+ //调降时间
|
|
|
+ if (!string.IsNullOrEmpty(dic["DownFeeDate"].ToString()))
|
|
|
+ {
|
|
|
+ DateTime DownFeeDate = Convert.ToDateTime(dic["DownFeeDate"].ToString());
|
|
|
+ }
|
|
|
+ //所属创客
|
|
|
+ int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
|
|
|
+ Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
|
|
|
+ dic["UserIdMakerCode"] = userid_Users.MakerCode;
|
|
|
+ dic["UserIdRealName"] = userid_Users.RealName;
|
|
|
+ dic.Remove("UserId");
|
|
|
+ //所属仓库
|
|
|
+ int StoreId = int.Parse(function.CheckInt(dic["StoreId"].ToString()));
|
|
|
+ StoreHouse storeid_StoreHouse = db.StoreHouse.FirstOrDefault(m => m.Id == StoreId) ?? new StoreHouse();
|
|
|
+ dic["StoreIdCode"] = storeid_StoreHouse.StoreNo;
|
|
|
+ dic["StoreIdName"] = storeid_StoreHouse.StoreName;
|
|
|
+ dic.Remove("StoreId");
|
|
|
+ //产品类型
|
|
|
+ dic["BrandId"] = RelationClass.GetKqProductBrandInfo(int.Parse(dic["BrandId"].ToString()));
|
|
|
+ //参加活动
|
|
|
+ // dic["ActivityList"] = RelationClass.GetProfitObjectsActivesList(dic["ActivityList"].ToString());
|
|
|
+ //绑定商户
|
|
|
+ int BindMerchantId = int.Parse(function.CheckInt(dic["BindMerchantId"].ToString()));
|
|
|
+ PosMerchantInfo bindmerchantid_MerchantInfo = db.PosMerchantInfo.FirstOrDefault(m => m.Id == BindMerchantId) ?? new PosMerchantInfo();
|
|
|
+ dic["BindMerchantIdMerchantNo"] = bindmerchantid_MerchantInfo.MerchantNo;
|
|
|
+ dic["BindMerchantIdMerchantName"] = bindmerchantid_MerchantInfo.MerchantName;
|
|
|
+ dic.Remove("BindMerchantId");
|
|
|
+ //机具类型
|
|
|
+ int PosSnType = int.Parse(dic["PosSnType"].ToString());
|
|
|
+ if (PosSnType == 0) dic["PosSnType"] = "购买机具";
|
|
|
+ if (PosSnType == 1) dic["PosSnType"] = "赠送机具";
|
|
|
+ // //设备类型
|
|
|
+ // string DeviceType = dic["DeviceType"].ToString();
|
|
|
+ // if (DeviceType == "KysSignPos") dic["DeviceType"] = "快益刷电签POS";
|
|
|
+ // if (DeviceType == "KssSignPos") dic["DeviceType"] = "快闪刷电签POS";
|
|
|
+ // if (DeviceType == "") dic["DeviceType"] = "";
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ Dictionary<string, object> result = new Dictionary<string, object>();
|
|
|
+ result.Add("Status", "1");
|
|
|
+ result.Add("Info", "Excel报表-" + DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss") + ".xlsx");
|
|
|
+ result.Add("Obj", diclist);
|
|
|
+ Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
|
|
|
+ ReturnFields.Add("UserIdMakerCode", "创客编号");
|
|
|
+ ReturnFields.Add("UserIdRealName", "创客姓名");
|
|
|
+ ReturnFields.Add("StoreIdCode", "仓库编号");
|
|
|
+ ReturnFields.Add("StoreIdName", "仓库名称");
|
|
|
+ ReturnFields.Add("BrandId", "产品类型");
|
|
|
+ ReturnFields.Add("PosSn", "SN编号");
|
|
|
+ ReturnFields.Add("PosSnType", "SN类型");
|
|
|
+ // ReturnFields.Add("ActivityList", "参加活动");
|
|
|
+ ReturnFields.Add("BindMerchantIdMerchantNo", "绑定商户编号");
|
|
|
+ ReturnFields.Add("BindMerchantIdMerchantName", "绑定商户姓名");
|
|
|
+ ReturnFields.Add("DeviceType", "设备类型");
|
|
|
+ ReturnFields.Add("BindingState", "绑定状态");
|
|
|
+ ReturnFields.Add("BindingTime", "绑定时间");
|
|
|
+ ReturnFields.Add("ActivationState", "激活状态");
|
|
|
+ ReturnFields.Add("ActivationTime", "激活时间");
|
|
|
+ ReturnFields.Add("TransferTime", "划拨时间");
|
|
|
+ ReturnFields.Add("UpFeeFlag", "调升标记");
|
|
|
+ ReturnFields.Add("UpFeeDate", "调升时间");
|
|
|
+ ReturnFields.Add("UpFeeMan", "调升人");
|
|
|
+ ReturnFields.Add("DownFeeFlag", "调降标记");
|
|
|
+ ReturnFields.Add("DownFeeDate", "调降时间");
|
|
|
+ ReturnFields.Add("DownFeeMan", "调降人");
|
|
|
+
|
|
|
+ result.Add("Fields", ReturnFields);
|
|
|
+ AddSysLog("0", "PosMachinesTwo", "ExportExcel");
|
|
|
+ return Json(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ }
|
|
|
+}
|