Merge branch 'test6.9.9' of http://git.yoho.cn/ufo/ufo-platform into test6.9.9
Showing
1 changed file
with
46 additions
and
1 deletions
@@ -2,6 +2,9 @@ package com.yoho.ufo.service.impl; | @@ -2,6 +2,9 @@ package com.yoho.ufo.service.impl; | ||
2 | 2 | ||
3 | import com.google.common.collect.Lists; | 3 | import com.google.common.collect.Lists; |
4 | import com.yoho.core.common.utils.DateUtil; | 4 | import com.yoho.core.common.utils.DateUtil; |
5 | +import com.yoho.product.dal.SecondhandFlawMapper; | ||
6 | +import com.yoho.product.dal.SecondhandInfoMapper; | ||
7 | +import com.yoho.product.model.SecondhandFlaw; | ||
5 | import com.yoho.product.model.SecondhandImages; | 8 | import com.yoho.product.model.SecondhandImages; |
6 | import com.yoho.product.model.SecondhandInfo; | 9 | import com.yoho.product.model.SecondhandInfo; |
7 | import com.yoho.ufo.convert.ProductConvertService; | 10 | import com.yoho.ufo.convert.ProductConvertService; |
@@ -67,6 +70,12 @@ public class StorageService { | @@ -67,6 +70,12 @@ public class StorageService { | ||
67 | @Autowired | 70 | @Autowired |
68 | private UfoSizeMapper sizeMapper; | 71 | private UfoSizeMapper sizeMapper; |
69 | 72 | ||
73 | + @Autowired | ||
74 | + private SecondhandInfoMapper secondhandInfoMapper; | ||
75 | + | ||
76 | + @Autowired | ||
77 | + private SecondhandFlawMapper secondhandFlawMapper; | ||
78 | + | ||
70 | private static final Integer DEFAULT_SKUP_STATUS = 1; | 79 | private static final Integer DEFAULT_SKUP_STATUS = 1; |
71 | 80 | ||
72 | //商品编码 商品名称 品牌 最低价 可售库存 | 81 | //商品编码 商品名称 品牌 最低价 可售库存 |
@@ -354,7 +363,43 @@ public class StorageService { | @@ -354,7 +363,43 @@ public class StorageService { | ||
354 | ); | 363 | ); |
355 | 364 | ||
356 | String desc = Optional.ofNullable(skup).map(secondhandInfoService::selectBySkup).map(SecondhandInfo::getDescribeInfo).orElse(""); | 365 | String desc = Optional.ofNullable(skup).map(secondhandInfoService::selectBySkup).map(SecondhandInfo::getDescribeInfo).orElse(""); |
357 | - return new SecondDetailResp(skup, desc, "", "", infos); | 366 | + |
367 | + List<SecondhandInfo> secondhandInfoList = secondhandInfoMapper.selectBySkups(Arrays.asList(skup)); | ||
368 | + String shoeBoxDesc = ""; | ||
369 | + String shoeQualityDesc = ""; | ||
370 | + if (!secondhandInfoList.isEmpty()) { | ||
371 | + SecondhandInfo secondhandInfo = secondhandInfoList.get(0); | ||
372 | + StringBuilder boxInfo = new StringBuilder(); | ||
373 | + StringBuilder qualityInfo = new StringBuilder(); | ||
374 | + if (org.apache.commons.lang3.StringUtils.isNotBlank(secondhandInfo.getFlawId())) { | ||
375 | + List<SecondhandFlaw> flaws = secondhandFlawMapper.selectByIds(secondhandInfo.getFlawId()); | ||
376 | + for (SecondhandFlaw flaw : flaws) { | ||
377 | + // 其他问题,文字不展示 | ||
378 | + if (flaw.getId() == 200) { | ||
379 | + continue; | ||
380 | + } | ||
381 | + if (flaw.getType() == 1) { | ||
382 | + boxInfo.append(",").append(flaw.getName()); | ||
383 | + } | ||
384 | + if (flaw.getType() == 2) { | ||
385 | + qualityInfo.append(",").append(flaw.getName()); | ||
386 | + } | ||
387 | + } | ||
388 | + if (org.apache.commons.lang3.StringUtils.isNotBlank(secondhandInfo.getFlawAttr())) { | ||
389 | + qualityInfo.append(",").append(secondhandInfo.getFlawAttr()); | ||
390 | + } | ||
391 | + if (boxInfo.length() > 0) { | ||
392 | + shoeBoxDesc = boxInfo.substring(1); | ||
393 | + } | ||
394 | + if (qualityInfo.length() > 0) { | ||
395 | + shoeQualityDesc = qualityInfo.substring(1); | ||
396 | + } else { | ||
397 | + shoeQualityDesc = "该商品没有明显瑕疵"; | ||
398 | + } | ||
399 | + } | ||
400 | + } | ||
401 | + | ||
402 | + return new SecondDetailResp(skup, desc, shoeBoxDesc, shoeQualityDesc, infos); | ||
358 | } | 403 | } |
359 | 404 | ||
360 | public Boolean updateSkuStatus(Integer storageId, Integer status) { | 405 | public Boolean updateSkuStatus(Integer storageId, Integer status) { |
-
Please register or login to post a comment