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
9c93b0cd
Commit
9c93b0cd
authored
Jul 29, 2024
by
刘学辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客户供料通知、异常单调整
parent
547177f9
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
333 additions
and
12 deletions
+333
-12
TasksExecute.js
huigou-xt/src/main/webapp/system/taskCenter/TasksExecute.js
+19
-2
HomePage.jsp
topsun-xt/src/main/webapp/HomePage.jsp
+2
-2
exceptionReportDetail.js
...p/biz/topsun/sap/exceptionReport/exceptionReportDetail.js
+73
-3
exceptionReportDetail.jsp
.../biz/topsun/sap/exceptionReport/exceptionReportDetail.jsp
+6
-2
HomePage.js
topsun-xt/src/main/webapp/javaScript/HomePage.js
+8
-0
ResourceSearchController.java
...om/huigou/topsun/controller/ResourceSearchController.java
+96
-0
EpSaleOrderQueryRequest.java
...topsun/ep/order/domain/query/EpSaleOrderQueryRequest.java
+1
-0
ExceptionReportApplication.java
...ceptionReport/application/ExceptionReportApplication.java
+3
-0
ExceptionReportApplicationImpl.java
...port/application/impl/ExceptionReportApplicationImpl.java
+8
-0
ExceptionReportController.java
...exceptionReport/controller/ExceptionReportController.java
+16
-0
SapMaterialApplication.java
...ap/sapApplication/application/SapMaterialApplication.java
+4
-0
SapMaterialApplicationImpl.java
...lication/application/impl/SapMaterialApplicationImpl.java
+75
-3
SapDialogOrderQuery.java
.../sap/sapApplication/domain/query/SapDialogOrderQuery.java
+21
-0
WasteSaleQueryRequest.java
...sun/sap/wasteSale/domain/query/WasteSaleQueryRequest.java
+1
-0
No files found.
huigou-xt/src/main/webapp/system/taskCenter/TasksExecute.js
View file @
9c93b0cd
...
...
@@ -88,12 +88,29 @@ function showTask(taskKind){
function
reloadExecuteTasks
()
{
Public
.
ajax
(
web_app
.
name
+
"/homePage/queryAllTasks.ajax"
,
{},
function
(
data
)
{
parseTaskHtml
(
'#waitTaskContent'
,
data
[
'tasks'
]);
parseSpecialTaskHtml
(
'#trackTaskContent'
,
data
[
'trackingTasks'
]);
//
parseSpecialTaskHtml('#trackTaskContent',data['trackingTasks']);
$
(
'span.taskCount'
).
html
(
data
[
'taskCount'
]);
$
(
'span.trackingTaskCount'
).
html
(
data
[
'trackingTaskCount'
]);
//
$('span.trackingTaskCount').html(data['trackingTaskCount']);
});
}
function
reloadExecuteDoneTasks
()
{
Public
.
ajax
(
web_app
.
name
+
"/homePage/queryTasksByViewKind.ajax"
,
{
viewTaskKind
:
'2'
},
function
(
data
)
{
parseTaskHtml
(
'#taskDoneContent'
,
data
[
'tasks2'
]);
//parseTaskHtml('#procdoneContent',data['tasks8']);
$
(
'span.taskCenterDoneCount'
).
html
(
data
[
'taskCount2'
]);
//$('span.taskProcdoneCount').html(data['taskCount8']);
});
}
function
reloadExecuteProcdoneTasks
(){
Public
.
ajax
(
web_app
.
name
+
"/homePage/queryTasksByViewKind.ajax"
,
{
viewTaskKind
:
'8'
},
function
(
data
)
{
parseTaskHtml
(
'#procdoneContent'
,
data
[
'tasks8'
]);
$
(
'span.taskProcdoneCount'
).
html
(
data
[
'taskCount8'
]);
});
}
function
parseTaskHtml
(
container
,
taskList
){
if
(
!
taskList
)
return
;
var
html
=
[];
...
...
topsun-xt/src/main/webapp/HomePage.jsp
View file @
9c93b0cd
...
...
@@ -62,7 +62,7 @@
<div
class=
"box-header with-border"
>
<h3
class=
"box-title"
><x:message
key=
"index.task.center.done"
/></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=
"reloadGrid
Done
()"
><i
class=
"fa fa-repeat"
></i></button>
<button
type=
"button"
class=
"btn btn-box-tool"
title=
"更多"
onclick=
"showTasksMore(2)"
><i
class=
"fa fa-bars"
></i></button>
</div>
...
...
@@ -78,7 +78,7 @@
<div
class=
"box-header with-border"
>
<h3
class=
"box-title"
><x:message
key=
"index.task.center.procdone"
/></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=
"reloadGrid
Procdone
()"
><i
class=
"fa fa-repeat"
></i></button>
<button
type=
"button"
class=
"btn btn-box-tool"
title=
"更多"
onclick=
"showTasksMore(8)"
><i
class=
"fa fa-bars"
></i></button>
</div>
...
...
topsun-xt/src/main/webapp/biz/topsun/sap/exceptionReport/exceptionReportDetail.js
View file @
9c93b0cd
...
...
@@ -16,6 +16,57 @@ function initialize() {
}
function
initItemGrid
()
{
//工厂
$
(
'#werksName'
).
searchbox
({
type
:
"system"
,
name
:
"dictionary"
,
getParam
:
function
(
item
)
{
return
{
fieldName
:
"WERKS"
}
},
onChange
:
function
(
value
,
data
)
{
$
(
'#werks'
).
val
(
data
.
WERKS
);
$
(
'#werksName'
).
val
(
data
.
NAME1
);
}
});
$
(
'input[name="customerName"]'
).
change
(
function
()
{
// alert(22223);
// Public.ajax(web_app.name + '/exceptionReport/getCustomerOrders.ajax'
// , {customerNo:"4ttdssd"}, function (data) {
// alert(18883);
// });
})
/*$('#customerName').searchbox({
type: "system", name: "sapCustomerOrderSelect",
getParam: function (item) {
if (Public.isBlank($('#werksName').val())){
Public.tip("请先选择工厂!")
return false
}
return {
werks: $('#werks').val(),
}
},
onChange: function (value, data) {
$('#customerName').val(data.NAME1);
$('#customerNo').val(data.KUNNR);
}
});*/
$
(
'#customerOrderNo'
).
searchbox
({
type
:
"system"
,
name
:
"sapCustomerOrderSelect"
,
getParam
:
function
(
item
)
{
if
(
Public
.
isBlank
(
$
(
'#customerNo'
).
val
())){
Public
.
tip
(
"请先选择客户编号!"
)
return
false
}
return
{
werks
:
$
(
'#werks'
).
val
(),
kunnr
:
$
(
'#customerNo'
).
val
()
}
},
onChange
:
function
(
value
,
data
)
{
$
(
'#customerOrderNo'
).
val
(
data
.
VBELN
);
$
(
'#customerName'
).
val
(
data
.
NAME1
);
}
});
var
toolbarOptions
=
UICtrl
.
getDefaultToolbarOptions
({
addHandler
:
function
(){
UICtrl
.
addGridRow
(
itemGridManager
);
...
...
@@ -58,9 +109,28 @@ function initItemGrid() {
function
getGridColumns
()
{
var
columns
=
[];
columns
=
[
{
display
:
"生产单号"
,
name
:
"produceNo"
,
width
:
"160"
,
align
:
"left"
,
type
:
"string"
,
editor
:
{
type
:
'text'
}
},
{
display
:
"生产单号"
,
name
:
"produceNo"
,
width
:
"160"
,
align
:
"left"
,
type
:
"string"
,
editor
:
{
required
:
true
,
type
:
"select"
,
data
:
{
type
:
'system'
,
name
:
"sapCustomerProduceNo"
,
getParam
:
function
(
item
)
{
return
{
werks
:
$
(
"#werks"
).
val
(),
kunnr
:
$
(
"#customerNo"
).
val
(),
vbeln
:
$
(
"#customerOrderNo"
).
val
()}
},
back
:
{
AUFNR
:
"produceNo"
,
MATNR
:
"productCode"
,
MAKTX
:
"productName"
,
PSMNG
:
"number"
,
KOEIN
:
"currencyName"
,
KWERT
:
"money"
,
EDATU
:
"sendDate"
}
}
}
},
{
display
:
"产品编码"
,
name
:
"productCode"
,
width
:
"160"
,
align
:
"left"
,
type
:
"string"
,
editor
:
{
type
:
'text'
}
},
...
...
topsun-xt/src/main/webapp/biz/topsun/sap/exceptionReport/exceptionReportDetail.jsp
View file @
9c93b0cd
...
...
@@ -40,8 +40,12 @@
<x:inputC
name=
"reportDate"
label=
"呈报日期"
labelCol=
"1"
fieldCol=
"2"
required=
"true"
wrapper=
"date"
/>
</div>
<div
class=
"hg-form-row"
>
<x:inputC
name=
"customerName"
label=
"客户"
labelCol=
"1"
fieldCol=
"2"
required=
"true"
/>
<x:inputC
name=
"customerOrderNo"
label=
"客户单号"
labelCol=
"1"
fieldCol=
"2"
required=
"true"
/>
<x:inputC
name=
"werksName"
required=
"true"
label=
"工厂"
labelCol=
"1"
wrapper=
"select"
fieldCol=
"2"
/>
<x:hidden
name=
"werks"
/>
<x:inputC
name=
"customerNo"
label=
"客户编号"
labelCol=
"1"
fieldCol=
"2"
required=
"true"
/>
<x:inputC
name=
"customerName"
label=
"客户名称"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
readonly=
"true"
/>
<!--x:inputC name="customerOrderNo" label="客户单号" labelCol="1" fieldCol="2" required="true"/-->
<x:inputC
name=
"customerOrderNo"
label=
"客户订单号"
labelCol=
"1"
fieldCol=
"2"
wrapper=
"select"
/>
</div>
</div>
<x:title
title=
"单号信息"
name=
"group"
hideTable=
"#info"
/>
...
...
topsun-xt/src/main/webapp/javaScript/HomePage.js
View file @
9c93b0cd
...
...
@@ -84,6 +84,14 @@ function reloadGrid(){
reloadExecuteTasks
();
}
function
reloadGridDone
(){
reloadExecuteDoneTasks
();
}
function
reloadGridProcdone
(){
reloadExecuteProcdoneTasks
();
}
function
reloadSpecialTaskGrid
(){
Public
.
ajax
(
web_app
.
name
+
"/homePage/queryAllTasks.ajax"
,
{},
function
(
data
)
{
parseSpecialTaskHtml
(
'#trackTaskContent'
,
data
[
'trackingTasks'
]);
...
...
topsun/src/main/java/com/huigou/topsun/controller/ResourceSearchController.java
View file @
9c93b0cd
...
...
@@ -6,7 +6,9 @@ import com.fasterxml.jackson.core.type.TypeReference;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.huigou.cache.DictUtil
;
import
com.huigou.topsun.sap.sapApplication.application.*
;
import
com.huigou.topsun.sap.sapApplication.domain.query.SapDialogOrderQuery
;
import
com.huigou.topsun.sap.sapApplication.domain.query.SapDialogQuery
;
import
com.huigou.topsun.sap.suppliers.application.SuppliersDataApplication
;
import
com.huigou.topsun.util.SAPUtils
;
import
com.huigou.uasp.annotation.ControllerMapping
;
...
...
@@ -217,6 +219,100 @@ public class ResourceSearchController {
return
model
;
}
@EasySearch
(
queryName
=
"sapCustomerOrderSelect"
)
public
Map
<
String
,
Object
>
sapCustomerOrderSelect
(
SDO
sdo
)
throws
IOException
{
String
param
=
sdo
.
getString
(
"paramValue"
);
String
werks
=
sdo
.
getString
(
"werks"
);
String
kunnr
=
sdo
.
getString
(
"kunnr"
);
SapDialogOrderQuery
queryRequest
=
sdo
.
toObject
(
SapDialogOrderQuery
.
class
);
//queryRequest.setWerks(filterValue);
queryRequest
.
setKunnr
(
kunnr
);
queryRequest
.
setWerks
(
werks
);
List
<
Map
<
String
,
String
>>
mapList
=
sapMaterialApplication
.
getSapCustomerOrder
(
queryRequest
);
// List<SapOrderVo> orderList=new ArrayList<>();
// for (int x=0;x<mapList.size();x++){
// orderList.add((SapOrderVo)mapList.get(x));
// }
if
(
CollectionUtil
.
isNotEmpty
(
mapList
)){
if
(
StringUtil
.
isNotBlank
(
kunnr
)){
//固定条件过滤,比如选了工厂后,只能读取改工厂下的物料组
mapList
=
mapList
.
stream
()
.
filter
(
map
->
!
map
.
containsValue
(
kunnr
))
.
collect
(
Collectors
.
toList
());
}
}
Integer
intPage
=
sdo
.
getInteger
(
"intPage"
,
1
);
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
)
);
easySearchParse
.
setFields
(
fields
);
easySearchParse
.
setWidth
(
500L
);
MemEasySearcher
<
Map
<
String
,
String
>>
memEasySearcher
=
new
MemEasySearcherImpl
<>();
Map
<
String
,
Object
>
model
=
memEasySearcher
.
search
(
mapList
,
easySearchParse
,
pageRequest
,
null
);
return
model
;
}
@EasySearch
(
queryName
=
"sapCustomerProduceNo"
)
public
Map
<
String
,
Object
>
sapCustomerProduceNo
(
SDO
sdo
)
throws
IOException
{
String
param
=
sdo
.
getString
(
"paramValue"
);
String
filterValue
=
sdo
.
getString
(
"filterValue"
);
String
kunnr
=
sdo
.
getString
(
"kunnr"
);
String
werks
=
sdo
.
getString
(
"werks"
);
String
vbeln
=
sdo
.
getString
(
"vbeln"
);
SapDialogOrderQuery
queryRequest
=
sdo
.
toObject
(
SapDialogOrderQuery
.
class
);
queryRequest
.
setWerks
(
werks
);
queryRequest
.
setKunnr
(
kunnr
);
queryRequest
.
setVbeln
(
vbeln
);
List
<
Map
<
String
,
String
>>
mapList
=
sapMaterialApplication
.
getSapCustomerOrder
(
queryRequest
);
if
(
CollectionUtil
.
isNotEmpty
(
mapList
)){
if
(
StringUtil
.
isNotBlank
(
kunnr
)){
//固定条件过滤,比如选了工厂后,只能读取改工厂下的物料组
mapList
=
mapList
.
stream
()
.
filter
(
map
->
!
map
.
containsValue
(
kunnr
))
.
collect
(
Collectors
.
toList
());
}
}
// List <Map<String,String>> list=(List <Map<String,String>>)mapList.get(0).get("ITEM");
Integer
intPage
=
sdo
.
getInteger
(
"intPage"
,
1
);
Integer
pageSize
=
sdo
.
getInteger
(
"pageSize"
,
10
);
PageRequest
pageRequest
=
new
PageRequest
(
intPage
-
1
,
pageSize
);
EasySearchParse
easySearchParse
=
new
EasySearchParse
();
List
<
QuerySchemeField
>
fields
=
Arrays
.
asList
(
new
QuerySchemeField
(
"生产单号"
,
"AUFNR"
,
"string"
,
140L
),
new
QuerySchemeField
(
"物料编码"
,
"MATNR"
,
"string"
,
140L
),
new
QuerySchemeField
(
"物料名称"
,
"MAKTX"
,
"string"
,
200L
),
new
QuerySchemeField
(
"数量"
,
"PSMNG"
,
"string"
,
100L
),
// new QuerySchemeField("客户物料编码", "KDMAT", "string", 200L),
new
QuerySchemeField
(
"币别"
,
"KOEIN"
,
"string"
,
100L
),
new
QuerySchemeField
(
"金额"
,
"KWERT"
,
"string"
,
200L
),
new
QuerySchemeField
(
"出货日期"
,
"EDATU"
,
"string"
,
100L
)
// new QuerySchemeField("基本计量单位名称", "MSEHL", "string", 100L),
// new QuerySchemeField("采购组", "EKGRP", "string", 100L),
// new QuerySchemeField("采购组名称", "EKNAM", "string", 200L),
// new QuerySchemeField("价格基数", "PEINH", "string", 100L)
);
easySearchParse
.
setFields
(
fields
);
easySearchParse
.
setWidth
(
500L
);
MemEasySearcher
<
Map
<
String
,
String
>>
memEasySearcher
=
new
MemEasySearcherImpl
<>();
Map
<
String
,
Object
>
model
=
memEasySearcher
.
search
(
mapList
,
easySearchParse
,
pageRequest
,
null
);
return
model
;
}
@EasySearch
(
queryName
=
"dictionarySelect"
)
public
Map
<
String
,
Object
>
dictionarySelect
(
SDO
sdo
)
throws
IOException
{
String
param
=
sdo
.
getString
(
"paramValue"
);
...
...
topsun/src/main/java/com/huigou/topsun/ep/order/domain/query/EpSaleOrderQueryRequest.java
View file @
9c93b0cd
...
...
@@ -12,4 +12,5 @@ import lombok.Data;
public
class
EpSaleOrderQueryRequest
extends
QueryAbstractRequest
{
private
String
epSaleOrderId
;
private
String
billCode
;
}
topsun/src/main/java/com/huigou/topsun/sap/exceptionReport/application/ExceptionReportApplication.java
View file @
9c93b0cd
...
...
@@ -5,6 +5,7 @@ import com.huigou.topsun.sap.exceptionReport.domain.query.ExceptionReportQueryRe
import
javax.servlet.http.HttpServletResponse
;
import
java.io.ByteArrayOutputStream
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -26,4 +27,6 @@ public interface ExceptionReportApplication {
ExceptionReport
saveExceptionReport
(
ExceptionReport
exceptionReport
);
ByteArrayOutputStream
printInfo
(
HttpServletResponse
response
,
String
id
);
List
<
Map
<
String
,
Object
>>
getCustomerOrders
(
String
customerNo
);
}
topsun/src/main/java/com/huigou/topsun/sap/exceptionReport/application/impl/ExceptionReportApplicationImpl.java
View file @
9c93b0cd
...
...
@@ -31,6 +31,7 @@ import javax.servlet.http.HttpServletResponse;
import
java.io.ByteArrayOutputStream
;
import
java.io.File
;
import
java.net.URLEncoder
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -288,4 +289,11 @@ public class ExceptionReportApplicationImpl extends FlowBroker implements Except
return
byteArrayOutputStream
;
}
@Override
public
List
<
Map
<
String
,
Object
>>
getCustomerOrders
(
String
customerNo
){
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
return
list
;
}
}
topsun/src/main/java/com/huigou/topsun/sap/exceptionReport/controller/ExceptionReportController.java
View file @
9c93b0cd
...
...
@@ -15,6 +15,7 @@ import com.huigou.util.SDO;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -67,6 +68,14 @@ public class ExceptionReportController extends CommonController {
ExceptionReport
exceptionReport
=
new
ExceptionReport
();
exceptionReport
.
setStatusId
(
BizBillStatus
.
APPLYING
.
getId
());
exceptionReport
.
setAttbizId
(
CommonUtil
.
createGUID
());
// 自动生成附件id
List
<
Map
<
String
,
Object
>>
list
=
exceptionReportApplication
.
getCustomerOrders
(
""
);
Map
map
=
new
HashMap
();
map
.
put
(
"alert-success"
,
"绿色"
);
map
.
put
(
"alert-info"
,
"蓝色"
);
map
.
put
(
"alert-warning"
,
"黄色"
);
map
.
put
(
"alert-danger"
,
"红色"
);
this
.
putAttribute
(
"customerOrders"
,
map
);
/**
* 设置jsp页面初始化填充数据,如果不设置, 那么在jsp页面上填写完表单之后立即提交申请TaskDescription获取不到时间和相关人员信息
*/
...
...
@@ -141,4 +150,11 @@ public class ExceptionReportController extends CommonController {
return
success
();
}
public
String
getCustomerOrders
(){
SDO
sdo
=
this
.
getSDO
();
List
<
String
>
ids
=
sdo
.
getIds
();
List
<
Map
<
String
,
Object
>>
list
=
exceptionReportApplication
.
getCustomerOrders
(
sdo
.
getString
(
"customerNo"
));
this
.
putAttribute
(
"customerOrders"
,
list
);
return
success
();
}
}
topsun/src/main/java/com/huigou/topsun/sap/sapApplication/application/SapMaterialApplication.java
View file @
9c93b0cd
package
com
.
huigou
.
topsun
.
sap
.
sapApplication
.
application
;
import
com.huigou.topsun.sap.sapApplication.domain.query.SapDialogOrderQuery
;
import
com.huigou.topsun.sap.sapApplication.domain.query.SapDialogQuery
;
import
com.huigou.topsun.sap.sapApplication.domain.vo.SapMaterialVo
;
...
...
@@ -14,4 +15,7 @@ import java.util.Map;
*/
public
interface
SapMaterialApplication
{
List
<
Map
<
String
,
String
>>
getSapMaterial
(
SapDialogQuery
queryRequest
)
throws
IOException
;
List
<
Map
<
String
,
String
>>
getSapCustomerOrder
(
SapDialogOrderQuery
queryRequest
)
throws
IOException
;
}
topsun/src/main/java/com/huigou/topsun/sap/sapApplication/application/impl/SapMaterialApplicationImpl.java
View file @
9c93b0cd
package
com
.
huigou
.
topsun
.
sap
.
sapApplication
.
application
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.huigou.topsun.sap.common.HttpClient
;
import
com.huigou.topsun.sap.common.domain.SapResult
;
import
com.huigou.topsun.sap.sapApplication.domain.query.SapDialogOrderQuery
;
import
com.huigou.topsun.sap.sapApplication.domain.query.SapDialogQuery
;
import
com.huigou.topsun.sap.sapApplication.application.SapMaterialApplication
;
import
com.huigou.topsun.sap.sapApplication.domain.vo.SapMaterialVo
;
import
com.huigou.topsun.util.SAPUtils
;
import
com.huigou.util.JSONUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
/**
* @Auther: xin.lu
...
...
@@ -52,4 +54,74 @@ public class SapMaterialApplicationImpl implements SapMaterialApplication {
}
return
sapMaterialVoList
;
}
@Override
public
List
<
Map
<
String
,
String
>>
getSapCustomerOrder
(
SapDialogOrderQuery
queryRequest
)
throws
IOException
{
List
<
Map
<
String
,
String
>>
sapOrderVoList
=
new
ArrayList
<>();
//String jsonParams="KUNNR:[{\"SIGN\": \"\",\"OPTION\": \"\",\"LOW\":"+queryRequest.getKunnr()+",\"HIGH\": \"\"}]";
StringBuffer
sb
=
new
StringBuffer
(
"{"
);
if
(
StringUtils
.
isNotBlank
(
queryRequest
.
getWerks
()))
{
//客户订单号
sb
.
append
(
"'WERKS':[{'SIGN':'I','OPTION':'EQ','LOW':'"
).
append
(
queryRequest
.
getWerks
()).
append
(
"','HIGH':''}]"
);
}
if
(
StringUtils
.
isNotBlank
(
queryRequest
.
getKunnr
()))
{
sb
.
append
(
",'KUNNR':[{'SIGN':'I','OPTION':'EQ','LOW':'"
).
append
(
queryRequest
.
getKunnr
()).
append
(
"','HIGH':''}]"
);
}
if
(
StringUtils
.
isNotBlank
(
queryRequest
.
getVbeln
()))
{
//客户销售订单号
sb
.
append
(
",'VBELN':[{'SIGN':'I','OPTION':'EQ','LOW':'"
).
append
(
queryRequest
.
getVbeln
()).
append
(
"','HIGH':''}]"
);
}
sb
.
append
(
"}"
);
Object
obj
=
JSONArray
.
parse
(
sb
.
toString
());
try
{
String
json
=
httpClient
.
execute
(
obj
,
"SALES_ORDERS/SALES"
);
List
<
Map
<
String
,
Object
>>
mapList
=
JSONUtil
.
toListMap
(
json
);
if
(
StringUtils
.
isNotBlank
(
queryRequest
.
getVbeln
()))
{
//按生产订单号
for
(
Map
map
:
mapList
)
{
Map
newMap
=
new
HashMap
();
List
<
Map
<
String
,
Object
>>
mapList2
=(
List
<
Map
<
String
,
Object
>>)
map
.
get
(
"ITEM"
);
newMap
.
put
(
"MATNR"
,
mapList2
.
get
(
0
).
get
(
"MATNR"
));
newMap
.
put
(
"MAKTX"
,
mapList2
.
get
(
0
).
get
(
"MAKTX"
));
newMap
.
put
(
"AUFNR"
,
mapList2
.
get
(
0
).
get
(
"AUFNR"
));
newMap
.
put
(
"PSMNG"
,
mapList2
.
get
(
0
).
get
(
"PSMNG"
));
//生产数量
newMap
.
put
(
"EDATU"
,
mapList2
.
get
(
0
).
get
(
"EDATU"
));
//出货日期
// KPEIN //定价单位
newMap
.
put
(
"KWERT"
,
mapList2
.
get
(
0
).
get
(
"KWERT"
));
// //折前总金额
newMap
.
put
(
"KOEIN"
,
mapList2
.
get
(
0
).
get
(
"KOEIN"
));
// 币别
sapOrderVoList
.
add
(
newMap
);
}
}
else
if
(
StringUtils
.
isNotBlank
(
queryRequest
.
getKunnr
()))
{
//查询订单号
for
(
Map
map
:
mapList
)
{
Map
newMap
=
new
HashMap
();
newMap
.
put
(
"BSTNK"
,
map
.
get
(
"BSTNK"
));
newMap
.
put
(
"VBELN"
,
map
.
get
(
"VBELN"
));
newMap
.
put
(
"KUNNR"
,
map
.
get
(
"KUNNR"
));
newMap
.
put
(
"NAME1"
,
map
.
get
(
"NAME1"
));
sapOrderVoList
.
add
(
newMap
);
}
}
else
{
//仅查询客户
for
(
Map
map
:
mapList
)
{
Map
newMap
=
new
HashMap
();
newMap
.
put
(
"KUNNR"
,
map
.
get
(
"KUNNR"
));
newMap
.
put
(
"NAME1"
,
map
.
get
(
"NAME1"
));
sapOrderVoList
.
add
(
newMap
);
}
}
// ObjectMapper objectMapper = SAPUtils.objectMapper();
// sapOrderVoList = objectMapper.readValue(JSONUtil.toString(json), new TypeReference<List<Map<String, String>>>() {
// });
// if (StringUtils.isNotBlank(queryRequest.getVbeln())) { //客户订单号
// sapOrderVoList = objectMapper.readValue(JSONUtil.toString(mapList.get(0).get("ITEM")), new TypeReference<List<Map<String, String>>>() {
// });
// }
}
catch
(
Exception
ex
){
throw
new
RuntimeException
(
"查询客户订单失败:"
+
ex
.
getMessage
());
//ex.printStackTrace();
}
return
sapOrderVoList
;
}
}
topsun/src/main/java/com/huigou/topsun/sap/sapApplication/domain/query/SapDialogOrderQuery.java
0 → 100644
View file @
9c93b0cd
package
com
.
huigou
.
topsun
.
sap
.
sapApplication
.
domain
.
query
;
import
lombok.Data
;
/**
* @Auther: lxh
* @Date: 2024/07/27/11:49
* @Description:
*/
@Data
public
class
SapDialogOrderQuery
{
private
String
kunnr
;
//客户编号
private
String
vbeln
;
//销售订单号
private
String
werks
;
//工厂
private
String
mtart
;
}
topsun/src/main/java/com/huigou/topsun/sap/wasteSale/domain/query/WasteSaleQueryRequest.java
View file @
9c93b0cd
...
...
@@ -11,4 +11,5 @@ import lombok.Data;
@Data
public
class
WasteSaleQueryRequest
extends
QueryAbstractRequest
{
private
String
wasteSaleId
;
private
String
billCode
;
}
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