935090232@qq.com
2021-05-16 36d16e2d43576002f66aeca435d0157ab0292f46
新增退款提醒
4 files modified
55 ■■■■■ changed files
zq-erp/pom.xml 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopRefundRecordAction.java 16 ●●●●● 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/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
@@ -11,8 +11,10 @@
import com.matrix.core.exception.GlobleException;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.core.tools.*;
import com.matrix.system.common.bean.BusParameterSettings;
import com.matrix.core.tools.LogUtil;
import com.matrix.core.tools.ModelUtils;
import com.matrix.core.tools.StringUtils;
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;
@@ -526,15 +528,7 @@
                modifyMap.put("refundCharge", shopRefundRecord.getRefundMoney());
                shopOrderDao.updateByMap(modifyMap);
                //发送退款通知
                BusParameterSettings wxOrderNoticeDingdingToken = parameterSettingsDao.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()
                            ,"");
                }
                rabiitMqTemplate.sendMsg(MQTaskRouting.SHOP_ORDER_REFUND+evn,shopRefundRecord.getOrderId()+"");
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);