新增拍立得
This commit is contained in:
@@ -497,8 +497,7 @@ public class ProductController {
|
||||
* 根据用户搜索的产品名称获取产品
|
||||
*/
|
||||
@RequestMapping(value = "/getSearchPro")
|
||||
public List<SysDictSearchPro> searchPro(@RequestParam("likeProTypeLabel") String likeProTypeLabel)
|
||||
throws Exception {
|
||||
public List<SysDictSearchPro> searchPro(@RequestParam("likeProTypeLabel") String likeProTypeLabel) throws Exception {
|
||||
List<SysDictSearchPro> proList = productService.searchPro(likeProTypeLabel);
|
||||
return proList;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import lingtao.net.bean.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -12,31 +13,40 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import lingtao.net.bean.SysPermission;
|
||||
import lingtao.net.service.SysPermissionService;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@RequestMapping("/sysPermission")
|
||||
@Controller
|
||||
public class SysPermissionController {
|
||||
|
||||
@Autowired
|
||||
private SysPermissionService sysPermissionService;
|
||||
@Autowired
|
||||
private SysPermissionService sysPermissionService;
|
||||
|
||||
@RequestMapping("/index")
|
||||
public String index() throws Exception {
|
||||
return "system/permission/index";
|
||||
}
|
||||
@RequestMapping("/index")
|
||||
public String index() throws Exception {
|
||||
return "system/permission/index";
|
||||
}
|
||||
|
||||
@RequestMapping("/parentList")
|
||||
@ResponseBody
|
||||
public List<SysPermission> parentList() {
|
||||
return sysPermissionService.getParentPers();
|
||||
}
|
||||
@RequestMapping("/parentList")
|
||||
@ResponseBody
|
||||
public List<SysPermission> parentList() {
|
||||
return sysPermissionService.getParentPers();
|
||||
}
|
||||
|
||||
@RequestMapping("/list")
|
||||
@ResponseBody
|
||||
public Map<String, Object> list() throws Exception {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("code", 0);
|
||||
map.put("msg", null);
|
||||
map.put("data", sysPermissionService.getAll());
|
||||
return map;
|
||||
}
|
||||
@RequestMapping("/persByUserId")
|
||||
@ResponseBody
|
||||
public List<SysPermission> persByUserId(HttpServletRequest request) {
|
||||
SysUser user = (SysUser) request.getSession().getAttribute("USER_SESSION");
|
||||
return sysPermissionService.getPersByUserId(user.getUserId());
|
||||
}
|
||||
|
||||
@RequestMapping("/list")
|
||||
@ResponseBody
|
||||
public Map<String, Object> list() throws Exception {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("code", 0);
|
||||
map.put("msg", null);
|
||||
map.put("data", sysPermissionService.getAll());
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4469,15 +4469,58 @@ public class ProductService {
|
||||
case "地垫":
|
||||
priceList = getFloorMatPrice(dto, width, length, height);
|
||||
return chucklePrice(role, priceList, dto);
|
||||
|
||||
case "滴胶转印贴":
|
||||
priceList = getDippingPrice(dto, width, length, height);
|
||||
return chucklePrice(role, priceList, dto);
|
||||
case "撕拉片":
|
||||
priceList = getTearStripPrice(dto, width, length, height);
|
||||
return chucklePrice(role, priceList, dto);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private List<Product> getTearStripPrice(Product dto, Double width, Double length, Double height) {
|
||||
|
||||
List<String> craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
|
||||
List<Product> priceList = new ArrayList<>();
|
||||
|
||||
int count = dto.getCount();
|
||||
int number = dto.getNumber();
|
||||
double max = Math.max(width, length);
|
||||
double min = Math.min(width, length);
|
||||
int[] counts = {50, 100, 200, 500, 1000, 2000, 3000, 5000, 10000, 20000, 30000, 50000, 100000};
|
||||
double[][] prices_area = {
|
||||
{260, 500, 970, 2090, 4020, 7610, 11100, 18000, 34500, 66200, 96400, 156000, 299000},
|
||||
{260, 500, 970, 2090, 4020, 7610, 11100, 18000, 34500, 66200, 96400, 156000, 299000},
|
||||
{270, 530, 1040, 2250, 4340, 8210, 12000, 19400, 37300, 71500, 104000, 169000, 324000}
|
||||
};
|
||||
if (max == 11 && min == 8.6) {
|
||||
prices_area = new double[][]{
|
||||
{310, 600, 1180, 2590, 4990, 9440, 13800, 22200, 42700, 82000, 120000, 194000, 371000},
|
||||
{310, 600, 1180, 2590, 4990, 9440, 13800, 22200, 42700, 82000, 120000, 194000, 371000},
|
||||
{330, 640, 1250, 2750, 5310, 10100, 14700, 23700, 45500, 87300, 128000, 207000, 394000}
|
||||
};
|
||||
}
|
||||
int current_index = 0;
|
||||
if (craft_list.contains("亮膜")) {
|
||||
current_index = 1;
|
||||
}
|
||||
if (craft_list.contains("触感膜")) {
|
||||
current_index = 2;
|
||||
}
|
||||
|
||||
double price = new PriceUtils().TableCountCenterPrice(count, prices_area[current_index], counts);
|
||||
double design_price = 0;
|
||||
Product pro = new Product();
|
||||
pro.setCount(count);
|
||||
pro.setPrice(Math.ceil(price * number) + design_price);
|
||||
priceList.add(pro);
|
||||
return priceList;
|
||||
}
|
||||
|
||||
private List<Product> getDippingPrice(Product dto, Double width, Double length, Double height) {
|
||||
List<String> craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
|
||||
List<Product> priceList = new ArrayList<>();
|
||||
@@ -5523,9 +5566,9 @@ public class ProductService {
|
||||
if (craft_list.contains("镭射膜")) {
|
||||
crafts.add(new ShengDaPriceRequstItemVo("镭射膜"));
|
||||
}
|
||||
if (craft_list.contains("模切") || craft_list.contains("镂空")) {
|
||||
crafts.add(new ShengDaPriceRequstItemVo("镂空"));
|
||||
}
|
||||
// if (craft_list.contains("模切") || craft_list.contains("镂空")) {
|
||||
// crafts.add(new ShengDaPriceRequstItemVo("镂空"));
|
||||
// }
|
||||
if (craft_list.contains("挂绳")) {
|
||||
ShengDaPriceRequstItemVo baseCrafts = new ShengDaPriceRequstItemVo("挂绳");
|
||||
Map<String, String> map = new HashMap<>();
|
||||
@@ -5796,9 +5839,9 @@ public class ProductService {
|
||||
} else {
|
||||
double area = width * length / 10000 * count * dto.getNumber();
|
||||
double[] areas = {0, 0.1, 0.15, 0.2, 0.3, 0.4, 0.5, 1, 2, 3, 5, 7, 9, 10, 20, 50};
|
||||
int[] prices = {0, 1100, 1000, 950, 900, 850, 800, 750, 700, 650, 600, 550, 500, 480, 470, 460};
|
||||
int[] prices = {0, 1300, 1200, 1150, 1100, 1050, 1000, 950, 900, 850, 800, 750, 700, 680, 670, 660};
|
||||
if ("4".equals(dto.getKindValue())) {
|
||||
prices = new int[]{0, 1130, 1030, 980, 930, 880, 830, 780, 730, 680, 630, 580, 530, 510, 500, 490};
|
||||
prices = new int[]{0, 1330, 1230, 1180, 1130, 1080, 1030, 980, 930, 880, 830, 780, 730, 710, 700, 690};
|
||||
}
|
||||
double last_price = 450;
|
||||
price = PriceUtils.TableUnitPrice(area, prices, areas, last_price);
|
||||
@@ -5807,10 +5850,10 @@ public class ProductService {
|
||||
}
|
||||
double craft_price = 0;
|
||||
if (!StringUtils.isEmpty(dto.getBianma())) {
|
||||
double craft_base = 0.1;
|
||||
if ("圆型钥匙扣银色".equals(dto.getBianma()) || "珠链银色".equals(dto.getBianma())) {
|
||||
craft_base = 0;
|
||||
}
|
||||
double craft_base = 0.2;
|
||||
// if ("圆型钥匙扣银色".equals(dto.getBianma()) || "珠链银色".equals(dto.getBianma())) {
|
||||
// craft_base = 0;
|
||||
// }
|
||||
craft_price = Math.ceil(craft_base * count * dto.getNumber());
|
||||
}
|
||||
String weight = df.format(width * length * 4.17 * dto.getCount() * 0.1 * number / 1000 * 2);
|
||||
|
||||
Reference in New Issue
Block a user