| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- using System;
- using System.Collections.Generic;
- using Library;
- using LitJson;
- using System.Linq;
- using System.Data;
- using System.Threading;
- using MySystem.PxcModels;
- namespace MySystem
- {
- public class TmpService
- {
- public readonly static TmpService Instance = new TmpService();
- private TmpService()
- { }
- public void Start()
- {
- Thread th = new Thread(poscheck);
- th.IsBackground = true;
- th.Start();
- }
- private void SetLkbDeposit()
- {
- while (true)
- {
- try
- {
- string content = RedisDbconn.Instance.RPop<string>("SetLkbDepositQueue");
- if (!string.IsNullOrEmpty(content))
- {
- string[] data = content.Split('|');
- PublicImportDataService.Instance.LkbSetDeposit(data[0], decimal.Parse(data[1]));
- }
- else
- {
- Thread.Sleep(2000);
- }
- }
- catch (Exception ex)
- {
- Utils.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "商城订单余额支付异常");
- Thread.Sleep(2000);
- }
- }
- }
- public void dosomething()
- {
- string content = function.ReadInstance("jk299.txt");
- string[] SnNos = content.Split('\n');
- int count = SnNos.Length;
- int index = 0;
- foreach(string SnNo in SnNos)
- {
- index += 1;
- PublicImportDataService.Instance.LkbSetDeposit(SnNo, 299);
- function.WritePage("/look/", "progress.txt", index + "/" + count);
- function.WritePage("/look/", "sn.txt", SnNo);
- Thread.Sleep(100);
- }
- content = function.ReadInstance("jk0.txt");
- SnNos = content.Split('\n');
- count = SnNos.Length;
- index = 0;
- foreach(string SnNo in SnNos)
- {
- index += 1;
- PublicImportDataService.Instance.LkbSetDeposit(SnNo, 0);
- function.WritePage("/look/", "progress.txt", index + "/" + count);
- function.WritePage("/look/", "sn.txt", SnNo);
- Thread.Sleep(100);
- }
- }
- public void poscheck()
- {
- string[] poslist = function.ReadInstance("pos.txt").Split('\n');
- List<string> pos25 = function.ReadInstance("pos25.txt").Split('\n').ToList();
- foreach(string possn in poslist)
- {
- if(!pos25.Contains(possn))
- {
- string result = PublicImportDataService.Instance.LkbSetFee(possn, 0.7M, 300);
- function.WriteLog(possn + "\n" + result + "\n\n", "25年前的金控机具费率");
- Thread.Sleep(500);
- }
- }
- }
- }
- }
|