#pragma once
|
#include "SellStruct.h"
|
#include <map>
|
#include <string>
|
using namespace std;
|
class SellManager
|
{
|
private:
|
map<string, SellSetting*> sellSettingMap;
|
map<string, CodePosition*> codePositionMap;
|
string getNowDate();
|
SellSetting* loadSettingFromFile(string code);
|
|
list<UINT> distributeVolume(UINT total, UINT percent);
|
UINT computeSellVolume(list<UINT> volumeList, list<int> sell_volumes);
|
|
public:
|
void init(string code);
|
|
SellSetting* getSellSetting(string code);
|
|
CodePosition* getCodePosition(string code);
|
|
// Âô³ö
|
int sell(string code, int sellPriceType);
|
|
// Âô³ö
|
// ·µ»ØorderRef
|
int sell(string code, int volume, int sellPriceType);
|
|
// Ëø¶¨Á¿
|
void lockVolume(string code, int volume);
|
|
// ½âËøÁ¿
|
void unLockVolume(string code);
|
|
// ¼ÆË㵱ǰÐèÒªµÄÂô³öÁ¿
|
int computeCurrentMoney(string code);
|
|
// ½«ÉèÖñ£´æµ½ÎļþÖÐ
|
void syncSettingToFile(string code);
|
|
// Çå³ý֮ǰµÄÉèÖÃ
|
void clearPreSettings();
|
|
static int sellMoneyToVolume(int money, double price);
|
|
};
|