Merge remote-tracking branch 'origin/master' into dev
# Conflicts: # smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/service/impl/TransactionBillValidatorImpl.java
This commit is contained in:
commit
486f192946
|
@ -130,6 +130,22 @@ public class CollectionUtils extends org.springframework.util.CollectionUtils {
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
public static boolean equalsDecimal(List<BigDecimal> l1, List<BigDecimal> l2) {
|
||||||
|
if (Objects.equals(l1, l2)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (l1.size() != l2.size()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
for(int i = 0; i < l1.size(); i ++) {
|
||||||
|
BigDecimal o1 = l1.get(i);
|
||||||
|
BigDecimal o2 = l2.get(i);
|
||||||
|
if (o1.compareTo(o2) != 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -177,7 +177,7 @@ public class TransactionBillValidatorImpl extends BaseValidator implements Trans
|
||||||
if (!Objects.equals(suit.getTimeUnit(), dto.getSuitTimeUnit())) {
|
if (!Objects.equals(suit.getTimeUnit(), dto.getSuitTimeUnit())) {
|
||||||
return error("当前套餐时间已发生变化,请重新下单");
|
return error("当前套餐时间已发生变化,请重新下单");
|
||||||
}
|
}
|
||||||
if (!CollectionUtils.equals(suit.getGearAmount(), dto.getSuitGearAmount())) {
|
if (!CollectionUtils.equalsDecimal(suit.getGearAmount(), dto.getSuitGearAmount())) {
|
||||||
log.error("套餐收费方式已发生变化,请重新下单:suit.getGearAmount()={}, dto.getSuitGearAmount()={}", suit.getGearAmount(), dto.getSuitGearAmount());
|
log.error("套餐收费方式已发生变化,请重新下单:suit.getGearAmount()={}, dto.getSuitGearAmount()={}", suit.getGearAmount(), dto.getSuitGearAmount());
|
||||||
return error("套餐收费方式已发生变化,请重新下单");
|
return error("套餐收费方式已发生变化,请重新下单");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user