提交 5505d8f2 authored 作者: 吴德鹏's avatar 吴德鹏

优化落地页商品排序

上级 6d7a6be0
......@@ -164,6 +164,8 @@ public class AdvertisementItemController {
return R.error("参数不能为空");
} else if (res == -2) {
return R.error("序号不能跟原来相同");
} else if (res == -3) {
return R.error("序号必须是正整数");
}
return R.error("操作失败");
}
......
......@@ -14,6 +14,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.locks.ReentrantLock;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Service实现类
......@@ -122,7 +124,16 @@ public class AdvertisementItemServiceImpl implements AdvertisementItemService {
String itemId = map.get("itemId").toString();
String adId = map.get("adId").toString();
String sort = map.get("sort").toString();
if (!StringUtils.isNumeric(sort)) {
return -3;
}
Integer itemSort = Integer.parseInt(sort);
String regex = "^[1-9]+[0-9]*$";
Pattern p = Pattern.compile(regex);
Matcher matcher = p.matcher(sort);
if (!matcher.matches()) {
return -3;
}
if (itemId == null || itemId == "") {
return -1;
}
......
......@@ -2,13 +2,13 @@
#jdbc.username=root
#jdbc.password=root
jdbc.url=jdbc:mysql://47.106.242.175:3306/chinafrica?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8
jdbc.username=root
jdbc.password=diaoyun666
#jdbc.url=jdbc:mysql://47.106.242.175:3306/chinafrica?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8
#jdbc.username=root
#jdbc.password=diaoyun666
#jdbc.url: jdbc:mysql://159.138.48.71:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
#jdbc.username: root
#jdbc.password: Diaoyunnuli.8
jdbc.url: jdbc:mysql://159.138.48.71:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
jdbc.username: root
jdbc.password: Diaoyunnuli.8
jdbc.initialSize=5
jdbc.maxActive=30
......
......@@ -2,13 +2,13 @@
#jdbc.username=root
#jdbc.password=root
jdbc.url=jdbc:mysql://47.106.242.175:3306/chinafrica?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8
jdbc.username=root
jdbc.password=diaoyun666
#jdbc.url=jdbc:mysql://47.106.242.175:3306/chinafrica?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8
#jdbc.username=root
#jdbc.password=diaoyun666
#jdbc.url: jdbc:mysql://159.138.48.71:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
#jdbc.username: root
#jdbc.password: Diaoyunnuli.8
jdbc.url: jdbc:mysql://159.138.48.71:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
jdbc.username: root
jdbc.password: Diaoyunnuli.8
jdbc.initialSize=5
jdbc.maxActive=30
......
......@@ -24,6 +24,8 @@ import java.util.Date;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* 商品导入功能
......@@ -481,4 +483,6 @@ public class ImpartCode {
return output.toByteArray();
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论