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

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

parent e9a7c5ae
......@@ -34,7 +34,7 @@
<h3 class="box-title">待办任务</h3>
<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="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 class="box-body">
......@@ -48,7 +48,7 @@
<h3 class="box-title">专项任务</h3>
<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="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 class="box-body">
......
......@@ -14,7 +14,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "ZEP_PLAN"}
return {fieldName: "ZEP_PLAN"}
},
back: {
ZEP_PLAN: "zepPlan",
......@@ -32,32 +32,14 @@ var tableArray = [
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: "zepBptype", width: 120, minwidth: 120, type: "string", align: "left"
},
{
display: "BP标识描述", name: "zepBptypename", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
/*editor: {
type: 'text'
}
}*/
},
{
display: "BP(合作伙伴)", name: "partner", width: 120, minwidth: 120, type: "string", align: "left",
......@@ -67,7 +49,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "PARTNER"}
return {fieldName: "PARTNER"}
},
back: {
PARTNER: "partner",
......@@ -119,7 +101,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "EBELN"}
return {fieldName: "EBELN"}
},
back: {
EBELN: "ebeln",
......@@ -155,7 +137,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "WAERS"}
return {fieldName: "WAERS"}
},
back: {
WAERS: "waers",
......@@ -175,7 +157,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "KURSF"}
return {fieldName: "KURSF"}
},
back: {
KURSF: "kursf",
......@@ -222,7 +204,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "RSTGR"}
return {fieldName: "RSTGR"}
},
back: {
RSTGR: "rstgr",
......@@ -266,7 +248,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "ZEP_PAY"}
return {fieldName: "ZEP_PAY"}
},
back: {
ZEP_PAY: "zepPay",
......@@ -282,7 +264,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "ZLSCH"}
return {fieldName: "ZLSCH"}
},
back: {
ZLSCH: "zlsch",
......@@ -310,7 +292,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "ZEP_BANK"}
return {fieldName: "ZEP_BANK"}
},
back: {
ZEP_BANK: "zepBank",
......@@ -354,7 +336,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "BANKN1"}
return {fieldName: "BANKN1"}
},
back: {
BANKN1: "bankn1",
......@@ -553,7 +535,7 @@ function bindQueryEvent() {
$('#bukrs').searchbox({
type: "system", name: "dictionary",
getParam: function (item) {
return {paramValue: "BUKRS"}
return {fieldName: "BUKRS"}
},
onChange: function (value, data) {
$('#bukrs').val(data.BUKRS);
......
......@@ -14,7 +14,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "ZEP_PLAN"}
return {fieldName: "ZEP_PLAN"}
},
back: {
ZEP_PLAN: "zepPlan",
......@@ -34,23 +34,23 @@ var tableArray = [
{
display: "BP标识", name: "zepBptype", width: 120, minwidth: 120, type: "string", align: "left",
/*editor: {
editor: {
required: false, type: "select",
data: {
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "ZEP_BPTYPE"}
return {fieldName: "ZEP_BPTYPE"}
},
back: {
ZEP_BPTYPE: "zepBptype",
ZEP_BPTYPENAME: "zepBptypename"
}
},
}*/
editor: {
type: 'text'
}
/*editor: {
type: 'text'
}*/
},
{
display: "BP标识描述", name: "zepBptypename", width: 120, minwidth: 120, type: "string", align: "left",
......@@ -60,25 +60,22 @@ var tableArray = [
},
{
display: "BP(合作伙伴)", name: "partner", width: 120, minwidth: 120, type: "string", align: "left",
/*editor: {
required: false, type: "select",
editor: {
required: true, type: "select",
data: {
type: 'system',
name: "dictionary",
name: "getCusAndSuppliers",
getParam: function (item) {
return {paramValue: "PARTNER"}
return {
ZEP_BPTYPE: item.zepBptype,
BUKRS:$("#bukrs").val()
}
},
back: {
PARTNER: "partner",
KOINH: "koinh",
BANKL: "bankl",
BANKN: "bankn",
SWIFT: "swift",
NAME_ORG1: "koinh"
}
},
}*/
editor: {
type: 'text'
}
},
{
......@@ -88,13 +85,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: {
type: 'text'
required: true, type: "select",
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: {
type: 'text'
}
......@@ -113,7 +125,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "ZEP_EXTYPE"}
return {fieldName: "ZEP_EXTYPE"}
},
back: {
ZEP_EXTYPE: "zepExtype",
......@@ -165,7 +177,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "KOSTL"}
return {fieldName: "KOSTL"}
},
back: {
KOSTL: "kostl",
......@@ -185,22 +197,21 @@ var tableArray = [
},
{
display: "内部订单", name: "aufnr", width: 120, minwidth: 120, type: "string", align: "left",
/*editor: {
editor: {
required: false, type: "select",
data: {
type: 'system',
name: "dictionary",
name: "getCompanyOrders",
getParam: function (item) {
return {paramValue: "AUFNR"}
return {
BUKRS: $("#bukrs").val()
}
},
back: {
AUFNR: "aufnr",
KTEXT: "ktext"
}
},
}*/
editor: {
type: 'text'
}
},
{
......@@ -217,7 +228,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "WAERS"}
return {fieldName: "WAERS"}
},
back: {
WAERS: "waers",
......@@ -236,7 +247,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "KURSF"}
return {fieldName: "KURSF"}
},
back: {
KURSF: "kursf",
......@@ -262,7 +273,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "MWSKZ"}
return {fieldName: "MWSKZ"}
},
back: {
MWSKZ: "mwskz",
......@@ -295,8 +306,12 @@ var tableArray = [
},
//等于(含税金额-本位币)/(1+税码对应的税率)*税码对应税率,可手工修改
render:function(item){
var value = MathUtil.div(item.kzwi11,(1+item.mwskz)).mul(item.mwskz).toFixed(2)
return item.kwetr1 = value;
if (Public.isBlank(item.kwetr1) || MathUtil.compare(item.kwetr1,0)===0){
var value = MathUtil.div(item.kzwi11,(1+item.mwskz)).mul(item.mwskz).toFixed(2)
return item.kwetr1 = value;
}else {
return item.kwetr1
}
}
},
{
......@@ -314,8 +329,13 @@ var tableArray = [
},
//等于含税金额/(1+税码对应的税率)*税码对应税率,可手工修改
render:function(item){
var value = MathUtil.div(item.kzwi1,(1+item.mwskz)).mul(item.mwskz).toFixed(2)
return item.kwetr = value;
if (Public.isBlank(item.kwetr) || MathUtil.compare(item.kwetr,0)===0){
var value = MathUtil.div(item.kzwi1,(1+item.mwskz)).mul(item.mwskz).toFixed(2)
return item.kwetr = value;
}else {
return item.kwetr
}
}
},
{
......@@ -341,7 +361,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "RSTGR"}
return {fieldName: "RSTGR"}
},
back: {
RSTGR: "rstgr",
......@@ -427,7 +447,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "ZEP_PAY"}
return {fieldName: "ZEP_PAY"}
},
back: {
ZEP_PAY: "zepPay",
......@@ -443,7 +463,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "ZLSCH"}
return {fieldName: "ZLSCH"}
},
back: {
ZLSCH: "zlsch",
......@@ -463,7 +483,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "ZEP_BANK"}
return {fieldName: "ZEP_BANK"}
},
back: {
ZEP_BANK: "zepBank",
......@@ -501,22 +521,21 @@ var tableArray = [
{display: "EP流程子序号", name: "zepItemno", width: 80, minwidth: 80, type: "string", align: "left"},
{
display: "付款银行账号", name: "bankn1", width: 200, minwidth: 120, type: "string", align: "left",
/*editor: {
editor: {
required: false, type: "select",
data: {
type: 'system',
name: "dictionary",
name: "getCompanyAndBankInfos",
getParam: function (item) {
return {paramValue: "BANKN1"}
return {
BUKRS: $("#bukrs").val()
}
},
back: {
BANKN1: "bankn1",
ZT012K_TEXT1: "zt012kText1",
TEXT1: "zt012kText1",
}
},
}*/
editor: {
type: 'text'
}
},
{
......@@ -707,7 +726,7 @@ function bindQueryEvent() {
$('#bukrs').searchbox({
type: "system", name: "dictionary",
getParam: function (item) {
return {paramValue: "BUKRS"}
return {fieldName: "BUKRS"}
},
onChange: function (value, data) {
$('#bukrs').val(data.BUKRS);
......
......@@ -14,7 +14,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "ZEP_PLAN"}
return {fieldName: "ZEP_PLAN"}
},
back: {
ZEP_PLAN: "zepPlan",
......@@ -47,26 +47,22 @@ var tableArray = [
},
{
display: "BP(合作伙伴)", name: "partner", width: 120, minwidth: 120, type: "string", align: "left",
/*editor: {
editor: {
required: true, type: "select",
data: {
type: 'system',
name: "dictionary",
name: "getCusAndSuppliers",
getParam: function (item) {
return {paramValue: "PARTNER"}
return {
ZEP_BPTYPE: item.zepBptype,
BUKRS:$("#bukrs").val()
}
},
back: {
PARTNER: "partner",
KOINH: "koinh",
BANKL: "bankl",
BANKN: "bankn",
SWIFT: "swift",
NAME_ORG1: "koinh"
}
},
}*/
editor: {
type: 'text'
}
},
{
......@@ -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: {
type: 'text'
required: true, type: "select",
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: {
type: 'text'
......@@ -112,7 +122,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "WAERS"}
return {fieldName: "WAERS"}
},
back: {
WAERS: "waers",
......@@ -132,7 +142,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "KURSF"}
return {fieldName: "KURSF"}
},
back: {
KURSF: "kursf",
......@@ -202,7 +212,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "RSTGR"}
return {fieldName: "RSTGR"}
},
back: {
RSTGR: "rstgr",
......@@ -246,7 +256,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "ZEP_PAY"}
return {fieldName: "ZEP_PAY"}
},
back: {
ZEP_PAY: "zepPay",
......@@ -262,7 +272,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "ZLSCH"}
return {fieldName: "ZLSCH"}
},
back: {
ZLSCH: "zlsch",
......@@ -290,7 +300,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "ZEP_BANK"}
return {fieldName: "ZEP_BANK"}
},
back: {
ZEP_BANK: "zepBank",
......@@ -311,37 +321,31 @@ var tableArray = [
columns: [
{display: "EP流程子序号", name: "zepItemno", width: 80, minwidth: 80, type: "string", align: "left"},
{
display: "付款银行账号", name: "bankn1", width: 120, minwidth: 120, type: "string", align: "left",
/*editor: {
required: true, type: "select",
display: "付款银行账号", name: "bankn1", width: 200, minwidth: 120, type: "string", align: "left",
editor: {
required: false, type: "select",
data: {
type: 'system',
name: "dictionary",
name: "getCompanyAndBankInfos",
getParam: function (item) {
return {paramValue: "BANKN1"}
return {
BUKRS: $("#bukrs").val()
}
},
back: {
BANKN1: "bankn1",
ZT012K_TEXT1: "zt012kText1",
TEXT1: "zt012kText1",
}
},
}*/
editor: {
required: false,
type: 'text'
}
},
{
display: "付款银行账号名称",
name: "zt012kText1",
width: 120,
width: 200,
minwidth: 120,
type: "string",
align: "left",
editor: {
type: 'text'
}
},
{
display: "付款附言", name: "zepTxt1", width: 120, minwidth: 120, type: "string", align: "left",
......@@ -520,7 +524,7 @@ function bindQueryEvent() {
$('#bukrs').searchbox({
type: "system", name: "dictionary",
getParam: function (item) {
return {paramValue: "BUKRS"}
return {fieldName: "BUKRS"}
},
onChange: function (value, data) {
$('#bukrs').val(data.BUKRS);
......
......@@ -23,6 +23,7 @@
<x:hidden name="positionName"/>
<x:hidden name="personMemberId"/>
<x:hidden name="personMemberName"/>
<x:hidden name="zepFtype"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:inputC name="zepFtypename" required="false" readonly="true" label="EP付款申请类别名称" labelCol="2" maxLength="64"
......
......@@ -14,7 +14,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "ZEP_PLAN"}
return {fieldName: "ZEP_PLAN"}
},
back: {
ZEP_PLAN: "zepPlan",
......@@ -186,7 +186,7 @@ var tableArray = [
type: 'system',
name: "dictionary",
getParam: function (item) {
return {paramValue: "ZEP_PAY"}
return {fieldName: "ZEP_PAY"}
},
back: {
ZEP_PAY: "zepPay",
......@@ -453,7 +453,7 @@ function bindQueryEvent() {
$('#bukrs').searchbox({
type: "system", name: "dictionary",
getParam: function (item) {
return {paramValue: "BUKRS"}
return {fieldName: "BUKRS"}
},
onChange: function (value, data) {
$('#bukrs').val(data.BUKRS);
......
......@@ -410,7 +410,7 @@ function bindQueryEvent() {
$('#bukrs').searchbox({
type: "system", name: "dictionary",
getParam: function (item) {
return {paramValue: "BUKRS"}
return {fieldName: "BUKRS"}
},
onChange: function (value, data) {
$('#bukrs').val(data.BUKRS);
......
......@@ -2,7 +2,8 @@ package com.huigou.topsun.controller;
import cn.hutool.core.collection.CollectionUtil;
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.bmp.common.easysearch.EasySearch;
import com.huigou.uasp.bmp.common.easysearch.domain.model.EasySearchParse;
......@@ -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.impl.MemEasySearcherImpl;
import com.huigou.util.SDO;
import com.huigou.util.StringUtil;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Controller;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Auther: xin.lu
......@@ -27,6 +30,8 @@ import java.util.*;
public class ResourceSearchController {
@Resource
private SapDictionaryApplication sapDictionaryApplication;
@Resource
private SapPaymentApplication sapPaymentApplication;
@EasySearch(queryName = "knttp")
public Map<String, Object> knttpSelect(SDO sdo){
......@@ -65,11 +70,33 @@ public class ResourceSearchController {
public Map<String, Object> sapMaterialSelect(SDO sdo) throws IOException {
String fieldName = sdo.getString("paramValue");
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<>();
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.keySet().forEach(key->{
QuerySchemeField querySchemeField = new QuerySchemeField("",key,"string",200L);
QuerySchemeField querySchemeField = new QuerySchemeField(key,key,"string",200L);
fields.add(querySchemeField);
});
}
......@@ -84,15 +111,56 @@ public class ResourceSearchController {
return model;
}
@EasySearch(queryName = "dictionary")
public Map<String, Object> queryDictionary(SDO sdo) throws IOException {
String fieldName = sdo.getString("paramValue");
List<Map<String, Object>> mapList = sapDictionaryApplication.getSapDictionary(fieldName);
@EasySearch(queryName = "getCusAndSuppliers")
public Map<String, Object> getCusAndSuppliers(SDO sdo) throws IOException {
String param = sdo.getString("paramValue");
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<>();
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.keySet().forEach(key->{
QuerySchemeField querySchemeField = new QuerySchemeField("",key,"string",200L);
QuerySchemeField querySchemeField = new QuerySchemeField(key,key,"string",200L);
fields.add(querySchemeField);
});
}
......
package com.huigou.topsun.sap.sapApplication.dictionary.application;
package com.huigou.topsun.sap.sapApplication.application;
import java.io.IOException;
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.materail.vo.SapMaterialVo;
import com.huigou.topsun.sap.sapApplication.domain.vo.SapMaterialVo;
import java.io.IOException;
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.huigou.cache.SystemCache;
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 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.fasterxml.jackson.core.JsonProcessingException;
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.purchaseInfoRecord.domain.SapResult;
import com.huigou.topsun.sap.sapApplication.domain.query.SapDialogQuery;
import com.huigou.topsun.sap.sapApplication.materail.SapMaterialApplication;
import com.huigou.topsun.sap.sapApplication.domain.query.SapDialogQueryRequest;
import com.huigou.topsun.sap.sapApplication.materail.vo.SapMaterialVo;
import com.huigou.topsun.sap.statsIndicators.domain.SapStatsIndicatorsResult;
import com.huigou.topsun.sap.sapApplication.application.SapMaterialApplication;
import com.huigou.topsun.sap.sapApplication.domain.vo.SapMaterialVo;
import com.huigou.util.JSONUtil;
import com.huigou.util.StringUtil;
import oracle.sql.NUMBER;
import org.springframework.stereotype.Service;
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;
import com.huigou.topsun.sap.sapApplication.domain.query.SapDialogQuery;
import com.huigou.topsun.sap.sapApplication.materail.SapMaterialApplication;
import com.huigou.topsun.sap.sapApplication.domain.query.SapDialogQueryRequest;
import com.huigou.topsun.sap.sapApplication.materail.vo.SapMaterialVo;
import com.huigou.topsun.sap.sapApplication.application.SapMaterialApplication;
import com.huigou.topsun.sap.sapApplication.domain.vo.SapMaterialVo;
import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.client.CommonController;
import com.huigou.util.SDO;
......@@ -12,7 +11,6 @@ import org.springframework.stereotype.Controller;
import java.io.IOException;
import java.util.List;
import java.util.Map;
/**
* @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.SkipAuth;
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;
......
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