Commit 6df427fe authored by david.zhong's avatar david.zhong

卡系统master

parent a596c541
......@@ -19,6 +19,10 @@
<artifactId>poi-ooxml</artifactId>
<version>3.15</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
......
......@@ -29,7 +29,7 @@ import java.util.Map;
* @date 2019-08-13 16:40:46
*/
@RestController
@RequestMapping("provider/card/payapi")
@RequestMapping("/provider/card/payapi")
@Api(tags = "card支付接口表接口")
@Slf4j
public class CardApiController {
......@@ -45,7 +45,7 @@ public class CardApiController {
@ApiImplicitParam(paramType = "query", required = false, name = "payment_type", value = "支付方式 0-银行卡 1-固码汇旺财", dataType = "Integer")
@DataToUnderline()
public DataResponse<List<ApiResDto>> list(@RequestParam(required = false, name = "payment_type") Integer paymentType) {
String apiUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/provider/payapi/list";
String apiUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/payapi/list";
Map requestMap = new HashMap<>();
if (null != paymentType) {
requestMap.put("payment_type", paymentType);
......
package com.ost.micro.provider.controller;
import com.ost.micro.core.aop.DataToUnderline;
import com.ost.micro.core.context.model.response.DataResponse;
import com.ost.micro.core.pay.modules.cardservice.dto.bank.response.BankResDto;
import com.ost.micro.provider.common.PaymentServiceClient;
import com.ost.micro.provider.common.ServiceUrl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.consul.discovery.ConsulDiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author Anson
* @description:
* @email anson.xu@bytehug.com
* @date 2019/5/31 18:07
*/
@RestController
@Api(tags = "card银行")
@RequestMapping("/provider/card/bank")
@Slf4j
public class CardBankController {
@Autowired
private PaymentServiceClient paymentServiceClient;
@Autowired
private ConsulDiscoveryClient consulDiscoveryClient;
@Autowired
private ServiceUrl serviceUrl;
@GetMapping("/list")
@ApiOperation("列表")
@ApiImplicitParam(paramType = "query", name = "is_out_bank", value = "是否出金银行0否1是", dataType = "Integer")
@DataToUnderline()
public DataResponse<List<BankResDto>> list(@RequestParam(required = false, name = "is_out_bank") Integer isOutBank) {
String bankUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/bank/list";
Map params = new HashMap();
params.put("isOutBank", isOutBank);
return paymentServiceClient.get(bankUrl, params);
}
@GetMapping("/type")
@ApiOperation("聚合汇总银行列表")
@DataToUnderline()
public DataResponse<List<BankResDto>> type() {
String bankUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/bank/type";
return paymentServiceClient.get(bankUrl, new HashMap());
}
}
......@@ -32,7 +32,7 @@ import java.util.Map;
* @date 2019-08-13 16:42:06
*/
@RestController
@RequestMapping("provider/card/biz")
@RequestMapping("/provider/card/biz")
@Api(tags = "card商家管理表接口")
@Slf4j
public class CardBizController {
......@@ -57,15 +57,26 @@ public class CardBizController {
@RequestParam(required = false, name = "biz_ids") List<Long> bizIds,
@RequestParam(name = "page_index") Integer pageIndex,
@RequestParam(name = "page_size") Integer pageSize) {
String bizUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/biz";
Map params = new HashMap();
params.put("keyword", keyword);
params.put("enable", enable);
params.put("bizIds", !CollectionUtils.isEmpty(bizIds) ? StringUtils.strip(bizIds.toString(), "[]") : null);
params.put("pageIndex", pageIndex);
params.put("pageSize", pageSize);
// String bizUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/biz";
// Map params = new HashMap();
// params.put("keyword", keyword);
// params.put("enable", enable);
// params.put("bizIds", !CollectionUtils.isEmpty(bizIds) ? StringUtils.strip(bizIds.toString(), "[]") : null);
// params.put("pageIndex", pageIndex);
// params.put("pageSize", pageSize);
// return paymentServiceClient.get(bizUrl, params);
return paymentServiceClient.get(bizUrl, params);
StringBuilder urlBuilder = new StringBuilder();
urlBuilder.append(serviceUrl.getAsServiceUrl(consulDiscoveryClient));
urlBuilder.append("/api/provider/card/biz");
urlBuilder.append("?keyword={keyword}");
urlBuilder.append("&enable={enable}");
urlBuilder.append("&bizIds={bizIds}");
urlBuilder.append("&pageIndex={pageIndex}");
urlBuilder.append("&pageSize={pageSize}");
ResponseEntity<DataResponse> result = paymentServiceClient.getRestTemplate().getForEntity(urlBuilder.toString(),
DataResponse.class, keyword, enable, !CollectionUtils.isEmpty(bizIds) ? StringUtils.strip(bizIds.toString(), "[]") : null, pageIndex,pageSize);
return result.getBody();
}
@GetMapping("list")
......@@ -76,7 +87,7 @@ public class CardBizController {
@DataToUnderline()
public DataResponse list(@RequestParam(required = false, name = "bank_id") Long bankId,
@RequestParam(required = false, name = "biz_ids") List<Long> bizIds) {
String bizUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/biz/list";
String bizUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/biz/list";
Map params = new HashMap();
params.put("bankId", bankId);
params.put("bizIds", !CollectionUtils.isEmpty(bizIds) ? StringUtils.strip(bizIds.toString(), "[]") : null);
......@@ -89,7 +100,7 @@ public class CardBizController {
@ApiImplicitParam(paramType = "path", name = "id", value = "id", required = true, dataType = "long")
@DataToUnderline()
public DataResponse<BizResDto> info(@PathVariable("id") Long id) {
String bizUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/biz";
String bizUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/biz";
return paymentServiceClient.get(bizUrl, id);
}
......@@ -97,7 +108,8 @@ public class CardBizController {
@ApiOperation("新增")
@DataToUnderline()
public DataResponse add(@RequestBody BizReqDto dto) {
String bizUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/biz";
dto.setType(1);
String bizUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/biz";
return paymentServiceClient.post(bizUrl, dto);
}
......@@ -106,7 +118,7 @@ public class CardBizController {
@ApiOperation("修改")
@DataToUnderline()
public DataResponse<BizResDto> update(@RequestBody BizReqDto dto) {
String bizUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/biz";
String bizUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/biz";
return paymentServiceClient.putForEntity(bizUrl, dto);
}
......@@ -115,7 +127,7 @@ public class CardBizController {
@ApiImplicitParam(paramType = "path", name = "id", value = "id", required = true, dataType = "long")
@DataToUnderline()
public DataResponse delete(@PathVariable Long id) {
String bizUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/biz/" + id;
String bizUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/biz/" + id;
ResponseEntity<DataResponse> resp = paymentServiceClient.getRestTemplate()
.exchange(bizUrl, HttpMethod.DELETE, null,
DataResponse.class, id);
......@@ -127,7 +139,7 @@ public class CardBizController {
@ApiOperation("修改交易参数")
@DataToUnderline()
public DataResponse<BizResDto> editParams(@RequestBody BizParamsReqDto dto) {
String bizUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/biz/params/edit";
String bizUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/biz/params/edit";
return paymentServiceClient.putForEntity(bizUrl, dto);
}
}
......@@ -32,7 +32,7 @@ import java.util.Map;
* @author Yubo
*/
@RestController
@RequestMapping("provider/card/order")
@RequestMapping("/provider/card/order")
@Api(tags = "card交易明细接口")
@Slf4j
public class CardOrderController {
......@@ -54,6 +54,8 @@ public class CardOrderController {
@ApiImplicitParam(paramType = "query", name = "biz_id", value = "平台id", required = false, dataType = "long"),
@ApiImplicitParam(paramType = "query", name = "biz_id_list", value = "平台集合", required = false, allowMultiple = true, dataType = "Long"),
@ApiImplicitParam(paramType = "query", name = "biz_ids", value = "权限平台集合", required = false, allowMultiple = true, dataType = "Long"),
@ApiImplicitParam(paramType = "query", name = "current_biz_id", value = "当前登录的商家id", required = false, dataType = "long"),
@ApiImplicitParam(paramType = "query", name = "is_biz_id_from_permission", value = "bizId是否是权限系统中", required = false, dataType = "boolean"),
@ApiImplicitParam(paramType = "query", name = "status", value = "状态", required = false, dataType = "int"),
@ApiImplicitParam(paramType = "query", name = "from_date", value = "创建起始日期", required = false, dataType = "Long"),
@ApiImplicitParam(paramType = "query", name = "to_date", value = "创建结束日期", required = false, dataType = "Long"),
......@@ -70,9 +72,11 @@ public class CardOrderController {
@RequestParam(required = false) Integer status,
@RequestParam(required = false, name = "from_date") Long fromDate,
@RequestParam(required = false, name = "to_date") Long toDate,
@RequestParam(required = false, name = "current_biz_id") Long currentBizId,
@RequestParam(required = false, name = "is_biz_id_from_permission") Boolean isBizIdFromPermission,
@RequestParam(name = "page_index") Integer pageIndex,
@RequestParam(name = "page_size") Integer pageSize) {
String orderUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/order";
String orderUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/order";
Map<String, Object> params = new HashMap<>();
params.put("keyword", keyword);
params.put("name", name);
......@@ -88,6 +92,8 @@ public class CardOrderController {
params.put("toDate", toDate);
params.put("pageIndex", pageIndex);
params.put("pageSize", pageSize);
params.put("currentBizId", currentBizId);
params.put("isBizIdFromPermission", isBizIdFromPermission);
return paymentServiceClient.get(orderUrl, params);
}
......@@ -105,7 +111,7 @@ public class CardOrderController {
@ApiImplicitParam(paramType = "path", name = "id", value = "订单id", required = true, dataType = "long")
@DataToUnderline()
public DataResponse getTradeDetail(@PathVariable Long id) {
String orderUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/order";
String orderUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/order";
return paymentServiceClient.get(orderUrl, id);
}
......@@ -122,7 +128,9 @@ public class CardOrderController {
@ApiImplicitParam(paramType = "query", name = "type", value = "交易类型", required = false, dataType = "int"),
@ApiImplicitParam(paramType = "query", name = "status", value = "状态", required = false, dataType = "int"),
@ApiImplicitParam(paramType = "query", name = "from_date", value = "起始日期", required = false, dataType = "Long"),
@ApiImplicitParam(paramType = "query", name = "to_date", value = "结束日期", required = false, dataType = "Long")
@ApiImplicitParam(paramType = "query", name = "to_date", value = "结束日期", required = false, dataType = "Long"),
@ApiImplicitParam(paramType = "query", name = "current_biz_id", value = "当前登录的商家id", required = false, dataType = "long"),
@ApiImplicitParam(paramType = "query", name = "is_biz_id_from_permission", value = "bizId是否是权限系统中", required = false, dataType = "boolean"),
})
public void export(@RequestParam(required = false) String keyword,
@RequestParam(required = false) String name,
......@@ -136,9 +144,11 @@ public class CardOrderController {
@RequestParam(required = false, name = "to_date") Long toDate,
@RequestParam(required = false, name = "begin_time") Long beginTime,
@RequestParam(required = false, name = "end_time") Long endTime,
@RequestParam(required = false, name = "current_biz_id") Long currentBizId,
@RequestParam(required = false, name = "is_biz_id_from_permission") Boolean isBizIdFromPermission,
HttpServletResponse response) {
String orderUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/order/export";
String orderUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/order/export";
Map<String, Object> params = new HashMap<>();
params.put("keyword", keyword);
params.put("name", name);
......@@ -154,6 +164,8 @@ public class CardOrderController {
params.put("toDate", toDate);
params.put("beginTime", beginTime);
params.put("endTime", endTime);
params.put("currentBizId", currentBizId);
params.put("isBizIdFromPermission", isBizIdFromPermission);
DataResponse dataResponse = paymentServiceClient.get(orderUrl, params);
if (null != dataResponse && null != dataResponse.getData()) {
......
......@@ -6,8 +6,19 @@ services:
as-service:
micro-project-domain-as-service-v2
spring:
servlet:
multipart:
max-file-size: 50MB
max-request-size: 100MB
enabled: true
resolve-lazily: false
atx-url: http://172.30.10.185:4000
file:
upload:
storePath: /clouddisk/svr_sync/wwwroot/prj/www/uploads/
urlProfix: /uploads/
tempLocation: /web/temp_upload
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment