/// <summary> /// 更新商家收入 /// </summary> /// <param name="group"></param> /// <param name="tran"></param> public void UpdateIncome(PinGroup group, TransactionModel tran) { PinStore store = GetModel(group.storeId); if (store == null) { log4net.LogHelper.WriteError(GetType(), new Exception($"门店信息不存在storeId:{group.storeId}")); return; } PinGoodsOrderBLL pinGoodsOrderBLL = new PinGoodsOrderBLL(); List <PinGoodsOrder> orderList = pinGoodsOrderBLL.GetListByGroupId(group.id); if (orderList != null && orderList.Count > 0) { orderList = orderList.Where(order => order.state == (int)PinEnums.PinOrderState.交易成功 || order.state == (int)PinEnums.PinOrderState.已评价).ToList(); if (orderList != null && orderList.Count > 0) { foreach (var order in orderList) { AddIncome(order, store, tran, 1); } } } }
public STM32F1XX_HD() { var gpioA = new SimpleDeviceNode { Name = "GpioA", Regs = new[] { new RegRange { Start = 0x40010800, Length = 0x400.Bytes() } } }; var portA = new PinBank { Name = "PortA", PinsCount = 16, Device = gpioA }; var pgUsart1A = new PinGroup { Name = "Usart1-A", Pins = new[] { new PinFunction { Name = "TX", Pin = new PinRef(portA, 9) }, new PinFunction { Name = "RX", Pin = new PinRef(portA, 10) } } }; _chips.Add(new ChipDefinition { Id = STM32F103ZET6, Vendor = "ST", Name = "STM32F103ZET6", Memories = new[] { new MemoryRange { Name = "FLASH", Attribute = "rx", Start = 0x08000000, Length = 512.Kibibytes() }, new MemoryRange { Name = "RAM", Attribute = "rw", Start = 0x20000000, Length = 64.Kibibytes() } }, PinBanks = new[] { portA }, PinGroups = new[] { pgUsart1A }, Root = new MachineNode { Name = "STM32F103ZET6", Devices = new[] { new SimpleBusNode { Name = "soc", Children = new[] { gpioA, new SimpleDeviceNode { Name = "Rcc", Regs = new[] { new RegRange { Start = 0x40021800, Length = 0x400.Bytes() } }, }, new SimpleDeviceNode { Name = "Usart1", Compatible = new[] { DeviceCompatibles.Usart }, Regs = new[] { new RegRange { Start = 0x40013800, Length = 0x400.Bytes() } }, PinGroups = new[] { pgUsart1A } } } } } } }); }
public uint GetGroupPin(PinGroup group) { byte readCommand; uint RetVal; var txBuffer = new byte[6]; var rxBuffer = new byte[6]; if (group == PinGroup.Lower) { readCommand = (byte)Command.GetPinInputLow; } else { readCommand = (byte)Command.GetPinInputHigh; } txBuffer[0] = readCommand; txBuffer[1] = 0x00; txBuffer[2] = 0x00; txBuffer[3] = 0x00; txBuffer[4] = 0x00; txBuffer[5] = 0x00; spi.WriteRead(txBuffer, rxBuffer); RetVal = (uint)((rxBuffer[2] << 24) + (rxBuffer[3] << 16) + (rxBuffer[4] << 8) + (rxBuffer[5])); return RetVal; }
public void SetGroupPin(PinGroup group, uint state) { byte readCommand; var txBuffer = new byte[6]; var rxBuffer = new byte[6]; if (group==PinGroup.Lower) { readCommand = (byte)Command.SetPinStateLow; } else { readCommand = (byte)Command.SetPinStateHigh; } txBuffer[0] = readCommand; txBuffer[2] = (byte)(state >> 24 & 0xFF); txBuffer[3] = (byte)(state >> 16 & 0xFF); txBuffer[4] = (byte)(state >> 8 & 0xFF); txBuffer[5] = (byte)(state & 0xFF); spi.Write(txBuffer); }