public static AccountCheckingDAO GetUserAccountInfos(string uid, string machineSn)
        {
            var startTime = PosCheckingLocalService.GetLastPosChecking();
            //入款
            var depositMoney = CurrentRepository
                               .FindList(o => o.MachineSN == machineSn && o.CreateDT >= startTime && o.CreateUID == uid && o.Type == 1).ToList()
                               .Select(o => (decimal?)o.Amount).Sum() ?? 0;
            //出款
            var takeOutMoney = CurrentRepository
                               .FindList(o => o.MachineSN == machineSn && o.CreateDT >= startTime && o.CreateUID == uid && o.Type == 0).ToList()
                               .Select(o => (decimal?)o.Amount).Sum() ?? 0;
            //退货
            var returnSales = SalesReturnsLocalService.GetReturnSalesForBJ(startTime, uid, machineSn);

            return(new AccountCheckingDAO()
            {
                DepositMoney = depositMoney,
                TakeOutMoney = takeOutMoney,
                TotalSales = SaleOrdersLocalService.GetTotalSales(startTime, uid, machineSn),                                                      //销售总额
                ChangingSales = SaleOrdersLocalService.GetChangingSales(startTime, uid, machineSn),                                                //换货补价
                AllPayWayStatistics = ConsumptionPaymentLocalService.GetOnePayWayAmount(startTime, uid, machineSn),                                //所有支付方式统计
                SurplusCash = depositMoney - takeOutMoney + ConsumptionPaymentLocalService.GetCashPayWay(startTime, uid, machineSn) - returnSales, //当前现金
                ReturnSales = returnSales
            });
        }
        public static void Save(SaleOrders Infos)
        {
            SaleOrdersLocalService.IsForcedExpired = true;
            var repository = SaleOrdersLocalService.CurrentRepository;
            var order      = SaleOrdersLocalService.Find(o => o.PaySN == Infos.PaySN);

            if (order != null)
            {
                order.ApiCode += "," + Infos.ApiCode;
                repository.Update(order);
            }
            else
            {
                repository.Add(Infos);
            }
        }