👍 增加NPE防御
This commit is contained in:
@@ -16,16 +16,6 @@ import java.io.File;
|
|||||||
public class YudaoServerApplication {
|
public class YudaoServerApplication {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
ApplicationHome home = new ApplicationHome(YudaoServerApplication.class);
|
|
||||||
File jarFile = home.getSource();
|
|
||||||
String dirPath = jarFile.getParentFile().toString();
|
|
||||||
String filePath = dirPath + File.separator + ".dubbo";
|
|
||||||
System.out.println(filePath);
|
|
||||||
|
|
||||||
System.setProperty("dubbo.meta.cache.filePath", filePath);
|
|
||||||
System.setProperty("dubbo.mapping.cache.filePath",filePath);
|
|
||||||
|
|
||||||
SpringApplication.run(YudaoServerApplication.class, args);
|
SpringApplication.run(YudaoServerApplication.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+11
@@ -2773,6 +2773,12 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
|||||||
StringBuilder pBrand=new StringBuilder();
|
StringBuilder pBrand=new StringBuilder();
|
||||||
StringBuilder pCate=new StringBuilder();
|
StringBuilder pCate=new StringBuilder();
|
||||||
yxStoreOrder.getCartInfoList().forEach(c->{
|
yxStoreOrder.getCartInfoList().forEach(c->{
|
||||||
|
if (ObjectUtil.isEmpty(c.getCartInfoMap())){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!c.getCartInfoMap().containsKey("productInfo")){
|
||||||
|
return;
|
||||||
|
}
|
||||||
Object info = c.getCartInfoMap().get("productInfo");
|
Object info = c.getCartInfoMap().get("productInfo");
|
||||||
YxStoreProductQueryVo vo = JSONUtil.toBean(info.toString(), YxStoreProductQueryVo.class);
|
YxStoreProductQueryVo vo = JSONUtil.toBean(info.toString(), YxStoreProductQueryVo.class);
|
||||||
if (ObjectUtil.isNotEmpty(vo)) {
|
if (ObjectUtil.isNotEmpty(vo)) {
|
||||||
@@ -2783,8 +2789,12 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
|||||||
.append(" ,\r\n");
|
.append(" ,\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!c.getCartInfoMap().containsKey("productId")){
|
||||||
|
return;
|
||||||
|
}
|
||||||
Integer productId=Integer.valueOf(c.getCartInfoMap().get("productId").toString());
|
Integer productId=Integer.valueOf(c.getCartInfoMap().get("productId").toString());
|
||||||
YxStoreProduct yxStoreProduct=yxStoreProductService.getById(productId);
|
YxStoreProduct yxStoreProduct=yxStoreProductService.getById(productId);
|
||||||
|
if (ObjectUtil.isNotEmpty(yxStoreProduct)){
|
||||||
if (ObjectUtil.isNotNull(yxStoreBrandService.getById(yxStoreProduct.getBrandId()))) {
|
if (ObjectUtil.isNotNull(yxStoreBrandService.getById(yxStoreProduct.getBrandId()))) {
|
||||||
pBrand.append(yxStoreBrandService.getById(yxStoreProduct.getBrandId()).getBrandName());
|
pBrand.append(yxStoreBrandService.getById(yxStoreProduct.getBrandId()).getBrandName());
|
||||||
}
|
}
|
||||||
@@ -2792,6 +2802,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
|||||||
// YxStoreCategory yxStoreCategory=yxStoreCategoryService.getById(yxStoreProduct.getCateId());
|
// YxStoreCategory yxStoreCategory=yxStoreCategoryService.getById(yxStoreProduct.getCateId());
|
||||||
pCate.append(yxStoreCategoryService.getById(yxStoreProduct.getCateId()).getCateName());
|
pCate.append(yxStoreCategoryService.getById(yxStoreProduct.getCateId()).getCateName());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
map.put("商品名称",pname);
|
map.put("商品名称",pname);
|
||||||
map.put("商品品牌",pBrand);
|
map.put("商品品牌",pBrand);
|
||||||
|
|||||||
Reference in New Issue
Block a user