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
91156b43
Commit
91156b43
authored
Dec 15, 2021
by
zhaoxiaolei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改集成逻辑
parent
e301f858
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
47 deletions
+46
-47
IntegrateServiceImpl.java
...tech/authorization/service/impl/IntegrateServiceImpl.java
+38
-30
CharacteristicMapper.xml
src/main/resources/mapper/CharacteristicMapper.xml
+2
-7
CharacteristicValueMapper.xml
src/main/resources/mapper/CharacteristicValueMapper.xml
+6
-10
No files found.
src/main/java/cn/com/uitech/authorization/service/impl/IntegrateServiceImpl.java
View file @
91156b43
...
...
@@ -147,7 +147,7 @@ public class IntegrateServiceImpl implements IntegrateService {
characteristic
.
setSuperBomCode
(
saveSuperCharacterInputDto
.
getSuperNumber
());
characteristic
.
setUnisSalesCName
(
saveSuperCharacterInputDto
.
getOptionName
());
characteristic
.
setIsShow
(
1
);
characteristic
.
setIsHidden
(
0
);
characteristic
.
setIsHidden
(
1
);
characteristic
.
setCharacteristicType
(
"否"
);
Characteristic
getOne
=
characteristicMapper
.
selectByCode
(
characteristic
);
if
(!
ObjectUtils
.
isEmpty
(
getOne
))
{
...
...
@@ -239,6 +239,9 @@ public class IntegrateServiceImpl implements IntegrateService {
SuperTableInfo
superTableInfo
=
new
SuperTableInfo
();
superTableInfo
.
setId
(
sequence
.
nextId
());
superTableInfo
.
setSuperBomCode
(
superBomCode
);
if
(
saveTableInputDto
.
getTableNumber
().
contains
(
"OPTION"
)){
saveTableInputDto
.
setTableNumber
(
saveTableInputDto
.
getTableNumber
().
replace
(
"OPTION"
,
"0"
));
}
superTableInfo
.
setTableNumber
(
saveTableInputDto
.
getTableNumber
());
superTableInfo
.
setTableName
(
saveTableInputDto
.
getTableName
());
SuperTableInfo
getOne
=
superTableInfoMapper
.
getOne
(
superTableInfo
);
...
...
@@ -791,50 +794,55 @@ public class IntegrateServiceImpl implements IntegrateService {
//有configid
if
(!
StringUtils
.
isEmpty
(
configurableBom
.
getConfigId
()))
{
for
(
GetSKUByH3CConfigInfo
.
KeyValues
keyValues
:
selectedCharacteristicList
)
{
CharacteristicValue
characteristicValue
=
characteristicValueMapper
.
getCharacteristicValueInfoByCode
(
keyValues
.
getH3cVCode
(),
configurableBom
.
getSuperBomCode
());
//验证H3CVCODE 是否存在
if
(
ObjectUtils
.
isEmpty
(
characteristicValue
))
{
cpnList
.
setMsg
(
"CPQ数据验证失败,失败原因:"
+
keyValues
.
getH3cVCode
()
+
"关系未维护!"
);
cpnList
.
setCode
(
ApiResult
.
INTERNAL_SERVER_ERROR
.
getCode
());
continue
;
}
else
{
//验证H3CVCODE是否下架
if
(
characteristicValue
.
getIsState
()
==
0
)
{
cpnList
.
setMsg
(
"CPQ数据验证失败,失败原因:"
+
characteristicValue
.
getCharacteristicValueCode
()
+
"已下架!"
);
CharacteristicValue
characteristicValue
=
characteristicValueMapper
.
getCharacteristicValueInfoByCode
(
keyValues
.
getH3cVCode
(),
configurableBom
.
getSuperBomCode
());
//验证H3CVCODE 是否存在
if
(
ObjectUtils
.
isEmpty
(
characteristicValue
))
{
cpnList
.
setMsg
(
"CPQ数据验证失败,失败原因:"
+
keyValues
.
getH3cVCode
()
+
"关系未维护!"
);
cpnList
.
setCode
(
ApiResult
.
INTERNAL_SERVER_ERROR
.
getCode
());
continue
;
}
else
{
//有superbom 有configid h3cvcode存在 没有下架 设置true进行撞配
flag
=
true
;
flag
=
false
;
break
;
}
else
{
//验证特征的是否存在
//characteristicValue.get
//验证H3CVCODE是否下架
if
(
characteristicValue
.
getIsState
()
==
0
)
{
cpnList
.
setMsg
(
"CPQ数据验证失败,失败原因:"
+
characteristicValue
.
getCharacteristicValueCode
()
+
"已下架!"
);
cpnList
.
setCode
(
ApiResult
.
INTERNAL_SERVER_ERROR
.
getCode
());
flag
=
false
;
break
;
}
else
{
//有superbom 有configid h3cvcode存在 没有下架 设置true进行撞配
flag
=
true
;
}
}
}
}
}
else
{
//没有configid
cpnList
.
setMsg
(
configurableBom
.
getSuperBomCode
()+
"没有维护默认值"
);
cpnList
.
setCode
(
ApiResult
.
INTERNAL_SERVER_ERROR
.
getCode
());
continue
;
flag
=
false
;
break
;
}
}
else
{
//没有superbom
cpnList
.
setMsg
(
"H3CPN没有维护对照关系"
);
cpnList
.
setCode
(
ApiResult
.
INTERNAL_SERVER_ERROR
.
getCode
());
continue
;
flag
=
false
;
break
;
}
//根据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
){
//根据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"
);
SuperBomSkuInfo
superBomSkuInfo
=
new
SuperBomSkuInfo
();
ArrayList
<
SuperBomSkuConfigInfo
>
configs
=
new
ArrayList
<>();
superBomSkuInfo
.
setSuperBomCode
(
configurableBom
.
getSuperBomCode
());
...
...
src/main/resources/mapper/CharacteristicMapper.xml
View file @
91156b43
...
...
@@ -86,15 +86,10 @@
<update
id=
"updateBom"
>
UPDATE super_characteristic_info
SET
super_bom_code = #{superBomCode},
characteristic_type = #{characteristicType},
characteristic_name = #{characteristicName},
is_hidden = #{isHidden},
is_show = #{isShow},
unis_sales_c_name = #{unisSalesCName},
h3c_c_code = #{h3CCCode}
characteristic_name = #{characteristicName}
WHERE
characteristic_code = #{characteristicCode}
and super_bom_code = #{superBomCode}
;
</update>
...
...
src/main/resources/mapper/CharacteristicValueMapper.xml
View file @
91156b43
...
...
@@ -245,20 +245,16 @@
<update
id=
"updateBom"
>
UPDATE super_characteristic_value_info
SET
characteristic_code = #{characteristicCode},
characteristic_value_name = #{characteristicValueName,jdbcType=VARCHAR},
characteristic_value_name = #{characteristicValueName},
is_state = #{isState},
super_bom_code = #{superBomCode},
zph_code = #{zphCode},
zph_name = #{zphName},
qualify_date = #{qualifyDate,jdbcType=TIMESTAMP},
unis_sales_v_name = #{unisSalesVName},
h3c_c_value = #{h3cCValue},
is_base = #{isBase},
is_show = #{isShow},
h3c_deliver_code = #{h3cDeliverCode}
qualify_date = #{qualifyDate}
WHERE
characteristic_value_code = #{characteristicValueCode};
characteristic_value_code = #{characteristicValueCode}
and super_bom_code = #{superBomCode}
and characteristic_code = #{characteristicCode}
</update>
<insert
id=
"saveBom"
>
...
...
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