admin
8 天以前 6cd92a169cbc0db35042f243a09d976fd3e1445c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#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);
 
};