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
b10220dc
Commit
b10220dc
authored
Nov 30, 2024
by
1650842865
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
物料变更增加是否组织扩展字段控制;BPM推送物料信息到SAP后,只接收SAP返回的消息
parent
922ceff3
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
268 additions
and
67 deletions
+268
-67
materialApplyNext.js
...n/webapp/biz/topsun/sap/nonProdApply/materialApplyNext.js
+10
-7
nonProdApplyDetail.jsp
...webapp/biz/topsun/sap/nonProdApply/nonProdApplyDetail.jsp
+7
-1
nonProdApplyNext.jsp
...n/webapp/biz/topsun/sap/nonProdApply/nonProdApplyNext.jsp
+1
-1
suppliersDataDetail.jsp
...n/webapp/biz/topsun/sap/suppliers/suppliersDataDetail.jsp
+1
-1
NonProdApplyApplicationImpl.java
...odApply/application/impl/NonProdApplyApplicationImpl.java
+46
-41
NonProdApplyDeptApplicationImpl.java
...ply/application/impl/NonProdApplyDeptApplicationImpl.java
+197
-16
NonProdApplyBaseInfo.java
.../topsun/sap/nonProdApply/domain/NonProdApplyBaseInfo.java
+6
-0
No files found.
topsun-xt/src/main/webapp/biz/topsun/sap/nonProdApply/materialApplyNext.js
View file @
b10220dc
...
@@ -241,7 +241,10 @@ function saveForm(status) {
...
@@ -241,7 +241,10 @@ function saveForm(status) {
url
:
web_app
.
name
+
'/sapNonProdApplyNext/saveSapNonProdApplyDept.ajax'
,
url
:
web_app
.
name
+
'/sapNonProdApplyNext/saveSapNonProdApplyDept.ajax'
,
//param: extendedData,
//param: extendedData,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
$
(
"#applyDeptId"
).
val
(
data
.
applyDeptId
);
//$("#applyDeptId").val(data.applyDeptId);
if
(
status
==
1
){
$
(
"#matnr"
).
val
(
data
.
matnr
);
}
if
(
data
.
result
==
""
)
if
(
data
.
result
==
""
)
{
{
Public
.
successTip
(
"保存成功!"
);
Public
.
successTip
(
"保存成功!"
);
...
@@ -805,18 +808,18 @@ function bindEvent_mrp(mtart){
...
@@ -805,18 +808,18 @@ function bindEvent_mrp(mtart){
//采购收货默认库存地
//采购收货默认库存地
if
(
mtart
==
"ZYCL"
||
mtart
==
"ZMYP"
||
mtart
==
"ZFBL"
){
if
(
mtart
==
"ZYCL"
||
mtart
==
"ZMYP"
||
mtart
==
"ZFBL"
){
$
(
"#lg
pro
"
).
val
(
"Q000"
);
$
(
"#lg
fsb
"
).
val
(
"Q000"
);
$
(
"#lg
pro
Name"
).
val
(
"质检库/不良品库"
);
$
(
"#lg
fsb
Name"
).
val
(
"质检库/不良品库"
);
}
else
if
(
mtart
==
"ZBPJ"
||
mtart
==
"ZBZP"
||
mtart
==
"ZCOM"
}
else
if
(
mtart
==
"ZBPJ"
||
mtart
==
"ZBZP"
||
mtart
==
"ZCOM"
||
mtart
==
"ZECC"
||
mtart
==
"ZGMB"
||
mtart
==
"ZKGL"
||
mtart
==
"ZSHB"
){
||
mtart
==
"ZECC"
||
mtart
==
"ZGMB"
||
mtart
==
"ZKGL"
||
mtart
==
"ZSHB"
){
$
(
"#lg
pro
"
).
val
(
$
(
"#lgort"
).
val
());
$
(
"#lg
fsb
"
).
val
(
$
(
"#lgort"
).
val
());
$
(
"#lg
pro
Name"
).
val
(
$
(
"#lgortName"
).
val
());
$
(
"#lg
fsb
Name"
).
val
(
$
(
"#lgortName"
).
val
());
}
}
//生产发货默认库存地
//生产发货默认库存地
if
(
mtart
!=
"ZSRV"
&&
mtart
!=
"ZXHP"
&&
mtart
!=
"ZXNJ"
){
if
(
mtart
!=
"ZSRV"
&&
mtart
!=
"ZXHP"
&&
mtart
!=
"ZXNJ"
){
$
(
"#lg
fsb
"
).
val
(
$
(
"#lgort"
).
val
());
$
(
"#lg
pro
"
).
val
(
$
(
"#lgort"
).
val
());
$
(
"#lg
fsb
Name"
).
val
(
$
(
"#lgortName"
).
val
());
$
(
"#lg
pro
Name"
).
val
(
$
(
"#lgortName"
).
val
());
}
}
}
}
...
...
topsun-xt/src/main/webapp/biz/topsun/sap/nonProdApply/nonProdApplyDetail.jsp
View file @
b10220dc
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
<x:title
title=
"维护物品总体内容"
name=
"group"
/>
<x:title
title=
"维护物品总体内容"
name=
"group"
/>
<div
class=
"hg-form-cols"
>
<div
class=
"hg-form-cols"
>
<div
class=
"hg-form-row"
>
<div
class=
"hg-form-row"
>
<x:inputC
name=
"genericName"
label=
"通用品名"
labelCol=
"1"
fieldCol=
"5"
/>
<x:inputC
name=
"genericName"
label=
"通用品名"
required=
"true"
labelCol=
"1"
fieldCol=
"5"
/>
<x:inputC
name=
"matnr"
label=
"物料编号"
labelCol=
"1"
fieldCol=
"2"
/>
<x:inputC
name=
"matnr"
label=
"物料编号"
labelCol=
"1"
fieldCol=
"2"
/>
<c:if
test=
"
${
kind
==
'product'
}
"
>
<c:if
test=
"
${
kind
==
'product'
}
"
>
<x:inputC
name=
"applicableStandard"
label=
"适用标准(国标)"
labelCol=
"1"
fieldCol=
"2"
/>
<x:inputC
name=
"applicableStandard"
label=
"适用标准(国标)"
labelCol=
"1"
fieldCol=
"2"
/>
...
@@ -85,6 +85,10 @@
...
@@ -85,6 +85,10 @@
<x:checkboxListC
name=
"businessUsage"
label=
"业务用途"
list=
"businessUsageUnSeledList"
labelCol=
"1"
<x:checkboxListC
name=
"businessUsage"
label=
"业务用途"
list=
"businessUsageUnSeledList"
labelCol=
"1"
fieldCol=
"8"
/>
fieldCol=
"8"
/>
</div>
</div>
<div
class=
"hg-form-row"
>
<p
style=
"color: red;font-weight: bold"
>
扩展物料到其他工厂请勾选是
</p>
<x:selectC
name=
"isExtendOrg"
label=
"是否扩展组织"
labelCol=
"1"
fieldCol=
"2"
dictionary=
"yesorno"
/>
</div>
</c:if>
</c:if>
<c:if
test=
"
${
applyType
==
1
}
"
>
<c:if
test=
"
${
applyType
==
1
}
"
>
<div
class=
"hg-form-row"
>
<div
class=
"hg-form-row"
>
...
@@ -99,9 +103,11 @@
...
@@ -99,9 +103,11 @@
fieldCol=
"8"
/>
fieldCol=
"8"
/>
</div>
</div>
</c:if>
</c:if>
<div
class=
"hg-form-row"
>
<div
style=
"padding-top: 15px;"
>
<div
style=
"padding-top: 15px;"
>
<x:fileList
bizCode=
"nonProApplyInfo"
bizId=
"attbizId"
id=
"nonProApplyInfoList"
title=
"上传附件"
/>
<x:fileList
bizCode=
"nonProApplyInfo"
bizId=
"attbizId"
id=
"nonProApplyInfoList"
title=
"上传附件"
/>
</div>
</div>
</div>
</div>
</div>
...
...
topsun-xt/src/main/webapp/biz/topsun/sap/nonProdApply/nonProdApplyNext.jsp
View file @
b10220dc
...
@@ -292,7 +292,7 @@
...
@@ -292,7 +292,7 @@
<x:selectC
name=
"diskz"
label=
"库存地MRP标识"
labelCol=
"1"
fieldCol=
"2"
dictionary=
"diskz"
/>
<x:selectC
name=
"diskz"
label=
"库存地MRP标识"
labelCol=
"1"
fieldCol=
"2"
dictionary=
"diskz"
/>
<x:inputC
name=
"lgproName"
label=
"默认生产库存地"
labelCol=
"1"
fieldCol=
"2"
wrapper=
"select"
/>
<x:inputC
name=
"lgproName"
label=
"默认生产库存地"
labelCol=
"1"
fieldCol=
"2"
wrapper=
"select"
/>
<x:hidden
name=
"lgpro"
/>
<x:hidden
name=
"lgpro"
/>
<x:inputC
name=
"lgfsbName"
label=
"
默认采购收货库存地
"
labelCol=
"1"
fieldCol=
"2"
wrapper=
"select"
/>
<x:inputC
name=
"lgfsbName"
label=
"
外部采购存储地点
"
labelCol=
"1"
fieldCol=
"2"
wrapper=
"select"
/>
<x:hidden
name=
"lgfsb"
/>
<x:hidden
name=
"lgfsb"
/>
</div>
</div>
</div>
</div>
...
...
topsun-xt/src/main/webapp/biz/topsun/sap/suppliers/suppliersDataDetail.jsp
View file @
b10220dc
...
@@ -64,7 +64,7 @@
...
@@ -64,7 +64,7 @@
<x:inputC name="strSuppl3" label="街道4" labelCol="1" fieldCol="2"/>--%>
<x:inputC name="strSuppl3" label="街道4" labelCol="1" fieldCol="2"/>--%>
<x:inputC
name=
"land1Name"
label=
"国家"
labelCol=
"1"
fieldCol=
"2"
required=
"true"
wrapper=
"select"
/>
<x:inputC
name=
"land1Name"
label=
"国家"
labelCol=
"1"
fieldCol=
"2"
required=
"true"
wrapper=
"select"
/>
<x:hidden
name=
"land1"
/>
<x:hidden
name=
"land1"
/>
<x:inputC
name=
"regionName"
label=
"地区"
labelCol=
"1"
fieldCol=
"2"
required=
"
fals
e"
wrapper=
"select"
/>
<x:inputC
name=
"regionName"
label=
"地区"
labelCol=
"1"
fieldCol=
"2"
required=
"
tru
e"
wrapper=
"select"
/>
<x:hidden
name=
"region"
/>
<x:hidden
name=
"region"
/>
<x:inputC
name=
"city1"
label=
"城市"
labelCol=
"1"
fieldCol=
"2"
required=
"true"
/>
<x:inputC
name=
"city1"
label=
"城市"
labelCol=
"1"
fieldCol=
"2"
required=
"true"
/>
...
...
topsun/src/main/java/com/huigou/topsun/sap/nonProdApply/application/impl/NonProdApplyApplicationImpl.java
View file @
b10220dc
...
@@ -127,45 +127,50 @@ public class NonProdApplyApplicationImpl extends FlowBroker implements NonProdA
...
@@ -127,45 +127,50 @@ public class NonProdApplyApplicationImpl extends FlowBroker implements NonProdA
if
(
"modify"
.
equals
(
nonProdApplyBaseInfo
.
getMaintenanceType
()))
{
if
(
"modify"
.
equals
(
nonProdApplyBaseInfo
.
getMaintenanceType
()))
{
ClassHelper
.
copyProperties
(
sapNonProdApplyDept
,
newSapNonProdApplyDept
);
ClassHelper
.
copyProperties
(
sapNonProdApplyDept
,
newSapNonProdApplyDept
);
}
else
{
//扩展的 设置默认基本字段
}
else
{
//扩展的 设置默认基本字段
newSapNonProdApplyDept
.
setMatnr
(
sapNonProdApplyDept
.
getMatnr
());
if
(
"1"
.
equals
(
nonProdApplyBaseInfo
.
getIsExtendOrg
())){
newSapNonProdApplyDept
.
setMatkl
(
sapNonProdApplyDept
.
getMatkl
());
ClassHelper
.
copyProperties
(
sapNonProdApplyDept
,
newSapNonProdApplyDept
);
newSapNonProdApplyDept
.
setMatklName
(
sapNonProdApplyDept
.
getMatklName
());
}
else
{
newSapNonProdApplyDept
.
setGroes
(
sapNonProdApplyDept
.
getGroes
());
newSapNonProdApplyDept
.
setMatnr
(
sapNonProdApplyDept
.
getMatnr
());
newSapNonProdApplyDept
.
setMtart
(
sapNonProdApplyDept
.
getMtart
());
newSapNonProdApplyDept
.
setMatkl
(
sapNonProdApplyDept
.
getMatkl
());
newSapNonProdApplyDept
.
setSpart
(
sapNonProdApplyDept
.
getSpart
());
newSapNonProdApplyDept
.
setMatklName
(
sapNonProdApplyDept
.
getMatklName
());
newSapNonProdApplyDept
.
setSpartName
(
sapNonProdApplyDept
.
getSpartName
());
newSapNonProdApplyDept
.
setGroes
(
sapNonProdApplyDept
.
getGroes
());
newSapNonProdApplyDept
.
setMtposMara
(
sapNonProdApplyDept
.
getMtposMara
());
newSapNonProdApplyDept
.
setMtart
(
sapNonProdApplyDept
.
getMtart
());
newSapNonProdApplyDept
.
setXchpf
(
sapNonProdApplyDept
.
getXchpf
());
newSapNonProdApplyDept
.
setSpart
(
sapNonProdApplyDept
.
getSpart
());
newSapNonProdApplyDept
.
setMaktx
(
sapNonProdApplyDept
.
getMaktx
());
newSapNonProdApplyDept
.
setSpartName
(
sapNonProdApplyDept
.
getSpartName
());
newSapNonProdApplyDept
.
setMaktxEn
(
sapNonProdApplyDept
.
getMaktxEn
());
newSapNonProdApplyDept
.
setMtposMara
(
sapNonProdApplyDept
.
getMtposMara
());
newSapNonProdApplyDept
.
setMeins
(
sapNonProdApplyDept
.
getMeins
());
newSapNonProdApplyDept
.
setXchpf
(
sapNonProdApplyDept
.
getXchpf
());
newSapNonProdApplyDept
.
setMeinsName
(
sapNonProdApplyDept
.
getMeinsName
());
newSapNonProdApplyDept
.
setMaktx
(
sapNonProdApplyDept
.
getMaktx
());
newSapNonProdApplyDept
.
setRaube
(
sapNonProdApplyDept
.
getRaube
());
newSapNonProdApplyDept
.
setMaktxEn
(
sapNonProdApplyDept
.
getMaktxEn
());
newSapNonProdApplyDept
.
setBrgew
(
sapNonProdApplyDept
.
getBrgew
());
newSapNonProdApplyDept
.
setMeins
(
sapNonProdApplyDept
.
getMeins
());
newSapNonProdApplyDept
.
setGewei
(
sapNonProdApplyDept
.
getGewei
());
newSapNonProdApplyDept
.
setMeinsName
(
sapNonProdApplyDept
.
getMeinsName
());
newSapNonProdApplyDept
.
setVolum
(
sapNonProdApplyDept
.
getVolum
());
newSapNonProdApplyDept
.
setRaube
(
sapNonProdApplyDept
.
getRaube
());
newSapNonProdApplyDept
.
setVoleh
(
sapNonProdApplyDept
.
getVoleh
());
newSapNonProdApplyDept
.
setBrgew
(
sapNonProdApplyDept
.
getBrgew
());
newSapNonProdApplyDept
.
setIprkz
(
sapNonProdApplyDept
.
getIprkz
());
newSapNonProdApplyDept
.
setGewei
(
sapNonProdApplyDept
.
getGewei
());
newSapNonProdApplyDept
.
setMhdhb
(
sapNonProdApplyDept
.
getMhdhb
());
newSapNonProdApplyDept
.
setVolum
(
sapNonProdApplyDept
.
getVolum
());
newSapNonProdApplyDept
.
setMhdrz
(
sapNonProdApplyDept
.
getMhdrz
());
newSapNonProdApplyDept
.
setVoleh
(
sapNonProdApplyDept
.
getVoleh
());
newSapNonProdApplyDept
.
setNormt
(
sapNonProdApplyDept
.
getNormt
());
newSapNonProdApplyDept
.
setIprkz
(
sapNonProdApplyDept
.
getIprkz
());
newSapNonProdApplyDept
.
setLength
(
sapNonProdApplyDept
.
getLength
());
newSapNonProdApplyDept
.
setMhdhb
(
sapNonProdApplyDept
.
getMhdhb
());
newSapNonProdApplyDept
.
setWidthCm
(
sapNonProdApplyDept
.
getWidthCm
());
newSapNonProdApplyDept
.
setMhdrz
(
sapNonProdApplyDept
.
getMhdrz
());
newSapNonProdApplyDept
.
setThickness
(
sapNonProdApplyDept
.
getThickness
());
newSapNonProdApplyDept
.
setNormt
(
sapNonProdApplyDept
.
getNormt
());
newSapNonProdApplyDept
.
setWeight
(
sapNonProdApplyDept
.
getWeight
());
newSapNonProdApplyDept
.
setLength
(
sapNonProdApplyDept
.
getLength
());
newSapNonProdApplyDept
.
setSingleThickness
(
sapNonProdApplyDept
.
getSingleThickness
());
newSapNonProdApplyDept
.
setWidthCm
(
sapNonProdApplyDept
.
getWidthCm
());
newSapNonProdApplyDept
.
setKlart
(
sapNonProdApplyDept
.
getKlart
());
newSapNonProdApplyDept
.
setThickness
(
sapNonProdApplyDept
.
getThickness
());
newSapNonProdApplyDept
.
setClassify
(
sapNonProdApplyDept
.
getClassify
());
newSapNonProdApplyDept
.
setWeight
(
sapNonProdApplyDept
.
getWeight
());
newSapNonProdApplyDept
.
setMaktxRemEn
(
sapNonProdApplyDept
.
getMaktxRemEn
());
newSapNonProdApplyDept
.
setSingleThickness
(
sapNonProdApplyDept
.
getSingleThickness
());
newSapNonProdApplyDept
.
setMaktxRemZh
(
sapNonProdApplyDept
.
getMaktxRemZh
());
newSapNonProdApplyDept
.
setKlart
(
sapNonProdApplyDept
.
getKlart
());
newSapNonProdApplyDept
.
setWerks
(
sapNonProdApplyDept
.
getWerks
());
newSapNonProdApplyDept
.
setClassify
(
sapNonProdApplyDept
.
getClassify
());
newSapNonProdApplyDept
.
setWerksName
(
sapNonProdApplyDept
.
getWerksName
());
newSapNonProdApplyDept
.
setMaktxRemEn
(
sapNonProdApplyDept
.
getMaktxRemEn
());
newSapNonProdApplyDept
.
setLgort
(
sapNonProdApplyDept
.
getLgort
());
newSapNonProdApplyDept
.
setMaktxRemZh
(
sapNonProdApplyDept
.
getMaktxRemZh
());
newSapNonProdApplyDept
.
setLgortName
(
sapNonProdApplyDept
.
getLgortName
());
newSapNonProdApplyDept
.
setWerks
(
sapNonProdApplyDept
.
getWerks
());
newSapNonProdApplyDept
.
setLgtyp
(
sapNonProdApplyDept
.
getLgtyp
());
newSapNonProdApplyDept
.
setWerksName
(
sapNonProdApplyDept
.
getWerksName
());
newSapNonProdApplyDept
.
setLgtypName
(
sapNonProdApplyDept
.
getLgtypName
());
newSapNonProdApplyDept
.
setLgort
(
sapNonProdApplyDept
.
getLgort
());
newSapNonProdApplyDept
.
setMtvfp
(
sapNonProdApplyDept
.
getMtvfp
());
newSapNonProdApplyDept
.
setLgortName
(
sapNonProdApplyDept
.
getLgortName
());
newSapNonProdApplyDept
.
setLvorm
(
sapNonProdApplyDept
.
getLvorm
());
newSapNonProdApplyDept
.
setLgtyp
(
sapNonProdApplyDept
.
getLgtyp
());
newSapNonProdApplyDept
.
setLgtypName
(
sapNonProdApplyDept
.
getLgtypName
());
newSapNonProdApplyDept
.
setMtvfp
(
sapNonProdApplyDept
.
getMtvfp
());
newSapNonProdApplyDept
.
setLvorm
(
sapNonProdApplyDept
.
getLvorm
());
}
// newSapNonProdApplyDept.setMagrv(sapNonProdApplyDept.getMagrv());
// newSapNonProdApplyDept.setMagrv(sapNonProdApplyDept.getMagrv());
// newSapNonProdApplyDept.setVkorg(sapNonProdApplyDept.getVkorg());
// newSapNonProdApplyDept.setVkorg(sapNonProdApplyDept.getVkorg());
...
@@ -329,7 +334,7 @@ public class NonProdApplyApplicationImpl extends FlowBroker implements NonProdA
...
@@ -329,7 +334,7 @@ public class NonProdApplyApplicationImpl extends FlowBroker implements NonProdA
//查询 单据日期
//查询 单据日期
String
fillinDateStr
=
DateUtil
.
getDateFormat
(
"yyyy-MM-dd HH:mm:ss"
,
baseInfo
.
getFillinDate
());
String
fillinDateStr
=
DateUtil
.
getDateFormat
(
"yyyy-MM-dd HH:mm:ss"
,
baseInfo
.
getFillinDate
());
//设置标题
//设置标题
String
title
=
"
非产品/半成品类
物料主数据"
;
String
title
=
"物料主数据"
;
String
maintenanceType
=
baseInfo
.
getMaintenanceType
();
String
maintenanceType
=
baseInfo
.
getMaintenanceType
();
if
(
"new"
.
equals
(
maintenanceType
)){
if
(
"new"
.
equals
(
maintenanceType
)){
title
=
title
+
"新增"
;
title
=
title
+
"新增"
;
...
@@ -338,7 +343,7 @@ public class NonProdApplyApplicationImpl extends FlowBroker implements NonProdA
...
@@ -338,7 +343,7 @@ public class NonProdApplyApplicationImpl extends FlowBroker implements NonProdA
}
else
if
(
"extend"
.
equals
(
maintenanceType
))
{
}
else
if
(
"extend"
.
equals
(
maintenanceType
))
{
title
=
title
+
"扩展"
;
title
=
title
+
"扩展"
;
}
}
return
String
.
format
(
"%s-%s
(%s)"
,
title
,
baseInfo
.
getBillCode
(),
fillinDateStr
);
return
String
.
format
(
"%s-%s
-%s(%s)"
,
title
,
baseInfo
.
getBillCode
(),
baseInfo
.
getGenericName
(),
fillinDateStr
);
}
}
@Override
@Override
...
...
topsun/src/main/java/com/huigou/topsun/sap/nonProdApply/application/impl/NonProdApplyDeptApplicationImpl.java
View file @
b10220dc
...
@@ -149,24 +149,15 @@ public class NonProdApplyDeptApplicationImpl extends BaseApplication implements
...
@@ -149,24 +149,15 @@ public class NonProdApplyDeptApplicationImpl extends BaseApplication implements
}
}
ClassHelper
.
copyProperties
(
deptVo
,
nonProdApplyDept
);
ClassHelper
.
copyProperties
(
deptVo
,
nonProdApplyDept
);
nonProdApplyDept
=
this
.
save
(
nonProdApplyDept
);
//
nonProdApplyDept = this.save(nonProdApplyDept);
//不是分发的 提交后产生领导的待办信息
//不是分发的 提交后产生领导的待办信息
if
(
StringUtil
.
isBlank
(
businessCode
)&&
active
==
1
&&
StringUtil
.
isBlank
(
sdo
.
getString
(
"distribute"
))){
//基本信息提交后 发送待分发的待办消息
if
(
StringUtil
.
isBlank
(
businessCode
)&&
active
==
1
&&
StringUtil
.
isBlank
(
sdo
.
getString
(
"distribute"
))){
//基本信息提交后 发送待分发的待办消息
//调用SAP进行校验
//调用SAP进行校验
//baseInfo.setCheckFlag("X");
//baseInfo.setCheckFlag("X");
String
backStr
=
sendSapMaterialData
(
baseInfo
,
nonProdApplyDept
);
Map
<
String
,
Object
>
data
=
sendSapMaterialData2
(
baseInfo
,
nonProdApplyDept
);
if
(
StringUtil
.
isNotBlank
(
backStr
))
{
map
.
put
(
"matnr"
,
data
.
get
(
"matnr"
));
throw
new
RuntimeException
(
backStr
);
return
map
;
}
else
{
}
//产生领导确认的待办信息 取消确认节点 2024.11.21
// Map backMap = new HashMap();
// backMap.put("TYPE", "D");
// backMap.put("title", nonProdApplyDept.getMaktx()); //汉语品名
// backMap.put("positionCode", "LDQR");
// saveBsnMessageData(baseInfo, backMap);
}
}
map
.
put
(
"applyDeptId"
,
nonProdApplyDept
.
getApplyDeptId
());
return
map
;
return
map
;
}
}
...
@@ -279,7 +270,7 @@ public class NonProdApplyDeptApplicationImpl extends BaseApplication implements
...
@@ -279,7 +270,7 @@ public class NonProdApplyDeptApplicationImpl extends BaseApplication implements
/**
/**
* 远程调用sap接口,传递数据
* 远程调用sap接口,传递数据
*/
*/
public
String
sendSapMaterialData
(
NonProdApplyBaseInfo
baseInfo
,
SapNonProdApplyDept
applyDept
)
{
public
Map
<
String
,
Object
>
sendSapMaterialData
(
NonProdApplyBaseInfo
baseInfo
,
SapNonProdApplyDept
applyDept
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
String
backStr
=
""
;
String
backStr
=
""
;
ProdApplyToSapVO
sapVO
=
new
ProdApplyToSapVO
();
ProdApplyToSapVO
sapVO
=
new
ProdApplyToSapVO
();
...
@@ -453,9 +444,199 @@ public class NonProdApplyDeptApplicationImpl extends BaseApplication implements
...
@@ -453,9 +444,199 @@ public class NonProdApplyDeptApplicationImpl extends BaseApplication implements
backMap
.
put
(
"title"
,
applyDept
.
getMaktx
());
//汉语品名
backMap
.
put
(
"title"
,
applyDept
.
getMaktx
());
//汉语品名
backMap
.
put
(
"positionCode"
,
"HYZY"
);
backMap
.
put
(
"positionCode"
,
"HYZY"
);
if
(
StringUtil
.
isBlank
(
baseInfo
.
getCheckFlag
()))
{
if
(
StringUtil
.
isBlank
(
baseInfo
.
getCheckFlag
()))
{
if
(
StringUtil
.
isBlank
(
baseInfo
.
getGenericName
())){
baseInfo
.
setGenericName
(
applyDept
.
getMaktx
());
}
saveBsnMessageData
(
baseInfo
,
backMap
);
saveBsnMessageData
(
baseInfo
,
backMap
);
}
}
return
backStr
;
map
.
put
(
"backStr"
,
backStr
);
return
map
;
//return backStr;
}
}
/**
* 远程调用sap接口,传递数据,直接收SAP返回消息
*/
public
Map
<
String
,
Object
>
sendSapMaterialData2
(
NonProdApplyBaseInfo
baseInfo
,
SapNonProdApplyDept
applyDept
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
String
backStr
=
""
;
ProdApplyToSapVO
sapVO
=
new
ProdApplyToSapVO
();
ClassHelper
.
copyProperties
(
baseInfo
,
sapVO
);
ClassHelper
.
copyProperties
(
applyDept
,
sapVO
);
sapVO
.
setMaktxRemZh
(
baseInfo
.
getMaktxRemZh
());
sapVO
.
setMaktxRemEn
(
baseInfo
.
getMaktxRemEn
());
//中英文语言代码
if
(
StringUtil
.
isNotBlank
(
sapVO
.
getMaktx
())){
sapVO
.
setSpars
(
"1"
);
}
if
(
StringUtil
.
isNotBlank
(
sapVO
.
getMaktxEn
())){
sapVO
.
setSparsEn
(
"E"
);
}
if
(
"0"
.
equals
(
sapVO
.
getXchpf
())){
//批次管理 否 传递空
sapVO
.
setXchpf
(
""
);
}
if
(
"0"
.
equals
(
sapVO
.
getNcost
())){
//不参与成本核算 否 传递空
sapVO
.
setNcost
(
""
);
}
if
(
"0"
.
equals
(
sapVO
.
getHkmat
())){
//物料来源 否 传递空
sapVO
.
setHkmat
(
""
);
}
if
(
"0"
.
equals
(
sapVO
.
getEkalr
())){
//数量结构 传递空
sapVO
.
setEkalr
(
""
);
}
if
(
"0"
.
equals
(
sapVO
.
getLvorm
())){
//集团级删除 否 传空
sapVO
.
setLvorm
(
""
);
}
if
(
baseInfo
.
getBusinessUsage
().
contains
(
"K"
)){
sapVO
.
setPstat
(
baseInfo
.
getBusinessUsage
());
}
else
{
sapVO
.
setPstat
(
"K,"
+
baseInfo
.
getBusinessUsage
());
}
if
(
baseInfo
.
getBusinessUsage
().
contains
(
"B"
)){
sapVO
.
setPstat
(
"G,"
+
sapVO
.
getPstat
());
}
sapVO
.
setBwkey
(
applyDept
.
getWerks
());
sapVO
.
setLosgr
(
applyDept
.
getPeinh
());
//成本核算的价格单位 默认为定价基数
sapVO
.
setUpdkz
(
"I"
);
//新增
if
(
"modify"
.
equals
(
baseInfo
.
getMaintenanceType
())
//|| "extend".equals(baseInfo.getMaintenanceType())
){
sapVO
.
setUpdkz
(
"U"
);
//修改和扩展
if
(
"X"
.
equals
(
sapVO
.
getLvorm
())){
//修改如果选了集团级删除,传D
sapVO
.
setUpdkz
(
"D"
);
}
}
if
(
"0"
.
equals
(
sapVO
.
getInsmk
())){
sapVO
.
setInsmk
(
""
);
}
if
(
"0"
.
equals
(
sapVO
.
getRgekz
())){
sapVO
.
setRgekz
(
""
);
}
//存储分区标识默认001
sapVO
.
setLgbkz
(
"001"
);
sapVO
.
setMbrsh
(
"M"
);
//行业默认M
if
(
"0"
.
equals
(
sapVO
.
getPerkz
())){
//期间标识
sapVO
.
setPerkz
(
""
);
}
//销售单位转换
if
(
StringUtil
.
isNotBlank
(
sapVO
.
getVrkme
())){
Map
<
String
,
Object
>
unitsaleMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
unitMapList
=
new
ArrayList
<>();
unitsaleMap
.
put
(
"MEINH"
,
sapVO
.
getVrkme
());
unitsaleMap
.
put
(
"UMREZ"
,
sapVO
.
getUmrez
());
unitsaleMap
.
put
(
"UMREN"
,
sapVO
.
getUmren
());
//去掉sale lxh 03.29
unitsaleMap
.
put
(
"MEINS"
,
sapVO
.
getMeins
());
unitMapList
.
add
(
unitsaleMap
);
sapVO
.
setMapList
(
unitMapList
);
}
ObjectMapper
objectMapper
=
new
ObjectMapper
();
String
url
=
"bd_mastdata/material"
;
String
busiType
=
"物料主数据推送SAP"
;
if
(
"product"
.
equals
(
baseInfo
.
getKind
())){
url
=
"bd_mastdata/material02"
;
busiType
=
"产品主数据推送SAP"
;
}
/**
* 封装EP BOM原材料信息
*/
StringBuilder
bomText
=
new
StringBuilder
();
bomText
.
append
(
applyDept
.
getLength
())
.
append
(
","
)
.
append
(
applyDept
.
getWidthCm
())
.
append
(
","
)
.
append
(
applyDept
.
getThickness
())
.
append
(
","
)
.
append
(
applyDept
.
getWeight
())
.
append
(
","
)
.
append
(
applyDept
.
getSingleThickness
());
sapVO
.
setBomText
(
bomText
.
toString
());
List
<
ProdApplyToSapVO
>
mapList
=
new
ArrayList
<>();
mapList
.
add
(
sapVO
);
//日志记录
Map
<
String
,
Object
>
backMap
=
new
HashMap
<>();
backMap
.
put
(
"businessType"
,
busiType
);
backMap
.
put
(
"businessId"
,
baseInfo
.
getId
());
try
{
String
paramJson
=
new
ObjectMapper
().
writeValueAsString
(
mapList
);
backMap
.
put
(
"parameter"
,
paramJson
);
//JSON.toJSONString(mapList));
}
catch
(
Exception
ex
){
//ex.printStackTrace();
LOG
.
info
(
"数据转换出错:={}"
,
JSON
.
toJSONString
(
mapList
));
backMap
.
put
(
"parameter"
,
JSON
.
toJSONString
(
mapList
));
}
backMap
.
put
(
"sequence"
,
backMap
.
get
(
"row"
));
backMap
.
put
(
"TYPE"
,
"E"
);
String
errorMsg
=
""
;
try
{
String
result
=
defaultHttpClient
.
execute
(
mapList
,
url
);
List
<
Map
<
String
,
Object
>>
resultList
=
objectMapper
.
readValue
(
result
,
new
TypeReference
<
List
<
Map
<
String
,
Object
>>>()
{
});
Map
<
String
,
Object
>
returnMap
=
resultList
.
get
(
0
);
mapCopy
(
backMap
,
returnMap
);
if
(
"S"
.
equals
(
returnMap
.
get
(
"TYPE"
)))
{
backMap
.
put
(
"TYPE"
,
"S"
);
backMap
.
put
(
"MESSAGE"
,
applyDept
.
getMatnr
()+
":"
+
backMap
.
get
(
"MESSAGE"
));
if
(!
"product"
.
equals
(
baseInfo
.
getKind
()))
{
applyDept
.
setMatnr
((
String
)
backMap
.
get
(
"MESSAGE_V1"
));
}
if
(
StringUtil
.
isBlank
(
baseInfo
.
getCheckFlag
()))
{
//非校验
this
.
nonProdApplyDeptRepository
.
save
(
applyDept
);
map
.
put
(
"matnr"
,
applyDept
.
getMatnr
());
baseInfo
.
setDistribute
(
2
);
//已办结
nonProdApplyBaseInfoRepository
.
save
(
baseInfo
);
}
//先结束 基本信息的待办
BsnMessageSponsor
bsnMessageSponsor2
=
bsnMessageSponsorRepository
.
findByBusinessId
(
baseInfo
.
getId
());
if
(
bsnMessageSponsor2
!=
null
)
{
List
<
BsnMessageExecute
>
bsnMsgList2
=
bsnMessageExecuteRepository
.
findAllByMessageSponsorId
(
bsnMessageSponsor2
.
getId
());
for
(
BsnMessageExecute
bsnMessageExecute
:
bsnMsgList2
)
{
if
(
"HYZY"
.
equals
(
bsnMessageExecute
.
getBusinessCode
()))
{
bsnMessageApplication
.
submitTask
(
bsnMessageExecute
.
getId
());
}
}
}
}
else
{
//更改到到提交状态
//baseInfo.setDistribute(0);
List
<
String
>
messages
=
resultList
.
stream
()
.
map
(
resultMap
->{
return
(
String
)
resultMap
.
get
(
"MESSAGE"
);
}).
collect
(
Collectors
.
toList
());
errorMsg
=
String
.
join
(
";"
,
messages
);
backStr
=
"传输失败:"
+
errorMsg
;
backMap
.
put
(
"MESSAGE"
,
backStr
);
//nonProdApplyBaseInfoRepository.save(baseInfo);
throw
new
RuntimeException
(
backStr
);
}
}
catch
(
Exception
e
)
{
// backMap.put("MESSAGE",applyDept.getMatnr()+":"+errorMsg);
// sapMutualEpLogApplication.saveSapMutualEpLog(resultMap);
// System.out.println("传输错误了:"+e.getMessage());
// backStr="传输失败:" + errorMsg;
// throw new RuntimeException(backStr);
}
finally
{
sapMutualEpLogApplication
.
saveSapMutualEpLog
(
backMap
);
//Operator operator = operatorApplication.createOperatorByPersonMemberId(baseInfo.getPersonMemberId());
//向货源专员 发重新分发的消息
backMap
.
put
(
"title"
,
applyDept
.
getMaktx
());
//汉语品名
backMap
.
put
(
"positionCode"
,
"HYZY"
);
if
(
StringUtil
.
isBlank
(
baseInfo
.
getCheckFlag
()))
{
if
(
StringUtil
.
isBlank
(
baseInfo
.
getGenericName
())){
baseInfo
.
setGenericName
(
applyDept
.
getMaktx
());
}
saveBsnMessageData
(
baseInfo
,
backMap
);
}
map
.
put
(
"backStr"
,
backStr
);
return
map
;
//return backStr;
}
}
}
}
...
...
topsun/src/main/java/com/huigou/topsun/sap/nonProdApply/domain/NonProdApplyBaseInfo.java
View file @
b10220dc
...
@@ -175,5 +175,11 @@ public class NonProdApplyBaseInfo extends FlowBillAbstractEntity {
...
@@ -175,5 +175,11 @@ public class NonProdApplyBaseInfo extends FlowBillAbstractEntity {
@Transient
@Transient
private
String
businessUsageSeled
;
private
String
businessUsageSeled
;
/**
* 1是 ,0 否
*/
@Column
(
name
=
"is_extend_org"
)
private
String
isExtendOrg
;
}
}
\ No newline at end of file
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