Compare commits
161 Commits
unit_price
...
59119cab4c
| Author | SHA1 | Date | |
|---|---|---|---|
| 59119cab4c | |||
| e795cbe1d9 | |||
| 71c7722514 | |||
| 3f08207873 | |||
| 80d71369b5 | |||
| 3e549c1856 | |||
| 62dfd679b0 | |||
| 0c51492dc6 | |||
| 4c9befc831 | |||
| 2a6a05fd87 | |||
| 8992a51c7f | |||
| 99067b19d1 | |||
| 0d6813c501 | |||
| 9c9f127df6 | |||
| 6795b6f4ff | |||
| 4a46014f91 | |||
| e8a0669db7 | |||
| c6a6c2c682 | |||
| 162c230bf4 | |||
| 4cdabba8a0 | |||
| ab1e443e4b | |||
| 03d7d8808e | |||
| 44934a92c7 | |||
| 3abc4938de | |||
| 451a226990 | |||
| fe42ba31a1 | |||
| 4eeb45b64c | |||
| 8ea3cc18c9 | |||
| 3da5fa97a8 | |||
| 5a713e8160 | |||
| fea143f0e1 | |||
| 929ee2b0b1 | |||
| 1d4cea0b9a | |||
| 2012ad0a80 | |||
| af49257000 | |||
| 6b9c9feefb | |||
| ee17035e69 | |||
| b1d63d3087 | |||
| 64e2c7062d | |||
| f8374b1be3 | |||
| 7b2f033fe6 | |||
| b2d74bf0f3 | |||
| 8dbc3653a1 | |||
| 2733b250ad | |||
| ff9acb4bfb | |||
| 88c810f37f | |||
| 85888d79f8 | |||
| fd44d8f3e3 | |||
| 928a247c10 | |||
| 03c70c9598 | |||
| d6d264e86e | |||
| cdb2c65ce5 | |||
| 83adacb25d | |||
| fc44f05cd6 | |||
| 6352b8eab0 | |||
| b66c025cf8 | |||
| a204336b58 | |||
| 1929ebbfa3 | |||
| 8de1785270 | |||
| 9e4cd87a59 | |||
| 614388da7f | |||
| 95b8905ff4 | |||
| 694f46ba75 | |||
| 01d022ec76 | |||
| 6bb12bfc6a | |||
| 79c764ad78 | |||
| ba14bb9f0d | |||
| ba74fd7beb | |||
| f4319613e4 | |||
| 4b1a74bf13 | |||
| 2099f32634 | |||
| 8e1d6b5185 | |||
| d622d5b937 | |||
| de99f53f4b | |||
| 23465fcf3b | |||
| 493749f355 | |||
| 4fb8007f22 | |||
| b6c8ccb6cc | |||
| 69da79dd9c | |||
| d7a0917083 | |||
| 1c7a3def12 | |||
| cb734e7d8f | |||
| d24a4b9ee9 | |||
| b5cb6cd1b0 | |||
| d7001df657 | |||
| a306bca245 | |||
| 1633d9b102 | |||
| 6ce28bae01 | |||
| 58a1eecc62 | |||
| 028cc4103a | |||
| 2b7203a04a | |||
| 30af805f2f | |||
| 32310477d6 | |||
| f74e72958f | |||
| c3709a00dc | |||
| 44060ca68a | |||
| 3700a33cb8 | |||
| 3ffbfdee17 | |||
| 6ddf69dfc8 | |||
| 31ed14ceed | |||
| f2bd6f368c | |||
| fc23b9d62e | |||
| 65788e1df5 | |||
| 0bcd250a9a | |||
| 3e8d220a9c | |||
| 73eb1bc88a | |||
| 4b0e45b1c6 | |||
| 8fc6cdcd8b | |||
| 4a7fd6e2cc | |||
| 9480d75507 | |||
| 653e1bd831 | |||
| 842638ac67 | |||
| ed43cff130 | |||
| 2037bdf57d | |||
| 65d1b08293 | |||
| d77e26f423 | |||
| f3eaf66d56 | |||
| 46eaf4f726 | |||
| 851dfb9f53 | |||
| e48066dd0e | |||
| 0ab421eb9c | |||
| 8207377e6e | |||
| 2729347d90 | |||
| 639d1c27ef | |||
| 73e2d3777b | |||
| 8f649d572e | |||
| 207221a621 | |||
| 41b4f5fba5 | |||
| 662d2b010e | |||
| b0f83939d6 | |||
| 84970ee98f | |||
| 9c2b25287a | |||
| f9f42680be | |||
| fc8ac0f2ce | |||
| f6c39a234a | |||
| dc964b8cd7 | |||
| b40da3a612 | |||
| f0024fd1b7 | |||
| fbc6db905f | |||
| 05c2a4b66a | |||
| efa81c4d2c | |||
| a4de210c79 | |||
| c59a113add | |||
| 520466e7dd | |||
| ce095f4b7f | |||
| 656c3e2db6 | |||
| ac80841ff3 | |||
| 12a237bf53 | |||
| 08d4115ff5 | |||
| ab9ab9ca8d | |||
| 58c7ea9e36 | |||
| 20e61c01fd | |||
| e9c03666dc | |||
| 17f6c8bdaa | |||
| 05b89aba22 | |||
| 114d8f1449 | |||
| 72dca49bd2 | |||
| ce1c198047 | |||
| 764f3117f2 | |||
| 0cc4e97526 | |||
| 0828111404 |
@@ -1,2 +1,3 @@
|
||||
.idea/*
|
||||
target/*
|
||||
.vscode/*
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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>
|
||||
@@ -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);
|
||||
|
||||
@@ -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: [[{
|
||||
|
||||
@@ -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
+58353
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.
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
Reference in New Issue
Block a user