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);
}
}
package com.ost.micro.provider.controller;
import com.google.gson.internal.LinkedTreeMap;
import com.ost.micro.core.aop.DataToUnderline;
import com.ost.micro.core.contant.Result;
import com.ost.micro.core.context.model.response.DataResponse;
import com.ost.micro.core.exception.ServiceException;
import com.ost.micro.core.pay.modules.cardservice.dto.equipment.request.EquipmentReqDto;
import com.ost.micro.core.pay.modules.cardservice.dto.equipment.request.EquipmentUpReqDto;
import com.ost.micro.core.pay.modules.cardservice.dto.equipment.request.ForwardingDeviceReqDto;
import com.ost.micro.core.pay.modules.cardservice.dto.equipment.request.ForwardingReqDto;
import com.ost.micro.core.pay.modules.cardservice.dto.equipment.response.EquipmentResDto;
import com.ost.micro.core.pay.modules.cardservice.dto.equipment.response.EquipmentUpResDto;
import com.ost.micro.core.pay.modules.cardservice.dto.equipment.response.ForwardingDeviceRespDto;
import com.ost.micro.core.pay.resp.EventCode;
import com.ost.micro.core.utils.FileHelper;
import com.ost.micro.core.utils.GsonUtil;
import com.ost.micro.core.utils.ResponseUtils;
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.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.HttpStatus;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.entity.mime.content.FileBody;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.consul.discovery.ConsulDiscoveryClient;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 设备表
*
* @author rain
* @email rain.guo@bytehug.com
* @date 2019-08-13 16:36:54
*/
@RestController
@RequestMapping("/provider/card/equipment")
@Api(tags = "card设备表接口")
@Slf4j
public class CardEquipmentController {
@Autowired
private PaymentServiceClient paymentServiceClient;
@Autowired
private ConsulDiscoveryClient consulDiscoveryClient;
@Autowired
private ServiceUrl serviceUrl;
@Value("${atx-url}")
private String ATX_URL;
@GetMapping("")
@ApiOperation("分页列表")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "keyword", value = "关键字", required = false, dataType = "String"),
@ApiImplicitParam(paramType = "query", name = "biz_id", value = "所属平台", required = false, dataType = "long"),
@ApiImplicitParam(paramType = "query", name = "up_state", value = "升级状态(0失败1成功)", required = false, dataType = "int"),
@ApiImplicitParam(paramType = "query", name = "biz_ids", value = "所属平台集合", required = false, allowMultiple = true, dataType = "Long"),
@ApiImplicitParam(paramType = "query", name = "page_index", value = "页码", required = true, dataType = "int"),
@ApiImplicitParam(paramType = "query", name = "page_size", value = "每页数码条数", required = true, dataType = "int")})
@DataToUnderline()
public DataResponse<List<EquipmentResDto>> search(@RequestParam(required = false, name = "keyword") String keyword,
@RequestParam(required = false, name = "biz_id") Long bizId,
@RequestParam(required = false, name = "up_state") Integer upState,
@RequestParam(required = false, name = "biz_ids") List<Long> bizIds,
@RequestParam(name = "page_index") Integer pageIndex,
@RequestParam(name = "page_size") Integer pageSize) {
String equipmentUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/equipment";
Map params = new HashMap();
params.put("keyword", keyword);
params.put("bizId", bizId);
params.put("upState", upState);
params.put("bizIds", !CollectionUtils.isEmpty(bizIds) ? StringUtils.strip(bizIds.toString(), "[]") : null);
params.put("pageIndex", pageIndex);
params.put("pageSize", pageSize);
return paymentServiceClient.get(equipmentUrl, params);
}
@GetMapping("list")
@ApiOperation("列表")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "biz_id", value = "所属平台", dataType = "long"),
@ApiImplicitParam(paramType = "query", name = "biz_ids", value = "所属平台集合", required = false, allowMultiple = true, dataType = "Long")
})
@DataToUnderline()
public DataResponse<List<EquipmentResDto>> list(@RequestParam(required = false, name = "biz_id") Long bizId,
@RequestParam(required = false, name = "biz_ids") List<Long> bizIds) {
String equipmentUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/equipment/list";
Map params = new HashMap();
params.put("bizId", bizId);
params.put("bizIds", !CollectionUtils.isEmpty(bizIds) ? StringUtils.strip(bizIds.toString(), "[]") : null);
return paymentServiceClient.get(equipmentUrl, params);
}
@GetMapping("cards")
@ApiOperation("绑卡记录")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "equipment_id", value = "设备id", dataType = "long"),
@ApiImplicitParam(paramType = "query", name = "biz_ids", value = "所属平台集合", required = false, allowMultiple = true, dataType = "Long")
})
@DataToUnderline()
public DataResponse cards(@RequestParam(required = false, name = "equipment_id") Long equipmentId,
@RequestParam(required = false, name = "biz_ids") List<Long> bizIds) {
String equipmentUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/equipment/cards";
Map params = new HashMap();
params.put("equipmentId", equipmentId);
params.put("bizIds", !CollectionUtils.isEmpty(bizIds) ? StringUtils.strip(bizIds.toString(), "[]") : null);
return paymentServiceClient.get(equipmentUrl, params);
}
@GetMapping("/{id}")
@ApiOperation("查看")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "path", name = "id", value = "id", dataType = "Long"),
@ApiImplicitParam(paramType = "query", name = "biz_ids", value = "所属平台集合", allowMultiple = true, dataType = "Long")})
@DataToUnderline()
public DataResponse<EquipmentResDto> info(@PathVariable("id") Long id, @RequestParam(required = false, name = "biz_ids") List<Long> bizIds) {
String equipmentUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/equipment/" + id;
Map params = new HashMap();
params.put("bizIds", !CollectionUtils.isEmpty(bizIds) ? StringUtils.strip(bizIds.toString(), "[]") : null);
return paymentServiceClient.get(equipmentUrl, params);
}
@GetMapping("/{equipment_no}/status")
@ApiOperation("查询设备是否已完成初始化")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "path", name = "equipment_no", value = "equipment_no", dataType = "String"),
@ApiImplicitParam(paramType = "query", name = "id", value = "id", dataType = "Long")
})
@DataToUnderline()
public DataResponse<EquipmentResDto> initStatus(@PathVariable("equipment_no") String equipmentNo,
@RequestParam Long id) throws InvocationTargetException, IllegalAccessException {
// 根据设备号查询ATX初始化状态
String equipmentUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/equipment/" + id;
Map params = new HashMap();
DataResponse<LinkedTreeMap> asserviceResponse = paymentServiceClient.get(equipmentUrl, params);
if (null != asserviceResponse && null != asserviceResponse.getData() && null != asserviceResponse.getData().getList()) {
LinkedTreeMap linkedTreeMap = (LinkedTreeMap) asserviceResponse.getData().getList();
EquipmentReqDto equipmentReqDto = new EquipmentReqDto();
EquipmentReqDto equipmentInitResDto = new EquipmentReqDto();
BeanUtils.copyProperties(equipmentReqDto, linkedTreeMap);
if (null != equipmentReqDto.getInitStatus() && "1".equals(equipmentReqDto.getInitStatus())) {
return ResponseUtils.getInstance().success("success");
}
// 调ATX查询实时状态
String remoteAtxUrl = ATX_URL + "/api/v1/devices/init/" + equipmentNo;
log.info("调ATX查询实时状态, url:" + remoteAtxUrl);
Map remoteParams = new HashMap();
try {
ResponseEntity<DataResponse> responseEntity = paymentServiceClient.getRestTemplate().getForEntity(remoteAtxUrl, DataResponse.class, equipmentNo);
if (null != responseEntity && null != responseEntity.getBody()) {
DataResponse dataResponse = responseEntity.getBody();
if (null != dataResponse && null != dataResponse.getData() && ((List) dataResponse.getData().getList()).size() > 0) {
LinkedTreeMap remoteResult = (LinkedTreeMap) ((List) dataResponse.getData().getList()).get(0);
if (null != remoteResult.get("init_status") && !"0".equals(remoteResult.get("init_status"))) {
// 刷新init_status状态字段
equipmentReqDto.setInitStatus(((Double) remoteResult.get("init_status")).intValue());
log.info("更新init_status状态:{}", equipmentReqDto);
updateInitStatus(equipmentReqDto);
equipmentInitResDto.setInitStatus(equipmentReqDto.getInitStatus());
equipmentInitResDto.setInitErrorMsg((String) remoteResult.get("init_error_msg"));
return ResponseUtils.getInstance().success(equipmentInitResDto);
} else {
equipmentInitResDto.setInitStatus(equipmentReqDto.getInitStatus());
equipmentInitResDto.setInitErrorMsg((String) remoteResult.get("init_error_msg"));
return ResponseUtils.getInstance().success(equipmentInitResDto);
}
}
}
return ResponseUtils.getInstance().fail(EventCode.FAIL.code(), "连接Remote服务器异常, 获取信息失败");
} catch (Exception ex) {
throw new ServiceException("连接Remote服务器异常", ex);
}
}
return ResponseUtils.getInstance().fail(EventCode.FAIL.code(), "未查询到设备信息");
}
@PostMapping("")
@ApiOperation("新增")
@DataToUnderline()
public DataResponse add(@RequestBody EquipmentReqDto dto) {
String equipmentUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/equipment";
return paymentServiceClient.post(equipmentUrl, dto);
}
@PutMapping("")
@ApiOperation("修改")
@DataToUnderline()
public DataResponse<EquipmentResDto> update(@RequestBody EquipmentReqDto dto) {
String passageUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/equipment";
return paymentServiceClient.putForEntity(passageUrl, dto);
}
@PutMapping("init/status")
@ApiOperation("修改初始化状态")
@DataToUnderline()
public DataResponse<EquipmentResDto> updateInitStatus(@RequestBody EquipmentReqDto dto) {
String passageUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/equipment/init/status";
return paymentServiceClient.putForEntity(passageUrl, dto);
}
@DeleteMapping("{id}")
@ApiOperation("删除")
@DataToUnderline()
@ApiImplicitParam(paramType = "path", name = "id", value = "id", required = true, dataType = "long")
public DataResponse delete(@PathVariable Long id) {
String equipmentUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/equipment/" + id;
ResponseEntity<DataResponse> resp = paymentServiceClient.getRestTemplate()
.exchange(equipmentUrl, HttpMethod.DELETE, null,
DataResponse.class, id);
return resp.getBody();
}
@PostMapping("/uploads")
@ApiOperation("上传")
@ApiImplicitParams({@ApiImplicitParam(paramType = "query", name = "file", value = "文件", required = true, dataType = "MultipartFile")})
@DataToUnderline()
public DataResponse<EquipmentUpResDto> uploads(@RequestParam("file") MultipartFile file) {
String equipmentUrl = ATX_URL + "/api/v1/uploads";
try {
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpPost httppost = new HttpPost(equipmentUrl);
File tempFile = FileHelper.multipartFileToFile(file);
FileBody bin = new FileBody(tempFile);
HttpEntity reqEntity = MultipartEntityBuilder.create().addPart("file", bin).build();//添加参数
httppost.setEntity(reqEntity);
CloseableHttpResponse response = httpclient.execute(httppost);
HttpEntity resEntity = response.getEntity();
String resStr = EntityUtils.toString(resEntity, "UTF-8");
DataResponse dataResponse = GsonUtil.fromJson(resStr, DataResponse.class);
int statusCode = response.getStatusLine().getStatusCode();
response.close();
httpclient.close();
tempFile.delete();
if (statusCode == HttpStatus.SC_OK) {
return dataResponse;
} else if (statusCode == HttpStatus.SC_INTERNAL_SERVER_ERROR) {
return ResponseUtils.getInstance().fail(Result.FAIL.getCode(), "连接ATX服务器失败");
}
} catch (Exception ex) {
log.info("上传文件失败:" + ex.getMessage());
throw new ServiceException("上传文件失败");
}
return ResponseUtils.getInstance().success(true);
}
@GetMapping("/up/level")
@ApiOperation("确认升级")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "biz_id_list", value = "apk所属商家", allowMultiple = true, required = true, dataType = "long"),
@ApiImplicitParam(paramType = "query", name = "apk_version", value = "apk版本号", required = true, dataType = "String"),
@ApiImplicitParam(paramType = "query", name = "equipment_nos", value = "设备编号集合", allowMultiple = true, required = true, dataType = "String"),
@ApiImplicitParam(paramType = "query", name = "type", value = "升级类型(0所有1低于当前版本2自选)", required = true, dataType = "int")})
@DataToUnderline()
public DataResponse upLevel(@RequestParam("biz_id_list") List<Long> bizIdList,
@RequestParam("apk_version") String apkVersion,
@RequestParam("equipment_nos") List<String> equipmentNos,
@RequestParam("type") Integer type) {
String equipmentUrl = ATX_URL + "/api/v1/apk_update";
Map params = new HashMap();
params.put("bizIdList", bizIdList);
params.put("equipmentNos", equipmentNos);
params.put("type", type);
params.put("apkVersion", apkVersion);
try {
ResponseEntity<DataResponse> responseEntity = paymentServiceClient.getRestTemplate().postForEntity(equipmentUrl, params, DataResponse.class);
return responseEntity.getBody();
} catch (Exception ex) {
throw new ServiceException("连接ATX服务器异常");
}
}
@PostMapping("/call/forwarding/device/sim")
@ApiOperation("呼叫转移查询设备中sim卡")
@DataToUnderline()
public DataResponse<ForwardingDeviceRespDto> callForwardingSim(@RequestBody ForwardingDeviceReqDto dto) {
String equipmentUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/equipment/call/forwarding/device/sim";
return paymentServiceClient.post(equipmentUrl, dto);
}
@PostMapping("/call/forwarding")
@ApiOperation("呼叫转移")
@DataToUnderline()
public DataResponse callForwarding(@RequestBody ForwardingReqDto dto) {
String equipmentUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/equipment/call/forwarding";
return paymentServiceClient.post(equipmentUrl, dto);
}
@PostMapping("/up/level/edit")
@ApiOperation("设备升级修改")
@DataToUnderline()
public DataResponse upLevelEdit(@RequestBody EquipmentUpReqDto equipmentUpReqDto) {
String equipmentUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/equipment/up/level/edit";
return paymentServiceClient.post(equipmentUrl, equipmentUpReqDto);
}
}
......@@ -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()) {
......
package com.ost.micro.provider.controller;
import com.google.common.reflect.TypeToken;
import com.google.gson.Gson;
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.order.response.OrderResDto;
import com.ost.micro.core.pay.modules.cardservice.dto.order.response.OrderStatisticsResDto;
import com.ost.micro.core.pay.modules.cardservice.excel.OrderExcelDto;
import com.ost.micro.core.pay.modules.cardservice.excel.OrderStatisticsExcelDto;
import com.ost.micro.core.utils.DateUtil;
import com.ost.micro.core.utils.ExcelUtils;
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.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.consul.discovery.ConsulDiscoveryClient;
import org.springframework.util.CollectionUtils;
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 javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/provider/card/statics")
@Api(tags = "card交易统计")
@Slf4j
public class CardOrderStaticsController {
@Autowired
private PaymentServiceClient paymentServiceClient;
@Autowired
private ConsulDiscoveryClient consulDiscoveryClient;
@Autowired
private ServiceUrl serviceUrl;
@GetMapping("")
@ApiOperation("交易统计查询")
@ApiImplicitParams({
@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 = "payment_type", value = "支付方式 0-银行卡 1-固码汇旺财 3-PDD", required = false, dataType = "int"),
@ApiImplicitParam(paramType = "query", name = "passage_name", value = "通道名称", required = false, dataType = "String"),
@ApiImplicitParam(paramType = "query", name = "begin_time", value = "开始时间", required = false, dataType = "long"),
@ApiImplicitParam(paramType = "query", name = "end_time", value = "结束时间", required = false, 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 = "page_index", value = "页码", required = true, dataType = "int"),
@ApiImplicitParam(paramType = "query", name = "page_size", value = "每页数码条数", required = true, dataType = "int")})
@DataToUnderline()
public DataResponse<List<OrderStatisticsResDto>> search(
@RequestParam(required = false, name = "biz_id") Long bizId,
@RequestParam(required = false, name = "payment_type") Integer paymentType,
@RequestParam(required = false, name = "passage_name") String passageName,
@RequestParam(required = false, name = "biz_id_list") List<Long> bizIdList,
@RequestParam(required = false, name = "biz_ids") List<Long> bizIds,
@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,
@RequestParam(name = "page_index") Integer pageIndex,
@RequestParam(name = "page_size") Integer pageSize) {
String staticUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "api/provider/card/statics";
Map<String, Object> params = new HashMap<>();
params.put("bizId", bizId);
if (null != paymentType) {
params.put("paymentType", paymentType);
}
params.put("passageName", passageName);
if (!CollectionUtils.isEmpty(bizIdList)) {
bizIds = bizIdList;
}
params.put("bizIds", !CollectionUtils.isEmpty(bizIds) ? StringUtils.strip(bizIds.toString(), "[]") : null);
params.put("beginTime", beginTime);
params.put("endTime", endTime);
params.put("endTime", endTime);
params.put("currentBizId", currentBizId);
params.put("isBizIdFromPermission", isBizIdFromPermission);
params.put("pageIndex", pageIndex);
params.put("pageSize", pageSize);
return paymentServiceClient.get(staticUrl, params);
}
/**
* 交易明细
*
* @return
*/
@GetMapping("/item")
@ApiOperation("交易统计明细")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "keyword", value = "关键字", required = false, dataType = "String"),
@ApiImplicitParam(paramType = "query", name = "biz_id", value = "平台id", required = true, dataType = "long"),
@ApiImplicitParam(paramType = "query", name = "passage_id", value = "通道id", required = true, dataType = "long"),
@ApiImplicitParam(paramType = "query", name = "payment_type", value = "支付方式", required = false, dataType = "int"),
@ApiImplicitParam(paramType = "query", name = "biz_ids", value = "所属平台集合", required = false, allowMultiple = true, dataType = "Long"),
@ApiImplicitParam(paramType = "query", name = "begin_time", value = "开始时间", required = false, dataType = "long"),
@ApiImplicitParam(paramType = "query", name = "end_time", 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"),
@ApiImplicitParam(paramType = "query", name = "page_index", value = "页码", required = true, dataType = "int"),
@ApiImplicitParam(paramType = "query", name = "page_size", value = "每页数码条数", required = true, dataType = "int")})
@DataToUnderline()
public DataResponse tradePage(@RequestParam(required = false, name = "keyword") String keyword,
@RequestParam(name = "biz_id") Long bizId,
@RequestParam(required = false, name = "payment_type") Integer paymentType,
@RequestParam(required = false, name = "biz_ids") List<Long> bizIds,
@RequestParam(name = "passage_id") Long passageId,
@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,
@RequestParam(name = "page_index") Integer pageIndex,
@RequestParam(name = "page_size") Integer pageSize) {
String staticUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/statics/item";
Map<String, Object> params = new HashMap<>();
params.put("keyword", keyword);
params.put("bizId", bizId);
if (null != paymentType) {
params.put("paymentType", paymentType);
}
params.put("bizIds", !CollectionUtils.isEmpty(bizIds) ? StringUtils.strip(bizIds.toString(), "[]") : null);
params.put("passageId", passageId);
params.put("beginTime", beginTime);
params.put("endTime", endTime);
params.put("currentBizId", currentBizId);
params.put("isBizIdFromPermission", isBizIdFromPermission);
params.put("pageIndex", pageIndex);
params.put("pageSize", pageSize);
return paymentServiceClient.get(staticUrl, params);
}
@GetMapping("/export")
@ApiOperation("导出交易统计")
@ApiImplicitParams({
@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 = "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 = "payment_type", value = "支付方式", required = false, dataType = "int"),
@ApiImplicitParam(paramType = "query", name = "biz_ids", value = "所属平台集合", required = false, allowMultiple = true, dataType = "Long"),
@ApiImplicitParam(paramType = "query", name = "begin_time", value = "开始时间", required = false, dataType = "long"),
@ApiImplicitParam(paramType = "query", name = "end_time", value = "结束时间", required = false, dataType = "long")})
public void exportTradeStatic(@RequestParam(required = false, name = "biz_id") Long bizId,
@RequestParam(required = false, name = "biz_id_list") List<Long> bizIdList,
@RequestParam(required = false, name = "payment_type") Integer paymentType,
@RequestParam(required = false, name = "biz_ids") List<Long> bizIds,
@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 staticUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/statics/export";
Map<String, Object> params = new HashMap<>();
params.put("bizId", bizId);
if (!CollectionUtils.isEmpty(bizIdList)) {
bizIds = bizIdList;
}
if (null != paymentType) {
params.put("paymentType", paymentType);
}
params.put("bizIds", !CollectionUtils.isEmpty(bizIds) ? StringUtils.strip(bizIds.toString(), "[]") : null);
params.put("beginTime", beginTime);
params.put("endTime", endTime);
params.put("currentBizId", currentBizId);
params.put("isBizIdFromPermission", isBizIdFromPermission);
DataResponse dataResponse = paymentServiceClient.get(staticUrl, params);
if (null != dataResponse && null != dataResponse.getData()) {
Object obj = dataResponse.getData().getList();
Gson gson = new Gson();
if (null != obj && obj instanceof List) {
List<OrderStatisticsResDto> dataList = gson.fromJson(gson.toJson(obj), new TypeToken<List<OrderStatisticsResDto>>() {
}.getType());
try {
ExcelUtils.exportExcelToTarget(response, "交易统计_" + DateUtil.format(new Date(), "yyyyMMddHHmmss"), dataList, OrderStatisticsExcelDto.class);
} catch (Exception e) {
log.error("export 导出交易流水 error", e);
}
}
}
}
@GetMapping("/export/item")
@ApiOperation("导出交易统计明细")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "keyword", value = "关键字", required = false, dataType = "String"),
@ApiImplicitParam(paramType = "query", name = "biz_id", value = "平台id", required = 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 = "payment_type", value = "支付方式", required = false, dataType = "int"),
@ApiImplicitParam(paramType = "query", name = "biz_ids", value = "所属平台集合", required = false, allowMultiple = true, dataType = "Long"),
@ApiImplicitParam(paramType = "query", name = "passage_id", value = "通道id", required = true, dataType = "long"),
@ApiImplicitParam(paramType = "query", name = "begin_time", value = "开始时间", required = false, dataType = "long"),
@ApiImplicitParam(paramType = "query", name = "end_time", value = "结束时间", required = false, dataType = "long")})
public void exportTradePage(@RequestParam(required = false) String keyword,
@RequestParam(name = "biz_id") Long bizId,
@RequestParam(required = false, name = "payment_type") Integer paymentType,
@RequestParam(required = false, name = "biz_ids") List<Long> bizIds,
@RequestParam(name = "passage_id") Long passageId,
@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 staticUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/statics/export/item";
Map<String, Object> params = new HashMap<>();
params.put("keyword", keyword);
params.put("bizId", bizId);
if (null != paymentType) {
params.put("paymentType", paymentType);
}
params.put("bizIds", !CollectionUtils.isEmpty(bizIds) ? StringUtils.strip(bizIds.toString(), "[]") : null);
params.put("passageId", passageId);
params.put("beginTime", beginTime);
params.put("endTime", endTime);
params.put("currentBizId", currentBizId);
params.put("isBizIdFromPermission", isBizIdFromPermission);
DataResponse dataResponse = paymentServiceClient.get(staticUrl, params);
if (null != dataResponse && null != dataResponse.getData()) {
Object obj = dataResponse.getData().getList();
Gson gson = new Gson();
if (null != obj && obj instanceof List) {
List<OrderResDto> dataList = gson.fromJson(gson.toJson(obj), new TypeToken<List<OrderResDto>>() {
}.getType());
try {
ExcelUtils.exportExcelToTarget(response, "统计明细_" + DateUtil.format(new Date(), "yyyyMMddHHmmss"), dataList, OrderExcelDto.class);
} catch (Exception e) {
log.error("export 导出交易统计明细 error", e);
}
}
}
}
}
......@@ -38,7 +38,7 @@ import java.util.Map;
* @date 2019-08-13 16:37:27
*/
@RestController
@RequestMapping("provider/card/passage")
@RequestMapping("/provider/card/passage")
@Api(tags = "card支付通道接口")
@Slf4j
public class CardPassageController {
......@@ -60,6 +60,11 @@ public class CardPassageController {
@ApiImplicitParam(paramType = "query", name = "biz_id", value = "商家id", dataType = "Long"),
@ApiImplicitParam(paramType = "query", name = "biz_ids", value = "所属平台集合", required = false, allowMultiple = true, dataType = "Long"),
@ApiImplicitParam(paramType = "query", name = "is_control", value = "0未监控1监控中", dataType = "Integer"),
@ApiImplicitParam(paramType = "query", name = "is_entry_info", value = "是否是资质录入员", required = false, dataType = "int"),
@ApiImplicitParam(paramType = "query", name = "is_entry_info_admin", value = "是否是资质录入员admin", required = false, dataType = "int"),
@ApiImplicitParam(paramType = "query", name = "biz_id_admin", 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 = "current_biz_id", value = "当前登录的商家id", required = false, dataType = "long"),
@ApiImplicitParam(paramType = "query", name = "page_index", value = "页码", required = true, dataType = "int"),
@ApiImplicitParam(paramType = "query", name = "page_size", value = "每页数码条数", required = true, dataType = "int")})
@DataToUnderline()
......@@ -69,19 +74,36 @@ public class CardPassageController {
@RequestParam(required = false, name = "biz_id") Long bizId,
@RequestParam(required = false, name = "biz_ids") List<Long> bizIds,
@RequestParam(required = false, name = "is_control") Integer isControl,
@RequestParam(required = false, name = "is_entry_info") Integer isEntryInfo,
@RequestParam(required = false, name = "is_entry_info_admin") Integer isEntryInfoAdmin,
@RequestParam(required = false, name = "is_biz_id_from_permission") Boolean isBizIdFromPermission,
@RequestParam(required = false, name = "biz_id_admin") Long bizIdAdmin,
@RequestParam(required = false, name = "current_biz_id") Long currentBizId,
@RequestParam(name = "page_index") Integer pageIndex,
@RequestParam(name = "page_size") Integer pageSize) {
String passageUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/passage";
Map params = new HashMap();
params.put("keyword", keyword);
params.put("apiId", apiId);
params.put("bizId", bizId);
params.put("isControl", isControl);
params.put("bizIds", !CollectionUtils.isEmpty(bizIds) ? StringUtils.strip(bizIds.toString(), "[]") : null);
params.put("groupId", groupId);
params.put("pageIndex", pageIndex);
params.put("pageSize", pageSize);
return paymentServiceClient.get(passageUrl, params);
StringBuilder urlBuilder = new StringBuilder();
urlBuilder.append(serviceUrl.getAsServiceUrl(consulDiscoveryClient));
urlBuilder.append("/api/provider/card/passage");
urlBuilder.append("?keyword={keyword}");
urlBuilder.append("&apiId={apiId}");
urlBuilder.append("&groupId={groupId}");
urlBuilder.append("&bizId={bizId}");
urlBuilder.append("&bizIds={bizIds}");
urlBuilder.append("&isControl={isControl}");
urlBuilder.append("&isEntryInfo={isEntryInfo}");
urlBuilder.append("&isEntryInfoAdmin={isEntryInfoAdmin}");
urlBuilder.append("&isBizIdFromPermission={isBizIdFromPermission}");
urlBuilder.append("&bizIdAdmin={bizIdAdmin}");
urlBuilder.append("&currentBizId={currentBizId}");
urlBuilder.append("&pageIndex={pageIndex}");
urlBuilder.append("&pageSize={pageSize}");
Object bizIdsValues = !CollectionUtils.isEmpty(bizIds) ? StringUtils.strip(bizIds.toString(), "[]") : null;
ResponseEntity<DataResponse> result = paymentServiceClient.getRestTemplate().getForEntity(urlBuilder.toString(),
DataResponse.class, keyword, apiId, groupId, bizId, bizIdsValues, isControl, isEntryInfo, isEntryInfoAdmin, isBizIdFromPermission, bizIdAdmin,currentBizId,pageIndex,pageSize);
return result.getBody();
}
@GetMapping("list")
......@@ -89,6 +111,7 @@ public class CardPassageController {
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "biz_id", value = "所属平台id", dataType = "Long"),
@ApiImplicitParam(paramType = "query", name = "name", value = "名字", required = false, dataType = "String"),
@ApiImplicitParam(paramType = "query", name = "current_biz_id", value = "当前登录的商家id", required = false, dataType = "long"),
@ApiImplicitParam(paramType = "query", name = "biz_ids", value = "所属平台集合", required = false, allowMultiple = true, dataType = "Long"),
@ApiImplicitParam(paramType = "query", name = "group_type", value = "(0变金额2不变金额)", required = false, dataType = "Integer"),
@ApiImplicitParam(paramType = "query", name = "payment_type", value = "(0-银行卡 1-固码汇旺财 3-PDD)", required = false, dataType = "Integer"),
......@@ -97,6 +120,7 @@ public class CardPassageController {
@ApiImplicitParam(paramType = "query", name = "api_id", value = "接口id", dataType = "Long")})
@DataToUnderline()
public DataResponse list(@RequestParam(required = false, name = "biz_id") Long bizId,
@RequestParam(required = false, name = "current_biz_id") Long currentBizId,
@RequestParam(required = false, name = "name") String name,
@RequestParam(required = false, name = "bank_id") Long bankId,
@RequestParam(required = false, name = "group_type") Integer groupType,
......@@ -104,9 +128,10 @@ public class CardPassageController {
@RequestParam(required = false, name = "biz_ids") List<Long> bizIds,
@RequestParam(required = false, name = "bank_card") Long bankCard,
@RequestParam(required = false, name = "api_id") Long apiId) {
String passageUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/passage/list";
String passageUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/passage/list";
Map params = new HashMap();
params.put("bizId", bizId);
params.put("currentBizId", currentBizId);
params.put("apiId", apiId);
params.put("groupType", groupType);
params.put("paymentType", paymentType);
......@@ -135,7 +160,7 @@ public class CardPassageController {
@RequestParam(required = false, name = "biz_ids") List<Long> bizIds,
@RequestParam(required = false, name = "bank_card") Long bankCard,
@RequestParam(required = false, name = "api_id") Long apiId) {
String passageUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/passage/list/cashout";
String passageUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/passage/list/cashout";
Map params = new HashMap();
params.put("bizId", bizId);
params.put("apiId", apiId);
......@@ -155,7 +180,7 @@ public class CardPassageController {
@ApiImplicitParam(paramType = "query", name = "biz_ids", value = "所属平台集合", allowMultiple = true, dataType = "Long")})
@DataToUnderline()
public DataResponse<PassageResDto> info(@PathVariable("id") Long id, @RequestParam(required = false, name = "biz_ids") List<Long> bizIds) {
String passageUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/passage/" + id;
String passageUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/passage/" + id;
Map params = new HashMap();
params.put("bizIds", !CollectionUtils.isEmpty(bizIds) ? StringUtils.strip(bizIds.toString(), "[]") : null);
return paymentServiceClient.get(passageUrl, params);
......@@ -165,7 +190,8 @@ public class CardPassageController {
@ApiOperation("新增")
@DataToUnderline()
public DataResponse add(@RequestBody PassageReqDto dto) {
String passageUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/passage";
dto.setSource(1);
String passageUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/passage";
return paymentServiceClient.post(passageUrl, dto);
}
......@@ -174,7 +200,7 @@ public class CardPassageController {
@ApiOperation("修改")
@DataToUnderline()
public DataResponse<PassageResDto> update(@RequestBody PassageReqDto dto) {
String passageUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/passage";
String passageUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/passage";
return paymentServiceClient.putForEntity(passageUrl, dto);
}
......@@ -182,7 +208,7 @@ public class CardPassageController {
@ApiOperation("修改状态")
@DataToUnderline()
public DataResponse<PassageResDto> updateEnable(@RequestBody PassageReqDto dto) {
String passageUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/passage/enable";
String passageUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/passage/enable";
return paymentServiceClient.putForEntity(passageUrl, dto);
}
......@@ -191,7 +217,7 @@ public class CardPassageController {
@ApiImplicitParam(paramType = "path", name = "id", value = "id", required = true, dataType = "long")
@DataToUnderline()
public DataResponse delete(@PathVariable Long id) {
String passageUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/passage/" + id;
String passageUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/passage/" + id;
ResponseEntity<DataResponse> resp = paymentServiceClient.getRestTemplate()
.exchange(passageUrl, HttpMethod.DELETE, null,
DataResponse.class, id);
......@@ -202,7 +228,7 @@ public class CardPassageController {
@PostMapping("/check/enter")
@ApiOperation("测试登录/监控/获取url")
public DataResponse checkLogin(@RequestBody CheckLoginDto dto) {
String passageUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/passage/check/enter";
String passageUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/passage/check/enter";
return paymentServiceClient.post(passageUrl, dto);
}
......@@ -212,7 +238,7 @@ public class CardPassageController {
@ApiImplicitParam(paramType = "query", name = "card_number", value = "银行卡号", dataType = "Long")})
@DataToUnderline()
public DataResponse loginLogInfo(@RequestParam("card_number") String cardNumber) {
String passageUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/passage/enter/log/info";
String passageUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/passage/enter/log/info";
Map params = new HashMap();
params.put("cardNumber", cardNumber);
return paymentServiceClient.get(passageUrl, params);
......@@ -245,7 +271,7 @@ public class CardPassageController {
@ApiImplicitParam(paramType = "query", name = "bank_card", value = "银行卡号", dataType = "String")})
@DataToUnderline()
public DataResponse image(@RequestParam(name = "bank_card") String bankCard) {
String passageUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/passage/image";
String passageUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/passage/image";
Map params = new HashMap();
params.put("bankCard", bankCard);
return paymentServiceClient.get(passageUrl, params);
......@@ -255,7 +281,7 @@ public class CardPassageController {
@ApiOperation("查询域名成功率")
@DataToUnderline()
public DataResponse rate() {
String passageRateUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/card/passage/rate";
String passageRateUrl = serviceUrl.getAsServiceUrl(consulDiscoveryClient) + "/api/provider/card/passage/rate";
Map params = new HashMap();
return paymentServiceClient.get(passageRateUrl, params);
}
......
......@@ -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