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
a440c2f2
Commit
a440c2f2
authored
Feb 18, 2025
by
1650842865
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
物料创建储存点根据工厂筛选
parent
aceaea43
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
240 deletions
+10
-240
nonProdApplyNext.js
...in/webapp/biz/topsun/sap/nonProdApply/nonProdApplyNext.js
+8
-2
NonProdApplyDeptApplication.java
...nonProdApply/application/NonProdApplyDeptApplication.java
+0
-2
NonProdApplyDeptApplicationImpl.java
...ply/application/impl/NonProdApplyDeptApplicationImpl.java
+2
-227
NonProdApplyNextController.java
...p/nonProdApply/controller/NonProdApplyNextController.java
+0
-9
No files found.
topsun-xt/src/main/webapp/biz/topsun/sap/nonProdApply/nonProdApplyNext.js
View file @
a440c2f2
...
...
@@ -1415,7 +1415,10 @@ function bindEvent_mrp(){
$
(
'#lgproName'
).
searchbox
({
type
:
"system"
,
name
:
"dictionary"
,
getParam
:
function
(
item
)
{
return
{
fieldName
:
"LGORT"
}
return
{
fieldName
:
"LGORT"
,
filterValue
:
$
(
'#werks'
).
val
()
}
},
onChange
:
function
(
value
,
data
)
{
$
(
'#lgpro'
).
val
(
data
.
LGORT
);
...
...
@@ -1425,7 +1428,10 @@ function bindEvent_mrp(){
$
(
'#lgfsbName'
).
searchbox
({
type
:
"system"
,
name
:
"dictionary"
,
getParam
:
function
(
item
)
{
return
{
fieldName
:
"LGORT"
}
return
{
fieldName
:
"LGORT"
,
filterValue
:
$
(
'#werks'
).
val
()
}
},
onChange
:
function
(
value
,
data
)
{
$
(
'#lgfsb'
).
val
(
data
.
LGORT
);
...
...
topsun/src/main/java/com/huigou/topsun/sap/nonProdApply/application/NonProdApplyDeptApplication.java
View file @
a440c2f2
...
...
@@ -49,6 +49,4 @@ public interface NonProdApplyDeptApplication {
//保存待办消息
void
saveBsnMessageData
(
NonProdApplyBaseInfo
baseInfo
,
Map
<
String
,
Object
>
backMap
);
//领导确认
Map
<
String
,
Object
>
confirmNonProdApplyDept
(
SDO
sdo
);
}
\ No newline at end of file
topsun/src/main/java/com/huigou/topsun/sap/nonProdApply/application/impl/NonProdApplyDeptApplicationImpl.java
View file @
a440c2f2
...
...
@@ -156,7 +156,7 @@ public class NonProdApplyDeptApplicationImpl extends BaseApplication implements
if
(
StringUtil
.
isBlank
(
businessCode
)&&
active
==
1
&&
StringUtil
.
isBlank
(
sdo
.
getString
(
"distribute"
))){
//基本信息提交后 发送待分发的待办消息
//调用SAP进行校验
//baseInfo.setCheckFlag("X");
Map
<
String
,
Object
>
data
=
sendSapMaterialData
2
(
baseInfo
,
nonProdApplyDept
);
Map
<
String
,
Object
>
data
=
sendSapMaterialData
(
baseInfo
,
nonProdApplyDept
);
map
.
put
(
"matnr"
,
data
.
get
(
"matnr"
));
map
.
put
(
"type"
,
data
.
get
(
"TYPE"
));
map
.
put
(
"backStr"
,
data
.
get
(
"backStr"
));
...
...
@@ -272,7 +272,7 @@ public class NonProdApplyDeptApplicationImpl extends BaseApplication implements
}
/**
* 远程调用sap接口,传递数据
* 远程调用sap接口,传递数据
,直接收SAP返回消息
*/
public
Map
<
String
,
Object
>
sendSapMaterialData
(
NonProdApplyBaseInfo
baseInfo
,
SapNonProdApplyDept
applyDept
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
...
...
@@ -334,195 +334,6 @@ public class NonProdApplyDeptApplicationImpl extends BaseApplication implements
sapVO
.
setUeetk
(
""
);
}
//存储分区标识默认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
);
if
(
"S"
.
equals
(
returnMap
.
get
(
"TYPE"
))
&&
resultList
.
size
()>
1
){
returnMap
=
resultList
.
get
(
1
);
}
mapCopy
(
backMap
,
returnMap
);
// resultMap.put("businessType", busiType);
// resultMap.put("parameter", JSON.toJSONString(map));
// resultMap.put("businessId", prodApplyBaseInfo.getId());
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
);
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;
}
}
/**
* 远程调用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
())){
//期间标识
...
...
@@ -731,40 +542,4 @@ public class NonProdApplyDeptApplicationImpl extends BaseApplication implements
}
}
//领导确认
@Override
public
Map
<
String
,
Object
>
confirmNonProdApplyDept
(
SDO
sdo
){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
// map.put("result","");
// String confirm=sdo.getString("confirm");
// String baseId=sdo.getString("id");
// NonProdApplyBaseInfo baseInfo=nonProdApplyBaseInfoRepository.findOne(baseId);
// //先结束 领导确认的待办
// BsnMessageSponsor bsnMessageSponsor2=bsnMessageSponsorRepository.findByBusinessId(baseInfo.getId());
// if (bsnMessageSponsor2!=null){
// List<BsnMessageExecute> bsnMsgList2 = bsnMessageExecuteRepository.findAllByMessageSponsorId(bsnMessageSponsor2.getId());
// for (BsnMessageExecute bsnMessageExecute : bsnMsgList2) {
// if ("LDQR".equals(bsnMessageExecute.getBusinessCode())) {
// bsnMessageApplication.submitTask(bsnMessageExecute.getId());
// }
// }
// }
// SapNonProdApplyDept nonProdApplyDept=nonProdApplyDeptRepository.findByBaseInfoId(sdo.getId());
// if ("2".equals(confirm)){//确认
// // 推送SAP
// baseInfo.setCheckFlag("");
// String backStr=sendSapMaterialData(baseInfo,nonProdApplyDept);
// map.put("result",backStr);
// } else { //回退给货源专员
// //产生货源专员的待办信息
// Map backMap=new HashMap();
// backMap.put("TYPE","D");
// backMap.put("title",nonProdApplyDept.getMaktx()); //汉语品名
// backMap.put("positionCode","HYZY");
// saveBsnMessageData(baseInfo,backMap);
// baseInfo.setDistribute(0);//改回待 提交状态
// nonProdApplyBaseInfoRepository.save(baseInfo);
// }
return
map
;
}
}
topsun/src/main/java/com/huigou/topsun/sap/nonProdApply/controller/NonProdApplyNextController.java
View file @
a440c2f2
...
...
@@ -140,15 +140,6 @@ public class NonProdApplyNextController extends CommonController {
return
toResult
(
map
);
}
/**
* 领导确认和回退
*/
public
String
confirmSapNonProdApplyDept
()
{
SDO
sdo
=
this
.
getSDO
();
Map
<
String
,
Object
>
map
=
nonProdApplyDeptApplication
.
confirmNonProdApplyDept
(
sdo
);
return
toResult
(
map
);
}
/**
* 分发表单
...
...
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