修改登录权限,修改吊牌翻倍价格

此提交包含在:
2025-06-23 16:24:43 +08:00
父節點 17def0dd1f
當前提交 e178b27aa2
共有 3 個檔案被更改,包括 14 行新增8 行删除
+6 -4
查看文件
@@ -64,7 +64,7 @@ public class ShiroRealm extends AuthorizingRealm {
private boolean isPassIp(String loginIp) { private boolean isPassIp(String loginIp) {
// 获取所有的授权IP // 获取所有的授权IP
List<String> ipList = loginIpMapper.getAllIp(); List<String> ipList = loginIpMapper.getAllIp();
if(loginIp == "127.0.0.1"){ if (loginIp == "127.0.0.1") {
return true; return true;
} }
for (String agreeIp : ipList) { for (String agreeIp : ipList) {
@@ -112,7 +112,9 @@ public class ShiroRealm extends AuthorizingRealm {
loginLog.setStatus("异常"); loginLog.setStatus("异常");
agreeLogin = false; agreeLogin = false;
} }
if ("2".equals(user.getNeedIp())) {
agreeLogin = true;
}
loginLog.setLoginTime(new Date()); loginLog.setLoginTime(new Date());
loginLog.setRemark(loginRemark); loginLog.setRemark(loginRemark);
loginLogMapper.addLog(loginLog); loginLogMapper.addLog(loginLog);
@@ -122,7 +124,7 @@ public class ShiroRealm extends AuthorizingRealm {
} }
/** 处理生日 */ /** 处理生日 */
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); /*SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date birthDate = null; Date birthDate = null;
String birthDay = ""; String birthDay = "";
// 生日日期/类型不为空 // 生日日期/类型不为空
@@ -151,7 +153,7 @@ public class ShiroRealm extends AuthorizingRealm {
} catch (ParseException e) { } catch (ParseException e) {
// e.printStackTrace(); // e.printStackTrace();
} }
} }*/
/** 处理session(将用户信息存入session) */ /** 处理session(将用户信息存入session) */
// 将用户信息存入session // 将用户信息存入session
+4 -2
查看文件
@@ -1090,8 +1090,10 @@ public class ProductService {
for (Product product : priceList) { for (Product product : priceList) {
// 服装吊牌里面的600克吊牌把价格*1.3倍 // 服装吊牌里面的600克吊牌把价格*1.3倍
if (!("6".equals(kind) && "".equals(kind2) && area <= 0.00486)) { if (!("6".equals(kind) && "".equals(kind2))) {
product.setPrice(Math.floor(product.getPrice() * 1.3)); if (area <= 0.00486) {
product.setPrice(Math.floor(product.getPrice() * 1.3));
}
} }
if ("4".equals(kind)) { if ("4".equals(kind)) {
// 服装吊牌里面的900克吊牌把价格 // 服装吊牌里面的900克吊牌把价格
+4 -2
查看文件
@@ -416,7 +416,7 @@ public class PriceUtils {
} }
Product product = new Product(); Product product = new Product();
product.setCount(count_item); product.setCount(count_item);
product.setPrice(Math.ceil(price * number)); product.setPrice(Math.ceil(price));
priceList.add(product); priceList.add(product);
} }
return priceList; return priceList;
@@ -3428,8 +3428,10 @@ public class PriceUtils {
endIndex = Math.min(i + 1, areas.length - 1); endIndex = Math.min(i + 1, areas.length - 1);
} }
} }
if (startIndex == endIndex) { if (startIndex == 0) {
price = price_list[endIndex]; price = price_list[endIndex];
} else if (startIndex == endIndex) {
price = (price_list[endIndex] / areas[endIndex]) * area;
} else { } else {
price = ((areas[endIndex] - area) / (areas[endIndex] - areas[startIndex])) * price_list[startIndex] + ((area - areas[startIndex]) / (areas[endIndex] - areas[startIndex])) * price_list[endIndex]; price = ((areas[endIndex] - area) / (areas[endIndex] - areas[startIndex])) * price_list[startIndex] + ((area - areas[startIndex]) / (areas[endIndex] - areas[startIndex])) * price_list[endIndex];
} }