|
|
|
@@ -0,0 +1,133 @@ |
|
|
|
package com.iformall.controller; |
|
|
|
|
|
|
|
import com.iformall.common.ErrorCode; |
|
|
|
import com.iformall.common.ResultData; |
|
|
|
import com.iformall.domain.po.WxCoupon; |
|
|
|
import com.iformall.enums.EnumCouponSourceType; |
|
|
|
import com.iformall.enums.EnumSharingReceiverQualificationGth; |
|
|
|
import com.iformall.enums.EnumSharingReceiverQualificationQy; |
|
|
|
import com.iformall.service.bank.WxBankUtilService; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import java.lang.reflect.Method; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
@RestController |
|
|
|
@RequestMapping("bank") |
|
|
|
@Api(description="银行") |
|
|
|
public class BankController extends BaseController{ |
|
|
|
|
|
|
|
private final Logger logger = LoggerFactory.getLogger(this.getClass()); |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WxBankUtilService wxBankUtilService; |
|
|
|
|
|
|
|
@ApiOperation("根据对私银行卡号获取开户银行") |
|
|
|
@GetMapping("/searchBanks") |
|
|
|
public ResultData searchBanks(String accountNumber) { |
|
|
|
logger.debug("[" + getIpAddr() + "] BankController::searchBanks"); |
|
|
|
if(StringUtils.isBlank(accountNumber)){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
if(accountNumber.trim().length() < 10){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"参数不符合规范"); |
|
|
|
} |
|
|
|
try { |
|
|
|
return wxBankUtilService.searchBanksByBankAccount(getTenantInfo(),accountNumber); |
|
|
|
} catch (Exception e) { |
|
|
|
return new ResultData(ErrorCode.SYS_SERVER_ERROR); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("查询支持个人业务的银行列表") |
|
|
|
@GetMapping("personalBanking") |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), |
|
|
|
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) |
|
|
|
public ResultData personalBanking(Integer pageNum, Integer pageSize) { |
|
|
|
logger.debug("[" + getIpAddr() + "] BankController::personalBanking"); |
|
|
|
if(pageNum == null){ |
|
|
|
pageNum = 1; |
|
|
|
} |
|
|
|
if(pageSize == null){ |
|
|
|
pageSize = 200; |
|
|
|
} |
|
|
|
int offset = (pageNum-1)*pageSize; |
|
|
|
int limit = pageSize; |
|
|
|
|
|
|
|
return wxBankUtilService.personalBanking(getTenantInfo(),offset, limit); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("查询支持对公业务的银行列表") |
|
|
|
@GetMapping("corporateBanking") |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), |
|
|
|
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) |
|
|
|
public ResultData corporateBanking(Integer pageNum, Integer pageSize) { |
|
|
|
logger.debug("[" + getIpAddr() + "] BankController::corporateBanking"); |
|
|
|
if(pageNum == null){ |
|
|
|
pageNum = 1; |
|
|
|
} |
|
|
|
if(pageSize == null){ |
|
|
|
pageSize = 200; |
|
|
|
} |
|
|
|
int offset = (pageNum-1)*pageSize; |
|
|
|
int limit = pageSize; |
|
|
|
|
|
|
|
return wxBankUtilService.corporateBanking(getTenantInfo(),offset, limit); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("查省") |
|
|
|
@GetMapping("areasProvinces") |
|
|
|
public ResultData areasProvinces() { |
|
|
|
logger.debug("[" + getIpAddr() + "] BankController::areasProvinces"); |
|
|
|
return wxBankUtilService.areasProvinces(getTenantInfo()); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("查市") |
|
|
|
@GetMapping("areasCities") |
|
|
|
public ResultData areasCities(Integer provinceCode) { |
|
|
|
logger.debug("[" + getIpAddr() + "] BankController::areasCities"); |
|
|
|
if(provinceCode == null){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
return wxBankUtilService.areasCities(getTenantInfo(),provinceCode); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("查支行") |
|
|
|
@GetMapping("bankBranches") |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), |
|
|
|
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) |
|
|
|
public ResultData bankBranches(String bankAliasCode, Integer cityCode, Integer pageNum, Integer pageSize) { |
|
|
|
logger.debug("[" + getIpAddr() + "] BankController::bankBranches"); |
|
|
|
if(StringUtils.isBlank(bankAliasCode)){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未选择银行"); |
|
|
|
} |
|
|
|
if(cityCode == null){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未选择城市"); |
|
|
|
} |
|
|
|
if(pageNum == null){ |
|
|
|
pageNum = 1; |
|
|
|
} |
|
|
|
if(pageSize == null){ |
|
|
|
pageSize = 200; |
|
|
|
} |
|
|
|
int offset = (pageNum-1)*pageSize; |
|
|
|
int limit = pageSize; |
|
|
|
|
|
|
|
return wxBankUtilService.bankBranches(getTenantInfo(),bankAliasCode,cityCode,offset, limit); |
|
|
|
} |
|
|
|
|
|
|
|
} |