Commit d850144d2cdecf58e319ed6dfce6b396205bebbb

Authored by jiangchengyong
1 parent a30c7e98

收货地址 实现

mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/buyer/pickinfo/impl/PickInfoServiceImpl.java
1 1 package com.diligrp.mobsite.getway.service.buyer.pickinfo.impl;
2 2  
  3 +import com.b2c.myapp.common.api.pickingInfo.input.PickingInfoSaveInput;
  4 +import com.b2c.myapp.common.api.pickingInfo.input.PickingInfoUpdateInput;
3 5 import com.diligrp.mobsite.getway.domain.protocol.pickinfo.*;
  6 +import com.diligrp.mobsite.getway.rpc.PickInfoRPC;
4 7 import com.diligrp.mobsite.getway.service.buyer.pickinfo.PickInfoService;
  8 +import org.springframework.beans.factory.annotation.Autowired;
5 9 import org.springframework.stereotype.Service;
6 10  
7 11 /**
... ... @@ -9,6 +13,9 @@ import org.springframework.stereotype.Service;
9 13 */
10 14 @Service
11 15 public class PickInfoServiceImpl implements PickInfoService{
  16 + @Autowired
  17 + private PickInfoRPC pickInfoRPC;
  18 +
12 19 /**
13 20 * 新增收货人
14 21 *
... ... @@ -16,6 +23,8 @@ public class PickInfoServiceImpl implements PickInfoService{
16 23 */
17 24 @Override
18 25 public AddPickInfoResp addPickInfo(AddPickInfoReq req) {
  26 + PickingInfoSaveInput pickingInfoSaveInput = new PickingInfoSaveInput();
  27 + pickInfoRPC.addPickingInfo(pickingInfoSaveInput);
19 28 return null;
20 29 }
21 30  
... ... @@ -27,6 +36,8 @@ public class PickInfoServiceImpl implements PickInfoService{
27 36 */
28 37 @Override
29 38 public UpdatePickInfoResp updatePickInfo(UpdatePickInfoReq req) {
  39 + PickingInfoUpdateInput pickingInfoUpdateInput = new PickingInfoUpdateInput();
  40 + pickInfoRPC.modify(pickingInfoUpdateInput);
30 41 return null;
31 42 }
32 43  
... ... @@ -49,6 +60,7 @@ public class PickInfoServiceImpl implements PickInfoService{
49 60 */
50 61 @Override
51 62 public DelPickInfoResp delPickInfo(DelPickInfoReq req) {
  63 + pickInfoRPC.delPickingInfoById(req.getId());
52 64 return null;
53 65 }
54 66  
... ... @@ -60,6 +72,7 @@ public class PickInfoServiceImpl implements PickInfoService{
60 72 */
61 73 @Override
62 74 public GetPickInfoListResp getPickInfoList(GetPickInfoListReq req) {
  75 + pickInfoRPC.queryPickingInfosByBuyerId(req.getToken().getUserId());
63 76 return null;
64 77 }
65 78  
... ... @@ -72,6 +85,7 @@ public class PickInfoServiceImpl implements PickInfoService{
72 85 */
73 86 @Override
74 87 public GetDefaultPickInfoResp getDefaultPickInfo(GetDefaultPickInfoReq req) {
  88 + pickInfoRPC.getDefaultPickingInfoByBuyerId(req.getUserId());
75 89 return null;
76 90 }
77 91  
... ... @@ -84,6 +98,10 @@ public class PickInfoServiceImpl implements PickInfoService{
84 98 */
85 99 @Override
86 100 public SetDefaultPickInfoResp setDefault(Long consigneeId, Long userId) {
  101 + PickingInfoUpdateInput pickingInfoUpdateInput = new PickingInfoUpdateInput();
  102 + pickingInfoUpdateInput.setId(consigneeId);
  103 + pickingInfoUpdateInput.setBuyerId(userId);
  104 + pickInfoRPC.modify(pickingInfoUpdateInput);
87 105 return null;
88 106 }
89 107 }
... ...
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/buyer/home/PickInfoController.java
... ... @@ -98,7 +98,7 @@ public class PickInfoController extends BaseApiController {
98 98 /**
99 99 * 通过ID获取提货人详情
100 100 */
101   - @ApiOperation(value = "修改收货人", httpMethod = "POST",response = GetPickInfoResp.class)
  101 + @ApiOperation(value = "通过ID获取提货人详情", httpMethod = "POST",response = GetPickInfoResp.class)
102 102 @RequestMapping(value = "/getPickInfo",method = RequestMethod.POST)
103 103 @ResponseBody
104 104 public void getPickInfo(@RequestBody GetPickInfoReq temp) {
... ...