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
28cdfad3
Commit
28cdfad3
authored
Jul 17, 2025
by
1650842865
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
采购订单根据PD分成不同打印页;
parent
22a0633a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
86 additions
and
37 deletions
+86
-37
sapPurchaseOrderList.js
...bapp/biz/topsun/sap/purchaseOrder/sapPurchaseOrderList.js
+10
-3
SapPurchaseOrderApplication.java
...urchaseOrder/application/SapPurchaseOrderApplication.java
+1
-1
SapPurchaseOrderApplicationImpl.java
...der/application/impl/SapPurchaseOrderApplicationImpl.java
+14
-29
SapPurchaseOrderController.java
.../purchaseOrder/controller/SapPurchaseOrderController.java
+4
-2
easy-search-material.xml
...ources/config/content/easysearch/easy-search-material.xml
+1
-1
sapPurchaseOrder.xml
...s/config/topsun/sap/sapPurchaseOrder/sapPurchaseOrder.xml
+56
-1
No files found.
topsun-xt/src/main/webapp/biz/topsun/sap/purchaseOrder/sapPurchaseOrderList.js
View file @
28cdfad3
...
...
@@ -83,7 +83,7 @@ function loadGrid() {
width
:
'99.8%'
,
height
:
'100%'
,
checkbox
:
true
,
pageSize
:
10
0
,
pageSize
:
2
0
,
heightDiff
:
-
4
,
usePager
:
true
,
rownumbers
:
true
,
...
...
@@ -147,11 +147,15 @@ function printHandler(){
var
ids
=
[];
for
(
var
i
=
0
;
i
<
rows
.
length
;
i
++
){
var
row
=
rows
[
i
];
var
count
=
row
.
count
;
//工序外协ZNB3
//成品外购的类型是ZNB1+knttp包含‘M’
if
((
row
.
bsart
==
"ZNB1"
&&
row
.
knttp
.
indexOf
(
"M"
)
!==
-
1
)
||
row
.
bsart
==
"ZNB3"
){
var
url
=
'/sapPurchaseOrder/print.load'
;
Public
.
openPostWindow
(
web_app
.
name
+
url
,{
id
:
row
.
id
});
for
(
let
j
=
0
;
j
<
count
;
j
++
)
{
Public
.
openPostWindow
(
web_app
.
name
+
url
,{
id
:
row
.
id
,
j
:
j
});
}
}
else
{
Public
.
tip
(
"请选择工序外协单或者外购单"
);
return
false
;
...
...
@@ -174,11 +178,14 @@ function sapPrintProduceNoHandler(){
var
ids
=
[];
for
(
var
i
=
0
;
i
<
rows
.
length
;
i
++
){
var
row
=
rows
[
i
];
var
count
=
row
.
count
;
//工序外协ZNB3
//成品外购的类型是ZNB1+knttp包含‘M’
if
((
row
.
bsart
==
"ZNB1"
&&
row
.
knttp
.
indexOf
(
"M"
)
!==
-
1
)
||
row
.
bsart
==
"ZNB3"
){
var
url
=
'/sapPurchaseOrder/printProduceNo.load'
;
Public
.
openPostWindow
(
web_app
.
name
+
url
,{
id
:
row
.
id
});
for
(
let
j
=
0
;
j
<
count
;
j
++
)
{
Public
.
openPostWindow
(
web_app
.
name
+
url
,{
id
:
row
.
id
,
j
:
j
});
}
}
else
{
Public
.
tip
(
"请选择工序外协单或者外购单"
);
return
false
;
...
...
topsun/src/main/java/com/huigou/topsun/sap/purchaseOrder/application/SapPurchaseOrderApplication.java
View file @
28cdfad3
...
...
@@ -29,7 +29,7 @@ public interface SapPurchaseOrderApplication {
String
revokeApproval
(
String
id
,
String
revokeReason
,
String
revokeType
);
Map
<
String
,
Object
>
print
(
String
id
);
Map
<
String
,
Object
>
print
(
String
id
,
Integer
num
);
void
updateProcessOutStatus
(
List
<
String
>
ids
);
...
...
topsun/src/main/java/com/huigou/topsun/sap/purchaseOrder/application/impl/SapPurchaseOrderApplicationImpl.java
View file @
28cdfad3
...
...
@@ -512,7 +512,7 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
}
@Override
public
Map
<
String
,
Object
>
print
(
String
id
)
{
public
Map
<
String
,
Object
>
print
(
String
id
,
Integer
num
)
{
SapPurchaseOrder
sapPurchaseOrder
=
this
.
sapPurchaseOrderRepository
.
findOne
(
id
);
Map
<
String
,
Object
>
map
=
ClassHelper
.
beanToMap
(
sapPurchaseOrder
);
if
(
sapPurchaseOrder
.
getFillinDate
()!=
null
){
...
...
@@ -546,11 +546,11 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
//订单类型是ZNB3时对应工序外发(临时工序外协)
if
(
"ZNB3"
.
equals
(
sapPurchaseOrder
.
getBsart
())){
//工序外协
map
=
this
.
getProcessOutInfo
(
map
);
map
=
this
.
getProcessOutInfo
(
map
,
num
);
}
else
{
//成品外购
//获取订单信息
map
=
this
.
getSaleOrderInfo
(
map
,
purchaseOrderItems
);
map
=
this
.
getSaleOrderInfo
(
map
,
purchaseOrderItems
,
num
);
//销售单备注信息
String
headText2
=
""
;
...
...
@@ -619,21 +619,22 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
return
map
;
}
public
Map
<
String
,
Object
>
getSaleOrderInfo
(
Map
<
String
,
Object
>
map
,
List
<
SapPurchaseOrderItem
>
purchaseOrderItems
){
public
Map
<
String
,
Object
>
getSaleOrderInfo
(
Map
<
String
,
Object
>
map
,
List
<
SapPurchaseOrderItem
>
purchaseOrderItems
,
Integer
num
){
//根据产品合并明细项
List
<
String
>
matnrList
=
new
ArrayList
<>(
purchaseOrderItems
.
stream
()
.
map
(
SapPurchaseOrderItem:
:
getMatnr2
).
collect
(
Collectors
.
toSet
()));
//
String
s
=
matnrList
.
get
(
num
);
//根据产品和单价合并明细项
List
<
MatnrNetprPair
>
result
=
purchaseOrderItems
.
stream
()
.
map
(
item
->
new
MatnrNetprPair
(
item
.
getMatnr2
(),
item
.
getNetpr
()))
.
filter
(
item
->
item
.
getMatnr2
().
equals
(
s
))
.
distinct
()
// 如果类正确实现了 equals() 和 hashCode()
.
collect
(
Collectors
.
toList
());
////获取产品信息
List
<
EpProductInfoVo
>
productInfoVoList
=
this
.
getProductInfo
(
matnrList
);
List
<
EpProductInfoVo
>
productInfoVoList
=
this
.
getProductInfo
(
s
);
map
.
put
(
"productInfoVoList"
,
productInfoVoList
);
//生产制程
map
.
put
(
"productionProcess"
,
productInfoVoList
.
get
(
0
).
getProductionProcess
());
...
...
@@ -694,32 +695,14 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
return
map
;
}
private
List
<
EpProductInfoVo
>
getProductInfo
(
List
<
String
>
matnrList
)
{
private
List
<
EpProductInfoVo
>
getProductInfo
(
String
matnr2
)
{
List
<
EpProductInfoVo
>
epProductInfoVos
=
new
ArrayList
<>();
for
(
String
matnr2
:
matnrList
)
{
//从EP系统查询产品信息
EpProductInfoVo
epProductInfoVo
=
epApplication
.
queryEpProductInfo
(
matnr2
);
epProductInfoVos
.
add
(
epProductInfoVo
);
//pProductInfoVo.setPrintColor(epProductInfoVo.getFrontColor()+";"+epProductInfoVo.getOppositeColor());
//BeanUtil.beanToMap(epProductInfoVo,map,false,false);
}
// try {
// File file = new File("product-"+map.get("ebeln")+".png");
// if(!file.exists()) {
// String IMG_TYPE_PNG = "image/png";
// map.put("barCode", CommonUtils.genBarCode128((String) map.get("ebeln"), IMG_TYPE_PNG, file,128,10, HumanReadablePlacement.HRP_BOTTOM));
// } else {
// map.put("barCode",file);
// }
// }catch (Exception e) {
// e.printStackTrace();
// throw new RuntimeException("PDF生成失败!");
// }
EpProductInfoVo
epProductInfoVo
=
epApplication
.
queryEpProductInfo
(
matnr2
);
epProductInfoVos
.
add
(
epProductInfoVo
);
return
epProductInfoVos
;
}
private
Map
<
String
,
Object
>
getProcessOutInfo
(
Map
<
String
,
Object
>
map
)
{
private
Map
<
String
,
Object
>
getProcessOutInfo
(
Map
<
String
,
Object
>
map
,
Integer
num
)
{
String
ebeln
=
(
String
)
map
.
get
(
"ebeln"
);
//采购订单号
//根据订单号查询外协单明细
List
<
ProcessOutsourceOrderItem
>
outsourceOrderItemList
=
processOutsourceOrderItemRepository
.
findByEbeln
(
ebeln
);
...
...
@@ -727,14 +710,16 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
List
<
String
>
matnrList
=
new
ArrayList
<>(
outsourceOrderItemList
.
stream
()
.
map
(
ProcessOutsourceOrderItem:
:
getProductCode
).
collect
(
Collectors
.
toSet
()));
String
s
=
matnrList
.
get
(
num
);
//获取产品信息
List
<
EpProductInfoVo
>
productInfoVoList
=
this
.
getProductInfo
(
matnrList
);
List
<
EpProductInfoVo
>
productInfoVoList
=
this
.
getProductInfo
(
s
);
map
.
put
(
"productInfoVoList"
,
productInfoVoList
);
//生产制程
map
.
put
(
"productionProcess"
,
productInfoVoList
.
get
(
0
).
getProductionProcess
());
//产品和工序合并明细项,获取数量合计,loss合计,总金额合计
List
<
ProductKey
>
uniqueProductList
=
new
ArrayList
<>(
outsourceOrderItemList
.
stream
()
.
map
(
p
->
new
ProductKey
(
p
.
getProductCode
(),
p
.
getWempf
(),
p
.
getKbetr
()))
.
filter
(
item
->
item
.
getProductCode
().
equals
(
s
))
.
distinct
()
// 如果类正确实现了 equals() 和 hashCode()
.
collect
(
Collectors
.
toList
()));
//map.put("eindt",outsourceOrderItemList.get(0).getEeind());
...
...
topsun/src/main/java/com/huigou/topsun/sap/purchaseOrder/controller/SapPurchaseOrderController.java
View file @
28cdfad3
...
...
@@ -107,7 +107,8 @@ public class SapPurchaseOrderController extends CommonController {
public
String
print
()
{
SDO
sdo
=
this
.
getSDO
();
String
id
=
sdo
.
getId
();
Map
<
String
,
Object
>
map
=
this
.
sapPurchaseOrderApplication
.
print
(
id
);
Integer
num
=
sdo
.
getInteger
(
"j"
);
Map
<
String
,
Object
>
map
=
this
.
sapPurchaseOrderApplication
.
print
(
id
,
num
);
String
pintPage
=
"/print/topsun/processOuter2.ftl"
;
return
outputAndProcUnitHandlerPDF
(
pintPage
,
id
,
map
);
}
...
...
@@ -119,7 +120,8 @@ public class SapPurchaseOrderController extends CommonController {
public
String
printProduceNo
()
{
SDO
sdo
=
this
.
getSDO
();
String
id
=
sdo
.
getId
();
Map
<
String
,
Object
>
map
=
this
.
sapPurchaseOrderApplication
.
print
(
id
);
Integer
num
=
sdo
.
getInteger
(
"j"
);
Map
<
String
,
Object
>
map
=
this
.
sapPurchaseOrderApplication
.
print
(
id
,
num
);
String
pintPage
=
"/print/topsun/processOuter.ftl"
;
return
outputAndProcUnitHandlerPDF
(
pintPage
,
id
,
map
);
}
...
...
topsun/src/main/resources/config/content/easysearch/easy-search-material.xml
View file @
28cdfad3
...
...
@@ -205,7 +205,7 @@
LEFT JOIN sap_purchase_order o ON o.id = oi.purchase_order_id
LEFT JOIN ( SELECT dd.`NAME`, dd.`VALUE` FROM sa_dictionarydetail dd
LEFT JOIN sa_dictionary d ON d.id = dd.DICTIONARY_ID
WHERE d.`CODE` = 'currency' ) d ON d.`VALUE`= o.WAERS where 1=1
WHERE d.`CODE` = 'currency' ) d ON d.`VALUE`= o.WAERS where 1=1
and o.status in (0,1,3)
</sql>
<field
name=
"物料编码"
title=
"物料编码"
code=
"matnr"
width=
"200"
/>
<field
name=
"物料名称"
title=
"物料名称"
code=
"txz01"
width=
"400"
/>
...
...
topsun/src/main/resources/config/topsun/sap/sapPurchaseOrder/sapPurchaseOrder.xml
View file @
28cdfad3
...
...
@@ -2,7 +2,62 @@
<query-mappings>
<query
name=
"sapPurchaseOrderList"
label=
"SAP采购审批"
table=
"sap_purchase_order"
>
<sql-query>
SELECT t.* from sap_purchase_order t where 1=1
select * from (
SELECT
t.id,
t.fillin_date,
t.status,
t.full_id,
t.person_member_id,
t.person_member_name,
t.bill_code,
t.EBELN,
t.BSART,
t.BATXT,
t.EKGRP,
t.EKNAM,
t.WAERS,
t.AEDAT,
t.MSG_TYPE,
t.MESSAGE,
t.retpo,
t.total_money,
t.NAMEL,
t.LIFNR,
t.send_out,
t.HEAD_TEXT,
t.KNTTP,
t.revoke_reason,
t.order_revoke_type,
COUNT( DISTINCT poi.MATNR2 ) AS count
from sap_purchase_order t
LEFT JOIN sap_purchase_order_item poi ON t.ID = poi.purchase_order_id
GROUP BY
t.id,
t.fillin_date,
t.status,
t.full_id,
t.person_member_id,
t.person_member_name,
t.bill_code,
t.EBELN,
t.BSART,
t.BATXT,
t.EKGRP,
t.EKNAM,
t.WAERS,
t.AEDAT,
t.MSG_TYPE,
t.MESSAGE,
t.retpo,
t.total_money,
t.NAMEL,
t.LIFNR,
t.send_out,
t.HEAD_TEXT,
t.KNTTP,
t.revoke_reason,
t.order_revoke_type ) t where 1=1
</sql-query>
<condition
column=
"bill_code"
name=
"billCode"
type=
"java.lang.String"
symbol=
"like"
alias=
"t"
/>
<condition
column=
"ebeln"
name=
"ebeln"
type=
"java.lang.String"
symbol=
"like"
alias=
"t"
/>
...
...
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