Commit f9e50ae3797ff1cef2735fc0d7e993fadae38242

Authored by jiangchengyong
1 parent ff8e5911

店铺 资金相关接口 update

mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/fund/GetFundsReq.java
1 package com.diligrp.mobsite.getway.domain.protocol.fund; 1 package com.diligrp.mobsite.getway.domain.protocol.fund;
2 2
3 import com.diligrp.mobsite.getway.domain.protocol.BaseReq; 3 import com.diligrp.mobsite.getway.domain.protocol.BaseReq;
  4 +import io.swagger.annotations.ApiModelProperty;
4 5
5 /** 6 /**
6 * Created by xxxzzz on 2017/1/3. 7 * Created by xxxzzz on 2017/1/3.
7 */ 8 */
8 public class GetFundsReq extends BaseReq { 9 public class GetFundsReq extends BaseReq {
  10 + @ApiModelProperty(value = "搜索关键词")
  11 + private String keyword;
  12 + @ApiModelProperty(value="店铺ID")
  13 + private Long shopId;
  14 +
  15 + public String getKeyword() {
  16 + return keyword;
  17 + }
  18 +
  19 + public void setKeyword(String keyword) {
  20 + this.keyword = keyword;
  21 + }
  22 +
  23 + public Long getShopId() {
  24 + return shopId;
  25 + }
  26 +
  27 + public void setShopId(Long shopId) {
  28 + this.shopId = shopId;
  29 + }
9 } 30 }
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/fund/GetFundsResp.java
@@ -3,6 +3,7 @@ package com.diligrp.mobsite.getway.domain.protocol.fund; @@ -3,6 +3,7 @@ package com.diligrp.mobsite.getway.domain.protocol.fund;
3 import com.b2c.myapp.common.api.shop.output.ShopOutput; 3 import com.b2c.myapp.common.api.shop.output.ShopOutput;
4 import com.b2c.myapp.common.api.shopBuyer.output.ShopBuyerDetailOutput; 4 import com.b2c.myapp.common.api.shopBuyer.output.ShopBuyerDetailOutput;
5 import com.diligrp.mobsite.getway.domain.base.BaseListResp; 5 import com.diligrp.mobsite.getway.domain.base.BaseListResp;
  6 +import io.swagger.annotations.ApiModelProperty;
6 7
7 import java.util.List; 8 import java.util.List;
8 9
@@ -10,16 +11,23 @@ import java.util.List; @@ -10,16 +11,23 @@ import java.util.List;
10 * Created by xxxzzz on 2017/1/3. 11 * Created by xxxzzz on 2017/1/3.
11 */ 12 */
12 public class GetFundsResp extends BaseListResp { 13 public class GetFundsResp extends BaseListResp {
13 - private ShopOutput shop;  
14 - private List<ShopBuyerDetailOutput> shopBuyers;  
15 - public ShopOutput getShop() {  
16 - return shop;  
17 - }  
18 -  
19 - public void setShop(ShopOutput shop) {  
20 - this.shop = shop;  
21 - } 14 + /**
  15 + * 店铺储值总金额
  16 + */
  17 + @ApiModelProperty(value = "店铺储值总金额")
  18 + private Long storedTotalPrice;
  19 + /**
  20 + * 店铺可用余额
  21 + */
  22 + @ApiModelProperty(value = "店铺可用余额")
  23 + private Long residueTotalPrice;
  24 + /**
  25 + * 店铺冻结总金额
  26 + */
  27 + @ApiModelProperty(value = "店铺冻结总金额")
  28 + private Long freezeTotalPrice;
22 29
  30 + private List<ShopBuyerDetailOutput> shopBuyers;
23 public List<ShopBuyerDetailOutput> getShopBuyers() { 31 public List<ShopBuyerDetailOutput> getShopBuyers() {
24 return shopBuyers; 32 return shopBuyers;
25 } 33 }
@@ -27,4 +35,28 @@ public class GetFundsResp extends BaseListResp { @@ -27,4 +35,28 @@ public class GetFundsResp extends BaseListResp {
27 public void setShopBuyers(List<ShopBuyerDetailOutput> shopBuyers) { 35 public void setShopBuyers(List<ShopBuyerDetailOutput> shopBuyers) {
28 this.shopBuyers = shopBuyers; 36 this.shopBuyers = shopBuyers;
29 } 37 }
  38 +
  39 + public Long getStoredTotalPrice() {
  40 + return storedTotalPrice;
  41 + }
  42 +
  43 + public void setStoredTotalPrice(Long storedTotalPrice) {
  44 + this.storedTotalPrice = storedTotalPrice;
  45 + }
  46 +
  47 + public Long getResidueTotalPrice() {
  48 + return residueTotalPrice;
  49 + }
  50 +
  51 + public void setResidueTotalPrice(Long residueTotalPrice) {
  52 + this.residueTotalPrice = residueTotalPrice;
  53 + }
  54 +
  55 + public Long getFreezeTotalPrice() {
  56 + return freezeTotalPrice;
  57 + }
  58 +
  59 + public void setFreezeTotalPrice(Long freezeTotalPrice) {
  60 + this.freezeTotalPrice = freezeTotalPrice;
  61 + }
30 } 62 }
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/fund/GetfundTradeRecordReq.java
@@ -11,6 +11,8 @@ public class GetfundTradeRecordReq extends BaseListReq { @@ -11,6 +11,8 @@ public class GetfundTradeRecordReq extends BaseListReq {
11 11
12 @ApiModelProperty(value = "查询类型(1:充值 2:冻结4:消费)" ,required = true) 12 @ApiModelProperty(value = "查询类型(1:充值 2:冻结4:消费)" ,required = true)
13 private Long tradeType; 13 private Long tradeType;
  14 + @ApiModelProperty(value = "店铺用户ID,绑定的唯一标识")
  15 + private Long shopBuyerId;
14 16
15 public Long getTradeType() { 17 public Long getTradeType() {
16 return tradeType; 18 return tradeType;
@@ -19,4 +21,12 @@ public class GetfundTradeRecordReq extends BaseListReq { @@ -19,4 +21,12 @@ public class GetfundTradeRecordReq extends BaseListReq {
19 public void setTradeType(Long tradeType) { 21 public void setTradeType(Long tradeType) {
20 this.tradeType = tradeType; 22 this.tradeType = tradeType;
21 } 23 }
  24 +
  25 + public Long getShopBuyerId() {
  26 + return shopBuyerId;
  27 + }
  28 +
  29 + public void setShopBuyerId(Long shopBuyerId) {
  30 + this.shopBuyerId = shopBuyerId;
  31 + }
22 } 32 }
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/fund/GetfundTradeRecordResp.java
@@ -16,6 +16,9 @@ public class GetfundTradeRecordResp extends BaseListResp { @@ -16,6 +16,9 @@ public class GetfundTradeRecordResp extends BaseListResp {
16 @ApiModelProperty(value = "储值时间/消费时间") 16 @ApiModelProperty(value = "储值时间/消费时间")
17 private String tradeTime; 17 private String tradeTime;
18 18
  19 + @ApiModelProperty(value = "交易类型")
  20 + private Long tradeType;
  21 +
19 //@ApiModelProperty(value = "储值余额/消费时间") 22 //@ApiModelProperty(value = "储值余额/消费时间")
20 //private Long residueTotalPrice; 23 //private Long residueTotalPrice;
21 24
@@ -35,4 +38,12 @@ public class GetfundTradeRecordResp extends BaseListResp { @@ -35,4 +38,12 @@ public class GetfundTradeRecordResp extends BaseListResp {
35 public void setTradeTime(String tradeTime) { 38 public void setTradeTime(String tradeTime) {
36 this.tradeTime = tradeTime; 39 this.tradeTime = tradeTime;
37 } 40 }
  41 +
  42 + public Long getTradeType() {
  43 + return tradeType;
  44 + }
  45 +
  46 + public void setTradeType(Long tradeType) {
  47 + this.tradeType = tradeType;
  48 + }
38 } 49 }
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/ShopBuyerRPC.java
1 package com.diligrp.mobsite.getway.rpc; 1 package com.diligrp.mobsite.getway.rpc;
2 2
  3 +import com.b2c.myapp.common.api.shopBuyer.input.ShopBuyerDetail;
3 import com.b2c.myapp.common.api.shopBuyer.input.ShopBuyerListInput; 4 import com.b2c.myapp.common.api.shopBuyer.input.ShopBuyerListInput;
4 import com.b2c.myapp.common.api.shopBuyer.output.ShopBuyerDetailOutput; 5 import com.b2c.myapp.common.api.shopBuyer.output.ShopBuyerDetailOutput;
5 import com.b2c.myapp.common.api.shopBuyer.output.ShopBuyerKeyOutput; 6 import com.b2c.myapp.common.api.shopBuyer.output.ShopBuyerKeyOutput;
@@ -15,12 +16,12 @@ import java.util.List; @@ -15,12 +16,12 @@ import java.util.List;
15 public interface ShopBuyerRPC { 16 public interface ShopBuyerRPC {
16 /** 17 /**
17 * @comment 查找店铺所有买家列表 18 * @comment 查找店铺所有买家列表
18 - * @param shopBuyerListInput 店铺买家对象 19 + * @param shopBuyerDetail 店铺买家对象
19 * @return Page<ShopBuyerDetailOutput> 20 * @return Page<ShopBuyerDetailOutput>
20 * @author kelan 21 * @author kelan
21 * @time 2016/12/1 9:59 22 * @time 2016/12/1 9:59
22 */ 23 */
23 - public Page<ShopBuyerDetailOutput> queryShopAllBuyerList(ShopBuyerListInput shopBuyerListInput); 24 + public Page<ShopBuyerDetailOutput> queryShopAllBuyerList(ShopBuyerDetail shopBuyerDetail);
24 /** 25 /**
25 * 绑定并激活(查询买家是否绑定相关店铺,未绑定直接绑定,已绑定直接激活) 26 * 绑定并激活(查询买家是否绑定相关店铺,未绑定直接绑定,已绑定直接激活)
26 * @param buyerId 27 * @param buyerId
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/impl/ShopBuyerRPCImpl.java
1 package com.diligrp.mobsite.getway.rpc.impl; 1 package com.diligrp.mobsite.getway.rpc.impl;
2 2
  3 +import com.b2c.myapp.common.api.shopBuyer.input.ShopBuyerDetail;
3 import com.b2c.myapp.common.api.shopBuyer.input.ShopBuyerListInput; 4 import com.b2c.myapp.common.api.shopBuyer.input.ShopBuyerListInput;
4 import com.b2c.myapp.common.api.shopBuyer.output.ShopBuyerDetailOutput; 5 import com.b2c.myapp.common.api.shopBuyer.output.ShopBuyerDetailOutput;
5 import com.b2c.myapp.common.api.shopBuyer.output.ShopBuyerKeyOutput; 6 import com.b2c.myapp.common.api.shopBuyer.output.ShopBuyerKeyOutput;
@@ -23,18 +24,18 @@ public class ShopBuyerRPCImpl implements ShopBuyerRPC { @@ -23,18 +24,18 @@ public class ShopBuyerRPCImpl implements ShopBuyerRPC {
23 @Resource 24 @Resource
24 private MyAppClient myAppClient; 25 private MyAppClient myAppClient;
25 /** 26 /**
26 - * @param shopBuyerListInput 店铺买家对象 27 + * @param shopBuyerDetail 店铺买家对象
27 * @return BaseOutput<List<ShopBuyerOutput>> 28 * @return BaseOutput<List<ShopBuyerOutput>>
28 * @comment 查找店铺所有买家列表 29 * @comment 查找店铺所有买家列表
29 * @author kelan 30 * @author kelan
30 * @time 2016/12/1 9:59 31 * @time 2016/12/1 9:59
31 */ 32 */
32 @Override 33 @Override
33 - public Page<ShopBuyerDetailOutput> queryShopAllBuyerList(ShopBuyerListInput shopBuyerListInput) { 34 + public Page<ShopBuyerDetailOutput> queryShopAllBuyerList(ShopBuyerDetail shopBuyerDetail) {
34 BaseOutput<Page<ShopBuyerDetailOutput>> output = null; 35 BaseOutput<Page<ShopBuyerDetailOutput>> output = null;
35 boolean flag = false; 36 boolean flag = false;
36 try { 37 try {
37 - output = myAppClient.getShopBuyerService().queryShopAllBuyerList(shopBuyerListInput); 38 + output = myAppClient.getShopBuyerService().queryShopAllBuyerList(shopBuyerDetail);
38 if(output.getCode().equals(200)){ 39 if(output.getCode().equals(200)){
39 return output.getData(); 40 return output.getData();
40 } 41 }
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/seller/FundService.java
@@ -9,9 +9,9 @@ import com.diligrp.mobsite.getway.domain.protocol.fund.*; @@ -9,9 +9,9 @@ import com.diligrp.mobsite.getway.domain.protocol.fund.*;
9 public interface FundService { 9 public interface FundService {
10 10
11 11
12 - public GetFundsResp getFunds(Long shopId) ; 12 + public GetFundsResp getFunds(GetFundsReq fundsReq) ;
13 13
14 - FundTradeResp fundTrade(FundTradeReq req); 14 + FundTradeResp storeValue(Long price);
15 15
16 GetfundTradeRecordResp getfundTradeRecord(GetfundTradeRecordReq req); 16 GetfundTradeRecordResp getfundTradeRecord(GetfundTradeRecordReq req);
17 } 17 }
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/seller/impl/FundServiceImpl.java
1 package com.diligrp.mobsite.getway.service.seller.impl; 1 package com.diligrp.mobsite.getway.service.seller.impl;
2 2
3 import com.b2c.myapp.common.api.shop.output.ShopOutput; 3 import com.b2c.myapp.common.api.shop.output.ShopOutput;
  4 +import com.b2c.myapp.common.api.shopBuyer.input.ShopBuyerDetail;
4 import com.b2c.myapp.common.api.shopBuyer.input.ShopBuyerListInput; 5 import com.b2c.myapp.common.api.shopBuyer.input.ShopBuyerListInput;
5 import com.b2c.myapp.common.api.shopBuyer.output.ShopBuyerDetailOutput; 6 import com.b2c.myapp.common.api.shopBuyer.output.ShopBuyerDetailOutput;
6 import com.b2c.myapp.common.utils.base.Page; 7 import com.b2c.myapp.common.utils.base.Page;
@@ -21,21 +22,25 @@ public class FundServiceImpl implements FundService{ @@ -21,21 +22,25 @@ public class FundServiceImpl implements FundService{
21 @Autowired 22 @Autowired
22 private ShopRPC shopRPC; 23 private ShopRPC shopRPC;
23 @Override 24 @Override
24 - public GetFundsResp getFunds(Long shopId) {  
25 - ShopBuyerListInput shopBuyerListInput = new ShopBuyerListInput();  
26 - shopBuyerListInput.setShopId(shopId);  
27 - Page<ShopBuyerDetailOutput> shopBuyerDetailOutputPage = shopBuyerRPC.queryShopAllBuyerList(shopBuyerListInput);  
28 - ShopOutput shopOutput = shopRPC.getShopByShopId(shopId); 25 + public GetFundsResp getFunds(GetFundsReq fundsReq) {
  26 + ShopBuyerDetail shopBuyerDetail = new ShopBuyerDetail();
  27 + shopBuyerDetail.setShopId(fundsReq.getShopId());
  28 + shopBuyerDetail.setBuyerMobilePhone(fundsReq.getKeyword());
  29 + Page<ShopBuyerDetailOutput> shopBuyerDetailOutputPage = shopBuyerRPC.queryShopAllBuyerList(shopBuyerDetail);
  30 + ShopOutput shopOutput = shopRPC.getShopByShopId(fundsReq.getShopId());
29 31
30 GetFundsResp fundsResp = new GetFundsResp(); 32 GetFundsResp fundsResp = new GetFundsResp();
31 - fundsResp.setShop(shopOutput); 33 + fundsResp.setFreezeTotalPrice(shopOutput.getFreezeTotalPrice());
  34 + fundsResp.setResidueTotalPrice(shopOutput.getResidueTotalPrice());
  35 + fundsResp.setStoredTotalPrice(shopOutput.getStoredTotalPrice());
32 fundsResp.setShopBuyers(shopBuyerDetailOutputPage.getResult()); 36 fundsResp.setShopBuyers(shopBuyerDetailOutputPage.getResult());
33 fundsResp.setMaxPageNum(shopBuyerDetailOutputPage.getPageCount()); 37 fundsResp.setMaxPageNum(shopBuyerDetailOutputPage.getPageCount());
34 return fundsResp; 38 return fundsResp;
35 } 39 }
36 40
37 @Override 41 @Override
38 - public FundTradeResp fundTrade(FundTradeReq req) { 42 + public FundTradeResp storeValue(Long price) {
  43 +
39 return null; 44 return null;
40 } 45 }
41 46
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/seller/fund/FundController.java
@@ -9,10 +9,7 @@ import io.swagger.annotations.ApiImplicitParam; @@ -9,10 +9,7 @@ import io.swagger.annotations.ApiImplicitParam;
9 import io.swagger.annotations.ApiOperation; 9 import io.swagger.annotations.ApiOperation;
10 import org.apache.log4j.Logger; 10 import org.apache.log4j.Logger;
11 import org.springframework.stereotype.Controller; 11 import org.springframework.stereotype.Controller;
12 -import org.springframework.web.bind.annotation.RequestBody;  
13 -import org.springframework.web.bind.annotation.RequestMapping;  
14 -import org.springframework.web.bind.annotation.RequestMethod;  
15 -import org.springframework.web.bind.annotation.ResponseBody; 12 +import org.springframework.web.bind.annotation.*;
16 13
17 import javax.annotation.Resource; 14 import javax.annotation.Resource;
18 15
@@ -42,12 +39,11 @@ public class FundController extends BaseApiController{ @@ -42,12 +39,11 @@ public class FundController extends BaseApiController{
42 * @author weili 39 * @author weili
43 */ 40 */
44 @ApiOperation(value = "获取储值列表", httpMethod = "POST",response = GetFundsResp.class) 41 @ApiOperation(value = "获取储值列表", httpMethod = "POST",response = GetFundsResp.class)
45 - @ApiImplicitParam(paramType = "query",name = "shopId",dataType = "Long", required = true, value = "店铺ID")  
46 @RequestMapping(value = "/getFunds",method = RequestMethod.POST) 42 @RequestMapping(value = "/getFunds",method = RequestMethod.POST)
47 @ResponseBody 43 @ResponseBody
48 - public void getFunds(Long shopId) { 44 + public void getFunds(@ModelAttribute GetFundsReq fundsReq) {
49 try { 45 try {
50 - GetFundsResp resp = fundService.getFunds(shopId); 46 + GetFundsResp resp = fundService.getFunds(fundsReq);
51 super.sendSuccessResp(resp); 47 super.sendSuccessResp(resp);
52 } catch (ServiceException e) { 48 } catch (ServiceException e) {
53 log.error("获取储值列表出现业务异常", e); 49 log.error("获取储值列表出现业务异常", e);
@@ -70,13 +66,14 @@ public class FundController extends BaseApiController{ @@ -70,13 +66,14 @@ public class FundController extends BaseApiController{
70 * @author weili 66 * @author weili
71 */ 67 */
72 @ApiOperation(value = "储值卡操作", httpMethod = "POST",response = FundTradeResp.class) 68 @ApiOperation(value = "储值卡操作", httpMethod = "POST",response = FundTradeResp.class)
73 - @RequestMapping(value = "/fundTrade",method = RequestMethod.POST) 69 + @ApiImplicitParam(paramType = "query",name = "price",dataType = "Long", required = true, value = "储值金额")
  70 + @RequestMapping(value = "/storeValue",method = RequestMethod.POST)
74 @ResponseBody 71 @ResponseBody
75 - public void fundTrade(@RequestBody FundTradeReq temp) { 72 + public void storeValue(Long price) {
76 73
77 FundTradeReq req = super.getRequest(FundTradeReq.class); 74 FundTradeReq req = super.getRequest(FundTradeReq.class);
78 try { 75 try {
79 - FundTradeResp resp = fundService.fundTrade(req); 76 + FundTradeResp resp = fundService.storeValue(price);
80 super.sendSuccessResp(resp); 77 super.sendSuccessResp(resp);
81 } catch (ServiceException e) { 78 } catch (ServiceException e) {
82 log.error("获取储值列表出现业务异常", e); 79 log.error("获取储值列表出现业务异常", e);