From 01e3f19f82f6b4808ef3c8ecc5243702de95cc5e Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Wed, 22 Nov 2023 09:06:45 +0800 Subject: [PATCH] 20231122.9.06 --- log.path_IS_UNDEFINED/web_debug.log | 0 log.path_IS_UNDEFINED/web_error.log | 34 +++++++++++++++++++ log.path_IS_UNDEFINED/web_info.log | 0 log.path_IS_UNDEFINED/web_warn.log | 6 ++++ .../book/controller/BookController.java | 2 ++ .../book/controller/BuyOrderController.java | 2 +- .../controller/UserAddressController.java | 3 ++ .../service/impl/AliPayServiceImpl.java | 9 ++--- src/main/resources/application-dev.yml | 5 +++ src/main/resources/application-prod.yml | 4 +++ src/main/resources/application-test.yml | 4 +++ src/main/resources/logback-spring.xml | 2 +- 12 files changed, 62 insertions(+), 9 deletions(-) create mode 100644 log.path_IS_UNDEFINED/web_debug.log create mode 100644 log.path_IS_UNDEFINED/web_error.log create mode 100644 log.path_IS_UNDEFINED/web_info.log create mode 100644 log.path_IS_UNDEFINED/web_warn.log diff --git a/log.path_IS_UNDEFINED/web_debug.log b/log.path_IS_UNDEFINED/web_debug.log new file mode 100644 index 00000000..e69de29b diff --git a/log.path_IS_UNDEFINED/web_error.log b/log.path_IS_UNDEFINED/web_error.log new file mode 100644 index 00000000..51c12c87 --- /dev/null +++ b/log.path_IS_UNDEFINED/web_error.log @@ -0,0 +1,34 @@ +2023-11-21 10:44:30.152 [redisson-netty-4-26] ERROR i.n.u.concurrent.DefaultPromise.rejectedExecution - Failed to submit a listener notification task. Event loop shut down? +java.util.concurrent.RejectedExecutionException: event executor terminated + at io.netty.util.concurrent.SingleThreadEventExecutor.reject(SingleThreadEventExecutor.java:923) + at io.netty.util.concurrent.SingleThreadEventExecutor.offerTask(SingleThreadEventExecutor.java:350) + at io.netty.util.concurrent.SingleThreadEventExecutor.addTask(SingleThreadEventExecutor.java:343) + at io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:825) + at io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:815) + at io.netty.util.concurrent.DefaultPromise.safeExecute(DefaultPromise.java:841) + at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:499) + at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:616) + at io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:605) + at io.netty.util.concurrent.DefaultPromise.setSuccess(DefaultPromise.java:96) + at io.netty.channel.group.DefaultChannelGroupFuture.setSuccess0(DefaultChannelGroupFuture.java:200) + at io.netty.channel.group.DefaultChannelGroupFuture.access$400(DefaultChannelGroupFuture.java:41) + at io.netty.channel.group.DefaultChannelGroupFuture$1.operationComplete(DefaultChannelGroupFuture.java:75) + at io.netty.channel.group.DefaultChannelGroupFuture$1.operationComplete(DefaultChannelGroupFuture.java:48) + at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578) + at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:571) + at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:550) + at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491) + at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:616) + at io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:605) + at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:104) + at io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:84) + at io.netty.channel.AbstractChannel$CloseFuture.setClosed(AbstractChannel.java:1164) + at io.netty.channel.AbstractChannel$AbstractUnsafe.doClose0(AbstractChannel.java:755) + at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:731) + at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:620) + at io.netty.channel.nio.NioEventLoop.closeAll(NioEventLoop.java:772) + at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:529) + at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) + at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) + at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) + at java.lang.Thread.run(Thread.java:748) diff --git a/log.path_IS_UNDEFINED/web_info.log b/log.path_IS_UNDEFINED/web_info.log new file mode 100644 index 00000000..e69de29b diff --git a/log.path_IS_UNDEFINED/web_warn.log b/log.path_IS_UNDEFINED/web_warn.log new file mode 100644 index 00000000..d2cb1c69 --- /dev/null +++ b/log.path_IS_UNDEFINED/web_warn.log @@ -0,0 +1,6 @@ +2023-11-21 10:36:58.046 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning +2023-11-21 10:40:18.813 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning +2023-11-21 10:41:42.406 [AMQP Connection 39.106.36.183:5672] WARN com.rabbitmq.client.impl.ForgivingExceptionHandler - An unexpected connection driver error occurred (Exception message: Connection reset) +2023-11-21 10:46:49.457 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning +2023-11-21 10:50:31.693 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning +2023-11-21 10:51:56.022 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning diff --git a/src/main/java/com/peanut/modules/book/controller/BookController.java b/src/main/java/com/peanut/modules/book/controller/BookController.java index c28eb05b..8afa661a 100644 --- a/src/main/java/com/peanut/modules/book/controller/BookController.java +++ b/src/main/java/com/peanut/modules/book/controller/BookController.java @@ -12,6 +12,7 @@ import com.peanut.modules.book.dao.BookDao; import com.peanut.modules.book.entity.*; import com.peanut.modules.book.service.*; import com.peanut.modules.book.vo.BookIndexVo; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.web.bind.annotation.*; @@ -24,6 +25,7 @@ import com.peanut.common.utils.R; * @email yl328572838@163.com * @date 2022-08-04 15:36:59 */ +@Slf4j @RestController @RequestMapping("book/book") public class BookController { diff --git a/src/main/java/com/peanut/modules/book/controller/BuyOrderController.java b/src/main/java/com/peanut/modules/book/controller/BuyOrderController.java index 4ec5687b..7942727e 100644 --- a/src/main/java/com/peanut/modules/book/controller/BuyOrderController.java +++ b/src/main/java/com/peanut/modules/book/controller/BuyOrderController.java @@ -310,7 +310,7 @@ public class BuyOrderController { return R.error(500, "花生币余额不足!"); } } - // 2. 微信支付 + // 2. 微信支付,需要预支付 if (Constants.PAYMENT_METHOD_WECHAT_PAY.equals(buyOrder.getPaymentMethod())) { rabbitTemplate.convertAndSend( DelayQueueConfig.ORDER_TO_BE_PAY_EXCHANGE, diff --git a/src/main/java/com/peanut/modules/book/controller/UserAddressController.java b/src/main/java/com/peanut/modules/book/controller/UserAddressController.java index ae054199..8388a0c7 100644 --- a/src/main/java/com/peanut/modules/book/controller/UserAddressController.java +++ b/src/main/java/com/peanut/modules/book/controller/UserAddressController.java @@ -46,6 +46,9 @@ public class UserAddressController { if ((userAddressService.getUserDefaultAddressCount(userAddress.getUserId()) >= 1) && userAddress.getIsDefault() == 1) { return R.error("已经存在默认地址"); } + if(userAddress.getRegionCode()==null||userAddress.getRegionCode().equals("")){ + return R.error("地址异常添加失败!"); + } userAddressService.save(userAddress); return R.ok(); } diff --git a/src/main/java/com/peanut/modules/pay/alipay/service/impl/AliPayServiceImpl.java b/src/main/java/com/peanut/modules/pay/alipay/service/impl/AliPayServiceImpl.java index 39804f2a..e29ff8ce 100644 --- a/src/main/java/com/peanut/modules/pay/alipay/service/impl/AliPayServiceImpl.java +++ b/src/main/java/com/peanut/modules/pay/alipay/service/impl/AliPayServiceImpl.java @@ -122,7 +122,7 @@ public class AliPayServiceImpl implements AliPayService { return "success"; } PayZfbOrderEntity oldPayZfbOrderEntity = payZfbOrderService.getOne(new QueryWrapper().eq("out_trade_no", aliNotifyDto.getOutTradeNo())); - CopyUtils.copyProperties(aliNotifyDto,oldPayZfbOrderEntity); + CopyUtils.copyProperties(aliNotifyDto,oldPayZfbOrderEntity); payZfbOrderService.updateById(oldPayZfbOrderEntity); @@ -181,13 +181,9 @@ public class AliPayServiceImpl implements AliPayService { } if ("order".equals(subject)) { - System.out.println("=====到order更新字段=================================================================================================================="); BuyOrder orderEntity = buyOrderService.getBaseMapper().selectOne(new QueryWrapper().eq("order_sn", oldPayZfbOrderEntity.getRelevanceoid())); - System.out.println("======orderEntity=========="+orderEntity); BigDecimal realMoney = orderEntity.getRealMoney(); - System.out.println("======realMoney=========="+realMoney); BigDecimal bigDecimal = new BigDecimal(oldPayZfbOrderEntity.getBuyerPayAmount()); - System.out.println("======bigDecimal=========="+bigDecimal); //更新 订单 记录 if (bigDecimal.compareTo(realMoney) == 0) { buyOrderService.updateOrderStatus(Integer.valueOf(customerid),oldPayZfbOrderEntity.getRelevanceoid(),"0"); @@ -216,8 +212,7 @@ public class AliPayServiceImpl implements AliPayService { //TODO 更新用户优惠券状态 - - + //TODO 推送一路健康优惠券 diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 940996fc..817ddc12 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -1,4 +1,7 @@ spring: + logging: + file: + path: d:log/ redis: open: false # 是否开启redis缓存 true开启 false关闭 database: 0 @@ -86,5 +89,7 @@ wxpay: wechatPayCertificateUrl: D:/hs/nuttyreading-java/src/main/resources/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem privateKeyUrl: D:/hs/nuttyreading-java/src/main/resources/cent/apiclient_key.pem + + redisAddress: redis://59.110.212.44:6379 redisPassword: Jgll2015 \ No newline at end of file diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 6f6d11d8..424b54b4 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -85,5 +85,9 @@ wxpay: wechatPayCertificateUrl: /usr/local/hs/peanut_book/target/classes/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem privateKeyUrl: /usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem +logging: + file: + path: /usr/local/hs/peanut_book/logs/ + redisAddress: redis://59.110.212.44:6379 redisPassword: Jgll2015 \ No newline at end of file diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index 2e1ca3a4..c69a4c06 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -86,5 +86,9 @@ wxpay: wechatPayCertificateUrl: /usr/local/hs/peanut_book/target/classes/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem privateKeyUrl: /usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem +logging: + file: + path: /usr/local/hs/peanut_book/logs/ + redisAddress: redis://59.110.212.44:6379 redisPassword: Jgll2015 \ No newline at end of file diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml index 26c7e28e..1623814e 100644 --- a/src/main/resources/logback-spring.xml +++ b/src/main/resources/logback-spring.xml @@ -24,7 +24,7 @@ - +