|
@@ -8,6 +8,7 @@ using Microsoft.Extensions.Logging;
|
|
|
using Library;
|
|
using Library;
|
|
|
using LitJson;
|
|
using LitJson;
|
|
|
using System.Text;
|
|
using System.Text;
|
|
|
|
|
+using MySystem.Models.Main;
|
|
|
|
|
|
|
|
namespace MySystem.Controllers
|
|
namespace MySystem.Controllers
|
|
|
{
|
|
{
|
|
@@ -27,15 +28,59 @@ namespace MySystem.Controllers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- public string test(string a)
|
|
|
|
|
|
|
+ public string addsubmer()
|
|
|
{
|
|
{
|
|
|
- // string result = HaoDaHelper.Instance.CardInComeRecord("1486641", "2023-10-01", "2023-10-31", "030510606906888", "", "", "1", "10");
|
|
|
|
|
- // return result;
|
|
|
|
|
- // return AliIotFunction.Instance.IotDeviceQuery("LKB01230900202000002");
|
|
|
|
|
- // return AliIotFunction.Instance.IotUnBind("2088720723136476", "LKBYM2023090700098");
|
|
|
|
|
- // return AliIotFunction.Instance.IotTradeVoice("LKBYM2023090700098", "2088720723136476", DateTime.Now.ToString("yyyyMMddHHmmssfff"), a, "OTHER");
|
|
|
|
|
- // return AliIotFunction.Instance.IotTradeVoice("01010VO0cD5XkzVNlEVW61HRVe5Jd2sf9u6h4ndoZyS4Gg1rJAeRYJc", "2088720723136476", DateTime.Now.ToString("yyyyMMddHHmmssfff"), a, "OTHER");
|
|
|
|
|
- return AliyunOcr.Check("https://laikeba.oss-cn-chengdu.aliyuncs.com/miniappIncomingData/UnionPay/2024/12/4/380db2e4d913c627.png");
|
|
|
|
|
|
|
+ WebCMSEntities db = new WebCMSEntities();
|
|
|
|
|
+ List<string> data = new List<string>();
|
|
|
|
|
+ // data.Add("015510108266178|成都红地餐饮管理有限公司|20241112");
|
|
|
|
|
+ foreach(string sub in data)
|
|
|
|
|
+ {
|
|
|
|
|
+ string[] list = sub.Split('|');
|
|
|
|
|
+ string merNo = list[0];
|
|
|
|
|
+ string merName = list[1];
|
|
|
|
|
+ string bindDateString = list[2];
|
|
|
|
|
+ string bindDate = bindDateString.Substring(0, 4) + "-" + bindDateString.Substring(4, 2) + "-" + bindDateString.Substring(6, 2);
|
|
|
|
|
+ if(!db.MerchantAddInfo.Any(m => m.MchtNo == merNo))
|
|
|
|
|
+ {
|
|
|
|
|
+ MerchantAddInfo source = db.MerchantAddInfo.FirstOrDefault(m => m.CertMerchantName == merName && m.ParentId == 0);
|
|
|
|
|
+ int sourceCount = db.MerchantAddInfo.Count(m => m.CertMerchantName == merName && m.ParentId == 0);
|
|
|
|
|
+ if(source != null && sourceCount == 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ MerchantInfo sourceInfo = db.MerchantInfo.FirstOrDefault(m => m.Id == source.Id) ?? new MerchantInfo();
|
|
|
|
|
+ MerchantInfo info = db.MerchantInfo.Add(new MerchantInfo()
|
|
|
|
|
+ {
|
|
|
|
|
+ CreateDate = DateTime.Parse(bindDate),
|
|
|
|
|
+ UpdateDate = DateTime.Parse(bindDate),
|
|
|
|
|
+ Name = merName,
|
|
|
|
|
+ UserId = sourceInfo.UserId,
|
|
|
|
|
+ ParentId = source.Id,
|
|
|
|
|
+ Status = 2,
|
|
|
|
|
+ QueryCount = 2,
|
|
|
|
|
+ Sort = 1,
|
|
|
|
|
+ }).Entity;
|
|
|
|
|
+ db.SaveChanges();
|
|
|
|
|
+ db.MerchantAddInfo.Add(new MerchantAddInfo()
|
|
|
|
|
+ {
|
|
|
|
|
+ Id = info.Id,
|
|
|
|
|
+ CreateDate = DateTime.Parse(bindDate),
|
|
|
|
|
+ UpdateDate = DateTime.Parse(bindDate),
|
|
|
|
|
+ CertMerchantName = merName,
|
|
|
|
|
+ MchtNo = merNo,
|
|
|
|
|
+ ParentId = source.Id,
|
|
|
|
|
+ StoreNo = source.StoreNo,
|
|
|
|
|
+ OutMchtNo = source.OutMchtNo,
|
|
|
|
|
+ BrandId = source.BrandId,
|
|
|
|
|
+ AgentName = source.AgentName,
|
|
|
|
|
+ Status = 2,
|
|
|
|
|
+ QueryCount = 2,
|
|
|
|
|
+ HdStatus = 1,
|
|
|
|
|
+ });
|
|
|
|
|
+ db.SaveChanges();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ db.Dispose();
|
|
|
|
|
+ return "ok";
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|