jyy
2021-05-17 af0fec046a86c63ec007791efdad51ffecf78ae2
Merge remote-tracking branch 'origin/score_shop' into score_shop
5 files modified
65 ■■■■ changed files
zq-erp/pom.xml 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopRefundRecordAction.java 7 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxRefundRecordAction.java 13 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopRefundRecordServiceImpl.java 22 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/OrderDingDingNoticeTask.java 19 ●●●● patch | view | raw | blame | history
zq-erp/pom.xml
@@ -401,11 +401,11 @@
                    <exclude>config/xcx/*</exclude>
                    <exclude>config/xcshop/*</exclude>
                    <!---->
                    <!--
                    <exclude>config/config.json</exclude>
                    <exclude>config/application.properties</exclude>
                    <exclude>config/system.properties</exclude>
                    -->
                    <exclude>**/*.woff</exclude>
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopRefundRecordAction.java
@@ -17,6 +17,7 @@
import com.matrix.core.tools.WebUtil;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.constance.AppConstance;
import com.matrix.system.common.dao.BusParameterSettingsDao;
import com.matrix.system.hive.action.util.QueryUtil;
import com.matrix.system.shopXcx.api.service.WXShopOrderService;
import com.matrix.system.shopXcx.api.service.WxShopRefundRecordService;
@@ -81,6 +82,8 @@
    @Autowired
    private RabiitMqTemplate rabiitMqTemplate;
    @Autowired
    BusParameterSettingsDao parameterSettingsDao;
    /**
     * 列表显示
@@ -525,8 +528,12 @@
                modifyMap.put("refundCharge", shopRefundRecord.getRefundMoney());
                shopOrderDao.updateByMap(modifyMap);
                rabiitMqTemplate.sendMsg(MQTaskRouting.SHOP_ORDER_REFUND+evn,shopRefundRecord.getOrderId()+"");
            }catch (Exception e){
                LogUtil.debug("退款成功,修改退款表和订单表状态出错。。。", id);
                e.printStackTrace();
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxRefundRecordAction.java
@@ -1,6 +1,5 @@
package com.matrix.system.shopXcx.api.action;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.component.tools.WxUtils;
import com.matrix.core.pojo.AjaxResult;
@@ -9,6 +8,7 @@
import com.matrix.system.common.constance.AppConstance;
import com.matrix.system.common.dao.BusParameterSettingsDao;
import com.matrix.system.common.dao.CustomerDataDictionaryDao;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.system.shopXcx.api.service.WxShopRefundRecordService;
import com.matrix.system.shopXcx.api.tools.SMSTools;
import com.matrix.system.shopXcx.bean.ShopDeliveryInfo;
@@ -103,6 +103,7 @@
        return Double.valueOf(moneyStr);
    }
    /**
     * 接收保存退款退货数据
     */
@@ -135,13 +136,13 @@
            if (i == 0) {
                return new AjaxResult(AjaxResult.STATUS_FAIL, "保存失败");
            }
            ShopOrder order = shopOrderDao.selectById(refundRecord.getOrderId());
            //未发货的订单取消订单不走后台审核直接退款
            List<ShopRefundRecord> refundRecordsList = refundRecordDao.selectByModel(record);
            if(CollectionUtils.isNotEmpty(refundRecordsList)){
                ShopRefundRecord shopRecord = refundRecordsList.get(0);
                Integer orderId = shopRecord.getOrderId();
                ShopOrder order = shopOrderDao.selectById(orderId);
                if (order == null) {
                    return new AjaxResult(AjaxResult.STATUS_FAIL, "未发货直接退款未找到订单信息");
                }
@@ -160,6 +161,10 @@
                    if(flag){
                        ShopRefundRecord fundRecord = refundRecordDao.selectById(shopRecord.getId());
                        refundRecordService.updateGroupBuyStatus(orderId.longValue());
                        return new AjaxResult(AjaxResult.STATUS_SUCCESS, "退款成功");
                    }
                    return new AjaxResult(AjaxResult.STATUS_FAIL, "退款失败");
@@ -172,6 +177,8 @@
            modifyMap.put("id", orderId);
            modifyMap.put("orderStatus", ShopOrder.ORDER_STATUS_APPLY_MONEYBACK);
            shopOrderDao.updateByMap(modifyMap);
            return new AjaxResult(AjaxResult.STATUS_SUCCESS, "保存成功");
        }
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopRefundRecordServiceImpl.java
@@ -1,12 +1,14 @@
package com.matrix.system.shopXcx.api.service.impl;
import com.matrix.component.rabbitmq.RabiitMqTemplate;
import com.matrix.component.tools.WxTempLateMsgUtil;
import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil;
import com.matrix.core.exception.GlobleException;
import com.matrix.core.tools.DateUtil;
import com.matrix.core.tools.DingDingRobotUtil;
import com.matrix.core.tools.LogUtil;
import com.matrix.core.tools.StringUtils;
import com.matrix.system.common.bean.BusParameterSettings;
import com.matrix.system.common.constance.AppConstance;
import com.matrix.system.common.dao.BusParameterSettingsDao;
import com.matrix.system.shopXcx.api.service.WXShopOrderService;
import com.matrix.system.shopXcx.api.service.WxShopRefundRecordService;
import com.matrix.system.shopXcx.bean.*;
@@ -16,10 +18,8 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -48,6 +48,10 @@
    @Autowired
    private ShopActivitiesGroupJoinDao shopActivitiesGroupJoinDao;
    @Autowired
    private BusParameterSettingsDao busParameterSettingsDao;
    @Value("${wx_pay_debug_onoff}")
    private boolean isDebug;
@@ -146,6 +150,16 @@
                rabiitMqTemplate.sendMsg(MQTaskRouting.SHOP_ORDER_REFUND+evn,shopRefundRecord.getOrderId()+"");
                //发送退款通知
                BusParameterSettings wxOrderNoticeDingdingToken = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WX_ORDER_NOTICE_DINGDING_TOKEN, shopOrder.getCompanyId());
                if (wxOrderNoticeDingdingToken != null && StringUtils.isNotBlank(wxOrderNoticeDingdingToken.getParamValue())) {
                    DingDingRobotUtil.sendText(wxOrderNoticeDingdingToken.getParamValue(),
                            "订单退款,微商城订单编号 "+shopOrder.getOrderNo()
                                    +"; 订单金额:¥"+shopOrder.getOrderMoney()
                                    +";收货电话:"+ shopOrder.getUserTel()+",收货人:"+ shopOrder.getUserName()
                            ,"");
                }
            }catch (Exception e){
                LogUtil.debug("退款成功,修改退款表和订单表状态出错。。。", id);
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/OrderDingDingNoticeTask.java
@@ -7,10 +7,11 @@
import com.matrix.system.common.bean.BusParameterSettings;
import com.matrix.system.common.constance.AppConstance;
import com.matrix.system.common.dao.BusParameterSettingsDao;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.system.hive.dao.SysVipInfoDao;
import com.matrix.system.shopXcx.bean.ShopDeliveryInfo;
import com.matrix.system.shopXcx.bean.ShopOrder;
import com.matrix.system.shopXcx.bean.ShopOrderDetails;
import com.matrix.system.shopXcx.dao.ShopDeliveryInfoDao;
import com.matrix.system.shopXcx.dao.ShopOrderDao;
import com.matrix.system.shopXcx.dao.ShopOrderDetailsDao;
import com.rabbitmq.client.DeliverCallback;
@@ -41,11 +42,15 @@
    @Autowired
    SysVipInfoDao sysVipInfoDao;
    @Autowired
    ShopDeliveryInfoDao shopDeliveryInfoDao;
    @Override
    public void handle(String consumerTag, Delivery message) throws IOException {
        String orderId = new String(message.getBody(), "UTF-8");
        String orderIdStr = new String(message.getBody(), "UTF-8");
        Integer orderId=Integer.valueOf(orderIdStr);
        //获取订单信息
        ShopOrder order = shopOrderDao.selectById(Integer.valueOf(orderId));
        ShopOrder order = shopOrderDao.selectById(orderId);
        LogUtil.debug("收到创建订单通知任务orderId={}", orderId);
        BusParameterSettings wxOrderNoticeDingdingToken = parameterSettingsDao.selectCompanyParamByCode(AppConstance.WX_ORDER_NOTICE_DINGDING_TOKEN, order.getCompanyId());
        if (wxOrderNoticeDingdingToken != null && StringUtils.isNotBlank(wxOrderNoticeDingdingToken.getParamValue())) {
@@ -54,8 +59,14 @@
            StringBuilder content = new StringBuilder();
            orderDetails.stream().forEach(i -> content.append(i.getsTitle()).append("*").append(
                    i.getCount()).append(";"));
            ShopDeliveryInfo addInfo = shopDeliveryInfoDao.selectByOrderId(orderId);
            DingDingRobotUtil.sendText(wxOrderNoticeDingdingToken.getParamValue(),"微商城订单 ("+order.getUserName()+") | 订单金额:¥"+order.getOrderMoney()+",订单内容:"+ content.toString(),"");
            DingDingRobotUtil.sendText(wxOrderNoticeDingdingToken.getParamValue(),
                    "新订单,微商城订单编号 "+order.getOrderNo()
                            +"; 订单金额:¥"+order.getOrderMoney()
                            +";订单内容:"+ content.toString()
                            +";收货电话:"+ order.getUserTel()+",收货人:"+ order.getUserName()+",收货地址:"+ addInfo.getReceiveAddress()
                    ,"");
        }else{
            LogUtil.debug("未配置订单钉钉提醒");
        }