Commit 757220f6 authored by 鲁鑫's avatar 鲁鑫

付款申请相关调用SAP查询接口

parent e9a7c5ae
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<h3 class="box-title">待办任务</h3> <h3 class="box-title">待办任务</h3>
<div class="box-tools pull-right"> <div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" title="刷新" onclick="reloadGrid()"><i class="fa fa-repeat"></i></button> <button type="button" class="btn btn-box-tool" title="刷新" onclick="reloadGrid()"><i class="fa fa-repeat"></i></button>
<button type="button" class="btn btn-box-tool" title="更多" onclick="waitTaskMore()"><i class="fa fa-bars"></i></button> <button type="button" class="btn btn-box-tool" title="更多" onclick="showTasksMore(1)"><i class="fa fa-bars"></i></button>
</div> </div>
</div> </div>
<div class="box-body"> <div class="box-body">
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<h3 class="box-title">专项任务</h3> <h3 class="box-title">专项任务</h3>
<div class="box-tools pull-right"> <div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" title="刷新" onclick="reloadGrid()"><i class="fa fa-repeat"></i></button> <button type="button" class="btn btn-box-tool" title="刷新" onclick="reloadGrid()"><i class="fa fa-repeat"></i></button>
<button type="button" class="btn btn-box-tool" title="更多" onclick="trackTaskMore()"><i class="fa fa-bars"></i></button> <button type="button" class="btn btn-box-tool" title="更多" onclick="showTask(1)"><i class="fa fa-bars"></i></button>
</div> </div>
</div> </div>
<div class="box-body"> <div class="box-body">
......
...@@ -14,7 +14,7 @@ var tableArray = [ ...@@ -14,7 +14,7 @@ var tableArray = [
type: 'system', type: 'system',
name: "dictionary", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {paramValue: "ZEP_PLAN"} return {fieldName: "ZEP_PLAN"}
}, },
back: { back: {
ZEP_PLAN: "zepPlan", ZEP_PLAN: "zepPlan",
...@@ -32,32 +32,14 @@ var tableArray = [ ...@@ -32,32 +32,14 @@ var tableArray = [
align: "left", align: "left",
}, },
{ {
display: "BP标识", name: "zepBptype", width: 120, minwidth: 120, type: "string", align: "left", display: "BP标识", name: "zepBptype", width: 120, minwidth: 120, type: "string", align: "left"
/*editor: {
required: true, type: "select",
data: {
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "ZEP_BPTYPE"}
},
back: {
ZEP_BPTYPE: "zepBptype",
ZEP_BPTYPENAME: "zepBptypename"
}
},
}*/
editor: {
type: 'text'
}
}, },
{ {
display: "BP标识描述", name: "zepBptypename", width: 120, minwidth: 120, type: "string", align: "left", display: "BP标识描述", name: "zepBptypename", width: 120, minwidth: 120, type: "string", align: "left",
editor: { /*editor: {
type: 'text' type: 'text'
} }*/
}, },
{ {
display: "BP(合作伙伴)", name: "partner", width: 120, minwidth: 120, type: "string", align: "left", display: "BP(合作伙伴)", name: "partner", width: 120, minwidth: 120, type: "string", align: "left",
...@@ -67,7 +49,7 @@ var tableArray = [ ...@@ -67,7 +49,7 @@ var tableArray = [
type: 'system', type: 'system',
name: "dictionary", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {paramValue: "PARTNER"} return {fieldName: "PARTNER"}
}, },
back: { back: {
PARTNER: "partner", PARTNER: "partner",
...@@ -119,7 +101,7 @@ var tableArray = [ ...@@ -119,7 +101,7 @@ var tableArray = [
type: 'system', type: 'system',
name: "dictionary", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {paramValue: "EBELN"} return {fieldName: "EBELN"}
}, },
back: { back: {
EBELN: "ebeln", EBELN: "ebeln",
...@@ -155,7 +137,7 @@ var tableArray = [ ...@@ -155,7 +137,7 @@ var tableArray = [
type: 'system', type: 'system',
name: "dictionary", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {paramValue: "WAERS"} return {fieldName: "WAERS"}
}, },
back: { back: {
WAERS: "waers", WAERS: "waers",
...@@ -175,7 +157,7 @@ var tableArray = [ ...@@ -175,7 +157,7 @@ var tableArray = [
type: 'system', type: 'system',
name: "dictionary", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {paramValue: "KURSF"} return {fieldName: "KURSF"}
}, },
back: { back: {
KURSF: "kursf", KURSF: "kursf",
...@@ -222,7 +204,7 @@ var tableArray = [ ...@@ -222,7 +204,7 @@ var tableArray = [
type: 'system', type: 'system',
name: "dictionary", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {paramValue: "RSTGR"} return {fieldName: "RSTGR"}
}, },
back: { back: {
RSTGR: "rstgr", RSTGR: "rstgr",
...@@ -266,7 +248,7 @@ var tableArray = [ ...@@ -266,7 +248,7 @@ var tableArray = [
type: 'system', type: 'system',
name: "dictionary", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {paramValue: "ZEP_PAY"} return {fieldName: "ZEP_PAY"}
}, },
back: { back: {
ZEP_PAY: "zepPay", ZEP_PAY: "zepPay",
...@@ -282,7 +264,7 @@ var tableArray = [ ...@@ -282,7 +264,7 @@ var tableArray = [
type: 'system', type: 'system',
name: "dictionary", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {paramValue: "ZLSCH"} return {fieldName: "ZLSCH"}
}, },
back: { back: {
ZLSCH: "zlsch", ZLSCH: "zlsch",
...@@ -310,7 +292,7 @@ var tableArray = [ ...@@ -310,7 +292,7 @@ var tableArray = [
type: 'system', type: 'system',
name: "dictionary", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {paramValue: "ZEP_BANK"} return {fieldName: "ZEP_BANK"}
}, },
back: { back: {
ZEP_BANK: "zepBank", ZEP_BANK: "zepBank",
...@@ -354,7 +336,7 @@ var tableArray = [ ...@@ -354,7 +336,7 @@ var tableArray = [
type: 'system', type: 'system',
name: "dictionary", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {paramValue: "BANKN1"} return {fieldName: "BANKN1"}
}, },
back: { back: {
BANKN1: "bankn1", BANKN1: "bankn1",
...@@ -553,7 +535,7 @@ function bindQueryEvent() { ...@@ -553,7 +535,7 @@ function bindQueryEvent() {
$('#bukrs').searchbox({ $('#bukrs').searchbox({
type: "system", name: "dictionary", type: "system", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {paramValue: "BUKRS"} return {fieldName: "BUKRS"}
}, },
onChange: function (value, data) { onChange: function (value, data) {
$('#bukrs').val(data.BUKRS); $('#bukrs').val(data.BUKRS);
......
...@@ -14,7 +14,7 @@ var tableArray = [ ...@@ -14,7 +14,7 @@ var tableArray = [
type: 'system', type: 'system',
name: "dictionary", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {paramValue: "ZEP_PLAN"} return {fieldName: "ZEP_PLAN"}
}, },
back: { back: {
ZEP_PLAN: "zepPlan", ZEP_PLAN: "zepPlan",
...@@ -47,26 +47,22 @@ var tableArray = [ ...@@ -47,26 +47,22 @@ var tableArray = [
}, },
{ {
display: "BP(合作伙伴)", name: "partner", width: 120, minwidth: 120, type: "string", align: "left", display: "BP(合作伙伴)", name: "partner", width: 120, minwidth: 120, type: "string", align: "left",
/*editor: { editor: {
required: true, type: "select", required: true, type: "select",
data: { data: {
type: 'system', type: 'system',
name: "dictionary", name: "getCusAndSuppliers",
getParam: function (item) { getParam: function (item) {
return {paramValue: "PARTNER"} return {
ZEP_BPTYPE: item.zepBptype,
BUKRS:$("#bukrs").val()
}
}, },
back: { back: {
PARTNER: "partner", PARTNER: "partner",
KOINH: "koinh", NAME_ORG1: "koinh"
BANKL: "bankl",
BANKN: "bankn",
SWIFT: "swift",
} }
}, },
}*/
editor: {
type: 'text'
} }
}, },
{ {
...@@ -77,14 +73,28 @@ var tableArray = [ ...@@ -77,14 +73,28 @@ var tableArray = [
} }
}, },
{ {
display: "BP联行号", name: "bankl", width: 120, minwidth: 120, type: "string", align: "left", display: "BP银行账号", name: "bankn", width: 200, minwidth: 120, type: "string", align: "left",
editor: { editor: {
required: true, type: "select",
type: 'text' data: {
type: 'system',
name: "getCusAndBanks",
getParam: function (item) {
return {
ZEP_BPTYPE: item.zepBptype,
PARTNER:item.partner
}
},
back: {
BANKN: "bankn",
BANKL: "bankl",
SWIFT: "swift",
}
},
} }
}, },
{ {
display: "BP银行账号", name: "bankn", width: 120, minwidth: 120, type: "string", align: "left", display: "BP联行号", name: "bankl", width: 200, minwidth: 120, type: "string", align: "left",
editor: { editor: {
type: 'text' type: 'text'
...@@ -112,7 +122,7 @@ var tableArray = [ ...@@ -112,7 +122,7 @@ var tableArray = [
type: 'system', type: 'system',
name: "dictionary", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {paramValue: "WAERS"} return {fieldName: "WAERS"}
}, },
back: { back: {
WAERS: "waers", WAERS: "waers",
...@@ -132,7 +142,7 @@ var tableArray = [ ...@@ -132,7 +142,7 @@ var tableArray = [
type: 'system', type: 'system',
name: "dictionary", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {paramValue: "KURSF"} return {fieldName: "KURSF"}
}, },
back: { back: {
KURSF: "kursf", KURSF: "kursf",
...@@ -202,7 +212,7 @@ var tableArray = [ ...@@ -202,7 +212,7 @@ var tableArray = [
type: 'system', type: 'system',
name: "dictionary", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {paramValue: "RSTGR"} return {fieldName: "RSTGR"}
}, },
back: { back: {
RSTGR: "rstgr", RSTGR: "rstgr",
...@@ -246,7 +256,7 @@ var tableArray = [ ...@@ -246,7 +256,7 @@ var tableArray = [
type: 'system', type: 'system',
name: "dictionary", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {paramValue: "ZEP_PAY"} return {fieldName: "ZEP_PAY"}
}, },
back: { back: {
ZEP_PAY: "zepPay", ZEP_PAY: "zepPay",
...@@ -262,7 +272,7 @@ var tableArray = [ ...@@ -262,7 +272,7 @@ var tableArray = [
type: 'system', type: 'system',
name: "dictionary", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {paramValue: "ZLSCH"} return {fieldName: "ZLSCH"}
}, },
back: { back: {
ZLSCH: "zlsch", ZLSCH: "zlsch",
...@@ -290,7 +300,7 @@ var tableArray = [ ...@@ -290,7 +300,7 @@ var tableArray = [
type: 'system', type: 'system',
name: "dictionary", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {paramValue: "ZEP_BANK"} return {fieldName: "ZEP_BANK"}
}, },
back: { back: {
ZEP_BANK: "zepBank", ZEP_BANK: "zepBank",
...@@ -311,37 +321,31 @@ var tableArray = [ ...@@ -311,37 +321,31 @@ var tableArray = [
columns: [ columns: [
{display: "EP流程子序号", name: "zepItemno", width: 80, minwidth: 80, type: "string", align: "left"}, {display: "EP流程子序号", name: "zepItemno", width: 80, minwidth: 80, type: "string", align: "left"},
{ {
display: "付款银行账号", name: "bankn1", width: 120, minwidth: 120, type: "string", align: "left", display: "付款银行账号", name: "bankn1", width: 200, minwidth: 120, type: "string", align: "left",
/*editor: { editor: {
required: true, type: "select", required: false, type: "select",
data: { data: {
type: 'system', type: 'system',
name: "dictionary", name: "getCompanyAndBankInfos",
getParam: function (item) { getParam: function (item) {
return {paramValue: "BANKN1"} return {
BUKRS: $("#bukrs").val()
}
}, },
back: { back: {
BANKN1: "bankn1", BANKN1: "bankn1",
ZT012K_TEXT1: "zt012kText1", TEXT1: "zt012kText1",
} }
}, },
}*/
editor: {
required: false,
type: 'text'
} }
}, },
{ {
display: "付款银行账号名称", display: "付款银行账号名称",
name: "zt012kText1", name: "zt012kText1",
width: 120, width: 200,
minwidth: 120, minwidth: 120,
type: "string", type: "string",
align: "left", align: "left",
editor: {
type: 'text'
}
}, },
{ {
display: "付款附言", name: "zepTxt1", width: 120, minwidth: 120, type: "string", align: "left", display: "付款附言", name: "zepTxt1", width: 120, minwidth: 120, type: "string", align: "left",
...@@ -520,7 +524,7 @@ function bindQueryEvent() { ...@@ -520,7 +524,7 @@ function bindQueryEvent() {
$('#bukrs').searchbox({ $('#bukrs').searchbox({
type: "system", name: "dictionary", type: "system", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {paramValue: "BUKRS"} return {fieldName: "BUKRS"}
}, },
onChange: function (value, data) { onChange: function (value, data) {
$('#bukrs').val(data.BUKRS); $('#bukrs').val(data.BUKRS);
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
<x:hidden name="positionName"/> <x:hidden name="positionName"/>
<x:hidden name="personMemberId"/> <x:hidden name="personMemberId"/>
<x:hidden name="personMemberName"/> <x:hidden name="personMemberName"/>
<x:hidden name="zepFtype"/>
<div class="hg-form-cols"> <div class="hg-form-cols">
<div class="hg-form-row"> <div class="hg-form-row">
<x:inputC name="zepFtypename" required="false" readonly="true" label="EP付款申请类别名称" labelCol="2" maxLength="64" <x:inputC name="zepFtypename" required="false" readonly="true" label="EP付款申请类别名称" labelCol="2" maxLength="64"
......
...@@ -14,7 +14,7 @@ var tableArray = [ ...@@ -14,7 +14,7 @@ var tableArray = [
type: 'system', type: 'system',
name: "dictionary", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {paramValue: "ZEP_PLAN"} return {fieldName: "ZEP_PLAN"}
}, },
back: { back: {
ZEP_PLAN: "zepPlan", ZEP_PLAN: "zepPlan",
...@@ -186,7 +186,7 @@ var tableArray = [ ...@@ -186,7 +186,7 @@ var tableArray = [
type: 'system', type: 'system',
name: "dictionary", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {paramValue: "ZEP_PAY"} return {fieldName: "ZEP_PAY"}
}, },
back: { back: {
ZEP_PAY: "zepPay", ZEP_PAY: "zepPay",
...@@ -453,7 +453,7 @@ function bindQueryEvent() { ...@@ -453,7 +453,7 @@ function bindQueryEvent() {
$('#bukrs').searchbox({ $('#bukrs').searchbox({
type: "system", name: "dictionary", type: "system", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {paramValue: "BUKRS"} return {fieldName: "BUKRS"}
}, },
onChange: function (value, data) { onChange: function (value, data) {
$('#bukrs').val(data.BUKRS); $('#bukrs').val(data.BUKRS);
......
...@@ -410,7 +410,7 @@ function bindQueryEvent() { ...@@ -410,7 +410,7 @@ function bindQueryEvent() {
$('#bukrs').searchbox({ $('#bukrs').searchbox({
type: "system", name: "dictionary", type: "system", name: "dictionary",
getParam: function (item) { getParam: function (item) {
return {paramValue: "BUKRS"} return {fieldName: "BUKRS"}
}, },
onChange: function (value, data) { onChange: function (value, data) {
$('#bukrs').val(data.BUKRS); $('#bukrs').val(data.BUKRS);
......
...@@ -2,7 +2,8 @@ package com.huigou.topsun.controller; ...@@ -2,7 +2,8 @@ package com.huigou.topsun.controller;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.huigou.cache.DictUtil; import com.huigou.cache.DictUtil;
import com.huigou.topsun.sap.sapApplication.dictionary.application.SapDictionaryApplication; import com.huigou.topsun.sap.sapApplication.application.SapDictionaryApplication;
import com.huigou.topsun.sap.sapApplication.application.SapPaymentApplication;
import com.huigou.uasp.annotation.ControllerMapping; import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.bmp.common.easysearch.EasySearch; import com.huigou.uasp.bmp.common.easysearch.EasySearch;
import com.huigou.uasp.bmp.common.easysearch.domain.model.EasySearchParse; import com.huigou.uasp.bmp.common.easysearch.domain.model.EasySearchParse;
...@@ -10,12 +11,14 @@ import com.huigou.uasp.bmp.common.easysearch.domain.model.QuerySchemeField; ...@@ -10,12 +11,14 @@ import com.huigou.uasp.bmp.common.easysearch.domain.model.QuerySchemeField;
import com.huigou.uasp.bmp.opm.application.MemEasySearcher; import com.huigou.uasp.bmp.opm.application.MemEasySearcher;
import com.huigou.uasp.bmp.opm.application.impl.MemEasySearcherImpl; import com.huigou.uasp.bmp.opm.application.impl.MemEasySearcherImpl;
import com.huigou.util.SDO; import com.huigou.util.SDO;
import com.huigou.util.StringUtil;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* @Auther: xin.lu * @Auther: xin.lu
...@@ -27,6 +30,8 @@ import java.util.*; ...@@ -27,6 +30,8 @@ import java.util.*;
public class ResourceSearchController { public class ResourceSearchController {
@Resource @Resource
private SapDictionaryApplication sapDictionaryApplication; private SapDictionaryApplication sapDictionaryApplication;
@Resource
private SapPaymentApplication sapPaymentApplication;
@EasySearch(queryName = "knttp") @EasySearch(queryName = "knttp")
public Map<String, Object> knttpSelect(SDO sdo){ public Map<String, Object> knttpSelect(SDO sdo){
...@@ -65,11 +70,33 @@ public class ResourceSearchController { ...@@ -65,11 +70,33 @@ public class ResourceSearchController {
public Map<String, Object> sapMaterialSelect(SDO sdo) throws IOException { public Map<String, Object> sapMaterialSelect(SDO sdo) throws IOException {
String fieldName = sdo.getString("paramValue"); String fieldName = sdo.getString("paramValue");
List<Map<String, Object>> mapList = sapDictionaryApplication.getSapDictionary(fieldName); List<Map<String, Object>> mapList = sapDictionaryApplication.getSapDictionary(fieldName);
return this.initEasySearchModel( mapList, "", sdo);
}
@EasySearch(queryName = "dictionary")
public Map<String, Object> queryDictionary(SDO sdo) throws IOException {
String param = sdo.getString("paramValue");
String fieldName = sdo.getString("fieldName");
String filterValue = sdo.getString("filterValue");
List<Map<String, Object>> mapList = new ArrayList<>();
mapList = sapDictionaryApplication.getSapDictionary(fieldName);
List<QuerySchemeField> fields = new ArrayList<>(); List<QuerySchemeField> fields = new ArrayList<>();
if (CollectionUtil.isNotEmpty(mapList)){ if (CollectionUtil.isNotEmpty(mapList)){
if (StringUtil.isNotBlank(filterValue)){//固定条件过滤,比如选了工厂后,只能读取改工厂下的物料组
mapList = mapList
.stream()
.filter(map -> map.containsValue(filterValue))
.collect(Collectors.toList());
}
if (StringUtil.isNotBlank(param)){//输入查询条件过滤
mapList = mapList
.stream()
.filter(map -> map.containsValue(param))
.collect(Collectors.toList());
}
Map<String, Object> map = mapList.get(0); Map<String, Object> map = mapList.get(0);
map.keySet().forEach(key->{ map.keySet().forEach(key->{
QuerySchemeField querySchemeField = new QuerySchemeField("",key,"string",200L); QuerySchemeField querySchemeField = new QuerySchemeField(key,key,"string",200L);
fields.add(querySchemeField); fields.add(querySchemeField);
}); });
} }
...@@ -84,15 +111,56 @@ public class ResourceSearchController { ...@@ -84,15 +111,56 @@ public class ResourceSearchController {
return model; return model;
} }
@EasySearch(queryName = "dictionary") @EasySearch(queryName = "getCusAndSuppliers")
public Map<String, Object> queryDictionary(SDO sdo) throws IOException { public Map<String, Object> getCusAndSuppliers(SDO sdo) throws IOException {
String fieldName = sdo.getString("paramValue"); String param = sdo.getString("paramValue");
List<Map<String, Object>> mapList = sapDictionaryApplication.getSapDictionary(fieldName); String BUKRS = sdo.getString("BUKRS");
String ZEP_BPTYPE = sdo.getString("ZEP_BPTYPE");
List<Map<String, Object>> mapList = new ArrayList<>();
mapList = sapPaymentApplication.getCusAndSuppliers(BUKRS,ZEP_BPTYPE);
return this.initEasySearchModel( mapList, param, sdo);
}
@EasySearch(queryName = "getCusAndBanks")
public Map<String, Object> getCusAndBanks(SDO sdo) throws IOException {
String param = sdo.getString("paramValue");
String PARTNER = sdo.getString("PARTNER");
String ZEP_BPTYPE = sdo.getString("ZEP_BPTYPE");
List<Map<String, Object>> mapList = new ArrayList<>();
mapList = sapPaymentApplication.getCusAndBanks(PARTNER,ZEP_BPTYPE);
return this.initEasySearchModel( mapList, param, sdo);
}
@EasySearch(queryName = "getCompanyAndBankInfos")
public Map<String, Object> getCompanyAndBankInfos(SDO sdo) throws IOException {
String param = sdo.getString("paramValue");
String BUKRS = sdo.getString("BUKRS");
List<Map<String, Object>> mapList = new ArrayList<>();
mapList = sapPaymentApplication.getCompanyAndBankInfos(BUKRS);
return this.initEasySearchModel( mapList, param, sdo);
}
@EasySearch(queryName = "getCompanyOrders")
public Map<String, Object> getCompanyOrders(SDO sdo) throws IOException {
String param = sdo.getString("paramValue");
String BUKRS = sdo.getString("BUKRS");
List<Map<String, Object>> mapList = new ArrayList<>();
mapList = sapPaymentApplication.getCompanyOrders(BUKRS);
return this.initEasySearchModel( mapList, param, sdo);
}
public Map<String,Object> initEasySearchModel(List<Map<String, Object>> mapList,String param,SDO sdo){
List<QuerySchemeField> fields = new ArrayList<>(); List<QuerySchemeField> fields = new ArrayList<>();
if (CollectionUtil.isNotEmpty(mapList)){ if (CollectionUtil.isNotEmpty(mapList)){
if (StringUtil.isNotBlank(param)){//输入查询条件过滤
mapList = mapList
.stream()
.filter(map -> map.containsValue(param))
.collect(Collectors.toList());
}
Map<String, Object> map = mapList.get(0); Map<String, Object> map = mapList.get(0);
map.keySet().forEach(key->{ map.keySet().forEach(key->{
QuerySchemeField querySchemeField = new QuerySchemeField("",key,"string",200L); QuerySchemeField querySchemeField = new QuerySchemeField(key,key,"string",200L);
fields.add(querySchemeField); fields.add(querySchemeField);
}); });
} }
......
package com.huigou.topsun.sap.sapApplication.dictionary.application; package com.huigou.topsun.sap.sapApplication.application;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
......
package com.huigou.topsun.sap.sapApplication.materail; package com.huigou.topsun.sap.sapApplication.application;
import com.huigou.topsun.sap.sapApplication.domain.query.SapDialogQuery; import com.huigou.topsun.sap.sapApplication.domain.query.SapDialogQuery;
import com.huigou.topsun.sap.sapApplication.materail.vo.SapMaterialVo; import com.huigou.topsun.sap.sapApplication.domain.vo.SapMaterialVo;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
......
package com.huigou.topsun.sap.sapApplication.application;
import java.io.IOException;
import java.util.List;
import java.util.Map;
/**
* @Auther: xin.lu
* @Date: 2024/03/06/21:08
* @Description:
*/
public interface SapPaymentApplication {
/**
* 根据公司代码和BP标识查询客户、供应商
* @param BUKRS
* @param ZEP_BPTYPE
* @return
*/
List<Map<String,Object>> getCusAndSuppliers(String BUKRS,String ZEP_BPTYPE) throws IOException;
/**
* 根据公司代码和BP标识查询客户、供应商银行
* @param PARTNER
* @param ZEP_BPTYPE
* @return
* @throws IOException
*/
List<Map<String,Object>> getCusAndBanks(String PARTNER,String ZEP_BPTYPE) throws IOException;
/**
* 根据公司代码查询银行账号
* @param BUKRS
* @return
* @throws IOException
*/
List<Map<String,Object>> getCompanyAndBankInfos(String BUKRS) throws IOException;
/**
* 根据公司代码查询公司内部订单
* @param BUKRS
* @return
* @throws IOException
*/
List<Map<String,Object>> getCompanyOrders(String BUKRS) throws IOException;
}
package com.huigou.topsun.sap.sapApplication.dictionary.application.impl; package com.huigou.topsun.sap.sapApplication.application.impl;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.huigou.cache.SystemCache; import com.huigou.cache.SystemCache;
import com.huigou.topsun.sap.common.HttpClient; import com.huigou.topsun.sap.common.HttpClient;
import com.huigou.topsun.sap.sapApplication.dictionary.application.SapDictionaryApplication; import com.huigou.topsun.sap.sapApplication.application.SapDictionaryApplication;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
......
package com.huigou.topsun.sap.sapApplication.materail.impl; package com.huigou.topsun.sap.sapApplication.application.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.huigou.topsun.sap.common.HttpClient; import com.huigou.topsun.sap.common.HttpClient;
import com.huigou.topsun.sap.purchaseInfoRecord.domain.SapResult; import com.huigou.topsun.sap.purchaseInfoRecord.domain.SapResult;
import com.huigou.topsun.sap.sapApplication.domain.query.SapDialogQuery; import com.huigou.topsun.sap.sapApplication.domain.query.SapDialogQuery;
import com.huigou.topsun.sap.sapApplication.materail.SapMaterialApplication; import com.huigou.topsun.sap.sapApplication.application.SapMaterialApplication;
import com.huigou.topsun.sap.sapApplication.domain.query.SapDialogQueryRequest; import com.huigou.topsun.sap.sapApplication.domain.vo.SapMaterialVo;
import com.huigou.topsun.sap.sapApplication.materail.vo.SapMaterialVo;
import com.huigou.topsun.sap.statsIndicators.domain.SapStatsIndicatorsResult;
import com.huigou.util.JSONUtil; import com.huigou.util.JSONUtil;
import com.huigou.util.StringUtil;
import oracle.sql.NUMBER;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
......
package com.huigou.topsun.sap.sapApplication.application.impl;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.huigou.topsun.sap.common.HttpClient;
import com.huigou.topsun.sap.purchaseInfoRecord.domain.SapResult;
import com.huigou.topsun.sap.sapApplication.application.SapPaymentApplication;
import com.huigou.uasp.bmp.common.application.BaseApplication;
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/03/06/21:08
* @Description:
*/
@Service("sapPaymentApplication")
public class SapPaymentApplicationImpl implements SapPaymentApplication {
@Autowired
private HttpClient httpClient;
@Override
public List<Map<String, Object>> getCusAndSuppliers(String BUKRS, String ZEP_BPTYPE) throws IOException {
Map<String,Object> param = new HashMap<>();
param.put("BUKRS",BUKRS);
param.put("ZEP_BPTYPE",ZEP_BPTYPE);
String execute = null;
List<Map<String,Object>> mapList = new ArrayList<>();
try {
execute = httpClient.execute(param, "search/sch_partner");
Map<String, Object> map = JSONObject.parseObject(execute, Map.class);
SapResult sapResult = JSONObject.parseObject(JSONUtil.toJsonStr(map.get("MSG")), SapResult.class);
if ("S".equals(sapResult.getTYPE())) {
mapList = (List<Map<String,Object>>)JSONArray.parse(JSONUtil.toJsonStr(map.get("RDATA")));
} else {
throw new RuntimeException("客户、供应商失败:" + sapResult.getMESSAGE());
}
} catch (IOException e) {
throw new RuntimeException("查询客户、供应商出错”。");
}
return mapList;
}
@Override
public List<Map<String, Object>> getCusAndBanks(String PARTNER, String ZEP_BPTYPE) throws IOException {
Map<String,Object> param = new HashMap<>();
param.put("PARTNER",PARTNER);
param.put("ZEP_BPTYPE",ZEP_BPTYPE);
String execute = null;
List<Map<String,Object>> mapList = new ArrayList<>();
try {
execute = httpClient.execute(param, "search/sch_bankdata");
Map<String, Object> map = JSONObject.parseObject(execute, Map.class);
SapResult sapResult = JSONObject.parseObject(JSONUtil.toJsonStr(map.get("MSG")), SapResult.class);
if ("S".equals(sapResult.getTYPE())) {
mapList = (List<Map<String,Object>>)JSONArray.parse(JSONUtil.toJsonStr(map.get("RDATA")));
} else {
throw new RuntimeException("查询客户、供应商银行失败:" + sapResult.getMESSAGE());
}
} catch (IOException e) {
throw new RuntimeException("查询客户、供应商银行出错”。");
}
return mapList;
}
@Override
public List<Map<String, Object>> getCompanyAndBankInfos(String BUKRS) throws IOException {
Map<String,Object> param = new HashMap<>();
param.put("BUKRS",BUKRS);
String execute = null;
List<Map<String,Object>> mapList = new ArrayList<>();
try {
execute = httpClient.execute(param, "search/sch_bankaccount");
Map<String, Object> map = JSONObject.parseObject(execute, Map.class);
SapResult sapResult = JSONObject.parseObject(JSONUtil.toJsonStr(map.get("MSG")), SapResult.class);
if ("S".equals(sapResult.getTYPE())) {
mapList = (List<Map<String,Object>>)JSONArray.parse(JSONUtil.toJsonStr(map.get("RDATA")));
} else {
throw new RuntimeException("查询公司代码银行账号失败:" + sapResult.getMESSAGE());
}
} catch (IOException e) {
throw new RuntimeException("查询公司代码银行账号出错”。");
}
return mapList;
}
@Override
public List<Map<String, Object>> getCompanyOrders(String BUKRS) throws IOException {
Map<String,Object> param = new HashMap<>();
param.put("BUKRS",BUKRS);
String execute = null;
List<Map<String,Object>> mapList = new ArrayList<>();
try {
execute = httpClient.execute(param, "search/sch_aufnr");
Map<String, Object> map = JSONObject.parseObject(execute, Map.class);
SapResult sapResult = JSONObject.parseObject(JSONUtil.toJsonStr(map.get("MSG")), SapResult.class);
if ("S".equals(sapResult.getTYPE())) {
mapList = (List<Map<String,Object>>)JSONArray.parse(JSONUtil.toJsonStr(map.get("RDATA")));
} else {
throw new RuntimeException("查询公司内部订单失败:" + sapResult.getMESSAGE());
}
} catch (IOException e) {
throw new RuntimeException("查询公司内部订单出错”。");
}
return mapList;
}
}
package com.huigou.topsun.sap.sapApplication.controller; package com.huigou.topsun.sap.sapApplication.controller;
import com.huigou.topsun.sap.sapApplication.domain.query.SapDialogQuery; import com.huigou.topsun.sap.sapApplication.domain.query.SapDialogQuery;
import com.huigou.topsun.sap.sapApplication.materail.SapMaterialApplication; import com.huigou.topsun.sap.sapApplication.application.SapMaterialApplication;
import com.huigou.topsun.sap.sapApplication.domain.query.SapDialogQueryRequest; import com.huigou.topsun.sap.sapApplication.domain.vo.SapMaterialVo;
import com.huigou.topsun.sap.sapApplication.materail.vo.SapMaterialVo;
import com.huigou.uasp.annotation.ControllerMapping; import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.client.CommonController; import com.huigou.uasp.client.CommonController;
import com.huigou.util.SDO; import com.huigou.util.SDO;
...@@ -12,7 +11,6 @@ import org.springframework.stereotype.Controller; ...@@ -12,7 +11,6 @@ import org.springframework.stereotype.Controller;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @Auther: xin.lu * @Auther: xin.lu
......
package com.huigou.topsun.sap.sapApplication.dictionary.controller; package com.huigou.topsun.sap.sapApplication.controller;
import com.huigou.topsun.sap.sapApplication.dictionary.application.SapDictionaryApplication; import com.huigou.topsun.sap.sapApplication.application.SapDictionaryApplication;
import com.huigou.uasp.annotation.ControllerMapping; import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.annotation.SkipAuth; import com.huigou.uasp.annotation.SkipAuth;
import com.huigou.uasp.client.CommonController; import com.huigou.uasp.client.CommonController;
......
package com.huigou.topsun.sap.sapApplication.materail.vo; package com.huigou.topsun.sap.sapApplication.domain.vo;
import lombok.Data; import lombok.Data;
......
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