Authored by tanling

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

... ... @@ -125,5 +125,13 @@ public interface DepositService {
* @return
*/
int updateDepositWaitToPick(Integer uid, String depositCode);
/**
* 取消购买后更新寄存状态
* @param uid
* @param depositCode
* @return
*/
int updateDepositAfterCancelBuy(Integer uid, String depositCode);
}
... ...
... ... @@ -47,7 +47,7 @@ public class TransferChancelSelector {
}
public boolean isStopTransferWithAlipay() {
public boolean isStopTransfer() {
return ufoOrderPayConfigReader.isStopTransfer();
}
... ...
... ... @@ -814,6 +814,11 @@ public class DepositServiceImpl implements DepositService {
return storageDepositMapper.updateStorageStatus(deposit.getId(), StorageDepositStatusEnum.WAITING_QUERY.getCode(), 0, DepositOutTypeEnum.OUTTYPE_DEPOSIT_CHANGE_TO_IN_STOCK.getCode(), uid);
}
@Autowired
public int updateDepositAfterCancelBuy(Integer uid, String depositCode) {
return 0;
}
private List<DepositDetailBo> convertDepositResp(List<StorageDeposit> list, List<Long> orderCodeList){
Map<Long, BigDecimal> orderCodePriceMap = Maps.newHashMap();
List<BuyerOrder> buyerOrderList = buyerOrderMapper.selectByOrderCodes(orderCodeList, null);
... ...
... ... @@ -521,7 +521,7 @@ public class PaymentServiceImpl implements IPaymentService {
// 转账
try {
logger.info("{}, transfer alipayAccount={}, transferAmount={}", logTag, alipayAccount, transferAmount);
shoppingRiskWatchDog.checkManualStopTransfer();
if (transferChancelSelector.isTransferWithWallet(record)) {
transfer.setInterfaceType(INTERFACE_TYPE_TRANSFER_WALLET);
ordersPayTransferMapper.updateByPrimaryKeySelective(transfer);
... ... @@ -609,6 +609,8 @@ public class PaymentServiceImpl implements IPaymentService {
boolean exceedMillionAndSuccess = false;
transfer.setUpdateTime(now);
try {
logger.info("{}, transfer start", logTag);
shoppingRiskWatchDog.checkManualStopTransfer();
if (transferChancelSelector.isTransferWithWallet(record)) {
transfer.setInterfaceType(INTERFACE_TYPE_TRANSFER_WALLET);
ordersPayTransferMapper.updateByPrimaryKeySelective(transfer);
... ... @@ -620,11 +622,7 @@ public class PaymentServiceImpl implements IPaymentService {
throwServiceException(transferResult.getCode(), transferResult.getMsg());
}
}
logger.info("{}, transfer start", logTag);
shoppingRiskWatchDog.checkAlipayBlackUser(aliPayAccount.getUid(), aliPayAccount);
shoppingRiskWatchDog.checkManualStopAlipayTransfer();
if (transferChancelSelector.isTransferWithAlipayExceedMillionTransfer()) {
transfer.setInterfaceType(INTERFACE_TYPE_TRANSFER_WHEN_EXCEED_MILLION);
ordersPayTransferMapper.updateByPrimaryKeySelective(transfer);
... ... @@ -916,6 +914,7 @@ public class PaymentServiceImpl implements IPaymentService {
400, "转账记录已成功转账,请不要重复操作。");
Integer interfaceType = transfer.getInterfaceType();
logger.info("{}, transfer channel router {}", logTag, interfaceType);
shoppingRiskWatchDog.checkManualStopTransfer();
if (transferChancelSelector.isTransferWithWallet(interfaceType)) {
transferWithWalletAndAddSuccessTradeBills(logTag, tradeBills, orderCode, account, amount, transfer);
} else if (transferChancelSelector.isTransferWithAlipayExceedMillionTransfer(interfaceType)) {
... ... @@ -966,8 +965,7 @@ public class PaymentServiceImpl implements IPaymentService {
.alipayUid(account.getAlipayId())
.alipayAccount(account.getAlipayAccount())
.transferAmount(amount)
.riskWatcher(Arrays.asList((uid, aliRsp) -> shoppingRiskWatchDog.checkAlipayBlackUser(uid, aliRsp),
(uid, aliRsp) -> shoppingRiskWatchDog.checkManualStopAlipayTransfer()))
.riskWatcher(Arrays.asList((uid, aliRsp) -> shoppingRiskWatchDog.checkAlipayBlackUser(uid, aliRsp)))
.transfer();
parseTransferResultAndAddSuccessTradeBills(logTag, tradeBills, orderCode, transfer, transferResult);
}
... ... @@ -990,8 +988,7 @@ public class PaymentServiceImpl implements IPaymentService {
.alipayUid(account.getAlipayId())
.alipayAccount(account.getAlipayAccount())
.transferAmount(amount)
.riskWatcher(Arrays.asList((uid, alipayUid) -> shoppingRiskWatchDog.checkAlipayBlackUser(uid, alipayUid),
(uid, alipayUid) -> shoppingRiskWatchDog.checkManualStopAlipayTransfer() ))
.riskWatcher(Arrays.asList((uid, alipayUid) -> shoppingRiskWatchDog.checkAlipayBlackUser(uid, alipayUid)))
.transfer();
parseTransferResultAndUpdateTradeBillToSuccess(logTag, tradeBills, orderCode, transfer, transferResult);
}
... ... @@ -1060,8 +1057,7 @@ public class PaymentServiceImpl implements IPaymentService {
.transferAmount(amount)
.businessId(businessId)
.userName(account.getCertName())
.riskWatcher(Arrays.asList((uid, aar) -> shoppingRiskWatchDog.checkAlipayBlackUser(uid, aar),
(uid, aar) -> shoppingRiskWatchDog.checkManualStopAlipayTransfer()))
.riskWatcher(Arrays.asList((uid, aar) -> shoppingRiskWatchDog.checkAlipayBlackUser(uid, aar)))
.transfer();
// success to wait
if (transferResult.getCode() == 200) {
... ...
... ... @@ -100,8 +100,8 @@ public class ShoppingRiskWatchDog {
}
public void checkManualStopAlipayTransfer(){
if (transferChancelSelector.isStopTransferWithAlipay()){
public void checkManualStopTransfer(){
if (transferChancelSelector.isStopTransfer()){
logger.warn("stop manual transfer");
throw new UfoServiceException(442, "已关闭手动打款");
}
... ...