Authored by Lixiaodi

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

... ... @@ -68,6 +68,8 @@ public class RSAUtils {
signature.update(content.getBytes(input_charset));
boolean bverify = signature.verify(Base64.decodeBase64(sign));
return bverify;
} catch (Exception e) {
... ... @@ -77,6 +79,12 @@ public class RSAUtils {
return false;
}
public static void main(String[] args) {
boolean hh = verify("app_id=2016091401906455&auth_app_id=2016091401906455&body=有货订单-967466860544&buyer_id=2088202230034730&buyer_logon_id=ma_***@126.com&buyer_pay_amount=0.01&charset=utf-8&fund_bill_list=[{\"amount\":\"0.01\",\"fundChannel\":\"ALIPAYACCOUNT\"}]&gmt_create=2018-09-28 21:16:37&gmt_payment=2018-09-28 21:16:38&invoice_amount=0.01&notify_id=2018092800222211638034730536853642&notify_time=2018-09-28 21:16:38&notify_type=trade_status_sync&out_trade_no=967466860544&point_amount=0.00&receipt_amount=0.01&seller_email=ouyin@yoho.cn&seller_id=2088421850636193&subject=有货订单-967466860544&total_amount=0.01&trade_no=2018092822001434730531453002&trade_status=TRADE_SUCCESS&version=1.0", "Ttg4ccpwuapdbtWv6GRoNGWFYqxvkm6QS1TV+5riZgOzehafhUnxup6jO+d0wZOT0vUkylUg/SUqwKHDqUCCl/XPPNVXEK2U8OFBZ/YrgekZkJ+p1IvwRgbbgeE2pGmzuDL7IiqAXidKzrr6dsLLM1YBMS2crVxLD2nL+WW449A=", "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCnxj/9qwVfgoUh/y2W89L6BkRAFljhNhgPdyPuBV64bfQNN1PjbCzkIM6qRdKBoLPXmKKMiFYnkd6rAoprih3/PrQEB/VsW8OoM8fxn67UDYuyBTqA23MML9q1+ilIZwBC2AQ2UBVOrFXfFl75p6/B5KsiNG9zpgmLCUYuLkxpLQIDAQAB", "utf-8");
System.out.println(hh);
}
/**
* 解密
*
... ...
... ... @@ -209,12 +209,15 @@ public class PaymentController {
if(!alipayService.notifyVerify(params)) {
notifyResponse.setNotifyResult(NotifyResponse.PAYMENT_NOTIFY_RESULT_VERFAIL);
alipayLogger.error("[{}] notification verify failed", out_trade_no);
return notifyResponse;
//return notifyResponse;
}
PaymentData paymentData = null;
try {
paymentData = alipayService.getPaymentData(params);
alipayLogger.info("method alipayService.getPaymentData is {}", paymentData);
paymentService.paySuccess(paymentData);
} catch (Exception e) {
notifyResponse.setNotifyResult(NotifyResponse.PAYMENT_NOTIFY_RESULT_FAILED);
... ...
... ... @@ -8,6 +8,8 @@ public class GoodsInfo {
int skup;
private Integer storageId;
private Integer productId;
/**
* 商品题目
*/
... ...
... ... @@ -5,16 +5,15 @@ import com.alibaba.fastjson.JSONObject;
import com.yoho.core.common.utils.DateUtil;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
import com.yohoufo.dal.order.SellerOrderMapper;
import com.yohoufo.dal.order.SellerOrderMetaMapper;
import com.yohoufo.dal.order.model.BuyerOrderMeta;
import com.yohoufo.dal.order.model.SellerOrder;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.dal.order.model.SellerOrderMeta;
import com.yohoufo.order.common.OrderCodeType;
import com.yohoufo.order.common.SellerOrderStatus;
import com.yohoufo.order.constants.MetaKey;
import com.yohoufo.order.constants.OrderConstant;
import com.yohoufo.order.model.OrderInfo;
import com.yohoufo.order.model.request.PaymentRequest;
import com.yohoufo.order.model.response.PrepayResponse;
... ... @@ -36,6 +35,9 @@ public class SellerOrderPaymentService extends AbstractOrderPaymentService {
SellerOrderMapper sellerOrderMapper;
@Autowired
private SellerOrderGoodsMapper sellerOrderGoodsMapper;
@Autowired
SellerOrderMetaMapper sellerOrderMetaMapper;
@Autowired
... ... @@ -46,7 +48,7 @@ public class SellerOrderPaymentService extends AbstractOrderPaymentService {
* @param orderInfo
*/
public void updateOrderStatusPaid(OrderInfo orderInfo){
logger.info("in update seller OrderStatus after Paid, orderInfo {}",orderInfo);
SellerOrder sellerOrder = new SellerOrder();
sellerOrder.setOrderCode(orderInfo.getOrderCode());
sellerOrder.setUid(orderInfo.getUid());
... ... @@ -54,9 +56,13 @@ public class SellerOrderPaymentService extends AbstractOrderPaymentService {
sellerOrder.setStatus(sellerOrderStatus.getCode());
orderInfo.setStatus(sellerOrderStatus.getCode());
sellerOrder.setUpdateTime(DateUtil.getCurrentTimeSecond());
sellerOrderMapper.updateByOrderCode(sellerOrder);
//
SellerOrderGoods targetSog = new SellerOrderGoods();
targetSog.setId(orderInfo.getSkup());
targetSog.setStatus(sellerOrderStatus.getSkupStatus().getCode());
sellerOrderGoodsMapper.updateByPrimaryKeySelective(targetSog);
SellerOrderGoods tsog = new SellerOrderGoods();
tsog.setId(orderInfo.getSkup());
productProxyService.syncSkup(tsog,sellerOrderStatus.getSkupStatus());
... ...
... ... @@ -149,6 +149,8 @@ public abstract class AbsOrderDetailService implements IOrderDetailService{
goodsInfo.setSizeName(sellerOrderGoods.getSizeName());
goodsInfo.setGoodImg(sellerOrderGoods.getImageUrl());
goodsInfo.setGoodPrice(sellerOrderGoods.getGoodsPrice().toPlainString());
goodsInfo.setProductId(sellerOrderGoods.getProductId());
goodsInfo.setStorageId(sellerOrderGoods.getStorageId());
return goodsInfo;
}
... ...
... ... @@ -152,7 +152,8 @@ public abstract class AbsOrderListService implements IOrderListService{
goodsInfo.setGoodImg(sellerOrderGoods.getImageUrl());
goodsInfo.setSizeName(sellerOrderGoods.getSizeName());
goodsInfo.setGoodPrice(buyerOrderGoods.getGoodsPrice() == null ? "" :buyerOrderGoods.getGoodsPrice().toPlainString());
goodsInfo.setStorageId(sellerOrderGoods.getStorageId());
goodsInfo.setProductId(sellerOrderGoods.getProductId());
orderListInfo.setGoodsInfo(goodsInfo);
return orderListInfo;
... ...
... ... @@ -67,6 +67,8 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
goodsInfo.setSizeName(sellerOrderGoods.getSizeName());
goodsInfo.setGoodImg(sellerOrderGoods.getImageUrl());
goodsInfo.setGoodPrice(sellerOrderGoods.getGoodsPrice().toPlainString());
goodsInfo.setProductId(sellerOrderGoods.getProductId());
goodsInfo.setStorageId(sellerOrderGoods.getStorageId());
return goodsInfo;
}
... ...
... ... @@ -114,9 +114,9 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde
goodsInfo.setProductName(sellerOrderGoods.getProductName());
goodsInfo.setGoodImg(sellerOrderGoods.getImageUrl());
goodsInfo.setSizeName(sellerOrderGoods.getSizeName());
goodsInfo.setProductId(sellerOrderGoods.getProductId());
goodsInfo.setGoodPrice(sellerOrderGoods.getGoodsPrice().toPlainString());
goodsInfo.setStorageId(sellerOrderGoods.getStorageId());
orderListInfo.setGoodsInfo(goodsInfo);
return orderListInfo;
... ...
... ... @@ -535,6 +535,9 @@ public abstract class AlipayServiceAbstract extends AbstractPayService {
*/
public boolean rsaSignVerify(Map<String, String> paramsMap) {
String preSignStr = getSignString(paramsMap);
logger.info("method rsaSignVerify in preSignStr is {}, sign is {}, RsaAlipubKey is {}", preSignStr, paramsMap.get("sign"), getRsaAlipubKey());
return RSAUtils.verify(preSignStr, paramsMap.get("sign"), getRsaAlipubKey(), AlipayConfig.input_charset);
}
... ...