Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
topsun-bpm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
鲁鑫
topsun-bpm
Commits
23c459d6
Commit
23c459d6
authored
Mar 19, 2024
by
鲁鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
质量信息记录SAP接口完善;SAP数据字典模糊查询
parent
60a4d0de
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
302 additions
and
133 deletions
+302
-133
costReimbursement.js
...app/biz/topsun/sap/costReimbursement/costReimbursement.js
+87
-78
sapPurchaseDetail.js
.../main/webapp/biz/topsun/sap/purchase/sapPurchaseDetail.js
+1
-1
qualityInfoRecordDetail.js
...z/topsun/sap/qualityInfoRecord/qualityInfoRecordDetail.js
+61
-23
ResourceSearchController.java
...om/huigou/topsun/controller/ResourceSearchController.java
+34
-21
SapQualityInfoRecordApplicationImpl.java
...application/impl/SapQualityInfoRecordApplicationImpl.java
+41
-1
SapDictionaryApplication.java
.../sapApplication/application/SapDictionaryApplication.java
+1
-1
SapMaterialApplication.java
...ap/sapApplication/application/SapMaterialApplication.java
+1
-1
SapDictionaryApplicationImpl.java
...cation/application/impl/SapDictionaryApplicationImpl.java
+8
-2
SapMaterialApplicationImpl.java
...lication/application/impl/SapMaterialApplicationImpl.java
+7
-4
SapDialogSelectController.java
.../sapApplication/controller/SapDialogSelectController.java
+1
-1
SAPUtils.java
topsun/src/main/java/com/huigou/topsun/util/SAPUtils.java
+60
-0
No files found.
topsun-xt/src/main/webapp/biz/topsun/sap/costReimbursement/costReimbursement.js
View file @
23c459d6
...
@@ -119,22 +119,21 @@ var tableArray = [
...
@@ -119,22 +119,21 @@ var tableArray = [
},
},
{
{
display
:
"费用类型代码"
,
name
:
"zepExtype"
,
width
:
120
,
minwidth
:
120
,
type
:
"string"
,
align
:
"left"
,
display
:
"费用类型代码"
,
name
:
"zepExtype"
,
width
:
120
,
minwidth
:
120
,
type
:
"string"
,
align
:
"left"
,
/*
editor: {
editor
:
{
required
:
false
,
type
:
"select"
,
required
:
false
,
type
:
"select"
,
data
:
{
data
:
{
type
:
'system'
,
type
:
'system'
,
name
:
"dictionary"
,
name
:
"dictionary"
,
getParam
:
function
(
item
)
{
getParam
:
function
(
item
)
{
return {fieldName: "
ZEP_EXTYPE
"}
return
{
fieldName
:
"
SPKZL
"
}
},
},
back
:
{
back
:
{
ZEP_EXTYPE: "zepExtype",
SPKZL
:
"zepExtype"
,
ZEP_EXTYPENAME: "zepExtypename"
SPTXT
:
"zepExtypename"
,
SAKNR
:
"hkont"
,
TXT50_SKAT
:
"txt50"
}
}
},
},
}*/
editor
:
{
type
:
'text'
}
}
},
},
{
{
...
@@ -171,7 +170,7 @@ var tableArray = [
...
@@ -171,7 +170,7 @@ var tableArray = [
},
},
{
{
display
:
"成本中心"
,
name
:
"kostl"
,
width
:
120
,
minwidth
:
120
,
type
:
"string"
,
align
:
"left"
,
display
:
"成本中心"
,
name
:
"kostl"
,
width
:
120
,
minwidth
:
120
,
type
:
"string"
,
align
:
"left"
,
/*
editor: {
editor
:
{
required
:
false
,
type
:
"select"
,
required
:
false
,
type
:
"select"
,
data
:
{
data
:
{
type
:
'system'
,
type
:
'system'
,
...
@@ -181,12 +180,9 @@ var tableArray = [
...
@@ -181,12 +180,9 @@ var tableArray = [
},
},
back
:
{
back
:
{
KOSTL
:
"kostl"
,
KOSTL
:
"kostl"
,
KTEXT1
: "ktext1"
LTEXT
:
"ktext1"
}
}
},
},
}*/
editor
:
{
type
:
'text'
}
}
},
},
{
{
...
@@ -285,64 +281,68 @@ var tableArray = [
...
@@ -285,64 +281,68 @@ var tableArray = [
}
}
},
},
{
{
display
:
"含税金额(本位币)"
,
name
:
"kzwi11"
,
width
:
120
,
minwidth
:
120
,
type
:
"money"
,
align
:
"left"
,
display
:
"税额"
,
name
:
"kwetr"
,
width
:
120
,
minwidth
:
120
,
type
:
"money"
,
align
:
"left"
,
//"公司代码等于1000币别等于CNY时,默认等于含税金额;
// 公司代码等于1000币别不等于CNY时,等于含税金额*币别对应的汇率"
render
:
function
(
item
){
var
money
=
0
;
if
(
item
.
waers
===
"CNY"
){
money
=
item
.
kzwi1
;
}
else
{
money
=
MathUtil
.
mul
(
item
.
kzwi1
,
item
.
kursf
)
}
return
item
.
kzwi11
=
money
;
}
},
{
display
:
"税额(本位币)"
,
name
:
"kwetr1"
,
width
:
120
,
minwidth
:
120
,
type
:
"money"
,
align
:
"left"
,
editor
:
{
editor
:
{
mask
:
'nnnnnnnnn.nn'
,
mask
:
'nnnnnnnnn.nn'
,
type
:
'text'
type
:
'text'
},
},
//等于(含税金额-本位币)/(1+税码对应的税率)*税码对应税率,可手工修改
//等于含税金额/(1+税码对应的税率)*税码对应税率,可手工修改
render
:
function
(
item
){
// render:function(item){
if
(
Public
.
isBlank
(
item
.
kwetr1
)
||
MathUtil
.
compare
(
item
.
kwetr1
,
0
)
===
0
){
// if (Public.isBlank(item.kwetr) || MathUtil.compare(item.kwetr,0)===0){
var
value
=
MathUtil
.
div
(
item
.
kzwi11
,(
1
+
item
.
mwskz
)).
mul
(
item
.
mwskz
).
toFixed
(
2
)
// var value = MathUtil.div(item.kzwi1,(1+item.mwskz)).mul(item.mwskz).toFixed(2)
return
item
.
kwetr1
=
value
;
// return item.kwetr = value;
}
else
{
// }else {
return
item
.
kwetr1
// return item.kwetr
}
// }
}
//
// }
},
},
{
{
display
:
"不含税金额
(本位币)"
,
name
:
"netwr1
"
,
width
:
120
,
minwidth
:
120
,
type
:
"money"
,
align
:
"left"
,
display
:
"不含税金额
"
,
name
:
"netwr
"
,
width
:
120
,
minwidth
:
120
,
type
:
"money"
,
align
:
"left"
,
//等于含税金额
(本位币)减去税额(本位币)
//等于含税金额
减去税额
render
:
function
(
item
){
render
:
function
(
item
){
return
item
.
netwr
1
=
MathUtil
.
sub
(
item
.
kzwi11
,
item
.
kwetr1
);
return
item
.
netwr
=
MathUtil
.
sub
(
item
.
kzwi1
,
item
.
kwetr
);
}
}
},
},
{
{
display
:
"
税额"
,
name
:
"kwetr
"
,
width
:
120
,
minwidth
:
120
,
type
:
"money"
,
align
:
"left"
,
display
:
"
含税金额(本位币)"
,
name
:
"kzwi11
"
,
width
:
120
,
minwidth
:
120
,
type
:
"money"
,
align
:
"left"
,
editor
:
{
editor
:
{
mask
:
'nnnnnnnnn.nn'
,
mask
:
'nnnnnnnnn.nn'
,
type
:
'text'
type
:
'text'
},
},
//等于含税金额/(1+税码对应的税率)*税码对应税率,可手工修改
//"公司代码等于1000币别等于CNY时,默认等于含税金额;
render
:
function
(
item
){
// 公司代码等于1000币别不等于CNY时,等于含税金额*币别对应的汇率"
if
(
Public
.
isBlank
(
item
.
kwetr
)
||
MathUtil
.
compare
(
item
.
kwetr
,
0
)
===
0
){
// render:function(item){
var
value
=
MathUtil
.
div
(
item
.
kzwi1
,(
1
+
item
.
mwskz
)).
mul
(
item
.
mwskz
).
toFixed
(
2
)
// var money = 0;
return
item
.
kwetr
=
value
;
// if (item.waers === "CNY"){
}
else
{
// money=item.kzwi1;
return
item
.
kwetr
// }else {
}
// money = MathUtil.mul(item.kzwi1,item.kursf)
// }
}
// return item.kzwi11 = money;
// }
},
},
{
{
display
:
"不含税金额"
,
name
:
"netwr"
,
width
:
120
,
minwidth
:
120
,
type
:
"money"
,
align
:
"left"
,
display
:
"税额(本位币)"
,
name
:
"kwetr1"
,
width
:
120
,
minwidth
:
120
,
type
:
"money"
,
align
:
"left"
,
//等于含税金额减去税额
editor
:
{
mask
:
'nnnnnnnnn.nn'
,
type
:
'text'
},
//等于(含税金额-本位币)/(1+税码对应的税率)*税码对应税率,可手工修改
// render:function(item){
// if (Public.isBlank(item.kwetr1) || MathUtil.compare(item.kwetr1,0)===0){
// var value = MathUtil.div(item.kzwi11,MathUtil.add(1,item.mwskz)).mul(item.mwskz).toFixed(2)
// return item.kwetr1 = value;
// }else {
// return item.kwetr1
// }
// }
},
{
display
:
"不含税金额(本位币)"
,
name
:
"netwr1"
,
width
:
120
,
minwidth
:
120
,
type
:
"money"
,
align
:
"left"
,
//等于含税金额(本位币)减去税额(本位币)
render
:
function
(
item
){
render
:
function
(
item
){
return
item
.
netwr
=
MathUtil
.
sub
(
item
.
kzwi1
,
item
.
kwetr
);
return
item
.
netwr
1
=
MathUtil
.
sub
(
item
.
kzwi11
,
item
.
kwetr1
);
}
}
},
},
]
]
...
@@ -407,7 +407,7 @@ var tableArray = [
...
@@ -407,7 +407,7 @@ var tableArray = [
{
{
display
:
"不含税金额(审批-本位币)"
,
display
:
"不含税金额(审批-本位币)"
,
name
:
"zepPdamount"
,
name
:
"zepPdamount"
,
width
:
1
2
0
,
width
:
1
6
0
,
minwidth
:
120
,
minwidth
:
120
,
type
:
"money"
,
type
:
"money"
,
align
:
"left"
,
align
:
"left"
,
...
@@ -419,7 +419,7 @@ var tableArray = [
...
@@ -419,7 +419,7 @@ var tableArray = [
{
{
display
:
"税额(审批-本位币)"
,
display
:
"税额(审批-本位币)"
,
name
:
"zepPdtax"
,
name
:
"zepPdtax"
,
width
:
1
2
0
,
width
:
1
5
0
,
minwidth
:
120
,
minwidth
:
120
,
type
:
"money"
,
type
:
"money"
,
align
:
"left"
,
align
:
"left"
,
...
@@ -431,7 +431,7 @@ var tableArray = [
...
@@ -431,7 +431,7 @@ var tableArray = [
{
{
display
:
"含税金额(审批-本位币)"
,
display
:
"含税金额(审批-本位币)"
,
name
:
"zepPtdamount"
,
name
:
"zepPtdamount"
,
width
:
1
2
0
,
width
:
1
5
0
,
minwidth
:
120
,
minwidth
:
120
,
type
:
"money"
,
type
:
"money"
,
align
:
"left"
,
align
:
"left"
,
...
@@ -472,13 +472,19 @@ var tableArray = [
...
@@ -472,13 +472,19 @@ var tableArray = [
}
}
},
},
}*/
}*/
render
:
function
(
item
){
return
item
.
zlsch
=
"T"
}
},
},
{
{
display
:
"付款方式名称"
,
name
:
"zlschText1"
,
width
:
120
,
minwidth
:
120
,
type
:
"string"
,
align
:
"left"
,
display
:
"付款方式名称"
,
name
:
"zlschText1"
,
width
:
120
,
minwidth
:
120
,
type
:
"string"
,
align
:
"left"
,
render
:
function
(
item
){
return
item
.
zlschText1
=
"电汇"
}
},
},
{
{
display
:
"直联付款标识"
,
name
:
"zepBank"
,
width
:
120
,
minwidth
:
120
,
type
:
"string"
,
align
:
"left"
,
display
:
"直联付款标识"
,
name
:
"zepBank"
,
width
:
120
,
minwidth
:
120
,
type
:
"string"
,
align
:
"left"
,
/*
editor: {
editor
:
{
required
:
false
,
type
:
"select"
,
required
:
false
,
type
:
"select"
,
data
:
{
data
:
{
type
:
'system'
,
type
:
'system'
,
...
@@ -490,10 +496,10 @@ var tableArray = [
...
@@ -490,10 +496,10 @@ var tableArray = [
ZEP_BANK
:
"zepBank"
,
ZEP_BANK
:
"zepBank"
,
}
}
},
},
}*/
editor
:
{
type
:
'text'
}
}
// editor: {
// type: 'text'
// }
},
},
]
]
...
@@ -643,30 +649,33 @@ function loadGrid(obj) {
...
@@ -643,30 +649,33 @@ function loadGrid(obj) {
return
false
;
//阻止默认事件、防止某个表格的对应行被多次选中
return
false
;
//阻止默认事件、防止某个表格的对应行被多次选中
},
},
onBeforeCheckAllRow
:
function
(
a
,
b
)
{
onBeforeCheckAllRow
:
function
(
a
,
b
)
{
// console.log(b)
// $(b).addClass("l-checked")
// debugger
//同时全选、同时取消全选
// tableArray.forEach((item) => {
// let hrow=$(item.gridManager.element);//全选框
// console.log(hrow)
// console.log(item.gridManager.element)
//
// let checked= !hrow.hasClass("l-checked");
// $(hrow).toggleClass("l-checked",checked);
// let rows = item.gridManager.selected;
// rows.forEach((row) => {
// checked?item.gridManager.select(row):item.gridManager.unselect(row);
// })
// })
return
false
;
//阻止默认事件
return
false
;
//阻止默认事件
},
},
onAfterEdit
:
function
(
item
)
{
onAfterEdit
:
function
(
item
)
{
if
(
item
.
column
.
name
==
"waers"
if
(
item
.
column
.
name
==
"waers"
||
item
.
column
.
name
==
"kursf"
||
item
.
column
.
name
==
"kursf"
||
item
.
column
.
name
==
"kzwi1"
||
item
.
column
.
name
==
"kzwi1"
||
item
.
column
.
name
==
"mwskz"
){
||
item
.
column
.
name
==
"mwskz"
||
item
.
column
.
name
==
"kwetr"
){
//税额计算
//等于含税金额/(1+税码对应的税率)*税码对应税率,可手工修改
var
value
=
MathUtil
.
div
(
item
.
record
.
kzwi1
,
MathUtil
.
add
(
1
,
item
.
record
.
mwskz
));
var
kwetr
=
MathUtil
.
mul
(
value
,
item
.
record
.
mwskz
).
toFixed
(
2
);
//含税金额(本位币)计算
//"公司代码等于1000币别等于CNY时,默认等于含税金额;
// 公司代码等于1000币别不等于CNY时,等于含税金额*币别对应的汇率"
var
money
=
0
;
if
(
item
.
record
.
waers
===
"CNY"
){
money
=
item
.
record
.
kzwi1
;
}
else
{
money
=
MathUtil
.
mul
(
item
.
record
.
kzwi1
,
item
.
record
.
kursf
)
}
//税额(本位币)计算
//等于(含税金额-本位币)/(1+税码对应的税率)*税码对应税率,可手工修改
var
kwetr1
=
MathUtil
.
div
(
money
,
MathUtil
.
add
(
1
,
item
.
record
.
mwskz
)).
mul
(
item
.
record
.
mwskz
).
toFixed
(
2
)
obj
.
gridManager
.
updateRow
(
item
.
record
,
{
kwetr
:
kwetr
,
kzwi11
:
money
,
kwetr1
:
kwetr1
});
totalGrid
();
totalGrid
();
}
}
if
(
item
.
column
.
name
==
"zepPdamount1"
if
(
item
.
column
.
name
==
"zepPdamount1"
...
...
topsun-xt/src/main/webapp/biz/topsun/sap/purchase/sapPurchaseDetail.js
View file @
23c459d6
...
@@ -72,7 +72,7 @@ function getGridColumns() {
...
@@ -72,7 +72,7 @@ function getGridColumns() {
type
:
'system'
,
type
:
'system'
,
name
:
"knttp"
,
name
:
"knttp"
,
getParam
:
function
(
item
)
{
getParam
:
function
(
item
)
{
return
{
param
Value
:
$
(
"#bsart"
).
val
()}
return
{
filter
Value
:
$
(
"#bsart"
).
val
()}
},
},
back
:
{
back
:
{
knttp
:
"knttp"
knttp
:
"knttp"
...
...
topsun-xt/src/main/webapp/biz/topsun/sap/qualityInfoRecord/qualityInfoRecordDetail.js
View file @
23c459d6
...
@@ -44,14 +44,14 @@ function initItemGrid() {
...
@@ -44,14 +44,14 @@ function initItemGrid() {
//autoApplyNextEditor:false,
//autoApplyNextEditor:false,
toolbar
:
toolbarOptions
,
toolbar
:
toolbarOptions
,
onBeforeEdit
:
function
(
editParma
)
{
onBeforeEdit
:
function
(
editParma
)
{
// if (Public.isNotBlank(editParma.record.matnr) && editParma.column.name=='matklName'
){
if
(
Public
.
isBlank
(
editParma
.
record
.
grsrq
)
&&
(
editParma
.
column
.
name
==
'grscertnr'
||
editParma
.
column
.
name
==
'grscertdatai'
)
){
//
return false;
return
false
;
//
}
}
// if (Public.isNotBlank(editParma.record.matklName) && editParma.column.name=='matnr'
){
if
(
Public
.
isBlank
(
editParma
.
record
.
fscrq
)
&&
(
editParma
.
column
.
name
==
'fsccertnr'
||
editParma
.
column
.
name
==
'fsccertdatai'
)
){
//
return false;
return
false
;
//
}
}
//
//
return true;
return
true
;
},
},
}
}
...
@@ -142,34 +142,43 @@ function getGridColumns() {
...
@@ -142,34 +142,43 @@ function getGridColumns() {
},
},
{
display
:
"合格准入验证节点1"
,
name
:
"zqavfn1"
,
width
:
"200"
,
align
:
"left"
,
type
:
"string"
,
{
display
:
"合格准入验证节点1"
,
name
:
"zqavfn1"
,
width
:
"200"
,
align
:
"left"
,
type
:
"string"
,
editor
:
{
required
:
false
,
type
:
"text"
}
//
editor: {required: false, type: "text"}
},
},
{
display
:
"
zvfnc1
"
,
name
:
"zvfnc1"
,
width
:
"100"
,
align
:
"left"
,
type
:
"string"
,
{
display
:
"
节点1结论
"
,
name
:
"zvfnc1"
,
width
:
"100"
,
align
:
"left"
,
type
:
"string"
,
editor
:
{
type
:
'text'
,
}
//
editor: {type: 'text', }
},
},
{
display
:
"合格准入验证节点2"
,
name
:
"zqavfn2"
,
width
:
"200"
,
align
:
"left"
,
type
:
"string"
,
{
display
:
"合格准入验证节点2"
,
name
:
"zqavfn2"
,
width
:
"200"
,
align
:
"left"
,
type
:
"string"
,
editor
:
{
required
:
false
,
type
:
"text"
}
//
editor: {required: false, type: "text"}
},
},
{
display
:
"节点2结论"
,
name
:
"zvfnc2"
,
width
:
"100"
,
align
:
"left"
,
type
:
"string"
,
{
display
:
"节点2结论"
,
name
:
"zvfnc2"
,
width
:
"100"
,
align
:
"left"
,
type
:
"string"
,
editor
:
{
required
:
false
,
type
:
"text"
}
//
editor: {required: false, type: "text"}
},
},
{
display
:
"合格准入验证节点3"
,
name
:
"zqavfn3"
,
width
:
"200"
,
align
:
"left"
,
type
:
"string"
,
{
display
:
"合格准入验证节点3"
,
name
:
"zqavfn3"
,
width
:
"200"
,
align
:
"left"
,
type
:
"string"
,
editor
:
{
required
:
false
,
type
:
"text"
}
//
editor: {required: false, type: "text"}
},
},
{
display
:
"节点3结论"
,
name
:
"zvfnc3"
,
width
:
"100"
,
align
:
"left"
,
type
:
"string"
,
{
display
:
"节点3结论"
,
name
:
"zvfnc3"
,
width
:
"100"
,
align
:
"left"
,
type
:
"string"
,
editor
:
{
required
:
false
,
type
:
"text"
}
//editor: {required: false, type: "text"}
},
{
display
:
"合格准入验证节点4"
,
name
:
"zqavfn4"
,
width
:
"200"
,
align
:
"left"
,
type
:
"string"
,
editor
:
{
type
:
'text'
}
},
{
display
:
"节点4结论"
,
name
:
"zvfnc4"
,
width
:
"100"
,
align
:
"left"
,
type
:
"string"
,
editor
:
{
type
:
'text'
}
},
},
// {display: "合格准入验证节点4", name: "zqavfn4", width: "200", align: "left", type: "string",
// editor: {type: 'text' }
// },
// {display: "节点4结论", name: "zvfnc4", width: "100", align: "left", type: "string",
// editor: {type: 'text'}
// },
{
display
:
"打样单号码"
,
name
:
"zspaufnr"
,
width
:
"200"
,
align
:
"left"
,
type
:
"string"
,
{
display
:
"打样单号码"
,
name
:
"zspaufnr"
,
width
:
"200"
,
align
:
"left"
,
type
:
"string"
,
editor
:
{
type
:
"text"
,
required
:
false
,}
editor
:
{
type
:
"text"
,
required
:
false
,}
},
},
{
display
:
"GRSRQ"
,
name
:
"grsrq"
,
width
:
"100"
,
align
:
"left"
,
type
:
"string"
,
{
display
:
"GRSRQ"
,
name
:
"grsrq"
,
width
:
"100"
,
align
:
"left"
,
type
:
"string"
,
editor
:
{
type
:
'text'
},
editor
:
{
type
:
'dictionary'
,
data
:
{
name
:
'grsrq'
},
textField
:
'grsrqTextView'
,
valueField
:
'grsrq'
,
required
:
true
,
render
:
function
(
item
)
{
return
item
.
grsrqTextView
;
}
},
},
},
{
display
:
"GRS证书号"
,
name
:
"grscertnr"
,
width
:
"200"
,
align
:
"left"
,
type
:
"string"
,
{
display
:
"GRS证书号"
,
name
:
"grscertnr"
,
width
:
"200"
,
align
:
"left"
,
type
:
"string"
,
editor
:
{
type
:
'text'
},
editor
:
{
type
:
'text'
},
...
@@ -178,7 +187,16 @@ function getGridColumns() {
...
@@ -178,7 +187,16 @@ function getGridColumns() {
editor
:
{
type
:
'date'
}
editor
:
{
type
:
'date'
}
},
},
{
display
:
"FSC认证要求"
,
name
:
"fscrq"
,
width
:
"200"
,
align
:
"left"
,
type
:
"string"
,
{
display
:
"FSC认证要求"
,
name
:
"fscrq"
,
width
:
"200"
,
align
:
"left"
,
type
:
"string"
,
editor
:
{
required
:
false
,
type
:
"text"
}
editor
:
{
type
:
'dictionary'
,
data
:
{
name
:
'grsrq'
},
textField
:
'fscrqTextView'
,
valueField
:
'fscrq'
,
required
:
true
,
render
:
function
(
item
)
{
return
item
.
fscrqTextView
;
}
},
},
},
{
display
:
"FSC证书号"
,
name
:
"fsccertnr"
,
width
:
"200"
,
align
:
"left"
,
type
:
"string"
,
{
display
:
"FSC证书号"
,
name
:
"fsccertnr"
,
width
:
"200"
,
align
:
"left"
,
type
:
"string"
,
editor
:
{
type
:
"text"
}
editor
:
{
type
:
"text"
}
...
@@ -228,6 +246,26 @@ function getExtendedData(processAction) {
...
@@ -228,6 +246,26 @@ function getExtendedData(processAction) {
data
.
zqinfno
=
""
data
.
zqinfno
=
""
data
.
type
=
""
data
.
type
=
""
data
.
message
=
""
data
.
message
=
""
if
(
Public
.
isNotBlank
(
data
.
grsrq
)){
if
(
Public
.
isBlank
(
data
.
grscertnr
)){
Public
.
tip
(
"GRS证书号不能为空"
)
return
false
}
if
(
Public
.
isBlank
(
data
.
grscertdatai
)){
Public
.
tip
(
"GRS证书到期日不能为空"
)
return
false
}
}
if
(
Public
.
isNotBlank
(
data
.
fscrq
)){
if
(
Public
.
isBlank
(
data
.
fsccertnr
)){
Public
.
tip
(
"FSC证书号不能为空"
)
return
false
}
if
(
Public
.
isBlank
(
data
.
fsccertdatai
)){
Public
.
tip
(
"FSC证书到期日不能为空"
)
return
false
}
}
})
})
}
}
extendedData
.
items
=
Public
.
encodeJSONURI
(
datas
);
extendedData
.
items
=
Public
.
encodeJSONURI
(
datas
);
...
...
topsun/src/main/java/com/huigou/topsun/controller/ResourceSearchController.java
View file @
23c459d6
...
@@ -19,6 +19,7 @@ import com.huigou.util.StringUtil;
...
@@ -19,6 +19,7 @@ import com.huigou.util.StringUtil;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.util.CollectionUtils
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -51,18 +52,18 @@ public class ResourceSearchController {
...
@@ -51,18 +52,18 @@ public class ResourceSearchController {
easySearchParse
.
setFields
(
fields
);
easySearchParse
.
setFields
(
fields
);
easySearchParse
.
setWidth
(
450L
);
easySearchParse
.
setWidth
(
450L
);
List
<
Map
<
String
,
Object
>>
mapList
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
mapList
=
new
ArrayList
<>();
String
paramValue
=
sdo
.
getString
(
"param
Value"
);
String
filterValue
=
sdo
.
getString
(
"filter
Value"
);
Map
<
String
,
String
>
knttp
=
DictUtil
.
getDictionary
(
"knttp"
);
Map
<
String
,
String
>
knttp
=
DictUtil
.
getDictionary
(
"knttp"
);
knttp
.
forEach
((
key
,
value
)
->
{
knttp
.
forEach
((
key
,
value
)
->
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"knttp"
,
value
);
map
.
put
(
"knttp"
,
value
);
if
(
"ZFW"
.
equals
(
param
Value
))
{
if
(
"ZFW"
.
equals
(
filter
Value
))
{
mapList
.
add
(
map
);
mapList
.
add
(
map
);
}
else
if
(
"ZNE1"
.
equals
(
param
Value
))
{
}
else
if
(
"ZNE1"
.
equals
(
filter
Value
))
{
if
(
"A"
.
equals
(
key
))
{
if
(
"A"
.
equals
(
key
))
{
mapList
.
add
(
map
);
mapList
.
add
(
map
);
}
}
}
else
if
(
"ZNE2"
.
equals
(
param
Value
))
{
}
else
if
(
"ZNE2"
.
equals
(
filter
Value
))
{
if
(
"F"
.
equals
(
key
)
||
"K"
.
equals
(
key
))
{
if
(
"F"
.
equals
(
key
)
||
"K"
.
equals
(
key
))
{
mapList
.
add
(
map
);
mapList
.
add
(
map
);
}
}
...
@@ -100,15 +101,23 @@ public class ResourceSearchController {
...
@@ -100,15 +101,23 @@ public class ResourceSearchController {
String
filterValue
=
sdo
.
getString
(
"filterValue"
);
String
filterValue
=
sdo
.
getString
(
"filterValue"
);
SapDialogQuery
queryRequest
=
sdo
.
toObject
(
SapDialogQuery
.
class
);
SapDialogQuery
queryRequest
=
sdo
.
toObject
(
SapDialogQuery
.
class
);
queryRequest
.
setWerks
(
filterValue
);
queryRequest
.
setWerks
(
filterValue
);
List
<
Map
<
String
,
Object
>>
mapList
=
sapMaterialApplication
.
getSapMaterial
(
queryRequest
);
List
<
Map
<
String
,
String
>>
mapList
=
sapMaterialApplication
.
getSapMaterial
(
queryRequest
);
/*
if (CollectionUtil.isNotEmpty(mapList)){
if
(
CollectionUtil
.
isNotEmpty
(
mapList
)){
if
(
StringUtil
.
isNotBlank
(
filterValue
)){
//固定条件过滤,比如选了工厂后,只能读取改工厂下的物料组
if
(
StringUtil
.
isNotBlank
(
filterValue
)){
//固定条件过滤,比如选了工厂后,只能读取改工厂下的物料组
mapList
=
mapList
mapList
=
mapList
.
stream
()
.
stream
()
.
filter
(
map
->
map
.
containsValue
(
filterValue
))
.
filter
(
map
->
map
.
containsValue
(
filterValue
))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
}
}
}*/
}
if
(
CollectionUtil
.
isNotEmpty
(
mapList
)){
if
(
StringUtil
.
isNotBlank
(
param
)){
//模糊条件过滤
mapList
=
mapList
.
stream
()
.
filter
(
map
->
map
.
values
().
stream
().
anyMatch
(
value
->
value
.
contains
(
param
)))
.
collect
(
Collectors
.
toList
());
}
}
Integer
intPage
=
sdo
.
getInteger
(
"intPage"
,
1
);
Integer
intPage
=
sdo
.
getInteger
(
"intPage"
,
1
);
Integer
pageSize
=
sdo
.
getInteger
(
"pageSize"
,
10
);
Integer
pageSize
=
sdo
.
getInteger
(
"pageSize"
,
10
);
PageRequest
pageRequest
=
new
PageRequest
(
intPage
-
1
,
pageSize
);
PageRequest
pageRequest
=
new
PageRequest
(
intPage
-
1
,
pageSize
);
...
@@ -131,7 +140,7 @@ public class ResourceSearchController {
...
@@ -131,7 +140,7 @@ public class ResourceSearchController {
);
);
easySearchParse
.
setFields
(
fields
);
easySearchParse
.
setFields
(
fields
);
easySearchParse
.
setWidth
(
450L
);
easySearchParse
.
setWidth
(
450L
);
MemEasySearcher
<
Map
<
String
,
Object
>>
memEasySearcher
=
new
MemEasySearcherImpl
<>();
MemEasySearcher
<
Map
<
String
,
String
>>
memEasySearcher
=
new
MemEasySearcherImpl
<>();
Map
<
String
,
Object
>
model
=
memEasySearcher
.
search
(
mapList
,
easySearchParse
,
pageRequest
,
null
);
Map
<
String
,
Object
>
model
=
memEasySearcher
.
search
(
mapList
,
easySearchParse
,
pageRequest
,
null
);
return
model
;
return
model
;
}
}
...
@@ -141,7 +150,7 @@ public class ResourceSearchController {
...
@@ -141,7 +150,7 @@ public class ResourceSearchController {
String
param
=
sdo
.
getString
(
"paramValue"
);
String
param
=
sdo
.
getString
(
"paramValue"
);
String
fieldName
=
sdo
.
getString
(
"fieldName"
);
String
fieldName
=
sdo
.
getString
(
"fieldName"
);
String
filterValue
=
sdo
.
getString
(
"filterValue"
);
String
filterValue
=
sdo
.
getString
(
"filterValue"
);
List
<
Map
<
String
,
Object
>>
mapList
=
new
ArrayList
<>();
List
<
Map
<
String
,
String
>>
mapList
=
new
ArrayList
<>();
mapList
=
sapDictionaryApplication
.
getSapDictionary
(
fieldName
);
mapList
=
sapDictionaryApplication
.
getSapDictionary
(
fieldName
);
List
<
QuerySchemeField
>
fields
=
new
ArrayList
<>();
List
<
QuerySchemeField
>
fields
=
new
ArrayList
<>();
if
(
CollectionUtil
.
isNotEmpty
(
mapList
)){
if
(
CollectionUtil
.
isNotEmpty
(
mapList
)){
...
@@ -154,14 +163,16 @@ public class ResourceSearchController {
...
@@ -154,14 +163,16 @@ public class ResourceSearchController {
if
(
StringUtil
.
isNotBlank
(
param
)){
//输入查询条件过滤
if
(
StringUtil
.
isNotBlank
(
param
)){
//输入查询条件过滤
mapList
=
mapList
mapList
=
mapList
.
stream
()
.
stream
()
.
filter
(
map
->
map
.
containsValue
(
param
))
.
filter
(
map
->
map
.
values
().
stream
().
anyMatch
(
value
->
value
.
contains
(
param
)
))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
}
}
Map
<
String
,
Object
>
map
=
mapList
.
get
(
0
);
if
(!
CollectionUtils
.
isEmpty
(
mapList
)){
map
.
keySet
().
forEach
(
key
->{
Map
<
String
,
String
>
map
=
mapList
.
get
(
0
);
QuerySchemeField
querySchemeField
=
new
QuerySchemeField
(
key
,
key
,
"string"
,
200L
);
map
.
keySet
().
forEach
(
key
->{
fields
.
add
(
querySchemeField
);
QuerySchemeField
querySchemeField
=
new
QuerySchemeField
(
key
,
key
,
"string"
,
200L
);
});
fields
.
add
(
querySchemeField
);
});
}
}
}
Integer
intPage
=
sdo
.
getInteger
(
"intPage"
,
1
);
Integer
intPage
=
sdo
.
getInteger
(
"intPage"
,
1
);
Integer
pageSize
=
sdo
.
getInteger
(
"pageSize"
,
10
);
Integer
pageSize
=
sdo
.
getInteger
(
"pageSize"
,
10
);
...
@@ -169,7 +180,7 @@ public class ResourceSearchController {
...
@@ -169,7 +180,7 @@ public class ResourceSearchController {
EasySearchParse
easySearchParse
=
new
EasySearchParse
();
EasySearchParse
easySearchParse
=
new
EasySearchParse
();
easySearchParse
.
setFields
(
fields
);
easySearchParse
.
setFields
(
fields
);
easySearchParse
.
setWidth
(
450L
);
easySearchParse
.
setWidth
(
450L
);
MemEasySearcher
<
Map
<
String
,
Object
>>
memEasySearcher
=
new
MemEasySearcherImpl
<>();
MemEasySearcher
<
Map
<
String
,
String
>>
memEasySearcher
=
new
MemEasySearcherImpl
<>();
Map
<
String
,
Object
>
model
=
memEasySearcher
.
search
(
mapList
,
easySearchParse
,
pageRequest
,
null
);
Map
<
String
,
Object
>
model
=
memEasySearcher
.
search
(
mapList
,
easySearchParse
,
pageRequest
,
null
);
return
model
;
return
model
;
}
}
...
@@ -244,11 +255,13 @@ public class ResourceSearchController {
...
@@ -244,11 +255,13 @@ public class ResourceSearchController {
.
filter
(
map
->
map
.
containsValue
(
param
))
.
filter
(
map
->
map
.
containsValue
(
param
))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
}
}
Map
<
String
,
Object
>
map
=
mapList
.
get
(
0
);
if
(!
CollectionUtils
.
isEmpty
(
mapList
)){
map
.
keySet
().
forEach
(
key
->{
Map
<
String
,
Object
>
map
=
mapList
.
get
(
0
);
QuerySchemeField
querySchemeField
=
new
QuerySchemeField
(
key
,
key
,
"string"
,
200L
);
map
.
keySet
().
forEach
(
key
->{
fields
.
add
(
querySchemeField
);
QuerySchemeField
querySchemeField
=
new
QuerySchemeField
(
key
,
key
,
"string"
,
200L
);
});
fields
.
add
(
querySchemeField
);
});
}
}
}
Integer
intPage
=
sdo
.
getInteger
(
"intPage"
,
1
);
Integer
intPage
=
sdo
.
getInteger
(
"intPage"
,
1
);
Integer
pageSize
=
sdo
.
getInteger
(
"pageSize"
,
10
);
Integer
pageSize
=
sdo
.
getInteger
(
"pageSize"
,
10
);
...
...
topsun/src/main/java/com/huigou/topsun/sap/qualityInfoRecord/application/impl/SapQualityInfoRecordApplicationImpl.java
View file @
23c459d6
package
com
.
huigou
.
topsun
.
sap
.
qualityInfoRecord
.
application
.
impl
;
package
com
.
huigou
.
topsun
.
sap
.
qualityInfoRecord
.
application
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.lang.Assert
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.huigou.cache.SystemCache
;
import
com.huigou.cache.SystemCache
;
import
com.huigou.data.query.model.QueryDescriptor
;
import
com.huigou.data.query.model.QueryDescriptor
;
...
@@ -14,8 +15,11 @@ import com.huigou.topsun.sap.qualityInfoRecord.domain.SapQualityInfoRecordItem;
...
@@ -14,8 +15,11 @@ import com.huigou.topsun.sap.qualityInfoRecord.domain.SapQualityInfoRecordItem;
import
com.huigou.topsun.sap.qualityInfoRecord.domain.query.SapQualityInfoRecordQueryRequest
;
import
com.huigou.topsun.sap.qualityInfoRecord.domain.query.SapQualityInfoRecordQueryRequest
;
import
com.huigou.topsun.sap.qualityInfoRecord.domain.vo.SapQualityInfoRecordItemVo
;
import
com.huigou.topsun.sap.qualityInfoRecord.domain.vo.SapQualityInfoRecordItemVo
;
import
com.huigou.topsun.sap.qualityInfoRecord.repository.SapQualityInfoRecordRepository
;
import
com.huigou.topsun.sap.qualityInfoRecord.repository.SapQualityInfoRecordRepository
;
import
com.huigou.topsun.sap.suppliers.domain.SuppliersInfo
;
import
com.huigou.uasp.bmp.common.BizBillStatus
;
import
com.huigou.uasp.bmp.common.BizBillStatus
;
import
com.huigou.uasp.bpm.FlowBroker
;
import
com.huigou.uasp.bpm.FlowBroker
;
import
com.huigou.uasp.bpm.engine.domain.model.ProcUnitHandler
;
import
com.huigou.uasp.bpm.engine.domain.model.TaskExtension
;
import
com.huigou.util.ClassHelper
;
import
com.huigou.util.ClassHelper
;
import
org.activiti.engine.delegate.DelegateExecution
;
import
org.activiti.engine.delegate.DelegateExecution
;
import
org.activiti.engine.delegate.DelegateTask
;
import
org.activiti.engine.delegate.DelegateTask
;
...
@@ -59,6 +63,40 @@ public class SapQualityInfoRecordApplicationImpl extends FlowBroker implements S
...
@@ -59,6 +63,40 @@ public class SapQualityInfoRecordApplicationImpl extends FlowBroker implements S
return
sapQualityInfoRecord
.
getId
();
return
sapQualityInfoRecord
.
getId
();
}
}
@Override
protected
void
onBeforeComplete
(
DelegateTask
delegateTask
)
{
super
.
onBeforeComplete
(
delegateTask
);
String
bizId
=
delegateTask
.
getExecution
().
getProcessBusinessKey
();
if
(
this
.
isApplyProcUnit
(
delegateTask
)
&&
this
.
getApprovalParameter
().
isAdvanceProcessAction
())
{
SapQualityInfoRecord
sapQualityInfoRecord
=
sapQualityInfoRecordRepository
.
findOne
(
bizId
);
sapQualityInfoRecord
.
setStatusId
(
BizBillStatus
.
APPROVING
.
getId
());
sapQualityInfoRecordRepository
.
save
(
sapQualityInfoRecord
);
}
if
(!
isApplyProcUnit
(
delegateTask
))
{
List
<
SapQualityInfoRecordItem
>
purchaseInfoRecordItemList
=
sapQualityInfoRecordItemApplication
.
findBySapQualityInfoRecordId
(
bizId
);
TaskExtension
te
=
actApplication
.
loadRuntimeTaskExtension
(
delegateTask
.
getId
());
Assert
.
notNull
(
te
,
String
.
format
(
"未查询到流程任务【%s】的扩展信息"
,
delegateTask
.
getId
()));
// 获取流程任务对应的审批环节信息
ProcUnitHandler
procUnitHandler
=
procUnitHandlerApplication
.
loadProcUnitHandler
(
te
.
getProcUnitHandlerId
());
String
subProcUnitId
=
procUnitHandler
.
getSubProcUnitId
();
if
(
"stage1"
.
equals
(
subProcUnitId
)){
for
(
SapQualityInfoRecordItem
item
:
purchaseInfoRecordItemList
)
{
item
.
setZqavfn1
(
"S1"
);
item
.
setZvfnc1
(
"A"
);
item
.
setZqafst
(
"02"
);
sapQualityInfoRecordItemApplication
.
save
(
item
);
}
}
if
(
"stage2"
.
equals
(
subProcUnitId
)){
for
(
SapQualityInfoRecordItem
item
:
purchaseInfoRecordItemList
)
{
item
.
setZqavfn2
(
"Q1"
);
item
.
setZvfnc2
(
"A"
);
item
.
setZqafst
(
"04"
);
sapQualityInfoRecordItemApplication
.
save
(
item
);
}
}
}
}
@Override
@Override
...
@@ -85,7 +123,9 @@ public class SapQualityInfoRecordApplicationImpl extends FlowBroker implements S
...
@@ -85,7 +123,9 @@ public class SapQualityInfoRecordApplicationImpl extends FlowBroker implements S
purchaseInfoRecordItemList
.
forEach
(
sapQualityInfoRecordItem
->
{
purchaseInfoRecordItemList
.
forEach
(
sapQualityInfoRecordItem
->
{
SapQualityInfoRecordItemVo
sapQualityInfoRecordItemVo
=
new
SapQualityInfoRecordItemVo
();
SapQualityInfoRecordItemVo
sapQualityInfoRecordItemVo
=
new
SapQualityInfoRecordItemVo
();
BeanUtil
.
copyProperties
(
sapQualityInfoRecordItem
,
sapQualityInfoRecordItemVo
);
BeanUtil
.
copyProperties
(
sapQualityInfoRecordItem
,
sapQualityInfoRecordItemVo
);
sapQualityInfoRecordItem
.
setZqavfn3
(
"M1"
);
sapQualityInfoRecordItem
.
setZvfnc3
(
"A"
);
sapQualityInfoRecordItem
.
setZqafst
(
"11"
);
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
if
(
sapQualityInfoRecordItem
.
getGrscertdatai
()
!=
null
){
if
(
sapQualityInfoRecordItem
.
getGrscertdatai
()
!=
null
){
String
datab
=
dateFormat
.
format
(
sapQualityInfoRecordItem
.
getGrscertdatai
());
String
datab
=
dateFormat
.
format
(
sapQualityInfoRecordItem
.
getGrscertdatai
());
...
...
topsun/src/main/java/com/huigou/topsun/sap/sapApplication/application/SapDictionaryApplication.java
View file @
23c459d6
...
@@ -10,5 +10,5 @@ import java.util.Map;
...
@@ -10,5 +10,5 @@ import java.util.Map;
* @Description:
* @Description:
*/
*/
public
interface
SapDictionaryApplication
{
public
interface
SapDictionaryApplication
{
List
<
Map
<
String
,
Object
>>
getSapDictionary
(
String
fieldName
)
throws
IOException
;
List
<
Map
<
String
,
String
>>
getSapDictionary
(
String
fieldName
)
throws
IOException
;
}
}
topsun/src/main/java/com/huigou/topsun/sap/sapApplication/application/SapMaterialApplication.java
View file @
23c459d6
...
@@ -13,5 +13,5 @@ import java.util.Map;
...
@@ -13,5 +13,5 @@ import java.util.Map;
* @Description:
* @Description:
*/
*/
public
interface
SapMaterialApplication
{
public
interface
SapMaterialApplication
{
List
<
Map
<
String
,
Object
>>
getSapMaterial
(
SapDialogQuery
queryRequest
)
throws
IOException
;
List
<
Map
<
String
,
String
>>
getSapMaterial
(
SapDialogQuery
queryRequest
)
throws
IOException
;
}
}
topsun/src/main/java/com/huigou/topsun/sap/sapApplication/application/impl/SapDictionaryApplicationImpl.java
View file @
23c459d6
package
com
.
huigou
.
topsun
.
sap
.
sapApplication
.
application
.
impl
;
package
com
.
huigou
.
topsun
.
sap
.
sapApplication
.
application
.
impl
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
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.application.SapDictionaryApplication
;
import
com.huigou.topsun.sap.sapApplication.application.SapDictionaryApplication
;
import
com.huigou.topsun.util.SAPUtils
;
import
com.huigou.util.JSONUtil
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -23,7 +28,7 @@ public class SapDictionaryApplicationImpl implements SapDictionaryApplication {
...
@@ -23,7 +28,7 @@ public class SapDictionaryApplicationImpl implements SapDictionaryApplication {
private
HttpClient
httpClient
;
private
HttpClient
httpClient
;
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
getSapDictionary
(
String
fieldName
)
{
public
List
<
Map
<
String
,
String
>>
getSapDictionary
(
String
fieldName
)
throws
JsonProcessingException
{
String
url
=
SystemCache
.
getParameter
(
"sap.service.dictionary.url"
,
String
.
class
);
String
url
=
SystemCache
.
getParameter
(
"sap.service.dictionary.url"
,
String
.
class
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"FIELDNAME"
,
fieldName
);
map
.
put
(
"FIELDNAME"
,
fieldName
);
...
@@ -33,7 +38,8 @@ public class SapDictionaryApplicationImpl implements SapDictionaryApplication {
...
@@ -33,7 +38,8 @@ public class SapDictionaryApplicationImpl implements SapDictionaryApplication {
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
String
.
format
(
"查询“%s“数据字典出错”。"
,
fieldName
));
throw
new
RuntimeException
(
String
.
format
(
"查询“%s“数据字典出错”。"
,
fieldName
));
}
}
List
<
Map
<
String
,
Object
>>
mapList
=
(
List
<
Map
<
String
,
Object
>>)
JSONArray
.
parse
(
execute
);
ObjectMapper
objectMapper
=
SAPUtils
.
objectMapper
();
List
<
Map
<
String
,
String
>>
mapList
=
objectMapper
.
readValue
(
execute
,
new
TypeReference
<
List
<
Map
<
String
,
String
>>>()
{});
return
mapList
;
return
mapList
;
}
}
}
}
topsun/src/main/java/com/huigou/topsun/sap/sapApplication/application/impl/SapMaterialApplicationImpl.java
View file @
23c459d6
...
@@ -2,12 +2,14 @@ package com.huigou.topsun.sap.sapApplication.application.impl;
...
@@ -2,12 +2,14 @@ package com.huigou.topsun.sap.sapApplication.application.impl;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
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.common.domain.SapResult
;
import
com.huigou.topsun.sap.common.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.application.SapMaterialApplication
;
import
com.huigou.topsun.sap.sapApplication.application.SapMaterialApplication
;
import
com.huigou.topsun.sap.sapApplication.domain.vo.SapMaterialVo
;
import
com.huigou.topsun.sap.sapApplication.domain.vo.SapMaterialVo
;
import
com.huigou.topsun.util.SAPUtils
;
import
com.huigou.util.JSONUtil
;
import
com.huigou.util.JSONUtil
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -27,8 +29,8 @@ public class SapMaterialApplicationImpl implements SapMaterialApplication {
...
@@ -27,8 +29,8 @@ public class SapMaterialApplicationImpl implements SapMaterialApplication {
@Resource
@Resource
private
HttpClient
httpClient
;
private
HttpClient
httpClient
;
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
getSapMaterial
(
SapDialogQuery
queryRequest
)
throws
IOException
{
public
List
<
Map
<
String
,
String
>>
getSapMaterial
(
SapDialogQuery
queryRequest
)
throws
IOException
{
List
<
Map
<
String
,
Object
>>
sapMaterialVoList
=
new
ArrayList
<>();
List
<
Map
<
String
,
String
>>
sapMaterialVoList
=
new
ArrayList
<>();
/*if (StringUtil.isBlank(queryRequest.getWerks()) || StringUtil.isBlank(queryRequest.getMatkl())){
/*if (StringUtil.isBlank(queryRequest.getWerks()) || StringUtil.isBlank(queryRequest.getMatkl())){
return sapMaterialVoList;
return sapMaterialVoList;
}*/
}*/
...
@@ -37,8 +39,9 @@ public class SapMaterialApplicationImpl implements SapMaterialApplication {
...
@@ -37,8 +39,9 @@ public class SapMaterialApplicationImpl implements SapMaterialApplication {
Map
<
String
,
Object
>
map
=
JSONUtil
.
toMap
(
json
);
Map
<
String
,
Object
>
map
=
JSONUtil
.
toMap
(
json
);
SapResult
sapResult
=
JSONObject
.
parseObject
(
JSONUtil
.
toString
(
map
.
get
(
"MSG"
)),
SapResult
.
class
);
SapResult
sapResult
=
JSONObject
.
parseObject
(
JSONUtil
.
toString
(
map
.
get
(
"MSG"
)),
SapResult
.
class
);
if
(
"S"
.
equals
(
sapResult
.
getTYPE
())){
if
(
"S"
.
equals
(
sapResult
.
getTYPE
())){
sapMaterialVoList
=
(
List
<
Map
<
String
,
Object
>>)
JSONArray
.
parse
(
JSONUtil
.
toString
(
map
.
get
(
"RDATA"
)));
ObjectMapper
objectMapper
=
SAPUtils
.
objectMapper
();
//sapMaterialVoList = JSONObject.parseArray(JSONUtil.toString(map.get("RDATA")), SapMaterialVo.class);
sapMaterialVoList
=
objectMapper
.
readValue
(
JSONUtil
.
toString
(
map
.
get
(
"RDATA"
)),
new
TypeReference
<
List
<
Map
<
String
,
String
>>>()
{});
//sapMaterialVoList = (List<Map<String,String>>) JSONArray.parse(JSONUtil.toString(map.get("RDATA")));
}
else
{
}
else
{
throw
new
RuntimeException
(
"查询物料失败:"
+
sapResult
.
getMESSAGE
());
throw
new
RuntimeException
(
"查询物料失败:"
+
sapResult
.
getMESSAGE
());
}
}
...
...
topsun/src/main/java/com/huigou/topsun/sap/sapApplication/controller/SapDialogSelectController.java
View file @
23c459d6
...
@@ -35,7 +35,7 @@ public class SapDialogSelectController extends CommonController {
...
@@ -35,7 +35,7 @@ public class SapDialogSelectController extends CommonController {
public
String
sapMaterialSelect
()
throws
IOException
{
public
String
sapMaterialSelect
()
throws
IOException
{
SDO
sdo
=
this
.
getSDO
();
SDO
sdo
=
this
.
getSDO
();
SapDialogQuery
queryRequest
=
sdo
.
toObject
(
SapDialogQuery
.
class
);
SapDialogQuery
queryRequest
=
sdo
.
toObject
(
SapDialogQuery
.
class
);
List
<
Map
<
String
,
Object
>>
sapMaterial
=
sapMaterialApplication
.
getSapMaterial
(
queryRequest
);
List
<
Map
<
String
,
String
>>
sapMaterial
=
sapMaterialApplication
.
getSapMaterial
(
queryRequest
);
return
packGridDataAndResult
(
sapMaterial
);
return
packGridDataAndResult
(
sapMaterial
);
}
}
}
}
topsun/src/main/java/com/huigou/topsun/util/SAPUtils.java
0 → 100644
View file @
23c459d6
package
com
.
huigou
.
topsun
.
util
;
import
com.fasterxml.jackson.core.JsonGenerator
;
import
com.fasterxml.jackson.databind.DeserializationFeature
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.SerializationFeature
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
//import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
//import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
//import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
//import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer;
//import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
//import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
//import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.LocalTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.TimeZone
;
public
class
SAPUtils
{
public
static
ObjectMapper
objectMapper
()
{
ObjectMapper
objectMapper
=
new
ObjectMapper
();
//不显示为null的字段
//objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
//处理bigDecimal
objectMapper
.
enable
(
JsonGenerator
.
Feature
.
WRITE_BIGDECIMAL_AS_PLAIN
);
objectMapper
.
enable
(
DeserializationFeature
.
USE_BIG_DECIMAL_FOR_FLOATS
);
//处理失败
objectMapper
.
configure
(
DeserializationFeature
.
FAIL_ON_IGNORED_PROPERTIES
,
false
);
objectMapper
.
configure
(
DeserializationFeature
.
FAIL_ON_UNKNOWN_PROPERTIES
,
false
);
objectMapper
.
configure
(
DeserializationFeature
.
FAIL_ON_NULL_FOR_PRIMITIVES
,
false
);
objectMapper
.
configure
(
DeserializationFeature
.
FAIL_ON_NULL_CREATOR_PROPERTIES
,
false
);
// 枚举类处理
objectMapper
.
configure
(
SerializationFeature
.
WRITE_ENUMS_USING_TO_STRING
,
true
);
//默认的处理日期时间格式
// objectMapper.setDateFormat(new SimpleDateFormat("yyyyMMdd"));
// objectMapper.setTimeZone(TimeZone.getTimeZone("GMT+8"));
// JavaTimeModule javaTimeModule = new JavaTimeModule();
// javaTimeModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyyMMdd")));
// javaTimeModule.addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern("yyyyMMdd")));
// javaTimeModule.addSerializer(LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ofPattern("HHmmss")));
// javaTimeModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyyMMdd")));
// javaTimeModule.addDeserializer(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ofPattern("yyyyMMdd")));
// javaTimeModule.addDeserializer(LocalTime.class, new LocalTimeDeserializer(DateTimeFormatter.ofPattern("HHmmss")));
// // LONG转字符串
// javaTimeModule.addSerializer(Long.class, ToStringSerializer.instance);
// javaTimeModule.addSerializer(Long.TYPE, ToStringSerializer.instance);
//objectMapper.registerModule(javaTimeModule);
return
objectMapper
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment