Commit e3f391363a4e5d7c090f06c1912f1bf14157991c

Authored by jiangchengyong
1 parent 5f944c8a

update rpc pickinfo

mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/pickinfo/SetDefaultPickInfoReq.java renamed to mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/pickinfo/SetDefaultReq.java
@@ -13,7 +13,7 @@ import io.swagger.annotations.ApiModelProperty; @@ -13,7 +13,7 @@ import io.swagger.annotations.ApiModelProperty;
13 * @createTime 2014/8/28 16:23 13 * @createTime 2014/8/28 16:23
14 */ 14 */
15 @SuppressWarnings("serial") 15 @SuppressWarnings("serial")
16 -public class SetDefaultPickInfoReq extends BaseReq { 16 +public class SetDefaultReq extends BaseReq {
17 /** 17 /**
18 * 提货人信息Id 18 * 提货人信息Id
19 */ 19 */
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/pickinfo/SetDefaultPickInfoResp.java renamed to mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/pickinfo/SetDefaultResp.java
@@ -12,5 +12,5 @@ import com.diligrp.mobsite.getway.domain.protocol.BaseResp; @@ -12,5 +12,5 @@ import com.diligrp.mobsite.getway.domain.protocol.BaseResp;
12 * @createTime 2014/8/28 16:23 12 * @createTime 2014/8/28 16:23
13 */ 13 */
14 @SuppressWarnings("serial") 14 @SuppressWarnings("serial")
15 -public class SetDefaultPickInfoResp extends BaseResp { 15 +public class SetDefaultResp extends BaseResp {
16 } 16 }
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/buyer/pickinfo/PickInfoService.java
@@ -57,5 +57,5 @@ public interface PickInfoService { @@ -57,5 +57,5 @@ public interface PickInfoService {
57 * @param userId 57 * @param userId
58 * @return 58 * @return
59 */ 59 */
60 - SetDefaultPickInfoResp setDefault(Long consigneeId,Long userId); 60 + SetDefaultResp setDefault(Long consigneeId, Long userId);
61 } 61 }
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/buyer/pickinfo/impl/PickInfoServiceImpl.java
@@ -156,11 +156,12 @@ public class PickInfoServiceImpl implements PickInfoService{ @@ -156,11 +156,12 @@ public class PickInfoServiceImpl implements PickInfoService{
156 * @return 156 * @return
157 */ 157 */
158 @Override 158 @Override
159 - public SetDefaultPickInfoResp setDefault(Long consigneeId, Long userId) {  
160 - SetDefaultPickInfoResp resp = new SetDefaultPickInfoResp(); 159 + public SetDefaultResp setDefault(Long consigneeId, Long userId) {
  160 + SetDefaultResp resp = new SetDefaultResp();
161 PickingInfoUpdateInput pickingInfoUpdateInput = new PickingInfoUpdateInput(); 161 PickingInfoUpdateInput pickingInfoUpdateInput = new PickingInfoUpdateInput();
162 pickingInfoUpdateInput.setId(consigneeId); 162 pickingInfoUpdateInput.setId(consigneeId);
163 pickingInfoUpdateInput.setBuyerId(userId); 163 pickingInfoUpdateInput.setBuyerId(userId);
  164 + pickingInfoUpdateInput.setDef(2);
164 if(!pickInfoRPC.modify(pickingInfoUpdateInput)){ 165 if(!pickInfoRPC.modify(pickingInfoUpdateInput)){
165 resp.setCode(ResultCode.BUSINESS_FAILED); 166 resp.setCode(ResultCode.BUSINESS_FAILED);
166 } 167 }
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/buyer/home/PickInfoController.java
@@ -15,8 +15,6 @@ import org.springframework.web.bind.annotation.RequestMapping; @@ -15,8 +15,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
15 import org.springframework.web.bind.annotation.RequestMethod; 15 import org.springframework.web.bind.annotation.RequestMethod;
16 import org.springframework.web.bind.annotation.ResponseBody; 16 import org.springframework.web.bind.annotation.ResponseBody;
17 17
18 -import javax.annotation.Resource;  
19 -  
20 /** 18 /**
21 * <B>Description</B> 提货人相关操作接口 <br /> 19 * <B>Description</B> 提货人相关操作接口 <br />
22 * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved. <br /> 20 * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved. <br />
@@ -158,13 +156,13 @@ public class PickInfoController extends BaseApiController { @@ -158,13 +156,13 @@ public class PickInfoController extends BaseApiController {
158 /** 156 /**
159 * 设置默认提货人 157 * 设置默认提货人
160 */ 158 */
161 - @ApiOperation(value = "设置默认收货人", httpMethod = "POST",response = SetDefaultPickInfoReq.class) 159 + @ApiOperation(value = "设置默认收货人", httpMethod = "POST",response = SetDefaultResp.class)
162 @RequestMapping(value = "/setDefault",method = RequestMethod.POST) 160 @RequestMapping(value = "/setDefault",method = RequestMethod.POST)
163 @ResponseBody 161 @ResponseBody
164 - public void setDefault(@RequestBody SetDefaultPickInfoReq temp) {  
165 - SetDefaultPickInfoReq req = getRequest(SetDefaultPickInfoReq.class); 162 + public void setDefault(@RequestBody SetDefaultReq temp) {
  163 + SetDefaultReq req = getRequest(SetDefaultReq.class);
166 try { 164 try {
167 - SetDefaultPickInfoResp resp = pickInfoService.setDefault(req.getId(),req.getUserId()); 165 + SetDefaultResp resp = pickInfoService.setDefault(req.getId(),req.getUserId());
168 sendSuccessResp(resp); 166 sendSuccessResp(resp);
169 } catch (Exception e) { 167 } catch (Exception e) {
170 log.error(String.format("ErrorMessage=%s,UserId=%s",e.getMessage(),req.getUserId()), e); 168 log.error(String.format("ErrorMessage=%s,UserId=%s",e.getMessage(),req.getUserId()), e);