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
38f5ed4f
Commit
38f5ed4f
authored
Oct 22, 2024
by
刘学辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
品质异常单根据异常类型获取不同接口数据
parent
c6015faa
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
313 additions
and
85 deletions
+313
-85
exceptionReportDetail.js
...p/biz/topsun/sap/exceptionReport/exceptionReportDetail.js
+197
-62
exceptionReportDetail.jsp
.../biz/topsun/sap/exceptionReport/exceptionReportDetail.jsp
+7
-2
ResourceSearchController.java
...om/huigou/topsun/controller/ResourceSearchController.java
+19
-6
SapMaterialApplicationImpl.java
...lication/application/impl/SapMaterialApplicationImpl.java
+80
-14
SapPaymentApplicationImpl.java
...plication/application/impl/SapPaymentApplicationImpl.java
+1
-1
SapDialogOrderQuery.java
.../sap/sapApplication/domain/query/SapDialogOrderQuery.java
+2
-0
OrderQueryVo.java
...gou/topsun/sap/sapApplication/domain/vo/OrderQueryVo.java
+7
-0
No files found.
topsun-xt/src/main/webapp/biz/topsun/sap/exceptionReport/exceptionReportDetail.js
View file @
38f5ed4f
This diff is collapsed.
Click to expand it.
topsun-xt/src/main/webapp/biz/topsun/sap/exceptionReport/exceptionReportDetail.jsp
View file @
38f5ed4f
...
...
@@ -65,11 +65,16 @@
<div
class=
"hg-form-cols"
id=
"produceDiv"
>
<div
class=
"hg-form-row"
>
<x:inputC
name=
"customerNo"
label=
"客户编号"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
/>
<x:inputC
name=
"customerOrderNo"
label=
"生产
订单号/销售订
单号"
labelCol=
"2"
fieldCol=
"4"
wrapper=
"select"
required=
"false"
/>
<x:inputC
name=
"customerOrderNo"
label=
"生产
单号/客户
单号"
labelCol=
"2"
fieldCol=
"4"
wrapper=
"select"
required=
"false"
/>
<x:inputC
name=
"customerName"
label=
"客户名称"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
readonly=
"true"
/>
</div>
<x:title
title=
"单号信息"
name=
"group"
hideTable=
"#info"
/>
<div
id=
"producegrid"
></div>
<div
class=
"hg-form-cols"
id=
"producegridDiv"
>
<div
id=
"producegrid"
></div>
</div>
<div
class=
"hg-form-cols"
id=
"clientgridDiv"
>
<div
id=
"clientgrid"
></div>
</div>
</div>
<div
class=
"hg-form-cols"
>
...
...
topsun/src/main/java/com/huigou/topsun/controller/ResourceSearchController.java
View file @
38f5ed4f
...
...
@@ -306,12 +306,25 @@ public class ResourceSearchController {
Integer
pageSize
=
sdo
.
getInteger
(
"pageSize"
,
10
);
PageRequest
pageRequest
=
new
PageRequest
(
intPage
-
1
,
pageSize
);
EasySearchParse
easySearchParse
=
new
EasySearchParse
();
List
<
QuerySchemeField
>
fields
=
Arrays
.
asList
(
new
QuerySchemeField
(
"客户编号"
,
"KUNNR"
,
"string"
,
60L
),
new
QuerySchemeField
(
"客户名称"
,
"NAME1"
,
"string"
,
150L
),
new
QuerySchemeField
(
"订单号"
,
"VBELN"
,
"string"
,
160L
)
);
List
<
QuerySchemeField
>
fields
=
new
ArrayList
<>();
if
(
"2"
.
equals
(
queryRequest
.
getReasonType
())){
//生产异常
fields
=
Arrays
.
asList
(
new
QuerySchemeField
(
"订单号"
,
"VBELN"
,
"string"
,
150L
),
// new QuerySchemeField("订单描述", "KTEXT", "string", 160L),
new
QuerySchemeField
(
"物料编码"
,
"MATNR"
,
"string"
,
160L
),
new
QuerySchemeField
(
"物料描述"
,
"MAKTX"
,
"string"
,
160L
),
new
QuerySchemeField
(
"数量"
,
"PSMNG"
,
"string"
,
100L
),
new
QuerySchemeField
(
"单位"
,
"MEINS"
,
"string"
,
100L
)
);
}
else
{
fields
=
Arrays
.
asList
(
new
QuerySchemeField
(
"订单号"
,
"VBELN"
,
"string"
,
130L
),
new
QuerySchemeField
(
"客户编号"
,
"KUNNR"
,
"string"
,
60L
),
new
QuerySchemeField
(
"客户名称"
,
"NAME1"
,
"string"
,
150L
)
);
}
easySearchParse
.
setFields
(
fields
);
easySearchParse
.
setWidth
(
500L
);
MemEasySearcher
<
Map
<
String
,
String
>>
memEasySearcher
=
new
MemEasySearcherImpl
<>();
...
...
topsun/src/main/java/com/huigou/topsun/sap/sapApplication/application/impl/SapMaterialApplicationImpl.java
View file @
38f5ed4f
...
...
@@ -64,6 +64,7 @@ public class SapMaterialApplicationImpl implements SapMaterialApplication {
OrderQueryVo
orderQueryVo
=
new
OrderQueryVo
();
SignVo
signVo
=
null
;
String
InterfaceName
=
"SALES_ORDERS/SALES"
;
//客户异常 查询销售订单接口
if
(
StringUtils
.
isNotBlank
(
queryRequest
.
getWerks
()))
{
//工厂
signVo
=
new
SignVo
();
signVo
.
setLow
(
queryRequest
.
getWerks
());
...
...
@@ -71,21 +72,26 @@ public class SapMaterialApplicationImpl implements SapMaterialApplication {
werksList
.
add
(
signVo
);
orderQueryVo
.
setWERKS
(
werksList
);
}
if
(
StringUtils
.
isNotBlank
(
queryRequest
.
getKunnr
())
)
{
//客户
signVo
=
new
SignVo
();
if
(
StringUtils
.
isNotBlank
(
queryRequest
.
getKunnr
())
&&
"3"
.
equals
(
queryRequest
.
getReasonType
()))
{
//客户编号
signVo
=
new
SignVo
();
signVo
.
setLow
(
queryRequest
.
getKunnr
());
List
<
SignVo
>
kunnrList
=
new
ArrayList
<>();
List
<
SignVo
>
kunnrList
=
new
ArrayList
<>();
kunnrList
.
add
(
signVo
);
orderQueryVo
.
setKUNNR
(
kunnrList
);
if
(
StringUtils
.
isNotBlank
(
queryRequest
.
getParamValue
()))
{
//过滤参数
}
if
(
StringUtils
.
isNotBlank
(
queryRequest
.
getParamValue
()))
{
//过滤参数 按订单号查询
signVo
=
new
SignVo
();
signVo
.
setLow
(
"*"
+
queryRequest
.
getParamValue
()+
"*"
);
signVo
.
setOption
(
"CP"
);
List
<
SignVo
>
vbelnList
=
new
ArrayList
<>();
vbelnList
.
add
(
signVo
);
orderQueryVo
.
setVBELN
(
vbelnList
);
}
if
(
"3"
.
equals
(
queryRequest
.
getReasonType
())){
//如果是客户异常
if
(
"3"
.
equals
(
queryRequest
.
getReasonType
()))
{
//如果是客户异常
orderQueryVo
.
setBSTNK
(
vbelnList
);
}
else
{
// 是生产异常
orderQueryVo
.
setAUFNR
(
vbelnList
);
}
}
if
(
"3"
.
equals
(
queryRequest
.
getReasonType
())){
//如果是客户异常
List
<
SignVo
>
auartList
=
new
ArrayList
<>();
signVo
=
new
SignVo
();
signVo
.
setLow
(
"ZDO"
);
...
...
@@ -94,20 +100,75 @@ public class SapMaterialApplicationImpl implements SapMaterialApplication {
signVo2
.
setLow
(
"ZEO"
);
auartList
.
add
(
signVo2
);
orderQueryVo
.
setAUART
(
auartList
);
}
}
if
(
StringUtils
.
isNotBlank
(
queryRequest
.
getVbeln
()))
{
//客户销售订单号
}
else
{
//生产异常
InterfaceName
=
"SEARCH/SCH_AUFNR"
;
}
if
(
StringUtils
.
isNotBlank
(
queryRequest
.
getVbeln
())&&
"3"
.
equals
(
queryRequest
.
getReasonType
()))
{
//客户单号
signVo
=
new
SignVo
();
signVo
.
setLow
(
queryRequest
.
getVbeln
());
List
<
SignVo
>
vbelnList
=
new
ArrayList
<>();
vbelnList
.
add
(
signVo
);
orderQueryVo
.
set
VBELN
(
vbelnList
);
orderQueryVo
.
set
BSTNK
(
vbelnList
);
}
Object
obj
=
JSONObject
.
toJSON
(
orderQueryVo
);
try
{
String
json
=
httpClient
.
execute
(
obj
,
"SALES_ORDERS/SALES"
);
List
<
Map
<
String
,
Object
>>
mapList
=
JSONUtil
.
toListMap
(
json
);
String
json
=
""
;
List
<
Map
<
String
,
Object
>>
mapList
=
new
ArrayList
<>();
if
(
"3"
.
equals
(
queryRequest
.
getReasonType
()))
{
//如果是客户异常
if
(
StringUtils
.
isNotBlank
(
queryRequest
.
getParamValue
())||
StringUtils
.
isNotBlank
(
queryRequest
.
getVbeln
()))
{
//必须输入参数
json
=
httpClient
.
execute
(
obj
,
InterfaceName
);
mapList
=
JSONUtil
.
toListMap
(
json
);
}
}
else
{
//生产异常
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
param
.
put
(
"BUKRS"
,
queryRequest
.
getWerks
());
if
(
StringUtils
.
isNotBlank
(
queryRequest
.
getVbeln
())){
//生产订单号
param
.
put
(
"AUFNR"
,
queryRequest
.
getVbeln
());
}
if
(
StringUtils
.
isNotBlank
(
queryRequest
.
getParamValue
())){
param
.
put
(
"AUFNR"
,
queryRequest
.
getParamValue
());
}
List
<
Map
<
String
,
String
>>
mapList2
=
new
ArrayList
<>();
json
=
httpClient
.
execute
(
param
,
"search/sch_aufnr"
);
Map
<
String
,
String
>
map
=
JSONObject
.
parseObject
(
json
,
Map
.
class
);
SapResult
sapResult
=
JSONObject
.
parseObject
(
cn
.
hutool
.
json
.
JSONUtil
.
toJsonStr
(
map
.
get
(
"MSG"
)),
SapResult
.
class
);
if
(
"S"
.
equals
(
sapResult
.
getTYPE
()))
{
ObjectMapper
objectMapper
=
SAPUtils
.
objectMapper
();
mapList2
=
objectMapper
.
readValue
(
com
.
huigou
.
util
.
JSONUtil
.
toString
(
map
.
get
(
"RDATA"
)),
new
TypeReference
<
List
<
Map
<
String
,
String
>>>()
{
});
if
(
StringUtils
.
isNotBlank
(
queryRequest
.
getVbeln
()))
{
for
(
Map
mapItem
:
mapList2
)
{
Map
newMap
=
new
HashMap
();
newMap
.
put
(
"MATNR"
,
mapItem
.
get
(
"PLNBEZ"
));
//物料编号
newMap
.
put
(
"MAKTX"
,
mapItem
.
get
(
"MAKTX"
));
//物料描述
newMap
.
put
(
"PSMNG"
,
mapItem
.
get
(
"GAMNG"
));
//数量
newMap
.
put
(
"MEINS"
,
mapItem
.
get
(
"GMEIN"
));
//单位
sapOrderVoList
.
add
(
newMap
);
}
}
else
{
for
(
Map
mapItem
:
mapList2
)
{
Map
newMap
=
new
HashMap
();
newMap
.
put
(
"VBELN"
,
mapItem
.
get
(
"AUFNR"
));
//订单号
newMap
.
put
(
"KTEXT"
,
mapItem
.
get
(
"KTEXT"
));
//订单描述
newMap
.
put
(
"MATNR"
,
mapItem
.
get
(
"PLNBEZ"
));
//物料编号
newMap
.
put
(
"MAKTX"
,
mapItem
.
get
(
"MAKTX"
)!=
null
?
mapItem
.
get
(
"MAKTX"
):
""
);
//物料描述
newMap
.
put
(
"PSMNG"
,
mapItem
.
get
(
"GAMNG"
));
//数量
newMap
.
put
(
"MEINS"
,
mapItem
.
get
(
"GMEIN"
));
//单位
if
(
StringUtils
.
isNotBlank
(
queryRequest
.
getParamValue
())
&&
mapItem
.
get
(
"AUFNR"
).
toString
().
indexOf
(
queryRequest
.
getParamValue
())>-
1
)
{
//过滤参数
sapOrderVoList
.
add
(
newMap
);
break
;
}
//sapOrderVoList.add(newMap);
}
}
}
}
if
(
StringUtils
.
isNotBlank
(
queryRequest
.
getVbeln
()))
{
//按生产订单号
for
(
Map
map
:
mapList
)
{
Map
newMap
=
new
HashMap
();
...
...
@@ -117,7 +178,12 @@ public class SapMaterialApplicationImpl implements SapMaterialApplication {
newMap
.
put
(
"MAKTX"
,
mapItem
.
get
(
"MAKTX"
));
//物料名称
newMap
.
put
(
"AUFNR"
,
mapItem
.
get
(
"AUFNR"
));
//生产单号
newMap
.
put
(
"PSMNG"
,
mapItem
.
get
(
"PSMNG"
));
//生产数量
newMap
.
put
(
"LFDAT"
,
mapItem
.
get
(
"LFDAT"
));
//出货日期
String
sendDate
=
""
;
if
(!
"00000000"
.
equals
(
mapItem
.
get
(
"LFDAT"
).
toString
())){
sendDate
=
mapItem
.
get
(
"LFDAT"
).
toString
();
sendDate
=
sendDate
.
substring
(
0
,
4
)+
"-"
+
sendDate
.
substring
(
4
,
6
)+
"-"
+
sendDate
.
substring
(
6
,
8
);
}
newMap
.
put
(
"LFDAT"
,
sendDate
);
//出货日期
newMap
.
put
(
"MEINS"
,
mapItem
.
get
(
"MEINS_O"
));
//单位
// KPEIN //定价单位
...
...
topsun/src/main/java/com/huigou/topsun/sap/sapApplication/application/impl/SapPaymentApplicationImpl.java
View file @
38f5ed4f
...
...
@@ -105,6 +105,7 @@ public class SapPaymentApplicationImpl implements SapPaymentApplication {
public
List
<
Map
<
String
,
String
>>
getCompanyOrders
(
String
BUKRS
)
throws
IOException
{
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
param
.
put
(
"BUKRS"
,
BUKRS
);
param
.
put
(
"ZTYPE"
,
"N"
);
String
execute
=
null
;
List
<
Map
<
String
,
String
>>
mapList
=
new
ArrayList
<>();
try
{
...
...
@@ -114,7 +115,6 @@ public class SapPaymentApplicationImpl implements SapPaymentApplication {
if
(
"S"
.
equals
(
sapResult
.
getTYPE
()))
{
ObjectMapper
objectMapper
=
SAPUtils
.
objectMapper
();
mapList
=
objectMapper
.
readValue
(
com
.
huigou
.
util
.
JSONUtil
.
toString
(
map
.
get
(
"RDATA"
)),
new
TypeReference
<
List
<
Map
<
String
,
String
>>>()
{});
}
// else {
// throw new RuntimeException("查询公司内部订单失败:" + sapResult.getMESSAGE());
...
...
topsun/src/main/java/com/huigou/topsun/sap/sapApplication/domain/query/SapDialogOrderQuery.java
View file @
38f5ed4f
...
...
@@ -14,6 +14,8 @@ public class SapDialogOrderQuery {
private
String
vbeln
;
//销售订单号
private
String
aufnr
;
//生产订单号
private
String
werks
;
//工厂
private
String
reasonType
;
//异常原因类型
...
...
topsun/src/main/java/com/huigou/topsun/sap/sapApplication/domain/vo/OrderQueryVo.java
View file @
38f5ed4f
...
...
@@ -11,10 +11,17 @@ public class OrderQueryVo {
private
List
<
SignVo
>
KUNNR
;
@JSONField
(
name
=
"WERKS"
)
private
List
<
SignVo
>
WERKS
;
@JSONField
(
name
=
"VBELN"
)
private
List
<
SignVo
>
VBELN
;
@JSONField
(
name
=
"BSTNK"
)
private
List
<
SignVo
>
BSTNK
;
@JSONField
(
name
=
"AUART"
)
private
List
<
SignVo
>
AUART
;
@JSONField
(
name
=
"AUFNR"
)
private
List
<
SignVo
>
AUFNR
;
}
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