Authored by caoyan

Merge branch 'test6.9.17' of http://git.yoho.cn/ufo/yohoufo-fore into test6.9.17

# Conflicts:
#	product/src/main/java/com/yohoufo/product/controller/ProductController.java
Showing 19 changed files with 50 additions and 67 deletions
... ... @@ -24,7 +24,7 @@ import java.util.*;
public class BodySignatureCheckInterceptor implements HandlerInterceptor {
private final Logger logger = LoggerFactory.getLogger(SecurityInterceptor.class);
private final Logger logger = LoggerFactory.getLogger(BodySignatureCheckInterceptor.class);
//读取配置文件中的private key 配置
private Map<String, String> privateKeyMap = new HashMap<>();
... ...
... ... @@ -17,13 +17,13 @@ public class WeixinPayConfig {
/**微信支付UFO商户号正式**/
public static final String APP_ID_UFO_REAL = "wx75b18b98bdd92bbc";
public static final String PARTNER_ID = "1516774631";
public static final String WECHAT_PAY_UFOREAL_APP_PARTNER_CERT = "/certs/wechatpay/apiclient_cert_ufo_real_app.p12";
public static final String UFO_PARTNER_ID = "1516774631";
public static final String UFO_PARTNER_CERT = "/.cert/wechatpay/apiclient_cert_ufo.p12";
public interface Miniapp{
String APP_PARTNER_CERT = "/certs/wechatpay/apiclient_cert_wx_miniapp.p12";
String APP_PARTNER_CERT = "/.cert/wechatpay/apiclient_cert_ufo.p12";
String APPID = "wxc677c88385762287";
String MALL_ID = PARTNER_ID;
String MALL_ID = UFO_PARTNER_ID;
}
//查询微信支付订单前缀
... ...
... ... @@ -42,6 +42,8 @@ public class ErpFastDeliveryController {
@IgnoreSession
@RequestMapping("/getStorageInfo")
public ApiResponse getStorageInfo(@RequestBody FastDeliveryBatchOnShelfReq req){
logger.info("getStorageInfo param {}", req);
List<StorageCheckResp> data = erpFastDeliveryService.getStorageInfo(req);
return new ApiResponse.ApiResponseBuilder().data(data).build();
}
... ... @@ -57,6 +59,8 @@ public class ErpFastDeliveryController {
@RequestMapping("/batchOnShelf")
public ApiResponse batchOnShelf(@RequestBody FastDeliveryBatchOnShelfReq req){
logger.info("batchOnShelf param {}", req);
int code =200;
String msg = "成功";
... ... @@ -87,6 +91,8 @@ public class ErpFastDeliveryController {
@RequestMapping("/singleDownSelf")
public ApiResponse singleDownSelf(@RequestBody FastDeliveryDownShelfReq req){
logger.info("singleDownSelf param {}", req);
boolean result = erpFastDeliveryService.singleDownSelf(req);
String msg = "下架成功";
if (!result) {
... ... @@ -106,6 +112,8 @@ public class ErpFastDeliveryController {
@RequestMapping("/singleAdjustPrice")
public ApiResponse singleAdjustPrice(@RequestBody FastDeliveryAdjustPriceReq req){
logger.info("singleAdjustPrice param {}", req);
boolean result = erpFastDeliveryService.singleAdjustPrice(req);
String msg = "调价成功";
if (!result) {
... ... @@ -125,6 +133,8 @@ public class ErpFastDeliveryController {
@RequestMapping("/getLowestPrice")
public ApiResponse getLowestPrice(@RequestBody FastDeliveryLeastPriceReq req){
logger.info("getLowestPrice param {}", req);
List<StorageInfoResp> result = erpFastDeliveryService.getLeastPriceByProductCode(req);
return new ApiResponse.ApiResponseBuilder().data(result).code(200).build();
}
... ... @@ -139,6 +149,8 @@ public class ErpFastDeliveryController {
@RequestMapping("/getShelfInfo")
public ApiResponse getShelfInfo(@RequestBody FastDeliveryGetShelfReq req){
logger.info("getShelfInfo param {}", req);
FastDeliveryGetShelfDetailResp data = erpFastDeliveryService.getShelfInfo(req);
return new ApiResponse.ApiResponseBuilder().data(data).code(200).build();
... ...
... ... @@ -11,7 +11,6 @@ import javax.servlet.http.HttpServletResponse;
import com.yohobuy.ufo.model.order.bo.PaymentData;
import com.yohoufo.order.service.pay.alipay.AlipayCrossBorderService;
import com.yohoufo.order.service.pay.alipay.AbstractAlipayService;
import com.yohoufo.order.service.pay.alipay.bean.AlipayCustomsResponse;
import com.yohoufo.order.service.pay.alipay.bean.AlipayQueryCustomsResponse;
import com.yohoufo.order.service.pay.unionpay.JsUnionpayService;
import org.apache.commons.lang.StringUtils;
... ... @@ -38,7 +37,7 @@ import com.yohoufo.order.model.response.PaymentConfirmRsp;
import com.yohoufo.order.model.response.PrepayResponse;
import com.yohoufo.order.service.IPaymentService;
import com.yohoufo.order.service.pay.alipay.AlipayOuyinService;
import com.yohoufo.order.service.pay.weixin.WeixinPayUFORealAppService;
import com.yohoufo.order.service.pay.weixin.UfoAppWeixinPayService;
@RestController
@RequestMapping(value = "/payment")
... ... @@ -59,7 +58,7 @@ public class PaymentController {
IPaymentService paymentService;
@Autowired
WeixinPayUFORealAppService weixinPayAppService;
UfoAppWeixinPayService ufoAppWeixinPayService;
@Autowired
AlipayOuyinService alipayService;
... ... @@ -201,7 +200,7 @@ public class PaymentController {
wechatLogger.info("[{}] notification received", out_trade_no);
//回调验证
if(!weixinPayAppService.notifyVerify(params)) {
if(!ufoAppWeixinPayService.notifyVerify(params)) {
notifyResponse.setNotifyResult(NotifyResponse.PAYMENT_NOTIFY_RESULT_VERFAIL);
wechatLogger.error("[{}] notification verify failed", out_trade_no);
return ;
... ... @@ -209,7 +208,7 @@ public class PaymentController {
PaymentData paymentData = null;
try {
paymentData = weixinPayAppService.getPaymentData(params);
paymentData = ufoAppWeixinPayService.getPaymentData(params);
// 支付回调,业务处理
paymentService.paySuccess(paymentData);
... ...
... ... @@ -9,8 +9,8 @@ import com.yohoufo.order.service.pay.alipay.AlipayOuyinService;
import com.yohoufo.order.service.pay.alipay.AlipayOuyinWapService;
import com.yohoufo.order.service.pay.unionpay.JsUnionpayService;
import com.yohoufo.order.service.pay.wallet.WalletPayService;
import com.yohoufo.order.service.pay.weixin.WeixinMiniappPayService;
import com.yohoufo.order.service.pay.weixin.WeixinPayUFORealAppService;
import com.yohoufo.order.service.pay.weixin.MiniappWeixinPayService;
import com.yohoufo.order.service.pay.weixin.UfoAppWeixinPayService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -20,7 +20,7 @@ import org.springframework.stereotype.Component;
public class PayServiceFactory {
@Autowired
WeixinPayUFORealAppService weixinPayAppService;
UfoAppWeixinPayService ufoAppWeixinPayService;
@Autowired
AlipayOuyinService alipayService;
... ... @@ -29,7 +29,7 @@ public class PayServiceFactory {
AlipayCrossBorderService alipayCrossBorderService;
@Autowired
WeixinMiniappPayService weixinMiniappPayService;
MiniappWeixinPayService miniappWeixinPayService;
@Autowired
WalletPayService walletPayService;
... ... @@ -57,11 +57,11 @@ public class PayServiceFactory {
AbstractPayService payService = null;
if (payment == Payment.WECHAT) {
payService = weixinPayAppService;
payService = ufoAppWeixinPayService;
} else if (payment == Payment.ALIPAY || payment == Payment.ALIPAY_HB || payment == Payment.ALIPAY_HBFQ) {
payService = alipayService;
} else if (payment == Payment.MINIAPP) {
payService = weixinMiniappPayService;
payService = miniappWeixinPayService;
} else if (payment == Payment.WALLET) {
payService = walletPayService;
} else if(payment == Payment.UNION_PAY){
... ...
... ... @@ -28,7 +28,6 @@ import com.yohoufo.order.common.BillTradeStatus;
import com.yohoufo.order.common.HbfqEnum;
import com.yohoufo.order.common.TradeType;
import com.yohoufo.order.common.TransferCase;
import com.yohoufo.order.constants.ClearanceFailType;
import com.yohoufo.order.constants.RefundContant;
import com.yohoufo.order.model.PayQueryBo;
import com.yohoufo.order.model.PayRefundBo;
... ... @@ -50,19 +49,15 @@ import com.yohoufo.order.service.handler.transfer.TransferChancelSelector;
import com.yohoufo.order.service.pay.AbstractPayService;
import com.yohoufo.order.service.pay.alipay.AlipayCrossBorderService;
import com.yohoufo.order.service.pay.alipay.AlipayOuyinService;
import com.yohoufo.order.service.pay.alipay.bean.AlipayCustomsResponse;
import com.yohoufo.order.service.pay.alipay.bean.AlipayQueryCustomsResponse;
import com.yohoufo.order.service.pay.alipay.bean.CustomsErrorMsg;
import com.yohoufo.order.service.pay.unionpay.JsUnionpayService;
import com.yohoufo.order.service.pay.wallet.WalletPayService;
import com.yohoufo.order.service.pay.weixin.WeixinMiniappPayService;
import com.yohoufo.order.service.pay.weixin.WeixinPayUFORealAppService;
import com.yohoufo.order.service.pay.weixin.MiniappWeixinPayService;
import com.yohoufo.order.service.pay.weixin.UfoAppWeixinPayService;
import com.yohoufo.order.service.proxy.WalletTransferService;
import com.yohoufo.order.service.support.CustomsSupportService;
import com.yohoufo.order.service.support.codegenerator.OrderCodeGenerator;
import com.yohoufo.order.service.support.codegenerator.bean.CodeMeta;
import com.yohoufo.order.service.transfer.TransferResult;
import com.yohoufo.order.utils.LoggerUtils;
import com.yohoufo.order.utils.PaymentHelper;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
... ... @@ -110,7 +105,7 @@ public class PaymentServiceImpl implements IPaymentService {
MerchantOrderPaymentService merchantOrderPaymentService;
@Autowired
WeixinPayUFORealAppService weixinPayAppService;
UfoAppWeixinPayService ufoAppWeixinPayService;
@Autowired
AlipayOuyinService alipayService;
... ... @@ -137,7 +132,7 @@ public class PaymentServiceImpl implements IPaymentService {
OrdersPayTransferMapper ordersPayTransferMapper;
@Autowired
WeixinMiniappPayService weixinMiniappPayService;
MiniappWeixinPayService miniappWeixinPayService;
@Autowired
WalletPayService walletPayService;
... ...
... ... @@ -2,7 +2,7 @@ package com.yohoufo.order.service.pay.weixin;
import com.yohoufo.common.utils.HttpClient;
import com.yohoufo.order.config.WeixinPayConfig;
import com.yohoufo.order.service.pay.weixin.ssl.WxMiniappHttpSslClient;
import com.yohoufo.order.service.pay.weixin.ssl.WxUfoHttpSslClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
... ... @@ -10,10 +10,10 @@ import org.springframework.stereotype.Service;
* Created by chao.chen on 2018/11/9.
*/
@Service
public class WeixinMiniappPayService extends AbstractWeixinPayService {
public class MiniappWeixinPayService extends AbstractWeixinPayService {
@Autowired
private WxMiniappHttpSslClient wxMiniappHttpSslClient;
private WxUfoHttpSslClient httpSslClient;
@Override
protected String getMchId() {
... ... @@ -34,6 +34,6 @@ public class WeixinMiniappPayService extends AbstractWeixinPayService {
@Override
protected HttpClient getSslHttpClient() {
return wxMiniappHttpSslClient;
return httpSslClient;
}
}
... ...
... ... @@ -5,17 +5,17 @@ import org.springframework.stereotype.Service;
import com.yohoufo.common.utils.HttpClient;
import com.yohoufo.order.config.WeixinPayConfig;
import com.yohoufo.order.service.pay.weixin.ssl.WxUFORealAppHttpSslClient;
import com.yohoufo.order.service.pay.weixin.ssl.WxUfoHttpSslClient;
@Service
public class WeixinPayUFORealAppService extends AbstractWeixinPayService {
public class UfoAppWeixinPayService extends AbstractWeixinPayService {
@Autowired
private WxUFORealAppHttpSslClient httpSslClient;
private WxUfoHttpSslClient httpSslClient;
@Override
protected String getMchId() {
return WeixinPayConfig.PARTNER_ID;
return WeixinPayConfig.UFO_PARTNER_ID;
}
... ...
... ... @@ -18,7 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
public abstract class HttpSslClientAbstract extends HttpClient {
public abstract class AbstractHttpSslClient extends HttpClient {
//最大总数
private final int sslMaxTotal = 10;
... ...
package com.yohoufo.order.service.pay.weixin.ssl;
import com.yohoufo.order.config.WeixinPayConfig;
import org.springframework.stereotype.Component;
/**
* Created by chao.chen on 2018/11/9.
*/
@Component
public class WxMiniappHttpSslClient extends HttpSslClientAbstract {
@Override
protected String getMchId() {
return WeixinPayConfig.Miniapp.MALL_ID;
}
@Override
protected String getMchCertPath() {
return WeixinPayConfig.Miniapp.APP_PARTNER_CERT;
}
}
... ... @@ -4,16 +4,16 @@ import com.yohoufo.order.config.WeixinPayConfig;
import org.springframework.stereotype.Component;
@Component
public class WxUFORealAppHttpSslClient extends HttpSslClientAbstract {
public class WxUfoHttpSslClient extends AbstractHttpSslClient {
@Override
protected String getMchId() {
return WeixinPayConfig.PARTNER_ID;
return WeixinPayConfig.UFO_PARTNER_ID;
}
@Override
protected String getMchCertPath() {
return WeixinPayConfig.WECHAT_PAY_UFOREAL_APP_PARTNER_CERT;
return WeixinPayConfig.UFO_PARTNER_CERT;
}
}
... ...
... ... @@ -148,7 +148,7 @@
<dependency>
<groupId>com.yoho.core</groupId>
<artifactId>security</artifactId>
<version>1.6.5-SNAPSHOT</version>
<version>1.6.8-SNAPSHOT</version>
</dependency>
</dependencies>
... ...
... ... @@ -1015,16 +1015,11 @@ public class ProductController {
@ApiOperation(name = "ufo.product.sizeImage", desc = "查询尺码图片")
@RequestMapping(params = "method=ufo.product.sizeImage")
@Cachable(expire = 180)
@Cachable(expire = 300)
public ApiResponse getSizeImage(@RequestParam(value = "product_id") Integer productId,
@RequestParam(value = "brand_id") Integer brandId) {
if (null == productId || null == brandId) {
LOG.info("in method=ufo.product.sizeImage product_id and brand_id is Null or empty");
return new ApiResponse(400, "product_id and brand_id is Null or empty", null);
}
LOG.info("in method=ufo.product.sizeImage product_id is {}", productId);
SizeImageResp result =productService.getSizeImage(productId, brandId);
LOG.info("in method=ufo.product.sizeImage product_id is {}, brandId is {}", productId, brandId);
SizeImageResp result = productService.getSizeImage(productId, brandId);
return new ApiResponse.ApiResponseBuilder().code(200).data(result).message("getSizeImage success").build();
}
}
\ No newline at end of file
... ...
... ... @@ -2060,6 +2060,9 @@ public class ProductServiceImpl implements ProductService {
public void tabsGoods(ProductDetailResp resp) {
ProductInfo product_info = resp.getProduct_info();
if (Objects.isNull(product_info)) {
return;
}
List<GoodsBO> goodsList = product_info.getGoodsList();
if (!goodsList.isEmpty()) {
GoodsBO allGoodsBO = goodsList.get(0);
... ...