Commit 91156b43 by zhaoxiaolei

修改集成逻辑

parent e301f858
......@@ -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());
......
......@@ -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>
......
......@@ -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">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment