yeawood_consts 1.0.25 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +30 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -37,6 +37,7 @@ exports.STORAGE_DBS = {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
exports.DEFAULT_USER = '67d9197eb0df37bee9fe8565'
|
|
40
|
+
exports.DEFAULT_ROBOT = '688f55dc1341eb7e618bcc3a'
|
|
40
41
|
exports.DEFAULT_COMPANY = '62da5e1f0d5c6be576fa011a'
|
|
41
42
|
|
|
42
43
|
exports.TENDER_CEE_PROJECT_MODES = [
|
|
@@ -143,6 +144,35 @@ exports.TENDER_CEE_PROJECT_STATE_CALCULATOR = (
|
|
|
143
144
|
}
|
|
144
145
|
}
|
|
145
146
|
|
|
147
|
+
exports.TENDER_CEE_PACKAGE_LEADER_PRICE_CALCULATOR = (
|
|
148
|
+
price,
|
|
149
|
+
places,
|
|
150
|
+
delayCount,
|
|
151
|
+
decreaseType,
|
|
152
|
+
decreaseDelay,
|
|
153
|
+
decreaseBasic
|
|
154
|
+
) => {
|
|
155
|
+
let step = new big(0)
|
|
156
|
+
|
|
157
|
+
const delayDecreases = new big(decreaseDelay).times(delayCount).times(0.01)
|
|
158
|
+
const totalDecreases = new big(decreaseBasic).times(0.01).add(delayDecreases)
|
|
159
|
+
|
|
160
|
+
switch (decreaseType) {
|
|
161
|
+
case 'fixed':
|
|
162
|
+
step = new big(price).times(delayDecreases).add(decreaseBasic)
|
|
163
|
+
break
|
|
164
|
+
case 'ratio':
|
|
165
|
+
step = new big(price).times(totalDecreases)
|
|
166
|
+
break
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return {
|
|
170
|
+
step: step.toFixed(places, 3),
|
|
171
|
+
ratio: step.div(price).times(100).toFixed(places),
|
|
172
|
+
price: price.minus(step.toFixed(places, 3)).toFixed(places, 0)
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
146
176
|
exports.TENDER_COMPANY_FILTER = (company, company_curr) => {
|
|
147
177
|
switch (company) {
|
|
148
178
|
case company_curr:
|