|
@@ -68,9 +68,10 @@ public class SecondHandServiceImpl implements SecondHandService {
|
|
|
* @return List<SecondHandVo>
|
|
|
*/
|
|
|
@Override
|
|
|
- public ResponseJson<PaginationVo<SecondListVo>> getSecondHandList(Integer userId, Integer secondHandType, Integer instrumentType, String name, Integer secondProductType, Integer cityId, int pageNum, int pageSize) {
|
|
|
+ public ResponseJson<PaginationVo<SecondListVo>> getSecondHandList(Integer userId, Integer secondHandType, Integer instrumentType,
|
|
|
+ String name, Integer secondProductType, Integer cityId, Integer buyFlag, int pageNum, int pageSize) {
|
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
|
- List<SecondListVo> secondList = secondHandMapper.getSeconHandList(secondHandType, instrumentType, name, secondProductType, cityId);
|
|
|
+ List<SecondListVo> secondList = secondHandMapper.getSeconHandList(secondHandType, instrumentType, name, secondProductType, cityId, buyFlag);
|
|
|
if (!CollectionUtils.isEmpty(secondList)) {
|
|
|
// 初始化商品产品标签
|
|
|
int initNewNum = 0;
|
|
@@ -606,7 +607,7 @@ public class SecondHandServiceImpl implements SecondHandService {
|
|
|
Integer viewingNum = 0;
|
|
|
if (null != second) {
|
|
|
viewingNum = second.getViewingNum();
|
|
|
- /* 更新新浏览量规则
|
|
|
+ /** 更新新浏览量规则
|
|
|
* 7天内,每被浏览一次,浏览数添加一个20以内的随机数
|
|
|
* 14天内,每被浏览一次,浏览数添加一个10以内的随机数
|
|
|
* 30天内,每被浏览一次,浏览数添加一个5以内的随机数
|
|
@@ -662,23 +663,26 @@ public class SecondHandServiceImpl implements SecondHandService {
|
|
|
if (result != null) {
|
|
|
return ResponseJson.error("参数异常:联系方式不正确");
|
|
|
}
|
|
|
- if (null == secondDto.getProductId()) {
|
|
|
- //校验验证码
|
|
|
- String checkCode = secondDto.getCheckCode();
|
|
|
- if (StringUtils.isBlank(checkCode)) {
|
|
|
- return ResponseJson.error("参数异常:请输入验证码");
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(checkCode)) {
|
|
|
- String redisSmsCode = stringRedisService.get("code:" + contactMobile);
|
|
|
- // 开发 和 测试环境 固定短信验证码 666666
|
|
|
- if ("dev".equals(profile) || "beta".equals(profile)) {
|
|
|
- redisSmsCode = (null != redisSmsCode && !"null".equals(redisSmsCode) ? redisSmsCode : "666666");
|
|
|
- }
|
|
|
- if (!checkCode.equals(redisSmsCode)) {
|
|
|
- return ResponseJson.error("参数异常:手机验证码错误");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ /** todo
|
|
|
+ * 验证码校验需要提取重复代码,统一方法
|
|
|
+ */
|
|
|
+// if (null == secondDto.getProductId()) {
|
|
|
+// //校验验证码
|
|
|
+// String checkCode = secondDto.getCheckCode();
|
|
|
+// if (StringUtils.isBlank(checkCode)) {
|
|
|
+// return ResponseJson.error("参数异常:请输入验证码");
|
|
|
+// }
|
|
|
+// if (StringUtils.isNotBlank(checkCode)) {
|
|
|
+// String redisSmsCode = stringRedisService.get("code:" + contactMobile);
|
|
|
+// // 开发 和 测试环境 固定短信验证码 666666
|
|
|
+// if ("dev".equals(profile) || "beta".equals(profile)) {
|
|
|
+// redisSmsCode = (null != redisSmsCode && !"null".equals(redisSmsCode) ? redisSmsCode : "666666");
|
|
|
+// }
|
|
|
+// if (!checkCode.equals(redisSmsCode)) {
|
|
|
+// return ResponseJson.error("参数异常:手机验证码错误");
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
// 验证传入参数
|
|
|
Integer brandId = secondDto.getBrandId();
|
|
|
String name = secondDto.getName();
|