Merge branch 'test6.8.9' of http://git.yoho.cn/ufo/yohoufo-fore into test6.8.9
Showing
9 changed files
with
217 additions
and
17 deletions
@@ -35,4 +35,6 @@ public interface SellerOrderGoodsViewMapper { | @@ -35,4 +35,6 @@ public interface SellerOrderGoodsViewMapper { | ||
35 | @Param("limit")Integer limit); | 35 | @Param("limit")Integer limit); |
36 | 36 | ||
37 | int selectEntryCntByUidStatusGBSku(SellerOrderGoods condition); | 37 | int selectEntryCntByUidStatusGBSku(SellerOrderGoods condition); |
38 | + | ||
39 | + List<SellerOrderGoods> selectCanSellByStorageId(@Param("storageId")int storageId); | ||
38 | } | 40 | } |
@@ -123,4 +123,11 @@ | @@ -123,4 +123,11 @@ | ||
123 | ) t | 123 | ) t |
124 | </select> | 124 | </select> |
125 | 125 | ||
126 | + | ||
127 | + <select id="selectCanSellByStorageId" resultMap="BaseResultMap"> | ||
128 | + SELECT <include refid="Base_Column_List" /> | ||
129 | + FROM seller_order_goods | ||
130 | + WHERE storage_id = #{storageId,jdbcType=INTEGER} and status = 1 | ||
131 | + </select> | ||
132 | + | ||
126 | </mapper> | 133 | </mapper> |
@@ -136,7 +136,32 @@ public class ActionStatusHold { | @@ -136,7 +136,32 @@ public class ActionStatusHold { | ||
136 | static { | 136 | static { |
137 | sellerCanCancelBuyerOrderStatus = Arrays.asList(OrderStatus.HAS_PAYED.getCode()); | 137 | sellerCanCancelBuyerOrderStatus = Arrays.asList(OrderStatus.HAS_PAYED.getCode()); |
138 | } | 138 | } |
139 | + | ||
140 | + /** | ||
141 | + * 未完成的订单状态,商家退驻时需要 | ||
142 | + * @return | ||
143 | + */ | ||
144 | + | ||
145 | + public static List<Integer> unfinishedOrderStatusCode = Arrays.asList( | ||
146 | + OrderStatus.WAITING_PAY.getCode(), | ||
147 | + OrderStatus.HAS_PAYED.getCode(), | ||
148 | + OrderStatus.SELLER_SEND_OUT.getCode(), | ||
149 | + OrderStatus.PLATFORM_RECEIVE.getCode(), | ||
150 | + OrderStatus.PLATFORM_CHECKING.getCode(), | ||
151 | + OrderStatus.MINI_FAULT_WAITING.getCode(), | ||
152 | + OrderStatus.MINI_FAULT_ACCEPT.getCode(), | ||
153 | + OrderStatus.JUDGE_PASS.getCode() | ||
154 | + ); | ||
155 | + | ||
156 | + } | ||
157 | + | ||
158 | + public static List<Integer> getUnfinishedOrderStatusCode(){ | ||
159 | + return SellerASH.unfinishedOrderStatusCode; | ||
139 | } | 160 | } |
161 | + | ||
162 | + | ||
163 | + | ||
164 | + | ||
140 | public static List<Integer> getSellerShowExpressStatusList(){ | 165 | public static List<Integer> getSellerShowExpressStatusList(){ |
141 | return SellerASH.View_Express_Status; | 166 | return SellerASH.View_Express_Status; |
142 | } | 167 | } |
1 | +package com.yohoufo.order.event; | ||
2 | + | ||
3 | +import com.yohoufo.common.alarm.Event; | ||
4 | +import lombok.AllArgsConstructor; | ||
5 | +import lombok.Data; | ||
6 | +import lombok.NoArgsConstructor; | ||
7 | +import lombok.experimental.Builder; | ||
8 | + | ||
9 | +/** | ||
10 | + * Created by craig.qin on 2019/3/20. | ||
11 | + * 价格变动(调价、新的上架)发消息 | ||
12 | + */ | ||
13 | +@Data | ||
14 | +@Builder | ||
15 | +@NoArgsConstructor | ||
16 | +@AllArgsConstructor | ||
17 | +public class SellerOrderPriceChangeEvent extends Event{ | ||
18 | + | ||
19 | + private int sellerUid; | ||
20 | + | ||
21 | + private Integer skup; | ||
22 | +} |
1 | +package com.yohoufo.order.service.handler; | ||
2 | + | ||
3 | +import com.google.common.eventbus.Subscribe; | ||
4 | +import com.yoho.core.redis.cluster.annotation.Redis; | ||
5 | +import com.yoho.core.redis.cluster.operations.nosync.YHRedisTemplate; | ||
6 | +import com.yoho.core.redis.cluster.operations.nosync.YHSetOperations; | ||
7 | +import com.yoho.core.redis.cluster.operations.serializer.RedisKeyBuilder; | ||
8 | +import com.yohobuy.ufo.model.order.common.SkupStatus; | ||
9 | +import com.yohoufo.common.alarm.IEventHandler; | ||
10 | +import com.yohoufo.dal.order.SellerOrderGoodsMapper; | ||
11 | +import com.yohoufo.dal.order.SellerOrderGoodsViewMapper; | ||
12 | +import com.yohoufo.dal.order.model.SellerOrderGoods; | ||
13 | +import com.yohoufo.order.event.SellerOrderPriceChangeEvent; | ||
14 | +import com.yohoufo.order.service.proxy.InBoxFacade; | ||
15 | +import org.apache.commons.collections.CollectionUtils; | ||
16 | +import org.slf4j.Logger; | ||
17 | +import org.slf4j.LoggerFactory; | ||
18 | +import org.springframework.beans.factory.annotation.Autowired; | ||
19 | +import org.springframework.stereotype.Component; | ||
20 | + | ||
21 | +import java.math.BigDecimal; | ||
22 | +import java.text.SimpleDateFormat; | ||
23 | +import java.util.Date; | ||
24 | +import java.util.HashSet; | ||
25 | +import java.util.List; | ||
26 | +import java.util.Set; | ||
27 | +import java.util.concurrent.TimeUnit; | ||
28 | +import java.util.stream.Collectors; | ||
29 | + | ||
30 | +/** | ||
31 | + * Created by craig | ||
32 | + */ | ||
33 | +@Component | ||
34 | +public class SellerOrderPriceChangeHandler implements IEventHandler<SellerOrderPriceChangeEvent> { | ||
35 | + | ||
36 | + final Logger logger = LoggerFactory.getLogger(getClass()); | ||
37 | + | ||
38 | + @Autowired | ||
39 | + private SellerOrderGoodsMapper sellerOrderGoodsMapper; | ||
40 | + | ||
41 | + @Autowired | ||
42 | + private SellerOrderGoodsViewMapper sellerOrderGoodsViewMapper; | ||
43 | + | ||
44 | + @Autowired | ||
45 | + private InBoxFacade inBoxFacade; | ||
46 | + | ||
47 | + @Redis("gwNoSyncRedis") | ||
48 | + YHSetOperations yhSetOperations; | ||
49 | + | ||
50 | + @Redis("gwNoSyncRedis") | ||
51 | + YHRedisTemplate yhRedisTemplate; | ||
52 | + | ||
53 | + private final SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); | ||
54 | + | ||
55 | + @Override | ||
56 | + @Subscribe | ||
57 | + public void handle(SellerOrderPriceChangeEvent event) { | ||
58 | + logger.info("Subscribe SellerOrderPriceChangeEvent msg, event {}", event); | ||
59 | + SellerOrderGoods sog = sellerOrderGoodsMapper.selectByPrimaryKey(event.getSkup()); | ||
60 | + if(sog==null){ | ||
61 | + logger.warn("Subscribe SellerOrderPriceChangeEvent msg return SellerOrderGoods is null, event {}", event); | ||
62 | + return ; | ||
63 | + } | ||
64 | + if(SkupStatus.CAN_SELL.getCode()!=sog.getStatus()){ | ||
65 | + logger.warn("Subscribe SellerOrderPriceChangeEvent msg return SellerOrderGoods status is not can sell , event {} ,sog {}", event,sog); | ||
66 | + return ; | ||
67 | + } | ||
68 | + int changedSellerUid = sog.getUid(); | ||
69 | + BigDecimal changedPrice = sog.getGoodsPrice(); | ||
70 | + //根据storageId获取所有在售的卖家的订单 | ||
71 | + List<SellerOrderGoods> list= sellerOrderGoodsViewMapper.selectCanSellByStorageId(sog.getStorageId()); | ||
72 | + //把自己过滤掉,只保留价格高于当前价格 | ||
73 | + list = list.stream().filter(r->r.getGoodsPrice().compareTo(changedPrice)>0&&changedSellerUid!=r.getUid().intValue()).collect(Collectors.toList()); | ||
74 | + //从redis过滤uid+storgeid+date | ||
75 | + Date currentTime = new Date(); | ||
76 | + String dateString = formatter.format(currentTime);//2019-03-20 | ||
77 | + | ||
78 | + //发送,并记录到redis | ||
79 | + RedisKeyBuilder redisKey = getRedisKeyBuilder(dateString); | ||
80 | + Set<String> members = yhSetOperations.members(redisKey); | ||
81 | + if(CollectionUtils.isNotEmpty(members)){ | ||
82 | + list = list.stream().filter(r->!members.contains(getValueForSet(r))).collect(Collectors.toList()); | ||
83 | + } | ||
84 | + Set<Integer> noticeSellerUidList = new HashSet<>(); | ||
85 | + Set<String> redisSetValue = new HashSet<>(); | ||
86 | + for(SellerOrderGoods r:list){ | ||
87 | + noticeSellerUidList.add(r.getUid()); | ||
88 | + redisSetValue.add(getValueForSet(r)); | ||
89 | + } | ||
90 | + logger.info("Subscribe SellerOrderPriceChangeEvent begin send msg, event {},noticeSellerUidList {} ,redisSetValue {}", event,noticeSellerUidList,redisSetValue); | ||
91 | + //发消息 | ||
92 | + inBoxFacade.noticeSellerWhenOtherChangePriceLower(sog,noticeSellerUidList); | ||
93 | + // 记录到redis | ||
94 | + if(redisSetValue.size()>0){ | ||
95 | + yhSetOperations.add(redisKey,redisSetValue.toArray(new String[redisSetValue.size()])); | ||
96 | + yhRedisTemplate.longExpire(redisKey, 24, TimeUnit.HOURS); //24小时失效 | ||
97 | + } | ||
98 | + } | ||
99 | + | ||
100 | + public String getValueForSet(SellerOrderGoods r){ | ||
101 | + return r.getUid()+"-"+r.getStorageId(); | ||
102 | + } | ||
103 | + | ||
104 | + public static RedisKeyBuilder getRedisKeyBuilder(String dateString){ | ||
105 | + return RedisKeyBuilder.newInstance().appendFixed("ufo:order:price:change:").appendVar(dateString); | ||
106 | + } | ||
107 | +} |
@@ -678,7 +678,7 @@ public class PaymentServiceImpl implements IPaymentService { | @@ -678,7 +678,7 @@ public class PaymentServiceImpl implements IPaymentService { | ||
678 | logger.info("transferMon uid {} 支付宝账号uid无值使用账号{}", targetUid, account.getAlipayAccount()); | 678 | logger.info("transferMon uid {} 支付宝账号uid无值使用账号{}", targetUid, account.getAlipayAccount()); |
679 | transfer.setAlipayAccount(account.getAlipayAccount()); | 679 | transfer.setAlipayAccount(account.getAlipayAccount()); |
680 | } | 680 | } |
681 | - | 681 | + transfer.setUpdateTime(now); |
682 | tradeBillsMapper.insert(record); | 682 | tradeBillsMapper.insert(record); |
683 | 683 | ||
684 | String alipayAccount = transfer.getAlipayAccount(); | 684 | String alipayAccount = transfer.getAlipayAccount(); |
@@ -689,7 +689,8 @@ public class PaymentServiceImpl implements IPaymentService { | @@ -689,7 +689,8 @@ public class PaymentServiceImpl implements IPaymentService { | ||
689 | logger.info("transferMon开始调用阿里接口参数buyerOrderCode={}, alipayAccount={}, transferAmount={}", buyerOrderCode, alipayAccount, transferAmount); | 689 | logger.info("transferMon开始调用阿里接口参数buyerOrderCode={}, alipayAccount={}, transferAmount={}", buyerOrderCode, alipayAccount, transferAmount); |
690 | 690 | ||
691 | if(exceedMillion()) { | 691 | if(exceedMillion()) { |
692 | - transfer.setTransferType(2); | 692 | + transfer.setInterfaceType(2); |
693 | + ordersPayTransferMapper.updateByPrimaryKeySelective(transfer); | ||
693 | Map<String, String> mapResult = transferWhenExceedMillion(transfer.getId(), record, buyerOrderCode, account, transferAmount, now); | 694 | Map<String, String> mapResult = transferWhenExceedMillion(transfer.getId(), record, buyerOrderCode, account, transferAmount, now); |
694 | String resultStr = JSON.toJSONString(mapResult); | 695 | String resultStr = JSON.toJSONString(mapResult); |
695 | jsonObject = JSON.parseObject(resultStr); | 696 | jsonObject = JSON.parseObject(resultStr); |
@@ -701,7 +702,8 @@ public class PaymentServiceImpl implements IPaymentService { | @@ -701,7 +702,8 @@ public class PaymentServiceImpl implements IPaymentService { | ||
701 | } | 702 | } |
702 | } | 703 | } |
703 | 704 | ||
704 | - transfer.setTransferType(1); | 705 | + transfer.setInterfaceType(1); |
706 | + ordersPayTransferMapper.updateByPrimaryKeySelective(transfer); | ||
705 | jsonObject = alipayService.transferMoney(Long.toString(buyerOrderCode), account.getAlipayId(), account.getAlipayAccount(), transferAmount); | 707 | jsonObject = alipayService.transferMoney(Long.toString(buyerOrderCode), account.getAlipayId(), account.getAlipayAccount(), transferAmount); |
706 | if (jsonObject == null) { | 708 | if (jsonObject == null) { |
707 | logger.warn("transferMonErr 转账失败 , orderCode is {}", buyerOrderCode); | 709 | logger.warn("transferMonErr 转账失败 , orderCode is {}", buyerOrderCode); |
@@ -720,7 +722,8 @@ public class PaymentServiceImpl implements IPaymentService { | @@ -720,7 +722,8 @@ public class PaymentServiceImpl implements IPaymentService { | ||
720 | transfer.setAlipayTradeId(orderId); | 722 | transfer.setAlipayTradeId(orderId); |
721 | transfer.setStatus(1); | 723 | transfer.setStatus(1); |
722 | } else if(exceedMillion(jsonObject)) { | 724 | } else if(exceedMillion(jsonObject)) { |
723 | - transfer.setTransferType(2); | 725 | + transfer.setInterfaceType(2); |
726 | + ordersPayTransferMapper.updateByPrimaryKeySelective(transfer); | ||
724 | Map<String, String> mapResult = transferWhenExceedMillion(transfer.getId(), record, buyerOrderCode, account, transferAmount, now); | 727 | Map<String, String> mapResult = transferWhenExceedMillion(transfer.getId(), record, buyerOrderCode, account, transferAmount, now); |
725 | String resultStr = JSON.toJSONString(mapResult); | 728 | String resultStr = JSON.toJSONString(mapResult); |
726 | jsonObject = JSON.parseObject(resultStr); | 729 | jsonObject = JSON.parseObject(resultStr); |
@@ -754,7 +757,6 @@ public class PaymentServiceImpl implements IPaymentService { | @@ -754,7 +757,6 @@ public class PaymentServiceImpl implements IPaymentService { | ||
754 | return; | 757 | return; |
755 | } | 758 | } |
756 | logger.info("transferMon最后更新状态 status= {}", transfer.getStatus()); | 759 | logger.info("transferMon最后更新状态 status= {}", transfer.getStatus()); |
757 | - transfer.setUpdateTime(now); | ||
758 | ordersPayTransferMapper.updateByPrimaryKeySelective(transfer); | 760 | ordersPayTransferMapper.updateByPrimaryKeySelective(transfer); |
759 | // 100:成功;201:没有支付宝账号;202:金额不合法;299:转账失败 | 761 | // 100:成功;201:没有支付宝账号;202:金额不合法;299:转账失败 |
760 | record.setTradeStatus(transfer.getStatus() == 1 ? 100 : 299); | 762 | record.setTradeStatus(transfer.getStatus() == 1 ? 100 : 299); |
@@ -812,11 +814,13 @@ public class PaymentServiceImpl implements IPaymentService { | @@ -812,11 +814,13 @@ public class PaymentServiceImpl implements IPaymentService { | ||
812 | // 转账 | 814 | // 转账 |
813 | JSONObject jsonObject = null; | 815 | JSONObject jsonObject = null; |
814 | boolean exceedMillionAndSuccess = false; | 816 | boolean exceedMillionAndSuccess = false; |
817 | + transfer.setUpdateTime(now); | ||
815 | try { | 818 | try { |
816 | logger.info("transAllEarnest开始调用阿里接口参数buyerOrderCode={}, alipayAccount={}, transferAmount={}", orderCode, account, amount); | 819 | logger.info("transAllEarnest开始调用阿里接口参数buyerOrderCode={}, alipayAccount={}, transferAmount={}", orderCode, account, amount); |
817 | 820 | ||
818 | if(exceedMillion()) { | 821 | if(exceedMillion()) { |
819 | - transfer.setTransferType(2); | 822 | + transfer.setInterfaceType(2); |
823 | + ordersPayTransferMapper.updateByPrimaryKeySelective(transfer); | ||
820 | Map<String, String> mapResult = transferWhenExceedMillion(transfer.getId(), record, orderCode, aliPayAccount, amount, now); | 824 | Map<String, String> mapResult = transferWhenExceedMillion(transfer.getId(), record, orderCode, aliPayAccount, amount, now); |
821 | String resultStr = JSON.toJSONString(mapResult); | 825 | String resultStr = JSON.toJSONString(mapResult); |
822 | jsonObject = JSON.parseObject(resultStr); | 826 | jsonObject = JSON.parseObject(resultStr); |
@@ -828,7 +832,8 @@ public class PaymentServiceImpl implements IPaymentService { | @@ -828,7 +832,8 @@ public class PaymentServiceImpl implements IPaymentService { | ||
828 | } | 832 | } |
829 | } | 833 | } |
830 | 834 | ||
831 | - transfer.setTransferType(1); | 835 | + transfer.setInterfaceType(1); |
836 | + ordersPayTransferMapper.updateByPrimaryKeySelective(transfer); | ||
832 | jsonObject = alipayService.transferMoney(Long.toString(orderCode), aliPayAccount.getAlipayId(), aliPayAccount.getAlipayAccount(), amount); | 837 | jsonObject = alipayService.transferMoney(Long.toString(orderCode), aliPayAccount.getAlipayId(), aliPayAccount.getAlipayAccount(), amount); |
833 | if (jsonObject == null) { | 838 | if (jsonObject == null) { |
834 | logger.warn("transAllEarnestErr 转账失败 , orderCode is {}", orderCode); | 839 | logger.warn("transAllEarnestErr 转账失败 , orderCode is {}", orderCode); |
@@ -848,7 +853,8 @@ public class PaymentServiceImpl implements IPaymentService { | @@ -848,7 +853,8 @@ public class PaymentServiceImpl implements IPaymentService { | ||
848 | transfer.setStatus(1); | 853 | transfer.setStatus(1); |
849 | return true; | 854 | return true; |
850 | } else if(exceedMillion(jsonObject)) { | 855 | } else if(exceedMillion(jsonObject)) { |
851 | - transfer.setTransferType(2); | 856 | + transfer.setInterfaceType(2); |
857 | + ordersPayTransferMapper.updateByPrimaryKeySelective(transfer); | ||
852 | Map<String, String> mapResult = transferWhenExceedMillion(transfer.getId(), record, orderCode, aliPayAccount, amount, now); | 858 | Map<String, String> mapResult = transferWhenExceedMillion(transfer.getId(), record, orderCode, aliPayAccount, amount, now); |
853 | String resultStr = JSON.toJSONString(mapResult); | 859 | String resultStr = JSON.toJSONString(mapResult); |
854 | jsonObject = JSON.parseObject(resultStr); | 860 | jsonObject = JSON.parseObject(resultStr); |
@@ -1075,7 +1081,7 @@ public class PaymentServiceImpl implements IPaymentService { | @@ -1075,7 +1081,7 @@ public class PaymentServiceImpl implements IPaymentService { | ||
1075 | } | 1081 | } |
1076 | } | 1082 | } |
1077 | JSONObject jsonObject = null; | 1083 | JSONObject jsonObject = null; |
1078 | - Integer transferType = null; | 1084 | + Integer interfaceType = null; |
1079 | try { | 1085 | try { |
1080 | OrdersPayTransfer transfer = ordersPayTransferMapper.selectByBuyerOrderCode(orderCode); | 1086 | OrdersPayTransfer transfer = ordersPayTransferMapper.selectByBuyerOrderCode(orderCode); |
1081 | if (transfer == null) { | 1087 | if (transfer == null) { |
@@ -1084,16 +1090,16 @@ public class PaymentServiceImpl implements IPaymentService { | @@ -1084,16 +1090,16 @@ public class PaymentServiceImpl implements IPaymentService { | ||
1084 | if (transfer == null || transfer.getStatus() == 1) { | 1090 | if (transfer == null || transfer.getStatus() == 1) { |
1085 | throw new ServiceException(400, "转账记录已成功转账,流水id=" + tradeBillsId); | 1091 | throw new ServiceException(400, "转账记录已成功转账,流水id=" + tradeBillsId); |
1086 | } | 1092 | } |
1087 | - transferType = transfer.getInterfaceType(); | ||
1088 | - if (transferType == null || transferType < 1 || transferType > 2) { | ||
1089 | - throw new ServiceException(400, "转账记录接口类型有误,流水id=" + tradeBillsId); | ||
1090 | - } | 1093 | + interfaceType = transfer.getInterfaceType(); |
1091 | 1094 | ||
1092 | - if (transferType == 2) { | 1095 | + logger.info("manualDeal orderCode={}, tradeBillId={}, 转账接口类型为 {}", orderCode, tradeBillsId, interfaceType); |
1096 | + if (interfaceType != null && interfaceType == 2) { | ||
1097 | + logger.info("manualDeal orderCode={}, tradeBillId={}, 转账接口类型为 超过100万的接口", orderCode, tradeBillsId); | ||
1093 | transferWhenExceedMillion(transfer.getId(), preSuccess, orderCode, account, amount, now); | 1098 | transferWhenExceedMillion(transfer.getId(), preSuccess, orderCode, account, amount, now); |
1094 | return; | 1099 | return; |
1095 | } | 1100 | } |
1096 | 1101 | ||
1102 | + logger.info("manualDeal orderCode={}, tradeBillId={}, 转账接口类型为 小于100万的接口", orderCode, tradeBillsId); | ||
1097 | jsonObject = alipayService.transferMoney(Long.toString(orderCode), account.getAlipayId(), account.getAlipayAccount(), amount); | 1103 | jsonObject = alipayService.transferMoney(Long.toString(orderCode), account.getAlipayId(), account.getAlipayAccount(), amount); |
1098 | if (jsonObject == null) { | 1104 | if (jsonObject == null) { |
1099 | logger.warn("manualDeal 转账失败 , req is {}", req); | 1105 | logger.warn("manualDeal 转账失败 , req is {}", req); |
@@ -1127,7 +1133,7 @@ public class PaymentServiceImpl implements IPaymentService { | @@ -1127,7 +1133,7 @@ public class PaymentServiceImpl implements IPaymentService { | ||
1127 | throw new ServiceException(500, "转账失败:返回code="+code+",order_id="+orderId); | 1133 | throw new ServiceException(500, "转账失败:返回code="+code+",order_id="+orderId); |
1128 | } | 1134 | } |
1129 | } catch (Exception e) { | 1135 | } catch (Exception e) { |
1130 | - if (transferType != null && transferType == 2) { | 1136 | + if (interfaceType != null && interfaceType == 2) { |
1131 | return; | 1137 | return; |
1132 | } | 1138 | } |
1133 | logger.warn("manualDealErr 转账失败 , orderCode is {}, msg is {}", orderCode, e.getMessage()); | 1139 | logger.warn("manualDealErr 转账失败 , orderCode is {}, msg is {}", orderCode, e.getMessage()); |
@@ -814,7 +814,7 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi | @@ -814,7 +814,7 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi | ||
814 | */ | 814 | */ |
815 | public int getUnfinishedOrderBySellerUid(Integer uid){ | 815 | public int getUnfinishedOrderBySellerUid(Integer uid){ |
816 | log.info("in seller order getUnfinishedOrderBySellerUid count uid {} ", uid); | 816 | log.info("in seller order getUnfinishedOrderBySellerUid count uid {} ", uid); |
817 | - List<Integer> statusList = OrderStatus.getUnfinishedOrderStatusCode(); | 817 | + List<Integer> statusList = ActionStatusHold.getUnfinishedOrderStatusCode(); |
818 | Integer total = buyerOrderMapper.selectCntBySellerUidStatus(uid, statusList); | 818 | Integer total = buyerOrderMapper.selectCntBySellerUidStatus(uid, statusList); |
819 | log.info("in seller order getUnfinishedOrderBySellerUid count uid {}, total {} ", uid, total); | 819 | log.info("in seller order getUnfinishedOrderBySellerUid count uid {}, total {} ", uid, total); |
820 | return total; | 820 | return total; |
@@ -21,6 +21,7 @@ import java.math.BigDecimal; | @@ -21,6 +21,7 @@ import java.math.BigDecimal; | ||
21 | import java.util.Arrays; | 21 | import java.util.Arrays; |
22 | import java.util.List; | 22 | import java.util.List; |
23 | import java.util.Optional; | 23 | import java.util.Optional; |
24 | +import java.util.Set; | ||
24 | import java.util.concurrent.ArrayBlockingQueue; | 25 | import java.util.concurrent.ArrayBlockingQueue; |
25 | import java.util.concurrent.ExecutorService; | 26 | import java.util.concurrent.ExecutorService; |
26 | import java.util.concurrent.ThreadPoolExecutor; | 27 | import java.util.concurrent.ThreadPoolExecutor; |
@@ -945,6 +946,36 @@ public class InBoxFacade { | @@ -945,6 +946,36 @@ public class InBoxFacade { | ||
945 | } | 946 | } |
946 | } | 947 | } |
947 | 948 | ||
949 | + /** | ||
950 | + * 更低的出价提醒 | ||
951 | + * @param sog | ||
952 | + */ | ||
953 | + public void noticeSellerWhenOtherChangePriceLower(SellerOrderGoods sog,Set<Integer> noticeSellerUidList){ | ||
954 | + String prdName = sog.getProductName(); | ||
955 | + String sizeName = sog.getSizeName(); | ||
956 | + try { | ||
957 | + executorService.execute(() -> { | ||
958 | + // 发站内信 | ||
959 | + logger.info("record noticeSellerWhenOtherChangePriceLower for seller,noticeSellerUidList {}, sog {}", noticeSellerUidList, sog); | ||
960 | + | ||
961 | + Product product = productMapper.selectByPrimaryKey(sog.getProductId()); | ||
962 | + String productCode = product.getProductCode(); | ||
963 | + String params = buildParams(prdName, sizeName,productCode,sog.getGoodsPrice().toPlainString()); | ||
964 | + | ||
965 | + noticeSellerUidList.stream().forEach( | ||
966 | + sellerUid ->{ | ||
967 | + InboxReqVO req = buildInboxReqVO(sellerUid, params, InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_OTHER_LOWER_PRICE); | ||
968 | + InBoxResponse resp = inBoxSDK.addInbox(req); | ||
969 | + logger.info("record seller sham send out inbox msg,sellerUid {}, prdName {},sizeName {} resp {}", | ||
970 | + sellerUid, prdName, sizeName, resp); | ||
971 | + } | ||
972 | + ); | ||
973 | + }); | ||
974 | + } catch (Exception e) { | ||
975 | + logger.warn("InBoxFacade noticeSellerWhenOtherChangePriceLower error inbox msg, noticeSellerUidList {}, sog {} ", noticeSellerUidList, sog, e); | ||
976 | + } | ||
977 | + } | ||
978 | + | ||
948 | /********************************************************************* | 979 | /********************************************************************* |
949 | * 其他---短信 | 980 | * 其他---短信 |
950 | ********************************************************************/ | 981 | ********************************************************************/ |
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | <parent> | 6 | <parent> |
7 | <groupId>com.yoho</groupId> | 7 | <groupId>com.yoho</groupId> |
8 | <artifactId>parent</artifactId> | 8 | <artifactId>parent</artifactId> |
9 | - <version>1.5.1-SNAPSHOT</version> | 9 | + <version>1.5.4-SNAPSHOT</version> |
10 | </parent> | 10 | </parent> |
11 | 11 | ||
12 | <groupId>com.yohoufo.fore</groupId> | 12 | <groupId>com.yohoufo.fore</groupId> |
-
Please register or login to post a comment