From 1a95a181a4d3432042bf520ff2c887d01534426d Mon Sep 17 00:00:00 2001
From: DESKTOP-71BH0QO\L、ming <172680469@qq.com>
Date: 星期三, 21 四月 2021 18:08:35 +0800
Subject: [PATCH] no

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopOrderServiceImpl.java |   28 ++++++++++++++++++++++++++--
 1 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopOrderServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopOrderServiceImpl.java
index 6b120cf..a1f380d 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopOrderServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopOrderServiceImpl.java
@@ -8,6 +8,7 @@
 import com.panzhihua.common.model.dtos.PageDTO;
 import com.panzhihua.common.model.dtos.shop.*;
 import com.panzhihua.common.model.vos.R;
+import com.panzhihua.common.utlis.DateUtils;
 import com.panzhihua.common.utlis.WxPayUtils;
 import com.panzhihua.service_community.dao.ComShopOrderDAO;
 import com.panzhihua.service_community.model.dos.ComShopOrderDO;
@@ -321,6 +322,11 @@
                     orderGoodsDOList.forEach(orderGoods -> {
                         ComShopOrderGoodsVO orderGoodsVO = new ComShopOrderGoodsVO();
                         BeanUtils.copyProperties(orderGoods,orderGoodsVO);
+                        //根据商品规格id查询商品规格
+                        ComShopGoodsAttrDO goodsAttrDO = comShopGoodsAttrDAO.selectById(orderGoods.getGoodsAttrId());
+                        if(goodsAttrDO != null){
+                            orderGoodsVO.setGoodsAttr(goodsAttrDO.getGoodsAttr());
+                        }
                         orderGoodsVO.setNum(orderGoods.getAmount());
                         orderGoodsVO.setGoodsPic(orderGoods.getGoodsAttrPic());
                         orderGoodsVO.setPrice(orderGoods.getGoodsAttrPrice());
@@ -378,6 +384,11 @@
                 orderGoodsVO.setNum(orderGoods.getAmount());
                 orderGoodsVO.setGoodsPic(orderGoods.getGoodsAttrPic());
                 orderGoodsVO.setPrice(orderGoods.getGoodsAttrPrice());
+                //根据商品规格id查询商品规格
+                ComShopGoodsAttrDO goodsAttrDO = comShopGoodsAttrDAO.selectById(orderGoods.getGoodsAttrId());
+                if(goodsAttrDO != null){
+                    orderGoodsVO.setGoodsAttr(goodsAttrDO.getGoodsAttr());
+                }
                 orderGoodsVOS.add(orderGoodsVO);
                 sbr.append(orderGoods.getGoodsName() + " " );
             });
@@ -619,6 +630,12 @@
     @Override
     public R getFundsStat(Long userId) {
         ComShopFundsVO comShopFundsVO = comShopOrderDAO.queryStatis(userId);
+        if(comShopFundsVO==null){
+            comShopFundsVO = new ComShopFundsVO();
+            comShopFundsVO.setMonthTotal(new BigDecimal(0));
+            comShopFundsVO.setTodayTotal(new BigDecimal(0));
+            comShopFundsVO.setWeekTotal(new BigDecimal(0));
+        }
         return R.ok(comShopFundsVO);
     }
 
@@ -674,11 +691,13 @@
     @Transactional(rollbackFor = Exception.class)
     @Override
     public void wxOrderPayNotify(WxPayNotifyOrderDTO wxPayNotifyOrderDTO){
+        log.info("微信订单支付回调开始处理逻辑");
         if(StringUtils.isEmpty(wxPayNotifyOrderDTO.getOrderTradeNo())){
             log.error("微信支付回调失败,订单号为空");
             return;
         }
 
+        log.info("微信订单支付回调开始查询订单");
         //查询订单
         ComShopOrderDO shopOrderDO = this.baseMapper.selectOne(new QueryWrapper<ComShopOrderDO>().lambda().eq(ComShopOrderDO::getOrderNo,wxPayNotifyOrderDTO.getOrderTradeNo()));
         if(shopOrderDO == null){
@@ -688,9 +707,9 @@
         shopOrderDO.setStatus(ComShopOrderDO.status.dfh);
         shopOrderDO.setPayType(ComShopOrderDO.payType.wx);
         shopOrderDO.setPayStatus(ComShopOrderDO.payStatus.yes);
-        shopOrderDO.setPayAmount(BigDecimal.valueOf(Integer.parseInt(wxPayNotifyOrderDTO.getCashFee()) / 100));
+        shopOrderDO.setPayAmount(BigDecimal.valueOf(Double.valueOf(wxPayNotifyOrderDTO.getCashFee()) / 100));
         shopOrderDO.setWxTardeNo(wxPayNotifyOrderDTO.getWxTradeNo());
-        shopOrderDO.setPayTime(new Date(Long.parseLong(wxPayNotifyOrderDTO.getPayTime() + "000")));
+        shopOrderDO.setPayTime(DateUtils.stringToDate(wxPayNotifyOrderDTO.getPayTime(),new SimpleDateFormat("yyyyMMddHHmmss")));
         this.baseMapper.updateById(shopOrderDO);
 
         //查询订单商品
@@ -770,4 +789,9 @@
         }
         return R.ok(shopOrderVO);
     }
+
+    public static void main(String[] args) {
+        BigDecimal one = BigDecimal.valueOf(Double.valueOf("1") / 100);
+        System.out.println();
+    }
 }

--
Gitblit v1.7.1