Просмотр исходного кода

订单商品删除问题处理

anderx лет назад: 7
Родитель
Сommit
b9637fa46b
1 измененных файлов с 7 добавлено и 1 удалено
  1. 7 1
      src/main/java/com/goafanti/order/service/impl/JtOrderServiceImpl.java

+ 7 - 1
src/main/java/com/goafanti/order/service/impl/JtOrderServiceImpl.java

@@ -213,13 +213,19 @@ public class JtOrderServiceImpl extends BaseMybatisDao<JtOrderMapper> implements
 					if (null!=j.getCommodityType()) {
 					if (null!=j.getCommodityType()) {
 						if (j.getCommodityType()==1||j.getCommodityType()==0) {
 						if (j.getCommodityType()==1||j.getCommodityType()==0) {
 							JtBusinessProject bp=JtBusinessProjectMapper.selectByPrimaryKey(j.getCommodityId());
 							JtBusinessProject bp=JtBusinessProjectMapper.selectByPrimaryKey(j.getCommodityId());
-							j.setImgUrl(bp.getMinImgUrl());
+							if (null!=bp) {
+								j.setImgUrl(bp.getMinImgUrl());
+							}
 						}else if (j.getCommodityType()==2) {
 						}else if (j.getCommodityType()==2) {
 							Achievement a=achievementMapper.selectByPrimaryKey(j.getCommodityId());
 							Achievement a=achievementMapper.selectByPrimaryKey(j.getCommodityId());
+							if (null!=a) {
 							j.setImgUrl(a.getTechnicalPictureUrl());
 							j.setImgUrl(a.getTechnicalPictureUrl());
+							}
 						}else if (j.getCommodityType()==3) {
 						}else if (j.getCommodityType()==3) {
 							Demand d=demandMapper.selectByPrimaryKey(j.getCommodityId());
 							Demand d=demandMapper.selectByPrimaryKey(j.getCommodityId());
+							if (null!=d) {
 							j.setImgUrl(d.getPictureUrl());
 							j.setImgUrl(d.getPictureUrl());
+							}
 						}
 						}
 					}
 					}
 				}
 				}