DuGuYang 3 年 前
コミット
bff1c5b132

+ 172 - 0
AppStart/PublicChangePosFee.cs

@@ -0,0 +1,172 @@
+// using System;
+// using System.Collections.Generic;
+// using System.Linq;
+// using System.Data;
+// using System.Text.RegularExpressions;
+// using MySystem.Models;
+// using Library;
+// using NPOI.SS.UserModel;
+// using NPOI.XSSF.UserModel;
+// using Microsoft.AspNetCore.Mvc;
+// using System.IO;
+// using LitJson;
+
+// namespace MySystem
+// {
+//     public class PublicChangePosFee
+//     {
+//         public WebCMSEntities db = new WebCMSEntities();
+//         public BsModels.WebCMSEntities bsdb = new BsModels.WebCMSEntities();
+//         public OpModels.WebCMSEntities opdb = new OpModels.WebCMSEntities();
+
+//         #region 金控-设置押金
+//         public string SetJKDeposit(string SnIds)
+//         {
+//             string check = RedisDbconn.Instance.Get<string>("SetDepositWait:" + SnIds);
+//             if (!string.IsNullOrEmpty(check))
+//             {
+//                 return "操作频繁,请稍后再试";
+//             }
+//             RedisDbconn.Instance.Set("SetDepositWait:" + SnIds, SnIds);
+//             RedisDbconn.Instance.SetExpire("SetDepositWait:" + SnIds, 120);
+//             Dictionary<string, object> Obj = new Dictionary<string, object>();
+//             string[] SnIdList = SnIds.Split(',');
+//             foreach (string SnId in SnIdList)
+//             {
+//                 int SnIdNum = int.Parse(SnId);
+//                 PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == SnIdNum && m.UserId == UserId && m.BindingState == 0 && (string.IsNullOrEmpty(m.SeoKeyword) || m.SeoKeyword == "0"));
+//                 if (pos == null)
+//                 {
+//                     return "机具" + pos.PosSn + "已设置押金,请勿重复设置";
+//                 }
+//                 function.WriteLog(DateTime.Now.ToString() + ":请求参数," + pos.PosSn + ":" + DepositId, "金控-设置押金-返回报文");
+//                 string content = function.GetWebRequest("http://sp.kexiaoshuang.com/api/test/SetDeposit?sn=" + pos.PosSn + "&num=" + DepositId); //PublicImportDataService.Instance.SetDeposit(pos.PosSn, decimal.Parse(DepositId));
+//                 function.WriteLog(DateTime.Now.ToString() + "\n" + content, "金控-设置押金-返回报文");
+//                 if (content == "fail")
+//                 {
+//                     return Json(new AppResultJson() { Status = "-1", Info = "机具" + pos.PosSn + "设置失败" });
+//                 }
+//                 JsonData jsonObj = JsonMapper.ToObject(content);
+//                 if (jsonObj["code"].ToString() != "000000")
+//                 {
+//                     return Json(new AppResultJson() { Status = "-1", Info = jsonObj["message"].ToString() });
+//                 }
+//                 content = jsonObj["data"].ToString();
+//                 content = PublicImportDataService.Instance.Decrypt(content);
+//                 function.WriteLog(DateTime.Now.ToString() + "\n" + content, "金控-设置押金-返回报文");
+//                 JsonData contentObj = JsonMapper.ToObject(content);
+//                 if (contentObj["respCode"].ToString() != "00")
+//                 {
+//                     return Json(new AppResultJson() { Status = "-1", Info = contentObj["respMsg"].ToString() });
+//                 }
+//                 var BeforeDeposit = 0;
+//                 if (string.IsNullOrEmpty(pos.PrizeParams))
+//                 {
+//                     if (RelationClass.GetKqProductBrandInfo(pos.BrandId) == "立刷云电签")
+//                     {
+//                         BeforeDeposit = 249;
+//                     }
+//                     else
+//                     {
+//                         BeforeDeposit = 299;
+//                     }
+//                 }
+//                 else
+//                 {
+//                     BeforeDeposit = int.Parse(pos.PrizeParams);
+//                 }
+//                 decimal amount = decimal.Parse(DepositId);
+//                 pos.PrizeParams = amount.ToString("f0");
+//                 maindb.SaveChanges();
+
+//                 //设置押金添加记录
+//                 PublicFunction.MerchantDepositSet(pos.BrandId, UserId, SnIdNum, pos.PosSn, BeforeDeposit, decimal.Parse(pos.PrizeParams), content);
+//             }
+//             return Json(new AppResultJson() { Status = "1", Info = "", Data = Obj });
+//         }
+//         #endregion
+
+//         #region 海科-设置押金
+//         public string SetHKDeposit(string SnIds)
+//         {
+//             string check = RedisDbconn.Instance.Get<string>("SetHkPosDepositWait:" + SnIds);
+//             if (!string.IsNullOrEmpty(check))
+//             {
+//                 return "操作频繁,请稍后再试";
+//             }
+//             RedisDbconn.Instance.Set("SetHkPosDepositWait:" + SnIds, SnIds);
+//             RedisDbconn.Instance.SetExpire("SetHkPosDepositWait:" + SnIds, 120);
+//             string DepositId = "300"; //押金Id
+//             Dictionary<string, object> Obj = new Dictionary<string, object>();
+//             string[] SnIdList = SnIds.Split(',');
+//             foreach (string SnId in SnIdList)
+//             {
+//                 int SnIdNum = int.Parse(SnId);
+//                 PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == SnIdNum && m.BindingState == 0 && (string.IsNullOrEmpty(m.SeoKeyword) || m.SeoKeyword == "0"));
+//                 if (pos == null)
+//                 {
+//                     return "机具" + pos.PosSn + "已设置押金,请勿重复设置";
+//                 }
+//                 string OldId = "", NewId = "";
+//                 if (DepositId == "100")
+//                 {
+//                     NewId = pos.BrandId == 8 ? "202207011718129" : "202207011718197";
+//                 }
+//                 else if (DepositId == "200")
+//                 {
+//                     NewId = pos.BrandId == 8 ? "747200504467566592" : "747199934126108672";
+//                 }
+//                 else if (DepositId == "300")
+//                 {
+//                     NewId = pos.BrandId == 8 ? "747193472108732416" : "747193820156276736";
+//                 }
+//                 string content = PublicImportDataService.Instance.QueryActiveForConfigHK(pos.PosSn, pos.BrandId);
+//                 JsonData jsonObj = JsonMapper.ToObject(content);
+//                 if (jsonObj["code"].ToString() == "0")
+//                 {
+//                     OldId = jsonObj["data"]["posMarket"]["id"].ToString();
+//                 }
+//                 jsonObj = JsonMapper.ToObject(content);
+//                 function.WriteLog(DateTime.Now.ToString() + ":请求参数," + pos.PosSn + ":" + OldId + ":" + NewId, "海科-设置押金-返回报文");
+//                 content = PublicImportDataService.Instance.SetDepositForHK(pos.PosSn, OldId, NewId, pos.BrandId);
+//                 function.WriteLog(DateTime.Now.ToString() + "\n" + content, "海科-设置押金-返回报文");
+//                 if (content == "fail")
+//                 {
+//                     return "机具" + pos.PosSn + "设置失败";
+//                 }
+//                 jsonObj = JsonMapper.ToObject(content);
+//                 if (jsonObj["code"].ToString() != "0")
+//                 {
+//                     return jsonObj["msg"].ToString();
+//                 }
+//                 decimal amount = decimal.Parse(DepositId);
+//                 var BeforeDeposit = 0;
+//                 if (string.IsNullOrEmpty(pos.PrizeParams))
+//                 {
+//                     if (RelationClass.GetKqProductBrandInfo(pos.BrandId) == "立刷云电签")
+//                     {
+//                         BeforeDeposit = 249;
+//                     }
+//                     else
+//                     {
+//                         BeforeDeposit = 299;
+//                     }
+//                 }
+//                 else
+//                 {
+//                     BeforeDeposit = int.Parse(pos.PrizeParams);
+//                 }
+//                 if (pos.BrandId == 8 || pos.BrandId == 9)
+//                 {
+//                     amount -= 1;
+//                 }
+//                 pos.PrizeParams = amount.ToString("f0");
+//                 db.SaveChanges();
+
+//             }
+//             return "设置成功";
+//         }
+//         #endregion
+
+//     }
+// }

ファイルの差分が大きいため隠しています
+ 443 - 0
AppStart/PublicImportDataService.cs


+ 350 - 0
AppStart/RSAHelper.cs

@@ -0,0 +1,350 @@
+using System;
+using System.IO;
+using System.Security.Cryptography;
+using System.Text;
+
+namespace MySystem
+{
+    /// <summary>
+    /// RSA加解密 使用OpenSSL的公钥加密/私钥解密
+    /// 作者:李志强
+    /// 创建时间:2017年10月30日15:50:14
+    /// QQ:501232752
+    /// </summary>
+    public class RSAHelper
+	{
+		private readonly RSA _privateKeyRsaProvider;
+		private readonly RSA _publicKeyRsaProvider;
+		private readonly HashAlgorithmName _hashAlgorithmName;
+		private readonly Encoding _encoding;
+
+		/// <summary>
+		/// 实例化RSAHelper
+		/// </summary>
+		/// <param name="rsaType">加密算法类型 RSA SHA1;RSA2 SHA256 密钥长度至少为2048</param>
+		/// <param name="encoding">编码类型</param>
+		/// <param name="privateKey">私钥</param>
+		/// <param name="publicKey">公钥</param>
+		public RSAHelper(RSAType rsaType, Encoding encoding, string privateKey, string publicKey = null)
+		{
+			_encoding = encoding;
+			if (!string.IsNullOrEmpty(privateKey))
+			{
+				_privateKeyRsaProvider = CreateRsaProviderFromPrivateKey(privateKey);
+			}
+
+			if (!string.IsNullOrEmpty(publicKey))
+			{
+				_publicKeyRsaProvider = CreateRsaProviderFromPublicKey(publicKey);
+			}
+
+			_hashAlgorithmName = rsaType == RSAType.RSA ? HashAlgorithmName.SHA1 : HashAlgorithmName.SHA256;
+		}
+
+		#region 使用私钥签名
+
+		/// <summary>
+		/// 使用私钥签名
+		/// </summary>
+		/// <param name="data">原始数据</param>
+		/// <returns></returns>
+		public string Sign(string data)
+		{
+			byte[] dataBytes = _encoding.GetBytes(data);
+
+			// var signatureBytes = _privateKeyRsaProvider.SignData(dataBytes, _hashAlgorithmName, RSASignaturePadding.Pkcs1);
+			var signatureBytes = _publicKeyRsaProvider.SignData(dataBytes, _hashAlgorithmName, RSASignaturePadding.Pkcs1);
+
+			return Convert.ToBase64String(signatureBytes);
+		}
+
+		#endregion
+
+		#region 使用公钥验证签名
+
+		/// <summary>
+		/// 使用公钥验证签名
+		/// </summary>
+		/// <param name="data">原始数据</param>
+		/// <param name="sign">签名</param>
+		/// <returns></returns>
+		public bool Verify(string data, string sign)
+		{
+			byte[] dataBytes = _encoding.GetBytes(data);
+			byte[] signBytes = Convert.FromBase64String(sign);
+
+			var verify = _publicKeyRsaProvider.VerifyData(dataBytes, signBytes, _hashAlgorithmName, RSASignaturePadding.Pkcs1);
+
+			return verify;
+		}
+
+		#endregion
+
+		#region 解密
+
+		public string Decrypt(string cipherText)
+		{
+			if (_privateKeyRsaProvider == null)
+			{
+				throw new Exception("_privateKeyRsaProvider is null");
+			}
+			return Encoding.UTF8.GetString(_privateKeyRsaProvider.Decrypt(Convert.FromBase64String(cipherText), RSAEncryptionPadding.Pkcs1));
+		}
+
+		#endregion
+
+		#region 加密
+
+		// public string Encrypt(string text)
+		// {
+		// 	if (_publicKeyRsaProvider == null)
+		// 	{
+		// 		throw new Exception("_publicKeyRsaProvider is null");
+		// 	}
+		// 	return Convert.ToBase64String(_publicKeyRsaProvider.Encrypt(Encoding.UTF8.GetBytes(text), RSAEncryptionPadding.Pkcs1));
+		// }
+
+		public string Encrypt(string text)
+		{
+			if (_publicKeyRsaProvider == null)
+			{
+				throw new Exception("_publicKeyRsaProvider is null");
+			}
+            #region 分段加密
+            byte[] dataToEncrypt = Encoding.UTF8.GetBytes(text);
+            int bufferSize = (_publicKeyRsaProvider.KeySize / 8) - 11;
+			byte[] buffer = new byte [bufferSize] ;
+			byte[] outBytes = null;
+			using (MemoryStream input = new MemoryStream(dataToEncrypt))
+            using (MemoryStream ouput = new MemoryStream())
+            {
+                while (true)
+                {
+                    int readLine = input.Read(buffer, 0, bufferSize);
+                    if (readLine <= 0)
+                    {
+                        break;
+                    }
+                    byte[] temp = new byte[readLine];
+                    Array.Copy(buffer, 0, temp, 0, readLine);
+                    byte[] encrypt = _publicKeyRsaProvider.Encrypt(temp, RSAEncryptionPadding.Pkcs1);
+                    ouput.Write(encrypt, 0, encrypt.Length);
+                }
+                outBytes = ouput.ToArray();
+            }
+            #endregion
+            return Convert.ToBase64String(outBytes);
+		}
+
+		#endregion
+
+		#region 使用私钥创建RSA实例
+
+		public RSA CreateRsaProviderFromPrivateKey(string privateKey)
+		{
+			var privateKeyBits = Convert.FromBase64String(privateKey);
+
+			var rsa = RSA.Create();
+			var rsaParameters = new RSAParameters();
+
+			using (BinaryReader binr = new BinaryReader(new MemoryStream(privateKeyBits)))
+			{
+				byte bt = 0;
+				ushort twobytes = 0;
+				twobytes = binr.ReadUInt16();
+				if (twobytes == 0x8130)
+					binr.ReadByte();
+				else if (twobytes == 0x8230)
+					binr.ReadInt16();
+				else
+					throw new Exception("Unexpected value read binr.ReadUInt16()");
+
+				twobytes = binr.ReadUInt16();
+				if (twobytes != 0x0102)
+					throw new Exception("Unexpected version");
+
+				bt = binr.ReadByte();
+				if (bt != 0x00)
+					throw new Exception("Unexpected value read binr.ReadByte()");
+
+				rsaParameters.Modulus = binr.ReadBytes(GetIntegerSize(binr));
+				rsaParameters.Exponent = binr.ReadBytes(GetIntegerSize(binr));
+				rsaParameters.D = binr.ReadBytes(GetIntegerSize(binr));
+				rsaParameters.P = binr.ReadBytes(GetIntegerSize(binr));
+				rsaParameters.Q = binr.ReadBytes(GetIntegerSize(binr));
+				rsaParameters.DP = binr.ReadBytes(GetIntegerSize(binr));
+				rsaParameters.DQ = binr.ReadBytes(GetIntegerSize(binr));
+				rsaParameters.InverseQ = binr.ReadBytes(GetIntegerSize(binr));
+			}
+
+			rsa.ImportParameters(rsaParameters);
+			return rsa;
+		}
+
+		#endregion
+
+		#region 使用公钥创建RSA实例
+
+		public RSA CreateRsaProviderFromPublicKey(string publicKeyString)
+		{
+			// encoded OID sequence for  PKCS #1 rsaEncryption szOID_RSA_RSA = "1.2.840.113549.1.1.1"
+			byte[] seqOid = { 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00 };
+			byte[] seq = new byte[15];
+
+			var x509Key = Convert.FromBase64String(publicKeyString);
+
+			// ---------  Set up stream to read the asn.1 encoded SubjectPublicKeyInfo blob  ------
+			using (MemoryStream mem = new MemoryStream(x509Key))
+			{
+				using (BinaryReader binr = new BinaryReader(mem))  //wrap Memory Stream with BinaryReader for easy reading
+				{
+					byte bt = 0;
+					ushort twobytes = 0;
+
+					twobytes = binr.ReadUInt16();
+					if (twobytes == 0x8130) //data read as little endian order (actual data order for Sequence is 30 81)
+						binr.ReadByte();    //advance 1 byte
+					else if (twobytes == 0x8230)
+						binr.ReadInt16();   //advance 2 bytes
+					else
+						return null;
+
+					seq = binr.ReadBytes(15);       //read the Sequence OID
+					if (!CompareBytearrays(seq, seqOid))    //make sure Sequence for OID is correct
+						return null;
+
+					twobytes = binr.ReadUInt16();
+					if (twobytes == 0x8103) //data read as little endian order (actual data order for Bit String is 03 81)
+						binr.ReadByte();    //advance 1 byte
+					else if (twobytes == 0x8203)
+						binr.ReadInt16();   //advance 2 bytes
+					else
+						return null;
+
+					bt = binr.ReadByte();
+					if (bt != 0x00)     //expect null byte next
+						return null;
+
+					twobytes = binr.ReadUInt16();
+					if (twobytes == 0x8130) //data read as little endian order (actual data order for Sequence is 30 81)
+						binr.ReadByte();    //advance 1 byte
+					else if (twobytes == 0x8230)
+						binr.ReadInt16();   //advance 2 bytes
+					else
+						return null;
+
+					twobytes = binr.ReadUInt16();
+					byte lowbyte = 0x00;
+					byte highbyte = 0x00;
+
+					if (twobytes == 0x8102) //data read as little endian order (actual data order for Integer is 02 81)
+						lowbyte = binr.ReadByte();  // read next bytes which is bytes in modulus
+					else if (twobytes == 0x8202)
+					{
+						highbyte = binr.ReadByte(); //advance 2 bytes
+						lowbyte = binr.ReadByte();
+					}
+					else
+						return null;
+					byte[] modint = { lowbyte, highbyte, 0x00, 0x00 };   //reverse byte order since asn.1 key uses big endian order
+					int modsize = BitConverter.ToInt32(modint, 0);
+
+					int firstbyte = binr.PeekChar();
+					if (firstbyte == 0x00)
+					{   //if first byte (highest order) of modulus is zero, don't include it
+						binr.ReadByte();    //skip this null byte
+						modsize -= 1;   //reduce modulus buffer size by 1
+					}
+
+					byte[] modulus = binr.ReadBytes(modsize);   //read the modulus bytes
+
+					if (binr.ReadByte() != 0x02)            //expect an Integer for the exponent data
+						return null;
+					int expbytes = (int)binr.ReadByte();        // should only need one byte for actual exponent data (for all useful values)
+					byte[] exponent = binr.ReadBytes(expbytes);
+
+					// ------- create RSACryptoServiceProvider instance and initialize with public key -----
+					var rsa = RSA.Create();
+					RSAParameters rsaKeyInfo = new RSAParameters
+					{
+						Modulus = modulus,
+						Exponent = exponent
+					};
+					rsa.ImportParameters(rsaKeyInfo);
+
+					return rsa;
+				}
+
+			}
+		}
+
+		#endregion
+
+		#region 导入密钥算法
+
+		private int GetIntegerSize(BinaryReader binr)
+		{
+			byte bt = 0;
+			int count = 0;
+			bt = binr.ReadByte();
+			if (bt != 0x02)
+				return 0;
+			bt = binr.ReadByte();
+
+			if (bt == 0x81)
+				count = binr.ReadByte();
+			else
+			if (bt == 0x82)
+			{
+				var highbyte = binr.ReadByte();
+				var lowbyte = binr.ReadByte();
+				byte[] modint = { lowbyte, highbyte, 0x00, 0x00 };
+				count = BitConverter.ToInt32(modint, 0);
+			}
+			else
+			{
+				count = bt;
+			}
+
+			while (binr.ReadByte() == 0x00)
+			{
+				count -= 1;
+			}
+			binr.BaseStream.Seek(-1, SeekOrigin.Current);
+			return count;
+		}
+
+		private bool CompareBytearrays(byte[] a, byte[] b)
+		{
+			if (a.Length != b.Length)
+				return false;
+			int i = 0;
+			foreach (byte c in a)
+			{
+				if (c != b[i])
+					return false;
+				i++;
+			}
+			return true;
+		}
+
+		#endregion
+
+	}
+
+	/// <summary>
+	/// RSA算法类型
+	/// </summary>
+	public enum RSAType
+	{
+		/// <summary>
+		/// SHA1
+		/// </summary>
+		RSA = 0,
+		/// <summary>
+		/// RSA2 密钥长度至少为2048
+		/// SHA256
+		/// </summary>
+		RSA2
+	}
+}

+ 53 - 0
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -5668,5 +5668,58 @@ namespace MySystem.Areas.Admin.Controllers
         }
         #endregion
 
+
+        #region 调整机具服务费
+
+        public IActionResult ChangePosFee(string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+            return View();
+        }
+
+        [HttpPost]
+        public string ChangePosFeeDo(string PosSn)
+        {
+            if (string.IsNullOrEmpty(PosSn))
+            {
+                return "请输入机具SN";
+            }
+            List<int> SnIds = new List<int>();
+            string[] PosSnList = PosSn.Replace("\r", "").Replace("\n", ",").Split(',');
+            string error = "";
+            foreach (string Sn in PosSnList)
+            {
+                var posInfo = db.PosMachinesTwo.FirstOrDefault(m => m.Status > -1 && m.BindingState == 0 && m.ActivationState == 0 && m.PosSn == Sn) ?? new PosMachinesTwo();
+                if (posInfo.Id == 0)
+                {
+                    error += "以下操作失败" + Sn + ',' + "不存在或者不符合条件" + '\n';
+                }
+                else
+                {
+                    SnIds.Add(posInfo.Id);
+                }
+            }
+            if (!string.IsNullOrEmpty(error))
+            {
+                return "Warning|" + error;
+            }
+            else
+            {
+                foreach (int SnId in SnIds)
+                {
+                    var posInfo = db.PosMachinesTwo.FirstOrDefault(m => m.Id == SnId) ?? new PosMachinesTwo();
+                }
+                var query = SnIds + ";";
+                function.WriteLog(DateTime.Now.ToString() + ":请求参数," + query + ":" + SysUserName + "-" + SysRealName, "调整机具服务费");
+                db.SaveChanges();
+                db.Dispose();
+            }
+
+            return "success";
+        }
+        #endregion
+
     }
 }

+ 256 - 0
Areas/Admin/Views/MainServer/SysTools/ChangePosFee.cshtml

@@ -0,0 +1,256 @@
+@{
+    string RightInfo = ViewBag.RightInfo as string;
+    string right = ViewBag.right as string;
+
+}
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <title>调整机具服务费</title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport"
+        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
+    <script src="/admin/js/jquery-1.10.1.min.js"></script>
+    <script src="/admin/js/LAreaData2.js"></script>
+</head>
+
+<body>
+
+    <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin">
+        <form class="layui-form" id="confirmFrm">
+            <div class="layui-card">
+                <div class="layui-card-body">
+                    <div class="layui-tab" lay-filter="mytabbar">
+                        <ul class="layui-tab-title">
+                            <li class="layui-this" lay-id="1">基本信息</li>
+                        </ul>
+                        <div class="layui-tab-content mt20">
+                            <div class="layui-tab-item layui-show">
+                                <div class="layui-form-item">
+                                    <label class="layui-form-label">机具SN</label>
+                                    <div class="layui-input-block">
+                                        <textarea class="layui-textarea" lay-verify="required|" name="PosSn" id="PosSn"
+                                            placeholder="请输入机具SN,多个机具SN用回车隔开"></textarea>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="layui-form-item ml10">
+                        <div class="layui-input-block">
+                            <button type="button" class="layui-btn" onclick="save()">提交</button>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </form>
+    </div>
+
+    <script src="/layuiadmin/layui/layui.js"></script>
+    <script
+        src="/other/oss/upload-min@(MySystem.OssHelper.Instance.OssStatus ? "-oss" : "").js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script src="/other/mybjq/kindeditor-min.js"></script>
+    <script src="/other/mybjq/lang/zh_CN.js"></script>
+    <script>
+        function save() {
+            var PosSn = $('#PosSn').val();
+            if (PosSn == '') {
+                layer.msg('请输入机具SN');
+            }
+            else {
+                var index = layer.confirm('确定要划拨吗?', function (index) {
+                    var indexs = layer.load(1, {
+                        shade: [0.5, '#000']
+                    });
+                    var userdata = $("#confirmFrm").serialize();
+                    $.ajax({
+                        type: "POST",
+                        url: "/Admin/SysTools/ChangePosFeeDo?r=" + Math.random(1),
+                        data: userdata,
+                        dataType: "text",
+                        success: function (data) {
+                            layer.close(index); //关闭弹层
+                            if (data == "success") {
+                                layer.close(indexs); //关闭弹层
+                                layer.msg('调整成功', {
+                                    time: 1000
+                                }, function () {
+                                    window.location.reload();
+                                });
+                            } else if (data.indexOf("Warning") == 0) {
+                                var datalist = data.split('|');
+                                layer.close(indexs); //关闭弹层
+                                layer.alert(datalist[1], { time: 20000 }, function () {
+                                    window.location.reload();
+                                });
+                            } else {
+                                layer.close(indexs); //关闭弹层
+                                layer.msg(data);
+                            }
+                        }
+                    });
+                });
+            }
+        }
+
+
+        //编辑器
+        KindEditor.ready(function (K) {
+
+        });
+
+        var ids = "";
+        function getChildren(obj) {
+            $.each(obj, function (index, value) {
+                var id = obj[index].id;
+                ids += id + ",";
+                var children = obj[index].children;
+                if (children) {
+                    getChildren(children);
+                }
+            });
+        }
+
+        function AreasProvinceInit(tagId, areasVal, form) {
+            for (var i = 0; i < provs_data.length; i++) {
+                var sel = "";
+                if (areasVal.indexOf(provs_data[i].text) > -1) {
+                    sel = " selected=selected";
+                }
+                $("#" + tagId + "Province").append('<option value="' + provs_data[i].value + '"' + sel + '>' + provs_data[i].text + '</option>');
+            }
+            form.render();
+        }
+
+        function AreasProvinceSelected(tagId, areasVal, form, value) {
+            $("#" + tagId + "City").html('<option value="">市</option>');
+            var list = citys_data[value];
+            for (var i = 0; i < list.length; i++) {
+                var sel = "";
+                if (areasVal.indexOf(list[i].text) > -1) {
+                    sel = " selected=selected";
+                }
+                $("#" + tagId + "City").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
+            }
+            $("#" + tagId + "Area").html('<option value="">县/区</option>');
+            form.render();
+            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
+        }
+
+        function AreasCitySelected(tagId, areasVal, form, value) {
+            $("#" + tagId + "Area").html('<option value="">县/区</option>');
+            var list = dists_data[value];
+            for (var i = 0; i < list.length; i++) {
+                var sel = "";
+                if (areasVal.indexOf(list[i].text) > -1) {
+                    sel = " selected=selected";
+                }
+                $("#" + tagId + "Area").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
+            }
+            form.render();
+            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
+        }
+
+        function AreasAreaSelected(tagId, form) {
+            form.render();
+            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
+        }
+        function movePrev(obj, tagId) {
+            $(obj).parent().prev().insertAfter($(obj).parent());
+            checkPics(tagId);
+        }
+        function moveNext(obj, tagId) {
+            $(obj).parent().next().insertBefore($(obj).parent());
+            checkPics(tagId);
+        }
+        function deletePic(obj, tagId) {
+            $(obj).parent().remove();
+            checkPics(tagId);
+        }
+        function checkPics(tagId) {
+            var pics = "";
+            var texts = "";
+            $("#" + tagId + "Image div img").each(function (i) {
+                pics += $(this).attr("src").replace(osshost, '') + "|";
+            });
+            $("#" + tagId + "Image div input").each(function (i) {
+                texts += $(this).val() + "|";
+            });
+            if (pics == "") {
+                $("#" + tagId).val("");
+            } else {
+                pics = pics.substring(0, pics.length - 1);
+                texts = texts.substring(0, pics.length - 1);
+                $("#" + tagId).val(pics + "#cut#" + texts);
+            }
+        }
+        function checkBox(tagId) {
+            var text = "";
+            $("input[type=checkbox][name=" + tagId + "List]:checked").each(function (i) {
+                text += $(this).val() + ",";
+            });
+            $("#" + tagId).val(text);
+        }
+        function showBigPic(picpath) {
+            parent.layer.open({
+                type: 1,
+                title: false,
+                closeBtn: 0,
+                shadeClose: true,
+                area: ['auto', 'auto'],
+                content: '<img src="' + picpath + '" style="max-width:800px; max-height:800px;" />'
+            });
+        }
+
+
+        var tree;
+        var element;
+        var upload;
+        layui.config({
+            base: '/layuiadmin/' //静态资源所在路径
+        }).extend({
+            index: 'lib/index' //主入口模块
+        }).use(['index', 'form', 'upload', 'layedit', 'laydate', 'element', 'croppers', 'transfer', 'tree', 'util'], function () {
+            var $ = layui.$
+                , form = layui.form
+                , layer = layui.layer
+                , layedit = layui.layedit
+                , laydate = layui.laydate
+                , croppers = layui.croppers
+                , transfer = layui.transfer
+                , util = layui.util;
+            tree = layui.tree;
+            element = layui.element;
+            upload = layui.upload;
+
+            //Hash地址的定位
+            var layid = location.hash.replace(/^#test=/, '');
+            element.tabChange('test', layid);
+            element.on('tab(test)', function (elem) {
+                location.hash = 'test=' + $(this).attr('lay-id');
+            });
+
+            //日期
+
+
+            //上传文件
+
+
+            //穿梭框
+
+
+            //TreeView,比如权限管理
+
+
+            //省市区
+
+        })
+
+    </script>
+</body>
+
+</html>

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません