merge conflict origin/master
This commit is contained in:
		
						commit
						1b44bedf42
					
				@ -0,0 +1,40 @@
 | 
				
			|||||||
 | 
					package cn.lili.modules.order.order.entity.enums;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * 订单状态枚举
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @author Chopper
 | 
				
			||||||
 | 
					 * @since 2020/11/17 7:27 下午
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					public enum OrderStatusEnum {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 订单状态
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    UNPAID("未付款"),
 | 
				
			||||||
 | 
					    PAID("已付款"),
 | 
				
			||||||
 | 
					    UNDELIVERED("待发货"),
 | 
				
			||||||
 | 
					    DELIVERED("已发货"),
 | 
				
			||||||
 | 
					    COMPLETED("已完成"),
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 虚拟订单需要核验商品
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    TAKE("待核验"),
 | 
				
			||||||
 | 
					    CANCELLED("已取消");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private final String description;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    OrderStatusEnum(String description) {
 | 
				
			||||||
 | 
					        this.description = description;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public String getDescription() {
 | 
				
			||||||
 | 
					        return description;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public String description() {
 | 
				
			||||||
 | 
					        return this.description;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -39,7 +39,6 @@ import cn.lili.modules.payment.kit.plugin.wechat.model.*;
 | 
				
			|||||||
import cn.lili.modules.payment.service.PaymentService;
 | 
					import cn.lili.modules.payment.service.PaymentService;
 | 
				
			||||||
import cn.lili.modules.payment.service.RefundLogService;
 | 
					import cn.lili.modules.payment.service.RefundLogService;
 | 
				
			||||||
import cn.lili.modules.system.entity.dos.Setting;
 | 
					import cn.lili.modules.system.entity.dos.Setting;
 | 
				
			||||||
import cn.lili.modules.system.entity.dto.connect.dto.WechatConnectSettingItem;
 | 
					 | 
				
			||||||
import cn.lili.modules.system.entity.dto.payment.WechatPaymentSetting;
 | 
					import cn.lili.modules.system.entity.dto.payment.WechatPaymentSetting;
 | 
				
			||||||
import cn.lili.modules.system.entity.enums.SettingEnum;
 | 
					import cn.lili.modules.system.entity.enums.SettingEnum;
 | 
				
			||||||
import cn.lili.modules.system.service.SettingService;
 | 
					import cn.lili.modules.system.service.SettingService;
 | 
				
			||||||
@ -258,6 +257,9 @@ public class WechatPlugin implements Payment {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            WechatPaymentSetting setting = wechatPaymentSetting();
 | 
					            WechatPaymentSetting setting = wechatPaymentSetting();
 | 
				
			||||||
            String appid = setting.getAppId();
 | 
					            String appid = setting.getAppId();
 | 
				
			||||||
 | 
					            if (appid == null) {
 | 
				
			||||||
 | 
					                throw new ServiceException(ResultCode.WECHAT_PAYMENT_NOT_SETTING);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            UnifiedOrderModel unifiedOrderModel = new UnifiedOrderModel()
 | 
					            UnifiedOrderModel unifiedOrderModel = new UnifiedOrderModel()
 | 
				
			||||||
                    .setAppid(appid)
 | 
					                    .setAppid(appid)
 | 
				
			||||||
                    .setMchid(setting.getMchId())
 | 
					                    .setMchid(setting.getMchId())
 | 
				
			||||||
@ -323,6 +325,9 @@ public class WechatPlugin implements Payment {
 | 
				
			|||||||
            WechatPaymentSetting setting = wechatPaymentSetting();
 | 
					            WechatPaymentSetting setting = wechatPaymentSetting();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            String appid = setting.getServiceAppId();
 | 
					            String appid = setting.getServiceAppId();
 | 
				
			||||||
 | 
					            if (appid == null) {
 | 
				
			||||||
 | 
					                throw new ServiceException(ResultCode.WECHAT_PAYMENT_NOT_SETTING);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            UnifiedOrderModel unifiedOrderModel = new UnifiedOrderModel()
 | 
					            UnifiedOrderModel unifiedOrderModel = new UnifiedOrderModel()
 | 
				
			||||||
                    .setAppid(appid)
 | 
					                    .setAppid(appid)
 | 
				
			||||||
                    .setMchid(setting.getMchId())
 | 
					                    .setMchid(setting.getMchId())
 | 
				
			||||||
@ -391,6 +396,9 @@ public class WechatPlugin implements Payment {
 | 
				
			|||||||
            //微信小程序,appid 需要单独获取,这里读取了联合登陆配置的appid ,实际场景小程序自动登录,所以这个appid是最为保险的做法
 | 
					            //微信小程序,appid 需要单独获取,这里读取了联合登陆配置的appid ,实际场景小程序自动登录,所以这个appid是最为保险的做法
 | 
				
			||||||
            //如果有2开需求,这里需要调整,修改这个appid的获取途径即可
 | 
					            //如果有2开需求,这里需要调整,修改这个appid的获取途径即可
 | 
				
			||||||
            String appid = wechatPaymentSetting().getMpAppId();
 | 
					            String appid = wechatPaymentSetting().getMpAppId();
 | 
				
			||||||
 | 
					            if (StringUtils.isEmpty(appid)) {
 | 
				
			||||||
 | 
					                throw new ServiceException(ResultCode.WECHAT_PAYMENT_NOT_SETTING);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            String attach = URLEncoder.createDefault().encode(JSONUtil.toJsonStr(payParam), StandardCharsets.UTF_8);
 | 
					            String attach = URLEncoder.createDefault().encode(JSONUtil.toJsonStr(payParam), StandardCharsets.UTF_8);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            WechatPaymentSetting setting = wechatPaymentSetting();
 | 
					            WechatPaymentSetting setting = wechatPaymentSetting();
 | 
				
			||||||
 | 
				
			|||||||
@ -53,7 +53,7 @@ public class WechatPaymentSetting {
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    private String apiKey3;
 | 
					    private String apiKey3;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public String getAppId() {
 | 
					    public String getAppIdValue() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (StringUtils.isEmpty(appId)) {
 | 
					        if (StringUtils.isEmpty(appId)) {
 | 
				
			||||||
            throw new ServiceException(ResultCode.WECHAT_PAYMENT_NOT_SETTING);
 | 
					            throw new ServiceException(ResultCode.WECHAT_PAYMENT_NOT_SETTING);
 | 
				
			||||||
@ -61,14 +61,14 @@ public class WechatPaymentSetting {
 | 
				
			|||||||
        return appId;
 | 
					        return appId;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public String getMpAppId() {
 | 
					    public String getMpAppIdValue() {
 | 
				
			||||||
        if (StringUtils.isEmpty(mpAppId)) {
 | 
					        if (StringUtils.isEmpty(mpAppId)) {
 | 
				
			||||||
            throw new ServiceException(ResultCode.WECHAT_PAYMENT_NOT_SETTING);
 | 
					            throw new ServiceException(ResultCode.WECHAT_PAYMENT_NOT_SETTING);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        return mpAppId;
 | 
					        return mpAppId;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public String getServiceAppId() {
 | 
					    public String getServiceAppIdValue() {
 | 
				
			||||||
        if (StringUtils.isEmpty(serviceAppId)) {
 | 
					        if (StringUtils.isEmpty(serviceAppId)) {
 | 
				
			||||||
            throw new ServiceException(ResultCode.WECHAT_PAYMENT_NOT_SETTING);
 | 
					            throw new ServiceException(ResultCode.WECHAT_PAYMENT_NOT_SETTING);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user