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