Authored by caoyan

二手

@@ -235,25 +235,28 @@ public class SecondhandProductService implements ISecondhandProductService{ @@ -235,25 +235,28 @@ public class SecondhandProductService implements ISecondhandProductService{
235 List<SecondhandImages> secondhandImagesList = skupImageMap.get(skup); 235 List<SecondhandImages> secondhandImagesList = skupImageMap.get(skup);
236 rebuiltImageList(secondhandImagesList, flawMap); 236 rebuiltImageList(secondhandImagesList, flawMap);
237 rsp.setImageList(secondhandImagesList); 237 rsp.setImageList(secondhandImagesList);
238 - SecondhandInfo info = infoMap.get(skup);  
239 - rsp.setDescribeInfo(info.getDescribeInfo());  
240 - rsp.setSku(item.getStorageId());  
241 - SellerOrderGoods sellerGoods = sellerGoodsMap.get(skup);  
242 - if(null == sellerGoods) {  
243 - continue;  
244 - }  
245 rsp.setProductImage(ImagesHelper.getImageAbsoluteUrl(goodsIdImageMap.get(item.getProductId()), "goodsimg")); 238 rsp.setProductImage(ImagesHelper.getImageAbsoluteUrl(goodsIdImageMap.get(item.getProductId()), "goodsimg"));
246 - rsp.setColorName(sellerGoods.getColorName());  
247 - rsp.setSizeName(sellerGoods.getSizeName());  
248 rsp.setSellerUid(item.getSellerUid()); 239 rsp.setSellerUid(item.getSellerUid());
249 rsp.setPrice(String.valueOf(item.getPrice())); 240 rsp.setPrice(String.valueOf(item.getPrice()));
250 rsp.setStatus(item.getStatus()); 241 rsp.setStatus(item.getStatus());
251 - rsp.setCreateTimeStr(DateUtil.getDateFormatFromInt(info.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));  
252 - rsp.setAuditTimeStr(null == info.getAuditTime() ? "" : DateUtil.getDateFormatFromInt(info.getAuditTime(), "yyyy-MM-dd HH:mm:ss"));  
253 - rsp.setAuditName(null == info.getAuditName() ? "" : info.getAuditName()); 242 + rsp.setSku(item.getStorageId());
254 rsp.setProductName(productIdNameMap.get(item.getProductId())); 243 rsp.setProductName(productIdNameMap.get(item.getProductId()));
255 - rsp.setRejectReason(info.getRejectReason());  
256 - 244 +
  245 + SellerOrderGoods sellerGoods = sellerGoodsMap.get(skup);
  246 + if(null != sellerGoods) {
  247 + rsp.setColorName(sellerGoods.getColorName());
  248 + rsp.setSizeName(sellerGoods.getSizeName());
  249 + }
  250 +
  251 + SecondhandInfo info = infoMap.get(skup);
  252 + if(null != info) {
  253 + rsp.setDescribeInfo(info.getDescribeInfo());
  254 + rsp.setCreateTimeStr(DateUtil.getDateFormatFromInt(info.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
  255 + rsp.setAuditTimeStr(null == info.getAuditTime() ? "" : DateUtil.getDateFormatFromInt(info.getAuditTime(), "yyyy-MM-dd HH:mm:ss"));
  256 + rsp.setAuditName(null == info.getAuditName() ? "" : info.getAuditName());
  257 + rsp.setRejectReason(info.getRejectReason());
  258 + }
  259 +
257 respList.add(rsp); 260 respList.add(rsp);
258 } 261 }
259 262
@@ -261,6 +264,9 @@ public class SecondhandProductService implements ISecondhandProductService{ @@ -261,6 +264,9 @@ public class SecondhandProductService implements ISecondhandProductService{
261 } 264 }
262 265
263 private void rebuiltImageList(List<SecondhandImages> imageList, Map<Integer, String> flawIdNameMap) { 266 private void rebuiltImageList(List<SecondhandImages> imageList, Map<Integer, String> flawIdNameMap) {
  267 + if(CollectionUtils.isEmpty(imageList)) {
  268 + return;
  269 + }
264 for(SecondhandImages image : imageList) { 270 for(SecondhandImages image : imageList) {
265 image.setImageDesc(flawIdNameMap.get(image.getCode())); 271 image.setImageDesc(flawIdNameMap.get(image.getCode()));
266 image.setImageUrl(ImagesHelper.getImageAbsoluteUrl(image.getImageUrl(), "goodsimg")); 272 image.setImageUrl(ImagesHelper.getImageAbsoluteUrl(image.getImageUrl(), "goodsimg"));