fix: erp 对接物流,增加mobile属性
Showing
6 changed files
with
47 additions
and
23 deletions
@@ -37,7 +37,7 @@ public class AppraiseController { | @@ -37,7 +37,7 @@ public class AppraiseController { | ||
37 | @IgnoreSignature | 37 | @IgnoreSignature |
38 | public ApiResponse returnBack(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) { | 38 | public ApiResponse returnBack(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) { |
39 | logger.info("in returnBack , req {}", appraiseExpressInfoBo); | 39 | logger.info("in returnBack , req {}", appraiseExpressInfoBo); |
40 | - return appraiseService.returnBack(appraiseExpressInfoBo.getExpressCompanyId(), appraiseExpressInfoBo.getOrderCode(), appraiseExpressInfoBo.getWayBillCode(),appraiseExpressInfoBo.getDepotNum()); | 40 | + return appraiseService.returnBack(appraiseExpressInfoBo.getExpressCompanyId(), appraiseExpressInfoBo.getOrderCode(), appraiseExpressInfoBo.getWayBillCode(),appraiseExpressInfoBo.getDepotNum(),appraiseExpressInfoBo.getMobile()); |
41 | } | 41 | } |
42 | 42 | ||
43 | /** | 43 | /** |
@@ -50,7 +50,7 @@ public class AppraiseController { | @@ -50,7 +50,7 @@ public class AppraiseController { | ||
50 | @IgnoreSignature | 50 | @IgnoreSignature |
51 | public ApiResponse appraiseFail(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) { | 51 | public ApiResponse appraiseFail(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) { |
52 | logger.info("in appraise Fail, req {}", appraiseExpressInfoBo); | 52 | logger.info("in appraise Fail, req {}", appraiseExpressInfoBo); |
53 | - return appraiseService.appraiseFail(appraiseExpressInfoBo.getExpressCompanyId(), appraiseExpressInfoBo.getOrderCode(), appraiseExpressInfoBo.getWayBillCode(),appraiseExpressInfoBo.getDepotNum()); | 53 | + return appraiseService.appraiseFail(appraiseExpressInfoBo.getExpressCompanyId(), appraiseExpressInfoBo.getOrderCode(), appraiseExpressInfoBo.getWayBillCode(),appraiseExpressInfoBo.getDepotNum(),appraiseExpressInfoBo.getMobile()); |
54 | } | 54 | } |
55 | 55 | ||
56 | /** | 56 | /** |
@@ -62,7 +62,7 @@ public class AppraiseController { | @@ -62,7 +62,7 @@ public class AppraiseController { | ||
62 | @IgnoreSignature | 62 | @IgnoreSignature |
63 | public ApiResponse appraiseSuccess(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) { | 63 | public ApiResponse appraiseSuccess(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) { |
64 | logger.info("in appraiseSuccess, req {}", appraiseExpressInfoBo); | 64 | logger.info("in appraiseSuccess, req {}", appraiseExpressInfoBo); |
65 | - return appraiseService.appraiseSuccess(appraiseExpressInfoBo.getExpressCompanyId(), appraiseExpressInfoBo.getOrderCode(), appraiseExpressInfoBo.getWayBillCode(),appraiseExpressInfoBo.getDepotNum()); | 65 | + return appraiseService.appraiseSuccess(appraiseExpressInfoBo.getExpressCompanyId(), appraiseExpressInfoBo.getOrderCode(), appraiseExpressInfoBo.getWayBillCode(),appraiseExpressInfoBo.getDepotNum(),appraiseExpressInfoBo.getMobile()); |
66 | } | 66 | } |
67 | 67 | ||
68 | } | 68 | } |
@@ -35,7 +35,7 @@ public interface IExpressInfoService { | @@ -35,7 +35,7 @@ public interface IExpressInfoService { | ||
35 | * @param orderCode 订单号 | 35 | * @param orderCode 订单号 |
36 | * @param wayBillCode 快递单号 | 36 | * @param wayBillCode 快递单号 |
37 | */ | 37 | */ |
38 | - void returnBack(Integer sellerUid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum); | 38 | + void returnBack(Integer sellerUid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum,String mobile); |
39 | 39 | ||
40 | /** | 40 | /** |
41 | * 商品鉴定不通过,鉴定中心寄回商品给卖家 | 41 | * 商品鉴定不通过,鉴定中心寄回商品给卖家 |
@@ -44,7 +44,7 @@ public interface IExpressInfoService { | @@ -44,7 +44,7 @@ public interface IExpressInfoService { | ||
44 | * @param orderCode 订单号 | 44 | * @param orderCode 订单号 |
45 | * @param wayBillCode 快递单号 | 45 | * @param wayBillCode 快递单号 |
46 | */ | 46 | */ |
47 | - void appraiseFail(Integer sellerUid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum); | 47 | + void appraiseFail(Integer sellerUid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum,String mobile); |
48 | 48 | ||
49 | /** | 49 | /** |
50 | * 商品鉴定通过,鉴定中心发货给买家 | 50 | * 商品鉴定通过,鉴定中心发货给买家 |
@@ -54,7 +54,7 @@ public interface IExpressInfoService { | @@ -54,7 +54,7 @@ public interface IExpressInfoService { | ||
54 | * @param orderCode 订单号 | 54 | * @param orderCode 订单号 |
55 | * @param wayBillCode 快递单号 | 55 | * @param wayBillCode 快递单号 |
56 | */ | 56 | */ |
57 | - void appraiseSuccess(Integer uid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum); | 57 | + void appraiseSuccess(Integer uid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum,String mobile); |
58 | 58 | ||
59 | /** | 59 | /** |
60 | * 根据订单号查询快递信息 | 60 | * 根据订单号查询快递信息 |
@@ -18,6 +18,8 @@ import javax.annotation.PostConstruct; | @@ -18,6 +18,8 @@ import javax.annotation.PostConstruct; | ||
18 | import java.security.SecureRandom; | 18 | import java.security.SecureRandom; |
19 | import java.util.List; | 19 | import java.util.List; |
20 | import java.util.concurrent.TimeUnit; | 20 | import java.util.concurrent.TimeUnit; |
21 | +import java.util.stream.Collector; | ||
22 | +import java.util.stream.Collectors; | ||
21 | 23 | ||
22 | /** | 24 | /** |
23 | * Created by li.ma on 2018/9/28. | 25 | * Created by li.ma on 2018/9/28. |
@@ -67,6 +69,24 @@ public class AppraiseAddressService { | @@ -67,6 +69,24 @@ public class AppraiseAddressService { | ||
67 | return appraiseAddressResps.get(0); | 69 | return appraiseAddressResps.get(0); |
68 | } | 70 | } |
69 | 71 | ||
72 | + | ||
73 | + // 根据默认鉴定中心地址 | ||
74 | + public AppraiseAddressResp queryInitAddressByDepotNum(int depotNum) { | ||
75 | + List<AppraiseAddressResp> appraiseAddressResps = queryAddressInfoList(); | ||
76 | + | ||
77 | + if (CollectionUtils.isEmpty(appraiseAddressResps)) { | ||
78 | + return new AppraiseAddressResp.builder().setMobile("15010019250").setType(0).setAddressName("宫布朗").setAddress("北京市朝阳区建国路81号华贸写字楼1座3层 UFO飞碟好物【北京】实物鉴定中心").build(); | ||
79 | + } | ||
80 | + | ||
81 | + List<AppraiseAddressResp> collect = appraiseAddressResps.stream().filter(item -> item.getType() == depotNum).collect(Collectors.toList()); | ||
82 | + | ||
83 | + if (CollectionUtils.isEmpty(collect)) { | ||
84 | + return new AppraiseAddressResp.builder().setMobile("15010019250").setType(0).setAddressName("宫布朗").setAddress("北京市朝阳区建国路81号华贸写字楼1座3层 UFO飞碟好物【北京】实物鉴定中心").build(); | ||
85 | + } | ||
86 | + | ||
87 | + return collect.get(0); | ||
88 | + } | ||
89 | + | ||
70 | public List<AppraiseAddressResp> queryAddressInfoList() { | 90 | public List<AppraiseAddressResp> queryAddressInfoList() { |
71 | Object value=localCache.get(CACHE_KEY); | 91 | Object value=localCache.get(CACHE_KEY); |
72 | if(null == value) { | 92 | if(null == value) { |
@@ -88,7 +88,7 @@ public class AppraiseService { | @@ -88,7 +88,7 @@ public class AppraiseService { | ||
88 | private SellerService sellerService; | 88 | private SellerService sellerService; |
89 | 89 | ||
90 | 90 | ||
91 | - public ApiResponse appraiseSuccess(Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum){ | 91 | + public ApiResponse appraiseSuccess(Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum,String mobile){ |
92 | ApiResponse apiResponse=new ApiResponse(); | 92 | ApiResponse apiResponse=new ApiResponse(); |
93 | BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode); | 93 | BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode); |
94 | 94 | ||
@@ -181,7 +181,7 @@ public class AppraiseService { | @@ -181,7 +181,7 @@ public class AppraiseService { | ||
181 | BuyerConfirmEvent buyerConfirmEvent = BuyerConfirmEvent.builder().uid(buyerUid).orderCode(orderCode).build(); | 181 | BuyerConfirmEvent buyerConfirmEvent = BuyerConfirmEvent.builder().uid(buyerUid).orderCode(orderCode).build(); |
182 | EventBusPublisher.publishEvent(buyerConfirmEvent); | 182 | EventBusPublisher.publishEvent(buyerConfirmEvent); |
183 | //记录物流信息 | 183 | //记录物流信息 |
184 | - expressInfoService.appraiseSuccess(buyerUid, expressCompanyId, orderCode, wayBillCode, depotNum); | 184 | + expressInfoService.appraiseSuccess(buyerUid, expressCompanyId, orderCode, wayBillCode, depotNum,mobile); |
185 | //平台已发货给买家 | 185 | //平台已发货给买家 |
186 | inBoxFacade.appraisePassNotice(buyerUid, orderCode, sellerOrderGoods); | 186 | inBoxFacade.appraisePassNotice(buyerUid, orderCode, sellerOrderGoods); |
187 | }catch (Exception ex){ | 187 | }catch (Exception ex){ |
@@ -228,7 +228,7 @@ public class AppraiseService { | @@ -228,7 +228,7 @@ public class AppraiseService { | ||
228 | * @param wayBillCode | 228 | * @param wayBillCode |
229 | * @return | 229 | * @return |
230 | */ | 230 | */ |
231 | - public ApiResponse returnBack(Integer expressCompanyId, Long orderCode, String wayBillCode, Integer depotNum){ | 231 | + public ApiResponse returnBack(Integer expressCompanyId, Long orderCode, String wayBillCode, Integer depotNum,String mobile){ |
232 | ApiResponse apiResponse=new ApiResponse(); | 232 | ApiResponse apiResponse=new ApiResponse(); |
233 | BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode); | 233 | BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode); |
234 | 234 | ||
@@ -246,7 +246,7 @@ public class AppraiseService { | @@ -246,7 +246,7 @@ public class AppraiseService { | ||
246 | 246 | ||
247 | //记录物流信息 | 247 | //记录物流信息 |
248 | int sellerUid = buyerOrder.getSellerUid(); | 248 | int sellerUid = buyerOrder.getSellerUid(); |
249 | - expressInfoService.returnBack(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum); | 249 | + expressInfoService.returnBack(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum,mobile); |
250 | 250 | ||
251 | //发送消息 | 251 | //发送消息 |
252 | inBoxFacade.sendCancelledProductToSellerByCenter(sellerUid,wayBillCode); | 252 | inBoxFacade.sendCancelledProductToSellerByCenter(sellerUid,wayBillCode); |
@@ -262,7 +262,7 @@ public class AppraiseService { | @@ -262,7 +262,7 @@ public class AppraiseService { | ||
262 | * @param wayBillCode | 262 | * @param wayBillCode |
263 | * @return | 263 | * @return |
264 | */ | 264 | */ |
265 | - public ApiResponse appraiseFail(Integer expressCompanyId, Long orderCode, String wayBillCode, Integer depotNum){ | 265 | + public ApiResponse appraiseFail(Integer expressCompanyId, Long orderCode, String wayBillCode, Integer depotNum,String mobile){ |
266 | ApiResponse apiResponse=new ApiResponse(); | 266 | ApiResponse apiResponse=new ApiResponse(); |
267 | BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode); | 267 | BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode); |
268 | 268 | ||
@@ -360,7 +360,7 @@ public class AppraiseService { | @@ -360,7 +360,7 @@ public class AppraiseService { | ||
360 | }finally { | 360 | }finally { |
361 | 361 | ||
362 | //更新物流信息,写到最后 | 362 | //更新物流信息,写到最后 |
363 | - expressInfoService.appraiseFail(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum); | 363 | + expressInfoService.appraiseFail(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum,mobile); |
364 | } | 364 | } |
365 | 365 | ||
366 | }else{ | 366 | }else{ |
@@ -139,7 +139,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | @@ -139,7 +139,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | ||
139 | saveExpress(sellerUid,expressCompanyId,orderCode,wayBillCode,expressType,depotNum); | 139 | saveExpress(sellerUid,expressCompanyId,orderCode,wayBillCode,expressType,depotNum); |
140 | 140 | ||
141 | // 发送mq获取物流信息 | 141 | // 发送mq获取物流信息 |
142 | - sendExpressMQ(sellerUid,expressCompanyId,orderCode,wayBillCode); | 142 | + sendExpressMQ(sellerUid,expressCompanyId,orderCode,wayBillCode,appraiseAddressService.queryInitAddressByDepotNum(depotNum).getMobile()); |
143 | psog = sellerOrderGoodsMapper.selectByPrimaryKey(skup); | 143 | psog = sellerOrderGoodsMapper.selectByPrimaryKey(skup); |
144 | LOGGER.info("deliverToDepot end ! send express to erp "); | 144 | LOGGER.info("deliverToDepot end ! send express to erp "); |
145 | inBoxFacade.sellerDeliver2Depot(buyerUid, orderCode, psog.getProductName()); | 145 | inBoxFacade.sellerDeliver2Depot(buyerUid, orderCode, psog.getProductName()); |
@@ -157,47 +157,47 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | @@ -157,47 +157,47 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | ||
157 | } | 157 | } |
158 | 158 | ||
159 | @Override | 159 | @Override |
160 | - public void returnBack(Integer sellerUid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum){ | 160 | + public void returnBack(Integer sellerUid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum,String mobile){ |
161 | Integer expressType = ExpressInfoConstant.EXPRESS_TYPE_REBACK; | 161 | Integer expressType = ExpressInfoConstant.EXPRESS_TYPE_REBACK; |
162 | 162 | ||
163 | LOGGER.info("returnBack expressCompanyId = {}, orderCode = {}, wayBillCode = {} " + | 163 | LOGGER.info("returnBack expressCompanyId = {}, orderCode = {}, wayBillCode = {} " + |
164 | - ",expressType = {},depotNum={}", new Object[]{expressCompanyId, orderCode, wayBillCode,expressType,depotNum}); | 164 | + ",expressType = {},depotNum={},mobile={}", new Object[]{expressCompanyId, orderCode, wayBillCode,expressType,depotNum,mobile}); |
165 | 165 | ||
166 | // 保存订单物流信息 | 166 | // 保存订单物流信息 |
167 | saveExpress(sellerUid,expressCompanyId,orderCode,wayBillCode,expressType,depotNum); | 167 | saveExpress(sellerUid,expressCompanyId,orderCode,wayBillCode,expressType,depotNum); |
168 | 168 | ||
169 | // 发送mq获取物流信息 | 169 | // 发送mq获取物流信息 |
170 | - sendExpressMQ(sellerUid,expressCompanyId,orderCode,wayBillCode); | 170 | + sendExpressMQ(sellerUid,expressCompanyId,orderCode,wayBillCode,mobile); |
171 | LOGGER.info("returnBack end ! send express to erp "); | 171 | LOGGER.info("returnBack end ! send express to erp "); |
172 | } | 172 | } |
173 | 173 | ||
174 | @Override | 174 | @Override |
175 | - public void appraiseFail(Integer sellerUid ,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum) { | 175 | + public void appraiseFail(Integer sellerUid ,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum,String mobile) { |
176 | Integer expressType = ExpressInfoConstant.EXPRESS_TYPE_3; | 176 | Integer expressType = ExpressInfoConstant.EXPRESS_TYPE_3; |
177 | 177 | ||
178 | LOGGER.info("appraiseFail expressCompanyId = {}, orderCode = {}, wayBillCode = {} " + | 178 | LOGGER.info("appraiseFail expressCompanyId = {}, orderCode = {}, wayBillCode = {} " + |
179 | - ",expressType = {},depotNum={}", new Object[]{expressCompanyId, orderCode, wayBillCode,expressType,depotNum}); | 179 | + ",expressType = {},depotNum={},mobile={}", new Object[]{expressCompanyId, orderCode, wayBillCode,expressType,depotNum,mobile}); |
180 | 180 | ||
181 | // 保存订单物流信息 | 181 | // 保存订单物流信息 |
182 | saveExpress(sellerUid,expressCompanyId,orderCode,wayBillCode,expressType,depotNum); | 182 | saveExpress(sellerUid,expressCompanyId,orderCode,wayBillCode,expressType,depotNum); |
183 | 183 | ||
184 | // 发送mq获取物流信息 | 184 | // 发送mq获取物流信息 |
185 | - sendExpressMQ(sellerUid,expressCompanyId,orderCode,wayBillCode); | 185 | + sendExpressMQ(sellerUid,expressCompanyId,orderCode,wayBillCode,mobile); |
186 | LOGGER.info("appraiseFail end ! send express to erp "); | 186 | LOGGER.info("appraiseFail end ! send express to erp "); |
187 | } | 187 | } |
188 | 188 | ||
189 | @Override | 189 | @Override |
190 | - public void appraiseSuccess(Integer uid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum) { | 190 | + public void appraiseSuccess(Integer uid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum,String mobile) { |
191 | Integer expressType = ExpressInfoConstant.EXPRESS_TYPE_2; | 191 | Integer expressType = ExpressInfoConstant.EXPRESS_TYPE_2; |
192 | 192 | ||
193 | LOGGER.info("appraiseSuccess expressCompanyId = {}, orderCode = {}, wayBillCode = {} " + | 193 | LOGGER.info("appraiseSuccess expressCompanyId = {}, orderCode = {}, wayBillCode = {} " + |
194 | - ",expressType = {},depotNum={} ", new Object[]{expressCompanyId, orderCode, wayBillCode,expressType,depotNum}); | 194 | + ",expressType = {},depotNum={},mobile={} ", new Object[]{expressCompanyId, orderCode, wayBillCode,expressType,depotNum,mobile}); |
195 | 195 | ||
196 | // 保存订单物流信息 | 196 | // 保存订单物流信息 |
197 | saveExpress(uid,expressCompanyId,orderCode,wayBillCode,expressType,depotNum); | 197 | saveExpress(uid,expressCompanyId,orderCode,wayBillCode,expressType,depotNum); |
198 | 198 | ||
199 | // 发送mq获取物流信息 | 199 | // 发送mq获取物流信息 |
200 | - sendExpressMQ(uid,expressCompanyId,orderCode,wayBillCode); | 200 | + sendExpressMQ(uid,expressCompanyId,orderCode,wayBillCode,mobile); |
201 | LOGGER.info("appraiseSuccess end ! send express to erp "); | 201 | LOGGER.info("appraiseSuccess end ! send express to erp "); |
202 | } | 202 | } |
203 | 203 | ||
@@ -227,13 +227,14 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | @@ -227,13 +227,14 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | ||
227 | /** | 227 | /** |
228 | * 发送mq消息,获取物流信息 | 228 | * 发送mq消息,获取物流信息 |
229 | */ | 229 | */ |
230 | - private void sendExpressMQ(Integer uid,Integer expressCompanyId,Long orderCode,String wayBillCode ){ | 230 | + private void sendExpressMQ(Integer uid,Integer expressCompanyId,Long orderCode,String wayBillCode,String mobile ){ |
231 | ExpressForMqSend mqInfo=new ExpressForMqSend(); | 231 | ExpressForMqSend mqInfo=new ExpressForMqSend(); |
232 | mqInfo.setExpressNumber(wayBillCode); | 232 | mqInfo.setExpressNumber(wayBillCode); |
233 | mqInfo.setExpressId(expressCompanyId); | 233 | mqInfo.setExpressId(expressCompanyId); |
234 | mqInfo.setOrderCode(orderCode); | 234 | mqInfo.setOrderCode(orderCode); |
235 | mqInfo.setUid(uid); | 235 | mqInfo.setUid(uid); |
236 | mqInfo.setBusinessType(5); | 236 | mqInfo.setBusinessType(5); |
237 | + mqInfo.setMobile(mobile); | ||
237 | 238 | ||
238 | try{ | 239 | try{ |
239 | ufoExpressInfoProducer.send(EXPRESS_MQ_SEND, mqInfo); | 240 | ufoExpressInfoProducer.send(EXPRESS_MQ_SEND, mqInfo); |
-
Please register or login to post a comment