PriceUtils.java 148 KB

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