zhuyiyi 6 сар өмнө
parent
commit
d188743f49

+ 137 - 138
src/main/java/lingtao/net/bean/SysUser.java

@@ -6,203 +6,202 @@ import lombok.Data;
 
 /**
  * 用户
- * 
- * @author Administrator
  *
+ * @author Administrator
  */
 @Data
 public class SysUser {
-	private Integer userId;
+    private Integer userId;
 
-	public Integer getUserId() {
-		return userId;
-	}
+    public Integer getUserId() {
+        return userId;
+    }
 
-	public void setUserId(Integer userId) {
-		this.userId = userId;
-	}
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
 
-	public String getRealname() {
-		return realname;
-	}
+    public String getRealname() {
+        return realname;
+    }
 
-	public void setRealname(String realname) {
-		this.realname = realname;
-	}
+    public void setRealname(String realname) {
+        this.realname = realname;
+    }
 
-	public String getUsername() {
-		return username;
-	}
+    public String getUsername() {
+        return username;
+    }
 
-	public void setUsername(String username) {
-		this.username = username;
-	}
+    public void setUsername(String username) {
+        this.username = username;
+    }
 
-	public String getPassword() {
-		return password;
-	}
+    public String getPassword() {
+        return password;
+    }
 
-	public void setPassword(String password) {
-		this.password = password;
-	}
+    public void setPassword(String password) {
+        this.password = password;
+    }
 
-	public String getUserStatus() {
-		return userStatus;
-	}
+    public String getUserStatus() {
+        return userStatus;
+    }
 
-	public void setUserStatus(String userStatus) {
-		this.userStatus = userStatus;
-	}
+    public void setUserStatus(String userStatus) {
+        this.userStatus = userStatus;
+    }
 
-	public String getRole() {
-		return role;
-	}
+    public String getRole() {
+        return role;
+    }
 
-	public void setRole(String role) {
-		this.role = role;
-	}
+    public void setRole(String role) {
+        this.role = role;
+    }
 
-	public String getSysStatus() {
-		return sysStatus;
-	}
+    public String getSysStatus() {
+        return sysStatus;
+    }
 
-	public void setSysStatus(String sysStatus) {
-		this.sysStatus = sysStatus;
-	}
+    public void setSysStatus(String sysStatus) {
+        this.sysStatus = sysStatus;
+    }
 
-	public String getReadLogStatus() {
-		return readLogStatus;
-	}
+    public String getReadLogStatus() {
+        return readLogStatus;
+    }
 
-	public void setReadLogStatus(String readLogStatus) {
-		this.readLogStatus = readLogStatus;
-	}
+    public void setReadLogStatus(String readLogStatus) {
+        this.readLogStatus = readLogStatus;
+    }
 
-	public String getCreateBy() {
-		return createBy;
-	}
+    public String getCreateBy() {
+        return createBy;
+    }
 
-	public void setCreateBy(String createBy) {
-		this.createBy = createBy;
-	}
+    public void setCreateBy(String createBy) {
+        this.createBy = createBy;
+    }
 
-	public Date getCreateDate() {
-		return createDate;
-	}
+    public Date getCreateDate() {
+        return createDate;
+    }
 
-	public void setCreateDate(Date createDate) {
-		this.createDate = createDate;
-	}
+    public void setCreateDate(Date createDate) {
+        this.createDate = createDate;
+    }
 
-	public String getUpdateBy() {
-		return updateBy;
-	}
+    public String getUpdateBy() {
+        return updateBy;
+    }
 
-	public void setUpdateBy(String updateBy) {
-		this.updateBy = updateBy;
-	}
+    public void setUpdateBy(String updateBy) {
+        this.updateBy = updateBy;
+    }
 
-	public Date getUpdateDate() {
-		return updateDate;
-	}
+    public Date getUpdateDate() {
+        return updateDate;
+    }
 
-	public void setUpdateDate(Date updateDate) {
-		this.updateDate = updateDate;
-	}
+    public void setUpdateDate(Date updateDate) {
+        this.updateDate = updateDate;
+    }
 
-	public String getBirthDay() {
-		return birthDay;
-	}
+    public String getBirthDay() {
+        return birthDay;
+    }
 
-	public void setBirthDay(String birthDay) {
-		this.birthDay = birthDay;
-	}
+    public void setBirthDay(String birthDay) {
+        this.birthDay = birthDay;
+    }
 
-	public String getBirthType() {
-		return birthType;
-	}
+    public String getBirthType() {
+        return birthType;
+    }
 
-	public void setBirthType(String birthType) {
-		this.birthType = birthType;
-	}
+    public void setBirthType(String birthType) {
+        this.birthType = birthType;
+    }
 
-	public Integer getIsBirthDay() {
-		return isBirthDay;
-	}
+    public Integer getIsBirthDay() {
+        return isBirthDay;
+    }
 
-	public void setIsBirthDay(Integer isBirthDay) {
-		this.isBirthDay = isBirthDay;
-	}
+    public void setIsBirthDay(Integer isBirthDay) {
+        this.isBirthDay = isBirthDay;
+    }
 
-	public String getEntryDate() {
-		return entryDate;
-	}
+    public String getEntryDate() {
+        return entryDate;
+    }
 
-	public void setEntryDate(String entryDate) {
-		this.entryDate = entryDate;
-	}
+    public void setEntryDate(String entryDate) {
+        this.entryDate = entryDate;
+    }
 
-	public String getNeedIp() {
-		return needIp;
-	}
+    public String getNeedIp() {
+        return needIp;
+    }
 
-	public void setNeedIp(String needIp) {
-		this.needIp = needIp;
-	}
+    public void setNeedIp(String needIp) {
+        this.needIp = needIp;
+    }
 
-	public String getRoleSearch() {
-		return roleSearch;
-	}
+    public String getRoleSearch() {
+        return roleSearch;
+    }
 
-	public void setRoleSearch(String roleSearch) {
-		this.roleSearch = roleSearch;
-	}
+    public void setRoleSearch(String roleSearch) {
+        this.roleSearch = roleSearch;
+    }
 
-	public String[] getRoleArr() {
-		return roleArr;
-	}
+    public String[] getRoleArr() {
+        return roleArr;
+    }
 
-	public void setRoleArr(String[] roleArr) {
-		this.roleArr = roleArr;
-	}
+    public void setRoleArr(String[] roleArr) {
+        this.roleArr = roleArr;
+    }
 
-	private String realname;
+    private String realname;
 
-	private String username;
+    private String username;
 
-	private String password;
+    private String password;
 
-	private String userStatus;
+    private String userStatus;
 
-	private String role;
+    private String role;
 
-	private String sysStatus;
+    private String sysStatus;
 
-	private String readLogStatus;
+    private String readLogStatus;
 
-	private String createBy;
+    private String createBy;
 
-	private Date createDate;
+    private Date createDate;
 
-	private String updateBy;
+    private String updateBy;
 
-	private Date updateDate;
+    private Date updateDate;
 
-	private String birthDay;
+    private String birthDay;
 
-	private String birthType;
+    private String birthType;
 
-	private Integer isBirthDay;
+    private Integer isBirthDay;
 
-	private String entryDate;
+    private String entryDate;
 
-	// 是否需要判断IP 0:否 1:是
-	private String needIp;
+    // 是否需要判断IP 0:否 1:是
+    private String needIp;
 
-	// 根据角色查找用户
-	private String roleSearch;
+    // 根据角色查找用户
+    private String roleSearch;
 
-	// 用户所拥有角色数组
-	private String[] roleArr;
+    // 用户所拥有角色数组
+    private String[] roleArr;
 
 }

+ 91 - 19
src/main/java/lingtao/net/service/ProductService.java

@@ -4658,31 +4658,103 @@ public class ProductService {
                 double[] areas = {1, 4, 6, 9, 12, 16, 20, 25, 36, 45, 48.6, 54, 60, 72, 81};
 
                 area = length * width;
-                for (int i = 0; i < count_list.length; i++) {
-                    int count_item = count_list[i];
-                    if (priceList.size() > 2) {
-                        break;
-                    }
-                    if (count > count_item) {
-                        continue;
-                    }
-                    int count_index = Arrays.binarySearch(count_list, count_item);
-                    price = 0;
-                    if (count_index >= 0) {
-                        price = new PriceUtils().TablePrice(area, prices[count_index], areas);
-                    }
-                    Product product = new Product();
-                    product.setCount(count_item);
-                    product.setPrice(Math.ceil(price * number));
-                    priceList.add(product);
-                }
-                return priceList;
+                return getAreaCenterPrice(count_list, count, area, prices, areas, number);
+            case "透卡":
+                prices = new int[][]{
+                        {136, 163, 177, 190, 197, 227, 257, 303, 333, 407, 430},
+                        {193, 250, 277, 300, 313, 373, 433, 530, 587, 733, 780},
+                        {250, 337, 373, 410, 430, 520, 613, 757, 840, 1063, 1133},
+                        {307, 423, 473, 523, 547, 670, 790, 983, 1097, 1390, 1483},
+                        {333, 463, 520, 573, 603, 737, 873, 1090, 1210, 1540, 1643},
+                        {490, 697, 783, 873, 917, 1133, 1350, 1693, 1890, 2417, 2580},
+                        {533, 760, 857, 953, 1003, 1237, 1477, 1853, 2067, 2643, 2823},
+                        {990, 1440, 1633, 1830, 1927, 2397, 2873, 3627, 4057, 5207, 5567},
+                        {2007, 2943, 3347, 3747, 3950, 4927, 5910, 7473, 8367, 10743, 11490},
+                        {3013, 4413, 5013, 5613, 5913, 7373, 8847, 11180, 12513, 14077, 16007},
+                };
+                count_list = new int[]{100, 200, 300, 400, 500, 800, 1000, 2000, 5000, 10000};
+                areas = new double[]{22.5, 35.1, 40.5, 45.9, 48.6, 67.75, 75, 96, 108, 140, 150};
+                area = length * width;
+                return getAreaCenterPrice(count_list, count, area, prices, areas, number);
+            case "澜达海报":
+                //铜版纸200g (售价)
+                prices = new int[][]{
+                        {90, 90, 90, 90, 90, 94, 94, 94, 94},
+                        {100, 100, 100, 100, 100, 187, 187, 187, 187},
+                        {140, 140, 140, 140, 140, 280, 280, 280, 280},
+                        {187, 187, 187, 187, 187, 374, 374, 374, 374},
+                        {234, 234, 234, 234, 234, 467, 467, 467, 467},
+                        {467, 467, 467, 467, 467, 934, 934, 934, 934},
+                        {934, 934, 934, 934, 934, 1867, 1867, 1867, 1867},
+                        {2334, 2334, 2334, 2334, 2334, 4667, 4667, 4667, 4667},
+                        {4667, 4667, 4667, 4667, 4667, 9334, 9334, 9334, 9334},
+                        {9334, 9334, 9334, 9334, 9334, 18667, 18667, 18667, 18667},
+                        {23334, 23334, 23334, 23334, 23334, 46667, 46667, 46667, 46667},
+                };
+                if ("2".equals(dto.getKind())) {
+                    prices = new int[][]{
+                            {90, 90, 90, 90, 90, 107, 107, 107, 107},
+                            {100, 107, 107, 107, 107, 213, 213, 213, 213},
+                            {120, 160, 160, 160, 160, 320, 320, 320, 320},
+                            {150, 213, 213, 213, 213, 427, 427, 427, 427},
+                            {139, 267, 267, 267, 267, 533, 533, 533, 533},
+                            {267, 533, 533, 533, 533, 1067, 1067, 1067, 1067},
+                            {533, 1067, 1067, 1067, 1067, 2133, 2133, 2133, 2133},
+                            {1333, 2667, 2667, 2667, 2667, 5333, 5333, 5333, 5333},
+                            {2667, 5333, 5333, 5333, 5333, 10667, 10667, 10667, 10667},
+                            {5333, 10667, 10667, 10667, 10667, 21333, 21333, 21333, 21333},
+                            {13333, 26667, 26667, 26667, 26667, 53333, 53333, 53333, 53333},
+                    };
+                }
+                if ("3".equals(dto.getKind())) {
+                    prices = new int[][]{
+                            {90, 90, 90, 90, 90, 150, 150, 150, 150},
+                            {100, 140, 140, 150, 150, 300, 300, 300, 300},
+                            {110, 207, 207, 223, 223, 447, 447, 447, 447},
+                            {140, 277, 277, 300, 300, 597, 597, 597, 597},
+                            {180, 347, 347, 373, 373, 747, 747, 747, 747},
+                            {347, 693, 693, 747, 747, 1493, 1493, 1493, 1493},
+                            {693, 1387, 1387, 1493, 1493, 2987, 2987, 2987, 2987},
+                            {1733, 3467, 3467, 3733, 3733, 7467, 7467, 7467, 7467},
+                            {3467, 6933, 6933, 7467, 7467, 14933, 14933, 14933, 14933},
+                            {6933, 13867, 13867, 14933, 14933, 29867, 29867, 29867, 29867},
+                            {17333, 34667, 34667, 37333, 37333, 74667, 74667, 74667, 74667},
+                    };
+                }
+                count_list = new int[]{10, 20, 30, 40, 50, 100, 200, 500, 1000, 2000, 5000};
+                areas = new double[]{1197, 1716, 2394, 2596, 3430, 3467.1, 4788, 5192, 6860};
+                area = length * width;
+
+                return getAreaCenterPrice(count_list, count, area, prices, areas, number);
             default:
                 break;
         }
         return null;
     }
 
+    private List<Product> getAreaCenterPrice(int[] count_list, int count, double area, int[][] prices, double[] areas, int number) {
+        List<Product> priceList = new ArrayList<>();
+        for (int i = 0; i < count_list.length; i++) {
+            int count_item = count_list[i];
+            if (priceList.size() > 2) {
+                break;
+            }
+            if (count > count_item) {
+                continue;
+            }
+            int count_index = Arrays.binarySearch(count_list, count_item);
+            double price = 0;
+            if (count_index >= 0) {
+                price = new PriceUtils().TablePrice(area, prices[count_index], areas);
+            }
+            Product product = new Product();
+            product.setCount(count_item);
+            product.setPrice(Math.ceil(price * number));
+            priceList.add(product);
+        }
+        return priceList;
+    }
+
     private List<Product> lessSticker(Product dto, String kind, Integer number, Double width, Double length,
                                       int count, List<Product> stickersList, String role) {
         double price = 0.0;

+ 226 - 225
src/main/java/lingtao/net/service/SysUserService.java

@@ -18,252 +18,253 @@ import lingtao.net.util.MD5Util;
 @Service
 public class SysUserService {
 
-	@Autowired
-	private SysUserMapper userMapper;
+    @Autowired
+    private SysUserMapper userMapper;
 
-	// 注册
-	public Msg register(SysUser user) {
-		user.setPassword(new MD5Util().md5(user.getPassword(), "lingtao"));
-		user.setCreateDate(new Date());
-		// 注册的用户都是未激活状态
-		user.setUserStatus("0");
-		// 注册的用户都是系统功能隐藏状态
-		user.setSysStatus("0");
-		// 注册的用户不需要判断IP
-		user.setNeedIp("1");
-		String roleId = user.getRole();
-		if (StringUtils.isEmpty(roleId))
-			return null;
-		// 给用户赋予角色
-		user.setRole("999," + roleId);
-		// user.setRole("999");
-		// Integer[] ids = {999};
-		int count = userMapper.insertSelective(user);
-		// 根据角色的id把角色的权限给用户
-		Integer[] ids = { 999, Integer.valueOf(roleId) };
-		// 新增用户后会自动回补id
-		Integer userId = user.getUserId();
-		userMapper.addUserRoles(userId, ids);
-		if (count < 0) {
-			return Msg.fail();
-		}
-		return Msg.success();
-	}
+    // 注册
+    public Msg register(SysUser user) {
+        user.setPassword(new MD5Util().md5(user.getPassword(), "lingtao"));
+        user.setCreateDate(new Date());
+        // 注册的用户都是未激活状态
+        user.setUserStatus("0");
+        // 注册的用户都是系统功能隐藏状态
+        user.setSysStatus("0");
+        // 注册的用户不需要判断IP
+        user.setNeedIp("1");
+        String roleId = user.getRole();
+        if (StringUtils.isEmpty(roleId))
+            return null;
+        // 给用户赋予角色
+        user.setRole("999," + roleId);
+        // user.setRole("999");
+        // Integer[] ids = {999};
+        int count = userMapper.insertSelective(user);
+        // 根据角色的id把角色的权限给用户
+        Integer[] ids = {999, Integer.valueOf(roleId)};
+        // 新增用户后会自动回补id
+        Integer userId = user.getUserId();
+        userMapper.addUserRoles(userId, ids);
+        if (count < 0) {
+            return Msg.fail();
+        }
+        return Msg.success();
+    }
 
-	public List<SysUser> getUsers(SysUser user) {
-		// 用户所拥有的角色
-		String[] roleArr = user.getRole().split(",");
-		// 转成list,拿掉‘组长’身份
-		List<String> list = new ArrayList<String>(Arrays.asList(roleArr));
-		// 判断是否拥有超管身份标识
-		boolean isSuper = false;
-		for (int i = 0; i < roleArr.length; i++) {
-			// 有‘超级管理员’身份,状态改为true
-			if ("1".equals(roleArr[i])) {
-				isSuper = true;
-				break;
-			}
+    public List<SysUser> getUsers(SysUser user) {
+        // 用户所拥有的角色
+        String[] roleArr = user.getRole().split(",");
+        // 转成list,拿掉‘组长’身份
+        List<String> list = new ArrayList<String>(Arrays.asList(roleArr));
+        // 判断是否拥有超管身份标识
+        boolean isSuper = false;
+        for (int i = 0; i < roleArr.length; i++) {
+            // 有‘超级管理员’身份,状态改为true
+            if ("1".equals(roleArr[i])) {
+                isSuper = true;
+                break;
+            }
 
-			// 如果有【店长/考试审核员/客服/组长/IP管理员/操作日志/不填旺旺】身份,去掉。不带去查询
-			if ("666".equals(roleArr[i]) || "888".equals(roleArr[i]) || "999".equals(roleArr[i])
-					|| "1011".equals(roleArr[i]) || "1015".equals(roleArr[i]) || "1042".equals(roleArr[i])
-					|| "1049".equals(roleArr[i])) {
-				list.remove(roleArr[i]);
-			}
-		}
-		// 将list转为String[] 数组
-		roleArr = list.toArray(new String[list.size()]);
+            // 如果有【店长/考试审核员/客服/组长/IP管理员/操作日志/不填旺旺】身份,去掉。不带去查询
+            if ("666".equals(roleArr[i]) || "888".equals(roleArr[i]) || "999".equals(roleArr[i])
+                    || "1011".equals(roleArr[i]) || "1015".equals(roleArr[i]) || "1042".equals(roleArr[i])
+                    || "1049".equals(roleArr[i])) {
+                list.remove(roleArr[i]);
+            }
+        }
+        // 将list转为String[] 数组
+        roleArr = list.toArray(new String[list.size()]);
 
-		// 如果没有‘超级管理员’身份,只能看到负责的部门的用户;如果有可以看到所有用户
-		if (!isSuper) {
-			// 如果是通过‘用户角色’查询
-			if (StringUtils.isNotEmpty(user.getRoleSearch())) {
-				// 清除自己拥有的角色,防止查询出所有的部门数据
-				roleArr = null;
-			}
-			// 如果有多个
-			if (user.getRole().contains(",")) {
-				user.setRoleArr(roleArr);
-			} else {// 只有一个角色
-				user.setRoleSearch(user.getRole());
-			}
-		}
+        // 如果没有‘超级管理员’身份,只能看到负责的部门的用户;如果有可以看到所有用户
+        if (!isSuper) {
+            // 如果是通过‘用户角色’查询
+            if (StringUtils.isNotEmpty(user.getRoleSearch())) {
+                // 清除自己拥有的角色,防止查询出所有的部门数据
+                roleArr = null;
+            }
+            // 如果有多个
+            if (user.getRole().contains(",")) {
+                user.setRoleArr(roleArr);
+            } else {// 只有一个角色
+                user.setRoleSearch(user.getRole());
+            }
+        }
 
-		return userMapper.getUsers(user);
-	}
+        return userMapper.getUsers(user);
+    }
 
-	// 检查用户名是否存在
-	public Msg checkUsername(String username) {
-		SysUser user = userMapper.getUserByUsername(username);
-		if (user != null) {
-			return Msg.fail();
-		}
-		return Msg.success();
-	}
+    // 检查用户名是否存在
+    public Msg checkUsername(String username) {
+        SysUser user = userMapper.getUserByUsername(username);
+        if (user != null) {
+            return Msg.fail();
+        }
+        return Msg.success();
+    }
 
-	// 新增
-	public Msg addUser(SysUser user) {
-		user.setPassword(new MD5Util().md5(user.getPassword(), "lingtao"));
-		user.setCreateDate(new Date());
-		try {
-			userMapper.insertSelective(user);
-			return Msg.success();
-		} catch (Exception e) {
-			return Msg.fail();
-		}
-	}
+    // 新增
+    public Msg addUser(SysUser user) {
+        user.setPassword(new MD5Util().md5(user.getPassword(), "lingtao"));
+        user.setCreateDate(new Date());
+        user.setSysStatus("2");
+        try {
+            userMapper.insertSelective(user);
+            return Msg.success();
+        } catch (Exception e) {
+            return Msg.fail();
+        }
+    }
 
-	// 修改
-	public Msg updateUserById(SysUser user) {
-		if (!"********".equals(user.getPassword())) { // 如果改过密码
-			user.setPassword(new MD5Util().md5(user.getPassword(), "lingtao"));
-		} else {
-			user.setPassword(null);
-		}
-		// 如果有【店长】身份,更改的角色前面添加【客服】
-		SysUser user2 = (SysUser) SecurityUtils.getSubject().getPrincipal();
-		boolean flag = false;
-		String[] role = user2.getRole().split(",");
-		for (int i = 0; i < role.length; i++) {
-			if ("666".equals(role[i])) {
-				flag = true;
-				break;
-			}
-		}
-		if (flag) {
-			user.setRole("999," + user.getRole());
-		}
-		user.setUpdateDate(new Date());
-		try {
-			userMapper.updateByPrimaryKeySelective(user);
-			return Msg.success();
-		} catch (Exception e) {
-			return Msg.fail();
-		}
-	}
+    // 修改
+    public Msg updateUserById(SysUser user) {
+        if (!"********".equals(user.getPassword())) { // 如果改过密码
+            user.setPassword(new MD5Util().md5(user.getPassword(), "lingtao"));
+        } else {
+            user.setPassword(null);
+        }
+        // 如果有【店长】身份,更改的角色前面添加【客服】
+        SysUser user2 = (SysUser) SecurityUtils.getSubject().getPrincipal();
+        boolean flag = false;
+        String[] role = user2.getRole().split(",");
+        for (int i = 0; i < role.length; i++) {
+            if ("666".equals(role[i])) {
+                flag = true;
+                break;
+            }
+        }
+        if (flag) {
+            user.setRole("999," + user.getRole());
+        }
+        user.setUpdateDate(new Date());
+        try {
+            userMapper.updateByPrimaryKeySelective(user);
+            return Msg.success();
+        } catch (Exception e) {
+            return Msg.fail();
+        }
+    }
 
-	// 删除用户
-	public Msg deleteUserById(Integer userId) {
-		try {
-			userMapper.deleteByPrimaryKey(userId);
-			return Msg.success();
-		} catch (Exception e) {
-			return Msg.fail("主外键关联,删除失败!");
-		}
-	}
+    // 删除用户
+    public Msg deleteUserById(Integer userId) {
+        try {
+            userMapper.deleteByPrimaryKey(userId);
+            return Msg.success();
+        } catch (Exception e) {
+            return Msg.fail("主外键关联,删除失败!");
+        }
+    }
 
-	// 改变用户状态
-	public Msg changeUserStatus(Integer userId) {
-		try {
-			userMapper.changeUserStatus(userId);
-			return Msg.success();
-		} catch (Exception e) {
-			return Msg.fail();
-		}
-	}
+    // 改变用户状态
+    public Msg changeUserStatus(Integer userId) {
+        try {
+            userMapper.changeUserStatus(userId);
+            return Msg.success();
+        } catch (Exception e) {
+            return Msg.fail();
+        }
+    }
 
-	public void addUserRoles(Integer userId, Integer[] ids) {
-		userMapper.addUserRoles(userId, ids);
-	}
+    public void addUserRoles(Integer userId, Integer[] ids) {
+        userMapper.addUserRoles(userId, ids);
+    }
 
-	public void deleteUserRoles(Integer userId) {
-		userMapper.deleteUserRoles(userId);
-	}
+    public void deleteUserRoles(Integer userId) {
+        userMapper.deleteUserRoles(userId);
+    }
 
-	public Msg updatePassword(SysUser user) {
-		user.setPassword(new MD5Util().md5(user.getPassword(), "lingtao"));
-		int i = userMapper.updateByPrimaryKeySelective(user);
-		if (i > 0) {
-			return Msg.success();
-		}
-		return Msg.fail();
-	}
+    public Msg updatePassword(SysUser user) {
+        user.setPassword(new MD5Util().md5(user.getPassword(), "lingtao"));
+        int i = userMapper.updateByPrimaryKeySelective(user);
+        if (i > 0) {
+            return Msg.success();
+        }
+        return Msg.fail();
+    }
 
-	public Msg addBirthDay(SysUser user) {
-		SysUser sysUser = (SysUser) SecurityUtils.getSubject().getPrincipal();
-		user.setUserId(sysUser.getUserId());
-		user.setIsBirthDay(0);
-		int i = userMapper.updateByPrimaryKeySelective(user);
-		if (i > 0) {
-			return Msg.success();
-		}
-		return Msg.fail();
-	}
+    public Msg addBirthDay(SysUser user) {
+        SysUser sysUser = (SysUser) SecurityUtils.getSubject().getPrincipal();
+        user.setUserId(sysUser.getUserId());
+        user.setIsBirthDay(0);
+        int i = userMapper.updateByPrimaryKeySelective(user);
+        if (i > 0) {
+            return Msg.success();
+        }
+        return Msg.fail();
+    }
 
-	// 改变用户生日状态
-	public Msg changeIsBirthDay(Integer userId) {
-		try {
-			userMapper.changeIsBirthDay(userId);
-			return Msg.success();
-		} catch (Exception e) {
-			return Msg.fail();
-		}
-	}
+    // 改变用户生日状态
+    public Msg changeIsBirthDay(Integer userId) {
+        try {
+            userMapper.changeIsBirthDay(userId);
+            return Msg.success();
+        } catch (Exception e) {
+            return Msg.fail();
+        }
+    }
 
-	public Msg changeNeedIp() {
-		try {
-			userMapper.changeNeedIp();
-			return Msg.success();
-		} catch (Exception e) {
-			return Msg.fail();
-		}
-	}
+    public Msg changeNeedIp() {
+        try {
+            userMapper.changeNeedIp();
+            return Msg.success();
+        } catch (Exception e) {
+            return Msg.fail();
+        }
+    }
 
-	// 改变用户系统状态(管理员调整)
-	public Msg changeSysStatus(Integer userId) {
-		try {
-			userMapper.changeSysStatus(userId);
-			return Msg.success();
-		} catch (Exception e) {
-			return Msg.fail();
-		}
-	}
+    // 改变用户系统状态(管理员调整)
+    public Msg changeSysStatus(Integer userId) {
+        try {
+            userMapper.changeSysStatus(userId);
+            return Msg.success();
+        } catch (Exception e) {
+            return Msg.fail();
+        }
+    }
 
-	// 改变用户系统状态(看完视频)
-	public Msg videoOverToChangeSysStatus(Integer userId) {
-		try {
-			userMapper.videoOverToChangeSysStatus(userId);
-			return Msg.success();
-		} catch (Exception e) {
-			return Msg.fail();
-		}
-	}
+    // 改变用户系统状态(看完视频)
+    public Msg videoOverToChangeSysStatus(Integer userId) {
+        try {
+            userMapper.videoOverToChangeSysStatus(userId);
+            return Msg.success();
+        } catch (Exception e) {
+            return Msg.fail();
+        }
+    }
 
-	// 改变用户系统状态(答题通过)
-	public Msg examOverToChangeSysStatus(Integer userId) {
-		try {
-			userMapper.examOverToChangeSysStatus(userId);
-			return Msg.success();
-		} catch (Exception e) {
-			return Msg.fail();
-		}
-	}
+    // 改变用户系统状态(答题通过)
+    public Msg examOverToChangeSysStatus(Integer userId) {
+        try {
+            userMapper.examOverToChangeSysStatus(userId);
+            return Msg.success();
+        } catch (Exception e) {
+            return Msg.fail();
+        }
+    }
 
-	// 改变阅读更新日志状态
-	public Msg changeReadLogStatus(Integer userId) {
-		try {
-			userMapper.changeReadLogStatus(userId);
-			return Msg.success();
-		} catch (Exception e) {
-			return Msg.fail();
-		}
-	}
+    // 改变阅读更新日志状态
+    public Msg changeReadLogStatus(Integer userId) {
+        try {
+            userMapper.changeReadLogStatus(userId);
+            return Msg.success();
+        } catch (Exception e) {
+            return Msg.fail();
+        }
+    }
 
-	public SysUser getUserInfo(Integer userId) {
-		try {
-			return userMapper.getUserInfo(userId);
-		} catch (Exception e) {
-			return null;
-		}
-	}
+    public SysUser getUserInfo(Integer userId) {
+        try {
+            return userMapper.getUserInfo(userId);
+        } catch (Exception e) {
+            return null;
+        }
+    }
 
-	/**
-	 * 客服数据 -- 根据搜索的店铺获取人员
-	 * 
-	 * @return
-	 */
-	public List<SysUser> getRealnamesByShopname(String shopname) {
-		return userMapper.getRealnamesByShopname(shopname);
-	}
+    /**
+     * 客服数据 -- 根据搜索的店铺获取人员
+     *
+     * @return
+     */
+    public List<SysUser> getRealnamesByShopname(String shopname) {
+        return userMapper.getRealnamesByShopname(shopname);
+    }
 
 }

+ 4 - 2
src/main/webapp/views/main.jsp

@@ -355,6 +355,9 @@
             left: 650px;
             top: 250px;
         }
+        .swiper-slide{
+            text-align: center;
+        }
     </style>
 </head>
 <script id="happinessiInfo" type="text/html">
@@ -428,8 +431,7 @@
             <!--向上轮播-->
             <div class="swiper" style="height: 100%;width: 800px;">
                 <div class="swiper-wrapper">
-                    <div class="swiper-slide" data-swiper-autoplay="5000">【新增】不干胶新增划线工艺 客户需要划线工艺的  划线工艺必选</div>
-                    <div class="swiper-slide" data-swiper-autoplay="5000">【新增】专版报价需要配件的要勾选相对应的配件报价</div>
+                    <div class="swiper-slide" data-swiper-autoplay="5000">【新增】特种纸新增打码 烫金工艺 注意!!!雅柔纸打码烫金的工艺材质会比报价系统的材质偏黄点 接单的时候要跟客户沟通清楚 以免造成不必要的售后</div>
                 </div>
             </div>
         </div>

+ 320 - 0
src/main/webapp/views/product/landa.jsp

@@ -0,0 +1,320 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+         pageEncoding="UTF-8" %>
+<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="UTF-8">
+    <title>Insert title here</title>
+    <%@include file="/views/common.jsp" %>
+</head>
+<body>
+<div class="big_box">
+    <div class="left_div">
+        <h1 class="h1">澜达海报</h1> <span style="color:red;font-weight:700;"></span>
+        <hr>
+        <form class="layui-form">
+            <input type="hidden" name="proTypeValue" id="proTypeValue" class="layui-input" value="澜达海报"/>
+            <p>
+                材质
+            </p>
+            <div class="layui-form-item">
+                <select name="ui_bq_name" id="ui_bq_name" lay-filter="ui_fb_name" class="select" lay-search>
+                    <option value="1">铜版纸200g</option>
+                    <option value="2">铜版纸不干胶</option>
+                    <option value="3">pp纸(不带胶)</option>
+                </select>
+            </div>
+            <p>
+                尺寸(CM/厘米) <span style="font-size: 14px; color: red">输入格式: 长 * 宽</span>
+            </p>
+            <div class="layui-form-item" id="ui_size">
+                <input type="text" name="size" id="size" placeholder="格式:长*宽" class="layui-input" autocomplete="off">
+            </div>
+
+            <p>
+                数量(个)
+            </p>
+            <div class="layui-form-item">
+                <select name="count" class="select">
+                    <option value="10">10</option>
+                    <option value="20">20</option>
+                    <option value="30">30</option>
+                    <option value="40">40</option>
+                    <option value="50">50</option>
+                    <option value="100">100</option>
+                    <option value="200">200</option>
+                    <option value="500">500</option>
+                    <option value="1000">1000</option>
+                    <option value="2000">2000</option>
+                    <option value="5000">5000</option>
+                </select>
+            </div>
+            <p>
+                款数
+            </p>
+            <div class="layui-form-item">
+                <input type="text" placeholder="请输入整数" autocomplete="off" name="number" id="number" value="1"
+                       class="layui-input" lay-verify="number">
+            </div>
+            <p>
+                客户旺旺
+            </p>
+            <div class="layui-form-item">
+                <input type="text" placeholder="请输入客户旺旺号" autocomplete="off" name="wangwang" id="wangwang"
+                       class="layui-input">
+            </div>
+            <p>
+                工艺
+            </p>
+            <div class="layui-form-item">
+                <div class="layui-input-block" style="display:inline-block;">
+                    印面:
+                    <input type="checkbox" name="craft" lay-filter="ui_craft" value="单面" title="单面" checked>
+                </div>
+                <div class="layui-input-block" style="display:inline-block;">
+                    印色:
+                    <input type="checkbox" name="craft" lay-filter="ui_craft" value="彩色印刷" title="彩色印刷">
+                    <input type="checkbox" name="craft" lay-filter="ui_craft" value="专色" title="专色">
+                </div>
+                <div class="layui-input-block" style="display:inline-block;">
+                    裁切工艺:
+                    <input type="checkbox" name="craft" lay-filter="ui_craft" value="直角裁切" title="直角裁切" checked>
+                </div>
+                <div class="layui-input-block" style="display:inline-block;">
+                    覆膜工艺:
+                    <input type="checkbox" name="craft" lay-filter="ui_craft" value="覆光油" title="覆光油" checked>
+                </div>
+            </div>
+            <hr>
+            <div class="layui-form-item">
+                <button class="layui-btn" lay-submit="" lay-filter="acount_btn">计算</button>
+                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
+            </div>
+            <h2>计算结果-
+                <button type="button" class="layui-btn layui-btn-primary layui-btn-sm copyResult"
+                        onclick="copyResult()">点击复制
+                </button>
+            </h2>
+            <div>
+                <textarea rows="11" cols="75" id="span_result" readonly="readonly"></textarea>
+                <%@include file="../acountExpressFee.jsp" %>
+            </div>
+            <div>
+                <table class="layui-hide" id="priceTable" lay-filter="priceTable"></table>
+            </div>
+        </form>
+    </div>
+    <div class="right_div" style="margin-left:50px;">
+        <div class="layui-carousel" id="test1">
+            <div carousel-item id="carousel"></div>
+            <br>
+            <div id="remark" style="font-size:20px;color:red"></div>
+        </div>
+    </div>
+</div>
+</body>
+<%@include file="/views/copyResult.jsp" %>
+<script>
+    layui.use(['table', 'form', 'carousel'], function () {
+        var form = layui.form; //只有执行了这一步,部分表单元素才会自动修饰成功
+        var carousel = layui.carousel;
+        var table = layui.table;
+
+        //建造实例
+        ins = carousel.render({});
+        var html = " ";
+        var remark = " ";
+        // 清空轮播图
+        $("#carousel").empty();
+        $("#remark").empty();
+        $(".ui_feb").show();
+        $(".ui_feb select").attr("disabled", false);
+        $.ajax({
+            url: "${pageContext.request.contextPath}/getImgs",
+            type: "GET",
+            data: {
+                proTypeValue: $("#proTypeValue").val(),
+                kindValue: $('input[name="kindValue"]').val()
+            },
+            success: function (result) {
+                for (let i = 0; i < result.length; i++) {
+                    // 只留一个remark
+                    remark = "";
+                    html += '<div><img style="width:' + result[0].imgWidth + 'px" src="' + result[i].imgUrl + '"></div>';
+                    remark += '<div><span>' + result[i].remark + '<span/></div>';
+                }
+                $("#carousel").append(html);
+                // 如果没有说明,就不显示null
+                if (remark.indexOf("null") < 0) {
+                    $("#remark").append(remark);
+                }
+                // 如果没有轮播图就隐藏
+                if (result.length == 0) {
+                    document.getElementById("test1").style.display = "none";   //隐藏
+                } else {
+                    document.getElementById("test1").style.display = "block";   //显示
+                    ins.reload({
+                        elem: '#test1',
+                        width: result[0].imgWidth,  //设置容器宽度
+                        height: result[0].imgHeight
+                    });
+                }
+            }
+        });
+        form.on('checkbox(ui_craft)', function (data) {
+            let craft_list = [];
+            $("input[name='craft']:checked").each(function () {
+                    if (!$(this).is(':disabled')) {
+                        craft_list.push($(this).val());
+                    }
+                }
+            );
+            if (craft_list.indexOf("单面") == -1) {
+                $(data.elem).prop("checked", true);
+                layer.msg("印面不能取消选择", {offset: ['300px', '300px']}, function () {
+                });
+                form.render();
+                return false;
+            }
+            if (craft_list.indexOf("直角裁切") == -1) {
+                $(data.elem).prop("checked", true);
+                layer.msg("裁切不能取消选择", {offset: ['300px', '300px']}, function () {
+                });
+                form.render();
+                return false;
+            }
+            if (craft_list.indexOf("覆光油") == -1) {
+                $(data.elem).prop("checked", true);
+                layer.msg("覆膜不能取消选择", {offset: ['300px', '300px']}, function () {
+                });
+                form.render();
+                return false;
+            }
+            const carft_list1 = ["四色印刷", "专色"];
+            const carft1 = carft_list1.filter(craft => craft_list.includes(craft));
+            if (carft1.length > 1) {
+                $(data.elem).prop("checked", false);
+                layer.msg("印色工艺不能同时选择", {offset: ['300px', '300px']}, function () {
+                });
+                form.render();
+                return false;
+            }
+        })
+
+        // 点击计算,计算价格
+        form.on('submit(acount_btn)', function (data) {
+            var number = $("#number").val();
+            var size = $("#size").val();
+            var count = $("#count").val();
+            var kind = $("#ui_bq_name option:selected").text();
+            var craft = [];
+            if (size == "") {
+                layer.msg('请填写尺寸!', {offset: ['300px', '300px']}, function () {
+                });
+                return false;
+            }
+            if ((size.split("*")[0] < 42 || size.split("*")[1] < 28.5) && (size.split("*")[0] < 28.5 || size.split("*")[1] < 42)) {
+                layer.msg("【澜达海报】尺寸不能小于42*28.5 cm", {offset: ['300px', '300px']}, function () {
+                });
+                return false;
+            }
+            if ((size.split("*")[0] > 98 || size.split("*")[1] > 70) && (size.split("*")[0] > 70 || size.split("*")[1] > 98)) {
+                layer.msg("【澜达海报】尺寸不能大于70*98 cm", {offset: ['300px', '300px']}, function () {
+                });
+                return false;
+            }
+            $("input:checkbox[name='craft']:checked").each(function (i) {
+                // 没有被禁用的工艺加到arr中
+                if (!$(this).is(':disabled')) {
+                    craft.push($(this).val());
+                }
+            });
+
+            $.ajax({
+                url: "${path}/getThanSum",
+                type: "GET",
+                data: $(".big_box form").serialize(),
+                success: function (result) {
+                    if (result.code == 100) {
+                        layer.msg(result.msg, {offset: ['300px', '300px']}, function () {
+                        });
+                        return false;
+                    }
+                    var data = result.data.proList;
+
+                    var span_result = '澜达海报 - ' + kind + ' - ' + size + ' CM (同款内容)\n';
+
+                    span_result += `工艺:` + craft.join(",") + '\n';
+
+                    if (number > 1) {
+                        for (let i = 0; i < data.length; i++) {
+                            span_result += number + '款 各' + data[i].count + "条,共" + data[i].price + "元" + '\n'
+                            data[i].number = number;
+                        }
+                    } else {
+                        for (let i = 0; i < data.length; i++) {
+                            span_result += number + '款 ' + data[i].count + "条,共" + data[i].price + "元" + '\n'
+                            data[i].number = number;
+                        }
+                    }
+
+                    span_result += '包邮,免费设计呢~(偏远地区需补邮费)'
+                    $("#span_result").val(span_result);
+
+                    //计算完自动复制文本
+                    var e = document.getElementById("span_result");//对象是content
+                    if (e.value != "") {
+                        e.select();//选择对象
+                        document.execCommand("Copy");//执行浏览器复制命令
+                    }
+
+                    //生成表格
+                    table.render({
+                        elem: '#priceTable',
+                        even: true, //隔行变色
+                        data: data, // 赋值已知数据
+                        width: 500,
+                        cols: [[
+                            {
+                                field: 'number',
+                                width: '12%',
+                                align: "center",
+                                title: '款数'
+                            }, {
+                                field: 'count',
+                                width: '16%',
+                                align: "center",
+                                title: '数量'
+                            }, {
+                                field: 'price',
+                                width: '16%',
+                                align: "center",
+                                title: '报价'
+                            }, {
+                                field: 'wangwang',
+                                align: "center",
+                                width: '16%',
+                                title: '折扣价'
+                            }, {
+                                field: 'wangwang',
+                                align: "center",
+                                width: '19%',
+                                title: '跳楼价'
+                            }, {
+                                field: 'weight',
+                                width: '21%',
+                                align: "center",
+                                title: '重量(kg)'
+                            }
+                        ]],
+                        done: function () {
+                        }
+                    });
+                }
+            });
+            return false;
+        });
+    });
+</script>
+</html>

+ 5 - 0
src/main/webapp/views/product/metal.jsp

@@ -183,6 +183,11 @@
                                 <option value="3">3</option>
                                 <option value="4">4</option>
                                 <option value="5">5</option>
+                                <option value="6">6</option>
+                                <option value="7">7</option>
+                                <option value="8">8</option>
+                                <option value="9">9</option>
+                                <option value="10">10</option>
                             </select>
                         </div>
                     </span>

+ 317 - 0
src/main/webapp/views/product/pet.jsp

@@ -0,0 +1,317 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+         pageEncoding="UTF-8" %>
+<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="UTF-8">
+    <title>Insert title here</title>
+    <%@include file="/views/common.jsp" %>
+</head>
+<body>
+<div class="big_box">
+    <div class="left_div">
+        <h1 class="h1">透卡</h1> <span style="color:red;font-weight:700;"></span>
+        <hr>
+        <form class="layui-form">
+            <input type="hidden" name="proTypeValue" id="proTypeValue" class="layui-input" value="透卡"/>
+            <p>
+                材质
+            </p>
+            <div class="layui-form-item">
+                <select name="ui_bq_name" id="ui_bq_name" lay-filter="ui_fb_name" class="select" lay-search>
+                    <option value="1">PET透卡</option>
+                </select>
+            </div>
+            <p>
+                尺寸(CM/厘米) <span style="font-size: 14px; color: red">输入格式: 长 * 宽</span>
+            </p>
+            <div class="layui-form-item" id="ui_size">
+                <input type="text" name="size" id="size" placeholder="格式:长*宽" class="layui-input" autocomplete="off">
+            </div>
+
+            <p>
+                数量(个)
+            </p>
+            <div class="layui-form-item">
+                <select name="count" class="select">
+                    <option value="100">100</option>
+                    <option value="200">200</option>
+                    <option value="300">300</option>
+                    <option value="400">400</option>
+                    <option value="500">500</option>
+                    <option value="800">800</option>
+                    <option value="1000">1000</option>
+                    <option value="2000">2000</option>
+                    <option value="5000">5000</option>
+                    <option value="10000">10000</option>
+                </select>
+            </div>
+            <p>
+                款数
+            </p>
+            <div class="layui-form-item">
+                <input type="text" placeholder="请输入整数" autocomplete="off" name="number" id="number" value="1"
+                       class="layui-input" lay-verify="number">
+            </div>
+            <p>
+                客户旺旺
+            </p>
+            <div class="layui-form-item">
+                <input type="text" placeholder="请输入客户旺旺号" autocomplete="off" name="wangwang" id="wangwang"
+                       class="layui-input">
+            </div>
+            <p>
+                工艺
+            </p>
+            <div class="layui-form-item">
+                <div class="layui-input-block" style="display:inline-block;">
+                    印面:
+                    <input type="checkbox" name="craft" lay-filter="ui_craft" value="单面" title="单面" checked>
+                </div>
+                <div class="layui-input-block" style="display:inline-block;">
+                    常见工艺:
+                    <input type="checkbox" name="craft" lay-filter="ui_craft" value="彩色印刷" title="彩色印刷">
+                    <input type="checkbox" name="craft" lay-filter="ui_craft" value="白墨" title="白墨">
+                </div>
+                <div class="layui-input-block" style="display:inline-block;">
+                    裁切工艺:
+                    <input type="checkbox" name="craft" lay-filter="ui_craft" value="直角裁切" title="直角裁切" checked>
+                    <input type="checkbox" name="craft" lay-filter="ui_craft" value="异形模切" title="异形模切">
+                    <input type="checkbox" name="craft" lay-filter="ui_craft" value="圆角" title="圆角">
+                </div>
+            </div>
+            <hr>
+            <div class="layui-form-item">
+                <button class="layui-btn" lay-submit="" lay-filter="acount_btn">计算</button>
+                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
+            </div>
+            <h2>计算结果-
+                <button type="button" class="layui-btn layui-btn-primary layui-btn-sm copyResult"
+                        onclick="copyResult()">点击复制
+                </button>
+            </h2>
+            <div>
+                <textarea rows="11" cols="75" id="span_result" readonly="readonly"></textarea>
+                <%@include file="../acountExpressFee.jsp" %>
+            </div>
+            <div>
+                <table class="layui-hide" id="priceTable" lay-filter="priceTable"></table>
+            </div>
+        </form>
+    </div>
+    <div class="right_div" style="margin-left:50px;">
+        <div class="layui-carousel" id="test1">
+            <div carousel-item id="carousel"></div>
+            <br>
+            <div id="remark" style="font-size:20px;color:red"></div>
+        </div>
+    </div>
+</div>
+</body>
+<%@include file="/views/copyResult.jsp" %>
+<script>
+    layui.use(['table', 'form', 'carousel'], function () {
+        var form = layui.form; //只有执行了这一步,部分表单元素才会自动修饰成功
+        var carousel = layui.carousel;
+        var table = layui.table;
+
+        //建造实例
+        ins = carousel.render({});
+        var html = " ";
+        var remark = " ";
+        // 清空轮播图
+        $("#carousel").empty();
+        $("#remark").empty();
+        $(".ui_feb").show();
+        $(".ui_feb select").attr("disabled", false);
+        $.ajax({
+            url: "${pageContext.request.contextPath}/getImgs",
+            type: "GET",
+            data: {
+                proTypeValue: $("#proTypeValue").val(),
+                kindValue: $('input[name="kindValue"]').val()
+            },
+            success: function (result) {
+                for (let i = 0; i < result.length; i++) {
+                    // 只留一个remark
+                    remark = "";
+                    html += '<div><img style="width:' + result[0].imgWidth + 'px" src="' + result[i].imgUrl + '"></div>';
+                    remark += '<div><span>' + result[i].remark + '<span/></div>';
+                }
+                $("#carousel").append(html);
+                // 如果没有说明,就不显示null
+                if (remark.indexOf("null") < 0) {
+                    $("#remark").append(remark);
+                }
+                // 如果没有轮播图就隐藏
+                if (result.length == 0) {
+                    document.getElementById("test1").style.display = "none";   //隐藏
+                } else {
+                    document.getElementById("test1").style.display = "block";   //显示
+                    ins.reload({
+                        elem: '#test1',
+                        width: result[0].imgWidth,  //设置容器宽度
+                        height: result[0].imgHeight
+                    });
+                }
+            }
+        });
+        form.on('checkbox(ui_craft)', function (data) {
+            let craft_list = [];
+            $("input[name='craft']:checked").each(function () {
+                    if (!$(this).is(':disabled')) {
+                        craft_list.push($(this).val());
+                    }
+                }
+            );
+            if (craft_list.indexOf("单面") == -1) {
+                $(data.elem).prop("checked", true);
+                layer.msg("印面不能取消选择", {offset: ['300px', '300px']}, function () {
+                });
+                form.render();
+                return false;
+            }
+            const carft_list1 = ["四色印刷", "白墨"];
+            const carft1 = carft_list1.filter(craft => craft_list.includes(craft));
+            if (carft1.length > 1) {
+                $(data.elem).prop("checked", false);
+                layer.msg("常见工艺不能同时选择", {offset: ['300px', '300px']}, function () {
+                });
+                form.render();
+                return false;
+            }
+            const carft_list2 = ["直角裁切", "异形模切", "圆角"];
+            const carft2 = carft_list2.filter(craft => craft_list.includes(craft));
+            if (carft2.length > 1) {
+                $(data.elem).prop("checked", false);
+                layer.msg("裁切工艺不能同时选择", {offset: ['300px', '300px']}, function () {
+                });
+                form.render();
+                return false;
+            }
+        })
+
+        // 点击计算,计算价格
+        form.on('submit(acount_btn)', function (data) {
+            var number = $("#number").val();
+            var size = $("#size").val();
+            var count = $("#count").val();
+            var kind = $("#ui_bq_name option:selected").text();
+            var craft = [];
+            if (size == "") {
+                layer.msg('请填写尺寸!', {offset: ['300px', '300px']}, function () {
+                });
+                return false;
+            }
+            if ((size.split("*")[0] < 5 || size.split("*")[1] < 4.5) && (size.split("*")[0] < 4.5 || size.split("*")[1] < 5)) {
+                layer.msg("【PET透卡】尺寸不能小于5*4.5 cm", {offset: ['300px', '300px']}, function () {
+                });
+                return false;
+            }
+            if ((size.split("*")[0] > 10 || size.split("*")[1] > 15) && (size.split("*")[0] > 15 || size.split("*")[1] > 10)) {
+                layer.msg("【PET透卡】尺寸不能大于10*15 cm", {offset: ['300px', '300px']}, function () {
+                });
+                return false;
+            }
+            $("input:checkbox[name='craft']:checked").each(function (i) {
+                // 没有被禁用的工艺加到arr中
+                if (!$(this).is(':disabled')) {
+                    craft.push($(this).val());
+                }
+            });
+            const carft_list2 = ["直角裁切", "异形模切", "圆角"];
+            const carft2 = carft_list2.filter(item => craft.includes(item));
+            if (carft2.length == 0) {
+                layer.msg("请选择裁切工艺", {offset: ['300px', '300px']}, function () {
+                });
+                return false;
+            }
+
+            $.ajax({
+                url: "${path}/getThanSum",
+                type: "GET",
+                data: $(".big_box form").serialize(),
+                success: function (result) {
+                    if (result.code == 100) {
+                        layer.msg(result.msg, {offset: ['300px', '300px']}, function () {
+                        });
+                        return false;
+                    }
+                    var data = result.data.proList;
+
+                    var span_result = 'PET透卡 - ' + kind + ' - ' + size + ' CM (同款内容)\n';
+
+                    span_result += `工艺:` + craft.join(",") + '\n';
+
+                    if (number > 1) {
+                        for (let i = 0; i < data.length; i++) {
+                            span_result += number + '款 各' + data[i].count + "条,共" + data[i].price + "元" + '\n'
+                            data[i].number = number;
+                        }
+                    } else {
+                        for (let i = 0; i < data.length; i++) {
+                            span_result += number + '款 ' + data[i].count + "条,共" + data[i].price + "元" + '\n'
+                            data[i].number = number;
+                        }
+                    }
+
+                    span_result += '包邮,免费设计呢~(偏远地区需补邮费)'
+                    $("#span_result").val(span_result);
+
+                    //计算完自动复制文本
+                    var e = document.getElementById("span_result");//对象是content
+                    if (e.value != "") {
+                        e.select();//选择对象
+                        document.execCommand("Copy");//执行浏览器复制命令
+                    }
+
+                    //生成表格
+                    table.render({
+                        elem: '#priceTable',
+                        even: true, //隔行变色
+                        data: data, // 赋值已知数据
+                        width: 500,
+                        cols: [[
+                            {
+                                field: 'number',
+                                width: '12%',
+                                align: "center",
+                                title: '款数'
+                            }, {
+                                field: 'count',
+                                width: '16%',
+                                align: "center",
+                                title: '数量'
+                            }, {
+                                field: 'price',
+                                width: '16%',
+                                align: "center",
+                                title: '报价'
+                            }, {
+                                field: 'wangwang',
+                                align: "center",
+                                width: '16%',
+                                title: '折扣价'
+                            }, {
+                                field: 'wangwang',
+                                align: "center",
+                                width: '19%',
+                                title: '跳楼价'
+                            }, {
+                                field: 'weight',
+                                width: '21%',
+                                align: "center",
+                                title: '重量(kg)'
+                            }
+                        ]],
+                        done: function () {
+                        }
+                    });
+                }
+            });
+            return false;
+        });
+    });
+</script>
+</html>

+ 33 - 4
src/main/webapp/views/product/specialCard2.jsp

@@ -479,6 +479,13 @@
                 });
                 return false;
             }
+            if (craft_list.indexOf("打码") > -1 && craft_list.indexOf("异形模切") > -1) {
+                $(data.elem).next().attr("class", "layui-unselect layui-form-checkbox");
+                $(data.elem).prop("checked", false);
+                layer.msg("打码 - 异形模切不能同时选择", {offset: ['300px', '300px']}, function () {
+                });
+                return false;
+            }
             if (craft_list.indexOf("击凸") > -1 || craft_list.indexOf("压凹") > -1) {
                 $("#color_type").show();
                 $("#color_type").find("select").attr("disabled", false);
@@ -513,6 +520,13 @@
                     }
                 }
             );
+            if (craft_list.indexOf("打码") > -1 && craft_list.indexOf("异形模切") > -1) {
+                $(data.elem).next().attr("class", "layui-unselect layui-form-checkbox");
+                $(data.elem).prop("checked", false);
+                layer.msg("打码 - 异形模切不能同时选择", {offset: ['300px', '300px']}, function () {
+                });
+                return false;
+            }
             $("#dakong").removeAttr('disabled');
             $("#craft_mo").removeAttr('disabled');
             $(".newCraft").children().removeAttr('disabled');
@@ -651,22 +665,37 @@
                 }
             }
             var arr = []
+            let ma_num = $("select[name='maxian'] option:selected").val();
+            let is_dama = false;
             $("input:checkbox[name='craft']:checked").each(function (i) {
                 if (!$(this).is(':disabled')) {
                     if ($(this).val() != "双面覆哑膜") {
                         if ($(this).val() == "单面烫金" || $(this).val() == "双面烫金") {
                             let tangColor = $("#tang_type select[name='craft'] option:selected").val();
                             arr.push($(this).val() + tangColor);
-                        }
-                        else if ($(this).val() == "打码") {
-                            let ma_num = $("select[name='maxian'] option:selected").val();
+                        } else if ($(this).val() == "打码") {
+                            is_dama = true;
                             arr.push($(this).val() + ma_num + "个");
-                        }else {
+                        } else {
                             arr.push($(this).val());
                         }
                     }
                 }
             });
+            if (is_dama) {
+                if ((size.split("*")[0] < 9 || size.split("*")[1] < 5.4) && (size.split("*")[0] < 5.4 || size.split("*")[1] < 9)) {
+                    layer.msg("打码尺寸不能小于9*5.4 cm", {offset: ['300px', '300px']}, function () {
+                    });
+                    return false;
+                }
+                if (ma_num > 1) {
+                    if ((size.split("*")[0] < 13 || size.split("*")[1] < 4.5) && (size.split("*")[0] < 4.5 || size.split("*")[1] < 13)) {
+                        layer.msg("打码尺寸小于13*4.5 cm不能打多个码", {offset: ['300px', '300px']}, function () {
+                        });
+                        return false;
+                    }
+                }
+            }
             if (kindValueSelect == '素芸') {
                 let color = $("select[name='craft']:not(:disabled) option:selected").val()
                 if (color) {