PriceUtils.java 149 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934
  1. package lingtao.net.util;
  2. import lingtao.net.bean.Product;
  3. import lingtao.net.vo.FunReturnVo;
  4. import org.springframework.util.StringUtils;
  5. import java.text.DecimalFormat;
  6. import java.util.ArrayList;
  7. import java.util.Arrays;
  8. import java.util.List;
  9. import java.util.stream.Collectors;
  10. public class PriceUtils {
  11. DecimalFormat df = new DecimalFormat("0.00");
  12. int countArr[] = {500, 1000, 2000, 3000, 5000, 10000, 20000};
  13. /**
  14. * 卷标标签价格
  15. *
  16. * @param kind
  17. * @param area
  18. * @param count
  19. * @param craft
  20. * @param tang
  21. * @param yinbai
  22. * @return
  23. */
  24. public List<Product> rollLabelPrice(String kind, Double area, int count, String[] craft, String yinbai, String tang, double[] tangPrices) {
  25. List<Product> list = new ArrayList<Product>();
  26. Product pro = new Product();
  27. // 最低收费
  28. double lowerPrice = 0.0;
  29. // 印工价格
  30. double yinrPrice = 0.0;
  31. // 平方单价
  32. double danjia = 0.0;
  33. // 总价
  34. double price = 0.0;
  35. // 根据报的尺寸、数量算面积(保留2位小数)
  36. area = Double.valueOf(df.format(area * count));
  37. if (area <= 20) {
  38. yinrPrice = 260;
  39. lowerPrice = 550;
  40. } else if (area <= 150) {
  41. yinrPrice = 300;
  42. lowerPrice = 600;
  43. }
  44. switch (kind) {
  45. /**
  46. * 0:格底铜版纸卷标 1:格底PP合成纸 2:8丝光白PVC 3:5丝格底透明 4:格底哑金/哑银 5:格底银平光 6:单防热敏纸(底纸白色)
  47. * 7:三防热敏纸(底纸蓝色)
  48. */
  49. case "0":
  50. // 根据面积得到单价
  51. if (area <= 20) {
  52. danjia = 8;
  53. } else if (area <= 150) {
  54. danjia = 8;
  55. } else if (area <= 200) {
  56. danjia = 10.5;
  57. } else {
  58. danjia = 10.3;
  59. }
  60. break;
  61. case "1":
  62. // 根据面积得到单价
  63. if (area <= 20) {
  64. danjia = 10;
  65. } else if (area <= 150) {
  66. danjia = 10;
  67. } else if (area <= 200) {
  68. danjia = 12.5;
  69. } else {
  70. danjia = 12.3;
  71. }
  72. break;
  73. case "2":
  74. // 根据面积得到单价
  75. if (area <= 20) {
  76. danjia = 10;
  77. } else if (area <= 150) {
  78. danjia = 10;
  79. } else if (area <= 200) {
  80. danjia = 12.5;
  81. } else {
  82. danjia = 12.3;
  83. }
  84. break;
  85. case "3":
  86. // 根据面积得到单价
  87. if (area <= 20) {
  88. danjia = 10;
  89. } else if (area <= 150) {
  90. danjia = 10;
  91. } else if (area <= 200) {
  92. danjia = 12.5;
  93. } else {
  94. danjia = 12.3;
  95. }
  96. break;
  97. case "4":
  98. // 根据面积得到单价
  99. if (area <= 20) {
  100. danjia = 12;
  101. } else if (area <= 150) {
  102. danjia = 12;
  103. } else if (area <= 200) {
  104. danjia = 15;
  105. } else {
  106. danjia = 14.8;
  107. }
  108. break;
  109. case "5":
  110. // 根据面积得到单价
  111. if (area <= 20) {
  112. danjia = 12;
  113. } else if (area <= 150) {
  114. danjia = 12;
  115. } else if (area <= 200) {
  116. danjia = 15;
  117. } else {
  118. danjia = 14.8;
  119. }
  120. break;
  121. case "6":
  122. // 根据面积得到单价
  123. if (area <= 20) {
  124. danjia = 9;
  125. } else if (area <= 150) {
  126. danjia = 9;
  127. } else if (area <= 200) {
  128. danjia = 11;
  129. } else {
  130. danjia = 10.8;
  131. }
  132. break;
  133. case "7":
  134. // 根据面积得到单价
  135. if (area <= 20) {
  136. danjia = 9.5;
  137. } else if (area <= 150) {
  138. danjia = 9.5;
  139. } else if (area <= 200) {
  140. danjia = 11.5;
  141. } else {
  142. danjia = 11.3;
  143. }
  144. break;
  145. }
  146. // 加上覆膜的价格 (覆哑膜/亮膜 0.6元/平方, 镭射膜1元/平方)
  147. if (!StringUtils.isEmpty(craft)) {
  148. if ("大雪花镭射膜".equals(craft[0])) {
  149. danjia = danjia + 1;
  150. } else if ("覆哑膜".equals(craft[0])) {
  151. danjia = danjia + 0.8;
  152. } else {
  153. danjia = danjia + 0.6;
  154. }
  155. }
  156. price = Math.ceil(Math.max(area * danjia + yinrPrice + count * 0.01, lowerPrice));
  157. // 如果有印白工艺:2元一平方,最低收费200元
  158. if (!StringUtils.isEmpty(yinbai)) {
  159. price = price + (area * 2 > 200 ? area * 2 : 200);
  160. }
  161. double tang_price = 0;
  162. if (!StringUtils.isEmpty(tang) && "烫金".equals(tang)) {
  163. int[] bigCountArr = {500, 1000, 2000, 3000, 5000, 10000};
  164. for (int i = 0; i < bigCountArr.length; i++) {
  165. if (count >= bigCountArr[i]) {
  166. tang_price = price + tangPrices[i];
  167. }
  168. }
  169. }
  170. pro.setCount(count);
  171. pro.setPrice(Math.max(tang_price, price));
  172. list.add(pro);
  173. /*
  174. * for (int i = 0; i < countArr.length; i++) { if (countArr[i] < count) {
  175. * continue; } if (countArr[i] * area <= 150) { danjia = 15; } else if
  176. * (countArr[i] * area <= 200) { danjia = 14.5; } else { danjia = 14; } if
  177. * (!StringUtils.isEmpty(craft)) { if (!"大雪花镭射膜".equals(craft[0])) { danjia =
  178. * danjia + 1; } else { danjia = danjia + 0.6; } } pro = new Product();
  179. * pro.setCount(countArr[i]); pro.setPrice(Math.ceil(countArr[i] * area * danjia
  180. * > 550 ? countArr[i] * area * danjia : 550)); list.add(pro); }
  181. */
  182. return list;
  183. }
  184. /**
  185. * 合版封套自定义尺寸
  186. *
  187. * @param kind
  188. * @param count
  189. * @param min
  190. * @param priceArr
  191. * @return
  192. */
  193. public List<Product> getEnvelope(String kind, int count, int min, int[] priceArr) {
  194. int countArr[] = {200, 500, 1000, 2000, 5000, 10000};
  195. List<Product> list = new ArrayList<Product>();
  196. Product pro = new Product();
  197. for (int i = 0; i < countArr.length; i++) {
  198. if (countArr[i] < count || list.size() > 3) {
  199. continue;
  200. }
  201. pro = new Product();
  202. pro.setCount(countArr[i]);
  203. pro.setPrice(Math.ceil(min * priceArr[i] + 80 + 0.05 * countArr[i] + 30 + 0.06 * countArr[i]));
  204. list.add(pro);
  205. }
  206. return list;
  207. }
  208. /**
  209. * 房卡套特殊尺寸
  210. *
  211. * @param count
  212. * @param min
  213. * @return
  214. */
  215. public List<Product> getRoomCard(int count, int min) {
  216. int countArr[] = {200, 500, 1000, 2000, 5000, 10000};
  217. int priceArr[] = {40, 50, 70, 90, 160, 300};
  218. List<Product> list = new ArrayList<Product>();
  219. Product pro = new Product();
  220. for (int i = 0; i < countArr.length; i++) {
  221. if (countArr[i] < count) {
  222. continue;
  223. }
  224. pro = new Product();
  225. pro.setCount(countArr[i]);
  226. pro.setPrice(Math.ceil(min * priceArr[i] + 0.05 * countArr[i] + 60 + 30 + 0.06 * countArr[i]));
  227. list.add(pro);
  228. }
  229. return list;
  230. }
  231. /**
  232. * 打印不干胶带纯烫金价格
  233. *
  234. * @param kind
  235. * @param addPrice
  236. * @param yinbai
  237. */
  238. public Product getA(String kind, Double width, Double length, int count, double price, double addPrice,
  239. Integer number, String craftTang, String yinbai) {
  240. //List<Product> list = new ArrayList<Product>();
  241. if ("印白墨".equals(yinbai)) {
  242. price = 50;
  243. addPrice = 30;
  244. } else if ("黑白".equals(yinbai)) {
  245. price = 40;
  246. }
  247. double l = 425;
  248. double w = 285;
  249. if ("0".equals(kind) || "4".equals(kind)) {
  250. l = 430;
  251. w = 290;
  252. }
  253. // 哑金不干胶
  254. if ("5".equals(kind)) {
  255. l = 390;
  256. w = 270;
  257. }
  258. Product pro = new Product();
  259. // 数量*款数就是张数
  260. count = count * number;
  261. // 换成毫米每边+2
  262. length = length * 10 + 4;
  263. width = width * 10 + 4;
  264. if ((length > l || width > w) && (length > w || width > l))
  265. return null;
  266. // 一张大纸能做多少个此类尺寸的不干胶
  267. double max = Math.max(Math.floor(l / length) * Math.floor(w / width),
  268. Math.floor(l / width) * Math.floor(w / length));
  269. // 报的数量需要多少张大纸
  270. int num = (int) Math.ceil(count / max);
  271. price = price + (num - 1) * addPrice;
  272. if ("纯烫金".equals(craftTang) || "彩色印刷+烫金/银".equals(craftTang)) {
  273. // 一张纸张价格+大纸张数*addPrice + 每张烫金+20块(1张起收)(5*5cm内30元一张)
  274. if (width < 54 && length < 54) {
  275. price += num * 60;
  276. } else {
  277. price += num * 40;
  278. }
  279. }
  280. if ("彩色印刷+烫金/银".equals(craftTang)) {
  281. price = price > 80 ? price : 80;
  282. }
  283. // if ("印白墨".equals(yinbai)) {
  284. // // 透明不干胶,印白墨工艺,每张大纸+20(1张起收)
  285. // price = price + num * 20;
  286. // }
  287. // if(number > 1) {
  288. // price = price + (number - 1) * 15;
  289. // }
  290. pro.setCount(count / number);
  291. pro.setPrice(Math.ceil(price));
  292. return pro;
  293. }
  294. /**
  295. * 哑银不干胶价格
  296. *
  297. * @param kind
  298. * @param addPrice
  299. * @param yinbai
  300. */
  301. public List<Product> getYy(String kind, Double width, Double length, int count, double price, double addPrice,
  302. Integer number, String craftTang, String yinbai) {
  303. List<Product> list = new ArrayList<Product>();
  304. double l = 420;
  305. double w = 285;
  306. // 换成毫米每边+2
  307. length = length * 10 + 4;
  308. width = width * 10 + 4;
  309. if ((length > l || width > w) && (length > w || width > l))
  310. return null;
  311. // 一张大纸能做多少个此类尺寸的不干胶
  312. double max = Math.max(Math.floor(l / length) * Math.floor(w / width),
  313. Math.floor(l / width) * Math.floor(w / length));
  314. for (int i = 0; i < countArr.length; i++) {
  315. if (countArr[i] < count) {
  316. continue;
  317. }
  318. if ("印白墨".equals(yinbai)) {
  319. price = 50;
  320. addPrice = 30;
  321. }
  322. Product pro = new Product();
  323. // 数量*款数就是张数
  324. count = countArr[i] * number;
  325. // 报的数量需要多少张大纸
  326. int num = (int) Math.ceil(count / max);
  327. if ("纯烫金".equals(craftTang)) {
  328. // 一张纸张价格+大纸张数*addPrice + 每张烫金+20块(1张起收)(5*5cm内30元一张)
  329. if (width < 54 && length < 54) {
  330. price = price + (num - 1) * addPrice + num * 30;
  331. } else {
  332. price = price + (num - 1) * addPrice + num * 20;
  333. }
  334. } else if ("彩色印刷+烫金/银".equals(craftTang)) {
  335. if (width <= 154 && length <= 154) {
  336. price = price + (count * 0.15 + 200 > 200 ? count * 0.15 + 200 : 200);
  337. } else if (width > 154 || length > 154) {
  338. price = price + (count * 0.13 + 180 > 210 ? count * 0.13 + 180 : 210);
  339. }
  340. } else {
  341. price = price + (num - 1) * addPrice;
  342. }
  343. if (number > 1) {
  344. price = price + (number - 1) * 5;
  345. }
  346. // if ("印白墨".equals(yinbai)) {
  347. // // 透明不干胶,印白墨工艺,每张大纸+20(1张起收)
  348. // price = price + num * 20;
  349. // }
  350. pro.setCount(count / number);
  351. /*if (length == 14.0 && width == 14.0) {
  352. price = price * 2;
  353. }*/
  354. pro.setPrice(Math.ceil(price));
  355. list.add(pro);
  356. }
  357. return list;
  358. }
  359. // 不干胶常规数量美纹纸价格计算
  360. public List<Product> getMeiWenZhiPrice(Double length, Double width, int count, Integer number, String craftMo) {
  361. List<Product> priceList = new ArrayList<>();
  362. int[][] prices = new int[][]{
  363. {79, 107, 134, 272, 343, 685, 1030, 1374, 1787, 2322, 2748, 3302, 4351},
  364. {84, 112, 139, 277, 348, 690, 1035, 1379, 1792, 2327, 2753, 3307, 4356},
  365. {161, 222, 278, 553, 690, 1377, 2065, 2748, 3584, 4653, 5505, 6614, 8712},
  366. {318, 443, 552, 1101, 1377, 2753, 4119, 5475, 7128, 9108, 10613, 12435, 13068},
  367. {475, 661, 828, 1652, 2066, 4129, 6178, 8213, 10692, 13662, 15920, 18652, 19602},
  368. {788, 1099, 1380, 2743, 3430, 6856, 10272, 13613, 17721, 22275, 25542, 29700, 32670},
  369. {1575, 2188, 2747, 5485, 6859, 13712, 20543, 27225, 35442, 44550, 51084, 59400, 65340},
  370. {3150, 4355, 5494, 10930, 13662, 27324, 40887, 54054, 69894, 87120, 99000, 114444, 121968},
  371. };
  372. int[] count_list = new int[]{200, 500, 1000, 2000, 3000, 5000, 10000, 20000};
  373. double[] areas = new double[]{26, 37, 49.6, 82, 127, 171, 231, 295, 361, 451, 600.5, 902, 1199};
  374. double area = length * width;
  375. for (int i = 0; i < count_list.length; i++) {
  376. int count_item = count_list[i];
  377. if (priceList.size() > 2) {
  378. break;
  379. }
  380. if (count > count_item) {
  381. continue;
  382. }
  383. int count_index = Arrays.binarySearch(count_list, count_item);
  384. double price = 0;
  385. if (count_index >= 0) {
  386. price = new PriceUtils().TablePrice(area, prices[count_index], areas);
  387. }
  388. Product product = new Product();
  389. product.setCount(count_item);
  390. product.setPrice(Math.ceil(price));
  391. priceList.add(product);
  392. }
  393. return priceList;
  394. }
  395. /**
  396. * 插卡遍历添加价格
  397. */
  398. private List<Product> acountInsertCardPrice(int count, List<Product> list, Double[] priceArr) {
  399. int countArr[] = {200, 500, 1000, 2000, 3000, 5000, 10000};
  400. Product pro;
  401. for (int i = 0; i < countArr.length; i++) {
  402. if (countArr[i] < count) {
  403. continue;
  404. }
  405. pro = new Product();
  406. pro.setCount(countArr[i]);
  407. pro.setPrice(priceArr[i]);
  408. list.add(pro);
  409. }
  410. return list;
  411. }
  412. /**
  413. * 菱形单面直角插排
  414. */
  415. public List<Product> getInsertCard(String size, int count) {
  416. List<Product> list = new ArrayList<>();
  417. if ("4.5*4.5".equals(size)) {
  418. Double priceArr[] = {40.0, 50.0, 80.0, 120.0, 160.0, 270.0, 480.0};
  419. list = acountInsertCardPrice(count, list, priceArr);
  420. } else if ("5*5".equals(size)) {
  421. Double priceArr[] = {50.0, 60.0, 80.0, 130.0, 140.0, 300.0, 520.0};
  422. list = acountInsertCardPrice(count, list, priceArr);
  423. } else {
  424. Double priceArr[] = {40.0, 50.0, 70.0, 110.0, 160.0, 260.0, 480.0};
  425. list = acountInsertCardPrice(count, list, priceArr);
  426. }
  427. return list;
  428. }
  429. // 9*5.4cm(一个名片位)以内价格
  430. public List<Product> oneCradPrice(int count) {
  431. List<Product> list = new ArrayList<Product>();
  432. Product pro = new Product();
  433. int countArr[] = {1000, 2000, 5000, 10000, 20000};
  434. int priceArr[] = {70, 110, 250, 500, 900};
  435. if (count <= 20000) {
  436. for (int i = 0; i < countArr.length; i++) {
  437. if (countArr[i] < count || list.size() > 3) {
  438. continue;
  439. }
  440. pro = new Product();
  441. pro.setCount(countArr[i]);
  442. pro.setPrice(Math.ceil(priceArr[i]));
  443. list.add(pro);
  444. }
  445. } else {
  446. pro = new Product();
  447. pro.setCount(count);
  448. pro.setPrice(Math.ceil(count * 0.045));
  449. list.add(pro);
  450. }
  451. return list;
  452. }
  453. /**
  454. * 普通吊牌/服装吊牌 300/350克直角打孔吊牌价格
  455. *
  456. * @param dto
  457. * @param width
  458. * @param length
  459. * @param count
  460. * @param priceList
  461. * @return
  462. */
  463. public List<Product> tags300PriceCraftZhi(Product dto, Double width, Double length, int count,
  464. List<Product> priceList) {
  465. double l1;
  466. double w1;
  467. double l2;
  468. double w2;
  469. int min;
  470. l1 = Math.ceil(length / 9);
  471. w1 = Math.ceil(width / 5.4);
  472. l2 = Math.ceil(width / 9);
  473. w2 = Math.ceil(length / 5.4);
  474. // 产品位数
  475. min = (int) Math.min(l1 * w1, l2 * w2);
  476. if (min == 1) {
  477. double priceArr[] = {43, 52, 70, 110, 186, 242, 250, 500};
  478. priceList = new PriceUtils().acountTags300PriceCraftZhi(count, priceArr);
  479. } else if (min == 2) {
  480. double priceArr[] = {48, 70, 75, 110, 180, 230, 270, 520};
  481. priceList = new PriceUtils().acountTags300PriceCraftZhi(count, priceArr);
  482. } else if (min == 3) {
  483. double priceArr[] = {68, 93, 155, 276, 369, 484, 578, 1111};
  484. priceList = new PriceUtils().acountTags300PriceCraftZhi(count, priceArr);
  485. } else if (min == 4) {
  486. double priceArr[] = {80, 100, 186, 333, 496, 617, 736, 1417};
  487. priceList = new PriceUtils().acountTags300PriceCraftZhi(count, priceArr);
  488. }
  489. if (min > 1) {
  490. for (Product product : priceList) {
  491. product.setPrice(Math.floor(product.getPrice() * 0.98));
  492. }
  493. }
  494. if ("不覆膜".equals(dto.getCraftMo())) {
  495. for (Product product : priceList) {
  496. product.setPrice(Math.floor(product.getPrice() * 0.98));
  497. }
  498. }
  499. // 300克的模切材质才有第二尺寸
  500. // 第二尺寸不为空
  501. if (!StringUtils.isEmpty(dto.getSize1())) {
  502. String size1 = dto.getSize1();
  503. Double length1 = null;
  504. Double width1 = null;
  505. List<Product> priceListSecond = new ArrayList<Product>();
  506. length1 = Double.valueOf(size1.substring(0, size1.indexOf("*")));
  507. if (size1.indexOf(("*"), size1.indexOf("*") + 1) == -1) {
  508. width1 = Double.valueOf(size1.substring(size1.indexOf("*") + 1));
  509. } else {
  510. width1 = Double
  511. .valueOf(size1.substring(size1.indexOf("*") + 1, size1.indexOf(("*"), size1.indexOf("*") + 1)));
  512. }
  513. length1 = Math.abs(length1);
  514. width1 = Math.abs(width1);
  515. l1 = Math.ceil(length1 / 9);
  516. w1 = Math.ceil(width1 / 5.4);
  517. l2 = Math.ceil(width1 / 9);
  518. w2 = Math.ceil(length1 / 5.4);
  519. // 产品位数
  520. min = (int) Math.min(l1 * w1, l2 * w2);
  521. if (min == 1) {
  522. double priceArr[] = {43, 52, 72, 128, 186, 242, 276, 526};
  523. priceListSecond = new PriceUtils().acountTags300PriceCraftZhi(count, priceArr);
  524. } else if (min == 2) {
  525. double priceArr[] = {48, 78, 110, 202, 283, 351, 419, 805};
  526. priceListSecond = new PriceUtils().acountTags300PriceCraftZhi(count, priceArr);
  527. } else if (min == 3) {
  528. double priceArr[] = {68, 93, 155, 276, 369, 484, 578, 1111};
  529. priceListSecond = new PriceUtils().acountTags300PriceCraftZhi(count, priceArr);
  530. } else if (min == 4) {
  531. double priceArr[] = {80, 100, 186, 333, 496, 617, 736, 1417};
  532. priceListSecond = new PriceUtils().acountTags300PriceCraftZhi(count, priceArr);
  533. }
  534. if (min > 1) {
  535. for (Product product : priceListSecond) {
  536. product.setPrice(Math.floor(product.getPrice() * 0.98));
  537. }
  538. }
  539. if ("不覆膜".equals(dto.getCraftMo())) {
  540. for (Product product : priceListSecond) {
  541. product.setPrice(Math.floor(product.getPrice() * 0.98));
  542. }
  543. }
  544. // 如果俩个价格一样,后一位价格+10
  545. for (int i = 0; i < priceListSecond.size() - 1; i++) {
  546. if (priceListSecond.get(i).getPrice().equals(priceListSecond.get(i + 1).getPrice())) {
  547. priceListSecond.get(i + 1).setPrice(priceListSecond.get(i + 1).getPrice() + 10);
  548. }
  549. }
  550. // 俩个尺寸的价格相加 再*0.96
  551. for (int i = 0; i < priceList.size(); i++) {
  552. priceList.get(i).setPrice((priceList.get(i).getPrice() + priceListSecond.get(i).getPrice()) * 0.95);
  553. }
  554. }
  555. return priceList;
  556. }
  557. /**
  558. * 吊牌300克直角打孔价格计算
  559. */
  560. public List<Product> acountTags300PriceCraftZhi(int count, double[] priceArr) {
  561. int countArr[] = {200, 500, 1000, 2000, 3000, 4000, 5000, 10000};
  562. List<Product> list = new ArrayList<>();
  563. Product pro = new Product();
  564. for (int i = 0; i < countArr.length; i++) {
  565. if (countArr[i] < count || list.size() > 3) {
  566. continue;
  567. }
  568. pro = new Product();
  569. pro.setCount(countArr[i]);
  570. pro.setPrice(priceArr[i]);
  571. list.add(pro);
  572. }
  573. return list;
  574. }
  575. /**
  576. * 其他吊牌300克 异形模切价格
  577. *
  578. * @param dto
  579. * @param number
  580. * @param width
  581. * @param length
  582. * @param area
  583. * @param count
  584. * @param priceList
  585. * @return
  586. */
  587. public List<Product> tags300PriceCraftMo(Product dto, Integer number, Double width, Double length, Double area,
  588. int count, List<Product> priceList) {
  589. if (((length <= 9 && width <= 5.4) || (length <= 5.4 && width <= 9))) {
  590. length = 9.0;
  591. width = 5.4;
  592. area = length * width / 10000;
  593. }
  594. List<Product> priceList2 = new ArrayList<Product>();
  595. // 有工艺(覆膜)
  596. if ("双面覆哑膜".equals(dto.getCraftMo())) {
  597. double priceArr[] = {27, 18, 15, 14, 14, 14};
  598. priceList = new PriceUtils().acountTags300PriceCraftMo(area, count, number, priceArr);
  599. priceList2 = new PriceUtils().acountTags300PriceCraftMo(0.00486, count, number, priceArr);
  600. } else if ("不覆膜".equals(dto.getCraftMo())) {
  601. double priceArr[] = {26, 17, 14, 13, 13, 13};
  602. priceList = new PriceUtils().acountTags300PriceCraftMo(area, count, number, priceArr);
  603. priceList2 = new PriceUtils().acountTags300PriceCraftMo(0.00486, count, number, priceArr);
  604. }
  605. // 自定义尺寸和固定尺寸对比价格。
  606. for (int i = 0; i < priceList.size(); i++) {
  607. for (int j = 0; j < priceList2.size(); j++) {
  608. if (priceList.get(j).getPrice() < priceList2.get(j).getPrice()) {
  609. priceList.get(j).setPrice(priceList2.get(j).getPrice() + 5);
  610. }
  611. }
  612. }
  613. // 第二尺寸不为空
  614. if (!StringUtils.isEmpty(dto.getSize1())) {
  615. String size1 = dto.getSize1();
  616. Double length1 = null;
  617. Double width1 = null;
  618. Double area1 = null;
  619. List<Product> priceListSecond = new ArrayList<Product>();
  620. length1 = Double.valueOf(size1.substring(0, size1.indexOf("*")));
  621. if (size1.indexOf(("*"), size1.indexOf("*") + 1) == -1) {
  622. width1 = Double.valueOf(size1.substring(size1.indexOf("*") + 1));
  623. } else {
  624. width1 = Double
  625. .valueOf(size1.substring(size1.indexOf("*") + 1, size1.indexOf(("*"), size1.indexOf("*") + 1)));
  626. }
  627. length1 = Math.abs(length1);
  628. width1 = Math.abs(width1);
  629. if (((length1 <= 9 && width1 <= 5.4) || (length1 <= 5.4 && width1 <= 9))) {
  630. length1 = 9.0;
  631. width1 = 5.4;
  632. area1 = length1 * width1 / 10000;
  633. }
  634. List<Product> priceList3 = new ArrayList<Product>();
  635. // 有工艺(覆膜)
  636. if ("双面覆哑膜".equals(dto.getCraftMo())) {
  637. double priceArr[] = {27, 18, 15, 14, 14, 14};
  638. priceListSecond = new PriceUtils().acountTags300PriceCraftMo(area1, count, number, priceArr);
  639. priceList3 = new PriceUtils().acountTags300PriceCraftMo(0.00486, count, number, priceArr);
  640. } else if ("不覆膜".equals(dto.getCraftMo())) {
  641. double priceArr[] = {26, 17, 14, 13, 13, 13};
  642. priceListSecond = new PriceUtils().acountTags300PriceCraftMo(area1, count, number, priceArr);
  643. priceList3 = new PriceUtils().acountTags300PriceCraftMo(0.00486, count, number, priceArr);
  644. }
  645. // 自定义尺寸和固定尺寸对比价格。
  646. for (int i = 0; i < priceListSecond.size(); i++) {
  647. for (int j = 0; j < priceList3.size(); j++) {
  648. if (priceListSecond.get(j).getPrice() < priceList3.get(j).getPrice()) {
  649. priceListSecond.get(j).setPrice(priceList3.get(j).getPrice() + 5);
  650. }
  651. }
  652. }
  653. // 俩个尺寸的价格相加 再*0.96
  654. for (int i = 0; i < priceList.size(); i++) {
  655. priceList.get(i).setPrice((priceList.get(i).getPrice() + priceListSecond.get(i).getPrice()) * 0.95);
  656. }
  657. }
  658. return priceList;
  659. }
  660. /**
  661. * 其他吊牌300克异形模切价格计算===》 不复膜的 计算方法:长*宽*数量500张*22+每款设计费7元+绳子10元
  662. *
  663. * @param area
  664. * @param count
  665. * @param number
  666. * @param priceArr
  667. * @return
  668. */
  669. public List<Product> acountTags300PriceCraftMo(Double area, int count, Integer number, double[] priceArr) {
  670. int countArr[] = {500, 1000, 2000, 3000, 5000, 10000};
  671. // 数量大于1万,单独报价;
  672. List<Product> list = new ArrayList<>();
  673. Product pro = new Product();
  674. // 设计费 7元/款
  675. double designFee = 7;
  676. // 绳子 1分5一条
  677. double shengzi = 0.015;
  678. if (count > 10000) {
  679. pro.setCount(count);
  680. pro.setPrice(Math.ceil(area * count * priceArr[priceArr.length - 1] + designFee + count * shengzi));
  681. list.add(pro);
  682. } else {
  683. for (int i = 0; i < countArr.length; i++) {
  684. if (countArr[i] < count || list.size() > 3) {
  685. continue;
  686. }
  687. pro = new Product();
  688. pro.setCount(countArr[i]);
  689. pro.setPrice(Math.ceil(area * countArr[i] * priceArr[i] + designFee + countArr[i] * shengzi));
  690. list.add(pro);
  691. }
  692. }
  693. return list;
  694. }
  695. /**
  696. * 服装吊牌 300克异形模切价格
  697. *
  698. * @param dto
  699. * @param number
  700. * @param width
  701. * @param length
  702. * @param area
  703. * @param count
  704. * @param priceList
  705. * @return
  706. */
  707. public List<Product> tagClothes300PriceCraftMo(Product dto, Integer number, Double width, Double length, Double area, int count, List<Product> priceList) {
  708. if (((length <= 9 && width <= 5.4) || (length <= 5.4 && width <= 9))) {
  709. priceList = new PriceUtils().oneCradPrice(count);
  710. if ("不覆膜".equals(dto.getCraftMo())) {
  711. for (Product product : priceList) {
  712. product.setPrice(Math.floor(product.getPrice() * 0.98));
  713. }
  714. }
  715. } else {
  716. // 有工艺(覆膜)
  717. if ("双面覆哑膜".equals(dto.getCraftMo())) {
  718. double priceArr[] = {18, 15, 14, 14};
  719. // double priceArr[] = { 13, 12, 11.5, 10 };
  720. priceList = new PriceUtils().acountTagClothes300PriceCraftMo(area, count, number, priceArr);
  721. } else if ("不覆膜".equals(dto.getCraftMo())) {
  722. double priceArr[] = {17, 14, 13, 13};
  723. // double priceArr[] = { 12, 11, 10.5, 9 };
  724. priceList = new PriceUtils().acountTagClothes300PriceCraftMo(area, count, number, priceArr);
  725. }
  726. // 对比固定价格
  727. /*List<Product> priceList2 = new PriceUtils().oneCradPrice(count);
  728. if ("不覆膜".equals(dto.getCraftMo())) {
  729. for (Product product : priceList2) {
  730. product.setPrice(Math.floor(product.getPrice() * 0.98));
  731. }
  732. }*/
  733. /*for (int i = 0; i < priceList.size(); i++) {
  734. for (int j = 0; j < priceList2.size(); j++) {
  735. if (priceList.get(j).getPrice() < priceList2.get(j).getPrice()) {
  736. priceList.get(j).setPrice(priceList2.get(j).getPrice() + 10);
  737. }
  738. }
  739. }*/
  740. // 末尾变成0
  741. /*for (Product product : priceList) {
  742. product.setPrice(product.getPrice() - product.getPrice() % 10);
  743. }*/
  744. // 如果俩个价格一样,后一位价格+10
  745. for (int i = 0; i < priceList.size() - 1; i++) {
  746. if (priceList.get(i).getPrice().equals(priceList.get(i + 1).getPrice())) {
  747. priceList.get(i + 1).setPrice(priceList.get(i + 1).getPrice() + 10);
  748. }
  749. if (width == 6 && length == 6 && priceList.get(i).getCount() == 1000) {
  750. priceList.get(i).setPrice(priceList.get(i).getPrice() + 8);
  751. }
  752. }
  753. }
  754. // 300克的材质才有第二尺寸
  755. // 第二尺寸不为空
  756. if (!StringUtils.isEmpty(dto.getSize1())) {
  757. String size1 = dto.getSize1();
  758. Double length1 = null;
  759. Double width1 = null;
  760. List<Product> priceListSecond = new ArrayList<Product>();
  761. length1 = Double.valueOf(size1.substring(0, size1.indexOf("*")));
  762. if (size1.indexOf(("*"), size1.indexOf("*") + 1) == -1) {
  763. width1 = Double.valueOf(size1.substring(size1.indexOf("*") + 1));
  764. } else {
  765. width1 = Double
  766. .valueOf(size1.substring(size1.indexOf("*") + 1, size1.indexOf(("*"), size1.indexOf("*") + 1)));
  767. }
  768. length1 = Math.abs(length1);
  769. width1 = Math.abs(width1);
  770. double area1 = length1 * width1 / 10000;
  771. if (((length1 <= 10.5 && width1 <= 5.5) || (length1 <= 5.5 && width1 <= 10.5))) {
  772. priceListSecond = new PriceUtils().oneCradPrice(count);
  773. if ("不覆膜".equals(dto.getCraftMo())) {
  774. for (Product product : priceListSecond) {
  775. product.setPrice(Math.floor(product.getPrice() * 0.98));
  776. }
  777. }
  778. } else {
  779. // 有工艺(覆膜)
  780. if ("双面覆哑膜".equals(dto.getCraftMo())) {
  781. double priceArr[] = {18, 15, 14, 14};
  782. // double priceArr[] = { 13, 12, 11.5, 10 };
  783. priceListSecond = new PriceUtils().acountTagClothes300PriceCraftMo(area1, count, number, priceArr);
  784. } else if ("不覆膜".equals(dto.getCraftMo())) {
  785. double priceArr[] = {17, 14, 13, 13};
  786. priceListSecond = new PriceUtils().acountTagClothes300PriceCraftMo(area, count, number, priceArr);
  787. }
  788. // 对比固定价格
  789. List<Product> priceList2 = new PriceUtils().oneCradPrice(count);
  790. if ("不覆膜".equals(dto.getCraftMo())) {
  791. for (Product product : priceList2) {
  792. product.setPrice(Math.floor(product.getPrice() * 0.98));
  793. }
  794. }
  795. for (int i = 0; i < priceListSecond.size(); i++) {
  796. for (int j = 0; j < priceList2.size(); j++) {
  797. if (priceListSecond.get(j).getPrice() < priceList2.get(j).getPrice()) {
  798. priceListSecond.get(j).setPrice(priceList2.get(j).getPrice() + 10);
  799. }
  800. }
  801. }
  802. // 末尾变成0
  803. for (Product product : priceListSecond) {
  804. product.setPrice(product.getPrice() - product.getPrice() % 10);
  805. }
  806. // 如果俩个价格一样,后一位价格+10
  807. for (int i = 0; i < priceListSecond.size() - 1; i++) {
  808. if (priceListSecond.get(i).getPrice().equals(priceListSecond.get(i + 1).getPrice())) {
  809. priceListSecond.get(i + 1).setPrice(priceListSecond.get(i + 1).getPrice() + 10);
  810. }
  811. }
  812. }
  813. // 俩个尺寸的价格相加 再*0.96
  814. for (int i = 0; i < priceList.size(); i++) {
  815. priceList.get(i).setPrice((priceList.get(i).getPrice() + priceListSecond.get(i).getPrice()) * 0.95);
  816. }
  817. }
  818. return priceList;
  819. }
  820. /**
  821. * 服装吊牌300克异形模切价格计算===》 不复膜的 计算方法:长*宽*数量500张*22+每款设计费7元+绳子10元
  822. *
  823. * @param area
  824. * @param count
  825. * @param number
  826. * @param priceArr
  827. * @return
  828. */
  829. public List<Product> acountTagClothes300PriceCraftMo(Double area, int count, Integer number, double[] priceArr) {
  830. int countArr[] = {1000, 2000, 5000, 10000};
  831. // 数量大于1万,单独报价;
  832. List<Product> list = new ArrayList<>();
  833. Product pro = new Product();
  834. // 设计费 7元/款
  835. double designFee = 7;
  836. // 绳子 1分5一条
  837. double shengzi = 0.015;
  838. if (count > 10000) {
  839. pro.setCount(count);
  840. pro.setPrice(Math.ceil(area * count * priceArr[priceArr.length - 1] + number * designFee));
  841. list.add(pro);
  842. } else {
  843. for (int i = 0; i < countArr.length; i++) {
  844. if (countArr[i] < count || list.size() > 3) {
  845. continue;
  846. }
  847. pro = new Product();
  848. pro.setCount(countArr[i]);
  849. /* pro.setPrice(Math.ceil(area * countArr[i] * priceArr[i] + number * designFee
  850. + countArr[i] * shengzi));*/
  851. pro.setPrice(Math.ceil(area * countArr[i] * priceArr[i] + designFee));
  852. list.add(pro);
  853. }
  854. }
  855. return list;
  856. }
  857. /**
  858. * 600克 吊牌
  859. *
  860. * @param dto
  861. * @param kind
  862. * @param kind2
  863. * @param area
  864. * @param count
  865. * @return
  866. */
  867. public List<Product> tags600Price(Product dto, String kind, String kind2, Double area, int count) {
  868. List<Product> priceList;
  869. priceList = new PriceUtils().getTag600PriceFirst(kind, kind2, area, count, true);
  870. // 600克的材质才有第二尺寸
  871. // 第二尺寸不为空
  872. if (!StringUtils.isEmpty(dto.getSize1())) {
  873. String size1 = dto.getSize1();
  874. Double length1 = null;
  875. Double width1 = null;
  876. List<Product> priceList2 = new ArrayList<Product>();
  877. length1 = Double.valueOf(size1.substring(0, size1.indexOf("*")));
  878. if (size1.indexOf(("*"), size1.indexOf("*") + 1) == -1) {
  879. width1 = Double.valueOf(size1.substring(size1.indexOf("*") + 1));
  880. } else {
  881. width1 = Double
  882. .valueOf(size1.substring(size1.indexOf("*") + 1, size1.indexOf(("*"), size1.indexOf("*") + 1)));
  883. }
  884. length1 = Math.abs(length1);
  885. width1 = Math.abs(width1);
  886. double area1 = length1 * width1 / 10000;
  887. priceList2 = new PriceUtils().getTag600PriceFirst(kind, kind2, area1, count, false);
  888. // 俩个尺寸的价格相加
  889. for (int i = 0; i < priceList.size(); i++) {
  890. priceList.get(i).setPrice((priceList.get(i).getPrice() + priceList2.get(i).getPrice()) * 0.95);
  891. }
  892. }
  893. return priceList;
  894. }
  895. /**
  896. * 吊牌600/800克自定义尺寸价格
  897. *
  898. * @param kind 600克/800克
  899. * @param kind2 种类
  900. * @param area 单个产品的面积
  901. * @param count 报的数量
  902. * @param flag 是否要加绳子费用
  903. * @return
  904. */
  905. public List<Product> getTag600PriceFirst(String kind, String kind2, double area, int count, boolean flag) {
  906. // 数量大于1万,单独报价;
  907. if (count > 10000) {
  908. return null;
  909. }
  910. List<Product> list = new ArrayList<>();
  911. double shengzi = 0;
  912. if ("4".equals(kind)) {
  913. if ("无".equals(kind2)) {
  914. double priceArr[] = {50, 34, 27, 27, 26, 25};
  915. list = acountTag600Price(area, count, priceArr, shengzi, flag, list);
  916. } else if ("单面烫黄金".equals(kind2)) {
  917. double priceArr[] = {68, 48, 37, 36, 35, 34};
  918. list = acountTag600Price(area, count, priceArr, shengzi, flag, list);
  919. } else if ("单面烫镭射银".equals(kind2)) {
  920. double priceArr[] = {82, 58, 45, 43, 42, 41};
  921. list = acountTag600Price(area, count, priceArr, shengzi, flag, list);
  922. } else if ("双面烫黄金".equals(kind2)) {
  923. double priceArr[] = {108, 72, 56, 54, 52, 50};
  924. list = acountTag600Price(area, count, priceArr, shengzi, flag, list);
  925. } else if ("双面烫镭射银".equals(kind2)) {
  926. double priceArr[] = {123, 87, 68, 65, 63, 60};
  927. list = acountTag600Price(area, count, priceArr, shengzi, flag, list);
  928. } else if ("击凸".equals(kind2) || "压凹".equals(kind2)) {
  929. double priceArr[] = {75, 50, 40, 40, 39, 38};
  930. list = acountTag600Price(area, count, priceArr, shengzi, flag, list);
  931. } else if ("单面烫黄金+凹凸".equals(kind2)) {
  932. double priceArr[] = {93, 63, 48, 48, 47, 46};
  933. list = acountTag600Price(area, count, priceArr, shengzi, flag, list);
  934. } else if ("单面烫金+压凹".equals(kind2)) {
  935. double priceArr[] = {93, 63, 48, 48, 47, 46};
  936. list = acountTag600Price(area, count, priceArr, shengzi, flag, list);
  937. } else if ("单面烫金+击凸".equals(kind2)) {
  938. double priceArr[] = {93, 63, 48, 48, 47, 46};
  939. list = acountTag600Price(area, count, priceArr, shengzi, flag, list);
  940. }
  941. }
  942. if ("6".equals(kind)) {
  943. double price = 0;
  944. int[][] prices = {
  945. {144, 148, 166, 188, 193, 210, 232, 249, 251, 273, 317, 392, 464, 476, 674, 1028, 1802},
  946. {228, 238, 248, 255, 256, 258, 260, 268, 270, 278, 322, 397, 469, 481, 679, 1033, 1807},
  947. {330, 345, 350, 380, 386, 390, 420, 428, 430, 465, 538, 665, 780, 800, 1108, 1665, 2920},
  948. {480, 520, 530, 560, 568, 580, 591, 629, 633, 686, 791, 971, 1141, 1170, 1644, 2486, 4329},
  949. {800, 820, 860, 870, 880, 900, 955, 1016, 1023, 1107, 1276, 1563, 1838, 1885, 2645, 3997, 6955},
  950. {1400, 1430, 1450, 1527, 1560, 1690, 1852, 1969, 1982, 2145, 2470, 3022, 3549, 3640, 5102, 7702, 13390}
  951. };
  952. int[] count_list = {500, 1000, 2000, 3000, 5000, 10000};
  953. double[] areas = {16, 25, 30, 35, 36, 40, 45, 48.6, 49, 54, 64, 81, 97.2, 100, 145.8, 225, 400};
  954. if ("单面烫黄金".equals(kind2)) {
  955. prices = new int[][]{
  956. {190, 190, 221, 252, 258, 283, 315, 338, 340, 372, 435, 539, 641, 658, 938, 1438, 2530},
  957. {195, 195, 226, 257, 263, 288, 319, 343, 345, 377, 439, 544, 646, 663, 943, 1443, 2535},
  958. {315, 350, 366, 413, 418, 456, 504, 535, 538, 585, 681, 845, 1001, 1027, 1459, 2229, 3913},
  959. {468, 468, 538, 608, 622, 678, 748, 799, 805, 876, 1016, 1254, 1482, 1521, 2152, 3276, 5733},
  960. {764, 764, 877, 991, 1014, 1105, 1219, 1301, 1310, 1423, 1651, 2038, 2406, 2470, 3494, 5314, 9295},
  961. {1495, 1495, 1716, 1937, 1981, 2158, 2379, 2538, 2555, 2776, 3218, 3970, 4686, 4810, 6799, 10335, 18070}
  962. };
  963. } else if ("单面烫镭射银".equals(kind2)) {
  964. prices = new int[][]{
  965. {190, 190, 221, 252, 258, 283, 315, 338, 340, 372, 435, 539, 641, 658, 938, 1438, 2530},
  966. {195, 195, 226, 257, 263, 288, 319, 343, 345, 377, 439, 544, 646, 663, 943, 1443, 2535},
  967. {315, 350, 366, 413, 418, 456, 504, 535, 538, 585, 681, 845, 1001, 1027, 1459, 2229, 3913},
  968. {468, 468, 538, 608, 622, 678, 748, 799, 805, 876, 1016, 1254, 1482, 1521, 2152, 3276, 5733},
  969. {764, 764, 877, 991, 1014, 1105, 1219, 1301, 1310, 1423, 1651, 2038, 2406, 2470, 3494, 5314, 9295},
  970. {1495, 1495, 1716, 1937, 1981, 2158, 2379, 2538, 2555, 2776, 3218, 3970, 4686, 4810, 6799, 10335, 18070}
  971. };
  972. } else if ("击凸".equals(kind2) || "压凹".equals(kind2)) {
  973. prices = new int[][]{
  974. {196, 196, 229, 261, 268, 295, 326, 350, 352, 385, 450, 560, 665, 684, 976, 1496, 2635},
  975. {201, 201, 234, 266, 273, 299, 331, 355, 357, 390, 455, 565, 670, 689, 981, 1501, 2639},
  976. {345, 350, 398, 451, 462, 505, 558, 596, 600, 654, 760, 942, 1114, 1144, 1625, 2475, 4344},
  977. {507, 507, 585, 663, 678, 741, 819, 876, 881, 959, 1115, 1380, 1634, 1677, 2379, 3627, 6357},
  978. {829, 829, 955, 1082, 1107, 1209, 1336, 1427, 1437, 1563, 1817, 2249, 2659, 2730, 3871, 5899, 10335},
  979. {1625, 1625, 1872, 2119, 2168, 2366, 2613, 2791, 2810, 3057, 3551, 4391, 5192, 5330, 7553, 11505, 20150}
  980. };
  981. } else if ("双面烫黄金".equals(kind2)) {
  982. prices = new int[][]{
  983. {270, 380, 442, 504, 516, 566, 630, 676, 680, 744, 870, 1078, 1282, 1316, 1876, 2876, 5060},
  984. {278, 390, 452, 514, 526, 576, 638, 686, 690, 754, 878, 1088, 1292, 1326, 1886, 2886, 5070},
  985. {460, 630, 732, 826, 836, 912, 1008, 1070, 1076, 1170, 1362, 1690, 2002, 2054, 2918, 4458, 7826},
  986. {682, 936, 1076, 1216, 1244, 1356, 1496, 1598, 1610, 1752, 2032, 2508, 2964, 3042, 4304, 6552, 11466},
  987. {1118, 1528, 1754, 1982, 2028, 2210, 2438, 2602, 2620, 2846, 3302, 4076, 4812, 4940, 6988, 10628, 18590},
  988. {2194, 2990, 3432, 3874, 3962, 4316, 4758, 5076, 5110, 5552, 6436, 7940, 9372, 9620, 13598, 20670, 36140}
  989. };
  990. } else if ("双面烫镭射银".equals(kind2)) {
  991. prices = new int[][]{
  992. {270, 380, 442, 504, 516, 566, 630, 676, 680, 744, 870, 1078, 1282, 1316, 1876, 2876, 5060},
  993. {278, 390, 452, 514, 526, 576, 638, 686, 690, 754, 878, 1088, 1292, 1326, 1886, 2886, 5070},
  994. {460, 630, 732, 826, 836, 912, 1008, 1070, 1076, 1170, 1362, 1690, 2002, 2054, 2918, 4458, 7826},
  995. {682, 936, 1076, 1216, 1244, 1356, 1496, 1598, 1610, 1752, 2032, 2508, 2964, 3042, 4304, 6552, 11466},
  996. {1118, 1528, 1754, 1982, 2028, 2210, 2438, 2602, 2620, 2846, 3302, 4076, 4812, 4940, 6988, 10628, 18590},
  997. {2194, 2990, 3432, 3874, 3962, 4316, 4758, 5076, 5110, 5552, 6436, 7940, 9372, 9620, 13598, 20670, 36140}
  998. };
  999. } else if ("单面烫黄金+凹凸".equals(kind2)) {
  1000. prices = new int[][]{
  1001. {239, 239, 279, 321, 329, 361, 403, 433, 435, 477, 559, 698, 830, 853, 1222, 1877, 3310},
  1002. {244, 244, 284, 326, 334, 366, 408, 438, 440, 482, 564, 703, 835, 858, 1227, 1882, 3315},
  1003. {397, 430, 460, 524, 537, 588, 651, 697, 702, 766, 894, 1110, 1316, 1352, 1925, 2943, 5174},
  1004. {585, 585, 678, 772, 791, 865, 959, 1027, 1034, 1128, 1315, 1634, 1937, 1989, 2831, 4329, 7605},
  1005. {959, 959, 1111, 1264, 1294, 1417, 1570, 1680, 1692, 1844, 2150, 2670, 3165, 3250, 4625, 7069, 12415},
  1006. {1885, 1885, 2184, 2483, 2542, 2782, 3081, 3296, 3320, 3619, 4217, 5233, 6203, 6370, 9061, 13845, 24310}
  1007. };
  1008. } else if ("单面烫金+压凹".equals(kind2)) {
  1009. prices = new int[][]{
  1010. {239, 239, 279, 321, 329, 361, 403, 433, 435, 477, 559, 698, 830, 853, 1222, 1877, 3310},
  1011. {244, 244, 284, 326, 334, 366, 408, 438, 440, 482, 564, 703, 835, 858, 1227, 1882, 3315},
  1012. {397, 430, 460, 524, 537, 588, 651, 697, 702, 766, 894, 1110, 1316, 1352, 1925, 2943, 5174},
  1013. {585, 585, 678, 772, 791, 865, 959, 1027, 1034, 1128, 1315, 1634, 1937, 1989, 2831, 4329, 7605},
  1014. {959, 959, 1111, 1264, 1294, 1417, 1570, 1680, 1692, 1844, 2150, 2670, 3165, 3250, 4625, 7069, 12415},
  1015. {1885, 1885, 2184, 2483, 2542, 2782, 3081, 3296, 3320, 3619, 4217, 5233, 6203, 6370, 9061, 13845, 24310}
  1016. };
  1017. } else if ("单面烫金+击凸".equals(kind2)) {
  1018. prices = new int[][]{
  1019. {239, 239, 279, 321, 329, 361, 403, 433, 435, 477, 559, 698, 830, 853, 1222, 1877, 3310},
  1020. {244, 244, 284, 326, 334, 366, 408, 438, 440, 482, 564, 703, 835, 858, 1227, 1882, 3315},
  1021. {397, 430, 460, 524, 537, 588, 651, 697, 702, 766, 894, 1110, 1316, 1352, 1925, 2943, 5174},
  1022. {585, 585, 678, 772, 791, 865, 959, 1027, 1034, 1128, 1315, 1634, 1937, 1989, 2831, 4329, 7605},
  1023. {959, 959, 1111, 1264, 1294, 1417, 1570, 1680, 1692, 1844, 2150, 2670, 3165, 3250, 4625, 7069, 12415},
  1024. {1885, 1885, 2184, 2483, 2542, 2782, 3081, 3296, 3320, 3619, 4217, 5233, 6203, 6370, 9061, 13845, 24310}
  1025. };
  1026. }
  1027. for (int i = 0; i < count_list.length; i++) {
  1028. int count_item = count_list[i];
  1029. if (list.size() > 2) {
  1030. break;
  1031. }
  1032. if (count > count_item) {
  1033. continue;
  1034. }
  1035. int count_index = Arrays.binarySearch(count_list, count_item);
  1036. price = 0;
  1037. if (count_index >= 0) {
  1038. price = new PriceUtils().TablePrice(area * 10000, prices[count_index], areas);
  1039. }
  1040. Product product = new Product();
  1041. product.setCount(count_item);
  1042. product.setPrice(Math.ceil(price));
  1043. list.add(product);
  1044. }
  1045. // if ("单面烫黄金".equals(kind2)) {
  1046. // double priceArr[] = {68, 48, 37, 36, 35, 34};
  1047. // list = acountTag600Price(area, count, priceArr, shengzi, flag, list);
  1048. // } else if ("击凸".equals(kind2) || "压凹".equals(kind2)) {
  1049. // double priceArr[] = {75, 50, 40, 40, 39, 38};
  1050. // list = acountTag600Price(area, count, priceArr, shengzi, flag, list);
  1051. // } else if ("单面烫黄金+凹凸".equals(kind2)) {
  1052. // double priceArr[] = {93, 63, 48, 48, 47, 46};
  1053. // list = acountTag600Price(area, count, priceArr, shengzi, flag, list);
  1054. // }
  1055. }
  1056. return list;
  1057. }
  1058. /**
  1059. * 吊牌600/800克价格计算
  1060. *
  1061. * @param area
  1062. * @param count
  1063. * @param priceArr
  1064. * @param shengzi
  1065. * @param flag
  1066. * @return
  1067. */
  1068. private List<Product> acountTag600Price(double area, int count, double[] priceArr, double shengzi, boolean flag,
  1069. List<Product> list) {
  1070. int countArr[] = {500, 1000, 2000, 3000, 5000, 10000};
  1071. Product pro = new Product();
  1072. for (int i = 0; i < countArr.length; i++) {
  1073. if (countArr[i] < count || list.size() > 3) {
  1074. continue;
  1075. }
  1076. /*if (countArr[i] == 500) {
  1077. continue;
  1078. }*/
  1079. pro = new Product();
  1080. if (countArr[i] == 500) {
  1081. shengzi = 20;
  1082. } else if (countArr[i] == 1000) {
  1083. shengzi = 30;
  1084. } else if (countArr[i] == 2000) {
  1085. shengzi = 50;
  1086. } else {
  1087. shengzi = 0.03;
  1088. }
  1089. pro.setCount(countArr[i]);
  1090. if (flag) {
  1091. pro.setPrice(
  1092. Math.ceil(area * countArr[i] * priceArr[i] + (shengzi > 1 ? shengzi : shengzi * countArr[i])));
  1093. } else {
  1094. pro.setPrice(Math.ceil(area * countArr[i] * priceArr[i]));
  1095. }
  1096. list.add(pro);
  1097. }
  1098. return list;
  1099. }
  1100. /**
  1101. * 异形杯套价格计算
  1102. *
  1103. * @param count
  1104. * @return
  1105. */
  1106. public List<Product> getCupSetPrice(int count) {
  1107. List<Product> list = new ArrayList<>();
  1108. Product pro = new Product();
  1109. int countArr[] = {500, 1000, 2000, 3000, 5000, 10000};
  1110. double priceArr[] = {700, 780, 820, 900, 1300, 1800};
  1111. if (count <= 10000) {
  1112. for (int i = 0; i < countArr.length; i++) {
  1113. if (countArr[i] < count) {
  1114. continue;
  1115. }
  1116. pro = new Product();
  1117. pro.setCount(countArr[i]);
  1118. pro.setPrice(priceArr[i]);
  1119. list.add(pro);
  1120. }
  1121. } else {
  1122. pro = new Product();
  1123. pro.setCount(count);
  1124. pro.setPrice(Math.ceil(count * 0.25));
  1125. list.add(pro);
  1126. }
  1127. return list;
  1128. }
  1129. /**
  1130. * 手提袋价格计算
  1131. *
  1132. * @param
  1133. * @param kai 产品开数
  1134. * @return 报价:〔数量除以开数+*纸张《正度或者大度》+印工〔1千印X内150元,每超出1千印另加50元计算》+固定刀版收费200元+粘成品工钱.3*数量(小于200元按2⑾0元算〉〉*.5备注:以上报价展开尺寸最大为1000*700KM超出这个尺寸按以上报价*2倍计算
  1135. */
  1136. public List<Product> getPriceHanding(int count, int kai, double price, double m) {
  1137. List<Product> list = new ArrayList<>();
  1138. int countArr[] = {500, 1000, 2000, 4000, 10000, 20000, 30000};
  1139. Product pro = new Product();
  1140. if (count >= 100) {
  1141. if (count < 670) {
  1142. pro.setCount(count);
  1143. pro.setPrice(Math.ceil((count / kai * price + 150 + 200 + 200) * m));
  1144. list.add(pro);
  1145. } else {
  1146. pro.setCount(count);
  1147. pro.setPrice(Math.ceil(
  1148. (count / kai * price + (150 + Math.ceil((count - 1000) / 1000) * 50) + 200 + count * 0.3) * m));
  1149. list.add(pro);
  1150. }
  1151. }
  1152. for (int i = 0; i < countArr.length; i++) {
  1153. if (countArr[i] < count || countArr[i] == list.get(0).getCount()) {
  1154. continue;
  1155. }
  1156. pro = new Product();
  1157. pro.setCount(countArr[i]);
  1158. if (countArr[i] == 500) {
  1159. pro.setPrice(Math.ceil(
  1160. (countArr[i] / kai * price + (150 + Math.ceil((countArr[i] - 1000) / 1000) * 50) + 200 + 200)
  1161. * m));
  1162. } else {
  1163. pro.setPrice(Math.ceil((countArr[i] / kai * price + (150 + Math.ceil((countArr[i] - 1000) / 1000) * 50)
  1164. + 200 + countArr[i] * 0.3) * m));
  1165. }
  1166. list.add(pro);
  1167. }
  1168. return list;
  1169. }
  1170. /**
  1171. * 计算手提袋大度开数
  1172. *
  1173. * @param length
  1174. * @param width
  1175. * @return
  1176. */
  1177. public static String getDa(double length, double width) {
  1178. double l1 = Math.floor(1194 / length);
  1179. double w1 = Math.floor(889 / width);
  1180. double l2 = Math.floor(1194 / width);
  1181. double w2 = Math.floor(889 / length);
  1182. int maxDa = (int) Math.max(l1 * w1, l2 * w2);
  1183. if (w1 != 2) {
  1184. return "" + maxDa;
  1185. } else {
  1186. double ll1 = Math.floor(length / length);
  1187. double ww1 = Math.floor(889 / width);
  1188. double ll2 = Math.floor(length / width);
  1189. double ww2 = Math.floor(889 / length);
  1190. int maxxa = (int) Math.max(ll1 * ww1, ll2 * ww2);
  1191. double lll1 = Math.floor((1194 - length) / length);
  1192. double www1 = Math.floor(889 / width);
  1193. double lll2 = Math.floor(length / width);
  1194. double www2 = Math.floor(889 / length);
  1195. int maxxb = (int) Math.max(lll1 * www1, lll2 * www2);
  1196. maxDa = maxxb + maxxa;
  1197. return "" + maxDa;
  1198. }
  1199. }
  1200. /**
  1201. * 正度开数
  1202. *
  1203. * @param length
  1204. * @param width
  1205. * @return
  1206. */
  1207. public static String getZheng(double length, double width) {
  1208. double l1 = Math.floor(1092 / length);
  1209. double w1 = Math.floor(787 / width);
  1210. double l2 = Math.floor(1092 / width);
  1211. double w2 = Math.floor(787 / length);
  1212. int maxZheng = (int) Math.max(l1 * w1, l2 * w2);
  1213. if (w1 != 2) {
  1214. return "+" + maxZheng;
  1215. } else {
  1216. double ll1 = Math.floor(length / length);
  1217. double ww1 = Math.floor(787 / width);
  1218. double ll2 = Math.floor(length / width);
  1219. double ww2 = Math.floor(787 / length);
  1220. int maxxa = (int) Math.max(ll1 * ww1, ll2 * ww2);
  1221. double lll1 = Math.floor((1092 - length) / length);
  1222. double www1 = Math.floor(787 / width);
  1223. double lll2 = Math.floor(length / width);
  1224. double www2 = Math.floor(787 / length);
  1225. int maxxb = (int) Math.max(lll1 * www1, lll2 * www2);
  1226. maxZheng = maxxb + maxxa;
  1227. return "" + maxZheng;
  1228. }
  1229. }
  1230. /**
  1231. * 金属标价格计算 ===>最大印刷面积290*190MM 成品尺寸一边加1.5MM 算大张要几张 起步价90元
  1232. * 10张以内不含10张100+25*(数量-2) 20张以内 数量*24 30张以内 数量*22 超过30张*20
  1233. *
  1234. * @param list
  1235. * @param width
  1236. * @param length
  1237. * @param count
  1238. * @param number
  1239. * @return
  1240. */
  1241. public List<Product> getMetalPrice(List<Product> list, Double width, Double length, int count, Integer number) {
  1242. /*if (length == 1) {
  1243. length = 2.0;
  1244. }
  1245. if (width == 1) {
  1246. width = 2.0;
  1247. }*/
  1248. // 最大尺寸29*19cm ,加出血一边5mm
  1249. double l = 295;
  1250. double w = 195;
  1251. Product pro = new Product();
  1252. // 第一张大纸价格
  1253. double price = 0;
  1254. // 换成毫米每边+3
  1255. length = length * 10 + 2 * 1.5;
  1256. width = width * 10 + 2 * 1.5;
  1257. // 数量*款数就是张数
  1258. // count = count * number;
  1259. if ((length > l || width > w) && (length > w || width > l))
  1260. return null;
  1261. // 一张大纸29*19cm 能做多少个此类尺寸的金属标
  1262. double max = Math.max(Math.floor(l / length) * Math.floor(w / width),
  1263. Math.floor(l / width) * Math.floor(w / length));
  1264. // 报的数量需要多少张大纸
  1265. int num = (int) Math.ceil((count * number) / max);
  1266. int numUnit = (int) Math.ceil((count) / max);
  1267. boolean isNumnber = false;
  1268. if (numUnit == 1) {
  1269. isNumnber = true;
  1270. }
  1271. double mulit = 1;
  1272. /*
  1273. * if (num > 2) { price = price + 25 * (num - 2); }
  1274. */
  1275. double design = 0;
  1276. if (!isNumnber) {
  1277. if (numUnit <= 2) {
  1278. price = 80;
  1279. } else if (numUnit < 6) {
  1280. price = 80 + 24 * (numUnit - 2);
  1281. } else if (numUnit < 10) {
  1282. price = 80 + 23 * (numUnit - 2);
  1283. } else if (numUnit < 16) {
  1284. price = 80 + 21 * (numUnit - 2);
  1285. } else if (numUnit < 30) {
  1286. price = 200 + 12 * (numUnit - 2);
  1287. } else if (numUnit < 51) {
  1288. price = 280 + 9 * (numUnit - 2);
  1289. } else if (numUnit < 100) {
  1290. price = Math.ceil((numUnit * 9) / 0.64);
  1291. } else if (numUnit < 300) {
  1292. price = Math.ceil((numUnit * 9) / 0.645);
  1293. } else {
  1294. price = Math.ceil((numUnit * 9) / 0.646);
  1295. }
  1296. mulit = number;
  1297. } else {
  1298. price = 80;
  1299. mulit = Math.ceil(num / numUnit);
  1300. }
  1301. price = Math.ceil(price * mulit);
  1302. pro.setCount(count);
  1303. pro.setPrice(Math.ceil(price + design));
  1304. float d = (float) num / (float) 30;
  1305. if (number > 1) {
  1306. d = d * number;
  1307. }
  1308. pro.setWeight(String.valueOf(df.format(d)));
  1309. list.add(pro);
  1310. return list;
  1311. }
  1312. /**
  1313. * UV转印贴
  1314. *
  1315. * @param area
  1316. * @param type
  1317. * @return
  1318. */
  1319. private double f_getUvPrice(double area, int type) {//根据面积获取价格
  1320. double price = 0, lastPrice = 0;
  1321. double areaArr[] = {0.1, 0.12, 0.15, 0.2, 0.3, 0.4, 0.5, 1, 3, 5, 7, 9, 10, 20, 50, 100, 200, 500, 1000, 5000};
  1322. double priceArr[] = {450, 420, 400, 380, 360, 340, 300, 225, 200, 175, 170, 150, 145, 125, 120, 110, 100, 90, 80, 70};
  1323. double lessPriceArr[] = {215, 215, 215, 215, 215, 215, 215, 200, 170, 160, 150, 140, 135, 115, 110, 100, 90, 80, 70, 60};
  1324. double areaArrSmall[] = {0.03, 0.1};
  1325. double priceArrSmall[] = {30, 50};
  1326. for (int i = 0; i < areaArr.length; i++) {
  1327. if (areaArr[i] < area) {
  1328. continue;
  1329. }
  1330. if (i > 0) {
  1331. if (type == 2) {
  1332. lastPrice = Math.ceil(lessPriceArr[i - 1] * areaArr[i - 1]);
  1333. } else {
  1334. lastPrice = Math.ceil(priceArr[i - 1] * areaArr[i - 1]);
  1335. }
  1336. }
  1337. if (type == 2) {
  1338. price = Math.ceil(lessPriceArr[i] * area);
  1339. } else {
  1340. price = Math.ceil(priceArr[i] * area);
  1341. }
  1342. if (lastPrice > price) {
  1343. price = lastPrice;
  1344. }
  1345. break;
  1346. }
  1347. if (type == 3) {
  1348. for (int i = 0; i < areaArrSmall.length; i++) {
  1349. if (areaArrSmall[i] < area) {
  1350. continue;
  1351. }
  1352. if (i > 0) {
  1353. lastPrice = Math.ceil(priceArrSmall[i - 1]);
  1354. }
  1355. price = Math.ceil(priceArrSmall[i]);
  1356. if (lastPrice > price) {
  1357. price = lastPrice;
  1358. }
  1359. break;
  1360. }
  1361. }
  1362. //最低价65
  1363. if (price == 0) {
  1364. price = 65 * area;
  1365. }
  1366. return price;
  1367. }
  1368. public List<Product> UVStickerPrice(double length, double width, int count, int number, String yinse, String[] zhuan) {
  1369. List<Product> list = new ArrayList<Product>();
  1370. int countArr[] = {10, 20, 30, 50, 100, 200, 300, 400, 500, 800, 1000, 2000, 3000, 5000, 10000, 20000, 30000, 40000, 50000};
  1371. Product pro;
  1372. int oldCount = count;
  1373. int isInArr = 0;
  1374. double price = 0, mqPrice = 0, lastPrice;
  1375. if (!StringUtils.isEmpty(zhuan) && ("专金".equals(zhuan[0]) || "专银".equals(zhuan[0]) || "印刷+烫金".equals(zhuan[0]) || "印刷+烫银".equals(zhuan[0]))
  1376. && count < 100) {
  1377. // if (!StringUtils.isEmpty(zhuan) && ("专金".equals(zhuan[0]) || "专银".equals(zhuan[0])) && count < 100) {
  1378. // 烫金100个起
  1379. count = 100;
  1380. }
  1381. double area = (length + 0.3 * 2) * (width + 0.3 * 2) * count / 10000 * number;
  1382. if (!StringUtils.isEmpty(zhuan)) {
  1383. //工艺价格另算
  1384. area = (length + 0.3 * 2) * (width + 0.3 * 2) * count / 10000;
  1385. }
  1386. double lastArea = 0;
  1387. int index = Arrays.binarySearch(countArr, oldCount);
  1388. if (index >= 0) {
  1389. isInArr = 1;
  1390. }
  1391. if (isInArr != 1) {
  1392. price = f_getUvPrice(area, 1);
  1393. price = price > 45 ? price : 45;
  1394. if (area <= 0.2) {
  1395. mqPrice = count * 0.05;
  1396. mqPrice = mqPrice > 5 ? mqPrice : 5;
  1397. Math.ceil(price += mqPrice);
  1398. }
  1399. if (!StringUtils.isEmpty(zhuan)) {
  1400. if ("烫金".equals(zhuan[0]) || "烫银".equals(zhuan[0]) || "烫蓝".equals(zhuan[0]) || "烫红".equals(zhuan[0]) || "烫黑".equals(zhuan[0]) || "镭射银".equals(zhuan[0]) || "镭射金".equals(zhuan[0]) || "玫瑰金".equals(zhuan[0])) {
  1401. // 起步价+58元
  1402. price = price + (40 * area);
  1403. price = price > 80 ? price : 80;
  1404. } else if ("印刷+烫金".equals(zhuan[0]) || "印刷+烫银".equals(zhuan[0])) {
  1405. // 起步价+58元
  1406. price = price + (45 * area);
  1407. price = price > 103 ? price : 103;
  1408. } else if ("双面贴".equals(zhuan[0])) {
  1409. price = price + (40 * area);
  1410. price = price > 80 ? price : 80;
  1411. }
  1412. }
  1413. pro = new Product();
  1414. pro.setPrice(Math.ceil(price));
  1415. pro.setWeight(String.valueOf(df.format(area)));
  1416. pro.setCount(oldCount);
  1417. list.add(pro);
  1418. }
  1419. for (int i = 0; i < countArr.length; i++) {
  1420. if (countArr[i] < count) {
  1421. continue;
  1422. }
  1423. if (list.size() > 2) {
  1424. break;
  1425. } else {
  1426. area = (length + 0.3 * 2) * (width + 0.3 * 2) * countArr[i] / 10000 * number;
  1427. if (i > 0) {
  1428. lastArea = (length + 0.3 * 2) * (width + 0.3 * 2) * countArr[i - 1] / 10000 * number;
  1429. }
  1430. if (!StringUtils.isEmpty(zhuan)) {
  1431. //工艺价格另算
  1432. area = (length + 0.3 * 2) * (width + 0.3 * 2) * countArr[i] / 10000;
  1433. if (i > 0) {
  1434. lastArea = (length + 0.3 * 2) * (width + 0.3 * 2) * countArr[i - 1] / 10000;
  1435. }
  1436. }
  1437. // 报价面积,平方米(加一边3mm出血)
  1438. price = f_getUvPrice(area, 1);
  1439. price = price > 45 ? price : 45;
  1440. lastPrice = f_getUvPrice(lastArea, 1);
  1441. if (area <= 0.2) {
  1442. mqPrice = countArr[i] * 0.05;
  1443. mqPrice = mqPrice > 5 ? mqPrice : 5;
  1444. Math.ceil(price += mqPrice);
  1445. }
  1446. if (lastArea <= 0.2 && i > 0) {
  1447. mqPrice = countArr[i - 1] * 0.05;
  1448. mqPrice = mqPrice > 5 ? mqPrice : 5;
  1449. Math.ceil(lastPrice += mqPrice);
  1450. }
  1451. if (area > 0.1) {
  1452. if (lastPrice >= price) {//判断上一个尺寸
  1453. price = Math.ceil(lastPrice * 1.1);
  1454. }
  1455. }
  1456. if (!StringUtils.isEmpty(zhuan)) {
  1457. if ("烫金".equals(zhuan[0]) || "烫银".equals(zhuan[0]) || "烫蓝".equals(zhuan[0]) || "烫红".equals(zhuan[0]) || "烫黑".equals(zhuan[0]) || "镭射银".equals(zhuan[0]) || "镭射金".equals(zhuan[0]) || "玫瑰金".equals(zhuan[0])) {
  1458. // 起步价+58元
  1459. price = price + (40 * area);
  1460. price = price > 80 ? price : 80;
  1461. // lastPrice = lastPrice + (45 * area);
  1462. // lastPrice = lastPrice > 103 ? lastPrice : 103;
  1463. } else if ("印刷+烫金".equals(zhuan[0]) || "印刷+烫银".equals(zhuan[0])) {
  1464. // 起步价+58元
  1465. price = price + (45 * area);
  1466. price = price > 103 ? price : 103;
  1467. // lastPrice = lastPrice + (45 * area);
  1468. // lastPrice = lastPrice > 103 ? lastPrice : 103;
  1469. } else if ("双面贴".equals(zhuan[0])) {
  1470. price = price + (40 * area);
  1471. price = price > 80 ? price : 80;
  1472. }
  1473. }
  1474. pro = new Product();
  1475. pro.setPrice(Math.ceil(price));
  1476. pro.setWeight(String.valueOf(df.format(area)));
  1477. pro.setCount(countArr[i]);
  1478. list.add(pro);
  1479. }
  1480. }
  1481. // if (!StringUtils.isEmpty(zhuan) && ("烫金".equals(zhuan[0]) || "烫银".equals(zhuan[0]) || "印刷+烫金".equals(zhuan[0]) || "印刷+烫银".equals(zhuan[0]))) {
  1482. // for (Product product : list) {
  1483. // product.setPrice(Math.ceil(product.getPrice() + 60));
  1484. // }
  1485. // }
  1486. if (!StringUtils.isEmpty(zhuan) && ("专金".equals(zhuan[0]) || "专银".equals(zhuan[0]))) {
  1487. for (Product product : list) {
  1488. product.setPrice(Math.ceil(product.getPrice() + 80));
  1489. }
  1490. }
  1491. if (length >= 44 || width >= 44) {
  1492. if (width > length) {
  1493. length = width;
  1494. }
  1495. for (Product product : list) {
  1496. product.setPrice(Math.ceil(product.getPrice() + length * 0.6));
  1497. }
  1498. }
  1499. return list;
  1500. }
  1501. public Product getUVCenterPrice(double length, double width, int count, int number, String[] zhuan, Boolean isSmall) {
  1502. double areaArr[] = {0.1, 0.15, 0.2, 0.3, 0.4, 0.5, 1, 3, 5, 7, 9, 10, 20, 50, 100, 200, 500, 1000, 5000};
  1503. int priceArr[] = {50, 60, 76, 108, 136, 150, 225, 600, 875, 1190, 1350, 1450, 2500, 6000, 11000, 20000, 45000, 80000, 350000};
  1504. double areaArrSmall[] = {0.03, 0.1};
  1505. int priceArrSmall[] = {30, 50};
  1506. double mqPrice = 0;
  1507. double area = (length + 0.3 * 2) * (width + 0.3 * 2) * count / 10000 * number;
  1508. if (!StringUtils.isEmpty(zhuan)) {
  1509. //工艺价格另算
  1510. area = (length + 0.3 * 2) * (width + 0.3 * 2) * count / 10000;
  1511. }
  1512. double price = TablePrice(area, priceArr, areaArr);
  1513. price = price > 45 ? price : 45;
  1514. if (area < 0.1 && area > 0 && isSmall) {
  1515. price = TablePrice(area, priceArrSmall, areaArrSmall);
  1516. if (price == 0) {
  1517. price = Math.ceil(65 * area);
  1518. }
  1519. }
  1520. if (area <= 0.2 && area >= 0.1) {
  1521. mqPrice = count * 0.05;
  1522. mqPrice = mqPrice > 5 ? mqPrice : 5;
  1523. Math.ceil(price += mqPrice);
  1524. }
  1525. if (!StringUtils.isEmpty(zhuan)) {
  1526. if ("烫金".equals(zhuan[0]) || "烫哑金".equals(zhuan[0]) || "烫哑银".equals(zhuan[0]) || "烫银".equals(zhuan[0]) || "烫亮金".equals(zhuan[0]) || "烫银".equals(zhuan[0]) || "烫蓝".equals(zhuan[0]) || "烫红".equals(zhuan[0]) || "烫黑".equals(zhuan[0]) || "玫瑰金".equals(zhuan[0]) || "镭射银".equals(zhuan[0]) || "镭射金".equals(zhuan[0]) || "炫彩镭射".equals(zhuan[0])) {
  1527. // 起步价+58元
  1528. price = price + (40 * area);
  1529. price = price > 80 ? price : 80;
  1530. } else if ("印刷+烫金".equals(zhuan[0]) || "印刷+烫银".equals(zhuan[0])) {
  1531. // 起步价+58元
  1532. price = price + (45 * area);
  1533. price = price > 80 ? price : 80;
  1534. } else if ("双面贴".equals(zhuan[0])) {
  1535. price = price + (40 * area);
  1536. price = price > 80 ? price : 80;
  1537. }
  1538. }
  1539. Product pro = new Product();
  1540. pro.setPrice(Math.ceil(price));
  1541. pro.setCount(count);
  1542. return pro;
  1543. }
  1544. public List<Product> UVStickerSmallPriceV2(double length, double width, int count, int number, String yinse, String[] zhuan, Boolean isSmall) {
  1545. List<Product> list = new ArrayList<>();
  1546. int countArr[] = {10, 20, 30, 50, 100, 200, 300, 400, 500, 800, 1000, 2000, 3000, 5000, 10000, 20000, 30000, 40000, 50000};
  1547. int oldCount = count;
  1548. if (!StringUtils.isEmpty(zhuan) && ("专金".equals(zhuan[0]) || "专银".equals(zhuan[0])) && count < 100) {
  1549. // 烫金100个起
  1550. count = 100;
  1551. }
  1552. Product firstProduct = getUVCenterPrice(length, width, count, number, zhuan, isSmall);
  1553. firstProduct.setCount(oldCount);
  1554. list.add(firstProduct);
  1555. for (int i = 0; i < countArr.length; i++) {
  1556. if (list.size() > 3) {
  1557. break;
  1558. }
  1559. int currentCount = countArr[i];
  1560. if (currentCount <= count) {
  1561. continue;
  1562. }
  1563. list.add(getUVCenterPrice(length, width, currentCount, number, zhuan, isSmall));
  1564. }
  1565. if (!StringUtils.isEmpty(zhuan) && ("专金".equals(zhuan[0]) || "专银".equals(zhuan[0]))) {
  1566. for (Product product : list) {
  1567. product.setPrice(Math.ceil(product.getPrice() + 60));
  1568. }
  1569. }
  1570. if (length >= 44 || width >= 44) {
  1571. if (width > length) {
  1572. length = width;
  1573. }
  1574. for (Product product : list) {
  1575. product.setPrice(Math.ceil(product.getPrice() + length * 0.6));
  1576. }
  1577. }
  1578. return list;
  1579. }
  1580. /**
  1581. * 小面积UV转印贴报价:
  1582. *
  1583. * @param length
  1584. * @param width
  1585. * @param count
  1586. * @param zhuan
  1587. * @param yinse 印色
  1588. * @return
  1589. */
  1590. public List<Product> UVStickerSmallPrice(double length, double width, int count, int number, String yinse, String[] zhuan) {
  1591. List<Product> list = new ArrayList<Product>();
  1592. int countArr[] = {10, 20, 30, 50, 100, 200, 300, 400, 500, 800, 1000, 2000, 3000, 5000, 10000, 20000, 30000, 40000, 50000};
  1593. Product pro;
  1594. int isInArr = 0;
  1595. int oldCount = count;
  1596. double price = 0, mqPrice = 0, lastPrice, list_lastPrice = 0;
  1597. if (!StringUtils.isEmpty(zhuan) && ("专金".equals(zhuan[0]) || "专银".equals(zhuan[0]) || "印刷+烫金".equals(zhuan[0]) || "印刷+烫银".equals(zhuan[0]))
  1598. && count < 100) {
  1599. // if (!StringUtils.isEmpty(zhuan) && ("专金".equals(zhuan[0]) || "专银".equals(zhuan[0])) && count < 100) {
  1600. // 烫金100个起
  1601. count = 100;
  1602. }
  1603. double area = (length + 0.3 * 2) * (width + 0.3 * 2) * count / 10000 * number;
  1604. if (!StringUtils.isEmpty(zhuan)) {
  1605. //工艺价格另算
  1606. area = (length + 0.3 * 2) * (width + 0.3 * 2) * count / 10000;
  1607. }
  1608. double lastArea = 0;
  1609. int index = Arrays.binarySearch(countArr, oldCount);
  1610. if (index >= 0) {
  1611. isInArr = 1;
  1612. }
  1613. if (isInArr != 1) {
  1614. price = f_getUvPrice(area, 1);
  1615. price = price > 45 ? price : 45;
  1616. if (area < 0.1 && area > 0) {
  1617. price = f_getUvPrice(area, 3);
  1618. }
  1619. if (area <= 0.2 && area >= 0.1) {
  1620. mqPrice = count * 0.05;
  1621. mqPrice = mqPrice > 5 ? mqPrice : 5;
  1622. Math.ceil(price += mqPrice);
  1623. }
  1624. if (!StringUtils.isEmpty(zhuan)) {
  1625. if ("烫金".equals(zhuan[0]) || "烫哑金".equals(zhuan[0]) || "烫亮金".equals(zhuan[0]) || "烫银".equals(zhuan[0]) || "烫蓝".equals(zhuan[0]) || "烫红".equals(zhuan[0]) || "烫黑".equals(zhuan[0]) || "镭射银".equals(zhuan[0]) || "镭射金".equals(zhuan[0]) || "玫瑰金".equals(zhuan[0])) {
  1626. // 起步价+58元
  1627. price = price + (40 * area);
  1628. price = price > 80 ? price : 80;
  1629. } else if ("印刷+烫金".equals(zhuan[0]) || "印刷+烫银".equals(zhuan[0])) {
  1630. // 起步价+58元
  1631. price = price + (45 * area);
  1632. price = price > 103 ? price : 103;
  1633. } else if ("双面贴".equals(zhuan[0])) {
  1634. price = price + (40 * area);
  1635. price = price > 80 ? price : 80;
  1636. }
  1637. }
  1638. pro = new Product();
  1639. list_lastPrice = Math.max(Math.ceil(price), list_lastPrice);
  1640. pro.setPrice(list_lastPrice);
  1641. pro.setWeight(String.valueOf(df.format(area)));
  1642. pro.setCount(oldCount);
  1643. list.add(pro);
  1644. }
  1645. for (int i = 0; i < countArr.length; i++) {
  1646. if (countArr[i] < count) {
  1647. continue;
  1648. }
  1649. if (list.size() > 2) {
  1650. break;
  1651. } else {
  1652. area = (length + 0.3 * 2) * (width + 0.3 * 2) * countArr[i] / 10000 * number;
  1653. if (i > 0) {
  1654. lastArea = (length + 0.3 * 2) * (width + 0.3 * 2) * countArr[i - 1] / 10000 * number;
  1655. }
  1656. if (!StringUtils.isEmpty(zhuan)) {
  1657. //工艺价格另算
  1658. area = (length + 0.3 * 2) * (width + 0.3 * 2) * countArr[i] / 10000;
  1659. if (i > 0) {
  1660. lastArea = (length + 0.3 * 2) * (width + 0.3 * 2) * countArr[i - 1] / 10000;
  1661. }
  1662. }
  1663. // 报价面积,平方米(加一边3mm出血)
  1664. price = f_getUvPrice(area, 1);
  1665. price = price > 45 ? price : 45;
  1666. lastPrice = f_getUvPrice(lastArea, 1);
  1667. if (area < 0.1 && area > 0) {
  1668. price = f_getUvPrice(area, 3);
  1669. lastPrice = f_getUvPrice(lastArea, 3);
  1670. }
  1671. if (area <= 0.2 && area >= 0.1) {
  1672. mqPrice = countArr[i] * 0.05;
  1673. mqPrice = mqPrice > 5 ? mqPrice : 5;
  1674. Math.ceil(price += mqPrice);
  1675. }
  1676. if (lastArea <= 0.2 && area >= 0.1 && i > 0) {
  1677. mqPrice = countArr[i - 1] * 0.05;
  1678. mqPrice = mqPrice > 5 ? mqPrice : 5;
  1679. Math.ceil(lastPrice += mqPrice);
  1680. }
  1681. if (area > 0.1) {
  1682. if (lastPrice >= price) {//判断上一个尺寸
  1683. price = Math.ceil(lastPrice * 1.1);
  1684. }
  1685. }
  1686. if (!StringUtils.isEmpty(zhuan)) {
  1687. if ("烫金".equals(zhuan[0]) || "烫哑金".equals(zhuan[0]) || "烫亮金".equals(zhuan[0]) || "烫银".equals(zhuan[0]) || "烫蓝".equals(zhuan[0]) || "烫红".equals(zhuan[0]) || "烫黑".equals(zhuan[0]) || "镭射银".equals(zhuan[0]) || "镭射金".equals(zhuan[0]) || "玫瑰金".equals(zhuan[0])) {
  1688. // 起步价+58元
  1689. price = price + (40 * area);
  1690. price = price > 80 ? price : 80;
  1691. // lastPrice = lastPrice + (45 * area);
  1692. // lastPrice = lastPrice > 103 ? lastPrice : 103;
  1693. } else if ("印刷+烫金".equals(zhuan[0]) || "印刷+烫银".equals(zhuan[0])) {
  1694. // 起步价+58元
  1695. price = price + (45 * area);
  1696. price = price > 103 ? price : 103;
  1697. // lastPrice = lastPrice + (45 * area);
  1698. // lastPrice = lastPrice > 103 ? lastPrice : 103;
  1699. } else if ("双面贴".equals(zhuan[0])) {
  1700. price = price + (40 * area);
  1701. price = price > 80 ? price : 80;
  1702. }
  1703. }
  1704. pro = new Product();
  1705. list_lastPrice = Math.max(Math.ceil(price), list_lastPrice);
  1706. pro.setPrice(list_lastPrice);
  1707. pro.setWeight(String.valueOf(df.format(area)));
  1708. pro.setCount(countArr[i]);
  1709. list.add(pro);
  1710. }
  1711. }
  1712. // if (!StringUtils.isEmpty(zhuan) && ("烫金".equals(zhuan[0]) || "烫银".equals(zhuan[0]) || "印刷+烫金".equals(zhuan[0]) || "印刷+烫银".equals(zhuan[0]))) {
  1713. // for (Product product : list) {
  1714. // product.setPrice(Math.ceil(product.getPrice() + 60));
  1715. // }
  1716. // }
  1717. if (!StringUtils.isEmpty(zhuan) && ("专金".equals(zhuan[0]) || "专银".equals(zhuan[0]))) {
  1718. for (Product product : list) {
  1719. product.setPrice(Math.ceil(product.getPrice() + 60));
  1720. }
  1721. }
  1722. if (length >= 44 || width >= 44) {
  1723. if (width > length) {
  1724. length = width;
  1725. }
  1726. for (Product product : list) {
  1727. product.setPrice(Math.ceil(product.getPrice() + length * 0.6));
  1728. }
  1729. }
  1730. return list;
  1731. }
  1732. /**
  1733. * 少数量(小于10)UV转印贴报价:
  1734. *
  1735. * @param length
  1736. * @param width
  1737. * @param count
  1738. * @param zhuan
  1739. * @param number 印色
  1740. * @return
  1741. */
  1742. public List<Product> UVStickerLessPrice(double length, double width, int count, int number, String[] zhuan) {
  1743. List<Product> list = new ArrayList<Product>();
  1744. Product pro = new Product();
  1745. double area = (length + 0.3 * 2) * (width + 0.3 * 2) * count / 10000;
  1746. if (!StringUtils.isEmpty(zhuan) && count < 25) {
  1747. return list;
  1748. }
  1749. double price = f_getUvPrice(area, 2);
  1750. pro.setPrice(price > 80 ? price : 80);
  1751. pro.setCount(count);
  1752. list.add(pro);
  1753. if (!StringUtils.isEmpty(zhuan)) {
  1754. for (Product product : list) {
  1755. product.setPrice(Math.floor(product.getPrice() + 60 + (30 * area > 15 ? 30 * area : 15)));
  1756. }
  1757. }
  1758. return list;
  1759. }
  1760. /**
  1761. * 条幅
  1762. *
  1763. * @param kind2
  1764. * @param number
  1765. */
  1766. public static List<Product> bannerPrice(String kind2, double length, double width, int count, Integer number, String role) {
  1767. List<Product> list = new ArrayList<Product>();
  1768. Product pro = new Product();
  1769. // 一条条幅的长度
  1770. length = length / 100.0;
  1771. width = width / 100.0;
  1772. double area = length * width * count;
  1773. double price = 0;
  1774. if ("彩色条幅".equals(kind2)) {
  1775. //拼多多价格
  1776. if (role.indexOf("1045") > -1) {
  1777. if (width == 0.5 || length == 0.5) {
  1778. double widthArr[] = {3, 4, 5, 6, 7, 8};
  1779. double unitArr[] = {19, 17.5, 17, 17, 17, 17};
  1780. double baseArr[] = {40, 50, 60, 75, 85, 96};
  1781. for (int i = 0; i < widthArr.length; i++) {
  1782. if (widthArr[i] < width || widthArr[i] < length) {
  1783. continue;
  1784. }
  1785. price = unitArr[i] * area;
  1786. price = price > baseArr[i] ? price : baseArr[i];
  1787. break;
  1788. }
  1789. } else {
  1790. if (area <= 1) {
  1791. price = 45;
  1792. } else if (area <= 2) {
  1793. price = 35 * area;
  1794. } else if (area <= 3) {
  1795. price = 33 * area;
  1796. } else if (area <= 4) {
  1797. price = 32 * area;
  1798. } else if (area <= 5) {
  1799. price = 30 * area;
  1800. } else if (area <= 10) {
  1801. price = 28 * area;
  1802. } else {
  1803. price = 25 * area;
  1804. }
  1805. }
  1806. price = price > 40 ? price : 40;
  1807. } else {
  1808. if (width == 0.5 && length == 3 || width == 3 && length == 0.5) {
  1809. price = 30 * area;
  1810. } else if (width == 0.5 && length == 5 || width == 5 && length == 0.5) {
  1811. price = 24 * area;
  1812. } else if (area <= 1) {
  1813. price = 45;
  1814. } else if (area <= 2) {
  1815. price = 35 * area;
  1816. } else if (area <= 3) {
  1817. price = 33 * area;
  1818. } else if (area <= 4) {
  1819. price = 32 * area;
  1820. } else if (area <= 5) {
  1821. price = 30 * area;
  1822. } else if (area <= 10) {
  1823. price = 28 * area;
  1824. } else {
  1825. price = 25 * area;
  1826. }
  1827. price = price > 45 ? price : 45;
  1828. }
  1829. } else {
  1830. double[] areas = null;
  1831. int[] prices = null;
  1832. double last_price = 0;
  1833. double min_price = 0;
  1834. if ((width == 0.5 && length == 3 && count == 1) || (width == 3 && length == 0.5 && count == 1)) {
  1835. price = 24 * area;
  1836. } else {
  1837. areas = new double[]{1, 2, 3, 4, 5, 10};
  1838. prices = new int[]{35, 30, 24, 21, 18, 16};
  1839. last_price = 13;
  1840. min_price += 40;
  1841. price = Math.max(TableUnitPrice(area, prices, areas, last_price), min_price);
  1842. }
  1843. }
  1844. pro.setCount(count);
  1845. pro.setPrice(Math.ceil(price));
  1846. list.add(pro);
  1847. return list;
  1848. }
  1849. /**
  1850. * 桌贴0.38磨砂背胶价格计算 ======》 最大印刷尺寸40*45CM 最低起步价100元 每增加一张加30元 设计费每款加8元
  1851. * <p>
  1852. * 0.38桌贴(磨砂、哑光、亮光) 最大打印面积 395*445MM 成品最小做到1CM 每边加上1.5MM出血 起步价90元
  1853. * 单面印刷不带胶每增加一张单面加30元 双面打印不带胶每增加一张加36元, 带胶加40元一张 10张以上不分单双面带不带胶 均20元/张
  1854. * 款数不同的每款加上1元的设计费
  1855. *
  1856. * @param list
  1857. * @param width
  1858. * @param length
  1859. * @param count
  1860. * @param number
  1861. * @return
  1862. */
  1863. public List<Product> getDeskSticker(List<Product> list, Double width, Double length, int count, Integer number,
  1864. String craftShua, String craftJiao) {
  1865. // 最大尺寸435*385mm ,加出血一边3mm
  1866. double l = 435;
  1867. double w = 385;
  1868. Product pro = new Product();
  1869. // 价格
  1870. double price = 0;
  1871. // 换成毫米每边+1.5
  1872. length = length * 10 + 2 * 1.5;
  1873. width = width * 10 + 2 * 1.5;
  1874. // 数量*款数就是张数
  1875. count = count * number;
  1876. if ((length > l || width > w) && (length > w || width > l))
  1877. return null;
  1878. // 一张大纸45*40cm 能做多少个此类尺寸的桌贴
  1879. double max = Math.max(Math.floor(l / length) * Math.floor(w / width),
  1880. Math.floor(l / width) * Math.floor(w / length));
  1881. // 报的数量需要多少张大纸
  1882. int num = (int) Math.ceil(count / max);
  1883. if ("单面".equals(craftShua)) {
  1884. if (num > 10) {
  1885. price = 70 + num * 28 + (number - 1);
  1886. } else {
  1887. price = 80 + num * 30 + (number - 1);
  1888. }
  1889. } else if ("双面".equals(craftShua)) {
  1890. if ("背胶".equals(craftJiao)) {
  1891. price = 100 + num * 40 + (number - 1);
  1892. } else {
  1893. price = 100 + num * 36 + (number - 1);
  1894. }
  1895. }
  1896. pro.setCount(count / number);
  1897. pro.setPrice(price > 90 ? price : 90);
  1898. list.add(pro);
  1899. return list;
  1900. }
  1901. /**
  1902. * 桌贴0.38PVC亮光异型卡片 印刷价格
  1903. *
  1904. * @param list
  1905. * @param width
  1906. * @param length
  1907. * @param count
  1908. * @return
  1909. */
  1910. public List<Product> getDeskSticker(List<Product> list, Double width, Double length, int count) {
  1911. double danjia;
  1912. int countArr[] = {500, 1000, 2000, 3000, 5000, 10000};
  1913. for (int i = 0; i < countArr.length; i++) {
  1914. if (countArr[i] < count || list.size() > 3) {
  1915. continue;
  1916. }
  1917. // 面积平方米
  1918. double area = width * length * countArr[i] / 10000;
  1919. Product pro = new Product();
  1920. if (area <= 0.45) {
  1921. danjia = 110;
  1922. } else if (area <= 0.9) {
  1923. danjia = 150;
  1924. } else if (area <= 5) {
  1925. danjia = 100;
  1926. } else if (area <= 10) {
  1927. danjia = 70;
  1928. } else if (area <= 15) {
  1929. danjia = 55;
  1930. } else if (area <= 20) {
  1931. danjia = 50;
  1932. } else if (area <= 30) {
  1933. danjia = 40;
  1934. } else {
  1935. danjia = 30;
  1936. }
  1937. pro = new Product();
  1938. pro.setCount(countArr[i]);
  1939. pro.setPrice(area * danjia > 120 ? area * danjia : 120);
  1940. list.add(pro);
  1941. }
  1942. for (int i = 0; i < list.size() - 1; i++) {
  1943. if (list.get(i + 1).getPrice() - list.get(i).getPrice() < 100) {
  1944. list.get(i + 1).setPrice(list.get(i + 1).getPrice() + 100);
  1945. }
  1946. }
  1947. return list;
  1948. }
  1949. /**
  1950. * 桌贴0.38PVC亮光异型卡片 打印价格
  1951. *
  1952. * @param number
  1953. * @param width
  1954. * @param length
  1955. * @param count
  1956. * @param craftJiao
  1957. * @return 不同款内容的报价:成本核算 有效打印面积 380*420MM 起步价120元 每增加一张单面加30元
  1958. * 双面打印在每增加一张加36元,带胶加每增加一张加40元 10张以上单双面均加22元/张
  1959. */
  1960. public List<Product> getDeskStickerPrint(Double width, Double length, int count, int number, String craftJiao) {
  1961. List<Product> list = new ArrayList<Product>();
  1962. // 有效打印面积 420*380MM,加出血一边3mm
  1963. double l = 426;
  1964. double w = 386;
  1965. Product pro = new Product();
  1966. // 第一张大纸价格
  1967. double price = 120;
  1968. // 换成毫米每边+3
  1969. length = length * 10 + 2 * 3;
  1970. width = width * 10 + 2 * 3;
  1971. // 数量 * 款数就是张数
  1972. count = count * number;
  1973. if ((length > l || width > w) && (length > w || width > l))
  1974. return null;
  1975. // 一张大纸420*380mm 能做多少个此类尺寸的桌贴
  1976. double max = Math.max(Math.floor(l / length) * Math.floor(w / width),
  1977. Math.floor(l / width) * Math.floor(w / length));
  1978. // 报的数量需要多少张大纸
  1979. int num = (int) Math.ceil(count / max);
  1980. // 价格计算
  1981. if ("背胶".equals(craftJiao)) {
  1982. price = price + (num - 1) * 40;
  1983. } else {
  1984. if (num > 10) {
  1985. price = price + (num - 1) * 22;
  1986. } else {
  1987. // 单面
  1988. if ("单面".equals(craftJiao)) {
  1989. price = price + (num - 1) * 30;
  1990. } else if ("双面".equals(craftJiao)) {// 双面
  1991. price = price + (num - 1) * 36;
  1992. }
  1993. }
  1994. }
  1995. pro.setCount(count / number);
  1996. pro.setPrice(price);
  1997. list.add(pro);
  1998. return list;
  1999. }
  2000. /**
  2001. * 滴塑价格计算======> 滴塑 出血位每边加1.5MM 滴塑最大印刷面积43*30CM 起步价80元 2张100元 3张120元 4张150元
  2002. * 5张180元 10张260元 11张以上*25元
  2003. *
  2004. * @param list
  2005. * @param width
  2006. * @param length
  2007. * @param count
  2008. * @param number
  2009. * @param dto
  2010. * @return
  2011. */
  2012. public static List<Product> getDisuPrice(List<Product> list, Double width, Double length, int count, Integer number, Product dto) {
  2013. List<String> craft = dto.getCraft() != null ? Arrays.asList(dto.getCraft()) : new ArrayList<>();
  2014. // 最大尺寸43*30cm
  2015. double l = 430;
  2016. double w = 300;
  2017. Product pro = new Product();
  2018. // 第一张大纸价格
  2019. double price = 80;
  2020. if (craft.size() > 0) {//工艺起步价120
  2021. price = 120;
  2022. }
  2023. // 换成毫米每边+3
  2024. length = length * 10 + 2 * 1.5;
  2025. width = width * 10 + 2 * 1.5;
  2026. // 数量*款数就是张数
  2027. count = count * number;
  2028. if ((length - 3 > l || width - 3 > w) && (length - 3 > w || width - 3 > l)) {
  2029. return null;
  2030. }
  2031. // 一张大纸43*30 能做多少个此类尺寸的
  2032. double max = Math.max(Math.max(Math.floor(l / length) * Math.floor(w / width),
  2033. Math.floor(l / width) * Math.floor(w / length)), 1);
  2034. // 报的数量需要多少张大纸
  2035. int num = (int) Math.ceil(count / max);
  2036. if (num <= 10) {
  2037. price = price + (num - 1) * 20;
  2038. } else if (num > 10) {
  2039. price = num * 25;
  2040. }
  2041. price += 10 * craft.size() * num;
  2042. if (dto.getN_mq_num() > 0) {
  2043. price += 10 * dto.getN_mq_num();
  2044. }
  2045. price = Math.ceil(price + (number - 1) * 8);
  2046. pro.setCount(count / number);
  2047. pro.setPrice(price);
  2048. list.add(pro);
  2049. return list;
  2050. }
  2051. /**
  2052. * 毕业证书价格计算
  2053. *
  2054. * @param count
  2055. */
  2056. public List<Product> getDiploma(int count) {
  2057. List<Product> list = new ArrayList<Product>();
  2058. // 数量
  2059. int countArr[] = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 200, 300, 500, 1000};
  2060. // 价格
  2061. double priceArray[] = {90, 110, 120, 140, 160, 190, 210, 230, 240, 270, 480, 740, 920, 1200};
  2062. Product pro = new Product();
  2063. for (int i = 0; i < countArr.length; i++) {
  2064. if (countArr[i] < count) {
  2065. continue;
  2066. }
  2067. if (list.size() == 4) {
  2068. return list;
  2069. }
  2070. pro = new Product();
  2071. pro.setCount(countArr[i]);
  2072. pro.setPrice(priceArray[i]);
  2073. list.add(pro);
  2074. }
  2075. return list;
  2076. }
  2077. /**
  2078. * 复印纸价格计算
  2079. *
  2080. * @param count
  2081. * @param kind3
  2082. * @param kind2
  2083. * @param kind
  2084. * @param size
  2085. * @return
  2086. */
  2087. public List<Product> getCopyPaper(String kind, String kind2, String kind3, int count, String size) {
  2088. List<Product> list = new ArrayList<Product>();
  2089. double price = 0;
  2090. if ("彩色".equals(kind)) {
  2091. if ("80克双胶纸".equals(kind2)) {
  2092. if ("19*13".equals(size)) {
  2093. if (count == 10) {
  2094. price = 70;
  2095. } else if (count == 20) {
  2096. price = 90;
  2097. } else if (count == 50) {
  2098. price = 150;
  2099. }
  2100. } else if ("28.5*21".equals(size)) {
  2101. if (count == 10) {
  2102. price = 160;
  2103. } else if (count == 20) {
  2104. price = 320;
  2105. } else if (count == 50) {
  2106. price = 900;
  2107. }
  2108. }
  2109. }
  2110. } else {
  2111. if ("60克双胶纸".equals(kind2)) {
  2112. if ("19*13".equals(size)) {
  2113. if (count == 10) {
  2114. if ("单面".equals(kind3)) {
  2115. price = 50;
  2116. } else {
  2117. price = 70;
  2118. }
  2119. } else if (count == 20) {
  2120. if ("单面".equals(kind3)) {
  2121. price = 60;
  2122. } else {
  2123. price = 90;
  2124. }
  2125. } else if (count == 50) {
  2126. if ("单面".equals(kind3)) {
  2127. price = 110;
  2128. } else {
  2129. price = 150;
  2130. }
  2131. }
  2132. } else if ("28.5*21".equals(size)) {
  2133. if (count == 10) {
  2134. if ("单面".equals(kind3)) {
  2135. price = 110;
  2136. } else {
  2137. price = 150;
  2138. }
  2139. } else if (count == 20) {
  2140. if ("单面".equals(kind3)) {
  2141. price = 160;
  2142. } else {
  2143. price = 220;
  2144. }
  2145. } else if (count == 50) {
  2146. if ("单面".equals(kind3)) {
  2147. price = 380;
  2148. } else {
  2149. price = 520;
  2150. }
  2151. }
  2152. }
  2153. } else if ("80克双胶纸".equals(kind2)) {
  2154. if ("19*13".equals(size)) {
  2155. if (count == 10) {
  2156. if ("单面".equals(kind3)) {
  2157. price = 60;
  2158. } else {
  2159. price = 90;
  2160. }
  2161. } else if (count == 20) {
  2162. if ("单面".equals(kind3)) {
  2163. price = 80;
  2164. } else {
  2165. price = 120;
  2166. }
  2167. } else if (count == 50) {
  2168. if ("单面".equals(kind3)) {
  2169. price = 180;
  2170. } else {
  2171. price = 220;
  2172. }
  2173. }
  2174. } else if ("28.5*21".equals(size)) {
  2175. if (count == 10) {
  2176. if ("单面".equals(kind3)) {
  2177. price = 130;
  2178. } else {
  2179. price = 180;
  2180. }
  2181. } else if (count == 20) {
  2182. if ("单面".equals(kind3)) {
  2183. price = 220;
  2184. } else {
  2185. price = 260;
  2186. }
  2187. } else if (count == 50) {
  2188. if ("单面".equals(kind3)) {
  2189. price = 520;
  2190. } else {
  2191. price = 780;
  2192. }
  2193. }
  2194. }
  2195. }
  2196. }
  2197. Product pro = new Product();
  2198. pro = new Product();
  2199. pro.setCount(count);
  2200. pro.setPrice(Math.ceil(price));
  2201. list.add(pro);
  2202. return list;
  2203. }
  2204. /**
  2205. * 婚礼卡价格计算
  2206. *
  2207. * @param length
  2208. * @param width
  2209. * @param count
  2210. * @param number
  2211. * @param craftMo
  2212. * @param craftShua
  2213. * @return
  2214. */
  2215. public List<Product> getWeddingCardPrice(Double length, Double width, int count, Integer number, String craftMo,
  2216. String craftShua) {
  2217. List<Product> list = new ArrayList<Product>();
  2218. Product pro = new Product();
  2219. double weight = 0;
  2220. if ("直角".equals(craftMo) && count <= 300 && ((length == 13 && width == 5.4) || (length == 5.4 && width == 13))) {
  2221. if ("单面印刷".equals(craftShua)) {
  2222. // 数量
  2223. int countArr[] = {100, 200, 300};
  2224. // 价格
  2225. double priceArray[] = {70, 126, 183};
  2226. for (int i = 0; i < countArr.length; i++) {
  2227. if (countArr[i] < count) {
  2228. continue;
  2229. }
  2230. pro = new Product();
  2231. pro.setCount(countArr[i]);
  2232. pro.setPrice(priceArray[i]);
  2233. list.add(pro);
  2234. }
  2235. // 根据款数重新算价格
  2236. for (Product product : list) {
  2237. product.setWeight(df.format(length * width * product.getCount() / 10000 * 0.3 * number));
  2238. product.setPrice(Math.ceil(product.getPrice() * number));
  2239. }
  2240. } else if ("双面印刷".equals(craftShua)) {
  2241. // 数量
  2242. int countArr[] = {100, 200, 300};
  2243. // 价格
  2244. double priceArray[] = {108, 189, 275};
  2245. for (int i = 0; i < countArr.length; i++) {
  2246. if (countArr[i] < count) {
  2247. continue;
  2248. }
  2249. pro = new Product();
  2250. pro.setCount(countArr[i]);
  2251. pro.setPrice(priceArray[i]);
  2252. list.add(pro);
  2253. }
  2254. // 根据款数重新算价格
  2255. for (Product product : list) {
  2256. product.setPrice(Math.ceil(product.getPrice() * number));
  2257. }
  2258. }
  2259. } else {
  2260. // 转成毫米
  2261. weight = length * width * count / 10000 * 0.3 * number;
  2262. length = length * 10;
  2263. width = width * 10;
  2264. if (count <= 300) {
  2265. double l = 420;
  2266. double w = 285;
  2267. // 打印的加上出血(一边2毫米)
  2268. length = length + 4;
  2269. width = width + 4;
  2270. double price = 0.0;
  2271. // 5张以内价格
  2272. double fixPrice = 50;
  2273. // 每增加1张多少钱
  2274. double zhang = 6;
  2275. // 设计费
  2276. double designFee = 0.0;
  2277. // 婚礼卡,直角工艺每增加一张5元
  2278. if ("直角".equals(craftMo)) {
  2279. zhang = 5;
  2280. }
  2281. /*
  2282. * 婚礼卡设计费成品尺寸90X54MM以内每款收10元 140X100MM以内每款收15元 210X140MM以内30元 210X285MM以内40元
  2283. * 420X285MM以内60元 大于420X285MM80元
  2284. */
  2285. // 设计费不带出血的尺寸
  2286. if ((length - 4 <= 90 && width - 4 <= 54) || (length - 4 <= 54 && width - 4 <= 90)) {
  2287. designFee = 10;
  2288. } else if ((length - 4 <= 140 && width - 4 <= 100) || (length - 4 <= 140 && width - 4 <= 100)) {
  2289. designFee = 15;
  2290. } else if ((length - 4 <= 210 && width - 4 <= 140) || (length - 4 <= 140 && width - 4 <= 210)) {
  2291. designFee = 30;
  2292. } else if ((length - 4 <= 285 && width - 4 - 4 <= 210) || (length - 4 <= 210 && width - 4 <= 285)) {
  2293. designFee = 40;
  2294. } else if ((length - 4 <= 420 && width - 4 <= 285) || (length - 4 <= 285 && width - 4 <= 420)) {
  2295. designFee = 60;
  2296. } else {
  2297. designFee = 80;
  2298. }
  2299. // 一张l/w 大的纸张能做多少个此类尺寸的产品
  2300. double max = Math.max(Math.floor(l / length) * Math.floor(w / width),
  2301. Math.floor(l / width) * Math.floor(w / length));
  2302. // 报的数量需要多少张大纸
  2303. // 需要多少张大纸 = 数量 * 款数 /每张做多少个 ===总数量/每张多少个
  2304. int num = (int) Math.ceil(count * number / max);
  2305. // 5张以内价格 + 每张费用(第6张起收)+ 设计费 * 款数 + 0.1 * 总数量 (排号费)
  2306. price = fixPrice + (num - 5 > 0 ? num - 5 : 0) * zhang + designFee * number + 0.1 * count * number;
  2307. Product dto = new Product();
  2308. dto.setCount(count);
  2309. dto.setPrice(Math.ceil(price));
  2310. list.add(dto);
  2311. } else {
  2312. // 数量
  2313. int countArr[] = {500, 1000, 2000};
  2314. // 价格
  2315. double priceArray[] = {230, 400, 760};
  2316. for (int i = 0; i < countArr.length; i++) {
  2317. if (countArr[i] < count) {
  2318. continue;
  2319. }
  2320. pro = new Product();
  2321. pro.setCount(countArr[i]);
  2322. pro.setPrice(priceArray[i]);
  2323. list.add(pro);
  2324. }
  2325. // 根据款数重新算价格
  2326. for (Product product : list) {
  2327. product.setWeight(df.format(weight));
  2328. product.setPrice(Math.ceil(product.getPrice() * number));
  2329. }
  2330. }
  2331. }
  2332. return list;
  2333. }
  2334. /**
  2335. * 贡缎布产品价格
  2336. */
  2337. public static List<Product> satinClothPrice(String kind2, Double length, Double width, int count, Integer number) {
  2338. List<Product> list = new ArrayList<Product>();
  2339. Product pro = new Product();
  2340. double area = length * width / 10000;
  2341. double price = 0, dj = 0;
  2342. if (area < 0.25) {
  2343. dj = 40;
  2344. } else {
  2345. dj = 35;
  2346. }
  2347. area *= count;
  2348. if ("6".equals(kind2)) {
  2349. price = price + 30;
  2350. }
  2351. price = Math.ceil(area * dj > 40 ? area * dj : 40);
  2352. pro.setCount(count);
  2353. pro.setPrice(price * number);
  2354. list.add(pro);
  2355. return list;
  2356. }
  2357. /**
  2358. * 餐垫纸
  2359. *
  2360. * @param kind
  2361. * @param length
  2362. * @param width
  2363. * @param count
  2364. * @return
  2365. */
  2366. public List<Product> getPlaceMatPrice(String kind, Double length, Double width, int count) {
  2367. List<Product> list = new ArrayList<>();
  2368. length = length * 10;
  2369. width = width * 10;
  2370. // Double priceArr[] = { 40.0, 50.0, 80.0, 120.0, 160.0, 270.0, 480.0 };
  2371. // list = acountInsertCardPrice(count, list, priceArr);
  2372. if ((length <= 285 && width <= 210) || length <= 210 && width <= 285) {
  2373. Double priceArr[] = {46.0, 68.0, 117.0, 157.0, 236.0, 457.0};
  2374. list = acountPlaceMatPrice(kind, count, list, priceArr);
  2375. } else if (length <= 436 && width <= 285 || length <= 285 && width <= 436) {
  2376. Double priceArr[] = {88.0, 122.0, 191.0, 269.0, 457.0, 896.0};
  2377. list = acountPlaceMatPrice(kind, count, list, priceArr);
  2378. } else if (length <= 638 && width <= 285 || length <= 285 && width <= 638) {
  2379. Double priceArr[] = {137.0, 204.0, 350.0, 489.0, 810.0, 1482.0};
  2380. list = acountPlaceMatPrice(kind, count, list, priceArr);
  2381. } else if (length <= 852 && width <= 285 || length <= 285 && width <= 852) {
  2382. Double priceArr[] = {183.0, 272.0, 466.0, 652.0, 975.0, 1681.0};
  2383. list = acountPlaceMatPrice(kind, count, list, priceArr);
  2384. } else if (length <= 1050 && width <= 285 || length <= 285 && width <= 2050) {
  2385. Double priceArr[] = {229.0, 340.0, 582.0, 815.0, 1279.0, 2470.0};
  2386. list = acountPlaceMatPrice(kind, count, list, priceArr);
  2387. } else if (length <= 587 && width <= 428 || length <= 428 && width <= 587) {
  2388. Double priceArr[] = {195.0, 262.0, 408.0, 554.0, 869.0, 1659.0};
  2389. list = acountPlaceMatPrice(kind, count, list, priceArr);
  2390. } else if (length <= 638 && width <= 428 || length <= 428 && width <= 638) {
  2391. Double priceArr[] = {252.0, 352.0, 570.0, 755.0, 1191.0, 2263.0};
  2392. list = acountPlaceMatPrice(kind, count, list, priceArr);
  2393. } else if (length <= 779 && width <= 428 || length <= 428 && width <= 778) {
  2394. Double priceArr[] = {321.0, 430.0, 691.0, 951.0, 1434.0, 2765.0};
  2395. list = acountPlaceMatPrice(kind, count, list, priceArr);
  2396. } else if (length <= 880 && width <= 428 || length <= 428 && width <= 880) {
  2397. Double priceArr[] = {349.0, 484.0, 796.0, 1051.0, 1681.0, 3258.0};
  2398. list = acountPlaceMatPrice(kind, count, list, priceArr);
  2399. } else if (length <= 1050 && width <= 428 || length <= 428 && width <= 1050) {
  2400. Double priceArr[] = {419.0, 587.0, 900.0, 1191.0, 1985.0, 3748.0};
  2401. list = acountPlaceMatPrice(kind, count, list, priceArr);
  2402. } else if (length <= 638 && width <= 574 || length <= 574 && width <= 638) {
  2403. Double priceArr[] = {274.0, 408.0, 699.0, 927.0, 1535.0, 2964.0};
  2404. list = acountPlaceMatPrice(kind, count, list, priceArr);
  2405. } else if (length <= 779 && width <= 529 || length <= 529 && width <= 779) {
  2406. Double priceArr[] = {321.0, 430.0, 691.0, 951.0, 1434.0, 2765.0};
  2407. list = acountPlaceMatPrice(kind, count, list, priceArr);
  2408. } else if (length <= 880 && width <= 580 || length <= 580 && width <= 880) {
  2409. Double priceArr[] = {349.0, 484.0, 796.0, 1051.0, 1681.0, 3258.0};
  2410. list = acountPlaceMatPrice(kind, count, list, priceArr);
  2411. } else if (length <= 863 && width <= 638 || length <= 638 && width <= 863) {
  2412. Double priceArr[] = {411.0, 612.0, 993.0, 1390.0, 2303.0, 4446.0};
  2413. list = acountPlaceMatPrice(kind, count, list, priceArr);
  2414. }
  2415. return list;
  2416. }
  2417. /**
  2418. * 餐垫纸遍历添加价格
  2419. */
  2420. private List<Product> acountPlaceMatPrice(String kind, int count, List<Product> list, Double[] priceArr) {
  2421. int countArr[] = {500, 1000, 2000, 3000, 5000, 10000};
  2422. Product pro;
  2423. double beishu = 1;
  2424. for (int i = 0; i < countArr.length; i++) {
  2425. if (countArr[i] < count || list.size() > 3) {
  2426. continue;
  2427. }
  2428. pro = new Product();
  2429. pro.setCount(countArr[i]);
  2430. if (countArr[i] <= 500) {
  2431. beishu = 2.2;
  2432. } else if (countArr[i] <= 3000) {
  2433. beishu = 1.8;
  2434. } else {
  2435. beishu = 1.5;
  2436. }
  2437. // 55克 比80克便宜2分钱一张
  2438. if ("1".equals(kind)) {
  2439. pro.setPrice(Math.ceil(priceArr[i] * beishu - countArr[i] * 0.02));
  2440. } else if ("0".equals(kind)) {// 80克
  2441. pro.setPrice(Math.ceil(priceArr[i] * beishu));
  2442. } else if ("2".equals(kind)) {// 100克
  2443. pro.setPrice(Math.ceil(priceArr[i] * beishu * 1.5));
  2444. }
  2445. list.add(pro);
  2446. }
  2447. return list;
  2448. }
  2449. /**
  2450. * 硫酸纸吊牌价格
  2451. *
  2452. * @param count
  2453. */
  2454. public List<Product> getAcidTagsPrice(Double length, Double width, String size1, int count) {
  2455. List<Product> list = new ArrayList<>();
  2456. int countArr[] = {1000, 2000, 5000, 10000};
  2457. if ((length > 6.8 || width > 3) && (length > 3 || width > 6.8)) {
  2458. int priceArr[] = {200, 360, 720, 1300};
  2459. list = acountAcidTagsPrice(count, list, countArr, priceArr);
  2460. } else {
  2461. int priceArr[] = {180, 320, 620, 1100};
  2462. list = acountAcidTagsPrice(count, list, countArr, priceArr);
  2463. }
  2464. return list;
  2465. }
  2466. /**
  2467. * 硫酸纸吊牌价格计算
  2468. *
  2469. * @param count
  2470. * @param list
  2471. * @param countArr
  2472. * @param priceArr
  2473. */
  2474. private List<Product> acountAcidTagsPrice(int count, List<Product> list, int[] countArr, int[] priceArr) {
  2475. Product pro;
  2476. for (int i = 0; i < countArr.length; i++) {
  2477. if (countArr[i] < count || list.size() > 3) {
  2478. continue;
  2479. }
  2480. pro = new Product();
  2481. pro.setCount(countArr[i]);
  2482. pro.setPrice(Math.ceil(priceArr[i]));
  2483. list.add(pro);
  2484. }
  2485. return list;
  2486. }
  2487. /**
  2488. * 号码布价格计算
  2489. *
  2490. * @param kind
  2491. * @param num
  2492. * @param width
  2493. * @param length
  2494. * @param list
  2495. * @param count
  2496. * @return
  2497. */
  2498. public List<Product> getHmbPrice(String kind, int num, Double length, Double width, int count, List<Product> list) {
  2499. Product pro;
  2500. double price = 0;
  2501. if (length == 240 && width == 200 || length == 200 && width == 240) {
  2502. if (kind.equals("春亚布")) {
  2503. price = num * count * 1.8;
  2504. } else {
  2505. price = num * count * 2.5;
  2506. }
  2507. } else if (length == 200 && width == 140 || length == 140 && width == 200) {
  2508. if (kind.equals("春亚布")) {
  2509. price = num * count * 1.5;
  2510. } else {
  2511. price = num * count * 1.3;
  2512. }
  2513. } else {
  2514. if (kind.equals("春亚布")) {
  2515. price = num * count * 1.5;
  2516. } else {
  2517. price = num * count * 1.8;
  2518. }
  2519. }
  2520. pro = new Product();
  2521. pro.setCount(count);
  2522. pro.setPrice(Math.ceil(price) > 50 ? price : 50);
  2523. list.add(pro);
  2524. return list;
  2525. }
  2526. /**
  2527. * 锦旗价格计算
  2528. *
  2529. * @param kind
  2530. * @param num
  2531. * @param width
  2532. * @param length
  2533. * @param list
  2534. * @param count
  2535. * @return
  2536. */
  2537. public List<Product> getJQPrice(String kind, int num, Double length, Double width, int count, List<Product> list) {
  2538. Product pro;
  2539. double price = 0;
  2540. if (length == 60 && width == 90 || length == 90 && width == 60) {
  2541. if (kind.equals("小龙须黄字")) {
  2542. price = num * count * 45;
  2543. } else if (kind.equals("小龙须3d镀金")) {
  2544. price = num * count * 86;
  2545. } else if (kind.equals("大龙须黄字")) {
  2546. price = num * count * 66;
  2547. } else if (kind.equals("大龙须3d镀金")) {
  2548. price = num * count * 88;
  2549. } else {
  2550. price = num * count * 130;
  2551. }
  2552. } else if (length == 70 && width == 110 || length == 110 && width == 70) {
  2553. if (kind.equals("小龙须黄字")) {
  2554. price = num * count * 47;
  2555. } else if (kind.equals("小龙须3d镀金")) {
  2556. price = num * count * 88;
  2557. } else if (kind.equals("大龙须黄字")) {
  2558. price = num * count * 80;
  2559. } else {
  2560. price = num * count * 98;
  2561. }
  2562. } else if (length == 80 && width == 120 || length == 120 && width == 80) {
  2563. if (kind.equals("小龙须黄字")) {
  2564. price = num * count * 85;
  2565. } else if (kind.equals("小龙须3d镀金")) {
  2566. price = num * count * 125;
  2567. } else if (kind.equals("大龙须黄字")) {
  2568. price = num * count * 90;
  2569. } else {
  2570. price = num * count * 140;
  2571. }
  2572. } else if (length == 70 && width == 120 || length == 120 && width == 70) {
  2573. price = num * count * 158;
  2574. } else {
  2575. price = num * count * 220;
  2576. }
  2577. pro = new Product();
  2578. pro.setCount(count);
  2579. pro.setPrice(Math.ceil(price));
  2580. list.add(pro);
  2581. return list;
  2582. }
  2583. /**
  2584. * 彩旗价格计算
  2585. *
  2586. * @param num
  2587. * @param width
  2588. * @param length
  2589. * @param list
  2590. * @param count
  2591. * @return
  2592. */
  2593. public List<Product> getCQPrice(int num, Double length, Double width, int count, List<Product> list) {
  2594. Product pro;
  2595. double price = 0;
  2596. if (length == 40 && width == 80 || length == 80 && width == 40) {
  2597. price = num * count * 80;
  2598. } else if (length == 60 && width == 90 || length == 90 && width == 60) {
  2599. price = num * count * 130;
  2600. } else if (length == 70 && width == 120 || length == 120 && width == 70) {
  2601. price = num * count * 158;
  2602. } else {
  2603. price = num * count * 220;
  2604. }
  2605. pro = new Product();
  2606. pro.setCount(count);
  2607. pro.setPrice(Math.ceil(price));
  2608. list.add(pro);
  2609. return list;
  2610. }
  2611. /**
  2612. * 封口贴铜板不干胶价格计算
  2613. *
  2614. * @param num
  2615. * @param list
  2616. * @return
  2617. */
  2618. public List<Product> getFktPrice(int num, List<Product> list) {
  2619. Product pro;
  2620. double price = 0;
  2621. for (int i = 1; i < countArr.length; i++) {
  2622. if (countArr[i] == 1000) {
  2623. price = 50.0 * num;
  2624. } else if (countArr[i] == 2000) {
  2625. price = 80.0 * num;
  2626. } else if (countArr[i] == 3000) {
  2627. price = 150.0 * num;
  2628. } else if (countArr[i] == 5000) {
  2629. price = 175.0 * num;
  2630. } else if (countArr[i] == 10000) {
  2631. price = 240.0 * num;
  2632. } else {
  2633. price = 450.0 * num;
  2634. }
  2635. pro = new Product();
  2636. pro.setCount(countArr[i]);
  2637. pro.setPrice(Math.ceil(price));
  2638. list.add(pro);
  2639. }
  2640. return list;
  2641. }
  2642. /**
  2643. * PVC亮光异型卡片价格计算
  2644. *
  2645. * @param dto
  2646. * @param number
  2647. * @param width
  2648. * @param length
  2649. * @param area
  2650. * @param count
  2651. * @param priceList
  2652. * @return
  2653. */
  2654. /*public List<Product> getPVCPrice(String kindValue,int count,double width, double length, List<Product> list) {
  2655. Product pro;
  2656. double price = 0,dj = 0, bz = 1;
  2657. double area = (width*length)/10000;
  2658. int countArr[] = { 500, 1000, 2000, 5000, 10000 };
  2659. if(area <= 0.0016) {
  2660. bz = 2.7;
  2661. }else if(area <= 0.0025) {
  2662. bz = 1.8;
  2663. }else if(area <= 0.0036) {
  2664. bz = 1.3;
  2665. }else if(area <= 0.0042) {
  2666. bz = 1.05;
  2667. }
  2668. for(int i = 0; i< countArr.length; i++) {
  2669. if (countArr[i] < count || list.size() > 3) {
  2670. continue;
  2671. }
  2672. if(kindValue.equals("2")) {
  2673. if(countArr[i] == 500) {
  2674. dj = 45;
  2675. }else if(countArr[i] == 1000) {
  2676. dj = 34;
  2677. }else if(countArr[i] == 2000) {
  2678. dj = 31;
  2679. }else if(countArr[i] == 5000) {
  2680. dj = 29;
  2681. }else if(countArr[i] == 10000) {
  2682. dj = 28;
  2683. }
  2684. }else {
  2685. if(countArr[i] == 500) {
  2686. dj = 63;
  2687. }else if(countArr[i] == 1000) {
  2688. dj = 54;
  2689. }else if(countArr[i] == 2000) {
  2690. dj = 50;
  2691. }else if(countArr[i] == 5000) {
  2692. dj = 48;
  2693. }else if(countArr[i] == 10000) {
  2694. dj = 47;
  2695. }
  2696. }
  2697. price = bz*dj*countArr[i]*area;
  2698. pro = new Product();
  2699. pro.setCount(countArr[i]);
  2700. pro.setPrice(price);
  2701. list.add(pro);
  2702. }
  2703. return list;
  2704. }*/
  2705. /**
  2706. * 硫酸纸价格计算
  2707. *
  2708. * @param dto
  2709. * @param width
  2710. * @param length
  2711. * @param count
  2712. * @param list
  2713. * @return
  2714. */
  2715. public List<Product> getLszPrice(Product dto, double width, double length, int count, List<Product> list) {
  2716. double price = 0, dj = 0, area = 0;
  2717. String craft[] = dto.getCraft();
  2718. int lszCountArr[] = new int[]{500, 1000, 2000, 3000, 5000, 10000, 20000};
  2719. for (int i = 0; i < lszCountArr.length; i++) {
  2720. Product pro = new Product();
  2721. if (lszCountArr[i] < count || list.size() > 3) {
  2722. continue;
  2723. }
  2724. if ((width <= 6.8 && length <= 3) || (width <= 6.8 && length <= 3)) {
  2725. if ("直角".equals(craft[0])) {
  2726. dj = 14.5;
  2727. } else {
  2728. dj = 36.5;
  2729. }
  2730. } else if ((width <= 9 && length <= 5) || (width <= 9 && length <= 5)) {
  2731. if ("直角".equals(craft[0])) {
  2732. dj = 14.5;
  2733. } else {
  2734. dj = 36.5;
  2735. }
  2736. } else if ((width <= 10 && length <= 14) || (width <= 14 && length <= 10)) {
  2737. if ("直角".equals(craft[0])) {
  2738. dj = 11.5;
  2739. } else {
  2740. dj = 17.5;
  2741. }
  2742. } else if ((width <= 21 && length <= 14) || (width <= 14 && length <= 21)) {
  2743. if ("直角".equals(craft[0])) {
  2744. dj = 9.6;
  2745. } else {
  2746. dj = 12.1;
  2747. }
  2748. } else if ((width <= 21 && length <= 28.5) || (width <= 28.5 && length <= 21)) {
  2749. if ("直角".equals(craft[0])) {
  2750. dj = 7.6;
  2751. } else {
  2752. dj = 11.1;
  2753. }
  2754. } else {
  2755. if ("直角".equals(craft[0])) {
  2756. dj = 7.2;
  2757. } else {
  2758. dj = 10.7;
  2759. }
  2760. }
  2761. dj *= 2;//按照供应商成本价2倍计算
  2762. if (lszCountArr[i] == 500) {
  2763. area = width * length * 800 / 10000;
  2764. } else {
  2765. area = width * length * lszCountArr[i] / 10000;
  2766. if ((width >= 21 && length >= 28.5) || (width >= 28.5 && length >= 21)) {
  2767. area *= 0.85;
  2768. }
  2769. }
  2770. price = Math.ceil(dj * area);
  2771. pro.setPrice(price > 80 ? price : 80);
  2772. //烫金工艺
  2773. if ("烫金".equals(dto.getCraftTang())) {
  2774. area = length * width / 10000;
  2775. double tangPrice = 0;
  2776. double tangPriceArr[] = new double[4];
  2777. if (area <= 0.005) {
  2778. tangPriceArr = new double[]{90.0, 135.0, 205.0, 255.0, 425, 850, 1700};
  2779. } else if (area <= 0.01) {
  2780. tangPriceArr = new double[]{95.0, 140.0, 225.0, 300.0, 500, 1000, 2000};
  2781. } else if (area <= 0.015) {
  2782. tangPriceArr = new double[]{100.0, 145.0, 245.0, 325.0, 545, 1090, 2180};
  2783. } else if (area <= 0.025) {
  2784. tangPriceArr = new double[]{115.0, 165.0, 280.0, 380.0, 635, 1270, 2540};
  2785. } else if (area <= 0.035) {
  2786. tangPriceArr = new double[]{135.0, 205.0, 335.0, 468.0, 780, 1560, 3120};
  2787. } else {
  2788. tangPriceArr = new double[]{145.0, 225.0, 380.0, 535.0, 895, 1790, 3580};
  2789. }
  2790. tangPrice = tangPriceArr[i] * 1.4 > 135 ? tangPriceArr[i] * 1.4 : 135;
  2791. pro.setPrice(Math.ceil(pro.getPrice() + tangPrice));
  2792. }
  2793. pro.setCount(lszCountArr[i]);
  2794. list.add(pro);
  2795. }
  2796. return list;
  2797. }
  2798. /**
  2799. * 80克硫酸纸价格计算
  2800. *
  2801. * @param dto
  2802. * @param width
  2803. * @param length
  2804. * @param count
  2805. * @param list
  2806. * @return
  2807. */
  2808. public List<Product> get80LszPrice(Product dto, double width, double length, int count, List<Product> list) {
  2809. double dj = 0;
  2810. double l = 420;
  2811. double w = 285;
  2812. length *= 10;
  2813. width *= 10;
  2814. Product pro = new Product();
  2815. double max = Math.max(Math.floor(l / length) * Math.floor(w / width),
  2816. Math.floor(l / width) * Math.floor(w / length));
  2817. List<String> craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
  2818. // 报的数量需要多少张大纸
  2819. int num = (int) Math.ceil(count / max);
  2820. // if (count <= 1000) {
  2821. // dj = 150;
  2822. // } else {
  2823. // dj = 150 + Math.ceil(count / 1000) * 20;
  2824. // }
  2825. if (dto.getKindValue().equals("2")) {
  2826. dj = 0.86;
  2827. } else {
  2828. dj = 0.5;
  2829. }
  2830. pro.setPrice(130 + Math.ceil((num + 100) * dj));
  2831. if (craft_list.contains("异形") || craft_list.contains("异形模切")) {
  2832. pro.setPrice(Math.ceil(pro.getPrice() * 1.5));
  2833. }
  2834. double area = 0;
  2835. if ("烫金".equals(dto.getCraftTang())) {
  2836. int lszCountArr[] = new int[]{500, 1000, 2000, 3000, 5000, 10000, 20000};
  2837. int i = 0;
  2838. for (int j = 0; j < lszCountArr.length; j++) {
  2839. if (lszCountArr[i] > count) {
  2840. break;
  2841. }
  2842. i = j;
  2843. }
  2844. area = length * width / 10000;
  2845. double tangPrice = 0;
  2846. double tangPriceArr[] = new double[4];
  2847. if (area <= 0.005) {
  2848. tangPriceArr = new double[]{135, 189, 287, 357, 595, 1190, 2380};
  2849. } else if (area <= 0.01) {
  2850. tangPriceArr = new double[]{135, 196, 315, 420, 700, 1400, 2800};
  2851. } else if (area <= 0.015) {
  2852. tangPriceArr = new double[]{140, 203, 343, 455, 763, 1526, 3052};
  2853. } else if (area <= 0.025) {
  2854. tangPriceArr = new double[]{161, 231, 392, 532, 889, 1778, 3556};
  2855. } else if (area <= 0.035) {
  2856. tangPriceArr = new double[]{189, 287, 469, 655.2, 1092, 2184, 4368};
  2857. } else {
  2858. tangPriceArr = new double[]{203, 315, 532, 749, 1253, 2506, 5012};
  2859. }
  2860. tangPrice = tangPriceArr[i] * 1.4 > 135 ? tangPriceArr[i] * 1.4 : 135;
  2861. pro.setPrice(Math.ceil(pro.getPrice() + tangPrice));
  2862. }
  2863. pro.setCount(count);
  2864. list.add(pro);
  2865. return list;
  2866. }
  2867. /**
  2868. * 常规刚古水纹超白不干胶计算
  2869. *
  2870. * @param number
  2871. * @param width
  2872. * @param length
  2873. * @param count
  2874. * @return
  2875. */
  2876. public List<Product> getGgSwPrice(double length, double width, int count, int number) {
  2877. double price = 0, area = 0;
  2878. List<Product> list = new ArrayList<Product>();
  2879. Product pro = null;
  2880. for (int i = 0; i < countArr.length; i++) {
  2881. if (countArr[i] < count || list.size() > 3) {
  2882. continue;
  2883. }
  2884. pro = new Product();
  2885. area = (length * width * countArr[i]) / 10000;
  2886. price = 70 * area * number;
  2887. pro.setPrice(Math.ceil(price > 80 ? price : 80));
  2888. pro.setCount(countArr[i]);
  2889. list.add(pro);
  2890. }
  2891. return list;
  2892. }
  2893. /**
  2894. * 帆布计算
  2895. *
  2896. * @param dto
  2897. * @param number
  2898. * @param width
  2899. * @param length
  2900. * @param count
  2901. * @param list
  2902. * @return
  2903. */
  2904. public List<Product> getFbPrice(Product dto, Integer number, Double width, Double length, int count, List<Product> list) {
  2905. Product pro = new Product();
  2906. double price = 0, dj = 0;
  2907. String[] craft = dto.getCraft();
  2908. if ("套餐".equals(dto.getStickerKind())) {
  2909. pro.setCount(count);
  2910. pro.setPrice(198.0);
  2911. list.add(pro);
  2912. } else {
  2913. double area = length * width * count / 10000;
  2914. double d = length * width * count / 10000;
  2915. if (length == 100 && width == 45) {
  2916. price = 40 * number * count;
  2917. if (craft != null) {
  2918. for (int i = 0; i < craft.length; i++) {
  2919. if (craft[i].equals("缝兜")) {
  2920. price += number * 10;
  2921. } else {
  2922. continue;
  2923. }
  2924. }
  2925. }
  2926. pro.setCount(count);
  2927. pro.setPrice(price);
  2928. list.add(pro);
  2929. }/*else if(length == 45 && width == 45){
  2930. price = 30 * number * count;
  2931. if(craft != null) {
  2932. for(int i = 0; i< craft.length; i++) {
  2933. if(craft[i].equals("缝兜")) {
  2934. price += number * 10;
  2935. }else {
  2936. continue;
  2937. }
  2938. }
  2939. }
  2940. pro.setPrice(price);
  2941. }*/ else {
  2942. if (d <= 0.2) {
  2943. area *= number;
  2944. }
  2945. if (area <= 0.2) {
  2946. price = 45;
  2947. } else if (area <= 0.5) {
  2948. dj = 80;
  2949. } else if (area <= 0.7) {
  2950. dj = 75;
  2951. } else if (area <= 0.9) {
  2952. dj = 70;
  2953. } else if (area <= 1) {
  2954. dj = 68;
  2955. } else if (area <= 1.9) {
  2956. dj = 65;
  2957. } else if (area <= 3) {
  2958. dj = 60;
  2959. } else {
  2960. dj = 55;
  2961. }
  2962. if (d > 0.2) {
  2963. price = area * dj * number;
  2964. } else {
  2965. if (area <= 0.2) {
  2966. price = 45;
  2967. } else {
  2968. price = area * dj;
  2969. }
  2970. }
  2971. if (craft != null) {
  2972. for (int i = 0; i < craft.length; i++) {
  2973. if (craft[i].equals("缝兜")) {
  2974. price += number * 10;
  2975. } else {
  2976. continue;
  2977. }
  2978. }
  2979. }
  2980. /*if(d > 3 && number > 1) {
  2981. price += (number-1) * 20;
  2982. }*/
  2983. price = Math.ceil(price > 45 ? price : 45);
  2984. double other_price = 0;
  2985. if (length * width < 40 * 50) {
  2986. int total = count * number;
  2987. for (int i = 1; i <= total; i++) {
  2988. other_price = getFBPirce(width, length, i, 1);
  2989. if (other_price > 45) {
  2990. price = 45 + (total - i + 1) * 6;
  2991. break;
  2992. }
  2993. }
  2994. }
  2995. pro.setPrice(price);
  2996. pro.setCount(count);
  2997. pro.setWeight(df.format(area * 0.28 * number));
  2998. list.add(pro);
  2999. }
  3000. }
  3001. return list;
  3002. }
  3003. public double getFBPirce(double length, double width, int count, int number) {
  3004. double area = length * width * count / 10000;
  3005. double d = length * width * count / 10000;
  3006. double price = 0, dj = 0;
  3007. if (length == 100 && width == 45) {
  3008. price = 40 * number * count;
  3009. } else {
  3010. if (d <= 0.2) {
  3011. area *= number;
  3012. }
  3013. if (area <= 0.2) {
  3014. price = 45;
  3015. } else if (area <= 0.5) {
  3016. dj = 80;
  3017. } else if (area <= 0.7) {
  3018. dj = 75;
  3019. } else if (area <= 0.9) {
  3020. dj = 70;
  3021. } else if (area <= 1) {
  3022. dj = 68;
  3023. } else if (area <= 1.9) {
  3024. dj = 65;
  3025. } else if (area <= 3) {
  3026. dj = 60;
  3027. } else {
  3028. dj = 55;
  3029. }
  3030. if (d > 0.2) {
  3031. price = area * dj * number;
  3032. } else {
  3033. if (area <= 0.2) {
  3034. price = 45;
  3035. } else {
  3036. price = area * dj;
  3037. }
  3038. }
  3039. price = Math.ceil(price > 45 ? price : 45);
  3040. }
  3041. return price;
  3042. }
  3043. public double getTestPrice(double length, double width, int count, int number,
  3044. double[] areas, double[] prices, double minPrice, double lastPrice) {
  3045. final int total = count * number;
  3046. for (int i = 1; i <= total; i++) {
  3047. double currentPrice = new PriceUtils().getOptimizedPrice(
  3048. length,
  3049. width,
  3050. i, // 当前数量
  3051. 1, // number 参数固定为1
  3052. areas,
  3053. prices,
  3054. minPrice,
  3055. lastPrice
  3056. );
  3057. if (currentPrice > minPrice) {
  3058. // 计算累加价格:基础价 + 剩余项*6
  3059. return minPrice + (total - i + 1) * 6;
  3060. }
  3061. }
  3062. // 未触发条件时返回基础最低价
  3063. return minPrice;
  3064. }
  3065. public double getOptimizedPrice(double length, double width, int count, int number,
  3066. double[] areas, double[] prices, double minPrice, double lastPrice) {
  3067. final double area = length * width * count / 10000;
  3068. final boolean isSmallArea = area <= 0.2;
  3069. // 计算调整后的面积值
  3070. final double adjustedArea = isSmallArea ? area * number : area;
  3071. // 确定单价基准
  3072. double unitPrice = isSmallArea ? minPrice : lastPrice;
  3073. if (!isSmallArea) {
  3074. for (int i = 0; i < areas.length; i++) {
  3075. if (adjustedArea <= areas[i]) {
  3076. unitPrice = prices[i];
  3077. break;
  3078. }
  3079. }
  3080. }
  3081. // 计算基础价格
  3082. double basePrice = isSmallArea ? minPrice : adjustedArea * unitPrice;
  3083. // 应用数量系数
  3084. double finalPrice = (area > 0.2) ? basePrice * number : basePrice;
  3085. // 确保最低价格并取整
  3086. return Math.ceil(Math.max(finalPrice, minPrice));
  3087. }
  3088. /**
  3089. * 亚克力计算
  3090. *
  3091. * @param dto
  3092. * @param number
  3093. * @param width
  3094. * @param length
  3095. * @param count
  3096. * @param list
  3097. * @return
  3098. */
  3099. public List<Product> getYklPrice(Product dto, Integer number, Double width, Double length, int count, List<
  3100. Product> list) {
  3101. Product pro = new Product();
  3102. double price = 0, dj = 0;
  3103. double l = 1200;
  3104. double w = 2400;
  3105. double area = length * width * count / 10000;
  3106. String kind = dto.getKind2Value();
  3107. length = length * 10;
  3108. width = width * 10;
  3109. if ((length > l || width > w) && (length > w || width > l))
  3110. return null;
  3111. // 一张大纸能做多少个此类尺寸的不干胶
  3112. double max = Math.max(Math.floor(l / length) * Math.floor(w / width),
  3113. Math.floor(l / width) * Math.floor(w / length));
  3114. // 报的数量需要多少张大纸
  3115. int num = (int) Math.ceil(count / max);
  3116. if (num > 1) {
  3117. if (kind.equals("1")) {
  3118. dj = 317;
  3119. } else if (kind.equals("2")) {
  3120. dj = 357;
  3121. } else if (kind.equals("3")) {
  3122. dj = 477;
  3123. } else if (kind.equals("4")) {
  3124. dj = 375;
  3125. } else {
  3126. dj = 415;
  3127. }
  3128. price = dj * 1.8 + dj * 1.5 * (num - 1);
  3129. pro.setPrice(Math.ceil(price));
  3130. } else {
  3131. if (area <= 0.02) {
  3132. dj = 1800;
  3133. } else if (area <= 0.03) {
  3134. dj = 1300;
  3135. } else if (area <= 0.05) {
  3136. dj = 1000;
  3137. } else if (area <= 0.06) {
  3138. dj = 900;
  3139. } else if (area <= 0.07) {
  3140. dj = 800;
  3141. } else if (area <= 0.08) {
  3142. dj = 700;
  3143. } else if (area <= 0.16) {
  3144. dj = 650;
  3145. } else if (area <= 0.25) {
  3146. dj = 550;
  3147. } else if (area <= 0.4) {
  3148. dj = 500;
  3149. } else if (area <= 0.5) {
  3150. dj = 400;
  3151. } else if (area <= 0.6) {
  3152. dj = 350;
  3153. } else if (area <= 0.8) {
  3154. dj = 300;
  3155. } else if (area <= 1) {
  3156. dj = 280;
  3157. } else if (area <= 2) {
  3158. dj = 250;
  3159. } else if (area <= 3) {
  3160. dj = 240;
  3161. } else if (area <= 4) {
  3162. dj = 230;
  3163. } else if (area <= 5) {
  3164. dj = 225;
  3165. }
  3166. price = area * dj * 2.5;
  3167. if (kind.equals("5")) {
  3168. price = price * 1.2;
  3169. } else {
  3170. if (kind.equals("2")) {
  3171. price = price * 1.1;
  3172. } else if (kind.equals("3")) {
  3173. price = price * 1.3;
  3174. }
  3175. }
  3176. }
  3177. double weight = 0;
  3178. if (kind.equals("1") || kind.equals("4")) {
  3179. weight = area * number * 2.26;
  3180. } else if (kind.equals("2") || kind.equals("5")) {
  3181. weight = area * number * 3.06;
  3182. } else if (kind.equals("3")) {
  3183. weight = area * number * 5.11;
  3184. }
  3185. pro.setPrice(Math.ceil(price > 50 ? price : 50));
  3186. pro.setCount(count);
  3187. pro.setWeight(String.valueOf(df.format(weight)));
  3188. list.add(pro);
  3189. return list;
  3190. }
  3191. /**
  3192. * 灯布计算
  3193. *
  3194. * @param width
  3195. * @param length
  3196. * @param count
  3197. * @param list
  3198. * @return
  3199. */
  3200. public List<Product> getDbPrice(String kind, Double width, Double length, int count, List<Product> list, int number) {
  3201. //11-550灯布 12-520灯布 13-550黑底灯布
  3202. Product pro = new Product();
  3203. double price = 0, dj = 0;
  3204. double area = length * width * count / 10000;
  3205. double[] areas = {};
  3206. double[] prices = {};
  3207. double last_price = 0;
  3208. double min_price = 0;
  3209. if ("11".equals(kind)) {
  3210. areas = new double[]{5, 10,};
  3211. prices = new double[]{20, 18};
  3212. last_price = 17;
  3213. min_price = 55 + 15;
  3214. } else if ("12".equals(kind)) {
  3215. areas = new double[]{5, 10,};
  3216. prices = new double[]{16, 12};
  3217. last_price = 10;
  3218. min_price = 50 + 15;
  3219. } else {
  3220. areas = new double[]{5, 10,};
  3221. prices = new double[]{24, 20};
  3222. last_price = 18;
  3223. min_price = 60 + 15;
  3224. }
  3225. if (width * length < 40 * 50) {
  3226. price = new PriceUtils().getTestPrice(length, width, count, number, areas, prices, min_price, last_price);
  3227. } else {
  3228. dj = last_price;
  3229. for (int i = 0; i < areas.length; i++) {
  3230. if (area <= areas[i]) {
  3231. dj = prices[i];
  3232. break;
  3233. }
  3234. }
  3235. price = Math.max(area * dj, min_price);
  3236. }
  3237. if (number > 1 && width * length >= 40 * 50) {
  3238. pro.setPrice(Math.ceil(price * number));
  3239. } else {
  3240. pro.setPrice(Math.ceil(price));
  3241. }
  3242. pro.setWeight(String.valueOf(df.format(width * length * 0.55 / 10000)));
  3243. pro.setCount(count);
  3244. list.add(pro);
  3245. return list;
  3246. }
  3247. /**
  3248. * 串旗计算
  3249. *
  3250. * @param width
  3251. * @param length
  3252. * @param count
  3253. * @param num
  3254. * @param list
  3255. * @return
  3256. */
  3257. public List<Product> getCqPrice(Double width, Double length, int count, int num, List<Product> list) {
  3258. Product pro = new Product();
  3259. double price = 0, dj = 0;
  3260. double area = (width * length) / 10000;
  3261. if (area <= 0.042) {
  3262. price = 50 + 5 * count * num;
  3263. } else if (area <= 0.1125) {
  3264. dj = 120;
  3265. } else if (area <= 0.2) {
  3266. dj = 110;
  3267. } else if (area <= 0.5) {
  3268. dj = 100;
  3269. } else if (area <= 0.7) {
  3270. dj = 95;
  3271. } else if (area <= 0.9) {
  3272. dj = 90;
  3273. } else if (area <= 1) {
  3274. dj = 85;
  3275. } else {
  3276. dj = 80;
  3277. }
  3278. if (area > 0.042) {
  3279. price = dj * area * count * num;
  3280. }
  3281. price = Math.ceil(price > 50 ? price : 50);
  3282. double wei = area * 0.29 * count * num;
  3283. pro.setPrice(price);
  3284. pro.setCount(count);
  3285. pro.setWeight(df.format(wei));
  3286. list.add(pro);
  3287. return list;
  3288. }
  3289. /**
  3290. * 桌布
  3291. *
  3292. * @param length
  3293. * @param width
  3294. * @param count
  3295. * @param number
  3296. * @return
  3297. */
  3298. public List<Product> getTableClothPrice(Double length, Double width, int count, Integer
  3299. number, List<Product> priceList) {
  3300. double price = 0, dj = 0;
  3301. if (length <= 0.8 && width <= 0.8) {
  3302. dj = 77;
  3303. } else if ((length <= 0.8 && width <= 1.6) || (length <= 1.6 && width <= 0.8)) {
  3304. dj = 43;
  3305. } else if ((length <= 1.2 && width <= 1.6) || (length <= 1.6 && width <= 1.2)) {
  3306. dj = 29;
  3307. } else if ((length <= 1.4 && width <= 1.6) || (length <= 1.6 && width <= 1.4)) {
  3308. dj = 28;
  3309. } else if ((length <= 1.6 && width <= 2.0) || (length <= 2.0 && width <= 1.6)) {
  3310. dj = 27;
  3311. }/*else if((length <= 1.8 && width <= 2.0) || (length <= 2.0 && width <= 1.8)) {
  3312. dj = 26;
  3313. }else if((length <= 1.6 && width <= 2.5) || (length <= 2.5 && width <= 1.6)) {
  3314. dj = 26;
  3315. }*/ else {
  3316. dj = 26;
  3317. }
  3318. Product pro = new Product();
  3319. List<Product> list = new ArrayList<Product>();
  3320. price = length * width * count * number * dj;
  3321. pro.setCount(count);
  3322. pro.setPrice(Math.ceil(price > 50 ? price : 50));
  3323. pro.setWeight(df.format(0.3 * length * width * count * number));
  3324. list.add(pro);
  3325. return list;
  3326. }
  3327. public List<Product> getShkPrice(String size, int count, Integer number) {
  3328. int[] countArr = {200, 500, 1000, 2000, 5000, 10000};
  3329. double[] priceArr = {};
  3330. List<Product> list = new ArrayList<Product>();
  3331. Product pro = new Product();
  3332. if (size.equals("9*5.4")) {
  3333. priceArr = new double[]{25.0, 26.0, 27.0, 50.0, 110.0, 200.0};
  3334. } else if (size.equals("9*11")) {
  3335. priceArr = new double[]{27.0, 37.0, 45.0, 80.0, 210.0, 400.0};
  3336. } else if (size.equals("8*11")) {
  3337. priceArr = new double[]{27.0, 37.0, 45.0, 80.0, 210.0, 400.0};
  3338. } else if (size.equals("7*14")) {
  3339. priceArr = new double[]{27.0, 37.0, 45.0, 80.0, 210.0, 400.0};
  3340. } else if (size.equals("8*14")) {
  3341. priceArr = new double[]{44.0, 46.0, 72.0, 120.0, 260.0, 500.0};
  3342. } else if (size.equals("10*15")) {
  3343. priceArr = new double[]{44.0, 66.0, 88.0, 150.0, 350.0, 600.0};
  3344. } else if (size.equals("11*18")) {
  3345. priceArr = new double[]{61.0, 83.0, 94.0, 160.0, 400.0, 650.0};
  3346. } else if (size.equals("9*9")) {
  3347. priceArr = new double[]{30.0, 41.0, 44.0, 75.0, 200.0, 400.0};
  3348. } else {
  3349. priceArr = new double[]{44.0, 66.0, 88.0, 120.0, 260.0, 500.0};
  3350. }
  3351. for (int i = 0; i < countArr.length; i++) {
  3352. if (countArr[i] < count) {
  3353. continue;
  3354. }
  3355. if (list.size() > 3) {
  3356. break;
  3357. }
  3358. pro = new Product();
  3359. pro.setCount(countArr[i]);
  3360. pro.setPrice(Math.ceil(number * priceArr[i]));
  3361. list.add(pro);
  3362. }
  3363. return list;
  3364. }
  3365. public List<Product> getSdkPrice(int count, Integer number) {
  3366. int[] countArr = {50, 100, 500, 1000, 2000, 5000, 10000};
  3367. double[] priceArr = new double[]{339, 599, 1800.0, 3000.0, 4800.0, 8000.0, 15000.0};
  3368. Product pro = new Product();
  3369. List<Product> list = new ArrayList<Product>();
  3370. for (int i = 0; i < countArr.length; i++) {
  3371. if (countArr[i] < count) {
  3372. continue;
  3373. }
  3374. if (list.size() > 3) {
  3375. break;
  3376. }
  3377. pro = new Product();
  3378. pro.setCount(countArr[i]);
  3379. pro.setPrice(Math.ceil(number * priceArr[i]));
  3380. list.add(pro);
  3381. }
  3382. return list;
  3383. }
  3384. public double TableNextPrice(double area, double[] price_list, double[] areas) {
  3385. double price = 0;
  3386. double last_price = 0;
  3387. for (int i = 0; i < areas.length; i++) {
  3388. if (area <= areas[i]) {
  3389. price = price_list[i];
  3390. break;
  3391. }
  3392. last_price = price_list[i];
  3393. }
  3394. return price == 0 ? last_price : price;
  3395. }
  3396. public double TablePrice(double area, int[] price_list, double[] areas) {
  3397. double price = 0;
  3398. int startIndex = 0;
  3399. int endIndex = 0;
  3400. for (int i = 0; i < areas.length; i++) {
  3401. if (area > areas[i]) {
  3402. startIndex = endIndex;
  3403. endIndex = Math.min(i + 1, areas.length - 1);
  3404. }
  3405. }
  3406. if (startIndex == endIndex && startIndex == 0) {
  3407. price = price_list[endIndex];
  3408. } else if (startIndex == endIndex) {
  3409. price = (price_list[endIndex] / areas[endIndex]) * area;
  3410. } else {
  3411. price = ((areas[endIndex] - area) / (areas[endIndex] - areas[startIndex])) * price_list[startIndex] + ((area - areas[startIndex]) / (areas[endIndex] - areas[startIndex])) * price_list[endIndex];
  3412. }
  3413. return price;
  3414. }
  3415. public static double TableDoublePrice(double area, double[] price_list, double[] areas) {
  3416. double price = 0;
  3417. int startIndex = 0;
  3418. int endIndex = 0;
  3419. for (int i = 0; i < areas.length; i++) {
  3420. if (area > areas[i]) {
  3421. startIndex = endIndex;
  3422. endIndex = Math.min(i + 1, areas.length - 1);
  3423. }
  3424. }
  3425. if (startIndex == endIndex && startIndex == 0) {
  3426. price = price_list[endIndex];
  3427. } else if (startIndex == endIndex) {
  3428. price = (price_list[endIndex] / areas[endIndex]) * area;
  3429. } else {
  3430. price = ((areas[endIndex] - area) / (areas[endIndex] - areas[startIndex])) * price_list[startIndex] + ((area - areas[startIndex]) / (areas[endIndex] - areas[startIndex])) * price_list[endIndex];
  3431. }
  3432. return price;
  3433. }
  3434. public static double TableUnitPrice(double area, int[] price_list, double[] areas, double last_price) {
  3435. double price = 0;
  3436. int startIndex = 0;
  3437. int endIndex = 0;
  3438. boolean islast = false;
  3439. for (int i = 0; i < areas.length; i++) {
  3440. if (area > areas[i]) {
  3441. startIndex = endIndex;
  3442. endIndex = Math.min(i + 1, areas.length - 1);
  3443. }
  3444. if (area == areas[i]) {
  3445. endIndex = startIndex = i;
  3446. }
  3447. if (area > areas[i] && i == areas.length - 1) {
  3448. islast = true;
  3449. }
  3450. }
  3451. if (startIndex == endIndex && startIndex == 0) {
  3452. price = price_list[endIndex] * area;
  3453. } else if (startIndex == endIndex) {
  3454. price = (price_list[endIndex] * areas[endIndex] / areas[endIndex]) * area;
  3455. } else {
  3456. double end_price = price_list[endIndex] * areas[endIndex];
  3457. double start_price = price_list[startIndex] * areas[startIndex];
  3458. price = ((areas[endIndex] - area) / (areas[endIndex] - areas[startIndex])) * start_price + ((area - areas[startIndex]) / (areas[endIndex] - areas[startIndex])) * end_price;
  3459. }
  3460. price = islast ? last_price * area : price;
  3461. return Math.ceil(price);
  3462. }
  3463. public double CalculatePrice(List<String> craft_list, double count, int coNumber, double countNum, double area) {
  3464. if (craft_list.contains("烫画")) {
  3465. double basePrice = 0;
  3466. area = area / 10000;
  3467. if (area < 7.5) {
  3468. basePrice = 90;
  3469. } else {
  3470. basePrice = 70;
  3471. }
  3472. return Math.max(Math.ceil(area * basePrice), 50);
  3473. }
  3474. double price = 0;
  3475. if (craft_list.contains("冷转印")) {
  3476. double banfei = 200;
  3477. if (countNum > 1) {
  3478. price = 200 * countNum;
  3479. banfei = 0;
  3480. count = Math.abs(count - countNum);
  3481. }
  3482. if (count > 0) {
  3483. if (count <= 5) {
  3484. price += 200;
  3485. } else if (count < 75) {
  3486. price += 14 * count + banfei;
  3487. } else {
  3488. if (count < 89) {
  3489. count = 89;
  3490. }
  3491. price += 14 * count;
  3492. }
  3493. }
  3494. price = price + (coNumber - 1) * 100;
  3495. }
  3496. return Math.ceil(price);
  3497. }
  3498. public static List<Product> getYinBaiPrice(List<Product> productList, double width, double length) {
  3499. double miniprice = 50;
  3500. double miniarea = 9;
  3501. //cm
  3502. double[] prices = {7.2, 4.6, 4, 2.8, 2.5, 2.24, 2.02, 1.92, 1.63, 1.56, 1.34, 1.26, 1.25, 1.04, 0.86, 0.64};
  3503. double[] areas = {9, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 140, 210, 420};
  3504. double area = width * length;
  3505. double craft_price = 0;
  3506. if (area < miniarea) {
  3507. craft_price = miniprice;
  3508. } else {
  3509. for (int i = 1; i < areas.length; i++) {
  3510. if (area < areas[i]) {
  3511. craft_price = prices[i - 1] * area;
  3512. break;
  3513. }
  3514. }
  3515. if (craft_price == 0) {
  3516. craft_price = prices[prices.length - 1] * area;
  3517. }
  3518. }
  3519. for (Product pro : productList) {
  3520. pro.setPrice(Math.ceil(pro.getPrice() + craft_price));
  3521. }
  3522. return productList;
  3523. }
  3524. public FunReturnVo getBagTagPrice(String kind2Value, String kindValue) {
  3525. FunReturnVo vo = new FunReturnVo();
  3526. if ("1".equals(kind2Value)) {
  3527. if ("0".equals(kindValue)) {
  3528. vo.setBase_price(new double[]{420, 627, 1056, 1980, 2920, 4785, 9240});
  3529. }
  3530. if ("1".equals(kindValue)) {
  3531. vo.setBase_price(new double[]{726, 1073, 1914, 2723, 4290, 7920});
  3532. }
  3533. vo.setLength(25.0);
  3534. vo.setHeight(23.0);
  3535. vo.setWidth(15.0);
  3536. }
  3537. if ("2".equals(kind2Value)) {
  3538. if ("0".equals(kindValue)) {
  3539. vo.setBase_price(new double[]{480, 644, 1089, 2046, 2970, 4785, 9240});
  3540. }
  3541. if ("1".equals(kindValue)) {
  3542. vo.setBase_price(new double[]{743, 1089, 1947, 2772, 4372, 8085});
  3543. }
  3544. vo.setLength(24.0);
  3545. vo.setHeight(26.5);
  3546. vo.setWidth(14.0);
  3547. }
  3548. if ("3".equals(kind2Value)) {
  3549. if ("0".equals(kindValue)) {
  3550. vo.setBase_price(new double[]{480, 730, 1320, 2330, 3300, 5280, 9800});
  3551. }
  3552. if ("1".equals(kindValue)) {
  3553. vo.setBase_price(new double[]{770, 1200, 2380, 3400, 5300, 9500});
  3554. }
  3555. vo.setLength(28.0);
  3556. vo.setHeight(26.5);
  3557. vo.setWidth(15.0);
  3558. }
  3559. if ("4".equals(kind2Value)) {
  3560. if ("0".equals(kindValue)) {
  3561. vo.setBase_price(new double[]{420, 576, 896, 1600, 2304, 3760, 7040});
  3562. }
  3563. if ("1".equals(kindValue)) {
  3564. vo.setBase_price(new double[]{576, 880, 1568, 2256, 3600, 6880});
  3565. }
  3566. vo.setLength(13.0);
  3567. vo.setHeight(16.0);
  3568. vo.setWidth(8.0);
  3569. }
  3570. if ("5".equals(kind2Value)) {
  3571. if ("0".equals(kindValue)) {
  3572. vo.setBase_price(new double[]{450, 733, 980, 1700, 2500, 4000, 7600});
  3573. }
  3574. if ("1".equals(kindValue)) {
  3575. vo.setBase_price(new double[]{651, 890, 1480, 2150, 3450, 6625});
  3576. }
  3577. vo.setLength(11.0);
  3578. vo.setHeight(25.0);
  3579. vo.setWidth(9.5);
  3580. }
  3581. if ("6".equals(kind2Value)) {
  3582. if ("0".equals(kindValue)) {
  3583. vo.setBase_price(new double[]{390, 658, 1030, 1800, 2600, 4200, 8350});
  3584. }
  3585. if ("1".equals(kindValue)) {
  3586. vo.setBase_price(new double[]{593, 1000, 1720, 2500, 4000, 7800});
  3587. }
  3588. vo.setLength(16.0);
  3589. vo.setHeight(23.0);
  3590. vo.setWidth(8.0);
  3591. }
  3592. if ("7".equals(kind2Value)) {
  3593. if ("0".equals(kindValue)) {
  3594. vo.setBase_price(new double[]{320, 520, 860, 1550, 2240, 3750, 6900});
  3595. }
  3596. if ("1".equals(kindValue)) {
  3597. vo.setBase_price(new double[]{500, 890, 1530, 2130, 3430, 6280});
  3598. }
  3599. vo.setLength(21.0);
  3600. vo.setHeight(27.0);
  3601. vo.setWidth(11.0);
  3602. }
  3603. if ("8".equals(kind2Value)) {
  3604. if ("0".equals(kindValue)) {
  3605. vo.setBase_price(new double[]{400, 540, 1100, 1640, 2400, 3950, 7380});
  3606. }
  3607. if ("1".equals(kindValue)) {
  3608. vo.setBase_price(new double[]{560, 980, 1640, 2230, 3600, 6580});
  3609. }
  3610. vo.setLength(21.0);
  3611. vo.setHeight(26.5);
  3612. vo.setWidth(14.0);
  3613. }
  3614. if ("9".equals(kind2Value)) {
  3615. if ("0".equals(kindValue)) {
  3616. vo.setBase_price(new double[]{500, 760, 1200, 2260, 3300, 5200, 9910});
  3617. }
  3618. if ("1".equals(kindValue)) {
  3619. vo.setBase_price(new double[]{700, 1100, 1920, 2800, 4400, 8500});
  3620. }
  3621. vo.setLength(25.0);
  3622. vo.setHeight(27.0);
  3623. vo.setWidth(17.0);
  3624. }
  3625. if ("10".equals(kind2Value)) {
  3626. if ("0".equals(kindValue)) {
  3627. vo.setBase_price(new double[]{600, 970, 1450, 2480, 3600, 5450, 9380});
  3628. }
  3629. if ("1".equals(kindValue)) {
  3630. vo.setBase_price(new double[]{910, 1350, 2300, 3400, 5100, 8600});
  3631. }
  3632. vo.setLength(32.0);
  3633. vo.setHeight(27.0);
  3634. vo.setWidth(11.0);
  3635. }
  3636. if ("11".equals(kind2Value)) {
  3637. if ("0".equals(kindValue)) {
  3638. vo.setBase_price(new double[]{1192, 1600, 2800, 4100, 6500, 11280});
  3639. }
  3640. if ("1".equals(kindValue)) {
  3641. vo.setBase_price(new double[]{920, 1350, 2250, 3500, 6350, 10800});
  3642. }
  3643. vo.setLength(32.0);
  3644. vo.setHeight(39.0);
  3645. vo.setWidth(11.0);
  3646. }
  3647. if ("12".equals(kind2Value)) {
  3648. if ("0".equals(kindValue)) {
  3649. vo.setBase_price(new double[]{1419, 2013, 3234, 4800, 7672, 11385});
  3650. }
  3651. if ("1".equals(kindValue)) {
  3652. vo.setBase_price(new double[]{1338, 1898, 3069, 4500, 7260, 10395});
  3653. }
  3654. vo.setLength(25.0);
  3655. vo.setHeight(32.0);
  3656. vo.setWidth(13.0);
  3657. }
  3658. if ("31".equals(kind2Value)) {
  3659. if ("0".equals(kindValue)) {
  3660. vo.setBase_price(new double[]{528, 875, 1650, 2426, 3878, 7590});
  3661. }
  3662. if ("1".equals(kindValue)) {
  3663. vo.setBase_price(new double[]{680, 957, 1716, 2475, 3878, 7095});
  3664. }
  3665. vo.setLength(23.0);
  3666. vo.setHeight(21.0);
  3667. vo.setWidth(15.0);
  3668. }
  3669. if ("37".equals(kind2Value)) {
  3670. if ("0".equals(kindValue)) {
  3671. vo.setBase_price(new double[]{600, 990, 1848, 2723, 4455, 8580});
  3672. }
  3673. if ("1".equals(kindValue)) {
  3674. vo.setBase_price(new double[]{710, 1040, 1848, 2624, 4125, 7755});
  3675. }
  3676. vo.setLength(23.0);
  3677. vo.setHeight(21.0);
  3678. vo.setWidth(11.0);
  3679. }
  3680. if ("38".equals(kind2Value)) {
  3681. if ("0".equals(kindValue)) {
  3682. vo.setBase_price(new double[]{600, 924, 1650, 2376, 3878, 7260});
  3683. }
  3684. if ("1".equals(kindValue)) {
  3685. vo.setBase_price(new double[]{600, 908, 1617, 2328, 3713, 7095});
  3686. }
  3687. vo.setLength(21.0);
  3688. vo.setHeight(21.0);
  3689. vo.setWidth(14.0);
  3690. }
  3691. if ("62".equals(kind2Value)) {
  3692. if ("0".equals(kindValue)) {
  3693. vo.setBase_price(new double[]{578, 975, 1848, 2673, 5360, 10240});
  3694. }
  3695. if ("1".equals(kindValue)) {
  3696. vo.setBase_price(new double[]{693, 1008, 1749, 2475, 4960, 9600});
  3697. }
  3698. vo.setLength(24.0);
  3699. vo.setHeight(32.0);
  3700. vo.setWidth(14.0);
  3701. }
  3702. return vo;
  3703. }
  3704. }