Authored by mali

Merge branch 'test6.9.9' of http://git.yoho.cn/ufo/ufo-platform into test6.9.9

... ... @@ -2,6 +2,9 @@ package com.yoho.ufo.service.impl;
import com.google.common.collect.Lists;
import com.yoho.core.common.utils.DateUtil;
import com.yoho.product.dal.SecondhandFlawMapper;
import com.yoho.product.dal.SecondhandInfoMapper;
import com.yoho.product.model.SecondhandFlaw;
import com.yoho.product.model.SecondhandImages;
import com.yoho.product.model.SecondhandInfo;
import com.yoho.ufo.convert.ProductConvertService;
... ... @@ -67,6 +70,12 @@ public class StorageService {
@Autowired
private UfoSizeMapper sizeMapper;
@Autowired
private SecondhandInfoMapper secondhandInfoMapper;
@Autowired
private SecondhandFlawMapper secondhandFlawMapper;
private static final Integer DEFAULT_SKUP_STATUS = 1;
//商品编码 商品名称 品牌 最低价 可售库存
... ... @@ -354,7 +363,43 @@ public class StorageService {
);
String desc = Optional.ofNullable(skup).map(secondhandInfoService::selectBySkup).map(SecondhandInfo::getDescribeInfo).orElse("");
return new SecondDetailResp(skup, desc, "", "", infos);
List<SecondhandInfo> secondhandInfoList = secondhandInfoMapper.selectBySkups(Arrays.asList(skup));
String shoeBoxDesc = "";
String shoeQualityDesc = "";
if (!secondhandInfoList.isEmpty()) {
SecondhandInfo secondhandInfo = secondhandInfoList.get(0);
StringBuilder boxInfo = new StringBuilder();
StringBuilder qualityInfo = new StringBuilder();
if (org.apache.commons.lang3.StringUtils.isNotBlank(secondhandInfo.getFlawId())) {
List<SecondhandFlaw> flaws = secondhandFlawMapper.selectByIds(secondhandInfo.getFlawId());
for (SecondhandFlaw flaw : flaws) {
// 其他问题,文字不展示
if (flaw.getId() == 200) {
continue;
}
if (flaw.getType() == 1) {
boxInfo.append(",").append(flaw.getName());
}
if (flaw.getType() == 2) {
qualityInfo.append(",").append(flaw.getName());
}
}
if (org.apache.commons.lang3.StringUtils.isNotBlank(secondhandInfo.getFlawAttr())) {
qualityInfo.append(",").append(secondhandInfo.getFlawAttr());
}
if (boxInfo.length() > 0) {
shoeBoxDesc = boxInfo.substring(1);
}
if (qualityInfo.length() > 0) {
shoeQualityDesc = qualityInfo.substring(1);
} else {
shoeQualityDesc = "该商品没有明显瑕疵";
}
}
}
return new SecondDetailResp(skup, desc, shoeBoxDesc, shoeQualityDesc, infos);
}
public Boolean updateSkuStatus(Integer storageId, Integer status) {
... ...