Authored by Lixiaodi

增加默认值bug修改

@@ -18,6 +18,7 @@ public class ManualDealRequest { @@ -18,6 +18,7 @@ public class ManualDealRequest {
18 private Integer tradeBillsId; 18 private Integer tradeBillsId;
19 19
20 private Integer operateUid; 20 private Integer operateUid;
  21 + private String operateUname;
21 22
22 // '3位场景(卖家不卖了,卖家不卖了(已被购买),鉴定不通过,鉴定通过,交易成功)+2位资金去向(卖家,买家,其他)+2资金类型(货款、保证金、其他) 23 // '3位场景(卖家不卖了,卖家不卖了(已被购买),鉴定不通过,鉴定通过,交易成功)+2位资金去向(卖家,买家,其他)+2资金类型(货款、保证金、其他)
23 private int sceneId; 24 private int sceneId;
@@ -527,9 +527,9 @@ public class PaymentServiceImpl implements IPaymentService { @@ -527,9 +527,9 @@ public class PaymentServiceImpl implements IPaymentService {
527 logger.info("transferMon计算费用结果为 {}", transferAmount); 527 logger.info("transferMon计算费用结果为 {}", transferAmount);
528 if (transferAmount == null) { 528 if (transferAmount == null) {
529 logger.warn("transferMonErr transferMon计算费用结果为 null, 不合法的金额"); 529 logger.warn("transferMonErr transferMon计算费用结果为 null, 不合法的金额");
  530 + // TODO alarm
530 record.setTradeStatus(202); 531 record.setTradeStatus(202);
531 addTradeBills(record); 532 addTradeBills(record);
532 - // TODO alarm  
533 throw new ServiceException(400, "计算金额错误!:"); 533 throw new ServiceException(400, "计算金额错误!:");
534 } 534 }
535 transfer.setAmount(transferAmount); 535 transfer.setAmount(transferAmount);
@@ -538,9 +538,9 @@ public class PaymentServiceImpl implements IPaymentService { @@ -538,9 +538,9 @@ public class PaymentServiceImpl implements IPaymentService {
538 record.setSystemAmount(transferAmount.multiply(new BigDecimal("-1"))); 538 record.setSystemAmount(transferAmount.multiply(new BigDecimal("-1")));
539 if (transferAmount.compareTo(new BigDecimal("0.1")) < 0) { 539 if (transferAmount.compareTo(new BigDecimal("0.1")) < 0) {
540 logger.warn("transferMonErr transferMon计算费用结果为 {}, 小于0.1", transferAmount); 540 logger.warn("transferMonErr transferMon计算费用结果为 {}, 小于0.1", transferAmount);
  541 + // TODO alarm
541 record.setTradeStatus(202); 542 record.setTradeStatus(202);
542 addTradeBills(record); 543 addTradeBills(record);
543 - // TODO alarm  
544 throw new ServiceException(400, "不合法的金额:" + transferAmount); 544 throw new ServiceException(400, "不合法的金额:" + transferAmount);
545 } 545 }
546 546
@@ -570,8 +570,8 @@ public class PaymentServiceImpl implements IPaymentService { @@ -570,8 +570,8 @@ public class PaymentServiceImpl implements IPaymentService {
570 } 570 }
571 } catch (Exception e) { 571 } catch (Exception e) {
572 logger.warn("transferMonErr 转账失败 , orderCode is {}, msg is {}", buyerOrderCode, e.getMessage()); 572 logger.warn("transferMonErr 转账失败 , orderCode is {}, msg is {}", buyerOrderCode, e.getMessage());
573 - transfer.setStatus(3);  
574 // TODO alarm 573 // TODO alarm
  574 + transfer.setStatus(3);
575 if(e instanceof ServiceException) { 575 if(e instanceof ServiceException) {
576 throw new ServiceException(((ServiceException) e).getCode(), e.getMessage()); 576 throw new ServiceException(((ServiceException) e).getCode(), e.getMessage());
577 } else { 577 } else {
@@ -599,6 +599,9 @@ public class PaymentServiceImpl implements IPaymentService { @@ -599,6 +599,9 @@ public class PaymentServiceImpl implements IPaymentService {
599 if (req.getOperateUid() == null || req.getOperateUid() < 1) { 599 if (req.getOperateUid() == null || req.getOperateUid() < 1) {
600 throw new ServiceException(400, "manualDeal:客服uid不合法"); 600 throw new ServiceException(400, "manualDeal:客服uid不合法");
601 } 601 }
  602 + if (StringUtils.isBlank(req.getOperateUname())) {
  603 + throw new ServiceException(400, "manualDeal:客服名称不合法");
  604 + }
602 String alipayAccount = req.getAlipayAccount(); 605 String alipayAccount = req.getAlipayAccount();
603 if (StringUtils.isBlank(alipayAccount)) { 606 if (StringUtils.isBlank(alipayAccount)) {
604 throw new ServiceException(400, "manualDeal:支付宝账号不合法"); 607 throw new ServiceException(400, "manualDeal:支付宝账号不合法");
@@ -617,6 +620,11 @@ public class PaymentServiceImpl implements IPaymentService { @@ -617,6 +620,11 @@ public class PaymentServiceImpl implements IPaymentService {
617 if (tradeBillsMapper.selectByDealRelateId(tradeBillsId) != null) { 620 if (tradeBillsMapper.selectByDealRelateId(tradeBillsId) != null) {
618 throw new ServiceException(400, "manualDeal:该流水已经处理过"); 621 throw new ServiceException(400, "manualDeal:该流水已经处理过");
619 } 622 }
  623 + String alipayAccountDb = getAlipayAccount(tradeBills.getUid());
  624 + if (StringUtils.equals(alipayAccount, alipayAccountDb)) {
  625 + logger.warn("manualDeal:传入支付宝账号和系统不一致{},{}", alipayAccount, alipayAccountDb);
  626 + throw new ServiceException(400, "manualDeal:传入支付宝账号(" + alipayAccount + ")和系统不一致(" + alipayAccountDb + ")");
  627 + }
620 long orderCode = tradeBills.getOrderCode(); 628 long orderCode = tradeBills.getOrderCode();
621 629
622 BigDecimal amount = null; 630 BigDecimal amount = null;
@@ -639,6 +647,7 @@ public class PaymentServiceImpl implements IPaymentService { @@ -639,6 +647,7 @@ public class PaymentServiceImpl implements IPaymentService {
639 preSuccess.setDealTime(now); 647 preSuccess.setDealTime(now);
640 preSuccess.setDealStatus(1); 648 preSuccess.setDealStatus(1);
641 preSuccess.setDealUid(req.getOperateUid()); 649 preSuccess.setDealUid(req.getOperateUid());
  650 + preSuccess.setDealUserName(req.getOperateUname());
642 if (tradeBillsMapper.updateToOkByPrimaryKey(preSuccess) == 0) { 651 if (tradeBillsMapper.updateToOkByPrimaryKey(preSuccess) == 0) {
643 throw new ServiceException(400, "manualDeal:流水已经处理过id=" + tradeBills.getId()); 652 throw new ServiceException(400, "manualDeal:流水已经处理过id=" + tradeBills.getId());
644 } 653 }