|
@@ -4,10 +4,12 @@ import com.alibaba.fastjson.JSONException; |
|
@@ -4,10 +4,12 @@ import com.alibaba.fastjson.JSONException; |
4
|
import com.alibaba.fastjson.JSONObject;
|
4
|
import com.alibaba.fastjson.JSONObject;
|
5
|
import com.yoho.core.config.ConfigReader;
|
5
|
import com.yoho.core.config.ConfigReader;
|
6
|
import com.yoho.core.rabbitmq.YhProducer;
|
6
|
import com.yoho.core.rabbitmq.YhProducer;
|
|
|
7
|
+import com.yoho.error.ServiceError;
|
7
|
import com.yoho.error.exception.ServiceException;
|
8
|
import com.yoho.error.exception.ServiceException;
|
8
|
import com.yoho.service.model.union.bo.*;
|
9
|
import com.yoho.service.model.union.bo.*;
|
9
|
import com.yoho.service.model.union.request.UnionShareOrderReqBO;
|
10
|
import com.yoho.service.model.union.request.UnionShareOrderReqBO;
|
10
|
import com.yoho.service.model.union.request.UnionShareOrderSearchReqBO;
|
11
|
import com.yoho.service.model.union.request.UnionShareOrderSearchReqBO;
|
|
|
12
|
+import com.yoho.service.model.union.response.PageResponseBO;
|
11
|
import com.yoho.service.model.union.response.PageUnionShareOrderRspBO;
|
13
|
import com.yoho.service.model.union.response.PageUnionShareOrderRspBO;
|
12
|
import com.yoho.service.model.union.response.UnionShareOrderRspBO;
|
14
|
import com.yoho.service.model.union.response.UnionShareOrderRspBO;
|
13
|
import com.yoho.unions.common.enums.OrderStatusEnum;
|
15
|
import com.yoho.unions.common.enums.OrderStatusEnum;
|
|
@@ -49,6 +51,9 @@ import java.util.concurrent.atomic.AtomicInteger; |
|
@@ -49,6 +51,9 @@ import java.util.concurrent.atomic.AtomicInteger; |
49
|
@Service
|
51
|
@Service
|
50
|
public class UnionShareServiceImpl implements IUnionShareService,IBusinessExportService {
|
52
|
public class UnionShareServiceImpl implements IUnionShareService,IBusinessExportService {
|
51
|
private Logger logger = LoggerFactory.getLogger(UnionShareServiceImpl.class);
|
53
|
private Logger logger = LoggerFactory.getLogger(UnionShareServiceImpl.class);
|
|
|
54
|
+ private Logger mqLog = LoggerFactory.getLogger("cps_mq");
|
|
|
55
|
+ private Logger settlementLog = LoggerFactory.getLogger("cps_settlement");
|
|
|
56
|
+// private Logger mqLog = LoggerFactory.getLogger("cps_mq");
|
52
|
|
57
|
|
53
|
@Autowired
|
58
|
@Autowired
|
54
|
private UnionShareOrdersMapper unionShareOrdersMapper;
|
59
|
private UnionShareOrdersMapper unionShareOrdersMapper;
|
|
@@ -332,16 +337,24 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
@@ -332,16 +337,24 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
332
|
}
|
337
|
}
|
333
|
|
338
|
|
334
|
@Override
|
339
|
@Override
|
335
|
- public List<UnionShareSettlement> querySettlementRecord(UnionShareOrderReqBO unionShareOrderReqBO) {
|
340
|
+ public PageResponseBO<UnionShareSettlement> querySettlementRecord(UnionShareOrderReqBO unionShareOrderReqBO) {
|
336
|
//先从缓存获取
|
341
|
//先从缓存获取
|
337
|
String key = "settlementRecord";
|
342
|
String key = "settlementRecord";
|
338
|
- UnionShareSettlementListBO cacheResult = getFromRedis(ShareOrdersKeyEnum.SETTLEMENT_LIST, unionShareOrderReqBO.getUid(),
|
|
|
339
|
- UnionShareSettlementListBO.class, key, String.valueOf(unionShareOrderReqBO.getPage()), String.valueOf(unionShareOrderReqBO.getSize()));
|
343
|
+ PageResponseBO<UnionShareSettlement> cacheResult = getFromRedis(ShareOrdersKeyEnum.SETTLEMENT_LIST, unionShareOrderReqBO.getUid(),
|
|
|
344
|
+ PageResponseBO.class, key, String.valueOf(unionShareOrderReqBO.getPage()), String.valueOf(unionShareOrderReqBO.getSize()));
|
340
|
if (cacheResult != null) {
|
345
|
if (cacheResult != null) {
|
341
|
logger.debug("UnionShareServiceImpl :: querySettlementRecord get redis cache ,uid is {},cacheResult is {}",unionShareOrderReqBO.getUid(),cacheResult);
|
346
|
logger.debug("UnionShareServiceImpl :: querySettlementRecord get redis cache ,uid is {},cacheResult is {}",unionShareOrderReqBO.getUid(),cacheResult);
|
342
|
- return cacheResult.getList();
|
347
|
+ return cacheResult;
|
343
|
}
|
348
|
}
|
344
|
//数据库获取
|
349
|
//数据库获取
|
|
|
350
|
+ //获取总数
|
|
|
351
|
+ PageResponseBO<UnionShareSettlement> response = new PageResponseBO<>();
|
|
|
352
|
+ Integer count = unionShareSettlementMapper.selectSettlementRecordCount(unionShareOrderReqBO.getUid());
|
|
|
353
|
+ if (count <= 0){
|
|
|
354
|
+ logger.info("UnionShareServiceImpl :: querySettlementRecord count is 0");
|
|
|
355
|
+ return response;
|
|
|
356
|
+ }
|
|
|
357
|
+ //分页
|
345
|
List<UnionShareSettlement> unionShareSettlementList = unionShareSettlementMapper.selectSettlementRecordByUid(unionShareOrderReqBO.getUid(),
|
358
|
List<UnionShareSettlement> unionShareSettlementList = unionShareSettlementMapper.selectSettlementRecordByUid(unionShareOrderReqBO.getUid(),
|
346
|
(unionShareOrderReqBO.getPage()-1)*unionShareOrderReqBO.getSize(), unionShareOrderReqBO.getSize());
|
359
|
(unionShareOrderReqBO.getPage()-1)*unionShareOrderReqBO.getSize(), unionShareOrderReqBO.getSize());
|
347
|
if (CollectionUtils.isNotEmpty(unionShareSettlementList)){
|
360
|
if (CollectionUtils.isNotEmpty(unionShareSettlementList)){
|
|
@@ -351,34 +364,56 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
@@ -351,34 +364,56 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
351
|
unionShareSettlement.setSettlementTimeStr(DateUtils.int2DateStr(unionShareSettlement.getSettlementTime(), DateUtils.POINT_FOMARTPATTER));
|
364
|
unionShareSettlement.setSettlementTimeStr(DateUtils.int2DateStr(unionShareSettlement.getSettlementTime(), DateUtils.POINT_FOMARTPATTER));
|
352
|
}
|
365
|
}
|
353
|
}
|
366
|
}
|
|
|
367
|
+ response.setSize(unionShareOrderReqBO.getSize());
|
|
|
368
|
+ response.setPage(unionShareOrderReqBO.getPage());
|
|
|
369
|
+ response.setTotal(count);
|
|
|
370
|
+ if (count % unionShareOrderReqBO.getSize() == 0) {
|
|
|
371
|
+ response.setTotalPage(count/unionShareOrderReqBO.getSize());
|
|
|
372
|
+ } else {
|
|
|
373
|
+ response.setTotalPage(count/unionShareOrderReqBO.getSize()+1);
|
|
|
374
|
+ }
|
|
|
375
|
+ response.setList(unionShareSettlementList);
|
354
|
//设置缓存
|
376
|
//设置缓存
|
355
|
- UnionShareSettlementListBO unionShareSettlementListBO = new UnionShareSettlementListBO();
|
|
|
356
|
- unionShareSettlementListBO.setList(unionShareSettlementList);
|
|
|
357
|
- addToRedis(ShareOrdersKeyEnum.SETTLEMENT_LIST,unionShareOrderReqBO.getUid(),unionShareSettlementListBO,key, String.valueOf(unionShareOrderReqBO.getPage()), String.valueOf(unionShareOrderReqBO.getSize()));
|
|
|
358
|
- return unionShareSettlementList;
|
377
|
+ addToRedis(ShareOrdersKeyEnum.SETTLEMENT_LIST,unionShareOrderReqBO.getUid(),response,key, String.valueOf(unionShareOrderReqBO.getPage()), String.valueOf(unionShareOrderReqBO.getSize()));
|
|
|
378
|
+ return response;
|
359
|
}
|
379
|
}
|
360
|
|
380
|
|
361
|
@Override
|
381
|
@Override
|
362
|
- public List<UnionShareOrders> queryOrderList(UnionShareOrderReqBO unionShareOrderReqBO) {
|
382
|
+ public PageResponseBO<UnionShareOrders> queryOrderList(UnionShareOrderReqBO unionShareOrderReqBO) {
|
363
|
//先从缓存获取
|
383
|
//先从缓存获取
|
364
|
- UnionShareOrdersListBO cacheResult = getFromRedis(ShareOrdersKeyEnum.ORDER_LIST, unionShareOrderReqBO.getUid(),UnionShareOrdersListBO.class, unionShareOrderReqBO.getTab1().toString(),
|
384
|
+ PageResponseBO<UnionShareOrders> cacheResult = getFromRedis(ShareOrdersKeyEnum.ORDER_LIST, unionShareOrderReqBO.getUid(),PageResponseBO.class, unionShareOrderReqBO.getTab1().toString(),
|
365
|
unionShareOrderReqBO.getTab2().toString(), String.valueOf(unionShareOrderReqBO.getPage()), String.valueOf(unionShareOrderReqBO.getSize()));
|
385
|
unionShareOrderReqBO.getTab2().toString(), String.valueOf(unionShareOrderReqBO.getPage()), String.valueOf(unionShareOrderReqBO.getSize()));
|
366
|
if (cacheResult != null) {
|
386
|
if (cacheResult != null) {
|
367
|
logger.debug("UnionShareServiceImpl :: queryOrderList get redis cache ,uid is {},cacheResult is {}",unionShareOrderReqBO.getUid(),cacheResult);
|
387
|
logger.debug("UnionShareServiceImpl :: queryOrderList get redis cache ,uid is {},cacheResult is {}",unionShareOrderReqBO.getUid(),cacheResult);
|
368
|
- return cacheResult.getList();
|
388
|
+ return cacheResult;
|
369
|
}
|
389
|
}
|
370
|
//数据库获取
|
390
|
//数据库获取
|
|
|
391
|
+ //获取总数
|
|
|
392
|
+ PageResponseBO<UnionShareOrders> response = new PageResponseBO<>();
|
|
|
393
|
+ Integer count = unionShareOrdersMapper.selectOrderListCount(unionShareOrderReqBO);
|
|
|
394
|
+ if (count <= 0){
|
|
|
395
|
+ logger.info("UnionShareServiceImpl :: queryOrderList count is 0");
|
|
|
396
|
+ return response;
|
|
|
397
|
+ }
|
|
|
398
|
+ //分页
|
371
|
//tab1表示1、全部订单;2、有效订单;3、无效订单 tab2表示1、已付款;2、待结算;3、结算中
|
399
|
//tab1表示1、全部订单;2、有效订单;3、无效订单 tab2表示1、已付款;2、待结算;3、结算中
|
372
|
unionShareOrderReqBO.setStart((unionShareOrderReqBO.getPage()-1)*unionShareOrderReqBO.getSize());
|
400
|
unionShareOrderReqBO.setStart((unionShareOrderReqBO.getPage()-1)*unionShareOrderReqBO.getSize());
|
373
|
List<UnionShareOrders> unionShareOrdersList = unionShareOrdersMapper.selectOrderList(unionShareOrderReqBO);
|
401
|
List<UnionShareOrders> unionShareOrdersList = unionShareOrdersMapper.selectOrderList(unionShareOrderReqBO);
|
374
|
//处理订单列表数据
|
402
|
//处理订单列表数据
|
375
|
dealShareOrderList(unionShareOrdersList);
|
403
|
dealShareOrderList(unionShareOrdersList);
|
|
|
404
|
+ response.setSize(unionShareOrderReqBO.getSize());
|
|
|
405
|
+ response.setPage(unionShareOrderReqBO.getPage());
|
|
|
406
|
+ response.setTotal(count);
|
|
|
407
|
+ if (count % unionShareOrderReqBO.getSize() == 0) {
|
|
|
408
|
+ response.setTotalPage(count/unionShareOrderReqBO.getSize());
|
|
|
409
|
+ } else {
|
|
|
410
|
+ response.setTotalPage(count/unionShareOrderReqBO.getSize()+1);
|
|
|
411
|
+ }
|
|
|
412
|
+ response.setList(unionShareOrdersList);
|
376
|
//设置缓存
|
413
|
//设置缓存
|
377
|
- UnionShareOrdersListBO unionShareOrdersListBO = new UnionShareOrdersListBO();
|
|
|
378
|
- unionShareOrdersListBO.setList(unionShareOrdersList);
|
|
|
379
|
- addToRedis(ShareOrdersKeyEnum.ORDER_LIST,unionShareOrderReqBO.getUid(),unionShareOrdersListBO,unionShareOrderReqBO.getTab1().toString(), unionShareOrderReqBO.getTab2().toString(),
|
414
|
+ addToRedis(ShareOrdersKeyEnum.ORDER_LIST,unionShareOrderReqBO.getUid(),response,unionShareOrderReqBO.getTab1().toString(), unionShareOrderReqBO.getTab2().toString(),
|
380
|
String.valueOf(unionShareOrderReqBO.getPage()), String.valueOf(unionShareOrderReqBO.getSize()));
|
415
|
String.valueOf(unionShareOrderReqBO.getPage()), String.valueOf(unionShareOrderReqBO.getSize()));
|
381
|
- return unionShareOrdersList;
|
416
|
+ return response;
|
382
|
}
|
417
|
}
|
383
|
|
418
|
|
384
|
/**
|
419
|
/**
|
|
@@ -519,34 +554,34 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
@@ -519,34 +554,34 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
519
|
*/
|
554
|
*/
|
520
|
@Override
|
555
|
@Override
|
521
|
public BigDecimal addSettlement(Integer uid) {
|
556
|
public BigDecimal addSettlement(Integer uid) {
|
522
|
- logger.info("addSettlement enter,uid is {}",uid);
|
557
|
+ settlementLog.info("addSettlement enter,uid is {}",uid);
|
523
|
if (uid == null ) {
|
558
|
if (uid == null ) {
|
524
|
- return null;
|
559
|
+ throw new ServiceException(ServiceError.USER_ID_ERROR);
|
525
|
}
|
560
|
}
|
526
|
//查询该用户是否为特邀用户
|
561
|
//查询该用户是否为特邀用户
|
527
|
int count = unionShareUserMapper.selectCountByUid(uid);
|
562
|
int count = unionShareUserMapper.selectCountByUid(uid);
|
528
|
if (count == 0) {
|
563
|
if (count == 0) {
|
529
|
//不是特邀用户
|
564
|
//不是特邀用户
|
530
|
- logger.info("addSettlement end,can not find unionType,uid is {}",uid);
|
|
|
531
|
- return null;
|
565
|
+ settlementLog.info("addSettlement end,can not find unionType,uid is {}",uid);
|
|
|
566
|
+ throw new ServiceException(ServiceError.USER_ID_ERROR);
|
532
|
}
|
567
|
}
|
533
|
//查询是否有处理中的提现
|
568
|
//查询是否有处理中的提现
|
534
|
if (hasSettlement(uid)) {
|
569
|
if (hasSettlement(uid)) {
|
535
|
//有处理中的提现单,不可提现
|
570
|
//有处理中的提现单,不可提现
|
536
|
- logger.info("addSettlement end,hasSettlement,uid is {}",uid);
|
|
|
537
|
- return null;
|
571
|
+ settlementLog.info("addSettlement end,hasSettlement,uid is {}",uid);
|
|
|
572
|
+ throw new ServiceException(ServiceError.UNION_HASSETTLEMENT_ERROR);
|
538
|
}
|
573
|
}
|
539
|
|
574
|
|
540
|
//查询当前是否有可提现的订单
|
575
|
//查询当前是否有可提现的订单
|
541
|
int orderCount = unionShareOrdersMapper.selectCountByCondition(uid,ShareOrdersStatusEnum.CAN_SETTLE.getCode());
|
576
|
int orderCount = unionShareOrdersMapper.selectCountByCondition(uid,ShareOrdersStatusEnum.CAN_SETTLE.getCode());
|
542
|
if (orderCount == 0 ) {
|
577
|
if (orderCount == 0 ) {
|
543
|
//没有可以提现的订单
|
578
|
//没有可以提现的订单
|
544
|
- logger.info("addSettlement end,has not remaining settlement,uid is {}",uid);
|
|
|
545
|
- return null;
|
579
|
+ settlementLog.info("addSettlement end,has not remaining settlement,uid is {}",uid);
|
|
|
580
|
+ throw new ServiceException(ServiceError.UNION_HASNOT_REMAINING_SETTLEMENT);
|
546
|
}
|
581
|
}
|
547
|
- //todo 生成取现单,绑定订单,考虑是否异步操作
|
582
|
+ // 生成取现单,绑定订单
|
548
|
BigDecimal amount = relateSettlementAndOrder(uid);
|
583
|
BigDecimal amount = relateSettlementAndOrder(uid);
|
549
|
- logger.info("addSettlement end,remaining settlement is {},uid is {}",amount,uid);
|
584
|
+ settlementLog.info("addSettlement end,remaining settlement is {},uid is {}",amount,uid);
|
550
|
return amount;
|
585
|
return amount;
|
551
|
}
|
586
|
}
|
552
|
|
587
|
|
|
@@ -635,22 +670,22 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
@@ -635,22 +670,22 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
635
|
* */
|
670
|
* */
|
636
|
public BigDecimal relateSettlementAndOrder(int uid) {
|
671
|
public BigDecimal relateSettlementAndOrder(int uid) {
|
637
|
|
672
|
|
638
|
- logger.info("relateSettlementAndOrder enter,uid is {}",uid);
|
673
|
+ settlementLog.info("relateSettlementAndOrder enter,uid is {}",uid);
|
639
|
|
674
|
|
640
|
//生成提现编号
|
675
|
//生成提现编号
|
641
|
String settlementCode = createSettlementCode();
|
676
|
String settlementCode = createSettlementCode();
|
642
|
- logger.info("relateSettlementAndOrder,uid is {},settlementCode is {}",uid,settlementCode);
|
677
|
+ settlementLog.info("relateSettlementAndOrder,uid is {},settlementCode is {}",uid,settlementCode);
|
643
|
|
678
|
|
644
|
//更新订单状态,由可结算变为打款中
|
679
|
//更新订单状态,由可结算变为打款中
|
645
|
int updateTime = DateUtil.getCurrentTimeSecond();
|
680
|
int updateTime = DateUtil.getCurrentTimeSecond();
|
646
|
int count=unionShareOrdersMapper.updateStatusByUid(uid,settlementCode, ShareOrdersStatusEnum.CAN_SETTLE.getCode(), ShareOrdersStatusEnum.SETTLE.getCode(), updateTime);
|
681
|
int count=unionShareOrdersMapper.updateStatusByUid(uid,settlementCode, ShareOrdersStatusEnum.CAN_SETTLE.getCode(), ShareOrdersStatusEnum.SETTLE.getCode(), updateTime);
|
647
|
if (count == 0) {
|
682
|
if (count == 0) {
|
648
|
- logger.info("relateSettlementAndOrder end,uid is {},settlementCode is {},There are no available orders.",uid,settlementCode);
|
|
|
649
|
- return null;
|
683
|
+ settlementLog.info("relateSettlementAndOrder end,uid is {},settlementCode is {},There are no available orders.",uid,settlementCode);
|
|
|
684
|
+ throw new ServiceException(ServiceError.UNION_SETTLEMENT_UNAVAILABLE_ORDER_ERROR);
|
650
|
}
|
685
|
}
|
651
|
//计算提现金额
|
686
|
//计算提现金额
|
652
|
BigDecimal totalAmount=unionShareOrdersMapper.selectAmountBySettleCode(uid, settlementCode);
|
687
|
BigDecimal totalAmount=unionShareOrdersMapper.selectAmountBySettleCode(uid, settlementCode);
|
653
|
- logger.info("relateSettlementAndOrder,uid is {},settlementCode is {},totalAmount is {}",uid,settlementCode,totalAmount);
|
688
|
+ settlementLog.info("relateSettlementAndOrder,uid is {},settlementCode is {},totalAmount is {}",uid,settlementCode,totalAmount);
|
654
|
|
689
|
|
655
|
//生成提现单
|
690
|
//生成提现单
|
656
|
UnionShareSettlement insertReq = new UnionShareSettlement();
|
691
|
UnionShareSettlement insertReq = new UnionShareSettlement();
|
|
@@ -662,8 +697,8 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
@@ -662,8 +697,8 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
662
|
insertReq.setStatus((byte)1);//是否打款成功:1-处理中,2-已打款
|
697
|
insertReq.setStatus((byte)1);//是否打款成功:1-处理中,2-已打款
|
663
|
int num=unionShareSettlementMapper.insertSelective(insertReq);
|
698
|
int num=unionShareSettlementMapper.insertSelective(insertReq);
|
664
|
if (num < 1) {
|
699
|
if (num < 1) {
|
665
|
- //插入失败
|
|
|
666
|
- logger.warn("relateSettlementAndOrder end,uid is {},settlementCode is {},totalAmount is {},insert nothing.",uid,settlementCode,totalAmount);
|
700
|
+ //插入失败 todo 日志记录
|
|
|
701
|
+ settlementLog.warn("relateSettlementAndOrder end,uid is {},settlementCode is {},totalAmount is {},insert nothing.",uid,settlementCode,totalAmount);
|
667
|
}
|
702
|
}
|
668
|
|
703
|
|
669
|
Set<String> orderCodes = new HashSet<>();
|
704
|
Set<String> orderCodes = new HashSet<>();
|
|
@@ -679,20 +714,21 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
@@ -679,20 +714,21 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
679
|
}
|
714
|
}
|
680
|
if (orderCodes.size() == 0) {
|
715
|
if (orderCodes.size() == 0) {
|
681
|
//不该查不到订单
|
716
|
//不该查不到订单
|
682
|
- logger.warn("relateSettlementAndOrder end,uid is {},settlementCode is {},totalAmount is {},can not find orders.",uid,settlementCode,totalAmount);
|
|
|
683
|
- return null;
|
717
|
+ settlementLog.warn("relateSettlementAndOrder end,uid is {},settlementCode is {},totalAmount is {},can not find orders.",uid,settlementCode,totalAmount);
|
|
|
718
|
+ throw new ServiceException(ServiceError.UNION_SETTLEMENT_CANNOT_FIND_ORDER_ERROR);
|
684
|
}
|
719
|
}
|
685
|
|
720
|
|
686
|
|
721
|
|
687
|
//清缓存
|
722
|
//清缓存
|
688
|
clearShareOrderRedis(uid);
|
723
|
clearShareOrderRedis(uid);
|
689
|
|
724
|
|
690
|
- //todo 发送取现mq给erp SETTLEMENT_TOPIC
|
725
|
+ // 发送取现mq给erp SETTLEMENT_TOPIC
|
691
|
ShareSettlementBo bo = new ShareSettlementBo();
|
726
|
ShareSettlementBo bo = new ShareSettlementBo();
|
692
|
BeanUtils.copyProperties(insertReq,bo);
|
727
|
BeanUtils.copyProperties(insertReq,bo);
|
693
|
bo.setOrderCodes(orderCodes);
|
728
|
bo.setOrderCodes(orderCodes);
|
694
|
- logger.info("relateSettlementAndOrder,send mq {} to erp,uid is {},settlementCode is {},bo is {}", SETTLEMENT_TOPIC, uid, settlementCode, bo);
|
729
|
+ mqLog.info("relateSettlementAndOrder,send mq {} to erp,uid is {},settlementCode is {},bo is {}", SETTLEMENT_TOPIC, uid, settlementCode, bo);
|
695
|
yhProducer.send(SETTLEMENT_TOPIC, bo);
|
730
|
yhProducer.send(SETTLEMENT_TOPIC, bo);
|
|
|
731
|
+ settlementLog.info("relateSettlementAndOrder,send mq {} to erp success,uid is {},settlementCode is {},bo is {}", SETTLEMENT_TOPIC, uid, settlementCode, bo);
|
696
|
return totalAmount;
|
732
|
return totalAmount;
|
697
|
}
|
733
|
}
|
698
|
|
734
|
|
|
@@ -708,10 +744,17 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
@@ -708,10 +744,17 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
708
|
|
744
|
|
709
|
//是否打款成功:1-处理中,2-已打款
|
745
|
//是否打款成功:1-处理中,2-已打款
|
710
|
if (bo.getStatus() == null || bo.getStatus().intValue() != 2) {
|
746
|
if (bo.getStatus() == null || bo.getStatus().intValue() != 2) {
|
|
|
747
|
+ logger.info("updateSettlementStatus end,status error changed,bo is {}",bo);
|
711
|
return;
|
748
|
return;
|
712
|
}
|
749
|
}
|
713
|
UnionShareSettlement unionShareSettlement = unionShareSettlementMapper.selectByCode(bo.getSettlementCode());
|
750
|
UnionShareSettlement unionShareSettlement = unionShareSettlementMapper.selectByCode(bo.getSettlementCode());
|
714
|
if (unionShareSettlement == null) {
|
751
|
if (unionShareSettlement == null) {
|
|
|
752
|
+ logger.info("updateSettlementStatus end,settlementCode doesn't exist,bo is {}",bo);
|
|
|
753
|
+ return;
|
|
|
754
|
+ }
|
|
|
755
|
+ if (unionShareSettlement.getStatus().intValue()==2) {
|
|
|
756
|
+ //已更新,多余mq略过
|
|
|
757
|
+ logger.info("updateSettlementStatus end,status is already changed,bo is {}",bo);
|
715
|
return;
|
758
|
return;
|
716
|
}
|
759
|
}
|
717
|
//更新结算状态
|
760
|
//更新结算状态
|