material.go 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  1. package pkg2024
  2. import (
  3. "zhiyuan/pkg/utils"
  4. )
  5. type ShowFunction func(context *ItemContext) bool
  6. type IntArrayFunction func(context *ItemContext) []int64
  7. type Brand struct {
  8. Name string `json:"name"`
  9. Supplier int64 `json:"supplier"`
  10. }
  11. type Region struct {
  12. Material int64
  13. MaterialName string
  14. Brand int
  15. Series int
  16. }
  17. type RegionFrom struct {
  18. SpaceType int `form:"space_type" json:"space_type"`
  19. SpaceIndex int `form:"space_index" json:"space_index"`
  20. Index int `form:"index" json:"index"`
  21. Material int64 `form:"material" json:"material"`
  22. Brand int `form:"brand" json:"brand"`
  23. Series int `form:"series" json:"series"`
  24. }
  25. type RegionObject struct {
  26. Name string
  27. Type []int64
  28. DefaultCalc ItemJudgmentFunction
  29. DefaultMaterialCalc ItemIntFunction
  30. DefaultMaterial map[int]int64
  31. Brand []Brand
  32. DefaultBrand map[int]int
  33. Series [][]string
  34. DefaultSeries map[int]int
  35. Note string
  36. Unit string
  37. ControlPrice map[int]float64
  38. Convert map[int64]float64
  39. Convert1 map[int64]float64
  40. ShowCalc ShowFunction
  41. SupplierCalc IntArrayFunction
  42. MaterialPriceCalc ItemNumberFunction
  43. }
  44. func (region RegionObject) Show(context *ItemContext) bool {
  45. if region.ShowCalc != nil {
  46. return region.ShowCalc(context)
  47. }
  48. return true
  49. }
  50. func (region RegionObject) Suppliers(context *ItemContext) []int64 {
  51. if region.SupplierCalc != nil {
  52. return region.SupplierCalc(context)
  53. }
  54. return nil
  55. }
  56. type RegionData map[int][]map[int]Region
  57. var Regions = map[int][]RegionObject{
  58. -1: {
  59. {
  60. Name: "开关面板",
  61. Brand: []Brand{{"伊诺", 21}, {"公牛", 120}},
  62. Series: [][]string{
  63. {"月光白", "月光灰", "千金系列宝石灰", "千金系列宝石蓝", "E10系列白色", "E6象牙白", "E6肤感灰"},
  64. {"G12系列白色", "G12系列金色", "G12系列灰色", "G37系列白色", "G37系列金色", "G37系列灰色", "G33系列白色", "G33系列金色", "G33系列灰色"},
  65. },
  66. MaterialPriceCalc: func(context *ItemContext) (float64, error) {
  67. prices := [][]float64{{9.8, 9.8, 8, 8, 5.5, 5.5, 5.5}, {9.8, 9.8, 9.8, 8, 8, 8, 5.5, 5.5, 5.5}}
  68. num := 65
  69. if context.Pkg.RoomData.Pkg.Layout[0] > 2 {
  70. num += (context.Pkg.RoomData.Pkg.Layout[0] - 2) * 13
  71. }
  72. if context.Pkg.RoomData.Pkg.Layout[1] > 2 {
  73. num += (context.Pkg.RoomData.Pkg.Layout[1] - 2) * 16
  74. }
  75. if context.Pkg.RoomData.Pkg.Layout[3] > 1 {
  76. num += (context.Pkg.RoomData.Pkg.Layout[3] - 1) * 4
  77. }
  78. if context.Pkg.RoomData.Pkg.Layout[4] > 1 {
  79. num += (context.Pkg.RoomData.Pkg.Layout[4] - 1) * 3
  80. }
  81. return utils.FloatMul(prices[context.Region.Brand][context.Region.Series], float64(num), -1), nil
  82. },
  83. Unit: "套",
  84. DefaultBrand: map[int]int{A10: 0, A8: 0, A5: 0, ZZ1_0: 0},
  85. DefaultSeries: map[int]int{A10: 0, A8: 2, A5: 4, ZZ1_0: 2},
  86. },
  87. {
  88. Name: "地漏", Type: []int64{129},
  89. DefaultMaterial: map[int]int64{A10: 4776, A8: 4776, A5: 4776, ZZ1_0: 4776},
  90. Note: "全房地漏数量不限",
  91. ControlPrice: map[int]float64{A10: 21, A8: 28, A5: 21, ZZ1_0: 28},
  92. Unit: "个",
  93. },
  94. {
  95. Name: "角阀", Type: []int64{29},
  96. DefaultMaterial: map[int]int64{A10: 4779, A8: 4779, A5: 4779, ZZ1_0: 4779},
  97. Note: "含热水器角阀",
  98. ControlPrice: map[int]float64{A10: 17, A8: 17, A5: 17, ZZ1_0: 17},
  99. Unit: "个",
  100. },
  101. {
  102. Name: "窗台石", Type: []int64{190},
  103. DefaultMaterial: map[int]int64{A10: 47, A8: 47, A5: 47, ZZ1_0: 47},
  104. Note: "全房窗台石(不含阳台区域)",
  105. Unit: "m",
  106. },
  107. {
  108. Name: "门槛石", Type: []int64{189},
  109. DefaultMaterial: map[int]int64{A10: 50, A8: 50, A5: 50, ZZ1_0: 50},
  110. Note: "全房门槛石(不含阳台区域)",
  111. Unit: "m",
  112. },
  113. },
  114. 0: {
  115. {
  116. Name: "木门", Type: []int64{90},
  117. DefaultMaterial: map[int]int64{A10: 5309, A8: 5368, A5: 1259, ZZ1_0: 5368},
  118. Note: "1、房门标准尺寸为房门标准尺寸为2100*900*300mm,门洞高度每超10mm,加收15元;宽度每超10mm,加收15元;墙厚每超10mm,加收25元。\n2、单户限选一个品牌",
  119. ControlPrice: map[int]float64{A10: 1300, A8: 850, A5: 700, ZZ1_0: 850},
  120. Unit: "个",
  121. },
  122. {
  123. Name: "地面", Type: []int64{110, 10, 9, 7, 6, 5, 4, 3},
  124. DefaultMaterial: map[int]int64{A10: 4690, A8: 4699, A5: 430, ZZ1_0: 4699},
  125. Note: "1、限选一个品牌,每增加一个品牌加200元。",
  126. Convert: map[int64]float64{110: 1, 10: 1 / 0.09, 9: 1 / 0.18, 7: 1 / 1.125, 6: 1 / 0.72, 5: 1 / 0.64, 4: 1 / 0.16, 3: 1 / 0.32},
  127. ControlPrice: map[int]float64{A10: 92, A8: 84, A5: 70, ZZ1_0: 84},
  128. Unit: "m²",
  129. },
  130. },
  131. 1: {
  132. {
  133. Name: "入户门套", Type: []int64{92},
  134. DefaultMaterial: map[int]int64{A10: 4883, A8: 4883, A5: 0, ZZ1_0: 4883},
  135. ControlPrice: map[int]float64{A10: 90, A8: 90, A5: 0, ZZ1_0: 90},
  136. Unit: "m",
  137. ShowCalc: func(context *ItemContext) bool {
  138. return context.Pkg.RoomData.Pkg.Type != A5
  139. },
  140. },
  141. {
  142. Name: "地面", Type: []int64{110, 10, 9, 7, 6, 5, 4, 3},
  143. DefaultMaterial: map[int]int64{A10: 4655, A8: 5409, A5: 4966, ZZ1_0: 5409},
  144. Note: "陶瓷类产品选购限2个品牌,每增加一个品牌加价200元/套",
  145. Convert: map[int64]float64{110: 1, 10: 1 / 0.09, 9: 1 / 0.18, 7: 1 / 1.125, 6: 1 / 0.72, 5: 1 / 0.64, 4: 1 / 0.16, 3: 1 / 0.32},
  146. ControlPrice: map[int]float64{A10: 81, A8: 56, A5: 36, ZZ1_0: 56},
  147. Unit: "m²",
  148. },
  149. {
  150. Name: "筒灯或灯带", Type: []int64{230},
  151. DefaultMaterial: map[int]int64{A10: 0, A8: 0, A5: 0, ZZ1_0: 6496},
  152. ControlPrice: map[int]float64{A10: 0, A8: 0, A5: 0, ZZ1_0: 8},
  153. Unit: "套",
  154. ShowCalc: func(context *ItemContext) bool {
  155. return context.Pkg.RoomData.Pkg.Type == ZZ1_0
  156. },
  157. },
  158. },
  159. 2: {
  160. {
  161. Name: "铝合金门", Type: []int64{106, 105},
  162. DefaultMaterial: map[int]int64{A10: 1603, A8: 1603, A5: 1602, ZZ1_0: 1603},
  163. Note: "1、铝合金平开门标准尺寸:2000*750*280mm\n2、单户限选一个品牌",
  164. Convert: map[int64]float64{105: 1, 106: 3.52}, Convert1: map[int64]float64{105: 1, 106: 1 / 3.52},
  165. ControlPrice: map[int]float64{A10: 1513.6, A8: 1418.56, A5: 700, ZZ1_0: 403}},
  166. {
  167. Name: "门套", Type: []int64{109, 108},
  168. DefaultMaterial: map[int]int64{A10: 1606, A8: 1606, A5: 0, ZZ1_0: 1606},
  169. ControlPrice: map[int]float64{A10: 90, A8: 90, A5: 0, ZZ1_0: 90}, Unit: "m",
  170. ShowCalc: func(context *ItemContext) bool {
  171. return context.Pkg.RoomData.Pkg.Type != A5
  172. },
  173. },
  174. {
  175. Name: "墙砖", Type: []int64{10, 9, 7, 6, 5, 4, 3},
  176. DefaultMaterial: map[int]int64{A10: 163, A8: 4618, A5: 4968, ZZ1_0: 4618},
  177. Note: "1、陶瓷类产品选购限2个品牌,每增加一个品牌加价200元/套",
  178. Convert: map[int64]float64{10: 1 / 0.09, 9: 1 / 0.18, 7: 1 / 1.125, 6: 1 / 0.72, 5: 1 / 0.64, 4: 1 / 0.16, 3: 1 / 0.32},
  179. ControlPrice: map[int]float64{A10: 81, A8: 56, A5: 31, ZZ1_0: 56},
  180. Unit: "m²",
  181. },
  182. {
  183. Name: "地砖", Type: []int64{10, 9, 7, 6, 5, 4, 3},
  184. DefaultMaterial: map[int]int64{A10: 4990, A8: 5409, A5: 4966, ZZ1_0: 5409},
  185. Note: "1、陶瓷类产品选购限2个品牌,每增加一个品牌加价200元/套\n2、地砖同墙砖品牌",
  186. Convert: map[int64]float64{10: 1 / 0.09, 9: 1 / 0.18, 7: 1 / 1.125, 6: 1 / 0.72, 5: 1 / 0.64, 4: 1 / 0.16, 3: 1 / 0.32},
  187. ControlPrice: map[int]float64{A10: 81, A8: 56, A5: 36, ZZ1_0: 56},
  188. Unit: "m²",
  189. },
  190. {
  191. Name: "橱柜", Brand: []Brand{{"金牌", 118}, {"德莎", 14}, {"阳光木业", 24}},
  192. DefaultBrand: map[int]int{A10: 0, A8: 1, A5: 2, ZZ1_0: 1},
  193. },
  194. {
  195. Name: "橱柜地柜", Type: []int64{118},
  196. /*DefaultCalc: func(context *ItemContext) (bool, error) {
  197. brands := []int64{118, 14, 24}
  198. brand := context.Pkg.RegionData[context.SpaceType][context.SpaceIndex][4].Brand
  199. material := context.Pkg.RegionData[context.SpaceType][context.SpaceIndex][5].Material
  200. mat := context.GetMat(material)
  201. if mat == nil {
  202. return true, nil
  203. }
  204. return mat.SupplierId != brands[brand], nil
  205. },*/
  206. DefaultMaterialCalc: func(context *ItemContext) (int64, error) {
  207. materials := map[int][]int64{A10: {5475, 5451, 5533}, A8: {5475, 5157, 5533}, A5: {5475, 5157, 5533}, ZZ1_0: {5475, 5157, 5533}}
  208. brand := map[int]int{A10: 0, A8: 1, A5: 2, ZZ1_0: 1}[context.Pkg.RoomData.Pkg.Type]
  209. if len(context.Pkg.RegionData[context.SpaceType]) > context.SpaceIndex {
  210. brand = context.Pkg.RegionData[context.SpaceType][context.SpaceIndex][4].Brand
  211. }
  212. return materials[context.Pkg.RoomData.Pkg.Type][brand], nil
  213. },
  214. Note: "橱柜柜体为实木颗粒防潮板",
  215. ControlPrice: map[int]float64{A10: 592, A8: 460, A5: 306, ZZ1_0: 350},
  216. Unit: "m",
  217. SupplierCalc: func(context *ItemContext) []int64 {
  218. brands := []int64{118, 14, 24}
  219. brand := context.Pkg.RegionData[context.SpaceType][context.SpaceIndex][4].Brand
  220. return []int64{brands[brand]}
  221. },
  222. },
  223. {
  224. Name: "橱柜吊柜", Type: []int64{117},
  225. /*DefaultCalc: func(context *ItemContext) (bool, error) {
  226. brands := []int64{118, 14, 24}
  227. brand := context.Pkg.RegionData[context.SpaceType][context.SpaceIndex][4].Brand
  228. material := context.Pkg.RegionData[context.SpaceType][context.SpaceIndex][6].Material
  229. mat := context.GetMat(material)
  230. if mat == nil {
  231. return true, nil
  232. }
  233. return mat.SupplierId != brands[brand], nil
  234. },*/
  235. DefaultMaterialCalc: func(context *ItemContext) (int64, error) {
  236. materials := map[int][]int64{A10: {5498, 5463, 5535}, A8: {5498, 5170, 5535}, A5: {5498, 5170, 5535}, ZZ1_0: {5498, 5170, 5535}}
  237. brand := map[int]int{A10: 0, A8: 1, A5: 2, ZZ1_0: 1}[context.Pkg.RoomData.Pkg.Type]
  238. if len(context.Pkg.RegionData[context.SpaceType]) > context.SpaceIndex {
  239. brand = context.Pkg.RegionData[context.SpaceType][context.SpaceIndex][4].Brand
  240. }
  241. return materials[context.Pkg.RoomData.Pkg.Type][brand], nil
  242. },
  243. Note: "橱柜柜体为实木颗粒防潮板",
  244. ControlPrice: map[int]float64{A10: 434, A8: 170, A5: 294, ZZ1_0: 310},
  245. Unit: "m",
  246. SupplierCalc: func(context *ItemContext) []int64 {
  247. brands := []int64{118, 14, 24}
  248. brand := context.Pkg.RegionData[context.SpaceType][context.SpaceIndex][4].Brand
  249. return []int64{brands[brand]}
  250. },
  251. },
  252. {
  253. Name: "橱柜台面", Type: []int64{119},
  254. /*DefaultCalc: func(context *ItemContext) (bool, error) {
  255. brands := []int64{118, 14, 24}
  256. brand := context.Pkg.RegionData[context.SpaceType][context.SpaceIndex][4].Brand
  257. material := context.Pkg.RegionData[context.SpaceType][context.SpaceIndex][7].Material
  258. mat := context.GetMat(material)
  259. if mat == nil {
  260. return true, nil
  261. }
  262. return mat.SupplierId != brands[brand], nil
  263. },*/
  264. DefaultMaterialCalc: func(context *ItemContext) (int64, error) {
  265. materials := map[int][]int64{A10: {5231, 5206, 5534}, A8: {5231, 5182, 5534}, A5: {5231, 5182, 5534}, ZZ1_0: {5231, 5182, 5534}}
  266. brand := map[int]int{A10: 0, A8: 1, A5: 2, ZZ1_0: 1}[context.Pkg.RoomData.Pkg.Type]
  267. if len(context.Pkg.RegionData[context.SpaceType]) > context.SpaceIndex {
  268. brand = context.Pkg.RegionData[context.SpaceType][context.SpaceIndex][4].Brand
  269. }
  270. return materials[context.Pkg.RoomData.Pkg.Type][brand], nil
  271. },
  272. Note: "1、台面须和橱柜同品牌",
  273. ControlPrice: map[int]float64{A10: 515, A8: 450, A5: 380, ZZ1_0: 420},
  274. Unit: "m",
  275. SupplierCalc: func(context *ItemContext) []int64 {
  276. brands := []int64{118, 14, 24}
  277. brand := context.Pkg.RegionData[context.SpaceType][context.SpaceIndex][4].Brand
  278. return []int64{brands[brand]}
  279. },
  280. },
  281. {
  282. Name: "燃气包管", Type: []int64{114},
  283. /*DefaultCalc: func(context *ItemContext) (bool, error) {
  284. brands := []int64{118, 14, 24}
  285. brand := context.Pkg.RegionData[context.SpaceType][context.SpaceIndex][4].Brand
  286. material := context.Pkg.RegionData[context.SpaceType][context.SpaceIndex][8].Material
  287. mat := context.GetMat(material)
  288. if mat == nil {
  289. return true, nil
  290. }
  291. return mat.SupplierId != brands[brand], nil
  292. },*/
  293. DefaultMaterialCalc: func(context *ItemContext) (int64, error) {
  294. materials := []int64{4775, 82, 5538, 82}
  295. brand := map[int]int{A10: 0, A8: 1, A5: 2, ZZ1_0: 1}[context.Pkg.RoomData.Pkg.Type]
  296. if len(context.Pkg.RegionData[context.SpaceType]) > context.SpaceIndex {
  297. brand = context.Pkg.RegionData[context.SpaceType][context.SpaceIndex][4].Brand
  298. }
  299. return materials[brand], nil
  300. },
  301. ControlPrice: map[int]float64{A10: 120, A8: 120, A5: 120, ZZ1_0: 120},
  302. Unit: "根",
  303. SupplierCalc: func(context *ItemContext) []int64 {
  304. brands := []int64{118, 14, 24}
  305. brand := context.Pkg.RegionData[context.SpaceType][context.SpaceIndex][4].Brand
  306. return []int64{brands[brand]}
  307. },
  308. },
  309. {
  310. Name: "洗菜盆及龙头", Type: []int64{116, 28},
  311. /*DefaultCalc: func(context *ItemContext) (bool, error) {
  312. brands := []int64{43, 14, 43}
  313. brand := context.Pkg.RegionData[context.SpaceType][context.SpaceIndex][4].Brand
  314. material := context.Pkg.RegionData[context.SpaceType][context.SpaceIndex][9].Material
  315. mat := context.GetMat(material)
  316. if mat == nil {
  317. return true, nil
  318. }
  319. return mat.SupplierId != brands[brand], nil
  320. },*/
  321. DefaultMaterialCalc: func(context *ItemContext) (int64, error) {
  322. materials := []int64{634, 85, 637}
  323. brand := map[int]int{A10: 0, A8: 1, A5: 2, ZZ1_0: 1}[context.Pkg.RoomData.Pkg.Type]
  324. if len(context.Pkg.RegionData[context.SpaceType]) > context.SpaceIndex {
  325. brand = context.Pkg.RegionData[context.SpaceType][context.SpaceIndex][4].Brand
  326. }
  327. return materials[brand], nil
  328. },
  329. Note: "台中盆、台下盆:加价300元/套",
  330. ControlPrice: map[int]float64{A10: 468, A8: 468, A5: 468, ZZ1_0: 468},
  331. Unit: "套",
  332. SupplierCalc: func(context *ItemContext) []int64 {
  333. brands := [][]int64{{118, 43}, {14}, {24, 43}}
  334. brand := context.Pkg.RegionData[context.SpaceType][context.SpaceIndex][4].Brand
  335. return brands[brand]
  336. },
  337. },
  338. {
  339. Name: "集成吊顶", Type: []int64{128, 188, 187},
  340. DefaultMaterial: map[int]int64{A10: 4411, A8: 4411, A5: 4411, ZZ1_0: 4411},
  341. Convert: map[int64]float64{128: 1, 188: 1 / 0.18, 187: 1 / 0.09},
  342. ControlPrice: map[int]float64{A10: 90, A8: 90, A5: 75, ZZ1_0: 90},
  343. Unit: "m²",
  344. },
  345. {
  346. Name: "吊顶灯", Type: []int64{131},
  347. DefaultMaterial: map[int]int64{A10: 5018, A8: 5018, A5: 5018, ZZ1_0: 5018},
  348. ControlPrice: map[int]float64{A10: 38, A8: 38, A5: 38, ZZ1_0: 38},
  349. Unit: "个",
  350. },
  351. },
  352. 3: {
  353. {
  354. Name: "平开门", Type: []int64{105},
  355. DefaultMaterial: map[int]int64{A10: 4980, A8: 1601, A5: 1601, ZZ1_0: 4980},
  356. Note: "1、标配双包门套\n2、单户限选一个品牌",
  357. ControlPrice: map[int]float64{A10: 865, A8: 780, A5: 780, ZZ1_0: 900},
  358. Unit: "樘",
  359. },
  360. {
  361. Name: "墙砖", Type: []int64{10, 9, 7, 6, 5, 4, 3},
  362. DefaultMaterial: map[int]int64{A10: 163, A8: 4618, A5: 4968, ZZ1_0: 4618},
  363. Note: "陶瓷类产品选购限2个品牌,每增加一个品牌加价200元/套",
  364. Convert: map[int64]float64{10: 1 / 0.09, 9: 1 / 0.18, 7: 1 / 1.125, 6: 1 / 0.72, 5: 1 / 0.64, 4: 1 / 0.16, 3: 1 / 0.32},
  365. ControlPrice: map[int]float64{A10: 81, A8: 56, A5: 31, ZZ1_0: 56},
  366. Unit: "m²",
  367. },
  368. {
  369. Name: "地砖", Type: []int64{10, 9, 7, 6, 5, 4, 3},
  370. DefaultMaterial: map[int]int64{A10: 4990, A8: 5409, A5: 4966, ZZ1_0: 5409},
  371. Note: "1、陶瓷类产品选购限2个品牌,每增加一个品牌加价200元/套\n2、地砖同墙砖品牌",
  372. Convert: map[int64]float64{10: 1 / 0.09, 9: 1 / 0.18, 7: 1 / 1.125, 6: 1 / 0.72, 5: 1 / 0.64, 4: 1 / 0.16, 3: 1 / 0.32},
  373. ControlPrice: map[int]float64{A10: 81, A8: 56, A5: 36, ZZ1_0: 56}, Unit: "m²",
  374. ShowCalc: func(context *ItemContext) bool {
  375. return !context.Space.DryWetSeparation
  376. },
  377. },
  378. {
  379. Name: "干区地砖", Type: []int64{10, 9, 7, 6, 5, 4, 3},
  380. DefaultMaterial: map[int]int64{A10: 4990, A8: 5409, A5: 4966, ZZ1_0: 5409},
  381. Note: "1、陶瓷类产品选购限2个品牌,每增加一个品牌加价200元/套\n2、地砖同墙砖品牌",
  382. Convert: map[int64]float64{10: 1 / 0.09, 9: 1 / 0.18, 7: 1 / 1.125, 6: 1 / 0.72, 5: 1 / 0.64, 4: 1 / 0.16, 3: 1 / 0.32},
  383. ControlPrice: map[int]float64{A10: 81, A8: 56, A5: 36, ZZ1_0: 56}, Unit: "m²",
  384. ShowCalc: func(context *ItemContext) bool {
  385. return context.Space.DryWetSeparation
  386. },
  387. },
  388. {
  389. Name: "湿区地砖", Type: []int64{10, 9, 7, 6, 5, 4, 3},
  390. DefaultMaterial: map[int]int64{A10: 4990, A8: 5409, A5: 4966, ZZ1_0: 5409},
  391. Note: "1、陶瓷类产品选购限2个品牌,每增加一个品牌加价200元/套\n2、地砖同墙砖品牌",
  392. Convert: map[int64]float64{10: 1 / 0.09, 9: 1 / 0.18, 7: 1 / 1.125, 6: 1 / 0.72, 5: 1 / 0.64, 4: 1 / 0.16, 3: 1 / 0.32},
  393. ControlPrice: map[int]float64{A10: 81, A8: 56, A5: 36, ZZ1_0: 56}, Unit: "m²",
  394. ShowCalc: func(context *ItemContext) bool {
  395. return context.Space.DryWetSeparation
  396. },
  397. },
  398. {
  399. Name: "浴室柜(含龙头)", Type: []int64{97},
  400. DefaultMaterial: map[int]int64{A10: 4884, A8: 1613, A5: 1618, ZZ1_0: 1613},
  401. Note: "1、一个卫生间选购限1个品牌,每增加一个品牌加价200元/套",
  402. ControlPrice: map[int]float64{A10: 1630, A8: 1000, A5: 960, ZZ1_0: 1000},
  403. Unit: "套",
  404. },
  405. {
  406. Name: "淋浴花洒", Type: []int64{98},
  407. DefaultMaterial: map[int]int64{A10: 4894, A8: 6518, A5: 5133, ZZ1_0: 6518},
  408. Note: "1、一个卫生间选购限1个品牌,每增加一个品牌加价200元/套",
  409. ControlPrice: map[int]float64{A10: 650, A8: 390, A5: 400, ZZ1_0: 400},
  410. Unit: "套",
  411. },
  412. {
  413. Name: "马桶蹲坑", Type: []int64{100, 103},
  414. DefaultMaterial: map[int]int64{A10: 4892, A8: 897, A5: 32, ZZ1_0: 897},
  415. Note: "马桶蹲坑二选一",
  416. ControlPrice: map[int]float64{A10: 720, A8: 450, A5: 500, ZZ1_0: 460},
  417. Unit: "套",
  418. },
  419. {
  420. Name: "集成吊顶", Type: []int64{128, 188, 187},
  421. DefaultMaterial: map[int]int64{A10: 4411, A8: 4411, A5: 4411, ZZ1_0: 4411},
  422. Convert: map[int64]float64{128: 1, 188: 1 / 0.18, 187: 1 / 0.09},
  423. ControlPrice: map[int]float64{A10: 90, A8: 90, A5: 75, ZZ1_0: 90},
  424. Unit: "m²",
  425. },
  426. //{Name: "吊顶灯", Type: []int64{131}, DefaultMaterial: map[int]int64{A10: 5018, A8: 5018, A5: 5018}, ControlPrice: map[int]float64{A10: 38, A8: 38, A5: 38}, Unit: "个"},
  427. {
  428. Name: "浴霸", Type: []int64{130},
  429. DefaultMaterial: map[int]int64{A10: 0, A8: 0, A5: 0, ZZ1_0: 6404},
  430. ControlPrice: map[int]float64{A10: 0, A8: 0, A5: 0, ZZ1_0: 242},
  431. Unit: "个",
  432. ShowCalc: func(context *ItemContext) bool {
  433. return context.Pkg.RoomData.Pkg.Type == ZZ1_0
  434. },
  435. },
  436. {
  437. Name: "淋浴隔断", Type: []int64{122},
  438. DefaultMaterial: map[int]int64{A10: 0, A8: 0, A5: 0, ZZ1_0: 127},
  439. ControlPrice: map[int]float64{A10: 0, A8: 0, A5: 0, ZZ1_0: 285},
  440. Unit: "m²",
  441. ShowCalc: func(context *ItemContext) bool {
  442. return context.Pkg.RoomData.Pkg.Type == ZZ1_0
  443. },
  444. },
  445. {
  446. Name: "石基", Type: []int64{126},
  447. DefaultMaterial: map[int]int64{A10: 0, A8: 0, A5: 0, ZZ1_0: 137},
  448. ControlPrice: map[int]float64{A10: 0, A8: 0, A5: 0, ZZ1_0: 35},
  449. Unit: "m",
  450. ShowCalc: func(context *ItemContext) bool {
  451. return context.Pkg.RoomData.Pkg.Type == ZZ1_0
  452. },
  453. },
  454. {
  455. Name: "五金挂件", Type: []int64{209},
  456. DefaultMaterial: map[int]int64{A10: 0, A8: 0, A5: 0, ZZ1_0: 6504},
  457. ControlPrice: map[int]float64{A10: 0, A8: 0, A5: 0, ZZ1_0: 238},
  458. Unit: "套",
  459. ShowCalc: func(context *ItemContext) bool {
  460. return context.Pkg.RoomData.Pkg.Type == ZZ1_0
  461. },
  462. },
  463. },
  464. 4: {
  465. {
  466. Name: "墙砖", Type: []int64{10, 9, 7, 6, 5, 4, 3},
  467. DefaultMaterial: map[int]int64{A10: 0, A8: 0, A5: 0, ZZ1_0: 4618},
  468. Note: "陶瓷类产品选购限2个品牌,每增加一个品牌加价200元/套",
  469. Convert: map[int64]float64{10: 1 / 0.09, 9: 1 / 0.18, 7: 1 / 1.125, 6: 1 / 0.72, 5: 1 / 0.64, 4: 1 / 0.16, 3: 1 / 0.32},
  470. ControlPrice: map[int]float64{A10: 0, A8: 0, A5: 0, ZZ1_0: 56},
  471. Unit: "m²",
  472. ShowCalc: func(context *ItemContext) bool {
  473. return context.Pkg.RoomData.Pkg.Type == ZZ1_0
  474. },
  475. },
  476. {
  477. Name: "地砖", Type: []int64{10, 9, 7, 6, 5, 4, 3},
  478. DefaultMaterial: map[int]int64{A10: 4990, A8: 5409, A5: 4966, ZZ1_0: 5409},
  479. Note: "1、陶瓷类产品选购限2个品牌,每增加一个品牌加价200元/套\n2、地砖同墙砖品牌",
  480. Convert: map[int64]float64{10: 1 / 0.09, 9: 1 / 0.18, 7: 1 / 1.125, 6: 1 / 0.72, 5: 1 / 0.64, 4: 1 / 0.16, 3: 1 / 0.32},
  481. ControlPrice: map[int]float64{A10: 81, A8: 56, A5: 36, ZZ1_0: 56},
  482. Unit: "m²",
  483. },
  484. {
  485. Name: "洗衣机龙头", Type: []int64{27},
  486. DefaultMaterial: map[int]int64{A10: 4780, A8: 4780, A5: 4780, ZZ1_0: 4780},
  487. ControlPrice: map[int]float64{A10: 30, A8: 30, A5: 30, ZZ1_0: 30},
  488. Unit: "个",
  489. },
  490. },
  491. }
  492. type RegionReturn struct {
  493. Name string `json:"name"`
  494. MaterialName string `json:"material_name"`
  495. Type []int64 `json:"type"`
  496. BrandList []Brand `json:"brand_list"`
  497. SeriesList [][]string `json:"series_list"`
  498. Material int64 `json:"material"`
  499. Brand int `json:"brand"`
  500. Series int `json:"series"`
  501. Index int `json:"index"`
  502. Note string `json:"note"`
  503. ControlPrice float64 `json:"control_price"`
  504. Convert map[int64]float64 `json:"convert"`
  505. Convert1 map[int64]float64 `json:"convert1"`
  506. Unit string `json:"unit"`
  507. Suppliers []int64 `json:"suppliers"`
  508. }
  509. type RegionReturns map[int][][]RegionReturn