Commit 1a514085 authored by 鲁鑫's avatar 鲁鑫

根据银行所属国家选择银行代码和名称

parent ca1983d4
......@@ -536,6 +536,21 @@ function initPersonDialog() {
$('#regionName').val(data.BEZEI);
}
});
$('#bankCode').searchbox({
type: "system", name: "getBankInfo",
getParam: function (item) {
if (Public.isBlank($('#bankCountry').val())){
Public.tip("请先选择银行所属国家")
return false;
}
return {
BANKS: $('#bankCountry').val(),
}
},
onChange: function (value, data) {
$('#bankCode').val(data.BANKL);
}
});
}
function sapMesShow(){
......
......@@ -50,7 +50,7 @@
<x:selectC dictionary="country" name="bankCountry" label="银行所属国家" labelCol="2" fieldCol="4" />
</div>
<div class="col-md-4">
<x:inputC name="bankCode" label="银行代码" labelCol="4" fieldCol="8" />
<x:inputC name="bankCode" label="银行代码" labelCol="4" fieldCol="8" wrapper="select"/>
</div>
</div>
<div class="hg-form-row">
......
......@@ -409,7 +409,24 @@ function loadSuppliersBankListGrid() {
},
{
display: "银行代码", name: "bankl", width: 200, minWidth: 60, type: "String", align: "left",
editor: {type: 'text', required: true }
editor: {
required: true, type: "select",
data: {
type: 'system',
name: "getBankInfo",
getParam: function (item) {
return {BANKS: item.banks}
},
back: {
BANKL: "bankl",
BANKA: "banka",
}
},
}
},
{
display: "银行名称", name: "banka", width: 300, minWidth: 60, type: "String", align: "left",
//editor: {type: 'text', required: false}
},
{
display: "银行帐户号码", name: "bankn", width: 200, minWidth: 60, type: "String", align: "left",
......@@ -431,10 +448,6 @@ function loadSuppliersBankListGrid() {
display: "对方开户行类型", name: "bvtyp", width: 160, minWidth: 60, type: "String", align: "left",
editor: {type: 'text', required: false}
},
{
display: "银行名称", name: "banka", width: 200, minWidth: 60, type: "String", align: "left",
editor: {type: 'text', required: false}
},
{
display: "分行", name: "brnch", width: 200, minWidth: 60, type: "String", align: "left",
editor: {type: 'text', required: false}
......
......@@ -4,10 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.huigou.cache.DictUtil;
import com.huigou.topsun.sap.sapApplication.application.SapAreaApplication;
import com.huigou.topsun.sap.sapApplication.application.SapDictionaryApplication;
import com.huigou.topsun.sap.sapApplication.application.SapMaterialApplication;
import com.huigou.topsun.sap.sapApplication.application.SapPaymentApplication;
import com.huigou.topsun.sap.sapApplication.application.*;
import com.huigou.topsun.sap.sapApplication.domain.query.SapDialogQuery;
import com.huigou.topsun.util.SAPUtils;
import com.huigou.uasp.annotation.ControllerMapping;
......@@ -48,6 +45,8 @@ public class ResourceSearchController {
private SapAreaApplication sapAreaApplication;
@Autowired
private DictionaryApplication dictionaryApplication;
@Autowired
private SapBankInfoApplication sapBankInfoApplication;
@EasySearch(queryName = "knttp")
public Map<String, Object> knttpSelect(SDO sdo){
......@@ -333,6 +332,15 @@ public class ResourceSearchController {
return this.initEasySearchModel( mapList, param, sdo);
}
@EasySearch(queryName = "getBankInfo")
public Map<String, Object> getBankInfo(SDO sdo) throws IOException {
String param = sdo.getString("paramValue");
String BANKS = sdo.getString("BANKS");
List<Map<String, String>> mapList = new ArrayList<>();
mapList = sapBankInfoApplication.getBankInfo(BANKS);
return this.initEasySearchModel( mapList, param, sdo);
}
public Map<String,Object> initEasySearchModel(List<Map<String, String>> mapList,String param,SDO sdo){
List<QuerySchemeField> fields = new ArrayList<>();
if (CollectionUtil.isNotEmpty(mapList)){
......
package com.huigou.topsun.sap.sapApplication.application;
import java.io.IOException;
import java.util.List;
import java.util.Map;
/**
* @Auther: xin.lu
* @Date: 2024/04/09/15:03
* @Description:
*/
public interface SapBankInfoApplication {
/**
* 根据银行国家代码查询银行信息
* @param BANKS
* @return
* @throws IOException
*/
List<Map<String,String>> getBankInfo(String BANKS) throws IOException;
}
package com.huigou.topsun.sap.sapApplication.application.impl;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.huigou.topsun.sap.common.HttpClient;
import com.huigou.topsun.sap.common.domain.SapResult;
import com.huigou.topsun.sap.sapApplication.application.SapBankInfoApplication;
import com.huigou.topsun.util.SAPUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Auther: xin.lu
* @Date: 2024/04/09/15:04
* @Description:
*/
@Service("sapBankInfoApplication")
public class SapBankInfoApplicationImpl implements SapBankInfoApplication {
@Autowired
private HttpClient httpClient;
@Override
public List<Map<String, String>> getBankInfo(String BANKS) throws IOException {
Map<String,String> param = new HashMap<>();
param.put("BANKS",BANKS);
List<Map<String,String>> paramList = new ArrayList<>();
paramList.add(param);
String execute = null;
List<Map<String,String>> mapList = new ArrayList<>();
try {
execute = httpClient.execute(paramList, "search/sch_bank_info");
Map<String, String> map = JSONObject.parseObject(execute, Map.class);
List<SapResult> sapResultList = JSONObject.parseArray(JSONUtil.toJsonStr(map.get("MSG")), SapResult.class);
if ("S".equals(sapResultList.get(0).getTYPE())) {
ObjectMapper objectMapper = SAPUtils.objectMapper();
mapList = objectMapper.readValue(com.huigou.util.JSONUtil.toString(map.get("RDATA")), new TypeReference<List<Map<String, String>>>() {});
}
} catch (IOException e) {
throw new RuntimeException("根据银行国家代码查询银行信息出错。");
}
return mapList;
}
}
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