Authored by Lixiaodi

Merge branch 'dev_pay_million' into test6.8.8

... ... @@ -1106,6 +1106,13 @@ public class PaymentServiceImpl implements IPaymentService {
tradeBills.setTradeStatus(100);
tradeBills.setCreateTime(now);
addTradeBills(tradeBills);
OrdersPayTransfer transferSuccess = new OrdersPayTransfer();
transferSuccess.setId(transfer.getId());
transferSuccess.setAlipayTradeId(orderId);
transferSuccess.setStatus(1);
transferSuccess.setUpdateTime(now);
ordersPayTransferMapper.updateByPrimaryKeySelective(transferSuccess);
} else if(exceedMillion(jsonObject)) {
Map<String, String> mapResult = transferWhenExceedMillion(transfer.getId(), tradeBills, orderCode, account, amount, now);
String resultStr = JSON.toJSONString(mapResult);
... ... @@ -1178,13 +1185,14 @@ public class PaymentServiceImpl implements IPaymentService {
@Autowired
private ConfigReader configReader;
private void checkTransferExist(long orderCode) {
private OrdersPayTransfer checkTransferExist(long orderCode) {
// 查看是否已经有转账记录
OrdersPayTransfer exist = ordersPayTransferMapper.selectByBuyerOrderCode(orderCode);
if (exist != null) {
logger.warn("OrdersPayTransfer has exist, orderCode is {}", orderCode);
throw new ServiceException(400, "订单已经处理过");
}
return exist;
}
private OrdersPayTransfer createTransfer(long buyerOrderCode, long sellerOrderCode, Integer transferType, String alipayAccount,
... ...
... ... @@ -179,7 +179,7 @@ public abstract class AlipayServiceAbstract extends AbstractPayService {
public Map<String, String> transferMoneyWhenExceedMillion(String transferOrderCode, String businessId, String alipayUid, String alipayAccount, String userName, BigDecimal transferAmount) throws Exception{
Map<String, String> queryParams = buildTransferParamsWhenExceedMillion(transferOrderCode, businessId, alipayUid, alipayAccount, userName, transferAmount);
String respTxt = sendOpenApiRequestWithException(transferOrderCode, queryParams);
String respTxt = sendMApiRequestWithException(transferOrderCode, queryParams);
Map<String, String> result;
... ... @@ -235,6 +235,13 @@ public abstract class AlipayServiceAbstract extends AbstractPayService {
logger.info("[{}] trade openapi resp: {}", orderCode, response);
return response;
}
private String sendMApiRequestWithException(String orderCode, Map<String, String> paramMap) throws Exception {
logger.info("[{}] send openapi request: {}", orderCode, paramMap);
String response = httpClient.postFormData(AlipayConfig.MAPI_URL, paramMap);
logger.info("[{}] trade openapi resp: {}", orderCode, response);
return response;
}
private PayQueryBo queryOpenApiConvert(String orderCode, String respText) {
... ...