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
3552ea3d
Commit
3552ea3d
authored
Dec 13, 2021
by
zhaoxiaolei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
selector
parent
0c903091
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
129 additions
and
65 deletions
+129
-65
IntegrateController.java
.../uitech/authorization/controller/IntegrateController.java
+3
-5
CharacteristicMapper.java
...com/uitech/authorization/mapper/CharacteristicMapper.java
+1
-1
CharacteristicValueMapper.java
...itech/authorization/mapper/CharacteristicValueMapper.java
+1
-1
CtoBomMapper.java
...java/cn/com/uitech/authorization/mapper/CtoBomMapper.java
+1
-0
SuperTableInfoMapper.java
...com/uitech/authorization/mapper/SuperTableInfoMapper.java
+2
-0
CharacteristicValues.java
...m/uitech/authorization/pojo/dto/CharacteristicValues.java
+20
-0
ResultDto.java
.../java/cn/com/uitech/authorization/pojo/dto/ResultDto.java
+21
-0
IntegrateService.java
...cn/com/uitech/authorization/service/IntegrateService.java
+1
-1
IntegrateServiceImpl.java
...tech/authorization/service/impl/IntegrateServiceImpl.java
+64
-51
CharacteristicMapper.xml
src/main/resources/mapper/CharacteristicMapper.xml
+7
-1
CharacteristicValueMapper.xml
src/main/resources/mapper/CharacteristicValueMapper.xml
+0
-2
CtoBomMapper.xml
src/main/resources/mapper/CtoBomMapper.xml
+4
-0
SuperTableInfoMapper.xml
src/main/resources/mapper/SuperTableInfoMapper.xml
+4
-3
No files found.
src/main/java/cn/com/uitech/authorization/controller/IntegrateController.java
View file @
3552ea3d
...
...
@@ -83,17 +83,16 @@ public class IntegrateController {
List
<
Map
<
String
,
Object
>>
constraintCharacteristicValues
=
new
ArrayList
<>();
data
.
forEach
(
item
->
{
Map
<
String
,
Object
>
constraintCharacteristicValue
=
new
HashMap
<>();
constraintCharacteristicValue
.
put
(
"groupNumber"
,
item
.
getGroupNumber
());
List
<
Map
<
String
,
Object
>>
characteristicValues
=
new
ArrayList
<>();
List
<
SuperTableInfo
>
infos
=
item
.
getSuperTableInfos
();
infos
.
forEach
(
info
->
{
Map
<
String
,
Object
>
characteristicValue
=
new
HashMap
<>();
List
<
String
>
values
=
new
ArrayList
<>();
List
<
SuperTableItemInfo
>
itemInfos
=
info
.
getData
();
itemInfos
.
forEach
(
itemInfo
->
{
constraintCharacteristicValue
.
put
(
"groupNumber"
,
item
.
getGroupNumber
());
String
characteristicCode
=
itemInfo
.
getCharacteristicCode
();
String
cName
=
integrateService
.
getNameByCode
(
characteristicCode
,
selectorEntity
.
getIsShow
());
String
cName
=
integrateService
.
getNameByCode
(
characteristicCode
,
selectorEntity
.
getIsShow
()
,
item
.
getGroupNumber
()
);
if
(!
StringUtils
.
isEmpty
(
cName
))
{
characteristicValue
.
put
(
"characteristicName"
,
cName
);
String
characteristicValueCode
=
itemInfo
.
getCharacteristicValueCode
();
...
...
@@ -107,15 +106,14 @@ public class IntegrateController {
characteristicValue
.
put
(
"values"
,
values
);
characteristicValues
.
add
(
characteristicValue
);
});
constraintCharacteristicValue
.
put
(
"characteristicValues"
,
characteristicValues
);
constraintCharacteristicValues
.
add
(
constraintCharacteristicValue
);
});
map
.
put
(
"constraintCharacteristicValues"
,
constraintCharacteristicValues
);
map
.
put
(
"constraintCharacteristicName"
,
featureComponentNames
);
redisEntity
.
setData
(
map
);
redisEntities
.
add
(
redisEntity
);
redisHelper
.
set
(
RedisKey
.
getVariantTableKey
(
selectorEntity
.
getSystem
(),
selectorEntity
.
getProductClassCode
(),
selectorEntity
.
getSuperBomCode
()),
JSONObject
.
toJSONString
(
redisEntities
),
86400
);
});
redisHelper
.
set
(
RedisKey
.
getVariantTableKey
(
selectorEntity
.
getSystem
(),
selectorEntity
.
getProductClassCode
(),
selectorEntity
.
getSuperBomCode
()),
JSONObject
.
toJSONString
(
redisEntities
),
86400
);
}
ConfigurableBom
configurableBom
=
integrateService
.
getOdInfo
(
selectorEntity
);
...
...
src/main/java/cn/com/uitech/authorization/mapper/CharacteristicMapper.java
View file @
3552ea3d
...
...
@@ -68,7 +68,7 @@ public interface CharacteristicMapper extends IBaseMapper<Characteristic>, Inser
Characteristic
findByCharacteristicName
(
String
characteristicName
,
String
superBomCode
);
String
getNameByCode
(
String
characteristicCode
,
Integer
isShow
);
String
getNameByCode
(
String
characteristicCode
,
Integer
isShow
,
String
groupNumber
);
Characteristic
getCNameByCode
(
String
characteristicCode
,
String
superBomCode
);
...
...
src/main/java/cn/com/uitech/authorization/mapper/CharacteristicValueMapper.java
View file @
3552ea3d
...
...
@@ -102,5 +102,5 @@ public interface CharacteristicValueMapper extends IBaseMapper<CharacteristicVal
CharacteristicValue
getCharacteristicValueInfoByName
(
String
characteristicValueName
,
String
superBomCode
,
String
characteristicName
);
CharacteristicValue
getCharacteristicValueInfoByCode
(
String
h3cVCode
,
String
h3cPn
,
String
politicalMiningId
,
String
patern
);
CharacteristicValue
getCharacteristicValueInfoByCode
(
String
h3cVCode
,
String
h3cPn
);
}
src/main/java/cn/com/uitech/authorization/mapper/CtoBomMapper.java
View file @
3552ea3d
...
...
@@ -106,4 +106,5 @@ public interface CtoBomMapper extends IBaseMapper<ConfigurableBom>
SuperBomSkuInfo
getSkuInfo
(
GetSkuInputInfo
getSkuInputInfo
);
ConfigurableBom
getConfigId
(
String
h3cPn
);
}
src/main/java/cn/com/uitech/authorization/mapper/SuperTableInfoMapper.java
View file @
3552ea3d
package
cn
.
com
.
uitech
.
authorization
.
mapper
;
import
cn.com.uitech.authorization.pojo.dto.ResultDto
;
import
cn.com.uitech.authorization.pojo.dto.SuperTableInfoDto
;
import
cn.com.uitech.authorization.pojo.dto.SuperTableInfoLog
;
import
cn.com.uitech.authorization.pojo.entity.SuperTableInfo
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
import
java.util.Map
;
@Mapper
public
interface
SuperTableInfoMapper
extends
IBaseMapper
<
SuperTableInfo
>{
...
...
src/main/java/cn/com/uitech/authorization/pojo/dto/CharacteristicValues.java
0 → 100644
View file @
3552ea3d
package
cn
.
com
.
uitech
.
authorization
.
pojo
.
dto
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
import
lombok.Setter
;
import
lombok.ToString
;
import
lombok.experimental.Accessors
;
import
java.util.List
;
@Accessors
(
chain
=
true
)
@NoArgsConstructor
@Getter
@Setter
@ToString
public
class
CharacteristicValues
{
private
List
<
String
>
values
;
private
String
characteristicName
;
}
src/main/java/cn/com/uitech/authorization/pojo/dto/ResultDto.java
0 → 100644
View file @
3552ea3d
package
cn
.
com
.
uitech
.
authorization
.
pojo
.
dto
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
import
lombok.Setter
;
import
lombok.ToString
;
import
lombok.experimental.Accessors
;
@Accessors
(
chain
=
true
)
@NoArgsConstructor
@Getter
@Setter
@ToString
public
class
ResultDto
{
private
String
tableName
;
private
String
tableId
;
private
String
tableNumber
;
private
String
groupNumber
;
private
String
characteristicName
;
private
String
characteristicValueName
;
}
src/main/java/cn/com/uitech/authorization/service/IntegrateService.java
View file @
3552ea3d
...
...
@@ -25,7 +25,7 @@ public interface IntegrateService {
String
getName
(
Object
v
);
String
getNameByCode
(
String
characteristicCode
,
Integer
isShow
);
String
getNameByCode
(
String
characteristicCode
,
Integer
isShow
,
String
groupNumber
);
String
getVNameByCode
(
String
characteristicValueCode
,
String
characteristicCode
);
...
...
src/main/java/cn/com/uitech/authorization/service/impl/IntegrateServiceImpl.java
View file @
3552ea3d
...
...
@@ -341,8 +341,8 @@ public class IntegrateServiceImpl implements IntegrateService {
}
@Override
public
String
getNameByCode
(
String
characteristicCode
,
Integer
isShow
)
{
return
characteristicMapper
.
getNameByCode
(
characteristicCode
,
isShow
);
public
String
getNameByCode
(
String
characteristicCode
,
Integer
isShow
,
String
groupNumber
)
{
return
characteristicMapper
.
getNameByCode
(
characteristicCode
,
isShow
,
groupNumber
);
}
@Override
...
...
@@ -777,66 +777,79 @@ public class IntegrateServiceImpl implements IntegrateService {
List
<
GetSKUByH3CConfigInfo
.
H3CPNList
>
h3CPNList
=
configSkuInfo
.
getH3CPNList
();
for
(
GetSKUByH3CConfigInfo
.
H3CPNList
cpnList
:
h3CPNList
)
{
ConfigurableBom
configurableBom
=
ctoBomMapper
.
getConfigId
(
cpnList
.
getH3cPn
());
boolean
flag
=
false
;
if
(!
CollectionUtils
.
isEmpty
(
cpnList
.
getSelectedCharacteristicList
()))
{
List
<
GetSKUByH3CConfigInfo
.
KeyValues
>
selectedCharacteristicList
=
cpnList
.
getSelectedCharacteristicList
();
for
(
GetSKUByH3CConfigInfo
.
KeyValues
keyValues
:
selectedCharacteristicList
)
{
Integer
politicalMiningId
=
cpnList
.
getPoliticalMiningId
();
String
politicalMining
=
""
;
if
(
politicalMiningId
.
equals
(
0
))
{
politicalMining
=
"否"
;
}
else
if
(
politicalMiningId
.
equals
(
1
))
{
politicalMining
=
"是"
;
}
CharacteristicValue
characteristicValue
=
characteristicValueMapper
.
getCharacteristicValueInfoByCode
(
keyValues
.
getH3cVCode
(),
cpnList
.
getH3cPn
(),
politicalMining
,
cpnList
.
getPatern
());
if
(
ObjectUtils
.
isEmpty
(
characteristicValue
))
{
cpnList
.
setMsg
(
"CPQ数据验证失败,失败原因:"
+
keyValues
.
getH3cVCode
()
+
"关系未维护!"
);
cpnList
.
setCode
(
ApiResult
.
INTERNAL_SERVER_ERROR
.
getCode
());
return
configSkuInfo
;
}
else
{
//不为空时校验是否下架
if
(
characteristicValue
.
getIsState
()
==
0
)
{
cpnList
.
setMsg
(
"CPQ数据验证失败,失败原因:"
+
characteristicValue
.
getCharacteristicValueCode
()
+
"已下架!"
);
cpnList
.
setCode
(
ApiResult
.
INTERNAL_SERVER_ERROR
.
getCode
());
return
configSkuInfo
;
if
(!
ObjectUtils
.
isEmpty
(
configurableBom
))
{
if
(!
StringUtils
.
isEmpty
(
configurableBom
.
getConfigId
()))
{
for
(
GetSKUByH3CConfigInfo
.
KeyValues
keyValues
:
selectedCharacteristicList
)
{
CharacteristicValue
characteristicValue
=
characteristicValueMapper
.
getCharacteristicValueInfoByCode
(
keyValues
.
getH3cVCode
(),
cpnList
.
getH3cPn
());
if
(
ObjectUtils
.
isEmpty
(
characteristicValue
))
{
cpnList
.
setMsg
(
"CPQ数据验证失败,失败原因:"
+
keyValues
.
getH3cVCode
()
+
"关系未维护!"
);
cpnList
.
setCode
(
ApiResult
.
INTERNAL_SERVER_ERROR
.
getCode
());
return
configSkuInfo
;
}
else
{
//不为空时校验是否下架
if
(
characteristicValue
.
getIsState
()
==
0
)
{
cpnList
.
setMsg
(
"CPQ数据验证失败,失败原因:"
+
characteristicValue
.
getCharacteristicValueCode
()
+
"已下架!"
);
cpnList
.
setCode
(
ApiResult
.
INTERNAL_SERVER_ERROR
.
getCode
());
return
configSkuInfo
;
}
else
{
flag
=
true
;
}
}
}
}
else
{
result
.
setMsg
(
configurableBom
.
getSuperBomCode
()+
"没有维护默认值"
);
result
.
setCode
(
500
);
return
result
;
}
}
else
{
result
.
setMsg
(
"H3CPN没有维护对照关系"
);
result
.
setCode
(
500
);
return
result
;
}
//没有下架 撞配 封装 撞配信息
SuperBomSkuInfo
superBomSkuInfo
=
new
SuperBomSkuInfo
();
ArrayList
<
SuperBomSkuConfigInfo
>
configs
=
new
ArrayList
<>();
superBomSkuInfo
.
setSuperBomCode
(
cpnList
.
getH3cPn
());
superBomSkuInfo
.
setConfigId
(
cpnList
.
getConfigId
());
superBomSkuInfo
.
setApplyUser
(
"H3C"
);
superBomSkuInfo
=
(
SuperBomSkuInfo
)
superBomSkuInfoMapper
.
getSkuInfo
(
superBomSkuInfo
);
for
(
GetSKUByH3CConfigInfo
.
KeyValues
keyValues
:
selectedCharacteristicList
)
{
SuperBomSkuConfigInfo
superBomSkuConfigInfo
=
superBomSkuInfoMapper
.
getConfigInfoList
(
cpnList
.
getConfigId
(),
keyValues
.
getH3cVCode
());
configs
.
add
(
superBomSkuConfigInfo
);
}
superBomSkuInfo
.
setCharacteristicList
(
configs
);
//撞配 找PLM申请SKU
ApplySkuCodeResultDto
skuInfo
=
applySkuCode
(
superBomSkuInfo
);
if
(
skuInfo
.
getCode
().
equals
(
200
))
{
if
(
flag
){
//没有下架 撞配 封装 撞配信息
SuperBomSkuInfo
superBomSkuInfo
=
new
SuperBomSkuInfo
();
ArrayList
<
SuperBomSkuConfigInfo
>
configs
=
new
ArrayList
<>();
superBomSkuInfo
.
setSuperBomCode
(
configurableBom
.
getSuperBomCode
());
superBomSkuInfo
.
setConfigId
(
configurableBom
.
getConfigId
());
superBomSkuInfo
.
setPatern
(
"CTO"
);
superBomSkuInfo
.
setApplyUser
(
"H3C"
);
GetConfigurationInputDTO
getConfigurationInputDTO
=
new
GetConfigurationInputDTO
();
List
<
Long
>
configIds
=
new
ArrayList
<>();
configIds
.
add
(
Long
.
valueOf
(
configurableBom
.
getConfigId
()));
getConfigurationInputDTO
.
setConfigIds
(
configIds
);
Object
getConfigData
=
getConfigInfo
(
getConfigurationInputDTO
);
//撞配 找PLM申请SKU
ApplySkuCodeResultDto
skuInfo
=
applySkuCode
(
superBomSkuInfo
);
if
(
skuInfo
.
getCode
().
equals
(
200
))
{
ApplySkuCodeResultDto
.
data
data
=
skuInfo
.
getData
();
data
.
setConfigId
(
superBomSkuInfo
.
getConfigId
());
data
.
setMsg
(
"已回号"
);
cpnList
.
setCode
(
skuInfo
.
getCode
());
cpnList
.
setMsg
(
skuInfo
.
getMsg
());
cpnList
.
setSkuCode
(
data
.
getSkuCode
());
cpnList
.
setSkuName
(
data
.
getSkuName
());
data
.
setUser
(
SecurityService
.
getPrincipal
().
getCode
());
characteristicMapper
.
updateSuperBomSkuInfo
(
data
);
if
(
skuInfo
.
getCode
().
equals
(
200
))
{
ApplySkuCodeResultDto
.
data
data
=
skuInfo
.
getData
();
data
.
setConfigId
(
superBomSkuInfo
.
getConfigId
());
data
.
setMsg
(
"已回号"
);
cpnList
.
setCode
(
skuInfo
.
getCode
());
cpnList
.
setMsg
(
skuInfo
.
getMsg
());
cpnList
.
setSkuCode
(
data
.
getSkuCode
());
cpnList
.
setSkuName
(
data
.
getSkuName
());
data
.
setUser
(
SecurityService
.
getPrincipal
().
getCode
());
characteristicMapper
.
updateSuperBomSkuInfo
(
data
);
}
else
{
result
.
setCode
(
skuInfo
.
getCode
());
result
.
setMsg
(
"调用PLM申请回号失败"
);
result
.
setData
(
skuInfo
);
return
result
;
}
}
else
{
result
.
setMsg
(
skuInfo
.
getMsg
());
result
.
setCode
(
skuInfo
.
getCode
());
result
.
setMsg
(
"调用PLM申请回号失败"
);
result
.
setData
(
skuInfo
);
return
result
;
}
}
else
{
result
.
setMsg
(
skuInfo
.
getMsg
());
result
.
setCode
(
skuInfo
.
getCode
());
return
result
;
}
}
}
}
...
...
src/main/resources/mapper/CharacteristicMapper.xml
View file @
3552ea3d
...
...
@@ -122,7 +122,13 @@
</select>
<select
id=
"getNameByCode"
resultType=
"java.lang.String"
>
select characteristic_name from super_characteristic_info where characteristic_code = #{characteristicCode} and is_show = #{isShow}
SELECT characteristic_name
FROM super_characteristic_info a
left join super_table_item_info b on a.characteristic_code = b.characteristic_code
WHERE a.characteristic_code = #{ characteristicCode }
AND is_show = #{ isShow}
and b.group_number = #{groupNumber}
limit 1
</select>
<select
id=
"getCNameByCode"
resultType=
"cn.com.uitech.authorization.pojo.entity.Characteristic"
>
...
...
src/main/resources/mapper/CharacteristicValueMapper.xml
View file @
3552ea3d
...
...
@@ -312,7 +312,5 @@
select * from super_characteristic_value_info
where h3c_c_value = #{h3cVCode}
and super_bom_code = #{h3cPn}
<!--and political_mining_id = #{param3}
and patern = #{param4}-->
</select>
</mapper>
src/main/resources/mapper/CtoBomMapper.xml
View file @
3552ea3d
...
...
@@ -372,4 +372,7 @@
select * from super_bom_sku_info where cpq_config_id = #{cpqConfigId} and super_bom_code = #{superPartNumber}
</select>
<select
id=
"getConfigId"
resultType=
"cn.com.uitech.authorization.pojo.entity.ConfigurableBom"
>
select config_id from super_bom_info where h3c_pn = #{h3cPn}
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapper/SuperTableInfoMapper.xml
View file @
3552ea3d
...
...
@@ -64,9 +64,10 @@
</resultMap>
<select
id=
"findBySuperBomCode"
resultMap=
"baseResultMap"
>
select * from
super_table_info a
left join super_table_item_info b on a.table_number = b.table_number
select * from super_table_info a
left join super_table_item_info b on a.table_number = b.table_number
left join super_characteristic_info c on b.characteristic_code = c.characteristic_code
left join super_characteristic_value_info d on b.characteristic_value_code = d.characteristic_value_code
where a.super_bom_code = #{superBomCode}
order by b.characteristic_code
</select>
...
...
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