Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
config-server-api
Project
Overview
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
何熠
config-server-api
Commits
d4461006
Commit
d4461006
authored
Dec 14, 2021
by
zhaoxiaolei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
H3C撞配
parent
de939588
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
164 additions
and
41 deletions
+164
-41
SuperBomSkuInfoMapper.java
...om/uitech/authorization/mapper/SuperBomSkuInfoMapper.java
+2
-0
GetSKUByH3CConfigInfo.java
...tech/authorization/pojo/entity/GetSKUByH3CConfigInfo.java
+2
-2
SuperBomSkuInfo.java
...com/uitech/authorization/pojo/entity/SuperBomSkuInfo.java
+1
-0
IntegrateServiceImpl.java
...tech/authorization/service/impl/IntegrateServiceImpl.java
+146
-38
CtoBomMapper.xml
src/main/resources/mapper/CtoBomMapper.xml
+2
-1
SuperBomSkuInfoMapper.xml
src/main/resources/mapper/SuperBomSkuInfoMapper.xml
+11
-0
No files found.
src/main/java/cn/com/uitech/authorization/mapper/SuperBomSkuInfoMapper.java
View file @
d4461006
...
@@ -32,4 +32,6 @@ public interface SuperBomSkuInfoMapper extends IBaseMapper<SuperBomSkuInfo> {
...
@@ -32,4 +32,6 @@ public interface SuperBomSkuInfoMapper extends IBaseMapper<SuperBomSkuInfo> {
List
<
String
>
getConfigInfos
(
String
configId
);
List
<
String
>
getConfigInfos
(
String
configId
);
void
updateSkuStatus
(
SuperBomSkuInfo
returnSkuInfo
);
void
updateSkuStatus
(
SuperBomSkuInfo
returnSkuInfo
);
void
updateSkuStatusH3c
(
String
configId
,
String
skuCode
,
String
skuName
,
String
description
,
String
productType
,
String
productSmallType
);
}
}
src/main/java/cn/com/uitech/authorization/pojo/entity/GetSKUByH3CConfigInfo.java
View file @
d4461006
...
@@ -18,9 +18,9 @@ import java.util.List;
...
@@ -18,9 +18,9 @@ import java.util.List;
public
class
GetSKUByH3CConfigInfo
{
public
class
GetSKUByH3CConfigInfo
{
@JsonProperty
(
value
=
"TOKEN"
)
@JsonProperty
(
value
=
"TOKEN"
)
private
String
token
;
private
String
token
;
@JsonProperty
(
value
=
"QUOTERID"
)
@JsonProperty
(
value
=
"QUOTER
_
ID"
)
private
String
quoter_id
;
private
String
quoter_id
;
@JsonProperty
(
value
=
"QUOTERNUMBER"
)
@JsonProperty
(
value
=
"QUOTER
_
NUMBER"
)
private
String
quoter_number
;
private
String
quoter_number
;
@JsonProperty
(
value
=
"H3CPNLIST"
)
@JsonProperty
(
value
=
"H3CPNLIST"
)
private
List
<
H3CPNList
>
h3CPNList
;
private
List
<
H3CPNList
>
h3CPNList
;
...
...
src/main/java/cn/com/uitech/authorization/pojo/entity/SuperBomSkuInfo.java
View file @
d4461006
...
@@ -177,6 +177,7 @@ public class SuperBomSkuInfo extends BasePageDto implements Serializable {
...
@@ -177,6 +177,7 @@ public class SuperBomSkuInfo extends BasePageDto implements Serializable {
@Column
(
name
=
"id"
)
@Column
(
name
=
"id"
)
private
String
id
;
private
String
id
;
/**
/**
* setUnisSalesName
* setUnisSalesName
*/
*/
...
...
src/main/java/cn/com/uitech/authorization/service/impl/IntegrateServiceImpl.java
View file @
d4461006
package
cn
.
com
.
uitech
.
authorization
.
service
.
impl
;
package
cn
.
com
.
uitech
.
authorization
.
service
.
impl
;
import
cn.com.uitech.authorization.controller.IntegrateController
;
import
cn.com.uitech.authorization.pojo.entity.GetSKUByH3CConfigInfo
;
import
cn.com.uitech.authorization.pojo.entity.GetSKUByH3CConfigInfo
;
import
cn.com.uitech.authorization.exception.BusinessException
;
import
cn.com.uitech.authorization.exception.BusinessException
;
import
cn.com.uitech.authorization.mapper.*
;
import
cn.com.uitech.authorization.mapper.*
;
...
@@ -58,6 +59,8 @@ public class IntegrateServiceImpl implements IntegrateService {
...
@@ -58,6 +59,8 @@ public class IntegrateServiceImpl implements IntegrateService {
private
SuperBomSkuInfoMapper
superBomSkuInfoMapper
;
private
SuperBomSkuInfoMapper
superBomSkuInfoMapper
;
@Autowired
@Autowired
private
UserInfoMapper
userInfoMapper
;
private
UserInfoMapper
userInfoMapper
;
@Autowired
private
IntegrateController
integrateController
;
@Resource
@Resource
private
RedisHelper
redisHelper
;
private
RedisHelper
redisHelper
;
@Autowired
@Autowired
...
@@ -778,83 +781,188 @@ public class IntegrateServiceImpl implements IntegrateService {
...
@@ -778,83 +781,188 @@ public class IntegrateServiceImpl implements IntegrateService {
List
<
GetSKUByH3CConfigInfo
.
H3CPNList
>
h3CPNList
=
configSkuInfo
.
getH3CPNList
();
List
<
GetSKUByH3CConfigInfo
.
H3CPNList
>
h3CPNList
=
configSkuInfo
.
getH3CPNList
();
for
(
GetSKUByH3CConfigInfo
.
H3CPNList
cpnList
:
h3CPNList
)
{
for
(
GetSKUByH3CConfigInfo
.
H3CPNList
cpnList
:
h3CPNList
)
{
//根据H3CPN查询superbom
ConfigurableBom
configurableBom
=
ctoBomMapper
.
getConfigId
(
cpnList
.
getH3cPn
());
ConfigurableBom
configurableBom
=
ctoBomMapper
.
getConfigId
(
cpnList
.
getH3cPn
());
boolean
flag
=
false
;
boolean
flag
=
false
;
if
(!
CollectionUtils
.
isEmpty
(
cpnList
.
getSelectedCharacteristicList
()))
{
if
(!
CollectionUtils
.
isEmpty
(
cpnList
.
getSelectedCharacteristicList
()))
{
List
<
GetSKUByH3CConfigInfo
.
KeyValues
>
selectedCharacteristicList
=
cpnList
.
getSelectedCharacteristicList
();
List
<
GetSKUByH3CConfigInfo
.
KeyValues
>
selectedCharacteristicList
=
cpnList
.
getSelectedCharacteristicList
();
//有superbom
if
(!
ObjectUtils
.
isEmpty
(
configurableBom
))
{
if
(!
ObjectUtils
.
isEmpty
(
configurableBom
))
{
//有configid
if
(!
StringUtils
.
isEmpty
(
configurableBom
.
getConfigId
()))
{
if
(!
StringUtils
.
isEmpty
(
configurableBom
.
getConfigId
()))
{
for
(
GetSKUByH3CConfigInfo
.
KeyValues
keyValues
:
selectedCharacteristicList
)
{
for
(
GetSKUByH3CConfigInfo
.
KeyValues
keyValues
:
selectedCharacteristicList
)
{
CharacteristicValue
characteristicValue
=
characteristicValueMapper
.
getCharacteristicValueInfoByCode
(
keyValues
.
getH3cVCode
(),
cpnList
.
getH3cPn
());
CharacteristicValue
characteristicValue
=
characteristicValueMapper
.
getCharacteristicValueInfoByCode
(
keyValues
.
getH3cVCode
(),
configurableBom
.
getSuperBomCode
());
//验证H3CVCODE 是否存在
if
(
ObjectUtils
.
isEmpty
(
characteristicValue
))
{
if
(
ObjectUtils
.
isEmpty
(
characteristicValue
))
{
cpnLis
t
.
setMsg
(
"CPQ数据验证失败,失败原因:"
+
keyValues
.
getH3cVCode
()
+
"关系未维护!"
);
resul
t
.
setMsg
(
"CPQ数据验证失败,失败原因:"
+
keyValues
.
getH3cVCode
()
+
"关系未维护!"
);
cpnLis
t
.
setCode
(
ApiResult
.
INTERNAL_SERVER_ERROR
.
getCode
());
resul
t
.
setCode
(
ApiResult
.
INTERNAL_SERVER_ERROR
.
getCode
());
return
configSkuInfo
;
return
result
;
}
else
{
}
else
{
//
不为空时校验
是否下架
//
验证H3CVCODE
是否下架
if
(
characteristicValue
.
getIsState
()
==
0
)
{
if
(
characteristicValue
.
getIsState
()
==
0
)
{
cpnLis
t
.
setMsg
(
"CPQ数据验证失败,失败原因:"
+
characteristicValue
.
getCharacteristicValueCode
()
+
"已下架!"
);
resul
t
.
setMsg
(
"CPQ数据验证失败,失败原因:"
+
characteristicValue
.
getCharacteristicValueCode
()
+
"已下架!"
);
cpnLis
t
.
setCode
(
ApiResult
.
INTERNAL_SERVER_ERROR
.
getCode
());
resul
t
.
setCode
(
ApiResult
.
INTERNAL_SERVER_ERROR
.
getCode
());
return
configSkuInfo
;
return
result
;
}
else
{
}
else
{
//有superbom 有configid h3cvcode存在 没有下架 设置true进行撞配
flag
=
true
;
flag
=
true
;
}
}
}
}
}
}
}
else
{
}
else
{
//没有configid
result
.
setMsg
(
configurableBom
.
getSuperBomCode
()+
"没有维护默认值"
);
result
.
setMsg
(
configurableBom
.
getSuperBomCode
()+
"没有维护默认值"
);
result
.
setCode
(
500
);
result
.
setCode
(
ApiResult
.
INTERNAL_SERVER_ERROR
.
getCode
()
);
return
result
;
return
result
;
}
}
}
else
{
}
else
{
//没有superbom
result
.
setMsg
(
"H3CPN没有维护对照关系"
);
result
.
setMsg
(
"H3CPN没有维护对照关系"
);
result
.
setCode
(
500
);
result
.
setCode
(
ApiResult
.
INTERNAL_SERVER_ERROR
.
getCode
()
);
return
result
;
return
result
;
}
}
//根据configId生成配置
GetConfigurationInputDTO
getConfigurationInputDTO
=
new
GetConfigurationInputDTO
();
List
<
String
>
configIds
=
new
ArrayList
<>();
configIds
.
add
(
configurableBom
.
getConfigId
());
getConfigurationInputDTO
.
setConfigIds
(
configIds
);
//调用生成配置接口
Object
getConfigData
=
getConfigInfo
(
getConfigurationInputDTO
);
Object
o
=
JSONObject
.
toJSON
(
getConfigData
);
List
<
Object
>
objects
=
(
List
<
Object
>)
o
;
Map
<
String
,
Object
>
map
=
(
Map
<
String
,
Object
>)
objects
.
get
(
0
);
Object
superBomInfo
=
map
.
get
(
"superBomInfo"
);
//有superbom 有configid h3cvcode存在 没有下架 设置true进行撞配
if
(
flag
){
if
(
flag
){
//没有下架 撞配 封装 撞配信息
SuperBomSkuInfo
superBomSkuInfo
=
new
SuperBomSkuInfo
();
SuperBomSkuInfo
superBomSkuInfo
=
new
SuperBomSkuInfo
();
ArrayList
<
SuperBomSkuConfigInfo
>
configs
=
new
ArrayList
<>();
ArrayList
<
SuperBomSkuConfigInfo
>
configs
=
new
ArrayList
<>();
superBomSkuInfo
.
setSuperBomCode
(
configurableBom
.
getSuperBomCode
());
superBomSkuInfo
.
setSuperBomCode
(
configurableBom
.
getSuperBomCode
());
superBomSkuInfo
.
setConfigId
(
configurableBom
.
getConfigId
());
superBomSkuInfo
.
setConfigId
(
configurableBom
.
getConfigId
());
//H3C 过来写死 CTO
BeanUtils
.
copyProperties
(
superBomInfo
,
superBomSkuInfo
);
superBomSkuInfo
.
setPatern
(
"CTO"
);
superBomSkuInfo
.
setPatern
(
"CTO"
);
superBomSkuInfo
.
setApplyUser
(
"H3C"
);
superBomSkuInfo
.
setApplyUser
(
"H3C"
);
GetConfigurationInputDTO
getConfigurationInputDTO
=
new
GetConfigurationInputDTO
();
Integer
politicalMiningId
=
cpnList
.
getPoliticalMiningId
();
List
<
String
>
configIds
=
new
ArrayList
<>();
if
(
politicalMiningId
.
equals
(
1
)){
configIds
.
add
(
configurableBom
.
getConfigId
());
superBomSkuInfo
.
setPoliticalMiningId
(
"是"
);
getConfigurationInputDTO
.
setConfigIds
(
configIds
);
}
else
{
Object
getConfigData
=
getConfigInfo
(
getConfigurationInputDTO
);
superBomSkuInfo
.
setPoliticalMiningId
(
"否"
);
}
SuperBomSkuInfo
aa
=
(
SuperBomSkuInfo
)
superBomInfo
;
//获取list信息
List
<
SuperBomSkuConfigInfo
>
characteristicList
=
aa
.
getCharacteristicList
();
superBomSkuInfo
.
setCharacteristicList
(
characteristicList
);
//根据ccode vcode 替换list信息
List
<
GetSKUByH3CConfigInfo
.
KeyValues
>
paramList
=
cpnList
.
getSelectedCharacteristicList
();
//循环配置表信息
characteristicList
.
forEach
(
characteristic
->{
//循环传进来的值信息
paramList
.
forEach
(
param
->{
CharacteristicValue
characteristicValue
=
characteristicValueMapper
.
getCharacteristicValueInfoByCode
(
param
.
getH3cVCode
(),
configurableBom
.
getSuperBomCode
());
if
(
characteristic
.
getCharacteristicCode
().
equals
(
characteristicValue
.
getCharacteristicCode
())){
characteristic
.
setCharacteristicValueCode
(
characteristicValue
.
getCharacteristicValueCode
());
characteristic
.
setCharacteristicValueName
(
characteristicValue
.
getCharacteristicValueName
());
characteristic
.
setUnisSalesVName
(
characteristicValue
.
getUnisSalesVName
());
characteristic
.
setH3cVValue
(
characteristicValue
.
getH3cDeliverCode
());
characteristic
.
setZphCode
(
characteristicValue
.
getZphCode
());
characteristic
.
setZphName
(
characteristicValue
.
getZphName
());
}
});
});
//带着配置调用生成配置接口 获取configid赋值到撞配里面
/**
* productClassCode : ###
* materialCode : ###
* operator : ###
* selectedComplete : true
* sessionId : 会话Id,服务记录total信息的值
* selectedCharacteristicList : [{"characteristicName":"特征名称","characteristicValueName":"特征值名称","quantity":1}]
* keyValues : [{"key":"mode","value":"edit"}]
*/
BuildConfigurationInputDTO
buildConfigurationInputDTO
=
new
BuildConfigurationInputDTO
();
buildConfigurationInputDTO
.
setProductGroupCode
(
superBomSkuInfo
.
getProductClassCode
());
buildConfigurationInputDTO
.
setProductClassCode
(
superBomSkuInfo
.
getProductClassCode
());
buildConfigurationInputDTO
.
setMaterialCode
(((
SuperBomSkuInfo
)
superBomInfo
).
getSuperBomCode
());
buildConfigurationInputDTO
.
setOperator
(
"system"
);
buildConfigurationInputDTO
.
setSelectedComplete
(
true
);
//构建初始化接口 获取sessionId
/*private String system;
private String productClassCode;
private String operator;
private String configId;
private String superBomCode;
private Integer isShow;*/
SelectorEntity
selectorEntity
=
new
SelectorEntity
();
selectorEntity
.
setIsShow
(
1
);
selectorEntity
.
setOperator
(
"system"
);
selectorEntity
.
setSystem
(
"ZG"
);
selectorEntity
.
setProductClassCode
(((
SuperBomSkuInfo
)
superBomInfo
).
getProductClassCode
());
selectorEntity
.
setSuperBomCode
(((
SuperBomSkuInfo
)
superBomInfo
).
getSuperBomCode
());
Object
initializationData
=
integrateController
.
initializationData
(
selectorEntity
);
Map
<
String
,
Object
>
initMap
=
(
Map
<
String
,
Object
>)
JSONObject
.
toJSON
(
initializationData
);
Map
<
String
,
Object
>
dataMap
=
(
Map
<
String
,
Object
>)
initMap
.
get
(
"data"
);
String
sessionId
=
(
String
)
dataMap
.
get
(
"sessionId"
);
buildConfigurationInputDTO
.
setSessionId
(
sessionId
);
/*selectedCharacteristicList :
[
{
"characteristicName":"特征名称",
"characteristicValueName":"特征值名称",
"quantity":1
}
]
* keyValues : [{"key":"mode","value":"edit"}]
* */
List
<
BuildConfigurationInputDTO
.
SelectedCharacteristicListBean
>
selectedCharacteristicListBeans
=
new
ArrayList
<>();
//传入的pnlist
superBomSkuInfo
.
getCharacteristicList
().
forEach
(
selectedCharacteristic
->{
BuildConfigurationInputDTO
.
SelectedCharacteristicListBean
selectedCharacteristicListBean
=
new
BuildConfigurationInputDTO
.
SelectedCharacteristicListBean
();
//根据 list里面的vcode 查询v信息和c信息 赋值到 生成配置的对象里
selectedCharacteristicListBean
.
setCharacteristicName
(
selectedCharacteristic
.
getCharacteristicName
());
selectedCharacteristicListBean
.
setCharacteristicValueName
(
selectedCharacteristic
.
getCharacteristicValueName
());
selectedCharacteristicListBean
.
setQuantity
(
1
);
selectedCharacteristicListBeans
.
add
(
selectedCharacteristicListBean
);
});
buildConfigurationInputDTO
.
setSelectedCharacteristicList
(
selectedCharacteristicListBeans
);
buildConfigurationInputDTO
.
setKeyValues
(
null
);
Object
buildConfiguration
=
integrateController
.
buildConfiguration
(
buildConfigurationInputDTO
,
null
);
Map
<
String
,
Object
>
buildConfigurationMap
=
(
Map
<
String
,
Object
>)
JSONObject
.
toJSON
(
buildConfiguration
);
String
configId
=
(
String
)
buildConfigurationMap
.
get
(
"configId"
);
superBomSkuInfo
.
setConfigId
(
configId
);
//撞配 找PLM申请SKU
//撞配 找PLM申请SKU
ApplySkuCodeResultDto
skuInfo
=
applySkuCode
(
superBomSkuInfo
);
Object
ob
=
GetSKUByConfigInfo
(
superBomSkuInfo
);
if
(
skuInfo
.
getCode
().
equals
(
200
))
{
boolean
flag1
=
ob
instanceof
GetProductOutDto
;
if
(
skuInfo
.
getCode
().
equals
(
200
))
{
if
(
flag1
)
{
ApplySkuCodeResultDto
.
data
data
=
skuInfo
.
getData
();
Object
o1
=
JSONObject
.
toJSON
(
ob
);
data
.
setConfigId
(
superBomSkuInfo
.
getConfigId
());
Map
<
String
,
Object
>
map1
=
(
Map
<
String
,
Object
>)
o1
;
data
.
setMsg
(
"已回号"
);
Integer
code
=
(
Integer
)
map1
.
get
(
"code"
);
cpnList
.
setCode
(
skuInfo
.
getCode
());
if
(
code
.
equals
(
200
))
{
cpnList
.
setMsg
(
skuInfo
.
getMsg
());
JSONObject
data
=
(
JSONObject
)
map1
.
get
(
"data"
);
cpnList
.
setSkuCode
(
data
.
getSkuCode
());
cpnList
.
setSkuCode
((
String
)
data
.
get
(
"skuCode"
));
cpnList
.
setSkuName
(
data
.
getSkuName
());
cpnList
.
setSkuName
((
String
)
data
.
get
(
"skuName"
));
data
.
setUser
(
SecurityService
.
getPrincipal
().
getCode
());
result
.
setCode
(
code
);
characteristicMapper
.
updateSuperBomSkuInfo
(
data
);
result
.
setMsg
((
String
)
map1
.
get
(
"msg"
));
result
.
setData
(
configSkuInfo
);
}
else
{
}
else
{
result
.
setCode
(
skuInfo
.
getCode
());
Object
data
=
map1
.
get
(
"data"
);
result
.
setMsg
(
"调用PLM申请回号失败"
);
Object
data2
=
JSONObject
.
toJSON
(
data
);
result
.
setData
(
skuInfo
);
Map
<
String
,
Object
>
map2
=
(
Map
<
String
,
Object
>)
data2
;
return
result
;
result
.
setCode
(
code
);
result
.
setMsg
((
String
)
map1
.
get
(
"msg"
));
cpnList
.
setSkuCode
((
String
)
map2
.
get
(
"skuCode"
));
cpnList
.
setSkuName
((
String
)
map2
.
get
(
"skuName"
));
cpnList
.
setPatern
(
"CTO"
);
result
.
setData
(
configSkuInfo
);
}
}
}
else
{
result
.
setMsg
(
skuInfo
.
getMsg
());
result
.
setCode
(
skuInfo
.
getCode
());
return
result
;
}
}
}
}
}
}
}
}
}
}
return
configSkuInfo
;
return
result
;
}
}
@Override
@Override
...
...
src/main/resources/mapper/CtoBomMapper.xml
View file @
d4461006
...
@@ -373,6 +373,6 @@
...
@@ -373,6 +373,6 @@
</select>
</select>
<select
id=
"getConfigId"
resultType=
"cn.com.uitech.authorization.pojo.entity.ConfigurableBom"
>
<select
id=
"getConfigId"
resultType=
"cn.com.uitech.authorization.pojo.entity.ConfigurableBom"
>
select
config_id
from super_bom_info where h3c_pn = #{h3cPn}
select
*
from super_bom_info where h3c_pn = #{h3cPn}
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
src/main/resources/mapper/SuperBomSkuInfoMapper.xml
View file @
d4461006
...
@@ -194,4 +194,14 @@
...
@@ -194,4 +194,14 @@
<update
id=
"updateSkuStatus"
>
<update
id=
"updateSkuStatus"
>
update super_bom_sku_info set apply_status = '未回号' , apply_user = #{applyUser} , apply_time = now() where config_id = #{configId}
update super_bom_sku_info set apply_status = '未回号' , apply_user = #{applyUser} , apply_time = now() where config_id = #{configId}
</update>
</update>
<update
id=
"updateSkuStatusH3c"
>
update super_bom_sku_info set apply_status = '已回号' ,
apply_user = 'H3C' ,
apply_time = now(),
description = #{description},
product_type = #{productType},
product_small_type = #{productSmallType}
where config_id = #{configId}
</update>
</mapper>
</mapper>
\ 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