Browse Source

fix 校验平台不存在

zoujiajian 3 years ago
parent
commit
af0e9e0efc

+ 2 - 2
netflix-service/src/main/java/com/cyksj/service/distribute/impl/DistributeServiceImpl.java

@@ -46,7 +46,7 @@ public class DistributeServiceImpl implements DistributeService {
 				throw new BusinessRuntimeException("比例错误");
 			}
 			GoodsDon goodsDon = goodsDonMapper.selectById(rate.getGoodsId());
-			if (goodsDon == null || goodsDon.getType() == 2) {
+			if (goodsDon == null || !goodsDon.getDeleted() || goodsDon.getType() == 2) {
 				throw new BusinessRuntimeException("平台错误");
 			}
 			rate.setDistributeId(userDistribute.getId());
@@ -68,7 +68,7 @@ public class DistributeServiceImpl implements DistributeService {
 				throw new BusinessRuntimeException("比例错误");
 			}
 			GoodsDon goodsDon = goodsDonMapper.selectById(rate.getGoodsId());
-			if (goodsDon == null || goodsDon.getType() == 2) {
+			if (goodsDon == null || !goodsDon.getDeleted() || goodsDon.getType() == 2) {
 				throw new BusinessRuntimeException("平台错误");
 			}
 			rate.setDistributeId(userDistribute.getId());