修复商品管理单规格显示问题
This commit is contained in:
1 parent
e9422cd6a5
commit
c86430e397
1 file changed
+19
-19
+19
-19
@@ -538,7 +538,7 @@ public class StoreProductServiceImpl extends ServiceImpl<StoreProductMapper,Stor
|
|||||||
productDto.setAttrs(productFormatDtos);
|
productDto.setAttrs(productFormatDtos);
|
||||||
productDto.setItems(result.getObject("attr",ArrayList.class));
|
productDto.setItems(result.getObject("attr",ArrayList.class));
|
||||||
}else{
|
}else{
|
||||||
this.productFromat(productDto, result);
|
this.productFromat(productDto, attrValues.get(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
map.put("productInfo",productDto);
|
map.put("productInfo",productDto);
|
||||||
@@ -569,25 +569,25 @@ public class StoreProductServiceImpl extends ServiceImpl<StoreProductMapper,Stor
|
|||||||
* @param productDto
|
* @param productDto
|
||||||
* @param result
|
* @param result
|
||||||
*/
|
*/
|
||||||
private void productFromat(ProductDto productDto, JSONObject result) {
|
private void productFromat(ProductDto productDto, StoreProductAttrValueDO result) {
|
||||||
Map<String,Object> mapAttr = (Map<String,Object>) result.getObject("value",ArrayList.class).get(0);
|
//Map<String,Object> mapAttr = (Map<String,Object>) result.getObject("value",ArrayList.class).get(0);
|
||||||
ProductFormatDto productFormatDto = ProductFormatDto.builder()
|
ProductFormatDto productFormatDto = ProductFormatDto.builder()
|
||||||
.pic(mapAttr.get("pic").toString())
|
.pic(result.getImage())
|
||||||
.price(Double.valueOf(mapAttr.get("price").toString()))
|
.price(result.getPrice().doubleValue())
|
||||||
.cost(Double.valueOf(mapAttr.get("cost").toString()))
|
.cost(result.getCost().doubleValue())
|
||||||
.otPrice(Double.valueOf(mapAttr.get("otPrice").toString()))
|
.otPrice(result.getOtPrice().doubleValue())
|
||||||
.stock(Integer.valueOf(mapAttr.get("stock").toString()))
|
.stock(result.getStock())
|
||||||
.barCode(mapAttr.get("barCode").toString())
|
.barCode(result.getBarCode())
|
||||||
.weight(Double.valueOf(mapAttr.get("weight").toString()))
|
.weight(result.getWeight().doubleValue())
|
||||||
.volume(Double.valueOf(mapAttr.get("volume").toString()))
|
.volume(result.getVolume().doubleValue())
|
||||||
.value1(mapAttr.get("value1").toString())
|
.value1("规格")
|
||||||
.integral(mapAttr.get("integral") !=null ? Integer.valueOf(mapAttr.get("integral").toString()) : 0)
|
.integral(result.getIntegral())
|
||||||
.brokerage(Double.valueOf(mapAttr.get("brokerage").toString()))
|
.brokerage(result.getBrokerage().doubleValue())
|
||||||
.brokerageTwo(Double.valueOf(mapAttr.get("brokerageTwo").toString()))
|
.brokerageTwo(result.getBrokerageTwo().doubleValue())
|
||||||
.pinkPrice(Double.valueOf(mapAttr.get("pinkPrice").toString()))
|
.pinkPrice(result.getPinkPrice().doubleValue())
|
||||||
.pinkStock(Integer.valueOf(mapAttr.get("pinkStock").toString()))
|
.pinkStock(result.getPinkStock())
|
||||||
.seckillPrice(Double.valueOf(mapAttr.get("seckillPrice").toString()))
|
.seckillPrice(result.getSeckillPrice().doubleValue())
|
||||||
.seckillStock(Integer.valueOf(mapAttr.get("seckillStock").toString()))
|
.seckillStock(result.getSeckillStock())
|
||||||
.build();
|
.build();
|
||||||
productDto.setAttr(productFormatDto);
|
productDto.setAttr(productFormatDto);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user