Authored by Lixiaodi

增加默认值bug修改

... ... @@ -18,6 +18,7 @@ public class ManualDealRequest {
private Integer tradeBillsId;
private Integer operateUid;
private String operateUname;
// '3位场景(卖家不卖了,卖家不卖了(已被购买),鉴定不通过,鉴定通过,交易成功)+2位资金去向(卖家,买家,其他)+2资金类型(货款、保证金、其他)
private int sceneId;
... ...
... ... @@ -527,9 +527,9 @@ public class PaymentServiceImpl implements IPaymentService {
logger.info("transferMon计算费用结果为 {}", transferAmount);
if (transferAmount == null) {
logger.warn("transferMonErr transferMon计算费用结果为 null, 不合法的金额");
// TODO alarm
record.setTradeStatus(202);
addTradeBills(record);
// TODO alarm
throw new ServiceException(400, "计算金额错误!:");
}
transfer.setAmount(transferAmount);
... ... @@ -538,9 +538,9 @@ public class PaymentServiceImpl implements IPaymentService {
record.setSystemAmount(transferAmount.multiply(new BigDecimal("-1")));
if (transferAmount.compareTo(new BigDecimal("0.1")) < 0) {
logger.warn("transferMonErr transferMon计算费用结果为 {}, 小于0.1", transferAmount);
// TODO alarm
record.setTradeStatus(202);
addTradeBills(record);
// TODO alarm
throw new ServiceException(400, "不合法的金额:" + transferAmount);
}
... ... @@ -570,8 +570,8 @@ public class PaymentServiceImpl implements IPaymentService {
}
} catch (Exception e) {
logger.warn("transferMonErr 转账失败 , orderCode is {}, msg is {}", buyerOrderCode, e.getMessage());
transfer.setStatus(3);
// TODO alarm
transfer.setStatus(3);
if(e instanceof ServiceException) {
throw new ServiceException(((ServiceException) e).getCode(), e.getMessage());
} else {
... ... @@ -599,6 +599,9 @@ public class PaymentServiceImpl implements IPaymentService {
if (req.getOperateUid() == null || req.getOperateUid() < 1) {
throw new ServiceException(400, "manualDeal:客服uid不合法");
}
if (StringUtils.isBlank(req.getOperateUname())) {
throw new ServiceException(400, "manualDeal:客服名称不合法");
}
String alipayAccount = req.getAlipayAccount();
if (StringUtils.isBlank(alipayAccount)) {
throw new ServiceException(400, "manualDeal:支付宝账号不合法");
... ... @@ -617,6 +620,11 @@ public class PaymentServiceImpl implements IPaymentService {
if (tradeBillsMapper.selectByDealRelateId(tradeBillsId) != null) {
throw new ServiceException(400, "manualDeal:该流水已经处理过");
}
String alipayAccountDb = getAlipayAccount(tradeBills.getUid());
if (StringUtils.equals(alipayAccount, alipayAccountDb)) {
logger.warn("manualDeal:传入支付宝账号和系统不一致{},{}", alipayAccount, alipayAccountDb);
throw new ServiceException(400, "manualDeal:传入支付宝账号(" + alipayAccount + ")和系统不一致(" + alipayAccountDb + ")");
}
long orderCode = tradeBills.getOrderCode();
BigDecimal amount = null;
... ... @@ -639,6 +647,7 @@ public class PaymentServiceImpl implements IPaymentService {
preSuccess.setDealTime(now);
preSuccess.setDealStatus(1);
preSuccess.setDealUid(req.getOperateUid());
preSuccess.setDealUserName(req.getOperateUname());
if (tradeBillsMapper.updateToOkByPrimaryKey(preSuccess) == 0) {
throw new ServiceException(400, "manualDeal:流水已经处理过id=" + tradeBills.getId());
}
... ...