Compare commits

...

161 Commits

Author SHA1 Message Date
zyy 59119cab4c 新增抠图 2026-06-12 17:02:13 +08:00
zyy e795cbe1d9 修改特种纸名片模切加个 2026-06-12 14:52:10 +08:00
zyy 71c7722514 修改特种纸印刷颜色 2026-06-12 10:36:05 +08:00
zyy 3f08207873 修改暖心贴 2026-06-09 11:17:40 +08:00
zyy 80d71369b5 修改方巾纸价格 2026-06-08 11:07:37 +08:00
zyy 3e549c1856 修改亚克力设计费 2026-06-06 08:39:35 +08:00
zyy 62dfd679b0 修改特种纸名片模切价格 2026-05-30 10:20:30 +08:00
zyy 0c51492dc6 新增宠物婚礼 2026-05-28 14:43:18 +08:00
zyy 4c9befc831 修改扇子尺寸 2026-05-28 10:03:46 +08:00
zyy 2a6a05fd87 修改冰箱贴价格 2026-05-27 11:11:57 +08:00
zyy 8992a51c7f 修改冰箱贴价格 2026-05-21 15:02:20 +08:00
zyy 99067b19d1 修改日志 2026-05-20 17:16:51 +08:00
zyy 0d6813c501 修改页面推荐语 2026-05-20 14:50:21 +08:00
zyy 9c9f127df6 修改淘宝价格 2026-05-20 11:01:49 +08:00
zyy 6795b6f4ff 修改亚克力接口 2026-05-19 14:34:20 +08:00
zyy 4a46014f91 修改白胶价格 2026-05-15 10:33:50 +08:00
zyy e8a0669db7 新增opp袋尺寸 2026-05-14 12:03:56 +08:00
zyy c6a6c2c682 修改uv重量 2026-05-12 11:13:26 +08:00
zyy 162c230bf4 修改海报价格 2026-05-09 14:50:53 +08:00
zyy 4cdabba8a0 新增金属标颜色 2026-05-08 10:21:17 +08:00
zyy ab1e443e4b 新增金属标颜色 2026-05-07 15:44:46 +08:00
zyy 03d7d8808e 新增躺椅,修改天幕定制衫 2026-05-04 15:09:03 +08:00
zyy 44934a92c7 修改天幕 2026-05-01 10:07:38 +08:00
zyy 3abc4938de 修改天幕 2026-05-01 10:07:21 +08:00
zyy 451a226990 新增不干胶材质 2026-04-30 15:07:01 +08:00
zyy fe42ba31a1 新增盛大报价 2026-04-29 14:35:25 +08:00
zyy 4eeb45b64c 修改号码牌。限制彩色信封尺寸 2026-04-27 14:51:51 +08:00
zyy 8ea3cc18c9 修改淋膜纸加个 2026-04-24 15:40:07 +08:00
zyy 3da5fa97a8 新增卡片工艺 2026-04-23 15:13:55 +08:00
zyy 5a713e8160 新增redis 2026-04-20 23:32:52 +08:00
zyy fea143f0e1 修改卡片工艺 2026-04-17 14:45:36 +08:00
zyy 929ee2b0b1 宠物uv新增内部裁切 2026-04-16 08:37:29 +08:00
zyy 1d4cea0b9a 新增pvc卡片材质 2026-04-13 16:22:19 +08:00
zyy 2012ad0a80 现在银平光吃吃 2026-04-10 14:49:51 +08:00
zyy af49257000 素芸新增打孔工艺 2026-04-08 16:05:30 +08:00
zyy 6b9c9feefb 新增流苏工艺 2026-04-08 15:36:24 +08:00
zyy ee17035e69 新增冰箱贴雕刻工艺 2026-04-06 16:57:01 +08:00
zyy b1d63d3087 新增信封材质 2026-04-02 15:42:06 +08:00
zyy 64e2c7062d 帆布新增旗杆 2026-03-31 14:37:41 +08:00
zyy f8374b1be3 修改牙签款数价格 2026-03-30 14:06:02 +08:00
zyy 7b2f033fe6 新增伸缩手拉旗,新增熨斗,限制鼠标垫尺寸 2026-03-28 11:47:08 +08:00
zyy b2d74bf0f3 修改插旗价格,修改手提袋烫金价格 2026-03-27 15:37:57 +08:00
zyy 8dbc3653a1 修改哑金不干胶白墨,修改包装纸款数啥价格 2026-03-26 17:44:41 +08:00
zyy 2733b250ad 新增素云工艺 2026-03-26 11:07:45 +08:00
zyy ff9acb4bfb 修改pvc不干胶工艺价格 2026-03-26 08:43:56 +08:00
zyy 88c810f37f 新增数码插旗 2026-03-25 14:31:40 +08:00
zyy 85888d79f8 修改宠物uv起步价。修改手提袋尺寸 2026-03-23 18:01:36 +08:00
zyy fd44d8f3e3 修改多种价格,新增多种工艺 2026-03-21 15:11:27 +08:00
zyy 928a247c10 新增特种纸工艺 2026-03-20 08:51:16 +08:00
zyy 03c70c9598 新增撕撕乐 2026-03-15 15:34:36 +08:00
zyy d6d264e86e 贺卡新增内部模切 2026-03-13 14:49:06 +08:00
zyy cdb2c65ce5 新增包装纸 2026-03-09 16:43:16 +08:00
zyy 83adacb25d 新增包装纸 2026-03-09 16:43:06 +08:00
zyy fc44f05cd6 修改部分商品价格 2026-03-09 08:44:36 +08:00
zyy 6352b8eab0 新增素云材质 2026-03-05 10:31:41 +08:00
zyy b66c025cf8 修改提示 2026-03-04 14:45:47 +08:00
zyy a204336b58 修改烫画价格 2026-02-22 16:01:59 +08:00
zyy 1929ebbfa3 修改冷转印价格 2026-02-03 14:48:24 +08:00
zyy 8de1785270 修改特种子打码 2026-02-02 14:26:31 +08:00
zyy 9e4cd87a59 修改卡片打码,修改方巾尺寸 2026-01-26 10:13:45 +08:00
zyy 614388da7f 修改海报价格,修改滴塑价格 2026-01-23 08:56:31 +08:00
zyy 95b8905ff4 修改硫酸纸工艺价格 2026-01-21 16:45:51 +08:00
zyy 694f46ba75 新增打码个数 2026-01-20 14:25:20 +08:00
zyy 01d022ec76 新增香薰卡工艺,新增插旗材质,新增刮刮卡烫金,新增优惠卷打码工艺,新增插卡工艺,修改外卖盒,修改贺卡价格,修改不干胶价格 2026-01-19 15:57:57 +08:00
zyy 6bb12bfc6a 修改方巾纸数量 2026-01-13 17:48:01 +08:00
zyy 79c764ad78 新增淋膜纸尺寸 2026-01-12 16:38:03 +08:00
zyy ba14bb9f0d 修改金属徽章价格 2026-01-08 14:05:19 +08:00
zyy ba74fd7beb 修改吊牌工艺价格 2026-01-06 14:19:18 +08:00
zyy f4319613e4 新增电线胶材质 2026-01-04 14:18:20 +08:00
zyy 4b1a74bf13 修改冰箱贴价格 2025-12-29 11:51:06 +08:00
zyy 2099f32634 新增电线胶 2025-12-27 10:42:00 +08:00
zyy 8e1d6b5185 新增挂画 2025-12-26 17:40:15 +08:00
zyy d622d5b937 新增纸碗,新增腰封工艺,新增不干胶工艺 2025-12-20 16:33:02 +08:00
zyy de99f53f4b 香薰卡新增配件 2025-12-19 10:10:41 +08:00
zyy 23465fcf3b 新增冰箱贴背卡工艺 2025-12-19 09:54:38 +08:00
zyy 493749f355 edit 2025-12-18 14:55:32 +08:00
zyy 4fb8007f22 新增手提袋 2025-12-16 16:04:42 +08:00
zyy b6c8ccb6cc 修改香薰卡尺寸,新增杯垫材质 2025-12-16 10:12:15 +08:00
zyy 69da79dd9c 修改贺卡打开起步价。修改名片工艺 2025-12-15 14:43:32 +08:00
zyy d7a0917083 修改香薰卡、冰箱贴尺寸 2025-12-15 10:36:32 +08:00
zyy 1c7a3def12 修改香薰卡价格 2025-12-13 16:36:35 +08:00
zyy cb734e7d8f 新增产品重量 2025-12-10 14:28:40 +08:00
zyy d24a4b9ee9 新增手环价格 2025-12-05 16:00:27 +08:00
zyy b5cb6cd1b0 新增鼠标垫 2025-12-05 09:51:29 +08:00
zyy d7001df657 修改pVc价格 2025-12-03 15:35:11 +08:00
zyy a306bca245 修改帆布袋,外卖盒。方巾 2025-12-01 16:53:15 +08:00
zyy 1633d9b102 新增帆布袋,外卖盒,方巾 2025-11-29 09:04:06 +08:00
zyy 6ce28bae01 新增金属徽章工艺 2025-11-27 10:36:52 +08:00
zyy 58a1eecc62 修改插旗价格,修改腰封价格 2025-11-26 10:32:17 +08:00
zyy 028cc4103a 修改滴塑几个 2025-11-24 10:59:28 +08:00
zyy 2b7203a04a 修改条幅提示 2025-11-19 16:05:41 +08:00
zyy 30af805f2f 新增冰箱贴 2025-11-19 16:05:22 +08:00
zyy 32310477d6 新增银平光价格 2025-11-18 14:32:53 +08:00
zyy f74e72958f 修改班旗工艺 2025-11-18 14:04:05 +08:00
zyy c3709a00dc 修改腰封工艺 2025-11-17 10:08:57 +08:00
zyy 44060ca68a 新增金属微章 2025-11-14 17:24:46 +08:00
zyy 3700a33cb8 新增特种子工艺 2025-11-13 09:50:26 +08:00
zyy 3ffbfdee17 修改种子纸工艺 2025-11-13 09:49:56 +08:00
zyy 6ddf69dfc8 新增香薰卡 2025-11-13 09:49:27 +08:00
zyy 31ed14ceed 新增UV工艺 2025-11-12 09:59:06 +08:00
zyy f2bd6f368c 修改压痕工艺价格 2025-11-12 09:21:16 +08:00
zyy fc23b9d62e 修改uv烫金工艺 2025-11-07 10:39:04 +08:00
zyy 65788e1df5 修改oss 2025-11-07 10:38:42 +08:00
zyy 0bcd250a9a 删除刮刮卡烫金工艺 2025-11-04 10:56:18 +08:00
zyy 3e8d220a9c 修改UV烫金工艺 2025-11-04 10:56:02 +08:00
zyy 73eb1bc88a 新增印白工艺 2025-11-01 16:18:41 +08:00
zyy 4b0e45b1c6 新增杯垫镭射银工艺 2025-11-01 10:21:51 +08:00
zyy 8fc6cdcd8b 修改uv烫金工艺价格 2025-10-31 10:13:05 +08:00
zyy 4a7fd6e2cc edit 2025-10-30 15:42:25 +08:00
zyy 9480d75507 新增UV工艺 2025-10-30 14:39:28 +08:00
zyy 653e1bd831 修改特种纸名片模切价格 2025-10-30 14:39:10 +08:00
zyy 842638ac67 新增激凸工艺价格 2025-10-27 14:35:28 +08:00
zyy ed43cff130 新增双面烫金价格 2025-10-27 14:35:13 +08:00
zyy 2037bdf57d 修改一次性纸杯价格 2025-10-23 09:45:06 +08:00
zyy 65d1b08293 修改腰封压痕价格,修改冷转印无法选择 2025-10-22 15:06:16 +08:00
zyy d77e26f423 修改特种纸名片模切价格 2025-10-21 17:27:11 +08:00
zyy f3eaf66d56 修改淋膜价格 2025-10-20 10:08:18 +08:00
zyy 46eaf4f726 修改卡片300克打孔工艺 2025-10-16 15:54:51 +08:00
zyy 851dfb9f53 修改UV工艺价格 2025-10-16 10:13:42 +08:00
zyy e48066dd0e 删除无用扇,修改pet,修改插卡 2025-10-15 15:30:05 +08:00
zyy 0ab421eb9c 修改卡片选择限制 2025-10-15 09:37:00 +08:00
zyy 8207377e6e 新增铜版纸汤镭射银价格 2025-10-13 10:52:24 +08:00
zyy 2729347d90 edit 2025-10-10 14:18:51 +08:00
zyy 639d1c27ef 3:新增贺卡工艺配件尺寸价格4:新增餐垫纸工艺5:新增产品 2025-09-29 16:51:09 +08:00
zyy 73e2d3777b 修改PET工艺价格 2025-09-29 11:45:06 +08:00
zyy 8f649d572e 修改卡片尺寸价格 2025-09-29 09:11:57 +08:00
zyy 207221a621 胶带新增材质 2025-09-26 10:38:00 +08:00
zyy 41b4f5fba5 修改卡片价格 2025-09-25 14:38:34 +08:00
zyy 662d2b010e 修改特种纸价格 2025-09-24 14:55:31 +08:00
zyy b0f83939d6 新增手提袋烫金 2025-09-20 17:27:04 +08:00
zyy 84970ee98f 修改卡片圆角价格 2025-09-18 09:52:15 +08:00
zyy 9c2b25287a 修改卡片价格 2025-09-17 14:26:24 +08:00
zyy f9f42680be 裱冷板新增配件 2025-09-16 11:50:52 +08:00
zyy fc8ac0f2ce 新增刮刮卡打码价格 2025-09-15 15:13:40 +08:00
zyy f6c39a234a 修改车贴名称 2025-09-15 08:50:20 +08:00
zyy dc964b8cd7 修改冷转印价格 2025-09-11 16:10:08 +08:00
zyy b40da3a612 删除刮刮卡限制,修改车贴材质名称 2025-09-11 11:06:12 +08:00
zyy f0024fd1b7 修改uv工艺价格 2025-09-10 16:56:49 +08:00
zyy fbc6db905f 新增材质重量栏目 2025-09-10 10:46:29 +08:00
zyy 05c2a4b66a 硫酸纸新增模切 2025-09-08 15:46:02 +08:00
zyy efa81c4d2c 胶带重量 2025-09-08 09:01:32 +08:00
zyy a4de210c79 修改PDF样式 2025-09-05 15:33:06 +08:00
zyy c59a113add 修改BUG 2025-09-05 14:41:38 +08:00
zyy 520466e7dd 新增在线查看PDF 2025-09-05 14:41:05 +08:00
zyy ce095f4b7f 修改少数量卡片价格 2025-09-05 14:35:01 +08:00
zyy 656c3e2db6 新增在线查看PDF 2025-09-05 14:30:38 +08:00
zyy ac80841ff3 修改卡片腰封工艺,新增栏目 2025-09-05 09:19:27 +08:00
zyy 12a237bf53 修改不干胶工艺价格 2025-09-02 15:26:12 +08:00
zyy 08d4115ff5 edi 2025-09-02 14:28:58 +08:00
zyy ab9ab9ca8d 新增产品,新增uv工艺 2025-09-02 14:24:41 +08:00
zyy 58c7ea9e36 新增质检报告栏目 2025-09-01 10:06:51 +08:00
zyy 20e61c01fd 修改胶带数量 2025-08-29 16:02:45 +08:00
zyy e9c03666dc 修改页面显示 2025-08-29 11:49:11 +08:00
zyy 17f6c8bdaa 新增页面 2025-08-29 10:16:48 +08:00
zyy 05b89aba22 修改卡片部分工艺价格 2025-08-28 16:27:13 +08:00
zyy 114d8f1449 修改卡片 2025-08-28 10:36:25 +08:00
zyy 72dca49bd2 新增产品 2025-08-27 15:22:25 +08:00
zyy ce1c198047 修改种子纸工艺 2025-08-27 09:37:14 +08:00
zyy 764f3117f2 新增备注列表 2025-08-26 15:35:50 +08:00
zyy 0cc4e97526 新增备注列表 2025-08-26 15:35:26 +08:00
zyy 0828111404 价格取整 2025-08-26 09:30:55 +08:00
527 changed files with 144177 additions and 5609 deletions
+1
View File
@@ -1,2 +1,3 @@
.idea/*
target/*
.vscode/*
+22
View File
@@ -190,11 +190,22 @@
<artifactId>UserAgentUtils</artifactId>
<version>1.20</version>
</dependency>
<!-- Source: https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.12.13</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.24</version>
</dependency>
<dependency>
<groupId>com.luhuiguo</groupId>
<artifactId>aspose-pdf</artifactId>
<version>23.1</version>
</dependency>
<dependency>
<groupId>com.singularsys</groupId>
<artifactId>jep</artifactId>
@@ -202,6 +213,17 @@
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/jep-java-3.5-trial.jar</systemPath>
</dependency>
<!-- Redis依赖 -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
<version>1.8.17.RELEASE</version>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.9.3</version>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>
@@ -176,4 +176,10 @@ public class Product {
private String plantName;
private String ui_menu_size;
private String address;
private Double lengthVU;
private Double widthUV;
private Integer cropNumber;
}
@@ -0,0 +1,36 @@
package lingtao.net.bean;
import lombok.Data;
import java.util.Date;
/**
* 产品知识点;
*
* @author Administrator
*/
@Data
public class StandardMemo {
private Integer id;
private String content;
private String createBy;
private Date createDate;
private String updateBy;
private Date updateDate;
/**
* 附件
*/
private String title;
/**
* 描述
*/
private String memo;
private Integer type;
}
@@ -0,0 +1,28 @@
package lingtao.net.bean;
import lombok.Data;
import java.util.Date;
@Data
public class TipContent {
private Integer id;
private int type;
private String content;
private String createBy;
private Date createDate;
private String updateBy;
private Date updateDate;
private String title;
/**
* 附件
*/
private String attachment;
}
@@ -11,6 +11,7 @@ import lingtao.net.bean.SysUser;
import lingtao.net.service.PriceService;
import lingtao.net.service.ProductService;
import lingtao.net.service.QuoteLogService;
import lingtao.net.util.HuaFangPriceUtil;
import lingtao.net.vo.PricingListVo;
import lingtao.net.vo.ProductVo;
import org.springframework.beans.factory.annotation.Autowired;
@@ -103,7 +104,9 @@ public class ProductController {
product.setRole(user.getRole());
if ("菜单".equals(product.getProTypeLabel())) {
product.setSize(product.getSize1().replace(",", ""));
if (product.getSize1() != null) {
product.setSize(product.getSize1().replace(",", ""));
}
String s = request.getParameter("kindValue5");
product.setKind1Value(s);
product.setSize(request.getParameter("ui_menu_size"));
@@ -245,8 +248,8 @@ public class ProductController {
product.setKindValue(toumingKind);
}
// 插入操作日志
String log = quoteLogService.log(product, request, proList);
if ("登陆失效".equals(log)) {
// String log = quoteLogService.log(product, request, proList);
if (user == null) {
return Msg.fail("登录信息失效~请刷新页面!");
}
@@ -355,7 +358,7 @@ public class ProductController {
}
String size = product.getSize();
if (("17".equals(product.getProTypeValue()) && "6".equals(product.getKindValue())) || "手拉旗".equals(product.getProTypeValue())) {
if (("17".equals(product.getProTypeValue()) && "6".equals(product.getKindValue())) || ("手拉旗".equals(product.getProTypeValue()) && "常规".equals(product.getStickerKind()))) {
if (!StringUtils.isEmpty(size)) {
String sizeList[] = size.split(",");
size = sizeList[0];
@@ -2,6 +2,7 @@ package lingtao.net.controller;
import java.util.List;
import lingtao.net.bean.Msg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@@ -13,27 +14,34 @@ import com.github.pagehelper.PageInfo;
import lingtao.net.bean.QuoteLog;
import lingtao.net.service.QuoteLogService;
import javax.servlet.http.HttpServletRequest;
@RestController
public class QuoteLogController {
@Autowired
private QuoteLogService quoteLogService;
@Autowired
private QuoteLogService quoteLogService;
/**
* 获取操作日志列表
*
* @param page
* @param limit
* @param quoteLog
* @return
*/
@RequestMapping("/getQuoteLog")
public PageInfo<QuoteLog> logList(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "limit", defaultValue = "10") Integer limit, QuoteLog quoteLog) {
PageHelper.startPage(page, limit);
List<QuoteLog> logList = quoteLogService.quoteLogs(quoteLog);
PageInfo<QuoteLog> pageInfo = new PageInfo<QuoteLog>(logList);
return pageInfo;
}
/**
* 获取操作日志列表
*
* @param page
* @param limit
* @param quoteLog
* @return
*/
@RequestMapping("/getQuoteLog")
public PageInfo<QuoteLog> logList(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "limit", defaultValue = "10") Integer limit, QuoteLog quoteLog) {
PageHelper.startPage(page, limit);
List<QuoteLog> logList = quoteLogService.quoteLogs(quoteLog);
PageInfo<QuoteLog> pageInfo = new PageInfo<QuoteLog>(logList);
return pageInfo;
}
@RequestMapping("/addQuoteLog")
public Msg addQuoteLog(QuoteLog quoteLog, HttpServletRequest request) {
String log = quoteLogService.log(quoteLog, request);
return Msg.success();
}
}
@@ -0,0 +1,64 @@
package lingtao.net.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lingtao.net.bean.Information;
import lingtao.net.bean.Msg;
import lingtao.net.bean.StandardMemo;
import lingtao.net.service.InformationService;
import lingtao.net.service.StandardMemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpSession;
import java.util.List;
@RestController
public class StandardMemoController {
@Autowired
private StandardMemoService standardMemoService;
/**
* 产品知识列表
*
* @return
*/
@RequestMapping("/getStandard")
public Msg getStandard(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "limit", defaultValue = "10") Integer limit, StandardMemo standardMemo) {
PageHelper.startPage(page, limit);
List<StandardMemo> standardMemoList = standardMemoService.getStandardMemos(standardMemo);
PageInfo<StandardMemo> pageInfo = new PageInfo<>(standardMemoList);
return Msg.success().add("list", pageInfo);
}
/**
* 添加产品知识
*/
@RequestMapping("/addStandard")
public Msg addStandard(StandardMemo standardMemo, HttpSession session) {
standardMemoService.addStandardMemo(standardMemo, session);
return Msg.success();
}
/**
* 修改产品知识
*/
@RequestMapping("/updateStandard")
public Msg updateStandard(StandardMemo standardMemo, HttpSession session) {
standardMemoService.updateStandardMemoById(standardMemo, session);
return Msg.success();
}
/**
* 删除
*/
@RequestMapping("/deleteStandard")
public Msg deleteStandard(@RequestParam("id") Integer id) {
standardMemoService.deleteStandardMemoById(id);
return Msg.success();
}
}
@@ -0,0 +1,64 @@
package lingtao.net.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lingtao.net.bean.Msg;
import lingtao.net.bean.StandardMemo;
import lingtao.net.bean.TipContent;
import lingtao.net.service.StandardMemoService;
import lingtao.net.service.TipContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpSession;
import java.util.List;
@RestController
public class TipContentController {
@Autowired
private TipContentService tipContentService;
/**
* 产品知识列表
*
* @return
*/
@RequestMapping("/getTipContent")
public Msg getStandard(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "limit", defaultValue = "10") Integer limit, TipContent tipContent) {
PageHelper.startPage(page, limit);
List<TipContent> tipContentList = tipContentService.getTipContents(tipContent);
PageInfo<TipContent> pageInfo = new PageInfo<>(tipContentList);
return Msg.success().add("list", pageInfo);
}
/**
* 添加产品知识
*/
@RequestMapping("/addTipContent")
public Msg addStandard(TipContent tipContent, HttpSession session) {
tipContentService.addTipContent(tipContent, session);
return Msg.success();
}
/**
* 修改产品知识
*/
@RequestMapping("/updateTipContent")
public Msg updateStandard(TipContent tipContent, HttpSession session) {
tipContentService.updateTipContentById(tipContent, session);
return Msg.success();
}
/**
* 删除
*/
@RequestMapping("/deleteTipContent")
public Msg deleteStandard(@RequestParam("id") Integer id) {
tipContentService.deleteTipContentById(id);
return Msg.success();
}
}
@@ -0,0 +1,17 @@
package lingtao.net.dao;
import lingtao.net.bean.StandardMemo;
import java.util.List;
public interface StandardMemoMapper {
List<StandardMemo> getStandardMemos(StandardMemo standardMemo);
void addStandardMemo(StandardMemo standardMemo);
void updateStandardMemoById(StandardMemo standardMemo);
void deleteStandardMemoById(Integer id);
}
@@ -0,0 +1,18 @@
package lingtao.net.dao;
import lingtao.net.bean.StandardMemo;
import lingtao.net.bean.TipContent;
import java.util.List;
public interface TipContentMapper {
List<TipContent> getTipContents(TipContent standardMemo);
void addTipContent(TipContent standardMemo);
void updateTipContentById(TipContent standardMemo);
void deleteTipContentById(Integer id);
}
File diff suppressed because it is too large Load Diff
@@ -247,4 +247,83 @@ public class QuoteLogService {
}
return null;
}
public String log(QuoteLog quoteLog, HttpServletRequest request) {
long startTime, endTime = 0;
startTime = System.currentTimeMillis();
SysUser user = (SysUser) request.getSession().getAttribute("USER_SESSION");
String remark_judge = quoteLog.getRemark();
if (user == null) {
return "登陆失效";
}
QuoteLog log = new QuoteLog();
log.setRemark(remark_judge);
log.setRealname(user.getRealname());
log.setUsername(user.getUsername());
log.setQuoteIp(IPUtils.getIpAddr(request));// 获取ip
log.setBrower(IPUtils.getBrowserName(request));// 获取浏览器名称
log.setOs(IPUtils.getOsName(request)); // 获取操作系统名称
log.setPrice((double) 0);
List<SysRole> allRoleNames = sysRoleService.getAllRoleName(null);
String roleName = "";
String[] split = user.getRole().split(",");
for (SysRole sysRole : allRoleNames) {
for (int i = 0; i < split.length; i++) {
if (split[i].equals(String.valueOf(sysRole.getRoleId()))) {
roleName += sysRole.getRoleName() + "";
}
}
}
log.setShopname(roleName);
quoteLogMapper.insertSelective(log);
endTime = System.currentTimeMillis();
System.out.println("【insertSelective】使用的时间:" + (endTime - startTime));
long startTime2, endTime2 = 0;
startTime2 = System.currentTimeMillis();
boolean flag = false;
// 查询3分钟内自己报的数据
List<String> remarkJudgeData = quoteDataMapper.getQuoteDataByMinutes(user.getUsername());
endTime2 = System.currentTimeMillis();
System.out.println("【getQuoteDataByMinutes】使用的时间:" + (endTime2 - startTime2));
for (String remarkJudge : remarkJudgeData) {
if (remarkJudge.equals(remark_judge)) {
// 如果3分钟内报过相同数据
flag = true;
break;
}
}
// 插入数据(给客服数据新增用的)
String role = user.getRole();
// 客服报的且3分钟内没有同一个客户报的数据才插入
if (role.contains("999,") && !flag) {
QuoteData quoteData = new QuoteData();
quoteData.setUsername(user.getUsername());
quoteData.setRealname(user.getRealname());
quoteData.setPrice((double) 0);
quoteData.setRole(user.getRole());
// 默认都是没选择店铺
quoteData.setIsSelect("0");
// role = role.replace("999,", "").replace(",1049", "").replace(",1011", "");
// 规则:第一位客服,第二位主店铺
String shopname = role.substring(role.indexOf(",") + 1);
if (shopname.indexOf(",") != -1) {
shopname = shopname.substring(0, shopname.indexOf(","));
}
System.out.println(shopname);
quoteData.setShopname(shopname);
quoteData.setIsSelect("1");
// 除去【客服】只有一个店铺,所属店铺就是剩下这个店铺 切 选择状态改为已选择
// if (!role.contains(",")) {
// }
quoteData.setIsBuy("0");
quoteData.setIsBuyToDay("0");
quoteData.setRemark(remark_judge);
// 默认都是填写旺旺号
quoteData.setIsFillIn("1");
quoteDataMapper.addQuoteData(quoteData);
}
return null;
}
}
@@ -0,0 +1,56 @@
package lingtao.net.service;
import lingtao.net.bean.Msg;
import lingtao.net.bean.StandardMemo;
import lingtao.net.bean.SysUser;
import lingtao.net.dao.StandardMemoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpSession;
import java.util.List;
@Service
public class StandardMemoService {
@Autowired
private StandardMemoMapper standardMemoMapper;
public List<StandardMemo> getStandardMemos(StandardMemo standardMemo) {
return standardMemoMapper.getStandardMemos(standardMemo);
}
public Msg addStandardMemo(StandardMemo standardMemo, HttpSession session) {
SysUser user = (SysUser) session.getAttribute("USER_SESSION");
standardMemo.setCreateBy(user.getRealname());
try {
standardMemoMapper.addStandardMemo(standardMemo);
return Msg.success();
} catch (Exception e) {
return Msg.fail();
}
}
public Msg updateStandardMemoById(StandardMemo standardMemo, HttpSession session) {
SysUser user = (SysUser) session.getAttribute("USER_SESSION");
standardMemo.setUpdateBy(user.getRealname());
try {
standardMemoMapper.updateStandardMemoById(standardMemo);
return Msg.success();
} catch (Exception e) {
return Msg.fail();
}
}
public Msg deleteStandardMemoById(Integer id) {
try {
standardMemoMapper.deleteStandardMemoById(id);
return Msg.success();
} catch (Exception e) {
return Msg.fail();
}
}
}
@@ -0,0 +1,58 @@
package lingtao.net.service;
import lingtao.net.bean.Msg;
import lingtao.net.bean.StandardMemo;
import lingtao.net.bean.SysUser;
import lingtao.net.bean.TipContent;
import lingtao.net.dao.StandardMemoMapper;
import lingtao.net.dao.TipContentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpSession;
import java.util.List;
@Service
public class TipContentService {
@Autowired
private TipContentMapper tipContentMapper;
public List<TipContent> getTipContents(TipContent tipContent) {
return tipContentMapper.getTipContents(tipContent);
}
public Msg addTipContent(TipContent tipContent, HttpSession session) {
SysUser user = (SysUser) session.getAttribute("USER_SESSION");
tipContent.setCreateBy(user.getRealname());
try {
tipContentMapper.addTipContent(tipContent);
return Msg.success();
} catch (Exception e) {
return Msg.fail();
}
}
public Msg updateTipContentById(TipContent tipContent, HttpSession session) {
SysUser user = (SysUser) session.getAttribute("USER_SESSION");
tipContent.setUpdateBy(user.getRealname());
try {
tipContentMapper.updateTipContentById(tipContent);
return Msg.success();
} catch (Exception e) {
return Msg.fail();
}
}
public Msg deleteTipContentById(Integer id) {
try {
tipContentMapper.deleteTipContentById(id);
return Msg.success();
} catch (Exception e) {
return Msg.fail();
}
}
}
@@ -1,5 +1,7 @@
package lingtao.net.util;
import com.aspose.pdf.Document;
import com.aspose.pdf.optimization.OptimizationOptions;
import lingtao.net.bean.Product;
import java.io.File;
@@ -219,7 +221,7 @@ public class AStickersPrice {
List<Product> list = new ArrayList<Product>();
Product pro = new Product();
int bigCountArr[] = {500, 1000, 2000, 3000, 5000, 10000, 20000, 30000, 40000, 50000, 60000, 70000, 80000, 90000, 100000};
int priceArr[] = {56, 63, 84, 108, 150, 240, 456, 684, 912, 1125, 1350, 1575, 1800, 2025, 2250};
int priceArr[] = {65, 75, 100, 130, 180, 275, 515, 805, 1005, 1205, 1405, 1605, 1805, 2005, 2205};
if (count <= 40000) {
for (int i = 0; i < bigCountArr.length; i++) {
if (bigCountArr[i] < count || list.size() > 5) {
@@ -390,34 +392,30 @@ public class AStickersPrice {
}
public static void main(String[] args) {
String path = "Z:\\设计文件共享中心\\已下单\\2019\\1月\\年后出货\\不干胶\\dy\\已拼";
Path startPath = Paths.get(path);
try {
Files.walk(startPath).filter(Files::isRegularFile).forEach(System.out::println);
} catch (Exception e) {
e.printStackTrace();
}
String source = "C:\\Users\\231010\\Downloads\\蓝朝旺.pdf";
String target = "C:\\Users\\231010\\Downloads\\蓝朝旺1.pdf";
optimize(source, target);
}
public static String midStrEx(String source, String startStr, String endStr) {
String result = "";
int startIndex, endIndex;
try {
startIndex = source.indexOf(startStr);
if (startIndex == -1) {
return result;
}
String tmpStr = source.substring(startIndex + startStr.length());
endIndex = tmpStr.indexOf(endStr);
if (endIndex == -1) {
return result;
}
result = tmpStr.substring(0, endIndex);
} catch (Exception ex) {
System.out.println("MidStrEx Err: " + ex.getMessage());
}
return result;
public static void optimize(String source, String target) {
Document doc = new Document(source);
//设置压缩属性
OptimizationOptions opt = new OptimizationOptions();
//删除PDF不必要的对象
opt.setRemoveUnusedObjects(true);
//链接重复流
opt.setLinkDuplcateStreams(false);
//删除未使用的流
opt.setRemoveUnusedStreams(false);
//删除不必要的字体
opt.setUnembedFonts(true);
//压缩PDF中的图片
opt.getImageCompressionOptions().setCompressImages(true);
//图片压缩比, 0 到100可选,越低压缩比越大
opt.getImageCompressionOptions().setImageQuality(100);
doc.optimizeResources(opt);
//优化web的PDF文档
doc.optimize();
doc.save(target);
}
}
+9 -11
View File
@@ -8,12 +8,12 @@ import java.util.List;
public class CanopyUtil {
public static List<Product> getPrice(Double area, int count, List<Product> priceList, String kindvalue, String craft) {
public static List<Product> getPrice(Double area, int count, List<Product> priceList, String kindvalue, List<String> craft_list) {
Product pro = null;
double price = 0;
area = area * count;//计算总面积
double basePrice = 0;
double[] priceArr = getBasePrice(kindvalue, craft);
double[] priceArr = getBasePrice(kindvalue, craft_list);
if (priceArr.length == 0) {
return priceList;
}
@@ -26,7 +26,7 @@ public class CanopyUtil {
} else {
basePrice = priceArr[3];
}
double mince = getMinPrice(kindvalue, craft);
double mince = getMinPrice(kindvalue, craft_list);
price = Math.ceil(basePrice * area);
pro = new Product();
pro.setCount(count);
@@ -37,17 +37,16 @@ public class CanopyUtil {
return priceList;
}
private static double[] getBasePrice(String kindvalue, String craft) {
List<String> craftList = craft != null ? Collections.singletonList(craft) : new ArrayList<>();
private static double[] getBasePrice(String kindvalue, List<String> craft) {
if ("银胶涤纶布".equals(kindvalue)) {
if (craftList.contains("定制")) {
if (craft.contains("定制")) {
return new double[]{27, 26, 25, 24.5};
} else {
return new double[]{12.5, 11.5, 11, 10};
}
}
if ("黑胶涤纶布".equals(kindvalue)) {
if (craftList.contains("定制")) {
if (craft.contains("定制")) {
return new double[]{29, 28, 27, 26};
} else {
return new double[]{14.5, 13.5, 13, 12};
@@ -56,17 +55,16 @@ public class CanopyUtil {
return new double[]{};
}
private static double getMinPrice(String kindvalue, String craft) {
List<String> craftList = craft != null ? Collections.singletonList(craft) : new ArrayList<>();
private static double getMinPrice(String kindvalue, List<String> craft) {
if ("银胶涤纶布".equals(kindvalue)) {
if (craftList.contains("定制")) {
if (craft.contains("定制")) {
return 80;
} else {
return 60;
}
}
if ("黑胶涤纶布".equals(kindvalue)) {
if (craftList.contains("定制")) {
if (craft.contains("定制")) {
return 80;
} else {
return 50;
+75 -57
View File
@@ -6,61 +6,79 @@ import java.util.List;
import lingtao.net.bean.Product;
public class FgqPrice {
DecimalFormat df = new DecimalFormat("0.00");
/**仿古旗报价*/
public List<Product> getPrice(int count, Double area, List<Product> list,String[] craftList, String kind, int num) {
Product pro = new Product();
pro = new Product();
pro.setCount(count);
String craft = craftList[0];
double dj = 0,wei = 0;
if(kind.equals("1")) {
if(craft.equals("单面")) {
dj = 90;
wei = 0.065;
}else {
dj = 100;
wei = 0.195;
}
}else {
if(craft.equals("单面")) {
dj = 100;
wei = 0.165;
}else {
dj = 135;
wei = 0.33;
}
}
double price = Math.ceil(area * dj);
pro.setPrice(price);
pro.setWeight(df.format(area * wei * num));
list.add(pro);
return list;
}
/**手拉旗报价*/
public List<Product> getSlqPrice(int count, List<Product> list) {
Product pro = new Product();
pro = new Product();
pro.setCount(count);
pro.setPrice(Math.ceil(30 * count));
list.add(pro);
return list;
}
public List<Product> getSlqSpeicPrice(int count, List<Product> list, int type) {
Product pro = new Product();
pro = new Product();
pro.setCount(count);
if(type == 1) {
pro.setPrice(Math.ceil(16 * count));
}else {
pro.setPrice(Math.ceil(12 * count));
}
list.add(pro);
return list;
}
DecimalFormat df = new DecimalFormat("0.00");
/**
* 仿古旗报价
*/
public List<Product> getPrice(int count, Double area, List<Product> list, String[] craftList, String kind, int num) {
Product pro = new Product();
pro = new Product();
pro.setCount(count);
String craft = craftList[0];
double dj = 0, wei = 0;
if (kind.equals("1")) {
if (craft.equals("单面")) {
dj = 90;
wei = 0.065;
} else {
dj = 100;
wei = 0.195;
}
} else {
if (craft.equals("单面")) {
dj = 100;
wei = 0.165;
} else {
dj = 135;
wei = 0.33;
}
}
double price = Math.ceil(area * dj);
pro.setPrice(price);
pro.setWeight(df.format(area * wei * num));
list.add(pro);
return list;
}
/**
* 手拉旗报价
*/
public List<Product> getSlqPrice(int count, List<Product> list) {
double basePrice = 0;
if (count > 0 && count <= 10) {
basePrice = 30;
} else if (count > 10 && count <= 50) {
basePrice = 26;
} else if (count > 50 && count <= 100) {
basePrice = 22;
} else if (count > 100 && count <= 200) {
basePrice = 20;
} else {
basePrice = 18;
}
Product pro = new Product();
pro = new Product();
pro.setCount(count);
pro.setPrice(Math.ceil(basePrice * count));
list.add(pro);
return list;
}
public List<Product> getSlqSpeicPrice(int count, List<Product> list, int type) {
Product pro = new Product();
pro = new Product();
pro.setCount(count);
if (type == 1) {
pro.setPrice(Math.ceil(16 * count));
} else {
pro.setPrice(Math.ceil(12 * count));
}
list.add(pro);
return list;
}
}
@@ -0,0 +1,156 @@
package lingtao.net.util;
import okhttp3.*;
import java.io.IOException;
import java.util.Map;
public class HttpUtils {
private static final OkHttpClient HTTP_CLIENT = new OkHttpClient();
private static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
private static final MediaType FORM = MediaType.parse("application/x-www-form-urlencoded; charset=utf-8");
/**
* 通用HTTP GET请求方法
*
* @param url 请求地址
* @param headers 请求头映射
* @return 响应结果字符串
*/
public static String sendGetRequest(String url, Map<String, String> headers) {
Request.Builder builder = new Request.Builder()
.header("Content-Type", "application/json")
.url(url);
// 添加请求头
if (headers != null && !headers.isEmpty()) {
for (Map.Entry<String, String> entry : headers.entrySet()) {
builder.header(entry.getKey(), entry.getValue());
}
}
Request request = builder.build();
try (Response response = HTTP_CLIENT.newCall(request).execute()) {
if (!response.isSuccessful()) {
throw new IOException("请求异常: " + response.code());
}
return response.body().string();
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
/**
* 通用HTTP GET请求方法(无请求头)
*
* @param url 请求地址
* @return 响应结果字符串
*/
public static String sendGetRequest(String url) {
return sendGetRequest(url, null);
}
/**
* 通用HTTP POST请求方法(JSON参数)
*
* @param url 请求地址
* @param jsonParam JSON参数
* @param headers 请求头映射
* @return 响应结果字符串
*/
public static String sendPostRequest(String url, String jsonParam, Map<String, String> headers) {
RequestBody body = RequestBody.create(JSON, jsonParam);
Request.Builder builder = new Request.Builder()
.header("Content-Type", "application/json")
.url(url)
.post(body);
// 添加请求头
if (headers != null && !headers.isEmpty()) {
for (Map.Entry<String, String> entry : headers.entrySet()) {
builder.header(entry.getKey(), entry.getValue());
}
}
Request request = builder.build();
try (Response response = HTTP_CLIENT.newCall(request).execute()) {
if (!response.isSuccessful()) {
throw new IOException("请求异常: " + response.code());
}
return response.body().string();
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
/**
* 通用HTTP POST请求方法(JSON参数,无请求头)
*
* @param url 请求地址
* @param jsonParam JSON参数
* @return 响应结果字符串
*/
public static String sendPostRequest(String url, String jsonParam) {
return sendPostRequest(url, jsonParam, null);
}
/**
* 通用HTTP POST请求方法(表单参数)
*
* @param url 请求地址
* @param formParams 表单参数映射
* @param headers 请求头映射
* @return 响应结果字符串
*/
public static String sendPostFormRequest(String url, Map<String, String> formParams, Map<String, String> headers) {
StringBuilder formBody = new StringBuilder();
if (formParams != null && !formParams.isEmpty()) {
for (Map.Entry<String, String> entry : formParams.entrySet()) {
if (formBody.length() > 0) {
formBody.append("&");
}
formBody.append(entry.getKey()).append("=").append(entry.getValue());
}
}
RequestBody body = RequestBody.create(FORM, formBody.toString());
Request.Builder builder = new Request.Builder()
.header("Content-Type", "application/json")
.url(url)
.post(body);
// 添加请求头
if (headers != null && !headers.isEmpty()) {
for (Map.Entry<String, String> entry : headers.entrySet()) {
builder.header(entry.getKey(), entry.getValue());
}
}
Request request = builder.build();
try (Response response = HTTP_CLIENT.newCall(request).execute()) {
if (!response.isSuccessful()) {
throw new IOException("请求异常: " + response.code());
}
return response.body().string();
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
/**
* 通用HTTP POST请求方法(表单参数,无请求头)
*
* @param url 请求地址
* @param formParams 表单参数映射
* @return 响应结果字符串
*/
public static String sendPostFormRequest(String url, Map<String, String> formParams) {
return sendPostFormRequest(url, formParams, null);
}
}
@@ -0,0 +1,53 @@
package lingtao.net.util;
import com.alibaba.fastjson.JSONObject;
import lingtao.net.vo.HuaFangPriceRequstVo;
import lingtao.net.vo.HuaFangPriceResultVo;
import lingtao.net.vo.HuaFangTokenVo;
import okhttp3.*;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
public class HuaFangPriceUtil {
private static final String userName = "001008";
private static final String password = "lt666888";
public static String getToken() {
String token = "";
LocalDateTime currentTime = LocalDateTime.now();
String templateName = "HUAFANG_TOKEN";
if (!RedisUtil.exists(templateName)) {
Map<String, String> params = new HashMap<>();
params.put("userName", userName);
params.put("password", password);
String tokenString = HttpUtils.sendPostRequest("http://ds.gw.chenghuiyin.com/ordering/api/User/GetToken", JSONObject.toJSONString(params));
System.out.println("获取token返回:" + tokenString);
HuaFangTokenVo huaFangTokenVo = JSONObject.parseObject(tokenString, HuaFangTokenVo.class);
RedisUtil.set(templateName, huaFangTokenVo.getAccessToken(), huaFangTokenVo.getExpiresIn() - 50);
}
Object tokenObj = RedisUtil.get(templateName);
if (tokenObj != null) {
token = tokenObj.toString();
}
System.out.println("获取token:" + token);
return token;
}
public static HuaFangPriceResultVo getPrice(HuaFangPriceRequstVo params) {
Map<String, String> heards = new HashMap<>();
heards.put("Authorization", "Bearer " + getToken());
String resultText = HttpUtils.sendPostRequest("http://ds.quote.chenghuiyin.com/api/app/price/calc-price", JSONObject.toJSONString(params), heards);
HuaFangPriceResultVo result = JSONObject.parseObject(resultText, HuaFangPriceResultVo.class);
return result;
}
}
@@ -45,7 +45,7 @@ public class PVCStickersPrice {
} else if (product.getCount() == 100000) {
price = 700;
}
product.setPrice(product.getPrice() + price);
product.setPrice(Math.ceil(product.getPrice() + price));
}
} else if ((length <= 9 && width <= 5.4) || (length <= 5.4 && width <= 9)) {
for (Product product : stickersList) {
@@ -78,7 +78,7 @@ public class PVCStickersPrice {
} else if (product.getCount() == 100000) {
price = 1500;
}
product.setPrice(product.getPrice() + price);
product.setPrice(Math.ceil(product.getPrice() + price));
}
} else {
for (Product product : stickersList) {
@@ -99,7 +99,7 @@ public class PVCStickersPrice {
} else {
price = 3;
}
product.setPrice(product.getPrice() + (price * area > 50 ? price * area : 50));
product.setPrice(Math.ceil(product.getPrice() + (price * area > 50 ? price * area : 50)));
}
}
return stickersList;
+83 -38
View File
@@ -306,14 +306,10 @@ public class PosterPrice {
price = area * 380 > 380 + 15 ? area * 380 : 380 + 15;
break;
}
if (!"24".equals(kind2)) {
double area_jis = area;
if (width * length < 40 * 50) {
area_jis = area_jis * number;
}
// if ("8".equals(kind2) && width * length < 40 * 50) {
// price = new PriceUtils().getTestPrice(length, width, count, number, areas, prices, min_price, last_price);
// } else {
Product pro = new Product();
List<Product> list = new ArrayList<Product>();
pro.setCount(count);
if ("15".equals(kind2)) {
danjia = last_price;
for (int i = 0; i < areas.length; i++) {
if (area <= areas[i]) {
@@ -321,19 +317,44 @@ public class PosterPrice {
break;
}
}
price = Math.max(area_jis * danjia, min_price);
// }
price = Math.max(area * danjia, min_price) * number;
if (area < areas[0]) {
area = area * number;
for (int i = 0; i < areas.length; i++) {
if (area <= areas[i]) {
danjia = prices[i];
break;
}
}
price = Math.max(min_price, area * danjia) + 25 + 15 * (number - 1);
}
pro.setPrice(Math.ceil(price));
} else {
if (!"24".equals(kind2)) {
double area_jis = area;
if (width * length < 40 * 50) {
area_jis = area_jis * number;
}
danjia = last_price;
for (int i = 0; i < areas.length; i++) {
if (area <= areas[i]) {
danjia = prices[i];
break;
}
}
price = Math.max(area_jis * danjia, min_price);
}
// 价格 = 面积 * 单价 + (款数-1) * 40
if (number > 1 && width * length >= 40 * 50) {
pro.setPrice(Math.ceil(price * number));
} else {
pro.setPrice(Math.ceil(price));
}
}
Product pro = new Product();
List<Product> list = new ArrayList<Product>();
pro.setCount(count);
// 价格 = 面积 * 单价 + (款数-1) * 40
if (number > 1 && width * length >= 40 * 50) {
pro.setPrice(Math.ceil(price * number));
} else {
pro.setPrice(Math.ceil(price ));
}
pro.setWeight(weight);
list.add(pro);
return list;
@@ -362,9 +383,9 @@ public class PosterPrice {
// 户外写真白胶(国产)
case "0":
areas = new double[]{2, 5, 7, 8, 10, 20, 50};
prices = new double[]{55, 45, 40, 37, 31, 29, 27};
last_price = 26;
min_price += 50 + 15;
prices = new double[]{38, 38, 33, 30, 25, 23, 21};
last_price = 19;
min_price += 50 - 5;
// 根据面积得到单价
weight = String.valueOf(DecimalFormat.format(area * 0.24 * number));
break;
@@ -372,9 +393,9 @@ public class PosterPrice {
case "1":
// 根据面积得到单价
areas = new double[]{2, 5, 7, 8, 10, 20, 50};
prices = new double[]{55, 45, 40, 37, 31, 29, 27};
last_price = 26;
min_price += 50 + 15;
prices = new double[]{38, 38, 33, 30, 25, 23, 21};
last_price = 19;
min_price += 50 - 5;
weight = String.valueOf(DecimalFormat.format(area * 0.25 * number));
break;
// 户外写真可移白胶、黑胶
@@ -417,27 +438,51 @@ public class PosterPrice {
weight = String.valueOf(DecimalFormat.format(area * 0.24 * number));
break;
}
if (width * length < 40 * 50) {
price = new PriceUtils().getTestPrice(length, width, count, number, areas, prices, min_price, last_price);
} else {
danjia = last_price;
Product pro = new Product();
List<Product> list = new ArrayList<Product>();
pro.setCount(count);
danjia = last_price;
if ("0".equals(kind2) || "1".equals(kind2)) {
for (int i = 0; i < areas.length; i++) {
if (area <= areas[i]) {
danjia = prices[i];
break;
}
}
price = Math.max(area * danjia, min_price);
}
Product pro = new Product();
List<Product> list = new ArrayList<Product>();
pro.setCount(count);
// 价格 = 面积 * 单价 + (款数-1) * 40
if (number > 1 && width * length >= 40 * 50) {
pro.setPrice(Math.ceil(price * number));
} else {
price = Math.max(area * danjia, min_price) * number;
if (area < areas[0]) {
area = area * number;
for (int i = 0; i < areas.length; i++) {
if (area <= areas[i]) {
danjia = prices[i];
break;
}
}
price = Math.max(min_price, area * danjia) + 25 + 15 * (number - 1);
}
pro.setPrice(Math.ceil(price));
} else {
if (width * length < 40 * 50) {
price = new PriceUtils().getTestPrice(length, width, count, number, areas, prices, min_price, last_price);
} else {
for (int i = 0; i < areas.length; i++) {
if (area <= areas[i]) {
danjia = prices[i];
break;
}
}
price = Math.max(area * danjia, min_price);
}
// 价格 = 面积 * 单价 + (款数-1) * 40
if (number > 1 && width * length >= 40 * 50) {
pro.setPrice(Math.ceil(price * number));
} else {
pro.setPrice(Math.ceil(price));
}
}
pro.setWeight(weight);
list.add(pro);
return list;
+192 -40
View File
@@ -8,6 +8,7 @@ import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
public class PriceUtils {
@@ -41,7 +42,7 @@ public class PriceUtils {
area = Double.valueOf(df.format(area * count));
if (area <= 20) {
yinrPrice = 260;
lowerPrice = 550;
lowerPrice = 400;
} else if (area <= 150) {
yinrPrice = 300;
lowerPrice = 600;
@@ -973,12 +974,27 @@ public class PriceUtils {
} else if ("单面烫黄金".equals(kind2)) {
double priceArr[] = {68, 48, 37, 36, 35, 34};
list = acountTag600Price(area, count, priceArr, shengzi, flag, list);
} else if ("单面烫镭射银".equals(kind2)) {
double priceArr[] = {82, 58, 45, 43, 42, 41};
list = acountTag600Price(area, count, priceArr, shengzi, flag, list);
} else if ("双面烫黄金".equals(kind2)) {
double priceArr[] = {108, 72, 56, 54, 52, 50};
list = acountTag600Price(area, count, priceArr, shengzi, flag, list);
} else if ("双面烫镭射银".equals(kind2)) {
double priceArr[] = {123, 87, 68, 65, 63, 60};
list = acountTag600Price(area, count, priceArr, shengzi, flag, list);
} else if ("击凸".equals(kind2) || "压凹".equals(kind2)) {
double priceArr[] = {75, 50, 40, 40, 39, 38};
list = acountTag600Price(area, count, priceArr, shengzi, flag, list);
} else if ("单面烫黄金+凹凸".equals(kind2)) {
double priceArr[] = {93, 63, 48, 48, 47, 46};
list = acountTag600Price(area, count, priceArr, shengzi, flag, list);
} else if ("单面烫金+压凹".equals(kind2)) {
double priceArr[] = {93, 63, 48, 48, 47, 46};
list = acountTag600Price(area, count, priceArr, shengzi, flag, list);
} else if ("单面烫金+击凸".equals(kind2)) {
double priceArr[] = {93, 63, 48, 48, 47, 46};
list = acountTag600Price(area, count, priceArr, shengzi, flag, list);
}
}
if ("6".equals(kind)) {
@@ -1004,6 +1020,15 @@ public class PriceUtils {
{764, 764, 877, 991, 1014, 1105, 1219, 1301, 1310, 1423, 1651, 2038, 2406, 2470, 3494, 5314, 9295},
{1495, 1495, 1716, 1937, 1981, 2158, 2379, 2538, 2555, 2776, 3218, 3970, 4686, 4810, 6799, 10335, 18070}
};
} else if ("单面烫镭射银".equals(kind2)) {
prices = new int[][]{
{190, 190, 221, 252, 258, 283, 315, 338, 340, 372, 435, 539, 641, 658, 938, 1438, 2530},
{195, 195, 226, 257, 263, 288, 319, 343, 345, 377, 439, 544, 646, 663, 943, 1443, 2535},
{315, 350, 366, 413, 418, 456, 504, 535, 538, 585, 681, 845, 1001, 1027, 1459, 2229, 3913},
{468, 468, 538, 608, 622, 678, 748, 799, 805, 876, 1016, 1254, 1482, 1521, 2152, 3276, 5733},
{764, 764, 877, 991, 1014, 1105, 1219, 1301, 1310, 1423, 1651, 2038, 2406, 2470, 3494, 5314, 9295},
{1495, 1495, 1716, 1937, 1981, 2158, 2379, 2538, 2555, 2776, 3218, 3970, 4686, 4810, 6799, 10335, 18070}
};
} else if ("击凸".equals(kind2) || "压凹".equals(kind2)) {
prices = new int[][]{
{196, 196, 229, 261, 268, 295, 326, 350, 352, 385, 450, 560, 665, 684, 976, 1496, 2635},
@@ -1022,6 +1047,15 @@ public class PriceUtils {
{1118, 1528, 1754, 1982, 2028, 2210, 2438, 2602, 2620, 2846, 3302, 4076, 4812, 4940, 6988, 10628, 18590},
{2194, 2990, 3432, 3874, 3962, 4316, 4758, 5076, 5110, 5552, 6436, 7940, 9372, 9620, 13598, 20670, 36140}
};
} else if ("双面烫镭射银".equals(kind2)) {
prices = new int[][]{
{270, 380, 442, 504, 516, 566, 630, 676, 680, 744, 870, 1078, 1282, 1316, 1876, 2876, 5060},
{278, 390, 452, 514, 526, 576, 638, 686, 690, 754, 878, 1088, 1292, 1326, 1886, 2886, 5070},
{460, 630, 732, 826, 836, 912, 1008, 1070, 1076, 1170, 1362, 1690, 2002, 2054, 2918, 4458, 7826},
{682, 936, 1076, 1216, 1244, 1356, 1496, 1598, 1610, 1752, 2032, 2508, 2964, 3042, 4304, 6552, 11466},
{1118, 1528, 1754, 1982, 2028, 2210, 2438, 2602, 2620, 2846, 3302, 4076, 4812, 4940, 6988, 10628, 18590},
{2194, 2990, 3432, 3874, 3962, 4316, 4758, 5076, 5110, 5552, 6436, 7940, 9372, 9620, 13598, 20670, 36140}
};
} else if ("单面烫黄金+凹凸".equals(kind2)) {
prices = new int[][]{
{239, 239, 279, 321, 329, 361, 403, 433, 435, 477, 559, 698, 830, 853, 1222, 1877, 3310},
@@ -1031,6 +1065,24 @@ public class PriceUtils {
{959, 959, 1111, 1264, 1294, 1417, 1570, 1680, 1692, 1844, 2150, 2670, 3165, 3250, 4625, 7069, 12415},
{1885, 1885, 2184, 2483, 2542, 2782, 3081, 3296, 3320, 3619, 4217, 5233, 6203, 6370, 9061, 13845, 24310}
};
} else if ("单面烫金+压凹".equals(kind2)) {
prices = new int[][]{
{239, 239, 279, 321, 329, 361, 403, 433, 435, 477, 559, 698, 830, 853, 1222, 1877, 3310},
{244, 244, 284, 326, 334, 366, 408, 438, 440, 482, 564, 703, 835, 858, 1227, 1882, 3315},
{397, 430, 460, 524, 537, 588, 651, 697, 702, 766, 894, 1110, 1316, 1352, 1925, 2943, 5174},
{585, 585, 678, 772, 791, 865, 959, 1027, 1034, 1128, 1315, 1634, 1937, 1989, 2831, 4329, 7605},
{959, 959, 1111, 1264, 1294, 1417, 1570, 1680, 1692, 1844, 2150, 2670, 3165, 3250, 4625, 7069, 12415},
{1885, 1885, 2184, 2483, 2542, 2782, 3081, 3296, 3320, 3619, 4217, 5233, 6203, 6370, 9061, 13845, 24310}
};
} else if ("单面烫金+击凸".equals(kind2)) {
prices = new int[][]{
{239, 239, 279, 321, 329, 361, 403, 433, 435, 477, 559, 698, 830, 853, 1222, 1877, 3310},
{244, 244, 284, 326, 334, 366, 408, 438, 440, 482, 564, 703, 835, 858, 1227, 1882, 3315},
{397, 430, 460, 524, 537, 588, 651, 697, 702, 766, 894, 1110, 1316, 1352, 1925, 2943, 5174},
{585, 585, 678, 772, 791, 865, 959, 1027, 1034, 1128, 1315, 1634, 1937, 1989, 2831, 4329, 7605},
{959, 959, 1111, 1264, 1294, 1417, 1570, 1680, 1692, 1844, 2150, 2670, 3165, 3250, 4625, 7069, 12415},
{1885, 1885, 2184, 2483, 2542, 2782, 3081, 3296, 3320, 3619, 4217, 5233, 6203, 6370, 9061, 13845, 24310}
};
}
for (int i = 0; i < count_list.length; i++) {
@@ -1157,9 +1209,9 @@ public class PriceUtils {
pro.setPrice(Math.ceil((count / kai * price + 150 + 200 + 200) * m));
list.add(pro);
} else {
pro.setCount(count);
pro.setPrice(Math.ceil(
(count / kai * price + (150 + Math.ceil((count - 1000) / 1000) * 50) + 200 + count * 0.3) * m));
pro.setPrice(Math.ceil((count / kai * price + (150 + Math.ceil((count - 1000) / 1000) * 50) + 200 + count * 0.3) * m));
list.add(pro);
}
}
@@ -1568,14 +1620,14 @@ public class PriceUtils {
}
if (!StringUtils.isEmpty(zhuan)) {
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])) {
if ("烫金".equals(zhuan[0]) || "烫哑金".equals(zhuan[0]) || "烫哑银".equals(zhuan[0]) || "烫银".equals(zhuan[0]) || "烫亮金".equals(zhuan[0]) || "烫银".equals(zhuan[0]) || "烫蓝".equals(zhuan[0]) || "烫红".equals(zhuan[0]) || "烫黑".equals(zhuan[0]) || "玫瑰金".equals(zhuan[0]) || "镭射银".equals(zhuan[0]) || "镭射金".equals(zhuan[0]) || "炫彩镭射".equals(zhuan[0])) {
// 起步价+58元
price = price + (40 * area);
price = price > 80 ? price : 80;
} else if ("印刷+烫金".equals(zhuan[0]) || "印刷+烫银".equals(zhuan[0])) {
// 起步价+58元
price = price + (45 * area);
price = price > 103 ? price : 103;
price = price > 80 ? price : 80;
} else if ("双面贴".equals(zhuan[0])) {
price = price + (40 * area);
price = price > 80 ? price : 80;
@@ -1593,7 +1645,7 @@ public class PriceUtils {
int oldCount = count;
if (!StringUtils.isEmpty(zhuan) && ("专金".equals(zhuan[0]) || "专银".equals(zhuan[0]) || "印刷+烫金".equals(zhuan[0]) || "印刷+烫银".equals(zhuan[0])) && count < 100) {
if (!StringUtils.isEmpty(zhuan) && ("专金".equals(zhuan[0]) || "专银".equals(zhuan[0])) && count < 100) {
// 烫金100个起
count = 100;
}
@@ -1677,7 +1729,7 @@ public class PriceUtils {
}
if (!StringUtils.isEmpty(zhuan)) {
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])) {
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])) {
// 起步价+58元
price = price + (40 * area);
price = price > 80 ? price : 80;
@@ -1744,7 +1796,7 @@ public class PriceUtils {
}
if (!StringUtils.isEmpty(zhuan)) {
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])) {
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])) {
// 起步价+58元
price = price + (40 * area);
price = price > 80 ? price : 80;
@@ -2105,12 +2157,12 @@ public class PriceUtils {
width = width * 10 + 2 * 1.5;
// 数量*款数就是张数
count = count * number;
if ((length > l || width > w) && (length > w || width > l)) {
if ((length - 3 > l || width - 3 > w) && (length - 3 > w || width - 3 > l)) {
return null;
}
// 一张大纸43*30 能做多少个此类尺寸的
double max = Math.max(Math.floor(l / length) * Math.floor(w / width),
Math.floor(l / width) * Math.floor(w / length));
double max = Math.max(Math.max(Math.floor(l / length) * Math.floor(w / width),
Math.floor(l / width) * Math.floor(w / length)), 1);
// 报的数量需要多少张大纸
int num = (int) Math.ceil(count / max);
if (num <= 10) {
@@ -2122,9 +2174,7 @@ public class PriceUtils {
if (dto.getN_mq_num() > 0) {
price += 10 * dto.getN_mq_num();
}
if (number > 1) {
price *= 1.3;
}
price = Math.ceil(price + (number - 1) * 5);
pro.setCount(count / number);
pro.setPrice(price);
list.add(pro);
@@ -2322,7 +2372,7 @@ public class PriceUtils {
// 根据款数重新算价格
for (Product product : list) {
product.setWeight(df.format(length * width * product.getCount() / 10000 * 0.3 * number));
product.setPrice(Math.floor(product.getPrice() * number));
product.setPrice(Math.ceil(product.getPrice() * number));
}
} else if ("双面印刷".equals(craftShua)) {
// 数量
@@ -2341,7 +2391,7 @@ public class PriceUtils {
}
// 根据款数重新算价格
for (Product product : list) {
product.setPrice(Math.floor(product.getPrice() * number));
product.setPrice(Math.ceil(product.getPrice() * number));
}
}
} else {
@@ -2398,7 +2448,7 @@ public class PriceUtils {
price = fixPrice + (num - 5 > 0 ? num - 5 : 0) * zhang + designFee * number + 0.1 * count * number;
Product dto = new Product();
dto.setCount(count);
dto.setPrice(price);
dto.setPrice(Math.ceil(price));
list.add(dto);
} else {
// 数量
@@ -2418,7 +2468,7 @@ public class PriceUtils {
// 根据款数重新算价格
for (Product product : list) {
product.setWeight(df.format(weight));
product.setPrice(Math.floor(product.getPrice() * number));
product.setPrice(Math.ceil(product.getPrice() * number));
}
}
}
@@ -2433,17 +2483,21 @@ public class PriceUtils {
Product pro = new Product();
double area = length * width / 10000;
double price = 0, dj = 0;
if (area < 0.25) {
dj = 50;
if (area < 0.3) {
price = Math.max(40, 5 * count);
} else {
dj = 40;
}
if (area < 0.25) {
dj = 40;
} else {
dj = 35;
}
area *= count;
if ("6".equals(kind2)) {
price = price + 30;
area *= count;
if ("6".equals(kind2)) {
price = price + 30;
}
price = Math.ceil(Math.max(area * dj, 40));
}
price = Math.ceil(area * dj > 58 ? area * dj : 58);
pro.setCount(count);
pro.setPrice(price * number);
list.add(pro);
@@ -2537,6 +2591,8 @@ public class PriceUtils {
pro.setPrice(Math.ceil(priceArr[i] * beishu - countArr[i] * 0.02));
} else if ("0".equals(kind)) {// 80克
pro.setPrice(Math.ceil(priceArr[i] * beishu));
} else if ("2".equals(kind)) {// 100克
pro.setPrice(Math.ceil(priceArr[i] * beishu * 1.5));
}
list.add(pro);
}
@@ -2599,27 +2655,27 @@ public class PriceUtils {
double price = 0;
if (length == 240 && width == 200 || length == 200 && width == 240) {
if (kind.equals("春亚布")) {
price = num * count * 1.8;
price = num * count * 2;
} else {
price = num * count * 2.5;
price = num * count * 3;
}
} else if (length == 200 && width == 140 || length == 140 && width == 200) {
if (kind.equals("春亚布")) {
price = num * count * 1.5;
price = num * count * 1.8;
} else {
price = num * count * 1.3;
price = num * count * 2.5;
}
} else {
if (kind.equals("春亚布")) {
price = num * count * 1.5;
} else {
price = num * count * 1.8;
price = num * count * 2;
}
}
pro = new Product();
pro.setCount(count);
pro.setPrice(Math.ceil(price) > 50 ? price : 50);
pro.setPrice(Math.max(Math.ceil(price), 30));
list.add(pro);
return list;
}
@@ -2931,7 +2987,7 @@ public class PriceUtils {
Product pro = new Product();
double max = Math.max(Math.floor(l / length) * Math.floor(w / width),
Math.floor(l / width) * Math.floor(w / length));
List<String> craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
// 报的数量需要多少张大纸
int num = (int) Math.ceil(count / max);
// if (count <= 1000) {
@@ -2945,6 +3001,9 @@ public class PriceUtils {
dj = 0.5;
}
pro.setPrice(130 + Math.ceil((num + 100) * dj));
if (craft_list.contains("异形") || craft_list.contains("异形模切")) {
pro.setPrice(Math.ceil(pro.getPrice() * 1.5));
}
double area = 0;
if ("烫金".equals(dto.getCraftTang())) {
int lszCountArr[] = new int[]{500, 1000, 2000, 3000, 5000, 10000, 20000};
@@ -3022,12 +3081,11 @@ public class PriceUtils {
Product pro = new Product();
double price = 0, dj = 0;
String[] craft = dto.getCraft();
if (dto.getStickerKind().equals("套餐")) {
if ("套餐".equals(dto.getStickerKind())) {
pro.setCount(count);
pro.setPrice(198.0);
list.add(pro);
} else {
double area = length * width * count / 10000;
double d = length * width * count / 10000;
if (length == 100 && width == 45) {
@@ -3390,6 +3448,7 @@ public class PriceUtils {
} else {
pro.setPrice(Math.ceil(price));
}
pro.setWeight(String.valueOf(df.format(width * length * 0.55 / 10000)));
pro.setCount(count);
list.add(pro);
@@ -3544,6 +3603,48 @@ public class PriceUtils {
return list;
}
public double TableNextPrice(double area, double[] price_list, double[] areas) {
double price = 0;
double last_price = 0;
for (int i = 0; i < areas.length; i++) {
if (area <= areas[i]) {
price = price_list[i];
break;
}
last_price = price_list[i];
}
return price == 0 ? last_price : price;
}
public double calcByTargetN(int startN, double highPrice, int endN, double lowPrice, int targetN) {
// 高价商品个数线性插值
double a = startN * (double) (endN - targetN) / (endN - startN);
double b = targetN - a;
double total = a * highPrice + b * lowPrice;
return total;
}
public double TableCountCenterPrice(int area, double[] price_list, int[] areas) {
double price = 0;
int startIndex = 0;
int endIndex = 0;
for (int i = 0; i < areas.length; i++) {
if (area > areas[i]) {
startIndex = endIndex;
endIndex = Math.min(i + 1, areas.length - 1);
}
}
if (startIndex == endIndex && startIndex == 0) {
price = price_list[endIndex];
} else if (startIndex == endIndex) {
price = (price_list[endIndex] / areas[endIndex]) * area;
} else {
price = ((areas[endIndex] - (double) area) / (areas[endIndex] - areas[startIndex])) * price_list[startIndex] + (((double) area - areas[startIndex]) / (areas[endIndex] - areas[startIndex])) * price_list[endIndex];
}
return price;
}
public double TablePrice(double area, int[] price_list, double[] areas) {
double price = 0;
int startIndex = 0;
@@ -3564,6 +3665,26 @@ public class PriceUtils {
return price;
}
public static double TableDoublePrice(double area, double[] price_list, double[] areas) {
double price = 0;
int startIndex = 0;
int endIndex = 0;
for (int i = 0; i < areas.length; i++) {
if (area > areas[i]) {
startIndex = endIndex;
endIndex = Math.min(i + 1, areas.length - 1);
}
}
if (startIndex == endIndex && startIndex == 0) {
price = price_list[endIndex];
} else if (startIndex == endIndex) {
price = (price_list[endIndex] / areas[endIndex]) * area;
} else {
price = ((areas[endIndex] - area) / (areas[endIndex] - areas[startIndex])) * price_list[startIndex] + ((area - areas[startIndex]) / (areas[endIndex] - areas[startIndex])) * price_list[endIndex];
}
return price;
}
public static double TableUnitPrice(double area, int[] price_list, double[] areas, double last_price) {
double price = 0;
int startIndex = 0;
@@ -3603,9 +3724,10 @@ public class PriceUtils {
if (area < 7.5) {
basePrice = 90;
} else {
basePrice = 70;
basePrice = 80;
}
return Math.max(Math.ceil(area * basePrice), 50);
return Math.max(Math.ceil(area * basePrice * 1.2), 50);
}
double price = 0;
if (craft_list.contains("冷转印")) {
@@ -3619,17 +3741,47 @@ public class PriceUtils {
if (count > 0) {
if (count <= 5) {
price += 200;
} else if (count < 100) {
} else if (count < 75) {
price += 14 * count + banfei;
} else {
price += 12 * count;
if (count < 89) {
count = 89;
}
price += 14 * count;
}
}
price = price + (coNumber - 1) * 100;
}
return price;
return Math.ceil(price * 0.9);
}
public static List<Product> getYinBaiPrice(List<Product> productList, double width, double length) {
double miniprice = 50;
double miniarea = 9;
//cm
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};
double[] areas = {9, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 140, 210, 420};
double area = width * length;
double craft_price = 0;
if (area < miniarea) {
craft_price = miniprice;
} else {
for (int i = 1; i < areas.length; i++) {
if (area < areas[i]) {
craft_price = prices[i - 1] * area;
break;
}
}
if (craft_price == 0) {
craft_price = prices[prices.length - 1] * area;
}
}
for (Product pro : productList) {
pro.setPrice(Math.ceil(pro.getPrice() + craft_price));
}
return productList;
}
public FunReturnVo getBagTagPrice(String kind2Value, String kindValue) {
@@ -0,0 +1,112 @@
package lingtao.net.util;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import java.util.concurrent.TimeUnit;
@Component
public class RedisUtil implements ApplicationContextAware {
private static RedisTemplate redisTemplate;
private static ApplicationContext applicationContext;
@Override
public void setApplicationContext(ApplicationContext context) throws BeansException {
applicationContext = context;
redisTemplate = (RedisTemplate) applicationContext.getBean("redisTemplate");
}
/**
* 设置缓存
*
* @param key 键
* @param value 值
*/
public static void set(String key, Object value) {
if (redisTemplate != null) {
redisTemplate.opsForValue().set(key, value);
}
}
/**
* 设置缓存(带过期时间)
*
* @param key 键
* @param value 值
* @param expireTime 过期时间(秒)
*/
public static void set(String key, Object value, long expireTime) {
if (redisTemplate != null) {
redisTemplate.opsForValue().set(key, value, expireTime, TimeUnit.SECONDS);
}
}
/**
* 获取缓存
*
* @param key 键
* @return 值
*/
public static Object get(String key) {
if (redisTemplate != null) {
return redisTemplate.opsForValue().get(key);
}
return null;
}
/**
* 删除缓存
*
* @param key 键
*/
public static void delete(String key) {
if (redisTemplate != null) {
redisTemplate.delete(key);
}
}
/**
* 检查键是否存在
*
* @param key 键
* @return 是否存在
*/
public static boolean exists(String key) {
if (redisTemplate != null) {
return redisTemplate.hasKey(key);
}
return false;
}
/**
* 设置过期时间
*
* @param key 键
* @param expireTime 过期时间(秒)
* @return 是否成功
*/
public static boolean expire(String key, long expireTime) {
if (redisTemplate != null) {
return redisTemplate.expire(key, expireTime, TimeUnit.SECONDS);
}
return false;
}
/**
* 获取剩余过期时间
*
* @param key 键
* @return 剩余过期时间(秒)
*/
public static long getExpire(String key) {
if (redisTemplate != null) {
return redisTemplate.getExpire(key, TimeUnit.SECONDS);
}
return -1;
}
}
@@ -0,0 +1,33 @@
package lingtao.net.util;
import com.alibaba.fastjson.JSONObject;
import lingtao.net.vo.*;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
public class ShengDaPriceUtils {
private static final String AppId = "3a1ab376af58ec4e918b4c506480efdf";
private static final String AppSecret = "e06KAvT6ugHpQd5zjHukfMJBH0dxfA74gWk9o1lsLqOMTYExFVvWuTh0twMQvNBF";
//UV打印亚克力
private static final String productId = "UVDAYINYAKELI";
public static String getToken() {
String tokenString = HttpUtils.sendGetRequest("http://47.114.150.226:88/Handler/apiShengda.ashx?t=apiGetToken");
System.out.println("获取token返回:" + tokenString);
ShengDaTokenVo huaFangTokenVo = JSONObject.parseObject(tokenString, ShengDaTokenVo.class);
return huaFangTokenVo.getResult();
}
public static ShengDaPriceResultVo getPrice(ShengDaPriceRequstVo params) {
Map<String, String> heards = new HashMap<>();
heards.put("Authorization", "Bearer " + getToken());
String resultText = HttpUtils.sendPostRequest("https://open.sd2000.com/api/app/calculate", JSONObject.toJSONString(params), heards);
ShengDaPriceResultVo result = JSONObject.parseObject(resultText, ShengDaPriceResultVo.class);
return result;
}
}
+11 -26
View File
@@ -1,5 +1,7 @@
package lingtao.net.util;
import com.aspose.pdf.Document;
import com.aspose.pdf.optimization.OptimizationOptions;
import lingtao.net.bean.Product;
import org.springframework.util.StringUtils;
@@ -69,34 +71,16 @@ public class ZsPrice {
if (number > 1) {
double desFee = 0;
if (!role.contains("1045") && !role.contains("1054") && !role.contains("1029")) {
if (dto.getP() == 1) {
desFee = 0.6 * (number - 1);
} else {
desFee = 10* (number - 1);
// if (number == 2) {
// desFee = 5.75;
// }
// if (number == 3) {
// desFee = 5.75 + 3.75;
// }
// if (number > 3) {
// desFee = 5.75 + 3.75 + 2.75 * (number - 3);
// }
}
price += desFee;
if (dto.getP() == 1 || dto.getP() == 2 || dto.getP() == 3) {
desFee = 3;
} else if (dto.getP() == 4) {
desFee = 5;
} else if (dto.getP() == 5) {
desFee = 6;
} else {
if (dto.getP() == 1 || dto.getP() == 2 || dto.getP() == 3) {
desFee = 3;
} else if (dto.getP() == 4) {
desFee = 5;
} else if (dto.getP() == 5) {
desFee = 6;
} else {
desFee = 10;
}
price += desFee * (number - 1);
desFee = 10;
}
price += desFee * (number - 1);
}
@@ -112,6 +96,7 @@ public class ZsPrice {
}
public int[] twoSum(int[] nums, int target) {
List<Integer> list = new ArrayList<>();
@@ -0,0 +1,13 @@
package lingtao.net.vo;
import lombok.Data;
import java.util.List;
@Data
public class HuaFangPriceProcessItemsVo {
private String processName;
private String processValue;
private List<Double> sizes;
}
@@ -0,0 +1,23 @@
package lingtao.net.vo;
import lombok.Data;
import java.util.List;
@Data
public class HuaFangPriceRequstVo {
private Integer styleNum;
private List<Double> sizes;
private String productPrintFace;
private String productPrintColor;
private String productPaperCode;
private String productPaperName;
private String productName;
private Integer num;
private List<HuaFangPriceProcessItemsVo> calcProcess;
}
@@ -0,0 +1,21 @@
package lingtao.net.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.time.LocalDateTime;
@Data
public class HuaFangPriceResultVo {
private String id;
private Double amount;
@JSONField(format = "yyyy-MM-dd'T'HH:mm:ssXXX")
private LocalDateTime deliveryTime;
private Double totalWeight;
private Double deliveryAmount;
private Double productAmount;
}
@@ -0,0 +1,11 @@
package lingtao.net.vo;
import lombok.Data;
@Data
public class HuaFangTokenVo {
private String accessToken;
private Integer expiresIn;
}
@@ -0,0 +1,13 @@
package lingtao.net.vo;
import lombok.Data;
import java.util.Map;
@Data
public class ShengDaPriceRequstItemVo {
private String name;
private Map<String, String> parameters;
}
@@ -0,0 +1,16 @@
package lingtao.net.vo;
import lombok.Data;
import java.util.List;
@Data
public class ShengDaPriceRequstPartsVo {
private List<ShengDaPriceRequstItemVo> crafts;
private String name;
private Integer num;
private String sizeUnit;
private Double height;
private Double width;
private Integer printSide;
}
@@ -0,0 +1,17 @@
package lingtao.net.vo;
import lombok.Data;
import java.util.List;
@Data
public class ShengDaPriceRequstVo {
private String productCategory;
private String paper;
private List<ShengDaPriceRequstItemVo> baseCrafts;
private List<ShengDaPriceRequstPartsVo> parts;
}
@@ -0,0 +1,19 @@
package lingtao.net.vo;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class ShengDaPriceResultVo {
private Integer errCode;
private String errMsg;
private ResultData data;
@Data
public class ResultData {
private String productCategoryId;
private String productCategoryName;
private Double price;
}
}
@@ -0,0 +1,9 @@
package lingtao.net.vo;
import lombok.Data;
@Data
public class ShengDaTokenVo {
private String type;
private String result;
}
+46
View File
@@ -123,4 +123,50 @@
</value>
</property>
</bean>
<!-- =================配置Redis================= -->
<!-- Redis连接池配置 -->
<bean id="jedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig">
<property name="maxTotal" value="100"/>
<property name="maxIdle" value="20"/>
<property name="maxWaitMillis" value="10000"/>
<property name="testOnBorrow" value="true"/>
</bean>
<!-- Redis连接工厂 -->
<bean id="jedisConnectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory">
<property name="hostName" value="localhost"/>
<property name="port" value="6379"/>
<property name="password" value=""/>
<property name="database" value="0"/>
<property name="poolConfig" ref="jedisPoolConfig"/>
</bean>
<!-- Redis模板 -->
<bean id="redisTemplate" class="org.springframework.data.redis.core.RedisTemplate">
<property name="connectionFactory" ref="jedisConnectionFactory"/>
<property name="keySerializer">
<bean class="org.springframework.data.redis.serializer.StringRedisSerializer"/>
</property>
<property name="valueSerializer">
<bean class="org.springframework.data.redis.serializer.JdkSerializationRedisSerializer"/>
</property>
<property name="hashKeySerializer">
<bean class="org.springframework.data.redis.serializer.StringRedisSerializer"/>
</property>
<property name="hashValueSerializer">
<bean class="org.springframework.data.redis.serializer.JdkSerializationRedisSerializer"/>
</property>
</bean>
<!-- StringRedisTemplate(可选,用于String类型操作) -->
<bean id="stringRedisTemplate" class="org.springframework.data.redis.core.StringRedisTemplate">
<property name="connectionFactory" ref="jedisConnectionFactory"/>
</bean>
<!-- Redis缓存管理器 -->
<bean id="redisCacheManager" class="org.springframework.data.redis.cache.RedisCacheManager">
<constructor-arg name="redisOperations" ref="redisTemplate"/>
<property name="defaultExpiration" value="3600"/>
</bean>
</beans>
@@ -9,8 +9,12 @@
FROM
tbl_information
<where>
1=1
<if test="content != null and content != ''">
content like '%${content}%'
AND content like '%${content}%'
</if>
<if test="type != null and type != ''">
AND type = '${type}'
</if>
</where>
order by id
@@ -46,6 +46,7 @@
and kind2_value = #{kind2Value}
</if>
</where>
LIMIT 1
</select>
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="lingtao.net.dao.StandardMemoMapper">
<select id="getStandardMemos" parameterType="lingtao.net.bean.StandardMemo"
resultType="lingtao.net.bean.StandardMemo">
SELECT
*
FROM
tbl_standard_memo
<where>
1=1
<if test="content != null and content != ''">
and (title like '%${content}%' or content like '%${content}%')
</if>
<if test="type != null and type != ''">
and `type` = #{type}
</if>
</where>
order by id desc
</select>
<insert id="addStandardMemo" parameterType="lingtao.net.bean.StandardMemo">
insert into tbl_standard_memo
(content, createBy, createDate, title, memo, type)
values (#{content}, #{createBy}, now(), #{title}, #{memo}, #{type})
</insert>
<update id="updateStandardMemoById" parameterType="lingtao.net.bean.StandardMemo">
update tbl_standard_memo
<set>
<if test="content != null">
content = #{content,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
updateBy = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateDate != null">
updateDate = now(),
</if>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="memo != null">
memo = #{memo,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<delete id="deleteStandardMemoById">
delete
from tbl_standard_memo
where id = #{id}
</delete>
</mapper>
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="lingtao.net.dao.TipContentMapper">
<select id="getTipContents" parameterType="lingtao.net.bean.TipContent"
resultType="lingtao.net.bean.TipContent">
SELECT
*
FROM
tbl_tip_content
<where>
<if test="content != null and content != ''">
title like '%${content}%' or content like '%${content}%'
</if>
</where>
order by id desc
</select>
<insert id="addTipContent" parameterType="lingtao.net.bean.TipContent">
insert into tbl_tip_content
(content, createBy, createDate, title,attachment,type)
values (#{content}, #{createBy}, now(), #{title}, #{attachment}, #{type})
</insert>
<update id="updateTipContentById" parameterType="lingtao.net.bean.TipContent">
update tbl_tip_content
<set>
<if test="content != null">
content = #{content,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
updateBy = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateDate != null">
updateDate = now(),
</if>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="attachment != null">
attachment = #{attachment,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<delete id="deleteTipContentById">
delete
from tbl_tip_content
where id = #{id}
</delete>
</mapper>
+1 -1
View File
@@ -19,7 +19,7 @@ layui.use(['table','form','carousel'], function(){
for (let i = 0; i < result.length; i++) {
// 只留一个remark
remark = "";
html += '<div><img style="width:'+result[0].imgWidth+'px" src="' +result[i].imgUrl+ '"></div>';
html += '<div><img style="width:100%;height: 100%;object-fit: contain" src="' + result[i].imgUrl + '"></div>';
remark += '<div><span>' +result[i].remark+ '<span/></div>';
}
$("#carousel").append(html);
+1 -1
View File
@@ -22,7 +22,7 @@ layui.use(['element', 'table', 'laydate', 'form'], function () {
'limitName' : 'pageSize' // 分页每页条数默认字段改为pageSize
},*/
where: {
content: ''
type: '1',content: ''
},
cellMinWidth: 80, // 全局定义常规单元格的最小宽度,layui 2.2.1 新增
cols: [[{
+58
View File
@@ -0,0 +1,58 @@
const client = new OSS({
// yourregion填写Bucket所在地域。以华东1(杭州)为例,Region填写为oss-cn-hangzhou。
region: "oss-cn-hangzhou",
// 从环境变量中获取访问凭证。运行本代码示例之前,请确保已设置环境变量OSS_ACCESS_KEY_ID和OSS_ACCESS_KEY_SECRET。
accessKeyId: "LTAI5tE7wuNkeT9jZ42bQnyr",
accessKeySecret: "NnutvWhKl4HbQFSad3HosYbCkEkbjN",
// 填写存储空间名称。
bucket: "ltcloudfile",
endpoint: "https://oss-cn-hangzhou.aliyuncs.com",
});
async function uploadFile(file) {
let fileDir = dateFtt("yyyyMMdd", new Date())
let name = "priceImages/" + fileDir + "/" + guid() + getSuff(file.name);
// 填写Object完整路径。Object完整路径中不能包含Bucket名称。
// 您可以通过自定义文件名(例如exampleobject.txt)或文件完整路径(例如exampledir/exampleobject.txt)的形式实现将数据上传到当前Bucket或Bucket中的指定目录。
// data对象可以自定义为file对象、Blob数据或者OSS Buffer。
const options = {
};
let index = layer.load();
const result = await client.put(name, file, options);
layer.close(index);
return result.url;
}
function dateFtt(fmt, date) {
var o = {
"M+": date.getMonth() + 1, //月份
"d+": date.getDate(), //日
"h+": date.getHours(), //小时
"m+": date.getMinutes(), //分
"s+": date.getSeconds(), //秒
"q+": Math.floor((date.getMonth() + 3) / 3), //季度
"S": date.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
}
for (var k in o) {
if (new RegExp("(" + k + ")").test(fmt))
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
}
return fmt;
}
function getSuff(name) {
return name.substring(name.lastIndexOf("."));
}
function guid() {
return "xxxxxxxx-xxxx-4xxx-yxxx".replace(/[xy]/g, function (c) {
var r = (Math.random() * 16) | 0,
v = c == "x" ? r : (r & 0x3) | 0x8;
return v.toString(16);
});
}
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More