no
DESKTOP-71BH0QO\L、ming
2021-04-21 1a95a181a4d3432042bf520ff2c887d01534426d
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() + " " );
            });
@@ -680,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){
@@ -694,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())));
        shopOrderDO.setPayTime(DateUtils.stringToDate(wxPayNotifyOrderDTO.getPayTime(),new SimpleDateFormat("yyyyMMddHHmmss")));
        this.baseMapper.updateById(shopOrderDO);
        //查询订单商品
@@ -728,7 +741,6 @@
                comShopStoreDAO.updateById(storeDO);
            }
        }
        //添加订单操作记录
        ComShopOrderOperateDO orderOperateDO = new ComShopOrderOperateDO();
@@ -777,4 +789,9 @@
        }
        return R.ok(shopOrderVO);
    }
    public static void main(String[] args) {
        BigDecimal one = BigDecimal.valueOf(Double.valueOf("1") / 100);
        System.out.println();
    }
}