pageHelper 不生效问题
空值问题
This commit is contained in:
@@ -34,7 +34,6 @@ alipay:
|
|||||||
|
|
||||||
pagehelper:
|
pagehelper:
|
||||||
helper-dialect: mysql
|
helper-dialect: mysql
|
||||||
reasonable: true
|
|
||||||
support-methods-arguments: true
|
support-methods-arguments: true
|
||||||
|
|
||||||
dubbo:
|
dubbo:
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ mybatis-flex:
|
|||||||
|
|
||||||
pagehelper:
|
pagehelper:
|
||||||
helper-dialect: mysql
|
helper-dialect: mysql
|
||||||
reasonable: true
|
|
||||||
support-methods-arguments: true
|
support-methods-arguments: true
|
||||||
|
|
||||||
dubbo:
|
dubbo:
|
||||||
|
|||||||
@@ -21,5 +21,4 @@ mybatis-flex:
|
|||||||
jdbc-type-for-null: 'null'
|
jdbc-type-for-null: 'null'
|
||||||
pagehelper:
|
pagehelper:
|
||||||
helper-dialect: mysql
|
helper-dialect: mysql
|
||||||
reasonable: true
|
|
||||||
support-methods-arguments: true
|
support-methods-arguments: true
|
||||||
|
|||||||
@@ -12,5 +12,4 @@ logging:
|
|||||||
|
|
||||||
pagehelper:
|
pagehelper:
|
||||||
helper-dialect: mysql
|
helper-dialect: mysql
|
||||||
reasonable: true
|
|
||||||
support-methods-arguments: true
|
support-methods-arguments: true
|
||||||
@@ -87,4 +87,30 @@ public class CheckOrderPay implements Serializable {
|
|||||||
public Integer getPointsNum() {
|
public Integer getPointsNum() {
|
||||||
return pointsNum == null ? 0 : pointsNum;
|
return pointsNum == null ? 0 : pointsNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BigDecimal getDiscountRatio() {
|
||||||
|
return discountRatio == null ? BigDecimal.ONE : discountRatio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getFullCouponDiscountAmount() {
|
||||||
|
return fullCouponDiscountAmount == null ? BigDecimal.ZERO : fullCouponDiscountAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getProductCouponDiscountAmount() {
|
||||||
|
return productCouponDiscountAmount == null ? BigDecimal.ZERO : productCouponDiscountAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getDiscountAmount() {
|
||||||
|
return discountAmount == null ? BigDecimal.ZERO : discountAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPointsDiscountAmount() {
|
||||||
|
return pointsDiscountAmount == null ? BigDecimal.ZERO : pointsDiscountAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getRoundAmount() {
|
||||||
|
return roundAmount == null ? BigDecimal.ZERO : roundAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,17 +49,7 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.pagehelper</groupId>
|
<groupId>com.github.pagehelper</groupId>
|
||||||
<artifactId>pagehelper</artifactId>
|
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.github.jsqlparser</groupId>
|
|
||||||
<artifactId>jsqlparser</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.pagehelper</groupId>
|
|
||||||
<artifactId>sqlparser4.5</artifactId>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
<dubbo-registry-nacos.version>3.3.3</dubbo-registry-nacos.version>
|
<dubbo-registry-nacos.version>3.3.3</dubbo-registry-nacos.version>
|
||||||
<dubbo.version>3.3.3</dubbo.version>
|
<dubbo.version>3.3.3</dubbo.version>
|
||||||
<seata.version>2.0.0</seata.version>
|
<seata.version>2.0.0</seata.version>
|
||||||
<pagehelper.version>6.1.0</pagehelper.version>
|
<pagehelper.version>2.1.0</pagehelper.version>
|
||||||
<alipay-sdk-java.version>4.40.54.ALL</alipay-sdk-java.version>
|
<alipay-sdk-java.version>4.40.54.ALL</alipay-sdk-java.version>
|
||||||
<aliyun-sms.version>2.0.24</aliyun-sms.version>
|
<aliyun-sms.version>2.0.24</aliyun-sms.version>
|
||||||
<aliyun.oss.version>2.8.3</aliyun.oss.version>
|
<aliyun.oss.version>2.8.3</aliyun.oss.version>
|
||||||
@@ -168,21 +168,9 @@
|
|||||||
<artifactId>seata-spring-boot-starter</artifactId>
|
<artifactId>seata-spring-boot-starter</artifactId>
|
||||||
<version>${seata.version}</version>
|
<version>${seata.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.pagehelper</groupId>
|
<groupId>com.github.pagehelper</groupId>
|
||||||
<artifactId>pagehelper</artifactId>
|
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||||
<version>${pagehelper.version}</version>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.github.jsqlparser</groupId>
|
|
||||||
<artifactId>jsqlparser</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.pagehelper</groupId>
|
|
||||||
<artifactId>sqlparser4.5</artifactId>
|
|
||||||
<version>${pagehelper.version}</version>
|
<version>${pagehelper.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
@@ -91,12 +91,12 @@ public class ShopCouponServiceImpl extends ServiceImpl<ShopCouponMapper, ShopCou
|
|||||||
@Override
|
@Override
|
||||||
public Page<ShopActivateCouponRecord> find(Long userId, Long shopId, Integer status) {
|
public Page<ShopActivateCouponRecord> find(Long userId, Long shopId, Integer status) {
|
||||||
Page<Object> page = PageUtil.buildPage();
|
Page<Object> page = PageUtil.buildPage();
|
||||||
PageHelper.startPage(Math.toIntExact(page.getPageNumber()),Math.toIntExact(page.getPageSize()));
|
|
||||||
List<Long> shopUserIds = shopUserService.queryChain()
|
List<Long> shopUserIds = shopUserService.queryChain()
|
||||||
.eq(ShopUser::getUserId, userId)
|
.eq(ShopUser::getUserId, userId)
|
||||||
.eq(ShopUser::getShopId, shopId)
|
.eq(ShopUser::getShopId, shopId)
|
||||||
.select(ShopUser::getId).listAs(Long.class);
|
.select(ShopUser::getId).listAs(Long.class);
|
||||||
if (CollectionUtil.isNotEmpty(shopUserIds)) {
|
if (CollectionUtil.isNotEmpty(shopUserIds)) {
|
||||||
|
PageHelper.startPage(Math.toIntExact(page.getPageNumber()),Math.toIntExact(page.getPageSize()));
|
||||||
return PageUtil.convert(new PageInfo<>(couponRecordService.findByUser(shopUserIds, status)));
|
return PageUtil.convert(new PageInfo<>(couponRecordService.findByUser(shopUserIds, status)));
|
||||||
}
|
}
|
||||||
return new Page<>();
|
return new Page<>();
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||||||
if (prodCouponAmount.getPrice().compareTo(param.getProductCouponDiscountAmount()) != 0) {
|
if (prodCouponAmount.getPrice().compareTo(param.getProductCouponDiscountAmount()) != 0) {
|
||||||
throw new ValidateException("生成支付订单失败,商品优惠券优惠金额不正确");
|
throw new ValidateException("生成支付订单失败,商品优惠券优惠金额不正确");
|
||||||
}
|
}
|
||||||
BigDecimal newTotalAmount = BigDecimal.ZERO;
|
BigDecimal newTotalAmount;
|
||||||
//折扣金额 如 9折 计算 为 订单金额*0.9 向上取整
|
//折扣金额 如 9折 计算 为 订单金额*0.9 向上取整
|
||||||
if (param.getDiscountRatio().compareTo(BigDecimal.ONE) != 0) {
|
if (param.getDiscountRatio().compareTo(BigDecimal.ONE) != 0) {
|
||||||
newTotalAmount = totalAmount.getPrice().multiply(param.getDiscountRatio()).setScale(2, RoundingMode.UP);
|
newTotalAmount = totalAmount.getPrice().multiply(param.getDiscountRatio()).setScale(2, RoundingMode.UP);
|
||||||
@@ -648,7 +648,6 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||||||
*/
|
*/
|
||||||
private void upOrderPayInfo(OrderInfo orderInfo, CheckOrderPay param) {
|
private void upOrderPayInfo(OrderInfo orderInfo, CheckOrderPay param) {
|
||||||
orderInfo.setPointsNum(param.getPointsNum());
|
orderInfo.setPointsNum(param.getPointsNum());
|
||||||
orderInfo.setOriginAmount(param.getOriginAmount());
|
|
||||||
orderInfo.setRoundAmount(param.getRoundAmount());
|
orderInfo.setRoundAmount(param.getRoundAmount());
|
||||||
orderInfo.setOrderAmount(param.getOrderAmount());
|
orderInfo.setOrderAmount(param.getOrderAmount());
|
||||||
orderInfo.setPointsDiscountAmount(param.getPointsDiscountAmount());
|
orderInfo.setPointsDiscountAmount(param.getPointsDiscountAmount());
|
||||||
@@ -660,7 +659,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||||||
//折扣信息
|
//折扣信息
|
||||||
orderInfo.setDiscountInfo(buildDiscountInfo(orderInfo));
|
orderInfo.setDiscountInfo(buildDiscountInfo(orderInfo));
|
||||||
//最终折扣
|
//最终折扣
|
||||||
orderInfo.setDiscountRatio(param.getOriginAmount().divide(param.getOrderAmount(), 2, RoundingMode.UP));
|
orderInfo.setDiscountRatio(orderInfo.getOriginAmount().divide(param.getOrderAmount(), 2, RoundingMode.UP));
|
||||||
saveOrUpdate(orderInfo);
|
saveOrUpdate(orderInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,17 +42,7 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.pagehelper</groupId>
|
<groupId>com.github.pagehelper</groupId>
|
||||||
<artifactId>pagehelper</artifactId>
|
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.github.jsqlparser</groupId>
|
|
||||||
<artifactId>jsqlparser</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.pagehelper</groupId>
|
|
||||||
<artifactId>sqlparser4.5</artifactId>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.czg</groupId>
|
<groupId>com.czg</groupId>
|
||||||
|
|||||||
Reference in New Issue
Block a user