记得上下班打卡 | git大法好,push需谨慎

Commit a100accc authored by 姜秀龙's avatar 姜秀龙

Merge branch 'jxl-datongfensi' into 'master'

Jxl datongfensi

See merge request !420
parents 5e32a4b7 5761da52
-- 商品订单:粉丝俱乐部来源(与 source[app|h5|applet] 语义分离)
ALTER TABLE goblin_store_order
ADD COLUMN order_source varchar(255) NOT NULL DEFAULT '' COMMENT '粉丝俱乐部来源标识' AFTER source,
ADD COLUMN referrer_user_id varchar(64) NOT NULL DEFAULT '' COMMENT '粉丝俱乐部侧用户id' AFTER order_source;
-- 演出订单:粉丝俱乐部来源标记
ALTER TABLE kylin_order_tickets
ADD COLUMN referrer_user_id varchar(64) NOT NULL DEFAULT '' COMMENT '粉丝俱乐部侧用户id' AFTER order_source;
...@@ -47,8 +47,10 @@ public class DragonConstant { ...@@ -47,8 +47,10 @@ public class DragonConstant {
} }
public enum DeviceFromEnum{ public enum DeviceFromEnum{
WEB("web",""),WAP("wap",""),WAPPAGE("wappage","") WEB("web","PC网页"),WAP("wap","手机网页"),WAPPAGE("wappage","WAP页")
,APP("app",""),JS("js",""),APPLET("applet",""),APPLETB("appletb",""),MICROPAY("micropay",""); ,APP("app","App"),JS("js","微信内网页"),APPLET("applet","正在现场小程序"),APPLETB("appletb","摩登小程序")
,APPLET_DOUDOU("appletdoudou","DouDou小程序"),APPLET_MOOTOO("appletmootoo","mootoo小程序")
,APPLET_WENQUE("appletwenque","wenque小程序"),MICROPAY("micropay","付款码/扫码枪");
private String code; private String code;
private String message; private String message;
DeviceFromEnum(String code, String message) { DeviceFromEnum(String code, String message) {
...@@ -216,6 +218,10 @@ public class DragonConstant { ...@@ -216,6 +218,10 @@ public class DragonConstant {
return arry[i]; return arry[i];
} }
} }
// 兼容 APPLETDOUDOUWEPAY 等新类型:查单仍走小程序微信策略
if (code != null && code.contains("APPLET") && code.endsWith("WEPAY")) {
return PAYMENT_TYPE_APPLET_WEPAY;
}
return null; return null;
} }
......
package com.liquidnet.service.dragon.doc;
/**
* 支付相关 Swagger 文案(与 {@link com.liquidnet.service.dragon.support.WepayAppletPaySupport} 业务逻辑分离)。
*/
public final class DragonPaySwaggerDoc {
public static final String DEVICE_FROM_VALUE =
"支付终端。微信小程序微信支付:applet=正在现场,appletb=摩登,appletdoudou=DouDou,appletmootoo=mootoo,appletwenque=wenque;"
+ "须配合 payType=wepay 并传当前小程序 openId(sweet maOpenId type 分别为 4/7/8/9/10)。"
+ "其他:app、wap、js、web、wappage;micropay=付款码/扫码枪(payType 传 wepay 或 alipay,须 authCode,非银联)。"
+ "银联云闪付用 payType=unionpay,deviceFrom 一般为 app 或 wap,与 micropay 无关。";
public static final String DEVICE_FROM_ALLOWABLE =
"applet,appletb,appletdoudou,appletmootoo,appletwenque,app,wap,js,web,wappage,micropay";
public static final String PAY_TYPE_VALUE = "支付方式:wepay、alipay、douyinpay、unionpay、applepay 等";
public static final String PAY_TYPE_ALLOWABLE = "wepay,alipay,douyinpay,unionpay,applepay";
public static final String OPEN_ID_VALUE =
"微信 JSAPI/小程序支付必填,须为当前 deviceFrom 对应小程序的 openId";
private DragonPaySwaggerDoc() {
}
}
package com.liquidnet.service.dragon.support;
import com.liquidnet.service.dragon.dto.DragonPayBaseReqDto;
/**
* 微信小程序支付:deviceFrom / appIdType / paymentType 约定(不含 appid,appid 见 order 内 {@code WepayAppletPayConfigure})。
*/
public final class WepayAppletPaySupport {
public static final String DEVICE_APPLETB = "appletb";
public static final String DEVICE_APPLET_DOUDOU = "appletdoudou";
public static final String DEVICE_APPLET_MOOTOO = "appletmootoo";
public static final String DEVICE_APPLET_WENQUE = "appletwenque";
public static final String APP_ID_TYPE_B = "b";
public static final String APP_ID_TYPE_DOUDOU = "doudou";
public static final String APP_ID_TYPE_MOOTOO = "mootoo";
public static final String APP_ID_TYPE_WENQUE = "wenque";
private WepayAppletPaySupport() {
}
public static boolean requiresWechatOpenId(String deviceFrom) {
if (deviceFrom == null) {
return false;
}
return "js".equalsIgnoreCase(deviceFrom)
|| "applet".equalsIgnoreCase(deviceFrom)
|| DEVICE_APPLETB.equalsIgnoreCase(deviceFrom)
|| DEVICE_APPLET_DOUDOU.equalsIgnoreCase(deviceFrom)
|| DEVICE_APPLET_MOOTOO.equalsIgnoreCase(deviceFrom)
|| DEVICE_APPLET_WENQUE.equalsIgnoreCase(deviceFrom);
}
/**
* 将 appletdoudou 等 deviceFrom 规范为 applet,并写入 appIdType。
*/
public static void applyAppletDeviceFrom(DragonPayBaseReqDto dto) {
if (dto == null || dto.getDeviceFrom() == null) {
return;
}
String deviceFrom = dto.getDeviceFrom();
if (DEVICE_APPLETB.equals(deviceFrom)) {
dto.setDeviceFrom("applet");
dto.setAppIdType(APP_ID_TYPE_B);
} else if (DEVICE_APPLET_DOUDOU.equals(deviceFrom)) {
dto.setDeviceFrom("applet");
dto.setAppIdType(APP_ID_TYPE_DOUDOU);
} else if (DEVICE_APPLET_MOOTOO.equals(deviceFrom)) {
dto.setDeviceFrom("applet");
dto.setAppIdType(APP_ID_TYPE_MOOTOO);
} else if (DEVICE_APPLET_WENQUE.equals(deviceFrom)) {
dto.setDeviceFrom("applet");
dto.setAppIdType(APP_ID_TYPE_WENQUE);
}
}
public static boolean usesMerchantB(String appIdType) {
return APP_ID_TYPE_B.equals(appIdType);
}
public static boolean usesMerchantBByPaymentType(String paymentType) {
return paymentType != null && paymentType.contains("APPLETB");
}
/**
* 小程序微信 JSAPI:含历史 APPLETWEPAY、APPLETBWEPAY 及 APPLETDOUDOUWEPAY 等。
*/
public static boolean isAppletWechatPaymentType(String paymentType) {
return paymentType != null && paymentType.contains("APPLET") && paymentType.endsWith("WEPAY");
}
/** 场次批量退款统计:微信渠道 payment_type 白名单 */
public static String[] wechatPaymentTypesForRefundStatis() {
return new String[]{
"APPWEPAY", "APPLETWEPAY", "APPLETBWEPAY",
"APPLETDOUDOUWEPAY", "APPLETMOOTOOWEPAY", "APPLETWENQUEWEPAY",
"WAPWEPAY", "JSWEPAY", "wepay", "MICROPAYWEPAY"
};
}
/** 场次批量退款统计:支付宝渠道 payment_type 白名单 */
public static String[] alipayPaymentTypesForRefundStatis() {
return new String[]{"APPALIPAY", "WAPALIPAY", "APPLETALIPAY", "alipay"};
}
/** Admin 列表/详情:payment_type 展示文案 */
public static String paymentChannelDisplayLabel(String paymentType) {
if (paymentType == null || paymentType.trim().isEmpty()) {
return "";
}
String pt = paymentType.trim();
if (pt.contains("UNIONPAY")) {
return "银联云闪付";
}
if (pt.contains("DOUYIN")) {
return "抖音支付";
}
if (pt.contains("ALIPAY") || "alipay".equalsIgnoreCase(pt)) {
return "支付宝";
}
if (isAppletWechatPaymentType(pt)) {
if (pt.contains("DOUDOU")) {
return "微信(DouDou)";
}
if (pt.contains("MOOTOO")) {
return "微信(mootoo)";
}
if (pt.contains("WENQUE")) {
return "微信(wenque)";
}
if (pt.contains("APPLETB")) {
return "微信(摩登)";
}
return "微信小程序";
}
if (pt.endsWith("WEPAY") || "wepay".equalsIgnoreCase(pt)) {
return "微信";
}
return pt;
}
}
package com.liquidnet.service.goblin.constant;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo;
/**
* 商品「是否展示到商城」取值约定:0-否,1-是。
* 落库 / 写 SQL 参数时统一通过 {@link #resolve(GoblinGoodsInfoVo)},避免各处 magic number。
*/
public final class GoblinGoodsShowInMallHelper {
public static final int SHOW_IN_MALL_YES = 1;
public static final int SHOW_IN_MALL_NO = 0;
/** 收钱吧演出关联商品,与前台 {@code spuType=33} 约定一致 */
public static final int SQB_SPU_TYPE = 33;
private GoblinGoodsShowInMallHelper() {
}
/**
* 解析落库用的 show_in_mall:VO 已赋值则沿用;未赋值时普通商品默认展示,SQB 商品默认不展示。
*/
public static int resolve(GoblinGoodsInfoVo vo) {
if (vo == null) {
return SHOW_IN_MALL_YES;
}
if (vo.getShowInMall() != null) {
return vo.getShowInMall();
}
return vo.getSpuType() == SQB_SPU_TYPE ? SHOW_IN_MALL_NO : SHOW_IN_MALL_YES;
}
/** 请求参数未传时的默认值(普通商品 add/edit) */
public static int defaultFromRequest(Integer showInMall) {
return showInMall == null ? SHOW_IN_MALL_YES : showInMall;
}
}
package com.liquidnet.service.goblin.dto.manage; package com.liquidnet.service.goblin.dto.manage;
import com.liquidnet.service.dragon.doc.DragonPaySwaggerDoc;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -9,7 +10,7 @@ import java.util.ArrayList; ...@@ -9,7 +10,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
@ApiModel(value = "GoblinOrderParam") @ApiModel(value = "GoblinOrderParam", description = "POST /goblin/pre 商城下单。微信小程序微信支付见 deviceFrom 与 openId 说明。")
@Data @Data
public class GoblinOrderParam { public class GoblinOrderParam {
...@@ -17,13 +18,13 @@ public class GoblinOrderParam { ...@@ -17,13 +18,13 @@ public class GoblinOrderParam {
private ArrayList<String> addressIds; private ArrayList<String> addressIds;
@ApiModelProperty(value = "代理id") @ApiModelProperty(value = "代理id")
private String agentId; private String agentId;
@ApiModelProperty(value = "支付类型") @ApiModelProperty(value = DragonPaySwaggerDoc.PAY_TYPE_VALUE, allowableValues = DragonPaySwaggerDoc.PAY_TYPE_ALLOWABLE, example = "wepay")
@NotNull(message = "支付类型不能为空") @NotNull(message = "支付类型不能为空")
private String payType; private String payType;
@ApiModelProperty(value = "支付来源 [新增micropay-微信扫码支付]") @ApiModelProperty(value = DragonPaySwaggerDoc.DEVICE_FROM_VALUE, allowableValues = DragonPaySwaggerDoc.DEVICE_FROM_ALLOWABLE, example = "applet")
@NotNull(message = "支付来源不能为空") @NotNull(message = "支付来源不能为空")
private String deviceFrom; private String deviceFrom;
@ApiModelProperty(value = "openId") @ApiModelProperty(value = DragonPaySwaggerDoc.OPEN_ID_VALUE)
private String openId; private String openId;
@ApiModelProperty(value = "showUrl") @ApiModelProperty(value = "showUrl")
private String showUrl; private String showUrl;
...@@ -37,5 +38,9 @@ public class GoblinOrderParam { ...@@ -37,5 +38,9 @@ public class GoblinOrderParam {
private AddressVo addressesVo; private AddressVo addressesVo;
@ApiModelProperty(value = "商品相关参数集合") @ApiModelProperty(value = "商品相关参数集合")
private List<GoblinOrderStoreParam> goblinOrderStoreParamList; private List<GoblinOrderStoreParam> goblinOrderStoreParamList;
@ApiModelProperty(value = "粉丝俱乐部来源标识,如DOUDOU之家;与 referrerUserId 同时传才打标")
private String referrerApp;
@ApiModelProperty(value = "粉丝俱乐部侧用户id")
private String referrerUserId;
} }
...@@ -6,6 +6,7 @@ import com.liquidnet.commons.lang.util.CollectionUtil; ...@@ -6,6 +6,7 @@ import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.DateUtil; import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator; import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.service.base.ErrorMapping; import com.liquidnet.service.base.ErrorMapping;
import com.liquidnet.service.goblin.constant.GoblinGoodsShowInMallHelper;
import com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto; import com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo; import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo; import com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo;
...@@ -18,6 +19,8 @@ import org.apache.commons.lang3.StringUtils; ...@@ -18,6 +19,8 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern; import javax.validation.constraints.Pattern;
...@@ -128,6 +131,10 @@ public class GoblinStoreMgtGoodsAddParam implements Serializable { ...@@ -128,6 +131,10 @@ public class GoblinStoreMgtGoodsAddParam implements Serializable {
@ApiModelProperty(position = 31, required = true, value = "是否虚拟商品[0-否|1-是]", allowableValues = "0,1", example = "0") @ApiModelProperty(position = 31, required = true, value = "是否虚拟商品[0-否|1-是]", allowableValues = "0,1", example = "0")
@Pattern(regexp = "\\b(0|1)\\b", message = "是否虚拟商品参数无效") @Pattern(regexp = "\\b(0|1)\\b", message = "是否虚拟商品参数无效")
private String virtualFlg; private String virtualFlg;
@ApiModelProperty(position = 31, required = false, value = "是否展示到商城[0-否|1-是]", allowableValues = "0,1", example = "1")
@Min(value = 0, message = "是否展示到商城参数无效")
@Max(value = 1, message = "是否展示到商城参数无效")
private Integer showInMall;
/** /**
* ---------------------------- 服务保障 ---------------------------- * ---------------------------- 服务保障 ----------------------------
...@@ -191,6 +198,7 @@ public class GoblinStoreMgtGoodsAddParam implements Serializable { ...@@ -191,6 +198,7 @@ public class GoblinStoreMgtGoodsAddParam implements Serializable {
vo.setShelvesTime(this.getShelvesTime()); vo.setShelvesTime(this.getShelvesTime());
vo.setSpuValidity(this.getSpuValidity()); vo.setSpuValidity(this.getSpuValidity());
vo.setVirtualFlg(this.getVirtualFlg()); vo.setVirtualFlg(this.getVirtualFlg());
vo.setShowInMall(GoblinGoodsShowInMallHelper.defaultFromRequest(this.getShowInMall()));
vo.setStatus("3"); vo.setStatus("3");
// vo.setReason(null); // vo.setReason(null);
// vo.setShelvesStatus("0"); // vo.setShelvesStatus("0");
...@@ -244,6 +252,7 @@ public class GoblinStoreMgtGoodsAddParam implements Serializable { ...@@ -244,6 +252,7 @@ public class GoblinStoreMgtGoodsAddParam implements Serializable {
vo.setShelvesTime(this.getShelvesTime()); vo.setShelvesTime(this.getShelvesTime());
vo.setSpuValidity(this.getSpuValidity()); vo.setSpuValidity(this.getSpuValidity());
vo.setVirtualFlg(this.getVirtualFlg()); vo.setVirtualFlg(this.getVirtualFlg());
vo.setShowInMall(GoblinGoodsShowInMallHelper.defaultFromRequest(this.getShowInMall()));
vo.setImageList(this.getImageList()); vo.setImageList(this.getImageList());
vo.setLogisticsTemplate(this.getLogisticsTemplate()); vo.setLogisticsTemplate(this.getLogisticsTemplate());
// vo.setErpType();// 暂不考虑更改ERP类型 // vo.setErpType();// 暂不考虑更改ERP类型
......
...@@ -4,6 +4,7 @@ import com.liquidnet.commons.lang.constant.LnsRegex; ...@@ -4,6 +4,7 @@ import com.liquidnet.commons.lang.constant.LnsRegex;
import com.liquidnet.commons.lang.util.CollectionUtil; import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.DateUtil; import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator; import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.service.goblin.constant.GoblinGoodsShowInMallHelper;
import com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto; import com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo; import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo; import com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo;
...@@ -189,6 +190,7 @@ public class GoblinStoreMgtGoodsCouponAddParam implements Serializable { ...@@ -189,6 +190,7 @@ public class GoblinStoreMgtGoodsCouponAddParam implements Serializable {
vo.setShelvesStatus("0"); vo.setShelvesStatus("0");
} }
vo.setSpuAppear("0"); vo.setSpuAppear("0");
vo.setShowInMall(GoblinGoodsShowInMallHelper.SHOW_IN_MALL_YES);
vo.setDelFlg("0"); vo.setDelFlg("0");
// vo.setShelvesAt(null); // vo.setShelvesAt(null);
vo.setImageList(this.getImageList()); vo.setImageList(this.getImageList());
......
...@@ -5,6 +5,7 @@ import com.liquidnet.common.third.sqb.util.SqbAmountUtils; ...@@ -5,6 +5,7 @@ import com.liquidnet.common.third.sqb.util.SqbAmountUtils;
import com.liquidnet.commons.lang.constant.LnsRegex; import com.liquidnet.commons.lang.constant.LnsRegex;
import com.liquidnet.commons.lang.util.CollectionUtil; import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.IDGenerator; import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.service.goblin.constant.GoblinGoodsShowInMallHelper;
import com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto; import com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto;
import com.liquidnet.service.goblin.dto.vo.*; import com.liquidnet.service.goblin.dto.vo.*;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -143,6 +144,7 @@ public class GoblinStoreMgtGoodsSqbAddParam implements Serializable { ...@@ -143,6 +144,7 @@ public class GoblinStoreMgtGoodsSqbAddParam implements Serializable {
vo.setStatus("3"); vo.setStatus("3");
vo.setShelvesStatus("0"); vo.setShelvesStatus("0");
vo.setSpuAppear("0"); vo.setSpuAppear("0");
vo.setShowInMall(GoblinGoodsShowInMallHelper.resolve(vo));
vo.setDelFlg("0"); vo.setDelFlg("0");
vo.setImageList(sqbGoods.getConverImages()); vo.setImageList(sqbGoods.getConverImages());
vo.setLogisticsTemplate(""); vo.setLogisticsTemplate("");
...@@ -164,6 +166,9 @@ public class GoblinStoreMgtGoodsSqbAddParam implements Serializable { ...@@ -164,6 +166,9 @@ public class GoblinStoreMgtGoodsSqbAddParam implements Serializable {
vo.setDetails(sqbGoods.getProductIntroduction()); vo.setDetails(sqbGoods.getProductIntroduction());
vo.setCoverPic(CollectionUtil.isEmpty(sqbGoods.getConverImages()) ? "" : sqbGoods.getConverImages().get(0)); vo.setCoverPic(CollectionUtil.isEmpty(sqbGoods.getConverImages()) ? "" : sqbGoods.getConverImages().get(0));
// vo.setImageList(sqbGoods.getConverImages()); // vo.setImageList(sqbGoods.getConverImages());
if (vo.getShowInMall() == null) {
vo.setShowInMall(GoblinGoodsShowInMallHelper.resolve(vo));
}
return vo; return vo;
} }
......
package com.liquidnet.service.goblin.dto.manage; package com.liquidnet.service.goblin.dto.manage;
import com.liquidnet.service.dragon.doc.DragonPaySwaggerDoc;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -17,13 +18,13 @@ public class MixOrderParam { ...@@ -17,13 +18,13 @@ public class MixOrderParam {
private String mixId; private String mixId;
@ApiModelProperty(value = "入场人地址vo") @ApiModelProperty(value = "入场人地址vo")
private AddressVo addressesVo; private AddressVo addressesVo;
@ApiModelProperty(value = "支付类型") @ApiModelProperty(value = DragonPaySwaggerDoc.PAY_TYPE_VALUE, allowableValues = DragonPaySwaggerDoc.PAY_TYPE_ALLOWABLE, example = "wepay")
@NotNull(message = "支付类型不能为空") @NotNull(message = "支付类型不能为空")
private String payType; private String payType;
@ApiModelProperty(value = "支付来源 [新增micropay-微信扫码支付]") @ApiModelProperty(value = DragonPaySwaggerDoc.DEVICE_FROM_VALUE, allowableValues = DragonPaySwaggerDoc.DEVICE_FROM_ALLOWABLE, example = "applet")
@NotNull(message = "支付来源不能为空") @NotNull(message = "支付来源不能为空")
private String deviceFrom; private String deviceFrom;
@ApiModelProperty(value = "openId") @ApiModelProperty(value = DragonPaySwaggerDoc.OPEN_ID_VALUE)
private String openId; private String openId;
@ApiModelProperty(value = "showUrl") @ApiModelProperty(value = "showUrl")
private String showUrl; private String showUrl;
......
...@@ -55,6 +55,10 @@ public class GoblinAppOrderListVo implements Serializable, Cloneable { ...@@ -55,6 +55,10 @@ public class GoblinAppOrderListVo implements Serializable, Cloneable {
private String mixId; private String mixId;
@ApiModelProperty(value = " 混合售名称") @ApiModelProperty(value = " 混合售名称")
private String mixName; private String mixName;
@ApiModelProperty(value = "粉丝俱乐部来源标识")
private String referrerApp;
@ApiModelProperty(value = "粉丝俱乐部侧用户id")
private String referrerUserId;
private static final GoblinAppOrderListVo obj = new GoblinAppOrderListVo(); private static final GoblinAppOrderListVo obj = new GoblinAppOrderListVo();
public static GoblinAppOrderListVo getNew() { public static GoblinAppOrderListVo getNew() {
......
...@@ -91,6 +91,8 @@ public class GoblinGoodsInfoVo implements Serializable, Cloneable { ...@@ -91,6 +91,8 @@ public class GoblinGoodsInfoVo implements Serializable, Cloneable {
private String shelvesStatus; private String shelvesStatus;
@ApiModelProperty(position = 37, value = "是否隐藏[0-默认展示|1-隐藏]") @ApiModelProperty(position = 37, value = "是否隐藏[0-默认展示|1-隐藏]")
private String spuAppear; private String spuAppear;
@ApiModelProperty(position = 37, value = "是否展示到商城[0-否|1-是]")
private Integer showInMall;
@ApiModelProperty(position = 37, value = "是否购买[0-否|1-是]") @ApiModelProperty(position = 37, value = "是否购买[0-否|1-是]")
private String spuCanbuy; private String spuCanbuy;
@ApiModelProperty(position = 37, value = "创作者") @ApiModelProperty(position = 37, value = "创作者")
......
...@@ -80,6 +80,10 @@ public class GoblinStoreOrderVo implements Serializable, Cloneable { ...@@ -80,6 +80,10 @@ public class GoblinStoreOrderVo implements Serializable, Cloneable {
private String cancelReason; private String cancelReason;
@ApiModelProperty(value = " 订单来源[app|h5|applet]") @ApiModelProperty(value = " 订单来源[app|h5|applet]")
private String source; private String source;
@ApiModelProperty(value = "粉丝俱乐部来源标识")
private String referrerApp;
@ApiModelProperty(value = "粉丝俱乐部侧用户id")
private String referrerUserId;
@ApiModelProperty(value = " 版本号") @ApiModelProperty(value = " 版本号")
private String version; private String version;
@ApiModelProperty(value = " 是否会员") @ApiModelProperty(value = " 是否会员")
...@@ -100,7 +104,7 @@ public class GoblinStoreOrderVo implements Serializable, Cloneable { ...@@ -100,7 +104,7 @@ public class GoblinStoreOrderVo implements Serializable, Cloneable {
private Integer payCountdownMinute; private Integer payCountdownMinute;
@ApiModelProperty(value = " 快递单号[废弃]") @ApiModelProperty(value = " 快递单号[废弃]")
private String mailNo; private String mailNo;
@ApiModelProperty(value = " 发货时间[废弃]") @ApiModelProperty(value = "订单完成时间")
private String deliveryTime; private String deliveryTime;
@ApiModelProperty(value = " 物流公司姓名[废弃]") @ApiModelProperty(value = " 物流公司姓名[废弃]")
private String logisticsCompany; private String logisticsCompany;
...@@ -200,6 +204,8 @@ public class GoblinStoreOrderVo implements Serializable, Cloneable { ...@@ -200,6 +204,8 @@ public class GoblinStoreOrderVo implements Serializable, Cloneable {
this.setDeviceFrom(source.getDeviceFrom()); this.setDeviceFrom(source.getDeviceFrom());
this.setCancelReason(source.getCancelReason()); this.setCancelReason(source.getCancelReason());
this.setSource(source.getSource()); this.setSource(source.getSource());
this.setReferrerApp(source.getOrderSource() == null ? "" : source.getOrderSource());
this.setReferrerUserId(source.getReferrerUserId() == null ? "" : source.getReferrerUserId());
this.setVersion(source.getVersion()); this.setVersion(source.getVersion());
this.setIsMember(source.getIsMember()); this.setIsMember(source.getIsMember());
this.setOrderType(source.getOrderType()); this.setOrderType(source.getOrderType());
...@@ -251,6 +257,8 @@ public class GoblinStoreOrderVo implements Serializable, Cloneable { ...@@ -251,6 +257,8 @@ public class GoblinStoreOrderVo implements Serializable, Cloneable {
this.setDeviceFrom(source.getDeviceFrom()); this.setDeviceFrom(source.getDeviceFrom());
this.setCancelReason(source.getCancelReason()); this.setCancelReason(source.getCancelReason());
this.setSource(source.getSource()); this.setSource(source.getSource());
this.setReferrerApp(source.getOrderSource() == null ? "" : source.getOrderSource());
this.setReferrerUserId(source.getReferrerUserId() == null ? "" : source.getReferrerUserId());
this.setVersion(source.getVersion()); this.setVersion(source.getVersion());
this.setIsMember(source.getIsMember()); this.setIsMember(source.getIsMember());
this.setOrderType(source.getOrderType()); this.setOrderType(source.getOrderType());
......
package com.liquidnet.service.goblin.param; package com.liquidnet.service.goblin.param;
import com.liquidnet.service.dragon.doc.DragonPaySwaggerDoc;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -10,18 +11,18 @@ import javax.validation.constraints.NotNull; ...@@ -10,18 +11,18 @@ import javax.validation.constraints.NotNull;
@Data @Data
public class GoblinNftOrderPayAgainParam { public class GoblinNftOrderPayAgainParam {
@ApiModelProperty(value = "openId") @ApiModelProperty(value = DragonPaySwaggerDoc.OPEN_ID_VALUE)
private String openId; private String openId;
@ApiModelProperty(value = "订单id") @ApiModelProperty(value = "订单id")
@NotNull(message = "订单ID不能为空") @NotNull(message = "订单ID不能为空")
private String orderId; private String orderId;
@ApiModelProperty(value = "支付类型") @ApiModelProperty(value = DragonPaySwaggerDoc.PAY_TYPE_VALUE, allowableValues = DragonPaySwaggerDoc.PAY_TYPE_ALLOWABLE, example = "wepay")
@NotNull(message = "支付类型不能为空") @NotNull(message = "支付类型不能为空")
private String payType; private String payType;
@ApiModelProperty(value = "支付来源") @ApiModelProperty(value = DragonPaySwaggerDoc.DEVICE_FROM_VALUE, allowableValues = DragonPaySwaggerDoc.DEVICE_FROM_ALLOWABLE, example = "applet")
@NotNull(message = "支付来源不能为空") @NotNull(message = "支付来源不能为空")
private String deviceFrom; private String deviceFrom;
......
package com.liquidnet.service.goblin.param; package com.liquidnet.service.goblin.param;
import com.liquidnet.commons.lang.constant.LnsRegex; import com.liquidnet.commons.lang.constant.LnsRegex;
import com.liquidnet.service.dragon.doc.DragonPaySwaggerDoc;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -12,7 +13,7 @@ import javax.validation.constraints.Pattern; ...@@ -12,7 +13,7 @@ import javax.validation.constraints.Pattern;
@Data @Data
public class GoblinNftOrderPayParam { public class GoblinNftOrderPayParam {
@ApiModelProperty(position = 10, value = "openId微信内网页及小程序支付必传") @ApiModelProperty(position = 10, value = DragonPaySwaggerDoc.OPEN_ID_VALUE)
private String openId; private String openId;
@ApiModelProperty(position = 11, required = true, value = "skuId") @ApiModelProperty(position = 11, required = true, value = "skuId")
...@@ -25,12 +26,12 @@ public class GoblinNftOrderPayParam { ...@@ -25,12 +26,12 @@ public class GoblinNftOrderPayParam {
@ApiModelProperty(position = 13, value = "商品券码") @ApiModelProperty(position = 13, value = "商品券码")
private String storeVoucherCode;*/ private String storeVoucherCode;*/
@ApiModelProperty(position = 14, required = true, value = "支付方式", allowableValues = "alipay,wepay,douyinpay,unionpay,applepay") @ApiModelProperty(position = 14, required = true, value = DragonPaySwaggerDoc.PAY_TYPE_VALUE, allowableValues = DragonPaySwaggerDoc.PAY_TYPE_ALLOWABLE, example = "wepay")
@Pattern(regexp = LnsRegex.Valid.TRIPLE_PF_FOR_PAY, message = "支付方式无效") @Pattern(regexp = LnsRegex.Valid.TRIPLE_PF_FOR_PAY, message = "支付方式无效")
@NotBlank(message = "支付方式不能为空") @NotBlank(message = "支付方式不能为空")
private String payType; private String payType;
@ApiModelProperty(position = 15, required = true, value = "支付终端", allowableValues = "app,wap,js,applet") @ApiModelProperty(position = 15, required = true, value = DragonPaySwaggerDoc.DEVICE_FROM_VALUE, allowableValues = DragonPaySwaggerDoc.DEVICE_FROM_ALLOWABLE, example = "applet")
@Pattern(regexp = LnsRegex.Valid.TRIPLE_PF_FOR_PAY_TERMINAL, message = "支付终端类型无效") @Pattern(regexp = LnsRegex.Valid.TRIPLE_PF_FOR_PAY_TERMINAL, message = "支付终端类型无效")
@NotBlank(message = "支付终端不能为空") @NotBlank(message = "支付终端不能为空")
private String deviceFrom; private String deviceFrom;
......
...@@ -4,6 +4,7 @@ import com.liquidnet.service.goblin.dto.manage.GoblinOrderSkuParam; ...@@ -4,6 +4,7 @@ import com.liquidnet.service.goblin.dto.manage.GoblinOrderSkuParam;
import com.liquidnet.service.goblin.entity.GoblinOrderAttr; import com.liquidnet.service.goblin.entity.GoblinOrderAttr;
import com.liquidnet.service.goblin.entity.GoblinOrderSku; import com.liquidnet.service.goblin.entity.GoblinOrderSku;
import com.liquidnet.service.goblin.entity.GoblinStoreOrder; import com.liquidnet.service.goblin.entity.GoblinStoreOrder;
import com.liquidnet.service.dragon.doc.DragonPaySwaggerDoc;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -35,12 +36,13 @@ public class GoblinOrderPreParam implements Cloneable{ ...@@ -35,12 +36,13 @@ public class GoblinOrderPreParam implements Cloneable{
@ApiModelProperty(required = true, value = "订单过期时间") @ApiModelProperty(required = true, value = "订单过期时间")
private int expireTime; private int expireTime;
@ApiModelProperty(value = DragonPaySwaggerDoc.DEVICE_FROM_VALUE, allowableValues = DragonPaySwaggerDoc.DEVICE_FROM_ALLOWABLE, example = "applet")
private String deviceFrom; private String deviceFrom;
private String authCode; private String authCode;
@ApiModelProperty(required = true, value = "支付方式[pos_crash-现金支付|]") @ApiModelProperty(required = true, value = DragonPaySwaggerDoc.PAY_TYPE_VALUE, allowableValues = DragonPaySwaggerDoc.PAY_TYPE_ALLOWABLE, example = "wepay")
private String payType; private String payType;
@ApiModelProperty(value = DragonPaySwaggerDoc.OPEN_ID_VALUE)
private String openId; private String openId;
private String returnUrl; private String returnUrl;
private String showUrl; private String showUrl;
......
package com.liquidnet.service.goblin.param; package com.liquidnet.service.goblin.param;
import com.liquidnet.service.dragon.doc.DragonPaySwaggerDoc;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -10,13 +11,13 @@ public class PayAgainParam { ...@@ -10,13 +11,13 @@ public class PayAgainParam {
@ApiModelProperty(value = "订单id") @ApiModelProperty(value = "订单id")
@NotNull(message = "订单ID不能为空") @NotNull(message = "订单ID不能为空")
private String orderId; private String orderId;
@ApiModelProperty(value = "支付类型") @ApiModelProperty(value = DragonPaySwaggerDoc.PAY_TYPE_VALUE, allowableValues = DragonPaySwaggerDoc.PAY_TYPE_ALLOWABLE, example = "wepay")
@NotNull(message = "支付类型不能为空") @NotNull(message = "支付类型不能为空")
private String payType; private String payType;
@ApiModelProperty(value = "支付来源") @ApiModelProperty(value = DragonPaySwaggerDoc.DEVICE_FROM_VALUE, allowableValues = DragonPaySwaggerDoc.DEVICE_FROM_ALLOWABLE, example = "applet")
@NotNull(message = "支付来源不能为空") @NotNull(message = "支付来源不能为空")
private String deviceFrom; private String deviceFrom;
@ApiModelProperty(value = "openId") @ApiModelProperty(value = DragonPaySwaggerDoc.OPEN_ID_VALUE)
private String openId; private String openId;
@ApiModelProperty(value = "showUrl") @ApiModelProperty(value = "showUrl")
private String showUrl; private String showUrl;
......
...@@ -17,6 +17,11 @@ ...@@ -17,6 +17,11 @@
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-service-dragon-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
package com.liquidnet.service.kylin.dto.param; package com.liquidnet.service.kylin.dto.param;
import com.liquidnet.service.dragon.doc.DragonPaySwaggerDoc;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -10,13 +11,13 @@ public class PayAgainParam { ...@@ -10,13 +11,13 @@ public class PayAgainParam {
@ApiModelProperty(value = "订单id") @ApiModelProperty(value = "订单id")
@NotNull(message = "订单ID不能为空") @NotNull(message = "订单ID不能为空")
private String orderId; private String orderId;
@ApiModelProperty(value = "支付类型") @ApiModelProperty(value = DragonPaySwaggerDoc.PAY_TYPE_VALUE, allowableValues = DragonPaySwaggerDoc.PAY_TYPE_ALLOWABLE, example = "wepay")
@NotNull(message = "支付类型不能为空") @NotNull(message = "支付类型不能为空")
private String payType; private String payType;
@ApiModelProperty(value = "支付来源") @ApiModelProperty(value = DragonPaySwaggerDoc.DEVICE_FROM_VALUE, allowableValues = DragonPaySwaggerDoc.DEVICE_FROM_ALLOWABLE, example = "applet")
@NotNull(message = "支付来源不能为空") @NotNull(message = "支付来源不能为空")
private String deviceFrom; private String deviceFrom;
@ApiModelProperty(value = "openId") @ApiModelProperty(value = DragonPaySwaggerDoc.OPEN_ID_VALUE)
private String openId; private String openId;
@ApiModelProperty(value = "showUrl") @ApiModelProperty(value = "showUrl")
private String showUrl; private String showUrl;
......
package com.liquidnet.service.kylin.dto.param; package com.liquidnet.service.kylin.dto.param;
import com.liquidnet.service.dragon.doc.DragonPaySwaggerDoc;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Builder; import lombok.Builder;
...@@ -10,7 +11,7 @@ import javax.validation.constraints.Min; ...@@ -10,7 +11,7 @@ import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.List; import java.util.List;
@Api @Api(tags = "演出下单", description = "POST /order/pre。微信小程序微信支付见 deviceFrom 与 openId 说明。")
@Data @Data
public class PayOrderParam { public class PayOrderParam {
@ApiModelProperty(value = "演出id") @ApiModelProperty(value = "演出id")
...@@ -40,13 +41,13 @@ public class PayOrderParam { ...@@ -40,13 +41,13 @@ public class PayOrderParam {
@ApiModelProperty(value = "快递类型[0无类型|1寄付|2到付|3包邮]") @ApiModelProperty(value = "快递类型[0无类型|1寄付|2到付|3包邮]")
@NotNull(message = "快递方式不能为空") @NotNull(message = "快递方式不能为空")
private Integer expressType; private Integer expressType;
@ApiModelProperty(value = "支付类型") @ApiModelProperty(value = DragonPaySwaggerDoc.PAY_TYPE_VALUE, allowableValues = DragonPaySwaggerDoc.PAY_TYPE_ALLOWABLE, example = "wepay")
@NotNull(message = "支付类型不能为空") @NotNull(message = "支付类型不能为空")
private String payType; private String payType;
@ApiModelProperty(value = "支付来源") @ApiModelProperty(value = DragonPaySwaggerDoc.DEVICE_FROM_VALUE, allowableValues = DragonPaySwaggerDoc.DEVICE_FROM_ALLOWABLE, example = "applet")
@NotNull(message = "支付来源不能为空") @NotNull(message = "支付来源不能为空")
private String deviceFrom; private String deviceFrom;
@ApiModelProperty(value = "openId") @ApiModelProperty(value = DragonPaySwaggerDoc.OPEN_ID_VALUE)
private String openId; private String openId;
@ApiModelProperty(value = "showUrl") @ApiModelProperty(value = "showUrl")
private String showUrl; private String showUrl;
...@@ -66,4 +67,8 @@ public class PayOrderParam { ...@@ -66,4 +67,8 @@ public class PayOrderParam {
private AddressVo addressesVo; private AddressVo addressesVo;
@ApiModelProperty(value = "联系方式") @ApiModelProperty(value = "联系方式")
private String userMobile; private String userMobile;
@ApiModelProperty(value = "粉丝俱乐部来源标识,如DOUDOU之家;与 referrerUserId 同时传才打标")
private String referrerApp;
@ApiModelProperty(value = "粉丝俱乐部侧用户id")
private String referrerUserId;
} }
...@@ -45,7 +45,11 @@ public class KylinOrderTicketVo implements Serializable, Cloneable { ...@@ -45,7 +45,11 @@ public class KylinOrderTicketVo implements Serializable, Cloneable {
private String qrCode; private String qrCode;
@ApiModelProperty(position = 18, value = "下单方式") @ApiModelProperty(position = 18, value = "下单方式")
private String orderType; private String orderType;
@ApiModelProperty(position = 19, value = "下单版本") @ApiModelProperty(position = 19, value = "粉丝俱乐部来源标识")
private String referrerApp;
@ApiModelProperty(position = 19, value = "粉丝俱乐部侧用户id")
private String referrerUserId;
@ApiModelProperty(position = 20, value = "下单版本")
private String orderVersion; private String orderVersion;
@ApiModelProperty(position = 20, value = "数量") @ApiModelProperty(position = 20, value = "数量")
private Integer number; private Integer number;
...@@ -156,6 +160,8 @@ public class KylinOrderTicketVo implements Serializable, Cloneable { ...@@ -156,6 +160,8 @@ public class KylinOrderTicketVo implements Serializable, Cloneable {
public void setOrderTicket(KylinOrderTickets orderTicket) { public void setOrderTicket(KylinOrderTickets orderTicket) {
BeanUtils.copyProperties(orderTicket, this); BeanUtils.copyProperties(orderTicket, this);
this.referrerApp = orderTicket.getOrderSource() == null ? "" : orderTicket.getOrderSource();
this.referrerUserId = orderTicket.getReferrerUserId() == null ? "" : orderTicket.getReferrerUserId();
} }
public void setOrderTicketStatus(KylinOrderTicketStatus orderTicketStatus) { public void setOrderTicketStatus(KylinOrderTicketStatus orderTicketStatus) {
......
...@@ -49,6 +49,10 @@ public class KylinOrderListVo implements Serializable, Cloneable { ...@@ -49,6 +49,10 @@ public class KylinOrderListVo implements Serializable, Cloneable {
private Integer transferStatus; private Integer transferStatus;
@ApiModelProperty(value = "创建时间", example = "") @ApiModelProperty(value = "创建时间", example = "")
private String createdAt; private String createdAt;
@ApiModelProperty(value = "粉丝俱乐部来源标识")
private String referrerApp;
@ApiModelProperty(value = "粉丝俱乐部侧用户id")
private String referrerUserId;
private static final KylinOrderListVo obj = new KylinOrderListVo(); private static final KylinOrderListVo obj = new KylinOrderListVo();
...@@ -116,6 +120,8 @@ public class KylinOrderListVo implements Serializable, Cloneable { ...@@ -116,6 +120,8 @@ public class KylinOrderListVo implements Serializable, Cloneable {
} else { } else {
this.status = vo.getStatus(); this.status = vo.getStatus();
} }
this.referrerApp = vo.getReferrerApp() == null ? "" : vo.getReferrerApp();
this.referrerUserId = vo.getReferrerUserId() == null ? "" : vo.getReferrerUserId();
return this; return this;
} }
} }
...@@ -111,6 +111,41 @@ ...@@ -111,6 +111,41 @@
var removeFlag = [[${@permission.hasPermi('kylin:tickets:remove')}]]; var removeFlag = [[${@permission.hasPermi('kylin:tickets:remove')}]];
var prefix = ctx + "kylin/tickets"; var prefix = ctx + "kylin/tickets";
function formatPaymentType(value) {
if (!value) {
return '';
}
var pt = value;
if (pt.indexOf('UNIONPAY') >= 0) {
return '银联云闪付';
}
if (pt.indexOf('DOUYIN') >= 0) {
return '抖音支付';
}
if (pt.indexOf('ALIPAY') >= 0 || pt.toLowerCase() === 'alipay') {
return '支付宝';
}
if (pt.indexOf('APPLET') >= 0 && pt.lastIndexOf('WEPAY') === pt.length - 5) {
if (pt.indexOf('DOUDOU') >= 0) {
return '微信(DouDou)';
}
if (pt.indexOf('MOOTOO') >= 0) {
return '微信(mootoo)';
}
if (pt.indexOf('WENQUE') >= 0) {
return '微信(wenque)';
}
if (pt.indexOf('APPLETB') >= 0) {
return '微信(摩登)';
}
return '微信小程序';
}
if (pt.indexOf('WEPAY') >= 0 || pt.toLowerCase() === 'wepay') {
return '微信';
}
return pt;
}
$(function() { $(function() {
var options = { var options = {
url: prefix + "/list", url: prefix + "/list",
...@@ -144,7 +179,10 @@ ...@@ -144,7 +179,10 @@
}, },
{ {
field: 'paymentType', field: 'paymentType',
title: '支付方式' title: '支付方式',
formatter: function(value) {
return formatPaymentType(value);
}
}, },
{ {
field: 'userId', field: 'userId',
......
...@@ -28,6 +28,11 @@ ...@@ -28,6 +28,11 @@
<artifactId>liquidnet-service-kylin-api</artifactId> <artifactId>liquidnet-service-kylin-api</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-service-dragon-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency> <dependency>
<groupId>com.liquidnet</groupId> <groupId>com.liquidnet</groupId>
<artifactId>liquidnet-service-adam-api</artifactId> <artifactId>liquidnet-service-adam-api</artifactId>
......
...@@ -21,6 +21,7 @@ import com.liquidnet.service.kylin.mapper.KylinOrderRefundBatchesMapper; ...@@ -21,6 +21,7 @@ import com.liquidnet.service.kylin.mapper.KylinOrderRefundBatchesMapper;
import com.liquidnet.service.kylin.mapper.KylinOrderRefundsMapper; import com.liquidnet.service.kylin.mapper.KylinOrderRefundsMapper;
import com.liquidnet.service.kylin.mapper.KylinOrderTicketsMapper; import com.liquidnet.service.kylin.mapper.KylinOrderTicketsMapper;
import com.liquidnet.service.kylin.mapper.KylinPerformancesMapper; import com.liquidnet.service.kylin.mapper.KylinPerformancesMapper;
import com.liquidnet.service.dragon.support.WepayAppletPaySupport;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -67,9 +68,9 @@ public class KylinRefundPerformancesAdminServiceImpl { ...@@ -67,9 +68,9 @@ public class KylinRefundPerformancesAdminServiceImpl {
public ResponseDto refundBatchApply(RefundBatchApplyParam refundBatchApplyParam) { public ResponseDto refundBatchApply(RefundBatchApplyParam refundBatchApplyParam) {
String targetId = refundBatchApplyParam.getTargetId(); String targetId = refundBatchApplyParam.getTargetId();
// 查询需要退的金额和数量 // 查询需要退的金额和数量
String[] paymentTypeAlipay = {"APPALIPAY", "WAPALIPAY", "alipay"}; String[] paymentTypeAlipay = WepayAppletPaySupport.alipayPaymentTypesForRefundStatis();
HashMap<String, Object> orderStatisAlipay = kylinOrderTicketsMapper.getPerformanceRefundOrderStatis(targetId, paymentTypeAlipay); HashMap<String, Object> orderStatisAlipay = kylinOrderTicketsMapper.getPerformanceRefundOrderStatis(targetId, paymentTypeAlipay);
String[] paymentTypeWepay = {"APPWEPAY", "APPLETWEPAY", "WAPWEPAY", "JSWEPAY", "wepay"}; String[] paymentTypeWepay = WepayAppletPaySupport.wechatPaymentTypesForRefundStatis();
HashMap<String, Object> orderStatisWepay = kylinOrderTicketsMapper.getPerformanceRefundOrderStatis(targetId, paymentTypeWepay); HashMap<String, Object> orderStatisWepay = kylinOrderTicketsMapper.getPerformanceRefundOrderStatis(targetId, paymentTypeWepay);
BigDecimal totalPriceRefundAlipay = new BigDecimal(0.0); BigDecimal totalPriceRefundAlipay = new BigDecimal(0.0);
Integer totalRefundNumberAlipay = 0; Integer totalRefundNumberAlipay = 0;
......
...@@ -123,7 +123,8 @@ public class LnsRegex { ...@@ -123,7 +123,8 @@ public class LnsRegex {
/** /**
* 支持的支付终端 * 支持的支付终端
*/ */
public static final String TRIPLE_PF_FOR_PAY_TERMINAL = "\\b(app|wap|js|applet)\\b"; public static final String TRIPLE_PF_FOR_PAY_TERMINAL =
"\\b(app|wap|js|applet|appletb|appletdoudou|appletmootoo|appletwenque|web|wappage|micropay)\\b";
/** /**
* 支持的支付方式 * 支持的支付方式
*/ */
......
...@@ -12,12 +12,17 @@ import javax.crypto.SecretKey; ...@@ -12,12 +12,17 @@ import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec; import javax.crypto.spec.SecretKeySpec;
import java.util.Date; import java.util.Date;
import java.util.Map; import java.util.Map;
import java.util.UUID;
@Data @Data
@Component("jwtValidator") @Component("jwtValidator")
@ConfigurationProperties(prefix = "jwt") @ConfigurationProperties(prefix = "jwt")
public class JwtValidator { public class JwtValidator {
private String ssoRedisKey = "adam:identity:sso:"; private String ssoRedisKey = "adam:identity:sso:";
/** 用户会话:adam:session:{jti} = uid */
private String sessionRedisKey = "adam:session:";
/** 用户下活跃 jti 集合:adam:session:user:{uid} = {jti,...},用于按人踢线 */
private String userSessionsRedisKey = "adam:session:user:";
private String msoRedisKey = "adam:identity:mso:"; private String msoRedisKey = "adam:identity:mso:";
private String secret; private String secret;
// 分钟 // 分钟
...@@ -45,15 +50,32 @@ public class JwtValidator { ...@@ -45,15 +50,32 @@ public class JwtValidator {
* @return token字符串 * @return token字符串
*/ */
public String create(Map<String, Object> claimsMap) { public String create(Map<String, Object> claimsMap) {
return create(claimsMap, generateJti());
}
public String create(Map<String, Object> claimsMap, String jti) {
long nowMillis = System.currentTimeMillis(); long nowMillis = System.currentTimeMillis();
long expMillis = System.currentTimeMillis() + expireTtl * 60000; long expMillis = nowMillis + expireTtl * 60000;
JwtBuilder builder = Jwts.builder() return Jwts.builder()
.setClaims(claimsMap) .setClaims(claimsMap)
.setId(jti)
.setIssuedAt(new Date(nowMillis)) .setIssuedAt(new Date(nowMillis))
.setExpiration(new Date(expMillis)) .setExpiration(new Date(expMillis))
.signWith(SignatureAlgorithm.HS256, this.initSecretKey(this.secret)); .signWith(SignatureAlgorithm.HS256, this.initSecretKey(this.secret))
return builder.compact(); .compact();
}
public String generateJti() {
return UUID.randomUUID().toString().replace("-", "");
}
public String sessionKey(String jti) {
return sessionRedisKey.concat(jti);
}
public String userSessionsKey(String uid) {
return userSessionsRedisKey.concat(uid);
} }
/** /**
......
...@@ -18,6 +18,7 @@ public class CurrentUtil { ...@@ -18,6 +18,7 @@ public class CurrentUtil {
public static final String TOKEN_NICKNAME = "nickname"; public static final String TOKEN_NICKNAME = "nickname";
public static final String TOKEN_TYPE = "type"; public static final String TOKEN_TYPE = "type";
public static final String TOKEN_UCREATED = "c_at"; public static final String TOKEN_UCREATED = "c_at";
public static final String TOKEN_JTI = "jti";
public static final String TOKEN_TYPE_VAL_USER = "user"; public static final String TOKEN_TYPE_VAL_USER = "user";
public static final String TOKEN_TYPE_VAL_STATION = "station"; public static final String TOKEN_TYPE_VAL_STATION = "station";
......
...@@ -249,13 +249,14 @@ public class GlobalAuthorityInterceptor extends HandlerInterceptorAdapter { ...@@ -249,13 +249,14 @@ public class GlobalAuthorityInterceptor extends HandlerInterceptorAdapter {
Integer online = null == val ? null : Integer.valueOf(val); Integer online = null == val ? null : Integer.valueOf(val);
return null != online && online == 1 || this.responseHandlerRefuse(response, TOKEN_INVALID); return null != online && online == 1 || this.responseHandlerRefuse(response, TOKEN_INVALID);
case CurrentUtil.TOKEN_TYPE_VAL_USER:// adam:identity:sso:${uid}=MD5(${token}) case CurrentUtil.TOKEN_TYPE_VAL_USER:// adam:session:{jti}=uid
String ssoKey = jwtValidator.getSsoRedisKey().concat(currentUid); String jti = claims.getId();
if (StringUtils.isBlank(jti)) {
String md5Token = this.getAccessToken(ssoKey); return this.responseHandlerRefuse(response, TOKEN_INVALID);
}
return StringUtils.isEmpty(md5Token) ? this.responseHandlerRefuse(response, TOKEN_INVALID) String sessionUid = this.getAccessToken(jwtValidator.sessionKey(jti));
: (md5Token.equals(DigestUtils.md5DigestAsHex(token.getBytes(StandardCharsets.UTF_8))) || this.responseHandlerRefuse(response, TOKEN_KICK)); return StringUtils.isNotBlank(sessionUid) && sessionUid.equals(currentUid)
|| this.responseHandlerRefuse(response, TOKEN_INVALID);
default: default:
log.warn("Authority failed:{} (Unknown token type).uri:[{}],token:{}", TOKEN_ILLEGAL, uri, token); log.warn("Authority failed:{} (Unknown token type).uri:[{}],token:{}", TOKEN_ILLEGAL, uri, token);
return this.responseHandlerRefuse(response, TOKEN_ILLEGAL); return this.responseHandlerRefuse(response, TOKEN_ILLEGAL);
......
...@@ -12,6 +12,9 @@ liquidnet: ...@@ -12,6 +12,9 @@ liquidnet:
expire-ttl: 43200 expire-ttl: 43200
refresh-ttl: 525600 refresh-ttl: 525600
blacklist_grace_period: 5 blacklist_grace_period: 5
adam:
# 静默登录 v2,与粉丝俱乐部 A 后端同配,生产请在配置中心设置
silent-otp-v2-secret: 4bG9EhEd3gtd51lO9dbHHbVy7G7QffRs
mysql: mysql:
urlHostAndPort: java-test.mysql.polardb.rds.aliyuncs.com:3306 urlHostAndPort: java-test.mysql.polardb.rds.aliyuncs.com:3306
username: zhengzai username: zhengzai
...@@ -215,6 +218,15 @@ liquidnet: ...@@ -215,6 +218,15 @@ liquidnet:
modern: modern:
appid: wxe3a093ce7278d5b1 appid: wxe3a093ce7278d5b1
secret: 14d531f87dffd3cbbd668ae9f475f1ff secret: 14d531f87dffd3cbbd668ae9f475f1ff
doudou:
appid: wxa4b24c3ed55e4e18
secret: 49fcc65986606b6ff2d8d2f765586c2b
mootoo:
appid: wxe86ab49478ec3ee9
secret: f26158c5dff7f273e4f95818edb92bf2
wenque:
appid: wxacbe59cb64cb3ed4
secret: fc6b4ce7cf4c0576400bcb5a3d524e6a
umeng: umeng:
ios: ios:
appkey: 54fe819bfd98c546b50004f0 appkey: 54fe819bfd98c546b50004f0
......
...@@ -12,6 +12,8 @@ liquidnet: ...@@ -12,6 +12,8 @@ liquidnet:
expire-ttl: 43200 expire-ttl: 43200
refresh-ttl: 525600 refresh-ttl: 525600
blacklist_grace_period: 5 blacklist_grace_period: 5
adam:
silent-otp-v2-secret: 4bG9EhEd3gtd51lO9dbHHbVy7G7QffRs
mysql: mysql:
urlHostAndPort: java-test.mysql.polardb.rds.aliyuncs.com:3306 urlHostAndPort: java-test.mysql.polardb.rds.aliyuncs.com:3306
username: zhengzai username: zhengzai
...@@ -215,6 +217,15 @@ liquidnet: ...@@ -215,6 +217,15 @@ liquidnet:
modern: modern:
appid: wxe3a093ce7278d5b1 appid: wxe3a093ce7278d5b1
secret: 14d531f87dffd3cbbd668ae9f475f1ff secret: 14d531f87dffd3cbbd668ae9f475f1ff
doudou:
appid: wxa4b24c3ed55e4e18
secret: 49fcc65986606b6ff2d8d2f765586c2b
mootoo:
appid: wxe86ab49478ec3ee9
secret: f26158c5dff7f273e4f95818edb92bf2
wenque:
appid: wxacbe59cb64cb3ed4
secret: fc6b4ce7cf4c0576400bcb5a3d524e6a
umeng: umeng:
ios: ios:
appkey: 54fe819bfd98c546b50004f0 appkey: 54fe819bfd98c546b50004f0
......
...@@ -215,6 +215,15 @@ liquidnet: ...@@ -215,6 +215,15 @@ liquidnet:
modern: modern:
appid: wxe3a093ce7278d5b1 appid: wxe3a093ce7278d5b1
secret: 14d531f87dffd3cbbd668ae9f475f1ff secret: 14d531f87dffd3cbbd668ae9f475f1ff
doudou:
appid: wxa4b24c3ed55e4e18
secret: 49fcc65986606b6ff2d8d2f765586c2b
mootoo:
appid: wxe86ab49478ec3ee9
secret: f26158c5dff7f273e4f95818edb92bf2
wenque:
appid: wxacbe59cb64cb3ed4
secret: fc6b4ce7cf4c0576400bcb5a3d524e6a
umeng: umeng:
ios: ios:
appkey: 54fe819bfd98c546b50004f0 appkey: 54fe819bfd98c546b50004f0
......
...@@ -215,6 +215,15 @@ liquidnet: ...@@ -215,6 +215,15 @@ liquidnet:
modern: modern:
appid: wxe3a093ce7278d5b1 appid: wxe3a093ce7278d5b1
secret: 14d531f87dffd3cbbd668ae9f475f1ff secret: 14d531f87dffd3cbbd668ae9f475f1ff
doudou:
appid: wxa4b24c3ed55e4e18
secret: 49fcc65986606b6ff2d8d2f765586c2b
mootoo:
appid: wxe86ab49478ec3ee9
secret: f26158c5dff7f273e4f95818edb92bf2
wenque:
appid: wxacbe59cb64cb3ed4
secret: fc6b4ce7cf4c0576400bcb5a3d524e6a
umeng: umeng:
ios: ios:
appkey: 54fe819bfd98c546b50004f0 appkey: 54fe819bfd98c546b50004f0
......
...@@ -200,6 +200,11 @@ public class GoblinGoods implements Serializable { ...@@ -200,6 +200,11 @@ public class GoblinGoods implements Serializable {
*/ */
private String spuAppear; private String spuAppear;
/**
* 是否展示到商城[0-否|1-是]
*/
private Integer showInMall;
/** /**
* 是否购买[0-否|1-是] * 是否购买[0-否|1-是]
*/ */
......
...@@ -190,6 +190,16 @@ public class GoblinStoreOrder implements Serializable,Cloneable { ...@@ -190,6 +190,16 @@ public class GoblinStoreOrder implements Serializable,Cloneable {
*/ */
private String source; private String source;
/**
* 粉丝俱乐部来源标识
*/
private String orderSource;
/**
* 粉丝俱乐部侧用户id
*/
private String referrerUserId;
/** /**
* 版本号 * 版本号
*/ */
......
...@@ -78,6 +78,11 @@ public class KylinOrderTickets implements Serializable, Cloneable { ...@@ -78,6 +78,11 @@ public class KylinOrderTickets implements Serializable, Cloneable {
*/ */
private String orderSource; private String orderSource;
/**
* 粉丝俱乐部侧用户id
*/
private String referrerUserId;
/** /**
* 下单版本 * 下单版本
*/ */
...@@ -249,11 +254,14 @@ public class KylinOrderTickets implements Serializable, Cloneable { ...@@ -249,11 +254,14 @@ public class KylinOrderTickets implements Serializable, Cloneable {
* @return * @return
*/ */
public Object[] getAddObject(String ipAddress,String area,String areaProvince,String areaCity,String areaCounty) { public Object[] getAddObject(String ipAddress,String area,String areaProvince,String areaCity,String areaCounty) {
String safeOrderSource = orderSource == null ? "" : orderSource;
String safeReferrerUserId = referrerUserId == null ? "" : referrerUserId;
return new Object[]{ return new Object[]{
orderTicketsId, userId, userName, userMobile, performanceTitle, orderCode, qrCode, orderType, orderVersion, orderTicketsId, userId, userName, userMobile, performanceTitle, orderCode, qrCode, orderType, orderVersion,
safeOrderSource, safeReferrerUserId,
number, price, priceMember, priceTotal, priceVoucher, priceActual, priceExpress, priceRefund, refundNumber, number, price, priceMember, priceTotal, priceVoucher, priceActual, priceExpress, priceRefund, refundNumber,
payType, paymentType, timePay, expressContacts, expressAddress, expressPhone, couponType, getTicketType, payType, paymentType, timePay, expressContacts, expressAddress, expressPhone, couponType, getTicketType,
getTicketDescribe, payCountdownMinute, comment, createdAt, updatedAt, payCode,ipAddress,area,areaProvince,areaCity,areaCounty getTicketDescribe, payCountdownMinute, comment, createdAt, updatedAt, payCode, ipAddress, area, areaProvince, areaCity, areaCounty
}; };
} }
......
...@@ -919,7 +919,7 @@ GROUP BY user_mobile,tickets_id; ...@@ -919,7 +919,7 @@ GROUP BY user_mobile,tickets_id;
WHEN temtable.payment_type = 'WAPALIPAY' THEN '支付宝' WHEN temtable.payment_type = 'WAPALIPAY' THEN '支付宝'
WHEN temtable.payment_type = 'APPALIPAY' THEN '支付宝' WHEN temtable.payment_type = 'APPALIPAY' THEN '支付宝'
WHEN temtable.payment_type = 'JSWEPAY' THEN '微信' WHEN temtable.payment_type = 'JSWEPAY' THEN '微信'
WHEN temtable.payment_type = 'APPLETWEPAY' THEN '微信' WHEN temtable.payment_type LIKE 'APPLET%WEPAY' THEN '微信'
WHEN temtable.payment_type = 'APPWEPAY' THEN '微信' WHEN temtable.payment_type = 'APPWEPAY' THEN '微信'
WHEN temtable.payment_type = 'WAPWEPAY' THEN '微信' WHEN temtable.payment_type = 'WAPWEPAY' THEN '微信'
WHEN temtable.payment_type = 'APPUNIONPAY' THEN '银联云闪付' WHEN temtable.payment_type = 'APPUNIONPAY' THEN '银联云闪付'
...@@ -1023,7 +1023,7 @@ GROUP BY user_mobile,tickets_id; ...@@ -1023,7 +1023,7 @@ GROUP BY user_mobile,tickets_id;
WHEN kot.payment_type = 'WAPALIPAY' THEN '支付宝' WHEN kot.payment_type = 'WAPALIPAY' THEN '支付宝'
WHEN kot.payment_type = 'APPALIPAY' THEN '支付宝' WHEN kot.payment_type = 'APPALIPAY' THEN '支付宝'
WHEN kot.payment_type = 'JSWEPAY' THEN '微信' WHEN kot.payment_type = 'JSWEPAY' THEN '微信'
WHEN kot.payment_type = 'APPLETWEPAY' THEN '微信' WHEN kot.payment_type LIKE 'APPLET%WEPAY' THEN '微信'
WHEN kot.payment_type = 'APPWEPAY' THEN '微信' WHEN kot.payment_type = 'APPWEPAY' THEN '微信'
WHEN kot.payment_type = 'WAPWEPAY' THEN '微信' WHEN kot.payment_type = 'WAPWEPAY' THEN '微信'
WHEN kot.payment_type = 'APPUNIONPAY' THEN '银联云闪付' WHEN kot.payment_type = 'APPUNIONPAY' THEN '银联云闪付'
...@@ -1069,7 +1069,7 @@ GROUP BY user_mobile,tickets_id; ...@@ -1069,7 +1069,7 @@ GROUP BY user_mobile,tickets_id;
WHEN kot.payment_type = 'WAPALIPAY' THEN '支付宝' WHEN kot.payment_type = 'WAPALIPAY' THEN '支付宝'
WHEN kot.payment_type = 'APPALIPAY' THEN '支付宝' WHEN kot.payment_type = 'APPALIPAY' THEN '支付宝'
WHEN kot.payment_type = 'JSWEPAY' THEN '微信' WHEN kot.payment_type = 'JSWEPAY' THEN '微信'
WHEN kot.payment_type = 'APPLETWEPAY' THEN '微信' WHEN kot.payment_type LIKE 'APPLET%WEPAY' THEN '微信'
WHEN kot.payment_type = 'APPWEPAY' THEN '微信' WHEN kot.payment_type = 'APPWEPAY' THEN '微信'
WHEN kot.payment_type = 'WAPWEPAY' THEN '微信' WHEN kot.payment_type = 'WAPWEPAY' THEN '微信'
WHEN kot.payment_type = 'APPUNIONPAY' THEN '银联云闪付' WHEN kot.payment_type = 'APPUNIONPAY' THEN '银联云闪付'
...@@ -1144,16 +1144,16 @@ GROUP BY user_mobile,tickets_id; ...@@ -1144,16 +1144,16 @@ GROUP BY user_mobile,tickets_id;
select temtable.code as code, select temtable.code as code,
temtable.payment_id as payment_id, temtable.payment_id as payment_id,
name as name, name as name,
(CASE temtable.payment_type (CASE
WHEN 'WAPALIPAY' THEN '支付宝' WHEN temtable.payment_type = 'WAPALIPAY' THEN '支付宝'
WHEN 'APPALIPAY' THEN '支付宝' WHEN temtable.payment_type = 'APPALIPAY' THEN '支付宝'
WHEN 'JSWEPAY' THEN '微信' WHEN temtable.payment_type = 'JSWEPAY' THEN '微信'
WHEN 'APPLETWEPAY' THEN '微信' WHEN temtable.payment_type LIKE 'APPLET%WEPAY' THEN '微信'
WHEN 'APPWEPAY' THEN '微信' WHEN temtable.payment_type = 'APPWEPAY' THEN '微信'
WHEN 'WAPWEPAY' THEN '微信' WHEN temtable.payment_type = 'WAPWEPAY' THEN '微信'
WHEN 'APPUNIONPAY' THEN '银联云闪付' WHEN temtable.payment_type = 'APPUNIONPAY' THEN '银联云闪付'
WHEN 'WAPUNIONPAY' THEN '银联云闪付' WHEN temtable.payment_type = 'WAPUNIONPAY' THEN '银联云闪付'
WHEN 'APPLETDOUYINPAY' THEN '抖音支付' WHEN temtable.payment_type = 'APPLETDOUYINPAY' THEN '抖音支付'
ELSE '其他' END) as payment_type, ELSE '其他' END) as payment_type,
temtable.price_actual as price_actual, temtable.price_actual as price_actual,
temtable.created_at as created_at, temtable.created_at as created_at,
......
...@@ -19,6 +19,8 @@ import com.liquidnet.service.adam.dto.vo.AdamUserInfoVo; ...@@ -19,6 +19,8 @@ import com.liquidnet.service.adam.dto.vo.AdamUserInfoVo;
import com.liquidnet.service.adam.service.AdamRdmService; import com.liquidnet.service.adam.service.AdamRdmService;
import com.liquidnet.service.adam.service.AdamWechatService; import com.liquidnet.service.adam.service.AdamWechatService;
import com.liquidnet.service.adam.service.IAdamUserService; import com.liquidnet.service.adam.service.IAdamUserService;
import com.liquidnet.service.adam.support.AdamUserSessionSupport;
import com.liquidnet.service.adam.support.SilentMobileOtpV2Support;
import com.liquidnet.service.base.ErrorMapping; import com.liquidnet.service.base.ErrorMapping;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.UserPathDto; import com.liquidnet.service.base.UserPathDto;
...@@ -72,6 +74,10 @@ public class AdamLoginController { ...@@ -72,6 +74,10 @@ public class AdamLoginController {
SmsProcessor smsProcessor; SmsProcessor smsProcessor;
@Autowired @Autowired
AdamWechatService adamWechatService; AdamWechatService adamWechatService;
@Autowired
AdamUserSessionSupport adamUserSessionSupport;
@Autowired
SilentMobileOtpV2Support silentMobileOtpV2Support;
@Value("${liquidnet.reviewer.app-login.mobile}") @Value("${liquidnet.reviewer.app-login.mobile}")
private String reviewMobile; private String reviewMobile;
...@@ -345,7 +351,30 @@ public class AdamLoginController { ...@@ -345,7 +351,30 @@ public class AdamLoginController {
log.error("login by silent for mobile:{},{}/{},{}-{}", mobile, otp, otpDecrypt, l, reql); log.error("login by silent for mobile:{},{}/{},{}-{}", mobile, otp, otpDecrypt, l, reql);
return ResponseDto.failure(ErrorMapping.get("10005")); return ResponseDto.failure(ErrorMapping.get("10005"));
} }
return this.silentMobileLoginSuccess(mobile);
}
@ApiOperationSupport(order = 7)
@ApiOperation(value = "手机号静默登录 v2(HMAC)")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "mobile", value = "手机号"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "otp", value = "HMAC-SHA256 十六进制,64 位"),
})
@PostMapping(value = {"login/silent_mobile_v2"})
public ResponseDto<AdamLoginInfoVo> loginBySilentMobileV2(@Pattern(regexp = "\\d{11}", message = "手机号格式有误")
@NotBlank(message = "手机号不能为空")
@RequestParam String mobile,
@NotBlank(message = "临时票据不能为空")
@RequestParam String otp) {
log.info("login by silent v2 for mobile:{}", mobile);
if (!silentMobileOtpV2Support.verify(mobile, otp)) {
log.error("login by silent v2 otp invalid, mobile:{}", mobile);
return ResponseDto.failure(ErrorMapping.get("10005"));
}
return this.silentMobileLoginSuccess(mobile);
}
private ResponseDto<AdamLoginInfoVo> silentMobileLoginSuccess(String mobile) {
String uid = adamRdmService.getUidByMobile(mobile); String uid = adamRdmService.getUidByMobile(mobile);
boolean toRegister = StringUtils.isEmpty(uid); boolean toRegister = StringUtils.isEmpty(uid);
...@@ -373,7 +402,17 @@ public class AdamLoginController { ...@@ -373,7 +402,17 @@ public class AdamLoginController {
public void logout() { public void logout() {
log.info("###logout_uid:{}", CurrentUtil.getCurrentUid()); log.info("###logout_uid:{}", CurrentUtil.getCurrentUid());
redisUtil.del(jwtValidator.getSsoRedisKey().concat(CurrentUtil.getCurrentUid())); String token = CurrentUtil.getToken();
if (StringUtils.isNotBlank(token)) {
try {
String jti = jwtValidator.parse(token).getId();
if (StringUtils.isNotBlank(jti)) {
adamUserSessionSupport.unbindSession(jti, CurrentUtil.getCurrentUid());
}
} catch (Exception e) {
log.warn("logout parse token failed", e);
}
}
} }
@ApiOperationSupport(order = 8) @ApiOperationSupport(order = 8)
...@@ -488,13 +527,9 @@ public class AdamLoginController { ...@@ -488,13 +527,9 @@ public class AdamLoginController {
log.debug("Gentoken:{}", claimsMap); log.debug("Gentoken:{}", claimsMap);
String token = jwtValidator.create(claimsMap); String jti = jwtValidator.generateJti();
String token = jwtValidator.create(claimsMap, jti);
redisUtil.set( adamUserSessionSupport.bindSession(jti, userInfoVo.getUid());
jwtValidator.getSsoRedisKey().concat(userInfoVo.getUid()),
DigestUtils.md5DigestAsHex(token.getBytes(StandardCharsets.UTF_8)),
jwtValidator.getExpireTtl() * 60
);
return token; return token;
} }
......
...@@ -12,6 +12,7 @@ import com.liquidnet.service.adam.dto.vo.AdamTagVo; ...@@ -12,6 +12,7 @@ import com.liquidnet.service.adam.dto.vo.AdamTagVo;
import com.liquidnet.service.adam.dto.vo.AdamUserInfoVo; import com.liquidnet.service.adam.dto.vo.AdamUserInfoVo;
import com.liquidnet.service.adam.service.AdamRdmService; import com.liquidnet.service.adam.service.AdamRdmService;
import com.liquidnet.service.adam.service.IAdamUserInfoService; import com.liquidnet.service.adam.service.IAdamUserInfoService;
import com.liquidnet.service.adam.support.AdamUserSessionSupport;
import com.liquidnet.service.adam.util.QueueUtils; import com.liquidnet.service.adam.util.QueueUtils;
import com.liquidnet.service.base.ErrorMapping; import com.liquidnet.service.base.ErrorMapping;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
...@@ -26,9 +27,6 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -26,9 +27,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils;
import java.nio.charset.StandardCharsets;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.regex.Pattern; import java.util.regex.Pattern;
...@@ -53,6 +51,8 @@ public class AdamUserInfoServiceImpl implements IAdamUserInfoService { ...@@ -53,6 +51,8 @@ public class AdamUserInfoServiceImpl implements IAdamUserInfoService {
@Autowired @Autowired
JwtValidator jwtValidator; JwtValidator jwtValidator;
@Autowired @Autowired
AdamUserSessionSupport adamUserSessionSupport;
@Autowired
private EasemobUtil easemobUtil; private EasemobUtil easemobUtil;
@Autowired @Autowired
...@@ -308,13 +308,9 @@ public class AdamUserInfoServiceImpl implements IAdamUserInfoService { ...@@ -308,13 +308,9 @@ public class AdamUserInfoServiceImpl implements IAdamUserInfoService {
claimsMap.put(CurrentUtil.TOKEN_TYPE, CurrentUtil.TOKEN_TYPE_VAL_USER); claimsMap.put(CurrentUtil.TOKEN_TYPE, CurrentUtil.TOKEN_TYPE_VAL_USER);
claimsMap.put(CurrentUtil.TOKEN_UCREATED, DateUtil.Formatter.yyyyMMddHHmmssTrim.format(userInfoVo.getCreateAt())); claimsMap.put(CurrentUtil.TOKEN_UCREATED, DateUtil.Formatter.yyyyMMddHHmmssTrim.format(userInfoVo.getCreateAt()));
String token = jwtValidator.create(claimsMap); String jti = jwtValidator.generateJti();
String token = jwtValidator.create(claimsMap, jti);
redisUtil.set( adamUserSessionSupport.bindSession(jti, userInfoVo.getUid());
jwtValidator.getSsoRedisKey().concat(userInfoVo.getUid()),
DigestUtils.md5DigestAsHex(token.getBytes(StandardCharsets.UTF_8)),
jwtValidator.getExpireTtl() * 60
);
return token; return token;
} }
} }
package com.liquidnet.service.adam.support;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.core.JwtValidator;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 用户 JTI 会话:adam:session:{jti}=uid,adam:session:user:{uid} 记录活跃 jti。
*/
@Component
public class AdamUserSessionSupport {
@Autowired
private RedisUtil redisUtil;
@Autowired
private JwtValidator jwtValidator;
public void bindSession(String jti, String uid) {
long sessionTtlSec = jwtValidator.getExpireTtl() * 60;
redisUtil.set(jwtValidator.sessionKey(jti), uid, sessionTtlSec);
redisUtil.sSetAndTime(jwtValidator.userSessionsKey(uid), sessionTtlSec, jti);
}
public void unbindSession(String jti, String uid) {
if (StringUtils.isBlank(jti)) {
return;
}
redisUtil.del(jwtValidator.sessionKey(jti));
if (StringUtils.isNotBlank(uid)) {
redisUtil.setRemove(jwtValidator.userSessionsKey(uid), jti);
}
}
}
package com.liquidnet.service.adam.support;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
/**
* 静默登录 v2:otp = hex(HMAC-SHA256(secret, mobile)),与 v1 DES 隔离。A/B 两侧均不带时间戳。
*/
@Component
public class SilentMobileOtpV2Support {
private static final String HMAC_SHA256 = "HmacSHA256";
@Value("${liquidnet.adam.silent-otp-v2-secret:}")
private String secret;
public boolean verify(String mobile, String otp) {
if (StringUtils.isBlank(secret) || StringUtils.isBlank(mobile) || StringUtils.isBlank(otp)) {
return false;
}
if (!otp.matches("^[0-9a-fA-F]{64}$")) {
return false;
}
byte[] otpBytes = hexToBytes(otp);
if (otpBytes == null) {
return false;
}
byte[] expected = sign(mobile);
return expected != null && MessageDigest.isEqual(expected, otpBytes);
}
public String signHex(String mobile) {
byte[] raw = sign(mobile);
return raw == null ? null : bytesToHex(raw);
}
private byte[] sign(String mobile) {
try {
Mac mac = Mac.getInstance(HMAC_SHA256);
mac.init(new SecretKeySpec(secret.getBytes(StandardCharsets.UTF_8), HMAC_SHA256));
return mac.doFinal(mobile.getBytes(StandardCharsets.UTF_8));
} catch (Exception e) {
return null;
}
}
private static byte[] hexToBytes(String hex) {
if (hex.length() % 2 != 0) {
return null;
}
byte[] out = new byte[hex.length() / 2];
for (int i = 0; i < hex.length(); i += 2) {
out[i / 2] = (byte) Integer.parseInt(hex.substring(i, i + 2), 16);
}
return out;
}
private static String bytesToHex(byte[] bytes) {
StringBuilder sb = new StringBuilder(bytes.length * 2);
for (byte b : bytes) {
sb.append(String.format("%02x", b & 0xff));
}
return sb.toString();
}
}
...@@ -112,6 +112,26 @@ public class TestAdam { ...@@ -112,6 +112,26 @@ public class TestAdam {
System.out.println(post); System.out.println(post);
} }
@SneakyThrows
@Test
public void testLoginBySilentMobileV2() {
String mobile = "15811009011";
String secret = System.getenv("LIQUIDNET_ADAM_SILENT_OTP_V2_SECRET");
if (secret == null || secret.isEmpty()) {
System.out.println("skip v2 test: set env LIQUIDNET_ADAM_SILENT_OTP_V2_SECRET");
return;
}
javax.crypto.Mac mac = javax.crypto.Mac.getInstance("HmacSHA256");
mac.init(new javax.crypto.spec.SecretKeySpec(secret.getBytes(java.nio.charset.StandardCharsets.UTF_8), "HmacSHA256"));
byte[] raw = mac.doFinal(mobile.getBytes(java.nio.charset.StandardCharsets.UTF_8));
StringBuilder otp = new StringBuilder();
for (byte b : raw) {
otp.append(String.format("%02x", b & 0xff));
}
String post = HttpUtil.post("http://testadam.zhengzai.tv/adam/login/silent_mobile_v2?mobile=" + mobile + "&otp=" + otp, null);
System.out.println(post);
}
@Test @Test
public void testTmp() { public void testTmp() {
} }
......
-- 普通商品是否展示到商城精选列表
ALTER TABLE goblin_goods ADD COLUMN show_in_mall TINYINT(1) NOT NULL DEFAULT 1 COMMENT '是否展示到商城[0-否|1-是]' AFTER spu_appear;
...@@ -79,6 +79,11 @@ public class GoblinFrontServiceImpl implements GoblinFrontService { ...@@ -79,6 +79,11 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
return vo != null && vo.getSpuType() == 33; return vo != null && vo.getSpuType() == 33;
} }
/** showInMall=0 时不展示到商城精选列表;历史数据无该字段时默认展示 */
private boolean isNotShowInMall(GoblinGoodsInfoVo vo) {
return vo != null && vo.getShowInMall() != null && vo.getShowInMall() == 0;
}
/** /**
* 单场次演出下全部关联关系(status=1):先读 Redis {@link GoblinRedisUtils#getSqbPerformanceGoodsListCache}, * 单场次演出下全部关联关系(status=1):先读 Redis {@link GoblinRedisUtils#getSqbPerformanceGoodsListCache},
* 未命中再查库并回写,与 {@link #getPerformanceSelectGoods} 一致。 * 未命中再查库并回写,与 {@link #getPerformanceSelectGoods} 一致。
...@@ -919,7 +924,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService { ...@@ -919,7 +924,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
query.addCriteria(Criteria.where("spuId").nin(spuids.split(","))); query.addCriteria(Criteria.where("spuId").nin(spuids.split(",")));
} }
query.addCriteria(Criteria.where("delFlg").is("0").and("shelvesStatus").is("3").and("spuAppear").is("0").and("marketId").is(null) query.addCriteria(Criteria.where("delFlg").is("0").and("shelvesStatus").is("3").and("spuAppear").is("0").and("marketId").is(null)
.and("spuType").ne(33).and("cateFid").nin("22196120924543", "22196122839313").and("name").not().regex(Pattern.compile(SELECT_GOODS_EXCLUDE_NAME))); .and("spuType").ne(33).and("showInMall").ne(0).and("cateFid").nin("22196120924543", "22196122839313").and("name").not().regex(Pattern.compile(SELECT_GOODS_EXCLUDE_NAME)));
//redis里面获取排序规则 1、上架时间2、销量3、价格高到低4、价格低到高 //redis里面获取排序规则 1、上架时间2、销量3、价格高到低4、价格低到高
...@@ -1038,7 +1043,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService { ...@@ -1038,7 +1043,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
} else { } else {
GoblinGoodsInfoVo goblinGoodsInfoVo = goblinRedisUtils.getGoodsInfoVo(goblinFrontSelectGoods.getSpuId()); GoblinGoodsInfoVo goblinGoodsInfoVo = goblinRedisUtils.getGoodsInfoVo(goblinFrontSelectGoods.getSpuId());
if (null == goblinGoodsInfoVo || StringUtil.isNotBlank(goblinGoodsInfoVo.getMarketId()) || isPassportExclusive(goblinGoodsInfoVo) if (null == goblinGoodsInfoVo || StringUtil.isNotBlank(goblinGoodsInfoVo.getMarketId()) || isPassportExclusive(goblinGoodsInfoVo)
|| isSqbSpuGoods(goblinGoodsInfoVo)) { || isSqbSpuGoods(goblinGoodsInfoVo) || isNotShowInMall(goblinGoodsInfoVo)) {
it.remove(); it.remove();
} }
} }
...@@ -1086,6 +1091,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService { ...@@ -1086,6 +1091,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
if (isSqbSpuGoods(goblinGoodsInfoVo)) { if (isSqbSpuGoods(goblinGoodsInfoVo)) {
continue; continue;
} }
if (isNotShowInMall(goblinGoodsInfoVo)) {
continue;
}
goblinGoodsInfoVoArrayList.add(goblinGoodsInfoVo); goblinGoodsInfoVoArrayList.add(goblinGoodsInfoVo);
} }
} }
...@@ -1150,6 +1158,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService { ...@@ -1150,6 +1158,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
if (isSqbSpuGoods(goblinGoodsInfoVo)) { if (isSqbSpuGoods(goblinGoodsInfoVo)) {
continue; continue;
} }
if (isNotShowInMall(goblinGoodsInfoVo)) {
continue;
}
goblinGoodsInfoVoArrayList.add(goblinGoodsInfoVo); goblinGoodsInfoVoArrayList.add(goblinGoodsInfoVo);
} }
} }
......
...@@ -33,8 +33,7 @@ import java.util.List; ...@@ -33,8 +33,7 @@ import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.stream.IntStream; import java.util.stream.IntStream;
import static com.liquidnet.commons.lang.util.DateUtil.DTF_YMD_HMS; import static com.liquidnet.commons.lang.util.DateUtil.*;
import static com.liquidnet.commons.lang.util.DateUtil.DTFYMDHMS;
@Service @Service
...@@ -78,6 +77,12 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService { ...@@ -78,6 +77,12 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
} }
GoblinAppOrderListVo vo = GoblinAppOrderListVo.getNew(); GoblinAppOrderListVo vo = GoblinAppOrderListVo.getNew();
BeanUtils.copyProperties(orderVo, vo); BeanUtils.copyProperties(orderVo, vo);
if (vo.getReferrerApp() == null) {
vo.setReferrerApp("");
}
if (vo.getReferrerUserId() == null) {
vo.setReferrerUserId("");
}
vo.setRestTime(getRestTime(orderVo)); vo.setRestTime(getRestTime(orderVo));
List<GoblinOrderSkuVo> skuVos = ObjectUtil.getGoblinOrderSkuVoArrayList(); List<GoblinOrderSkuVo> skuVos = ObjectUtil.getGoblinOrderSkuVoArrayList();
for (String orderSkuId : orderVo.getOrderSkuVoIds()) { for (String orderSkuId : orderVo.getOrderSkuVoIds()) {
...@@ -100,6 +105,12 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService { ...@@ -100,6 +105,12 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
GoblinStoreOrderVo orderVo = redisUtils.getGoblinOrder(orderId); GoblinStoreOrderVo orderVo = redisUtils.getGoblinOrder(orderId);
GoblinAppOrderListVo vo = GoblinAppOrderListVo.getNew(); GoblinAppOrderListVo vo = GoblinAppOrderListVo.getNew();
BeanUtils.copyProperties(orderVo, vo); BeanUtils.copyProperties(orderVo, vo);
if (vo.getReferrerApp() == null) {
vo.setReferrerApp("");
}
if (vo.getReferrerUserId() == null) {
vo.setReferrerUserId("");
}
vo.setRestTime(getRestTime(orderVo)); vo.setRestTime(getRestTime(orderVo));
List<GoblinOrderSkuVo> skuVos = ObjectUtil.getGoblinOrderSkuVoArrayList(); List<GoblinOrderSkuVo> skuVos = ObjectUtil.getGoblinOrderSkuVoArrayList();
for (String orderSkuId : orderVo.getOrderSkuVoIds()) { for (String orderSkuId : orderVo.getOrderSkuVoIds()) {
...@@ -119,6 +130,12 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService { ...@@ -119,6 +130,12 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
if (orderVo == null || (!orderVo.getUserId().equals(uid) && uid != null)) { if (orderVo == null || (!orderVo.getUserId().equals(uid) && uid != null)) {
return ResponseDto.failure(ErrorMapping.get("20003")); return ResponseDto.failure(ErrorMapping.get("20003"));
} }
if (orderVo.getReferrerApp() == null) {
orderVo.setReferrerApp("");
}
if (orderVo.getReferrerUserId() == null) {
orderVo.setReferrerUserId("");
}
GoblinAppOrderDetailsVo vo = GoblinAppOrderDetailsVo.getNew(); GoblinAppOrderDetailsVo vo = GoblinAppOrderDetailsVo.getNew();
vo.setStoreOrderVo(orderVo); vo.setStoreOrderVo(orderVo);
List<GoblinOrderSkuVo> skuVos = ObjectUtil.getGoblinOrderSkuVoArrayList(); List<GoblinOrderSkuVo> skuVos = ObjectUtil.getGoblinOrderSkuVoArrayList();
...@@ -183,7 +200,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService { ...@@ -183,7 +200,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
public ResponseDto<Boolean> getProduce(String orderId, String uid) { public ResponseDto<Boolean> getProduce(String orderId, String uid) {
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
LinkedList<String> sqls = CollectionUtil.linkedListString(); LinkedList<String> sqls = CollectionUtil.linkedListString();
sqls.add(SqlMapping.get("goblin_order.store.orderStatus")); sqls.add(SqlMapping.get("goblin_order.store.orderStatus.time"));
sqls.add(SqlMapping.get("goblin_order.store.orderSkuStatus")); sqls.add(SqlMapping.get("goblin_order.store.orderSkuStatus"));
LinkedList<Object[]> orderStatus = CollectionUtil.linkedListObjectArr(); LinkedList<Object[]> orderStatus = CollectionUtil.linkedListObjectArr();
LinkedList<Object[]> orderSkuStatus = CollectionUtil.linkedListObjectArr(); LinkedList<Object[]> orderSkuStatus = CollectionUtil.linkedListObjectArr();
...@@ -197,8 +214,9 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService { ...@@ -197,8 +214,9 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
} }
//订单状态修改 //订单状态修改
orderVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_4.getValue()); orderVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_4.getValue());
orderVo.setDeliveryTime(getNowTime()); // 设置收货时间
orderStatus.add(new Object[]{ orderStatus.add(new Object[]{
orderVo.getStatus(), orderVo.getZhengzaiStatus(), now, orderVo.getStatus(), orderVo.getZhengzaiStatus(), now, now,
orderVo.getOrderId(), now, now orderVo.getOrderId(), now, now
}); });
for (String orderSkuId : orderVo.getOrderSkuVoIds()) { for (String orderSkuId : orderVo.getOrderSkuVoIds()) {
...@@ -297,7 +315,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService { ...@@ -297,7 +315,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
backOrder.setDescribes(param.getDescribes()); backOrder.setDescribes(param.getDescribes());
backOrder.setSkuIdNums(Joiner.on(",").join(orderVo.getOrderSkuVoIds())); backOrder.setSkuIdNums(Joiner.on(",").join(orderVo.getOrderSkuVoIds()));
} else if (orderVo.getStatus() == GoblinStatusConst.Status.ORDER_STATUS_4.getValue()) {//已完成 } else if (orderVo.getStatus() == GoblinStatusConst.Status.ORDER_STATUS_4.getValue()) {//已完成
if (param.getOrderSkuId() != null) { if (StringUtil.isNotBlank(param.getOrderSkuId())) {
GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(param.getOrderSkuId()); GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(param.getOrderSkuId());
if (orderVo.getPriceRefund().add(orderSkuVo.getSkuPriceActual()).add(orderVo.getPriceExpress()).compareTo(orderVo.getPriceActual()) >= 0) { if (orderVo.getPriceRefund().add(orderSkuVo.getSkuPriceActual()).add(orderVo.getPriceExpress()).compareTo(orderVo.getPriceActual()) >= 0) {
backOrder.setRealBackPrice(orderSkuVo.getSkuPriceActual().add(orderVo.getPriceExpress())); backOrder.setRealBackPrice(orderSkuVo.getSkuPriceActual().add(orderVo.getPriceExpress()));
...@@ -756,13 +774,30 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService { ...@@ -756,13 +774,30 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
//获取 可申请退款时间 //获取 可申请退款时间
private LocalDateTime getCanRefundTime(GoblinStoreOrderVo orderVo) { private LocalDateTime getCanRefundTime(GoblinStoreOrderVo orderVo) {
LocalDateTime canRefundTimeDateTime = null; LocalDateTime canRefundTimeDateTime = null;
if (orderVo.getStatus() == GoblinStatusConst.Status.ORDER_STATUS_2.getValue() || orderVo.getStatus() == GoblinStatusConst.Status.ORDER_STATUS_4.getValue()) { if (orderVo.getStatus() == GoblinStatusConst.Status.ORDER_STATUS_2.getValue()) {
try { try {
canRefundTimeDateTime = LocalDateTime.parse(orderVo.getPayTime(), DTF_YMD_HMS).plusDays(7); // 允许退款修改成发货时间+14天
// canRefundTimeDateTime = LocalDateTime.parse(orderVo.getPayTime(), DTF_YMD_HMS).plusDays(7);
// if (StringUtil.isBlank(orderVo.getDeliveryTime())) {
// canRefundTimeDateTime = LocalDateTime.parse(orderVo.getPayTime(), DTF_YMD_HMS).plusDays(7);
// }else {
// canRefundTimeDateTime = LocalDateTime.parse(orderVo.getDeliveryTime(), DTF_YMD_HMS).plusDays(14);
// }
// 未发货商品 可直接退款
canRefundTimeDateTime = LocalDateTime.now().plusDays(7);
// log.info("[getCanRefundTime] 未发货商品可退款时间: {}", canRefundTimeDateTime);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} else if (orderVo.getStatus() == GoblinStatusConst.Status.ORDER_STATUS_4.getValue()) {
if (StringUtil.isBlank(orderVo.getDeliveryTime())) {
canRefundTimeDateTime = LocalDateTime.parse(orderVo.getPayTime(), DTF_YMD_HMS).plusDays(7);
}else {
canRefundTimeDateTime = LocalDateTime.parse(orderVo.getDeliveryTime(), DTF_YMD_HMS).plusDays(7);
}
} }
log.info("[getCanRefundTime] 订单可退款时间: orderId: {}, orderStatus: {}, canRefundTimeDateTime: {}",
orderVo.getOrderId(), orderVo.getStatus(), canRefundTimeDateTime);
return canRefundTimeDateTime; return canRefundTimeDateTime;
} }
......
...@@ -12,6 +12,7 @@ import com.liquidnet.commons.lang.util.IDGenerator; ...@@ -12,6 +12,7 @@ import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.JsonUtils; import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.SqlMapping; import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst; import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.goblin.constant.GoblinGoodsShowInMallHelper;
import com.liquidnet.service.goblin.dto.GoblinGoodsImportDto; import com.liquidnet.service.goblin.dto.GoblinGoodsImportDto;
import com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto; import com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo; import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo;
...@@ -173,7 +174,9 @@ public class GoblinStoreMgtGoodsImportService { ...@@ -173,7 +174,9 @@ public class GoblinStoreMgtGoodsImportService {
for (int i = 0, size = goodsInfoVos.size(); i < size; i++) { for (int i = 0, size = goodsInfoVos.size(); i < size; i++) {
GoblinGoodsInfoVo goodsInfoVo = goodsInfoVos.get(i); GoblinGoodsInfoVo goodsInfoVo = goodsInfoVos.get(i);
initGoodsObjs.add(new Object[] { goodsInfoVo.getSpuId(), goodsInfoVo.getSpuNo(), initGoodsObjs.add(new Object[] { goodsInfoVo.getSpuId(), goodsInfoVo.getSpuNo(),
goodsInfoVo.getSpuBarCode(), goodsInfoVo.getName(), goodsInfoVo.getSubtitle(), goodsInfoVo.getSpuBarCode(), goodsInfoVo.getSpuErpCode(),
StringUtils.isBlank(goodsInfoVo.getErpType()) ? "WANGDIAN" : goodsInfoVo.getErpType(),
goodsInfoVo.getName(), goodsInfoVo.getSubtitle(),
goodsInfoVo.getSellPrice(), goodsInfoVo.getPriceGe(), goodsInfoVo.getPriceLe(), goodsInfoVo.getSellPrice(), goodsInfoVo.getPriceGe(), goodsInfoVo.getPriceLe(),
goodsInfoVo.getIntro(), goodsInfoVo.getDetails(), goodsInfoVo.getIntro(), goodsInfoVo.getDetails(),
goodsInfoVo.getCoverPic(), goodsInfoVo.getVideo(), goodsInfoVo.getSpecMode(), goodsInfoVo.getCoverPic(), goodsInfoVo.getVideo(), goodsInfoVo.getSpecMode(),
...@@ -183,6 +186,7 @@ public class GoblinStoreMgtGoodsImportService { ...@@ -183,6 +186,7 @@ public class GoblinStoreMgtGoodsImportService {
goodsInfoVo.getBrandId(), goodsInfoVo.getShelvesHandle(), goodsInfoVo.getShelvesTime(), goodsInfoVo.getBrandId(), goodsInfoVo.getShelvesHandle(), goodsInfoVo.getShelvesTime(),
goodsInfoVo.getSpuValidity(), goodsInfoVo.getVirtualFlg(), goodsInfoVo.getSpuValidity(), goodsInfoVo.getVirtualFlg(),
goodsInfoVo.getStatus(), goodsInfoVo.getShelvesStatus(), goodsInfoVo.getSpuAppear(), goodsInfoVo.getStatus(), goodsInfoVo.getShelvesStatus(), goodsInfoVo.getSpuAppear(),
GoblinGoodsShowInMallHelper.resolve(goodsInfoVo),
goodsInfoVo.getShelvesAt(), goodsInfoVo.getCreatedBy(), goodsInfoVo.getShelvesAt(), goodsInfoVo.getCreatedBy(),
goodsInfoVo.getCreatedAt(), goodsInfoVo.getLogisticsTemplate() }); goodsInfoVo.getCreatedAt(), goodsInfoVo.getLogisticsTemplate() });
if (!CollectionUtils.isEmpty(goodsInfoVo.getImageList())) { if (!CollectionUtils.isEmpty(goodsInfoVo.getImageList())) {
...@@ -455,6 +459,7 @@ public class GoblinStoreMgtGoodsImportService { ...@@ -455,6 +459,7 @@ public class GoblinStoreMgtGoodsImportService {
lastGoodsInfoVo.setStatus("3"); lastGoodsInfoVo.setStatus("3");
lastGoodsInfoVo.setShelvesStatus("0"); lastGoodsInfoVo.setShelvesStatus("0");
lastGoodsInfoVo.setSpuAppear("0");// * lastGoodsInfoVo.setSpuAppear("0");// *
lastGoodsInfoVo.setShowInMall(GoblinGoodsShowInMallHelper.SHOW_IN_MALL_YES);
lastGoodsInfoVo.setSpuCanbuy("1"); lastGoodsInfoVo.setSpuCanbuy("1");
lastGoodsInfoVo.setDelFlg("0"); lastGoodsInfoVo.setDelFlg("0");
lastGoodsInfoVo.setCreatedAt(now); lastGoodsInfoVo.setCreatedAt(now);
......
...@@ -8,6 +8,7 @@ import com.liquidnet.commons.lang.util.JsonUtils; ...@@ -8,6 +8,7 @@ import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.PagedResult; import com.liquidnet.service.base.PagedResult;
import com.liquidnet.service.base.SqlMapping; import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst; import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.goblin.constant.GoblinGoodsShowInMallHelper;
import com.liquidnet.service.goblin.constant.GoblinStatusConst; import com.liquidnet.service.goblin.constant.GoblinStatusConst;
import com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto; import com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto;
import com.liquidnet.service.goblin.dto.manage.*; import com.liquidnet.service.goblin.dto.manage.*;
...@@ -145,7 +146,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi ...@@ -145,7 +146,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
goblinMongoUtils.setGoodsInfoVo(goodsInfoVo); goblinMongoUtils.setGoodsInfoVo(goodsInfoVo);
goblinMongoUtils.setGoodsSkuInfoVos(goodsSkuInfoVoList); goblinMongoUtils.setGoodsSkuInfoVos(goodsSkuInfoVoList);
if (goodsInfoVo.getShelvesHandle().equals("2")) { if (goodsInfoVo.getShelvesHandle().equals("2") || Integer.valueOf(0).equals(goodsInfoVo.getShowInMall())) {
goblinRedisUtils.deleteKeyForSelectGoods();// 精选商品:商品上架、下架、删除 调用的方法 goblinRedisUtils.deleteKeyForSelectGoods();// 精选商品:商品上架、下架、删除 调用的方法
} }
...@@ -233,6 +234,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi ...@@ -233,6 +234,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
goodsInfoVo.getShelvesHandle(), goodsInfoVo.getShelvesTime(), goodsInfoVo.getShelvesHandle(), goodsInfoVo.getShelvesTime(),
goodsInfoVo.getSpuValidity(), goodsInfoVo.getVirtualFlg(), goodsInfoVo.getStatus(), goodsInfoVo.getSpuValidity(), goodsInfoVo.getVirtualFlg(), goodsInfoVo.getStatus(),
goodsInfoVo.getShelvesStatus(), goodsInfoVo.getSpuAppear(), goodsInfoVo.getShelvesStatus(), goodsInfoVo.getSpuAppear(),
GoblinGoodsShowInMallHelper.resolve(goodsInfoVo),
goodsInfoVo.getShelvesAt(), createdBy, createdAt, goodsInfoVo.getLogisticsTemplate() goodsInfoVo.getShelvesAt(), createdBy, createdAt, goodsInfoVo.getLogisticsTemplate()
}); });
toMqSqls.add(SqlMapping.get("goblin_goods_sku.insert")); toMqSqls.add(SqlMapping.get("goblin_goods_sku.insert"));
...@@ -727,6 +729,11 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi ...@@ -727,6 +729,11 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
} }
updateSpuInfoVo.setUpdatedBy(uid); updateSpuInfoVo.setUpdatedBy(uid);
updateSpuInfoVo.setUpdatedAt(LocalDateTime.now()); updateSpuInfoVo.setUpdatedAt(LocalDateTime.now());
int newShowInMall = GoblinGoodsShowInMallHelper.resolve(updateSpuInfoVo);
int oldShowInMall = GoblinGoodsShowInMallHelper.resolve(mgtGoodsInfoVo);
if (newShowInMall != oldShowInMall) {
goblinRedisUtils.deleteKeyForSelectGoods();
}
if (goblinMongoUtils.updateGoodsInfoVo(updateSpuInfoVo)) { if (goblinMongoUtils.updateGoodsInfoVo(updateSpuInfoVo)) {
log.info("商品管理:SPU编辑[UID={},PARAMS={}]", uid, JsonUtils.toJson(storeMgtGoodsAddParam)); log.info("商品管理:SPU编辑[UID={},PARAMS={}]", uid, JsonUtils.toJson(storeMgtGoodsAddParam));
GoblinGoodsSkuInfoVo updateSkuInfoVo = GoblinGoodsSkuInfoVo.getNew(); GoblinGoodsSkuInfoVo updateSkuInfoVo = GoblinGoodsSkuInfoVo.getNew();
...@@ -758,6 +765,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi ...@@ -758,6 +765,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
updateSpuInfoVo.getSpuValidity(), updateSpuInfoVo.getVirtualFlg(), updateSpuInfoVo.getSpuValidity(), updateSpuInfoVo.getVirtualFlg(),
updateSpuInfoVo.getLogisticsTemplate(), updateSpuInfoVo.getUpdatedBy(), updateSpuInfoVo.getLogisticsTemplate(), updateSpuInfoVo.getUpdatedBy(),
updateSpuInfoVo.getUpdatedAt(), updateSpuInfoVo.getSpuErpCode(), updateSpuInfoVo.getUpdatedAt(), updateSpuInfoVo.getSpuErpCode(),
newShowInMall,
marketSpuId marketSpuId
}); });
updateGoodsSkuObjs.add(new Object[] { updateGoodsSkuObjs.add(new Object[] {
...@@ -787,6 +795,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi ...@@ -787,6 +795,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
updateSpuInfoVo.getSpuValidity(), updateSpuInfoVo.getVirtualFlg(), updateSpuInfoVo.getSpuValidity(), updateSpuInfoVo.getVirtualFlg(),
updateSpuInfoVo.getLogisticsTemplate(), updateSpuInfoVo.getUpdatedBy(), updateSpuInfoVo.getLogisticsTemplate(), updateSpuInfoVo.getUpdatedBy(),
updateSpuInfoVo.getUpdatedAt(), updateSpuInfoVo.getSpuErpCode(), updateSpuInfoVo.getUpdatedAt(), updateSpuInfoVo.getSpuErpCode(),
newShowInMall,
updateSpuInfoVo.getSpuId() updateSpuInfoVo.getSpuId()
}); });
toMqSqls.add(SqlMapping.get("goblin_goods_sku.update_by_edit_spu")); toMqSqls.add(SqlMapping.get("goblin_goods_sku.update_by_edit_spu"));
...@@ -1164,6 +1173,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi ...@@ -1164,6 +1173,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
updateSpuInfoVo.getSpuValidity(), updateSpuInfoVo.getVirtualFlg(), updateSpuInfoVo.getSpuValidity(), updateSpuInfoVo.getVirtualFlg(),
updateSpuInfoVo.getLogisticsTemplate(), updateSpuInfoVo.getUpdatedBy(), updateSpuInfoVo.getLogisticsTemplate(), updateSpuInfoVo.getUpdatedBy(),
updateSpuInfoVo.getUpdatedAt(), updateSpuInfoVo.getSpuErpCode(), updateSpuInfoVo.getUpdatedAt(), updateSpuInfoVo.getSpuErpCode(),
GoblinGoodsShowInMallHelper.resolve(updateSpuInfoVo),
marketSpuId marketSpuId
}); });
updateGoodsSkuObjs.add(new Object[] { updateGoodsSkuObjs.add(new Object[] {
...@@ -1192,6 +1202,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi ...@@ -1192,6 +1202,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
updateSpuInfoVo.getSpuValidity(), updateSpuInfoVo.getVirtualFlg(), updateSpuInfoVo.getSpuValidity(), updateSpuInfoVo.getVirtualFlg(),
updateSpuInfoVo.getLogisticsTemplate(), updateSpuInfoVo.getUpdatedBy(), updateSpuInfoVo.getLogisticsTemplate(), updateSpuInfoVo.getUpdatedBy(),
updateSpuInfoVo.getUpdatedAt(), updateSpuInfoVo.getSpuErpCode(), updateSpuInfoVo.getUpdatedAt(), updateSpuInfoVo.getSpuErpCode(),
GoblinGoodsShowInMallHelper.resolve(updateSpuInfoVo),
updateSpuInfoVo.getSpuId() updateSpuInfoVo.getSpuId()
}); });
toMqSqls.add(SqlMapping.get("goblin_goods_sku.update_by_edit_coupon_spu")); toMqSqls.add(SqlMapping.get("goblin_goods_sku.update_by_edit_coupon_spu"));
......
...@@ -14,6 +14,7 @@ import com.liquidnet.commons.lang.util.JsonUtils; ...@@ -14,6 +14,7 @@ import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.SqlMapping; import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst; import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.goblin.constant.GoblinGoodsShowInMallHelper;
import com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto; import com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto;
import com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtGoodsSqbAddParam; import com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtGoodsSqbAddParam;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinMgtCategorySpecVo; import com.liquidnet.service.goblin.dto.manage.vo.GoblinMgtCategorySpecVo;
...@@ -361,6 +362,7 @@ public class GoblinStoreMgtSqbGoodsServiceImpl implements IGoblinStoreMgtSqbGood ...@@ -361,6 +362,7 @@ public class GoblinStoreMgtSqbGoodsServiceImpl implements IGoblinStoreMgtSqbGood
updateSpuInfoVo.getSpuValidity(), updateSpuInfoVo.getVirtualFlg(), updateSpuInfoVo.getSpuValidity(), updateSpuInfoVo.getVirtualFlg(),
updateSpuInfoVo.getLogisticsTemplate(), updateSpuInfoVo.getUpdatedBy(), updateSpuInfoVo.getLogisticsTemplate(), updateSpuInfoVo.getUpdatedBy(),
updateSpuInfoVo.getUpdatedAt(), updateSpuInfoVo.getSpuErpCode(), updateSpuInfoVo.getUpdatedAt(), updateSpuInfoVo.getSpuErpCode(),
GoblinGoodsShowInMallHelper.resolve(updateSpuInfoVo),
updateSpuInfoVo.getSpuId() updateSpuInfoVo.getSpuId()
}); });
......
...@@ -701,6 +701,7 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService { ...@@ -701,6 +701,7 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
log.setType(GoblinStatusConst.Status.ORDER_LOG_STATUS_13.getValue()); log.setType(GoblinStatusConst.Status.ORDER_LOG_STATUS_13.getValue());
log.setRemark("发货:orderId=[" + orderId + "],orderSkuId=[" + StringUtils.join(skuIds, ",") + "],mailNo=[" + mailNo + "]"); log.setRemark("发货:orderId=[" + orderId + "],orderSkuId=[" + StringUtils.join(skuIds, ",") + "],mailNo=[" + mailNo + "]");
//redis //redis
redisUtils.setGoblinOrder(orderId, orderVo); redisUtils.setGoblinOrder(orderId, orderVo);
//mongo //mongo
......
...@@ -36,12 +36,12 @@ goblin_goods_sku_spec_value.update_by_edit=UPDATE goblin_goods_sku_spec_value SE ...@@ -36,12 +36,12 @@ goblin_goods_sku_spec_value.update_by_edit=UPDATE goblin_goods_sku_spec_value SE
goblin_goods_sku_spec_value.update_by_del_sku=UPDATE goblin_goods_sku_spec_value SET del_flg='1' WHERE sku_id=? AND del_flg='0' goblin_goods_sku_spec_value.update_by_del_sku=UPDATE goblin_goods_sku_spec_value SET del_flg='1' WHERE sku_id=? AND del_flg='0'
#---- \u5546\u54C1\u4FE1\u606F #---- \u5546\u54C1\u4FE1\u606F
#goblin_goods.insert=INSERT INTO goblin_goods (spu_id,spu_no,spu_bar_code,name,subtitle,sell_price, price_ge,price_le,intro,details,cover_pic, video,spec_mode,store_id,cate_fid,cate_sid, cate_tid,store_cate_fid,store_cate_sid,store_cate_tid,brand_id, shelves_handle,shelves_time,spu_validity,virtual_flg,status, shelves_status,spu_appear,shelves_at,created_by,created_at, logistics_template)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) #goblin_goods.insert=INSERT INTO goblin_goods (spu_id,spu_no,spu_bar_code,name,subtitle,sell_price, price_ge,price_le,intro,details,cover_pic, video,spec_mode,store_id,cate_fid,cate_sid, cate_tid,store_cate_fid,store_cate_sid,store_cate_tid,brand_id, shelves_handle,shelves_time,spu_validity,virtual_flg,status, shelves_status,spu_appear,shelves_at,created_by,created_at, logistics_template)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
goblin_goods.insert=INSERT INTO goblin_goods (spu_id,spu_no,spu_bar_code,spu_erp_code,erp_type,name,subtitle,sell_price, price_ge,price_le,intro,details,cover_pic, video,spec_mode,store_id,cate_fid,cate_sid, cate_tid,store_cate_fid,store_cate_sid,store_cate_tid,brand_id, shelves_handle,shelves_time,spu_validity,virtual_flg,status, shelves_status,spu_appear,shelves_at,created_by,created_at, logistics_template)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) goblin_goods.insert=INSERT INTO goblin_goods (spu_id,spu_no,spu_bar_code,spu_erp_code,erp_type,name,subtitle,sell_price, price_ge,price_le,intro,details,cover_pic, video,spec_mode,store_id,cate_fid,cate_sid, cate_tid,store_cate_fid,store_cate_sid,store_cate_tid,brand_id, shelves_handle,shelves_time,spu_validity,virtual_flg,status, shelves_status,spu_appear,show_in_mall,shelves_at,created_by,created_at, logistics_template)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
goblin_goods.insert_for_coupon=INSERT INTO goblin_goods (spu_id,spu_no,spu_bar_code,spu_erp_code,erp_type,spu_type,name,subtitle,sell_price, price_ge,price_le,intro,details,cover_pic, video,spec_mode,store_id,cate_fid,cate_sid, cate_tid,store_cate_fid,store_cate_sid,store_cate_tid,brand_id, shelves_handle,shelves_time,spu_validity,virtual_flg,status, shelves_status,spu_appear,shelves_at,created_by,created_at, logistics_template)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) goblin_goods.insert_for_coupon=INSERT INTO goblin_goods (spu_id,spu_no,spu_bar_code,spu_erp_code,erp_type,spu_type,name,subtitle,sell_price, price_ge,price_le,intro,details,cover_pic, video,spec_mode,store_id,cate_fid,cate_sid, cate_tid,store_cate_fid,store_cate_sid,store_cate_tid,brand_id, shelves_handle,shelves_time,spu_validity,virtual_flg,status, shelves_status,spu_appear,shelves_at,created_by,created_at, logistics_template)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
#goblin_goods.insert_for_digital=INSERT INTO goblin_goods (spu_id,spu_no,spu_type,name,intro,attention,store_id,cate_fid,cate_sid,cate_tid,virtual_flg,status,shelves_status,spu_appear,author,publisher,created_by,created_at)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) #goblin_goods.insert_for_digital=INSERT INTO goblin_goods (spu_id,spu_no,spu_type,name,intro,attention,store_id,cate_fid,cate_sid,cate_tid,virtual_flg,status,shelves_status,spu_appear,author,publisher,created_by,created_at)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
goblin_goods.insert_for_digital=INSERT INTO goblin_goods (spu_id,spu_no,spu_type,name,intro,attention,store_id,cate_fid,cate_sid,cate_tid,virtual_flg,status,shelves_status,spu_appear,author,publisher,created_by,created_at,spu_erp_code)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) goblin_goods.insert_for_digital=INSERT INTO goblin_goods (spu_id,spu_no,spu_type,name,intro,attention,store_id,cate_fid,cate_sid,cate_tid,virtual_flg,status,shelves_status,spu_appear,author,publisher,created_by,created_at,spu_erp_code)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
#goblin_goods.update_by_edit=UPDATE goblin_goods SET spu_no=?,name=?,subtitle=?,sell_price=?,intro=?,details=?,cover_pic=?,video=?,spec_mode=?,cate_fid=?,cate_sid=?,cate_tid=?,shelves_handle=?,shelves_time=?,spu_validity=?,virtual_flg=?,logistics_template=?,updated_by=?,updated_at=? WHERE spu_id=? AND del_flg='0' #goblin_goods.update_by_edit=UPDATE goblin_goods SET spu_no=?,name=?,subtitle=?,sell_price=?,intro=?,details=?,cover_pic=?,video=?,spec_mode=?,cate_fid=?,cate_sid=?,cate_tid=?,shelves_handle=?,shelves_time=?,spu_validity=?,virtual_flg=?,logistics_template=?,updated_by=?,updated_at=? WHERE spu_id=? AND del_flg='0'
goblin_goods.update_by_edit=UPDATE goblin_goods SET spu_no=?,name=?,subtitle=?,sell_price=?,intro=?,details=?,cover_pic=?,video=?,spec_mode=?,cate_fid=?,cate_sid=?,cate_tid=?,shelves_handle=?,shelves_time=?,spu_validity=?,virtual_flg=?,logistics_template=?,updated_by=?,updated_at=?,spu_erp_code=? WHERE spu_id=? AND del_flg='0' goblin_goods.update_by_edit=UPDATE goblin_goods SET spu_no=?,name=?,subtitle=?,sell_price=?,intro=?,details=?,cover_pic=?,video=?,spec_mode=?,cate_fid=?,cate_sid=?,cate_tid=?,shelves_handle=?,shelves_time=?,spu_validity=?,virtual_flg=?,logistics_template=?,updated_by=?,updated_at=?,spu_erp_code=?,show_in_mall=? WHERE spu_id=? AND del_flg='0'
#goblin_goods.update_by_edit_for_digital=UPDATE goblin_goods SET name=?,intro=?,cate_fid=?,cate_sid=?,cate_tid=?,updated_by=?,updated_at=? WHERE spu_id=? AND del_flg='0' #goblin_goods.update_by_edit_for_digital=UPDATE goblin_goods SET name=?,intro=?,cate_fid=?,cate_sid=?,cate_tid=?,updated_by=?,updated_at=? WHERE spu_id=? AND del_flg='0'
goblin_goods.update_by_edit_for_digital=UPDATE goblin_goods SET name=?,intro=?,cate_fid=?,cate_sid=?,cate_tid=?,updated_by=?,updated_at=?,spu_erp_code=? WHERE spu_id=? AND del_flg='0' goblin_goods.update_by_edit_for_digital=UPDATE goblin_goods SET name=?,intro=?,cate_fid=?,cate_sid=?,cate_tid=?,updated_by=?,updated_at=?,spu_erp_code=? WHERE spu_id=? AND del_flg='0'
goblin_goods.update_by_shelves=UPDATE goblin_goods SET shelves_status=?,shelves_at=?,updated_by=?,updated_at=? WHERE spu_id=? AND store_id=? AND spu_appear='0' goblin_goods.update_by_shelves=UPDATE goblin_goods SET shelves_status=?,shelves_at=?,updated_by=?,updated_at=? WHERE spu_id=? AND store_id=? AND spu_appear='0'
...@@ -119,6 +119,7 @@ goblin_order.store.orderSkuPush=UPDATE goblin_order_sku SET status = ? , updated ...@@ -119,6 +119,7 @@ goblin_order.store.orderSkuPush=UPDATE goblin_order_sku SET status = ? , updated
goblin_order.store.orderPush=UPDATE goblin_store_order SET status = ? ,zhengzai_status=?, updated_at = ?,push_time = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null) goblin_order.store.orderPush=UPDATE goblin_store_order SET status = ? ,zhengzai_status=?, updated_at = ?,push_time = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
goblin_order.store.express=UPDATE goblin_store_order SET status = ? , updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null) goblin_order.store.express=UPDATE goblin_store_order SET status = ? , updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
goblin_order.store.expressTime=UPDATE goblin_store_order SET status = ?, delivery_time = ? , updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
goblin_order.mail=INSERT INTO goblin_mail (`mail_id`,`order_id`,`mail_no`,`delivery_time`,`logistics_company`,`order_sku_ids`,`created_at`) VALUES (?,?,?,?,?,?,?) goblin_order.mail=INSERT INTO goblin_mail (`mail_id`,`order_id`,`mail_no`,`delivery_time`,`logistics_company`,`order_sku_ids`,`created_at`) VALUES (?,?,?,?,?,?,?)
goblin_order.mail.update=UPDATE goblin_mail SET mail_no = ? , updated_at = ? WHERE mail_id = ? goblin_order.mail.update=UPDATE goblin_mail SET mail_no = ? , updated_at = ? WHERE mail_id = ?
goblin_order.store.address=UPDATE goblin_order_attr SET express_contacts = ? ,express_address_detail = ? , express_phone = ? , updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null) goblin_order.store.address=UPDATE goblin_order_attr SET express_contacts = ? ,express_address_detail = ? , express_phone = ? , updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
...@@ -132,6 +133,7 @@ goblin_order.store.changeExpress=UPDATE goblin_back_order SET real_back_price = ...@@ -132,6 +133,7 @@ goblin_order.store.changeExpress=UPDATE goblin_back_order SET real_back_price =
goblin_order.store.changeSku=UPDATE goblin_back_order SET real_back_price = ? , updated_at = ? WHERE back_order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null) goblin_order.store.changeSku=UPDATE goblin_back_order SET real_back_price = ? , updated_at = ? WHERE back_order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
goblin_order.store.backOrderStatus=UPDATE goblin_back_order SET status = ? , refuse_at=?,refuse_size=?,updated_at = ? WHERE back_order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null) goblin_order.store.backOrderStatus=UPDATE goblin_back_order SET status = ? , refuse_at=?,refuse_size=?,updated_at = ? WHERE back_order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
goblin_order.store.orderStatus=UPDATE goblin_store_order SET status = ? ,zhengzai_status=?, updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null) goblin_order.store.orderStatus=UPDATE goblin_store_order SET status = ? ,zhengzai_status=?, updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
goblin_order.store.orderStatus.time=UPDATE goblin_store_order SET status = ? ,zhengzai_status=?, updated_at = ?, delivery_time = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
goblin_order.store.applyRefund=UPDATE goblin_back_order SET status = ? ,reason=?,audit_at=?, updated_at = ? WHERE back_order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null) goblin_order.store.applyRefund=UPDATE goblin_back_order SET status = ? ,reason=?,audit_at=?, updated_at = ? WHERE back_order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
#---- \u7528\u6237\u8BA2\u5355\u64CD\u4F5C #---- \u7528\u6237\u8BA2\u5355\u64CD\u4F5C
goblin_order.user.applyRefund=INSERT INTO goblin_back_order (`back_order_id`,`back_code`,`order_id`,`order_code`,`store_id`,`user_id`,`sku_id_nums`,`type`,`reason`,`describes`,`real_back_price`,`back_price_express`,`status`,`logis_company_name`,`mail_no`,`pics`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) goblin_order.user.applyRefund=INSERT INTO goblin_back_order (`back_order_id`,`back_code`,`order_id`,`order_code`,`store_id`,`user_id`,`sku_id_nums`,`type`,`reason`,`describes`,`real_back_price`,`back_price_express`,`status`,`logis_company_name`,`mail_no`,`pics`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
...@@ -194,7 +196,7 @@ goblin_nft_order.update_artwork=UPDATE goblin_nft_order SET artwork_id=? WHERE o ...@@ -194,7 +196,7 @@ goblin_nft_order.update_artwork=UPDATE goblin_nft_order SET artwork_id=? WHERE o
goblin_sku.stock=UPDATE goblin_goods_sku SET sku_stock = ? , stock = ?, updated_at = ? WHERE sku_erp_code = ? and erp_warehouse_no = ? goblin_sku.stock=UPDATE goblin_goods_sku SET sku_stock = ? , stock = ?, updated_at = ? WHERE sku_erp_code = ? and erp_warehouse_no = ?
#---- #----
candy_user_coupon.update_apply_refund=UPDATE candy_user_coupon SET state=?,operator=?,updated_at=? WHERE ucoupon_id=? candy_user_coupon.update_apply_refund=UPDATE candy_user_coupon SET state=?,operator=?,updated_at=? WHERE ucoupon_id=?
# \u6536\u94B1\u5427\u4E0B\u5355 INSERT \u5DF2\u8FC1\u81F3 order \u670D\u52A1\uff1aliquidnet-service-order-impl/sqlmap.properties \u4E2D goblin_sqb_order.insert # \u6536\u94B1\u5427\u4E0B\u5355 INSERT \u5DF2\u8FC1\u81F3 order \u670D\u52A1\uFF1Aliquidnet-service-order-impl/sqlmap.properties \u4E2D goblin_sqb_order.insert
# ---- \u624B\u73AF\u8BA2\u5355 ---- # ---- \u624B\u73AF\u8BA2\u5355 ----
goblin_bracelet_order_insert = INSERT INTO `goblin_bracelet_order`(`order_id`, `user_id`, `bind_name`, `bind_mobile`, `bind_idcard`, `req_date`, `goods_desc`, `wristband_id`, `wristband_price`, `amount_id`, `amount_price`, `req_seq_id`, `hf_seq_id`, `trade_type`, `party_order_id`, `price`, `price_total`, `price_refund`, `refund_price_charges`, `refund_number`, `status`, `pay_status`, `created_at`, `updated_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) goblin_bracelet_order_insert = INSERT INTO `goblin_bracelet_order`(`order_id`, `user_id`, `bind_name`, `bind_mobile`, `bind_idcard`, `req_date`, `goods_desc`, `wristband_id`, `wristband_price`, `amount_id`, `amount_price`, `req_seq_id`, `hf_seq_id`, `trade_type`, `party_order_id`, `price`, `price_total`, `price_refund`, `refund_price_charges`, `refund_number`, `status`, `pay_status`, `created_at`, `updated_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
......
...@@ -4,7 +4,7 @@ kylin_lack_register.insert=INSERT INTO `kylin_lack_registers`(`lack_registers_id ...@@ -4,7 +4,7 @@ kylin_lack_register.insert=INSERT INTO `kylin_lack_registers`(`lack_registers_id
# ------------------------PV/UV---------------------------- # ------------------------PV/UV----------------------------
bi_ticket_access_records.insert=INSERT INTO `bi_ticket_access_records` ( `user_id`, `access_type`, `performance_id`, `order_id`, `order_code`,`ip_address`, `area`, `area_province`, `area_city`, `area_county`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?); bi_ticket_access_records.insert=INSERT INTO `bi_ticket_access_records` ( `user_id`, `access_type`, `performance_id`, `order_id`, `order_code`,`ip_address`, `area`, `area_province`, `area_city`, `area_county`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?);
# ------------------------\u521B\u5EFA\u8BA2\u5355---------------------------- # ------------------------\u521B\u5EFA\u8BA2\u5355----------------------------
kylin_order_ticket.add=INSERT INTO kylin_order_tickets(order_tickets_id,user_id,user_name,user_mobile,performance_title,order_code,qr_code,order_type,order_version,`number`,price,price_member,price_total,price_voucher,price_actual,price_express,price_refund,refund_number,pay_type,payment_type,time_pay,express_contacts,express_address,express_phone,coupon_type,get_ticket_type,get_ticket_describe,pay_countdown_minute,`comment`,created_at,updated_at,pay_code,ip_address,area,area_province,area_city,area_county)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) kylin_order_ticket.add=INSERT INTO kylin_order_tickets(order_tickets_id,user_id,user_name,user_mobile,performance_title,order_code,qr_code,order_type,order_version,order_source,referrer_user_id,`number`,price,price_member,price_total,price_voucher,price_actual,price_express,price_refund,refund_number,pay_type,payment_type,time_pay,express_contacts,express_address,express_phone,coupon_type,get_ticket_type,get_ticket_describe,pay_countdown_minute,`comment`,created_at,updated_at,pay_code,ip_address,area,area_province,area_city,area_county)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
kylin_order_ticket_relation.add=INSERT INTO kylin_order_ticket_relations(order_ticket_relations_id ,order_id ,transfer_id ,live_id ,agent_id ,is_member ,performance_id ,time_id ,ticket_id ,created_at ,updated_at,agent_status,agent_distributions,agent_id_master,agent_distributions_master)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) kylin_order_ticket_relation.add=INSERT INTO kylin_order_ticket_relations(order_ticket_relations_id ,order_id ,transfer_id ,live_id ,agent_id ,is_member ,performance_id ,time_id ,ticket_id ,created_at ,updated_at,agent_status,agent_distributions,agent_id_master,agent_distributions_master)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
kylin_order_ticket_status.add=INSERT INTO kylin_order_ticket_status(order_ticket_status_id ,order_id ,express_type ,is_student ,transfer_status ,`status` ,pay_status , produce_code, created_at ,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?) kylin_order_ticket_status.add=INSERT INTO kylin_order_ticket_status(order_ticket_status_id ,order_id ,express_type ,is_student ,transfer_status ,`status` ,pay_status , produce_code, created_at ,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?)
kylin_order_ticket_entities.add=INSERT INTO kylin_order_ticket_entities(order_ticket_entities_id ,order_id ,ticket_id ,user_id ,time_id ,performance_id ,enter_type ,enter_name ,enter_mobile,enter_id_code,`status`,sys_damai,check_client,is_payment,`comment`,created_at,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) kylin_order_ticket_entities.add=INSERT INTO kylin_order_ticket_entities(order_ticket_entities_id ,order_id ,ticket_id ,user_id ,time_id ,performance_id ,enter_type ,enter_name ,enter_mobile,enter_id_code,`status`,sys_damai,check_client,is_payment,`comment`,created_at,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
......
...@@ -50,7 +50,11 @@ public class DragonServiceCommonBiz { ...@@ -50,7 +50,11 @@ public class DragonServiceCommonBiz {
orders.setClientIp(dragonPayBaseReqDto.getClientIp()); orders.setClientIp(dragonPayBaseReqDto.getClientIp());
orders.setNotifyUrl(dragonPayBaseReqDto.getNotifyUrl()); orders.setNotifyUrl(dragonPayBaseReqDto.getNotifyUrl());
orders.setNotifyStatus(Integer.valueOf(DragonConstant.PayNotifyStatusEnum.NOTIFY_INIT.getCode())); orders.setNotifyStatus(Integer.valueOf(DragonConstant.PayNotifyStatusEnum.NOTIFY_INIT.getCode()));
orders.setPaymentType((dragonPayBaseReqDto.getDeviceFrom()+dragonPayBaseReqDto.getPayType()).toUpperCase()); if (dragonPayBaseReqDto.getAppIdType() != null && !dragonPayBaseReqDto.getAppIdType().trim().isEmpty()) {
orders.setPaymentType((dragonPayBaseReqDto.getDeviceFrom() + dragonPayBaseReqDto.getAppIdType() + dragonPayBaseReqDto.getPayType()).toUpperCase());
} else {
orders.setPaymentType((dragonPayBaseReqDto.getDeviceFrom() + dragonPayBaseReqDto.getPayType()).toUpperCase());
}
// orders.setPaymentId(); // orders.setPaymentId();
orders.setPaymentAt(LocalDateTime.now()); orders.setPaymentAt(LocalDateTime.now());
// orders.setFinishedAt(); // orders.setFinishedAt();
......
...@@ -16,6 +16,8 @@ import com.liquidnet.service.dragon.dto.DragonPayBaseReqDto; ...@@ -16,6 +16,8 @@ import com.liquidnet.service.dragon.dto.DragonPayBaseReqDto;
import com.liquidnet.service.dragon.dto.DragonPayBaseRespDto; import com.liquidnet.service.dragon.dto.DragonPayBaseRespDto;
import com.liquidnet.service.dragon.dto.DragonPayOrderQueryRespDto; import com.liquidnet.service.dragon.dto.DragonPayOrderQueryRespDto;
import com.liquidnet.service.dragon.utils.DataUtilsDragon; import com.liquidnet.service.dragon.utils.DataUtilsDragon;
import com.liquidnet.service.dragon.config.WepayAppletPayConfigure;
import com.liquidnet.service.dragon.support.WepayAppletPaySupport;
import com.liquidnet.service.dragon.utils.PayWepayUtils; import com.liquidnet.service.dragon.utils.PayWepayUtils;
import com.liquidnet.service.dragon.utils.XmlUtil; import com.liquidnet.service.dragon.utils.XmlUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -157,9 +159,9 @@ public abstract class AbstractWepayStrategy implements IWepayStrategy { ...@@ -157,9 +159,9 @@ public abstract class AbstractWepayStrategy implements IWepayStrategy {
String nonceStr = PayWepayUtils.getInstance().getNonceStr(); String nonceStr = PayWepayUtils.getInstance().getNonceStr();
SortedMap<String, Object> parameters = new TreeMap<>(); SortedMap<String, Object> parameters = new TreeMap<>();
// parameters.put("mch_id", PayWepayUtils.getInstance().getMerchantId()); // parameters.put("mch_id", PayWepayUtils.getInstance().getMerchantId());
if(dragonPayBaseReqDto.getAppIdType().equals("b")){ if (WepayAppletPaySupport.usesMerchantB(dragonPayBaseReqDto.getAppIdType())) {
parameters.put("mch_id", PayWepayUtils.getInstance().getMerchantBId()); parameters.put("mch_id", PayWepayUtils.getInstance().getMerchantBId());
}else{ } else {
parameters.put("mch_id", PayWepayUtils.getInstance().getMerchantId()); parameters.put("mch_id", PayWepayUtils.getInstance().getMerchantId());
} }
parameters.put("nonce_str", nonceStr); parameters.put("nonce_str", nonceStr);
...@@ -201,11 +203,8 @@ public abstract class AbstractWepayStrategy implements IWepayStrategy { ...@@ -201,11 +203,8 @@ public abstract class AbstractWepayStrategy implements IWepayStrategy {
public DragonPayOrderQueryRespDto checkOrderStatus(String code) { public DragonPayOrderQueryRespDto checkOrderStatus(String code) {
DragonOrdersDto ordersDto = dataUtilsDragon.getPayOrderByCode(code); DragonOrdersDto ordersDto = dataUtilsDragon.getPayOrderByCode(code);
Map<String, Object> resultMap = null; Map<String, Object> resultMap = null;
if(code.contains("b")){ String queryAppid = WepayAppletPayConfigure.resolveAppletAppIdForTradeQuery(ordersDto.getPaymentType(), code);
resultMap = wepayBiz.tradeQuery(code, PayWepayUtils.getInstance().getAPPLETB_APPID()); resultMap = wepayBiz.tradeQuery(code, queryAppid);
}else{
resultMap = wepayBiz.tradeQuery(code,this.getAppid());
}
DragonPayOrderQueryRespDto respDto = dragonPayBiz.buildPayOrderQueryRespDto(ordersDto); DragonPayOrderQueryRespDto respDto = dragonPayBiz.buildPayOrderQueryRespDto(ordersDto);
......
...@@ -5,6 +5,7 @@ import com.liquidnet.service.dragon.channel.wepay.strategy.annotation.StrategyWe ...@@ -5,6 +5,7 @@ import com.liquidnet.service.dragon.channel.wepay.strategy.annotation.StrategyWe
import com.liquidnet.service.dragon.constant.DragonConstant; import com.liquidnet.service.dragon.constant.DragonConstant;
import com.liquidnet.service.dragon.dto.DragonPayBaseReqDto; import com.liquidnet.service.dragon.dto.DragonPayBaseReqDto;
import com.liquidnet.service.dragon.dto.DragonPayBaseRespDto; import com.liquidnet.service.dragon.dto.DragonPayBaseRespDto;
import com.liquidnet.service.dragon.config.WepayAppletPayConfigure;
import com.liquidnet.service.dragon.utils.PayWepayUtils; import com.liquidnet.service.dragon.utils.PayWepayUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -32,11 +33,7 @@ public class WepayStrategyAppletImpl extends AbstractWepayStrategy{ ...@@ -32,11 +33,7 @@ public class WepayStrategyAppletImpl extends AbstractWepayStrategy{
@Override @Override
SortedMap<String, Object> appendRequestParam(SortedMap<String, Object> requestMap, DragonPayBaseReqDto dragonPayBaseReqDto) { SortedMap<String, Object> appendRequestParam(SortedMap<String, Object> requestMap, DragonPayBaseReqDto dragonPayBaseReqDto) {
requestMap.put("trade_type", "JSAPI"); requestMap.put("trade_type", "JSAPI");
if(dragonPayBaseReqDto.getAppIdType().equals("b")){ requestMap.put("appid", WepayAppletPayConfigure.resolveAppletAppIdByAppIdType(dragonPayBaseReqDto.getAppIdType()));
requestMap.put("appid", PayWepayUtils.getInstance().getAPPLETB_APPID());
}else{
requestMap.put("appid", PayWepayUtils.getInstance().getAPPLET_APP_ID());
}
requestMap.put("openid", dragonPayBaseReqDto.getOpenId()); //只有trade_type="JSAPI"时必须传 requestMap.put("openid", dragonPayBaseReqDto.getOpenId()); //只有trade_type="JSAPI"时必须传
return requestMap; return requestMap;
} }
......
package com.liquidnet.service.dragon.config;
import com.liquidnet.service.dragon.support.WepayAppletPaySupport;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
/**
* 小程序微信支付 appid,与 sweet {@code liquidnet.wechat.applet.*} 配置一致。
*/
@Configuration
public class WepayAppletPayConfigure {
private static String appidZhengzai;
private static String appidModern;
private static String appidDoudou;
private static String appidMootoo;
private static String appidWenque;
@Value("${liquidnet.wechat.applet.zhengzai.appid}")
public void setAppidZhengzai(String appidZhengzai) {
WepayAppletPayConfigure.appidZhengzai = appidZhengzai;
}
@Value("${liquidnet.wechat.applet.modern.appid}")
public void setAppidModern(String appidModern) {
WepayAppletPayConfigure.appidModern = appidModern;
}
@Value("${liquidnet.wechat.applet.doudou.appid}")
public void setAppidDoudou(String appidDoudou) {
WepayAppletPayConfigure.appidDoudou = appidDoudou;
}
@Value("${liquidnet.wechat.applet.mootoo.appid}")
public void setAppidMootoo(String appidMootoo) {
WepayAppletPayConfigure.appidMootoo = appidMootoo;
}
@Value("${liquidnet.wechat.applet.wenque.appid}")
public void setAppidWenque(String appidWenque) {
WepayAppletPayConfigure.appidWenque = appidWenque;
}
public static String resolveAppletAppIdByAppIdType(String appIdType) {
if (appIdType == null || appIdType.trim().isEmpty()) {
return appidZhengzai;
}
switch (appIdType) {
case WepayAppletPaySupport.APP_ID_TYPE_B:
return appidModern;
case WepayAppletPaySupport.APP_ID_TYPE_DOUDOU:
return appidDoudou;
case WepayAppletPaySupport.APP_ID_TYPE_MOOTOO:
return appidMootoo;
case WepayAppletPaySupport.APP_ID_TYPE_WENQUE:
return appidWenque;
default:
return appidZhengzai;
}
}
public static String resolveAppletAppIdByPaymentType(String paymentType) {
if (paymentType == null) {
return appidZhengzai;
}
if (paymentType.contains("APPLETB")) {
return appidModern;
}
if (paymentType.contains("DOUDOU")) {
return appidDoudou;
}
if (paymentType.contains("MOOTOO")) {
return appidMootoo;
}
if (paymentType.contains("WENQUE")) {
return appidWenque;
}
return appidZhengzai;
}
/**
* 查单/退款:优先 paymentType;老摩登单可能 payment_type=APPLETWEPAY 但 pay_code 为 PAYB 前缀。
*/
public static String resolveAppletAppIdForTradeQuery(String paymentType, String payCode) {
String appId = resolveAppletAppIdByPaymentType(paymentType);
if (appidZhengzai != null && appidZhengzai.equals(appId) && payCode != null
&& (payCode.startsWith("PAYB") || payCode.contains("b"))) {
return appidModern;
}
return appId;
}
}
...@@ -5,6 +5,8 @@ import com.liquidnet.service.dragon.dto.DragonPayBaseReqDto; ...@@ -5,6 +5,8 @@ import com.liquidnet.service.dragon.dto.DragonPayBaseReqDto;
import com.liquidnet.service.dragon.dto.DragonPayBaseRespDto; import com.liquidnet.service.dragon.dto.DragonPayBaseRespDto;
import com.liquidnet.service.dragon.dto.DragonPayOrderQueryRespDto; import com.liquidnet.service.dragon.dto.DragonPayOrderQueryRespDto;
import com.liquidnet.service.dragon.service.IDragonOrdersService; import com.liquidnet.service.dragon.service.IDragonOrdersService;
import com.liquidnet.service.dragon.doc.DragonPaySwaggerDoc;
import com.liquidnet.service.dragon.support.WepayAppletPaySupport;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -43,8 +45,8 @@ public class PayController { ...@@ -43,8 +45,8 @@ public class PayController {
@ApiOperation("Dragon支付") @ApiOperation("Dragon支付")
@ApiResponse(code = 200, message = "接口返回对象参数") @ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "payType", value = "支付类型:alipay,wepay,unionpay,applepay", example = "unionpay"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "payType", value = DragonPaySwaggerDoc.PAY_TYPE_VALUE, allowableValues = DragonPaySwaggerDoc.PAY_TYPE_ALLOWABLE, example = "wepay"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "deviceFrom", value = "设备来源:web,wap,app,js,apple,micropay", example = "wap"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "deviceFrom", value = DragonPaySwaggerDoc.DEVICE_FROM_VALUE, allowableValues = DragonPaySwaggerDoc.DEVICE_FROM_ALLOWABLE, example = "applet"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "type", value = "业务类型:TICKET,PRODUCT,COST,MBEANS,LIVE,VIDEO,VIP,CLUB,STRAWBERRY", example = "TICKET"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "type", value = "业务类型:TICKET,PRODUCT,COST,MBEANS,LIVE,VIDEO,VIP,CLUB,STRAWBERRY", example = "TICKET"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "price", value = "支付金额", example = "0.1"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "price", value = "支付金额", example = "0.1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "name", value = "订单名称", example = "测试订单001"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "name", value = "订单名称", example = "测试订单001"),
...@@ -89,10 +91,7 @@ public class PayController { ...@@ -89,10 +91,7 @@ public class PayController {
DragonPayBaseReqDto dragonPayBaseReqDto = DragonPayBaseReqDto.getNew(); DragonPayBaseReqDto dragonPayBaseReqDto = DragonPayBaseReqDto.getNew();
dragonPayBaseReqDto.setPayType(payType); dragonPayBaseReqDto.setPayType(payType);
dragonPayBaseReqDto.setDeviceFrom(deviceFrom); dragonPayBaseReqDto.setDeviceFrom(deviceFrom);
if(deviceFrom.equals("appletb")){ WepayAppletPaySupport.applyAppletDeviceFrom(dragonPayBaseReqDto);
dragonPayBaseReqDto.setDeviceFrom("applet");
dragonPayBaseReqDto.setAppIdType("b");
}
dragonPayBaseReqDto.setOpenId(openId); dragonPayBaseReqDto.setOpenId(openId);
dragonPayBaseReqDto.setType(type); dragonPayBaseReqDto.setType(type);
dragonPayBaseReqDto.setPrice(price); dragonPayBaseReqDto.setPrice(price);
......
...@@ -4,6 +4,7 @@ import com.liquidnet.commons.lang.util.StringUtil; ...@@ -4,6 +4,7 @@ import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.dragon.dto.DragonPayBaseReqDto; import com.liquidnet.service.dragon.dto.DragonPayBaseReqDto;
import com.liquidnet.service.dragon.dto.DragonPayBaseRespDto; import com.liquidnet.service.dragon.dto.DragonPayBaseRespDto;
import com.liquidnet.service.dragon.doc.DragonPaySwaggerDoc;
import com.liquidnet.service.dragon.service.IDragonOrdersService; import com.liquidnet.service.dragon.service.IDragonOrdersService;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
...@@ -52,7 +53,7 @@ public class PayNotifyController { ...@@ -52,7 +53,7 @@ public class PayNotifyController {
@ApiResponse(code = 200, message = "接口返回对象参数") @ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "payType", value = "支付类型:alipay,wepay,unionpay,applepay", example = "unionpay"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "payType", value = "支付类型:alipay,wepay,unionpay,applepay", example = "unionpay"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "deviceFrom", value = "设备来源:web,wap,app,js,apple,micropay,inner", example = "wap"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "deviceFrom", value = DragonPaySwaggerDoc.DEVICE_FROM_VALUE, allowableValues = DragonPaySwaggerDoc.DEVICE_FROM_ALLOWABLE, example = "applet"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "type", value = "业务类型:TICKET,PRODUCT,COST,MBEANS,LIVE,VIDEO,VIP,CLUB,STRAWBERRY", example = "TICKET"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "type", value = "业务类型:TICKET,PRODUCT,COST,MBEANS,LIVE,VIDEO,VIP,CLUB,STRAWBERRY", example = "TICKET"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "price", value = "支付金额", example = "0.1"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "price", value = "支付金额", example = "0.1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "name", value = "订单名称", example = "测试订单001"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "name", value = "订单名称", example = "测试订单001"),
......
...@@ -24,6 +24,8 @@ import com.liquidnet.service.dragon.constant.DragonConstant; ...@@ -24,6 +24,8 @@ import com.liquidnet.service.dragon.constant.DragonConstant;
import com.liquidnet.service.dragon.constant.DragonErrorCodeEnum; import com.liquidnet.service.dragon.constant.DragonErrorCodeEnum;
import com.liquidnet.service.dragon.dto.*; import com.liquidnet.service.dragon.dto.*;
import com.liquidnet.service.dragon.service.IDragonOrderRefundsService; import com.liquidnet.service.dragon.service.IDragonOrderRefundsService;
import com.liquidnet.service.dragon.config.WepayAppletPayConfigure;
import com.liquidnet.service.dragon.support.WepayAppletPaySupport;
import com.liquidnet.service.dragon.utils.*; import com.liquidnet.service.dragon.utils.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpEntity; import org.apache.http.HttpEntity;
...@@ -92,7 +94,9 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService ...@@ -92,7 +94,9 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
String localDouYinCallBackUrl = url + "/refund/callBack/douyinpay"; String localDouYinCallBackUrl = url + "/refund/callBack/douyinpay";
String localUnionPayCallBackUrl = url + "/refund/callBack/union"; String localUnionPayCallBackUrl = url + "/refund/callBack/union";
if (insertResult) { if (insertResult) {
switch (paymentType) { if (WepayAppletPaySupport.isAppletWechatPaymentType(paymentType)) {
dto = weyPayRefund(code, orderRefundCode, code, reason, price, priceTotal, paymentId, paymentType, localWePayCallBackUrl, nowTime);
} else switch (paymentType) {
case DragonConstant.REFUND_TYPE_APP_ALIPAY: case DragonConstant.REFUND_TYPE_APP_ALIPAY:
dto = aliPayRefund(code, orderRefundCode, code, reason, price, paymentId, paymentType, nowTime); dto = aliPayRefund(code, orderRefundCode, code, reason, price, paymentId, paymentType, nowTime);
break; break;
...@@ -123,12 +127,6 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService ...@@ -123,12 +127,6 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
case DragonConstant.REFUND_TYPE_MICROPAY_WEPAY: case DragonConstant.REFUND_TYPE_MICROPAY_WEPAY:
dto = weyPayRefund(code, orderRefundCode, code, reason, price, priceTotal, paymentId, paymentType, localWePayCallBackUrl, nowTime); dto = weyPayRefund(code, orderRefundCode, code, reason, price, priceTotal, paymentId, paymentType, localWePayCallBackUrl, nowTime);
break; break;
case DragonConstant.REFUND_TYPE_APPLET_WEPAY:
dto = weyPayRefund(code, orderRefundCode, code, reason, price, priceTotal, paymentId, paymentType, localWePayCallBackUrl, nowTime);
break;
case DragonConstant.REFUND_TYPE_APPLETB_WEPAY:
dto = weyPayRefund(code, orderRefundCode, code, reason, price, priceTotal, paymentId, paymentType, localWePayCallBackUrl, nowTime);
break;
case DragonConstant.REFUND_TYPE_APPLET_DOUYIN: case DragonConstant.REFUND_TYPE_APPLET_DOUYIN:
dataUtilsDragon.setOrderCode(orderRefundCode, orderCode); dataUtilsDragon.setOrderCode(orderRefundCode, orderCode);
dto = douYinRefund(code, orderRefundCode, code, reason, price, priceTotal, paymentId, paymentType, localDouYinCallBackUrl, nowTime); dto = douYinRefund(code, orderRefundCode, code, reason, price, priceTotal, paymentId, paymentType, localDouYinCallBackUrl, nowTime);
...@@ -420,12 +418,12 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService ...@@ -420,12 +418,12 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
parameters.put("appid", PayWepayUtils.getInstance().getWEB_APP_ID()); parameters.put("appid", PayWepayUtils.getInstance().getWEB_APP_ID());
} else if (paymentType.equalsIgnoreCase(DragonConstant.PayTypeEnum.PAYMENT_TYPE_APP_WEPAY.getCode())) { } else if (paymentType.equalsIgnoreCase(DragonConstant.PayTypeEnum.PAYMENT_TYPE_APP_WEPAY.getCode())) {
parameters.put("appid", PayWepayUtils.getInstance().getAPP_ID()); parameters.put("appid", PayWepayUtils.getInstance().getAPP_ID());
} else if(paymentType.equalsIgnoreCase(DragonConstant.PayTypeEnum.PAYMENT_TYPE_APPLET_WEPAY.getCode()) && code.contains("PAYB")){ } else if (WepayAppletPaySupport.isAppletWechatPaymentType(paymentType)) {
parameters.put("appid", PayWepayUtils.getInstance().getAPPLETB_APPID()); parameters.put("appid", WepayAppletPayConfigure.resolveAppletAppIdForTradeQuery(paymentType, code));
parameters.put("mch_id", PayWepayUtils.getInstance().getMerchantBId()); if (WepayAppletPaySupport.usesMerchantBByPaymentType(paymentType)) {
type = 1; parameters.put("mch_id", PayWepayUtils.getInstance().getMerchantBId());
}else if (paymentType.equalsIgnoreCase(DragonConstant.PayTypeEnum.PAYMENT_TYPE_APPLET_WEPAY.getCode())) { type = 1;
parameters.put("appid", PayWepayUtils.getInstance().getAPPLET_APP_ID()); }
} else if (paymentType.equalsIgnoreCase(DragonConstant.PayTypeEnum.PAYMENT_TYPE_WAP_WEPAY.getCode())) { } else if (paymentType.equalsIgnoreCase(DragonConstant.PayTypeEnum.PAYMENT_TYPE_WAP_WEPAY.getCode())) {
parameters.put("appid", PayWepayUtils.getInstance().getWAP_APP_ID()); parameters.put("appid", PayWepayUtils.getInstance().getWAP_APP_ID());
}else if(paymentType.equalsIgnoreCase(DragonConstant.PayTypeEnum.PAYMENT_TYPE_MICROPAY_WEPAY.getCode())){ }else if(paymentType.equalsIgnoreCase(DragonConstant.PayTypeEnum.PAYMENT_TYPE_MICROPAY_WEPAY.getCode())){
......
...@@ -17,6 +17,7 @@ import com.liquidnet.service.dragon.dto.DragonPayBaseReqDto; ...@@ -17,6 +17,7 @@ import com.liquidnet.service.dragon.dto.DragonPayBaseReqDto;
import com.liquidnet.service.dragon.dto.DragonPayBaseRespDto; import com.liquidnet.service.dragon.dto.DragonPayBaseRespDto;
import com.liquidnet.service.dragon.dto.DragonPayOrderQueryRespDto; import com.liquidnet.service.dragon.dto.DragonPayOrderQueryRespDto;
import com.liquidnet.service.dragon.service.IDragonOrdersService; import com.liquidnet.service.dragon.service.IDragonOrdersService;
import com.liquidnet.service.dragon.support.WepayAppletPaySupport;
import com.liquidnet.service.dragon.utils.ApplepayUtils; import com.liquidnet.service.dragon.utils.ApplepayUtils;
import com.liquidnet.service.dragon.utils.DataUtilsDragon; import com.liquidnet.service.dragon.utils.DataUtilsDragon;
import com.liquidnet.service.dragon.utils.ObjectUtilDragon; import com.liquidnet.service.dragon.utils.ObjectUtilDragon;
...@@ -66,12 +67,10 @@ public class DragonOrdersServiceImpl implements IDragonOrdersService { ...@@ -66,12 +67,10 @@ public class DragonOrdersServiceImpl implements IDragonOrdersService {
if(!(boolean)map.get("resultStatus")){ if(!(boolean)map.get("resultStatus")){
return ResponseDto.failure(map.get("erro").toString()); return ResponseDto.failure(map.get("erro").toString());
} }
//设置支付编号 WepayAppletPaySupport.applyAppletDeviceFrom(dragonPayBaseReqDto);
if(dragonPayBaseReqDto.getDeviceFrom().equals("appletb")){ if (WepayAppletPaySupport.APP_ID_TYPE_B.equals(dragonPayBaseReqDto.getAppIdType())) {
dragonPayBaseReqDto.setDeviceFrom("applet");
dragonPayBaseReqDto.setAppIdType("b");
dragonPayBaseReqDto.setCode(IDGenerator.payCodeByType()); dragonPayBaseReqDto.setCode(IDGenerator.payCodeByType());
}else{ } else {
dragonPayBaseReqDto.setCode(IDGenerator.payCode()); dragonPayBaseReqDto.setCode(IDGenerator.payCode());
} }
log.info("dragon:dragonPay:req:dragonPayBaseReqDto : {}",dragonPayBaseReqDto.toString()); log.info("dragon:dragonPay:req:dragonPayBaseReqDto : {}",dragonPayBaseReqDto.toString());
...@@ -80,7 +79,7 @@ public class DragonOrdersServiceImpl implements IDragonOrdersService { ...@@ -80,7 +79,7 @@ public class DragonOrdersServiceImpl implements IDragonOrdersService {
public Map validateDragonPay(DragonPayBaseReqDto dragonPayBaseReqDto){ public Map validateDragonPay(DragonPayBaseReqDto dragonPayBaseReqDto){
HashMap<String, Object> map= ObjectUtilDragon.cloneHashMapStringAndObj(); HashMap<String, Object> map= ObjectUtilDragon.cloneHashMapStringAndObj();
if (dragonPayBaseReqDto.getPayType().equalsIgnoreCase(DragonConstant.PayChannelEnum.WEPAY.getCode())) { if (dragonPayBaseReqDto.getPayType().equalsIgnoreCase(DragonConstant.PayChannelEnum.WEPAY.getCode())) {
if (dragonPayBaseReqDto.getDeviceFrom().equalsIgnoreCase(DragonConstant.DeviceFromEnum.JS.getCode()) || dragonPayBaseReqDto.getDeviceFrom().equalsIgnoreCase(DragonConstant.DeviceFromEnum.APPLET.getCode()) ||dragonPayBaseReqDto.getDeviceFrom().equalsIgnoreCase(DragonConstant.DeviceFromEnum.APPLETB.getCode()) ) { if (WepayAppletPaySupport.requiresWechatOpenId(dragonPayBaseReqDto.getDeviceFrom())) {
if (StringUtil.isEmpty(dragonPayBaseReqDto.getOpenId())) { if (StringUtil.isEmpty(dragonPayBaseReqDto.getOpenId())) {
map.put("resultStatus",false); map.put("resultStatus",false);
map.put("erro","微信支付openId不能为空!"); map.put("erro","微信支付openId不能为空!");
...@@ -122,8 +121,12 @@ public class DragonOrdersServiceImpl implements IDragonOrdersService { ...@@ -122,8 +121,12 @@ public class DragonOrdersServiceImpl implements IDragonOrdersService {
return dragonPayBiz.buildPayOrderQueryRespDto(ordersDto); return dragonPayBiz.buildPayOrderQueryRespDto(ordersDto);
} }
//如果未支付进行三方查询` //如果未支付进行三方查询`
String payType = DragonConstant.PayTypeEnum.getEnumByCode(ordersDto.getPaymentType()).getPayType(); DragonConstant.PayTypeEnum payTypeEnum = DragonConstant.PayTypeEnum.getEnumByCode(ordersDto.getPaymentType());
return payChannelStrategyContext.getStrategy(payType).checkOrderStatus(code); if (payTypeEnum == null) {
throw new LiquidnetServiceException(DragonErrorCodeEnum.TRADE_ERROR_NOT_EXISTS.getCode(),
"不支持的支付类型: " + ordersDto.getPaymentType());
}
return payChannelStrategyContext.getStrategy(payTypeEnum.getPayType()).checkOrderStatus(code);
} }
@Override @Override
......
...@@ -9,6 +9,7 @@ import com.liquidnet.service.goblin.param.GoblinNftOrderPayAgainParam; ...@@ -9,6 +9,7 @@ import com.liquidnet.service.goblin.param.GoblinNftOrderPayAgainParam;
import com.liquidnet.service.goblin.param.GoblinNftOrderPayCallbackParam; import com.liquidnet.service.goblin.param.GoblinNftOrderPayCallbackParam;
import com.liquidnet.service.goblin.param.GoblinNftOrderPayParam; import com.liquidnet.service.goblin.param.GoblinNftOrderPayParam;
import com.liquidnet.service.goblin.param.GoblinNftOrderRefundCallbackParam; import com.liquidnet.service.goblin.param.GoblinNftOrderRefundCallbackParam;
import com.liquidnet.service.dragon.doc.DragonPaySwaggerDoc;
import com.liquidnet.service.goblin.service.IGoblinNftOrderService; import com.liquidnet.service.goblin.service.IGoblinNftOrderService;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -87,7 +88,7 @@ public class GoblinNftOrderController { ...@@ -87,7 +88,7 @@ public class GoblinNftOrderController {
@ApiOperation("兑换") @ApiOperation("兑换")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "from", required = true, dataType = "String", name = "code", value = "兑换码", example = "1"), @ApiImplicitParam(type = "from", required = true, dataType = "String", name = "code", value = "兑换码", example = "1"),
@ApiImplicitParam(type = "from", required = true, dataType = "String", name = "deviceFrom", value = "支付终端", example = "app", allowableValues = "app,wap,js,applet"), @ApiImplicitParam(type = "from", required = true, dataType = "String", name = "deviceFrom", value = DragonPaySwaggerDoc.DEVICE_FROM_VALUE, example = "applet", allowableValues = DragonPaySwaggerDoc.DEVICE_FROM_ALLOWABLE),
}) })
public ResponseDto<Boolean> exchange( public ResponseDto<Boolean> exchange(
@RequestParam("code") @NotBlank(message = "兑换码不能为空") String code, @RequestParam("code") @NotBlank(message = "兑换码不能为空") String code,
......
...@@ -475,7 +475,7 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService { ...@@ -475,7 +475,7 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
httpData.add("expireTime", "5"); httpData.add("expireTime", "5");
httpData.add("payType", nftOrder.getPayType()); httpData.add("payType", nftOrder.getPayType());
httpData.add("deviceFrom", nftOrder.getDeviceFrom()); httpData.add("deviceFrom", nftOrder.getDeviceFrom());
if (nftOrder.getDeviceFrom().equals("js") || nftOrder.getDeviceFrom().equals("applet") || nftOrder.getDeviceFrom().equals("appletb")) { if (com.liquidnet.service.dragon.support.WepayAppletPaySupport.requiresWechatOpenId(nftOrder.getDeviceFrom())) {
httpData.add("openId", payParam.getOpenId()); httpData.add("openId", payParam.getOpenId());
} }
httpData.add("showUrl", showUrl); httpData.add("showUrl", showUrl);
......
...@@ -515,6 +515,13 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -515,6 +515,13 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
storeOrder.setPayType(param.getPayType()); storeOrder.setPayType(param.getPayType());
storeOrder.setDeviceFrom(param.getDeviceFrom()); storeOrder.setDeviceFrom(param.getDeviceFrom());
storeOrder.setSource(source); storeOrder.setSource(source);
if (StringUtils.isNotBlank(param.getReferrerApp()) && StringUtils.isNotBlank(param.getReferrerUserId())) {
storeOrder.setOrderSource(param.getReferrerApp());
storeOrder.setReferrerUserId(param.getReferrerUserId());
} else {
storeOrder.setOrderSource("");
storeOrder.setReferrerUserId("");
}
storeOrder.setVersion(version); storeOrder.setVersion(version);
storeOrder.setIsMember(isMember ? 1 : 0); storeOrder.setIsMember(isMember ? 1 : 0);
storeOrder.setOrderType(0); storeOrder.setOrderType(0);
...@@ -573,7 +580,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -573,7 +580,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
DragonPayBaseReqDto dragonPayBaseReqDto = DragonPayBaseReqDto.getNew(); DragonPayBaseReqDto dragonPayBaseReqDto = DragonPayBaseReqDto.getNew();
dragonPayBaseReqDto.setPayType(preParam.getPayType()); dragonPayBaseReqDto.setPayType(preParam.getPayType());
dragonPayBaseReqDto.setDeviceFrom(preParam.getDeviceFrom()); dragonPayBaseReqDto.setDeviceFrom(preParam.getDeviceFrom());
if (preParam.getDeviceFrom().equals("js") || preParam.getDeviceFrom().equals("applet") || preParam.getDeviceFrom().equals("appletb")) { if (com.liquidnet.service.dragon.support.WepayAppletPaySupport.requiresWechatOpenId(preParam.getDeviceFrom())) {
dragonPayBaseReqDto.setOpenId(preParam.getOpenId()); dragonPayBaseReqDto.setOpenId(preParam.getOpenId());
} }
dragonPayBaseReqDto.setType("PRODUCT"); dragonPayBaseReqDto.setType("PRODUCT");
...@@ -763,7 +770,10 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -763,7 +770,10 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
sqlDataOrder.add(new Object[]{ sqlDataOrder.add(new Object[]{
storeOrder.getMasterOrderCode(), storeOrder.getOrderId(), storeOrder.getStoreId(), storeOrder.getStoreName(), storeOrder.getOrderCode(), storeOrder.getUserId(), storeOrder.getUserName(), storeOrder.getUserMobile(), storeOrder.getPriceTotal(), storeOrder.getPayCode(), storeOrder.getMasterOrderCode(), storeOrder.getOrderId(), storeOrder.getStoreId(), storeOrder.getStoreName(), storeOrder.getOrderCode(), storeOrder.getUserId(), storeOrder.getUserName(), storeOrder.getUserMobile(), storeOrder.getPriceTotal(), storeOrder.getPayCode(),
storeOrder.getPriceActual(), storeOrder.getPriceRefund(), storeOrder.getPriceExpress(), storeOrder.getPriceCoupon(), storeOrder.getStorePriceCoupon(), storeOrder.getPriceVoucher(), storeOrder.getStatus(), storeOrder.getUcouponId(), storeOrder.getStoreCouponId(), storeOrder.getPayType(), storeOrder.getDeviceFrom(), storeOrder.getPriceActual(), storeOrder.getPriceRefund(), storeOrder.getPriceExpress(), storeOrder.getPriceCoupon(), storeOrder.getStorePriceCoupon(), storeOrder.getPriceVoucher(), storeOrder.getStatus(), storeOrder.getUcouponId(), storeOrder.getStoreCouponId(), storeOrder.getPayType(), storeOrder.getDeviceFrom(),
storeOrder.getSource(), storeOrder.getVersion(), storeOrder.getIsMember(), storeOrder.getOrderType(), storeOrder.getWriteOffCode(), storeOrder.getPayCountdownMinute(), storeOrder.getIpAddress(), storeOrder.getMarketId(), storeOrder.getMarketType(), storeOrder.getCreatedAt(), "", "" storeOrder.getSource() == null ? "" : storeOrder.getSource(),
storeOrder.getOrderSource() == null ? "" : storeOrder.getOrderSource(),
storeOrder.getReferrerUserId() == null ? "" : storeOrder.getReferrerUserId(),
storeOrder.getVersion(), storeOrder.getIsMember(), storeOrder.getOrderType(), storeOrder.getWriteOffCode(), storeOrder.getPayCountdownMinute(), storeOrder.getIpAddress(), storeOrder.getMarketId(), storeOrder.getMarketType(), storeOrder.getCreatedAt(), "", ""
}); });
GoblinOrderAttr orderAttr = item.getOrderAttr(); GoblinOrderAttr orderAttr = item.getOrderAttr();
sqlDataAttr.add(new Object[]{ sqlDataAttr.add(new Object[]{
...@@ -882,7 +892,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -882,7 +892,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
DragonPayBaseReqDto dragonPayBaseReqDto = DragonPayBaseReqDto.getNew(); DragonPayBaseReqDto dragonPayBaseReqDto = DragonPayBaseReqDto.getNew();
dragonPayBaseReqDto.setPayType(param.getPayType()); dragonPayBaseReqDto.setPayType(param.getPayType());
dragonPayBaseReqDto.setDeviceFrom(param.getDeviceFrom()); dragonPayBaseReqDto.setDeviceFrom(param.getDeviceFrom());
if (param.getDeviceFrom().equals("js") || param.getDeviceFrom().equals("applet") || param.getDeviceFrom().equals("appletb")) { if (com.liquidnet.service.dragon.support.WepayAppletPaySupport.requiresWechatOpenId(param.getDeviceFrom())) {
dragonPayBaseReqDto.setOpenId(param.getOpenId()); dragonPayBaseReqDto.setOpenId(param.getOpenId());
} }
dragonPayBaseReqDto.setType("PRODUCT"); dragonPayBaseReqDto.setType("PRODUCT");
...@@ -1468,4 +1478,5 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -1468,4 +1478,5 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
} }
return ""; return "";
} }
} }
...@@ -498,6 +498,13 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -498,6 +498,13 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
orderTickets.setQrCode(""); orderTickets.setQrCode("");
orderTickets.setOrderType(source); orderTickets.setOrderType(source);
orderTickets.setOrderVersion(version); orderTickets.setOrderVersion(version);
if (StringUtils.isNotBlank(payOrderParam.getReferrerApp()) && StringUtils.isNotBlank(payOrderParam.getReferrerUserId())) {
orderTickets.setOrderSource(payOrderParam.getReferrerApp());
orderTickets.setReferrerUserId(payOrderParam.getReferrerUserId());
} else {
orderTickets.setOrderSource("");
orderTickets.setReferrerUserId("");
}
orderTickets.setNumber(payOrderParam.getNumber()); orderTickets.setNumber(payOrderParam.getNumber());
orderTickets.setPrice(ticketData.getPrice()); orderTickets.setPrice(ticketData.getPrice());
orderTickets.setPriceMember(ticketData.getMemberPrice()); orderTickets.setPriceMember(ticketData.getMemberPrice());
...@@ -752,7 +759,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -752,7 +759,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
DragonPayBaseReqDto dragonPayBaseReqDto = DragonPayBaseReqDto.getNew(); DragonPayBaseReqDto dragonPayBaseReqDto = DragonPayBaseReqDto.getNew();
dragonPayBaseReqDto.setPayType(payOrderParam.getPayType()); dragonPayBaseReqDto.setPayType(payOrderParam.getPayType());
dragonPayBaseReqDto.setDeviceFrom(payOrderParam.getDeviceFrom()); dragonPayBaseReqDto.setDeviceFrom(payOrderParam.getDeviceFrom());
if (payOrderParam.getDeviceFrom().equals("js") || payOrderParam.getDeviceFrom().equals("applet") || payOrderParam.getDeviceFrom().equals("appletb")) { if (com.liquidnet.service.dragon.support.WepayAppletPaySupport.requiresWechatOpenId(payOrderParam.getDeviceFrom())) {
dragonPayBaseReqDto.setOpenId(payOrderParam.getOpenId()); dragonPayBaseReqDto.setOpenId(payOrderParam.getOpenId());
} }
dragonPayBaseReqDto.setType("TICKET"); dragonPayBaseReqDto.setType("TICKET");
...@@ -884,7 +891,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -884,7 +891,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
DragonPayBaseReqDto dragonPayBaseReqDto = DragonPayBaseReqDto.getNew(); DragonPayBaseReqDto dragonPayBaseReqDto = DragonPayBaseReqDto.getNew();
dragonPayBaseReqDto.setPayType(payAgainParam.getPayType()); dragonPayBaseReqDto.setPayType(payAgainParam.getPayType());
dragonPayBaseReqDto.setDeviceFrom(payAgainParam.getDeviceFrom()); dragonPayBaseReqDto.setDeviceFrom(payAgainParam.getDeviceFrom());
if (payAgainParam.getDeviceFrom().equals("js") || payAgainParam.getDeviceFrom().equals("applet") || payAgainParam.getDeviceFrom().equals("appletb")) { if (com.liquidnet.service.dragon.support.WepayAppletPaySupport.requiresWechatOpenId(payAgainParam.getDeviceFrom())) {
dragonPayBaseReqDto.setOpenId(payAgainParam.getOpenId()); dragonPayBaseReqDto.setOpenId(payAgainParam.getOpenId());
} }
dragonPayBaseReqDto.setType("TICKET"); dragonPayBaseReqDto.setType("TICKET");
...@@ -1351,4 +1358,5 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -1351,4 +1358,5 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
return false; return false;
} }
} }
} }
...@@ -4,7 +4,7 @@ kylin_lack_register.insert=INSERT INTO `kylin_lack_registers`(`lack_registers_id ...@@ -4,7 +4,7 @@ kylin_lack_register.insert=INSERT INTO `kylin_lack_registers`(`lack_registers_id
# ------------------------PV/UV---------------------------- # ------------------------PV/UV----------------------------
bi_ticket_access_records.insert=INSERT INTO `bi_ticket_access_records` ( `user_id`, `access_type`, `performance_id`, `order_id`, `order_code`,`ip_address`, `area`, `area_province`, `area_city`, `area_county`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?); bi_ticket_access_records.insert=INSERT INTO `bi_ticket_access_records` ( `user_id`, `access_type`, `performance_id`, `order_id`, `order_code`,`ip_address`, `area`, `area_province`, `area_city`, `area_county`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?);
# ------------------------\u521B\u5EFA\u8BA2\u5355---------------------------- # ------------------------\u521B\u5EFA\u8BA2\u5355----------------------------
kylin_order_ticket.add=INSERT INTO kylin_order_tickets(order_tickets_id,user_id,user_name,user_mobile,performance_title,order_code,qr_code,order_type,order_version,`number`,price,price_member,price_total,price_voucher,price_actual,price_express,price_refund,refund_number,pay_type,payment_type,time_pay,express_contacts,express_address,express_phone,coupon_type,get_ticket_type,get_ticket_describe,pay_countdown_minute,`comment`,created_at,updated_at,pay_code,ip_address,area,area_province,area_city,area_county)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) kylin_order_ticket.add=INSERT INTO kylin_order_tickets(order_tickets_id,user_id,user_name,user_mobile,performance_title,order_code,qr_code,order_type,order_version,order_source,referrer_user_id,`number`,price,price_member,price_total,price_voucher,price_actual,price_express,price_refund,refund_number,pay_type,payment_type,time_pay,express_contacts,express_address,express_phone,coupon_type,get_ticket_type,get_ticket_describe,pay_countdown_minute,`comment`,created_at,updated_at,pay_code,ip_address,area,area_province,area_city,area_county)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
kylin_order_ticket_relation.add=INSERT INTO kylin_order_ticket_relations(order_ticket_relations_id ,order_id ,transfer_id ,live_id ,agent_id ,is_member ,performance_id ,time_id ,ticket_id ,created_at ,updated_at,agent_status,agent_distributions,agent_id_master,agent_distributions_master)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) kylin_order_ticket_relation.add=INSERT INTO kylin_order_ticket_relations(order_ticket_relations_id ,order_id ,transfer_id ,live_id ,agent_id ,is_member ,performance_id ,time_id ,ticket_id ,created_at ,updated_at,agent_status,agent_distributions,agent_id_master,agent_distributions_master)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
kylin_order_ticket_status.add=INSERT INTO kylin_order_ticket_status(order_ticket_status_id ,order_id ,express_type ,is_student ,transfer_status ,`status` ,pay_status , produce_code ,created_at ,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?) kylin_order_ticket_status.add=INSERT INTO kylin_order_ticket_status(order_ticket_status_id ,order_id ,express_type ,is_student ,transfer_status ,`status` ,pay_status , produce_code ,created_at ,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?)
kylin_order_ticket_entities.add=INSERT INTO kylin_order_ticket_entities(order_ticket_entities_id ,order_id ,ticket_id ,user_id ,time_id ,performance_id ,enter_type ,enter_name ,enter_mobile,enter_id_code,`status`,sys_damai,check_client,is_payment,`comment`,created_at,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) kylin_order_ticket_entities.add=INSERT INTO kylin_order_ticket_entities(order_ticket_entities_id ,order_id ,ticket_id ,user_id ,time_id ,performance_id ,enter_type ,enter_name ,enter_mobile,enter_id_code,`status`,sys_damai,check_client,is_payment,`comment`,created_at,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
...@@ -30,7 +30,7 @@ kylin_order_refund_entities.overtimeRefund=INSERT INTO kylin_order_refund_entiti ...@@ -30,7 +30,7 @@ kylin_order_refund_entities.overtimeRefund=INSERT INTO kylin_order_refund_entiti
#-------- \u5546\u57CE ------- #-------- \u5546\u57CE -------
goblin.order.create.order_insert=INSERT INTO goblin_store_order (`master_order_code`,`order_id`,`store_id`,`store_name`,`order_code`,`user_id`,`user_name`,`user_mobile`,`price_total`,`pay_code`,`price_actual`,`price_refund`,`price_express`,`price_coupon`,`store_price_coupon`,`price_voucher`,`status`,`ucoupon_id`,`store_coupon_id`,`pay_type`,`device_from`,`source`,`version`,`is_member`,`order_type`,`write_off_code`,`pay_countdown_minute`,`ip_address`,`market_id`,`market_type`,`created_at`,`mix_id`,`mix_code`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) goblin.order.create.order_insert=INSERT INTO goblin_store_order (`master_order_code`,`order_id`,`store_id`,`store_name`,`order_code`,`user_id`,`user_name`,`user_mobile`,`price_total`,`pay_code`,`price_actual`,`price_refund`,`price_express`,`price_coupon`,`store_price_coupon`,`price_voucher`,`status`,`ucoupon_id`,`store_coupon_id`,`pay_type`,`device_from`,`source`,`order_source`,`referrer_user_id`,`version`,`is_member`,`order_type`,`write_off_code`,`pay_countdown_minute`,`ip_address`,`market_id`,`market_type`,`created_at`,`mix_id`,`mix_code`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
goblin.order.create.attr_insert=INSERT INTO goblin_order_attr (`order_attr_id`,`order_id`,`express_contacts`,`express_address`,`express_address_detail`,`express_phone`,`express_type`,`created_at`) VALUES (?,?,?,?,?,?,?,?) goblin.order.create.attr_insert=INSERT INTO goblin_order_attr (`order_attr_id`,`order_id`,`express_contacts`,`express_address`,`express_address_detail`,`express_phone`,`express_type`,`created_at`) VALUES (?,?,?,?,?,?,?,?)
goblin.order.create.sku_insert=INSERT INTO goblin_order_sku (`order_sku_id`,`order_id`,`spu_id`,`spu_name`,`spu_pic`,`sku_id`,`num`,`sku_price`,`sku_price_actual`,`sku_name`,`sku_no`,`sku_image`,`sku_specs`,`price_voucher`,`spu_erp_code`,`sku_erp_code`,`erp_type`,`erp_warehouse_no`,`erp_hosting`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) goblin.order.create.sku_insert=INSERT INTO goblin_order_sku (`order_sku_id`,`order_id`,`spu_id`,`spu_name`,`spu_pic`,`sku_id`,`num`,`sku_price`,`sku_price_actual`,`sku_name`,`sku_no`,`sku_image`,`sku_specs`,`price_voucher`,`spu_erp_code`,`sku_erp_code`,`erp_type`,`erp_warehouse_no`,`erp_hosting`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
# \u6536\u94B1\u5427\u6269\u5C55\u8868\uff08\u4e0e goblin \u670d\u52a1 sqlmap \u4e00\u81f4\uff09 # \u6536\u94B1\u5427\u6269\u5C55\u8868\uff08\u4e0e goblin \u670d\u52a1 sqlmap \u4e00\u81f4\uff09
......
...@@ -41,6 +41,15 @@ public class WechatMaConfigure { ...@@ -41,6 +41,15 @@ public class WechatMaConfigure {
private static String appletAppidModern; private static String appletAppidModern;
private static String appletSecretModern; private static String appletSecretModern;
private static String appletAppidDoudou;
private static String appletSecretDoudou;
private static String appletAppidMootoo;
private static String appletSecretMootoo;
private static String appletAppidWenque;
private static String appletSecretWenque;
@Value("${liquidnet.wechat.applet.strawberry.appid}") @Value("${liquidnet.wechat.applet.strawberry.appid}")
public void setAppletAppidStrawberry(String appletAppidStrawberry) { public void setAppletAppidStrawberry(String appletAppidStrawberry) {
WechatMaConfigure.appletAppidStrawberry = appletAppidStrawberry; WechatMaConfigure.appletAppidStrawberry = appletAppidStrawberry;
...@@ -104,6 +113,33 @@ public class WechatMaConfigure { ...@@ -104,6 +113,33 @@ public class WechatMaConfigure {
WechatMaConfigure.appletSecretModern = appletSecretModern; WechatMaConfigure.appletSecretModern = appletSecretModern;
} }
@Value("${liquidnet.wechat.applet.doudou.appid}")
public void setAppletAppidDoudou(String appletAppidDoudou) {
WechatMaConfigure.appletAppidDoudou = appletAppidDoudou;
}
@Value("${liquidnet.wechat.applet.doudou.secret}")
public void setAppletSecretDoudou(String appletSecretDoudou) {
WechatMaConfigure.appletSecretDoudou = appletSecretDoudou;
}
@Value("${liquidnet.wechat.applet.mootoo.appid}")
public void setAppletAppidMootoo(String appletAppidMootoo) {
WechatMaConfigure.appletAppidMootoo = appletAppidMootoo;
}
@Value("${liquidnet.wechat.applet.mootoo.secret}")
public void setAppletSecretMootoo(String appletSecretMootoo) {
WechatMaConfigure.appletSecretMootoo = appletSecretMootoo;
}
@Value("${liquidnet.wechat.applet.wenque.appid}")
public void setAppletAppidWenque(String appletAppidWenque) {
WechatMaConfigure.appletAppidWenque = appletAppidWenque;
}
@Value("${liquidnet.wechat.applet.wenque.secret}")
public void setAppletSecretWenque(String appletSecretWenque) {
WechatMaConfigure.appletSecretWenque = appletSecretWenque;
}
private WxMaService wxMaAppletStrawberryService; private WxMaService wxMaAppletStrawberryService;
private WxMaService wxMaAppletFiveService; private WxMaService wxMaAppletFiveService;
private WxMaService wxMaAppletMdskService; private WxMaService wxMaAppletMdskService;
...@@ -111,6 +147,9 @@ public class WechatMaConfigure { ...@@ -111,6 +147,9 @@ public class WechatMaConfigure {
private WxMaService wxMaAppletAirshipService; private WxMaService wxMaAppletAirshipService;
private WxMaService wxMaAppletSmileService; private WxMaService wxMaAppletSmileService;
private WxMaService wxMaAppletModernService; private WxMaService wxMaAppletModernService;
private WxMaService wxMaAppletDoudouService;
private WxMaService wxMaAppletMootooService;
private WxMaService wxMaAppletWenqueService;
private WxMaMessageRouter wxMaStrawberryMessageRouter; private WxMaMessageRouter wxMaStrawberryMessageRouter;
private WxMaMessageRouter wxMaFiveMessageRouter; private WxMaMessageRouter wxMaFiveMessageRouter;
...@@ -119,6 +158,9 @@ public class WechatMaConfigure { ...@@ -119,6 +158,9 @@ public class WechatMaConfigure {
private WxMaMessageRouter wxMaAirshipMessageRouter; private WxMaMessageRouter wxMaAirshipMessageRouter;
private WxMaMessageRouter wxMaSmileMessageRouter; private WxMaMessageRouter wxMaSmileMessageRouter;
private WxMaMessageRouter wxMaModernMessageRouter; private WxMaMessageRouter wxMaModernMessageRouter;
private WxMaMessageRouter wxMaDoudouMessageRouter;
private WxMaMessageRouter wxMaMootooMessageRouter;
private WxMaMessageRouter wxMaWenqueMessageRouter;
@Autowired @Autowired
private StringRedisTemplate stringRedisTemplate; private StringRedisTemplate stringRedisTemplate;
...@@ -208,6 +250,39 @@ public class WechatMaConfigure { ...@@ -208,6 +250,39 @@ public class WechatMaConfigure {
this.setWxMaConfig(wxMaDefaultConfig); this.setWxMaConfig(wxMaDefaultConfig);
} }
}; };
wxMaAppletDoudouService = new WxMaServiceImpl() {
{
RedisTemplateWxRedisOps redisTemplateWxRedisOps = new RedisTemplateWxRedisOps(stringRedisTemplate);
WxMaRedisBetterConfigImpl wxMaDefaultConfig = new WxMaRedisBetterConfigImpl(redisTemplateWxRedisOps, "sweet:accessToken:applet:doudou");
wxMaDefaultConfig.setAppid(appletAppidDoudou);
wxMaDefaultConfig.setSecret(appletSecretDoudou);
wxMaDefaultConfig.setMsgDataFormat("JSON");
this.setWxMaConfig(wxMaDefaultConfig);
}
};
wxMaAppletMootooService = new WxMaServiceImpl() {
{
RedisTemplateWxRedisOps redisTemplateWxRedisOps = new RedisTemplateWxRedisOps(stringRedisTemplate);
WxMaRedisBetterConfigImpl wxMaDefaultConfig = new WxMaRedisBetterConfigImpl(redisTemplateWxRedisOps, "sweet:accessToken:applet:mootoo");
wxMaDefaultConfig.setAppid(appletAppidMootoo);
wxMaDefaultConfig.setSecret(appletSecretMootoo);
wxMaDefaultConfig.setMsgDataFormat("JSON");
this.setWxMaConfig(wxMaDefaultConfig);
}
};
wxMaAppletWenqueService = new WxMaServiceImpl() {
{
RedisTemplateWxRedisOps redisTemplateWxRedisOps = new RedisTemplateWxRedisOps(stringRedisTemplate);
WxMaRedisBetterConfigImpl wxMaDefaultConfig = new WxMaRedisBetterConfigImpl(redisTemplateWxRedisOps, "sweet:accessToken:applet:wenque");
wxMaDefaultConfig.setAppid(appletAppidWenque);
wxMaDefaultConfig.setSecret(appletSecretWenque);
wxMaDefaultConfig.setMsgDataFormat("JSON");
this.setWxMaConfig(wxMaDefaultConfig);
}
};
wxMaStrawberryMessageRouter = new WxMaMessageRouter(wxMaAppletStrawberryService); wxMaStrawberryMessageRouter = new WxMaMessageRouter(wxMaAppletStrawberryService);
wxMaFiveMessageRouter = new WxMaMessageRouter(wxMaAppletFiveService); wxMaFiveMessageRouter = new WxMaMessageRouter(wxMaAppletFiveService);
wxMaMdskMessageRouter = new WxMaMessageRouter(wxMaAppletMdskService); wxMaMdskMessageRouter = new WxMaMessageRouter(wxMaAppletMdskService);
...@@ -215,6 +290,9 @@ public class WechatMaConfigure { ...@@ -215,6 +290,9 @@ public class WechatMaConfigure {
wxMaAirshipMessageRouter = new WxMaMessageRouter(wxMaAppletAirshipService); wxMaAirshipMessageRouter = new WxMaMessageRouter(wxMaAppletAirshipService);
wxMaSmileMessageRouter = new WxMaMessageRouter(wxMaAppletSmileService); wxMaSmileMessageRouter = new WxMaMessageRouter(wxMaAppletSmileService);
wxMaModernMessageRouter = new WxMaMessageRouter(wxMaAppletModernService); wxMaModernMessageRouter = new WxMaMessageRouter(wxMaAppletModernService);
wxMaDoudouMessageRouter = new WxMaMessageRouter(wxMaAppletDoudouService);
wxMaMootooMessageRouter = new WxMaMessageRouter(wxMaAppletMootooService);
wxMaWenqueMessageRouter = new WxMaMessageRouter(wxMaAppletWenqueService);
} }
public WxMaService getWxMaService(Integer anum) { public WxMaService getWxMaService(Integer anum) {
...@@ -233,6 +311,12 @@ public class WechatMaConfigure { ...@@ -233,6 +311,12 @@ public class WechatMaConfigure {
return wxMaAppletSmileService; return wxMaAppletSmileService;
case 7: case 7:
return wxMaAppletModernService; return wxMaAppletModernService;
case 8:
return wxMaAppletDoudouService;
case 9:
return wxMaAppletMootooService;
case 10:
return wxMaAppletWenqueService;
} }
return null; return null;
} }
...@@ -253,6 +337,12 @@ public class WechatMaConfigure { ...@@ -253,6 +337,12 @@ public class WechatMaConfigure {
return appletAppidSmile; return appletAppidSmile;
case 7: case 7:
return appletAppidModern; return appletAppidModern;
case 8:
return appletAppidDoudou;
case 9:
return appletAppidMootoo;
case 10:
return appletAppidWenque;
} }
return ""; return "";
} }
...@@ -273,6 +363,12 @@ public class WechatMaConfigure { ...@@ -273,6 +363,12 @@ public class WechatMaConfigure {
return wxMaSmileMessageRouter; return wxMaSmileMessageRouter;
case 7: case 7:
return wxMaModernMessageRouter; return wxMaModernMessageRouter;
case 8:
return wxMaDoudouMessageRouter;
case 9:
return wxMaMootooMessageRouter;
case 10:
return wxMaWenqueMessageRouter;
} }
return null; return null;
} }
......
...@@ -32,7 +32,7 @@ public class SweetWechatLoginController { ...@@ -32,7 +32,7 @@ public class SweetWechatLoginController {
@ApiImplicitParam(type = "query", dataType = "String", name = "code", value = "获取手机号的 code", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "code", value = "获取手机号的 code", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "encryptedData", value = "encryptedData"), @ApiImplicitParam(type = "query", dataType = "String", name = "encryptedData", value = "encryptedData"),
@ApiImplicitParam(type = "query", dataType = "String", name = "iv", value = "iv"), @ApiImplicitParam(type = "query", dataType = "String", name = "iv", value = "iv"),
@ApiImplicitParam(type = "query", dataType = "Integer", name = "type", value = "1草莓 2五百里 3mdsk 4正在 5跳飞船音乐节 6小家伙", required = true), @ApiImplicitParam(type = "query", dataType = "Integer", name = "type", value = "1草莓 2五百里 3mdsk 4正在 5跳飞船 6小家伙 7摩登 8DouDou 9mootoo 10wenque", required = true),
}) })
public ResponseDto userInfo( public ResponseDto userInfo(
@RequestParam(required = false) String userCode, @RequestParam(required = false) String userCode,
...@@ -48,7 +48,7 @@ public class SweetWechatLoginController { ...@@ -48,7 +48,7 @@ public class SweetWechatLoginController {
@GetMapping(value = {"maOpenId"}) @GetMapping(value = {"maOpenId"})
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "jsCode", value = "微信jsCode", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "jsCode", value = "微信jsCode", required = true),
@ApiImplicitParam(type = "query", dataType = "Integer", name = "type", value = " 1草莓 2五百里 3mdsk 4正在 5跳飞船音乐节 6小家伙", required = true) @ApiImplicitParam(type = "query", dataType = "Integer", name = "type", value = " 1草莓 2五百里 3mdsk 4正在 5跳飞船 6小家伙 7摩登 8DouDou 9mootoo 10wenque", required = true)
}) })
public ResponseDto<String> wxaCode2Session(@RequestParam String jsCode, @RequestParam Integer type) { public ResponseDto<String> wxaCode2Session(@RequestParam String jsCode, @RequestParam Integer type) {
return sweetLoginService.wxaCode2Session(jsCode, type); return sweetLoginService.wxaCode2Session(jsCode, type);
...@@ -58,7 +58,7 @@ public class SweetWechatLoginController { ...@@ -58,7 +58,7 @@ public class SweetWechatLoginController {
@GetMapping(value = {"userInfoMa"}) @GetMapping(value = {"userInfoMa"})
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "jsCode", value = "微信jsCode", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "jsCode", value = "微信jsCode", required = true),
@ApiImplicitParam(type = "query", dataType = "Integer", name = "type", value = " 1草莓 2五百里 3mdsk 4正在 5跳飞船音乐节 6小家伙", required = true) @ApiImplicitParam(type = "query", dataType = "Integer", name = "type", value = " 1草莓 2五百里 3mdsk 4正在 5跳飞船 6小家伙 7摩登 8DouDou 9mootoo 10wenque", required = true)
}) })
public ResponseDto<AdamLoginInfoVo> userInfoMa(@RequestParam String jsCode, @RequestParam Integer type) { public ResponseDto<AdamLoginInfoVo> userInfoMa(@RequestParam String jsCode, @RequestParam Integer type) {
return sweetLoginService.userInfoMa(jsCode, type); return sweetLoginService.userInfoMa(jsCode, type);
......
...@@ -14,8 +14,6 @@ import io.jsonwebtoken.ExpiredJwtException; ...@@ -14,8 +14,6 @@ import io.jsonwebtoken.ExpiredJwtException;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.DigestUtils;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
...@@ -128,23 +126,22 @@ public class GlobalAuthFilter extends ZuulFilter { ...@@ -128,23 +126,22 @@ public class GlobalAuthFilter extends ZuulFilter {
ctx.setSendZuulResponse(true); ctx.setSendZuulResponse(true);
// } // }
} else { } else {
// adam:identity:sso:${uid}=MD5(${token}) // adam:session:{jti}=uid
String ssoKey = jwtValidator.getSsoRedisKey().concat(uid); try {
Claims claims = jwtValidator.parse(uToken);
String md5Token = (String) redisUtil.get(ssoKey); String jti = claims.getId();
if (StringUtils.isBlank(jti)) {
if (StringUtils.isEmpty(md5Token)) { this.respHandler(ctx, TOKEN_INVALID);
// 已离线
this.respHandler(ctx, TOKEN_INVALID);
} else {
// 与在线TOKEN比对
if (md5Token.equals(DigestUtils.md5DigestAsHex(uToken.getBytes(StandardCharsets.UTF_8)))) {
// 一致则放行
ctx.setSendZuulResponse(true);
} else { } else {
// 不一致则被踢下线 String sessionUid = (String) redisUtil.get(jwtValidator.sessionKey(jti));
this.respHandler(ctx, TOKEN_KICK); if (StringUtils.isNotBlank(sessionUid) && sessionUid.equals(uid)) {
ctx.setSendZuulResponse(true);
} else {
this.respHandler(ctx, TOKEN_INVALID);
}
} }
} catch (Exception e) {
this.respHandler(ctx, TOKEN_INVALID);
} }
} }
return null; return null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment