Commit ec5c2953 by zhaoxiaolei

调用PLM

parent 7c751cae
......@@ -3,6 +3,7 @@ package cn.com.uitech.authorization.controller;
import cn.com.uitech.authorization.pojo.entity.BasicsPriceInfoEntity;
import cn.com.uitech.authorization.service.BasicsPriceInfoService;
import cn.com.uitech.authorization.utils.CrmResponseEntity;
import cn.com.uitech.authorization.utils.ResultGenerator;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -36,8 +37,7 @@ public class BasicsPriceInfoController {
*/
@PostMapping("/savePriceCoefficient")
@ApiOperation(value = "保存各级别价格系数", notes = "保存各级别价格系数", httpMethod = "POST")
public CrmResponseEntity<Void> savePriceCoefficient(@RequestBody BasicsPriceInfoEntity basicsPriceInfoEntity) {
basicsPriceInfoService.savePriceCoefficient(basicsPriceInfoEntity);
return new CrmResponseEntity<>();
public CrmResponseEntity<?> savePriceCoefficient(@RequestBody BasicsPriceInfoEntity basicsPriceInfoEntity) {
return ResultGenerator.genSuccessResult(basicsPriceInfoService.savePriceCoefficient(basicsPriceInfoEntity));
}
}
......@@ -21,10 +21,7 @@ package cn.com.uitech.authorization.controller;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
......@@ -65,7 +62,7 @@ public class IntegrateController {
@PostMapping("/SetSuperTableInfo")
@ApiOperation(value = "集成OD约束关系", notes = "SetSuperTableInfo", httpMethod = "POST")
public CrmResponseEntity<?> SetSuperTableInfo(@RequestBody SaveTableInputDto saveTableInputDtos) {
public CrmResponseEntity<?> SetSuperTableInfo(@RequestBody List<SaveTableInputDto> saveTableInputDtos) {
return ResultGenerator.genSuccessResult(integrateService.SetSuperTableInfo(saveTableInputDtos));
}
......@@ -117,7 +114,7 @@ public class IntegrateController {
map.put("constraintCharacteristicName", featureComponentNames);
redisEntity.setData(map);
redisEntities.add(redisEntity);
redisHelper.set(RedisKey.getVariantTableKey(selectorEntity.getSystem(), selectorEntity.getProductClassCode(), selectorEntity.getSuperBomCode()), JSONObject.toJSONString(redisEntities));
redisHelper.set(RedisKey.getVariantTableKey(selectorEntity.getSystem(), selectorEntity.getProductClassCode(), selectorEntity.getSuperBomCode()), JSONObject.toJSONString(redisEntities), 86400);
}
}
......@@ -208,13 +205,17 @@ public class IntegrateController {
if (!CollectionUtils.isEmpty(activeValues)) {
for (PreVerifyOutputDTO.ActiveValuesBean activeValue : activeValues) {
String characteristicName = activeValue.getCharacteristicName();
activeValue.setCharacteristicName(integrateService.getCNameByCode(characteristicName));
List<String> values2 = activeValue.getValues();
for (int i = 0; i < values2.size(); i++) {
String name = integrateService.getName(values2.get(i));
values2.add(name);
values2.remove(i);
Characteristic characteristic = integrateService.getCNameByCode(characteristicName, preVerifyInputDTO.getMaterialCode());
if (!ObjectUtils.isEmpty(characteristic)) {
activeValue.setCharacteristicName(characteristic.getCharacteristicName());
List<String> values2 = activeValue.getValues();
for (int i = 0; i < values2.size(); i++) {
String name = integrateService.getName(values2.get(i));
values2.add(name);
values2.remove(i);
}
}
}
}
}
......@@ -298,4 +299,11 @@ public class IntegrateController {
}
@GetMapping("/querySkuOne/{configId}")
@ApiOperation(value = "查询sku信息One", notes = "querySkuOne", httpMethod = "GET")
public CrmResponseEntity<?> querySkuOne(@PathVariable(value = "configId") String configId) {
return ResultGenerator.genSuccessResult(integrateService.querySkuOne(configId));
}
}
......@@ -63,7 +63,7 @@ public class SuperBomPriceCalculateController {
* @return
*/
@PostMapping("/getPriceByConfigInfo")
public CrmResponseEntity<SuperBomPriceInfoEntity> getPriceByConfigInfo(@RequestBody SuperBomEntity superBomEntity) {
public CrmResponseEntity<Object> getPriceByConfigInfo(@RequestBody SuperBomEntity superBomEntity) {
return ResultGenerator.genSuccessResult(superBomPriceCalculateService.getPriceByConfigInfo(superBomEntity));
}
}
......@@ -24,7 +24,7 @@ public interface BasicsPriceInfoMapper {
* 新增价格系数
* @param basicsPriceInfoEntity
*/
void savePriceCoefficient(BasicsPriceInfoEntity basicsPriceInfoEntity);
Integer savePriceCoefficient(BasicsPriceInfoEntity basicsPriceInfoEntity);
/**
* 查询各个级别价格系数
......
......@@ -69,7 +69,7 @@ public interface CharacteristicMapper extends IBaseMapper<Characteristic>, Inser
String getNameByCode(String characteristicCode,Integer isShow);
String getCNameByCode(String characteristicCode);
Characteristic getCNameByCode(String characteristicCode,String superBomCode);
List<String> getVNameByConfigId(Long configId);
......@@ -79,7 +79,7 @@ public interface CharacteristicMapper extends IBaseMapper<Characteristic>, Inser
Characteristic getCharacteristicInfoByName(String cName,String superBomCode);
SuperBomSkuConfigInfo checkConfig(String characteristicCode, String characteristicValueCode,String superBomCode);
SuperBomSkuConfigInfo checkConfig(String characteristicCode, String characteristicValueName,String superBomCode,String patern,String politicalMiningId,String configId, String characteristicValueCode);
void updateSuperBomSkuInfo(ApplySkuCodeResultDto.data applySkuCodeResultDto);
......
......@@ -100,7 +100,7 @@ public interface CharacteristicValueMapper extends IBaseMapper<CharacteristicVal
String getVNameByCode(String characteristicValueCode);
CharacteristicValue getCharacteristicValueInfoByName(String characteristicValueName,String superBomCode);
CharacteristicValue getCharacteristicValueInfoByName(String characteristicValueName,String superBomCode,String characteristicName);
CharacteristicValue getCharacteristicValueInfoByCode(String h3cVCode, String h3cPn);
CharacteristicValue getCharacteristicValueInfoByCode(String h3cVCode, String h3cPn,String politicalMiningId,String patern);
}
......@@ -23,7 +23,7 @@ public interface CtoBomMapper extends IBaseMapper<ConfigurableBom>
* @param ctoBomRequestParamDto
* @return cto物料集合
*/
List<ConfigurableBomResultDto> getCtoBoms(CtoBomRequestParamDto ctoBomRequestParamDto);
List<ConfigurableBom> getCtoBoms(CtoBomRequestParamDto ctoBomRequestParamDto);
/**
* 根据bomcode修改cto物料
......@@ -102,7 +102,8 @@ public interface CtoBomMapper extends IBaseMapper<ConfigurableBom>
ConfigurableBom getSuperBomInfo(BuildConfigurationInputDTO buildConfigurationInputDTO);
ConfigurableBom getSuperBomInfoBySuperBomCode(String superBomCode);
String getSuperBomInfoBySuperBomCode(String skuCode);
SuperBomSkuInfo getSkuInfo(GetSkuInputInfo getSkuInputInfo);
}
......@@ -44,4 +44,6 @@ public interface SuperBomPriceCalculateMapper {
* @return
*/
List<SuperCharacterPriceInfoEntity> getCharacterValueList(CharacteristicValue characteristicValue);
SuperBomPriceInfoEntity getCharacteristicsPrice(String superBomCode, Integer type);
}
......@@ -14,10 +14,15 @@ public interface SuperBomSkuInfoMapper extends IBaseMapper<SuperBomSkuInfo> {
void saveSkuConfig(SuperBomSkuConfigInfo superBomSkuConfigInfo);
SuperBomSkuConfigInfo getConfigInfoList(String h3cPn,String vCode);
SuperBomSkuConfigInfo getConfigInfoList(String configId,String vCode);
void updateSkuInfo(ApplySkuCodeResultDto applySkuCodeResultDto);
List<SuperBomSkuInfo> querySkuList(SuperBomSkuInfo superBomSkuInfo);
SuperBomSkuInfo querySkuOne(String configId);
SuperBomSkuInfo getSkuInfo(SuperBomSkuInfo returnSkuInfo);
String getConfigId(String skuCode);
}
......@@ -36,6 +36,8 @@ public class PreVerifyInputDTO implements Serializable {
@NotNull
private String operator;
@NotNull
private String token;
@NotNull
private String characteristicValueName;
@NotNull
private String sessionId;
......
......@@ -39,7 +39,7 @@ public class SaveSuperBomInputDto implements Serializable {
@JsonProperty(value = "TYPE")
private String type;
@JsonProperty(value = "STATUS_CODE")
private Integer statusCode;
private String statusCode;
@JsonProperty(value = "CLASSIFICATION")
private String classification;
@JsonProperty(value = "EAN_CODE")
......
......@@ -23,11 +23,11 @@ public class StandardModelManageDto implements Serializable{
/**
* 选配器返回的cto编码
*/
private String bomCode;
private String superBomCode;
/**
* 选配器返回的产品组编码
*/
private String division;
private String productClassCode;
/**
* 选配器返回的userCode
*/
......@@ -35,7 +35,7 @@ public class StandardModelManageDto implements Serializable{
/**
* 选配器返回的configId
*/
private Integer configId;
private String configId;
/**
* 选配器返回的特征/特征值编码数组
*/
......
......@@ -68,7 +68,7 @@ public class ConfigurableBom implements Serializable{
*/
@Column(name = "model_status")
@ApiModelProperty(name = "modelStatus",value = "物料状态",dataType ="String")
private Integer modelStatus;
private String modelStatus;
/**
* CTO类型 1/2
......
package cn.com.uitech.authorization.controller;
package cn.com.uitech.authorization.pojo.entity;
import cn.com.uitech.authorization.pojo.dto.GetConfigSkuInfo;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
......@@ -15,7 +16,13 @@ import java.util.List;
@Setter
@ToString
public class GetSKUByH3CConfigInfo {
@JsonProperty(value = "TOKEN")
private String token;
@JsonProperty(value = "QUOTERID")
private String quoter_id;
@JsonProperty(value = "QUOTERNUMBER")
private String quoter_number;
@JsonProperty(value = "H3CPNLIST")
private List<H3CPNList> h3CPNList;
@Accessors(chain = true)
......@@ -23,10 +30,28 @@ public class GetSKUByH3CConfigInfo {
@Getter
@Setter
@ToString
public class H3CPNList {
public static class H3CPNList {
@JsonProperty(value = "SUBCONFIGID")
private String subConfigId;
@JsonProperty(value = "CONFIGID")
private String configId;
@JsonProperty(value = "CODE")
private Integer code;
@JsonProperty(value = "MSG")
private String msg;
@JsonProperty(value = "H3CID")
private Integer h3cId;
@JsonProperty(value = "H3CPN")
private String h3cPn;
@JsonProperty(value = "SKUCODE")
private String skuCode;
@JsonProperty(value = "SKUNAME")
private String skuName;
@JsonProperty(value = "POLITICALMININGID")
private Integer politicalMiningId;
@JsonProperty(value = "MODEL")
private String patern;
@JsonProperty(value = "SELECTEDCHARACTERISTICLIST")
private List<KeyValues> selectedCharacteristicList;
}
......@@ -36,8 +61,10 @@ public class GetSKUByH3CConfigInfo {
@Getter
@Setter
@ToString
public class KeyValues {
public static class KeyValues {
@JsonProperty(value = "H3CVCODE")
private String h3cVCode;
@JsonProperty(value = "QTY")
private Integer qty;
}
......
......@@ -15,5 +15,5 @@ public interface BasicsPriceInfoService {
* @param basicsPriceInfoEntity
* @return
*/
void savePriceCoefficient(BasicsPriceInfoEntity basicsPriceInfoEntity);
Object savePriceCoefficient(BasicsPriceInfoEntity basicsPriceInfoEntity);
}
......@@ -19,7 +19,7 @@ public interface CtoBomService {
* @param ctoBomRequestParamDto
* @return cto物料集合
*/
PageInfo<ConfigurableBomResultDto> getCtoBoms(CtoBomRequestParamDto ctoBomRequestParamDto);
PageInfo<ConfigurableBom> getCtoBoms(CtoBomRequestParamDto ctoBomRequestParamDto);
/**
* 根据bomcode修改cto物料
......
package cn.com.uitech.authorization.service;
import cn.com.uitech.authorization.controller.GetSKUByH3CConfigInfo;
import cn.com.uitech.authorization.pojo.entity.GetSKUByH3CConfigInfo;
import cn.com.uitech.authorization.pojo.dto.*;
import cn.com.uitech.authorization.pojo.entity.*;
import com.github.pagehelper.PageInfo;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -16,7 +15,7 @@ public interface IntegrateService {
GetProductOutDto setSuperCharacterValueInfo(List<SaveSuperCharacterValueInputDto> saveSuperCharacterValueInputDtos);
GetProductOutDto SetSuperTableInfo(SaveTableInputDto saveTableInputDtos);
GetProductOutDto SetSuperTableInfo(List<SaveTableInputDto> saveTableInputDtos);
ConfigurableBom getOdInfo(SelectorEntity selectorEntity);
......@@ -38,7 +37,7 @@ public interface IntegrateService {
Object saveSukInfo(SuperBomSkuInfo superBomSkuInfo);
String getCNameByCode(String characteristicName);
Characteristic getCNameByCode(String characteristicName,String superBomCode);
Object GetSKUByConfigInfo(SuperBomSkuInfo superBomSkuInfo);
......@@ -46,4 +45,5 @@ public interface IntegrateService {
PageInfo<SuperBomSkuInfo> querySkuList(SuperBomSkuInfo superBomSkuInfo);
Object querySkuOne(String configId);
}
......@@ -17,7 +17,7 @@ public interface SuperBomPriceCalculateService {
* @param superBomEntity
* @return
*/
SuperBomPriceInfoEntity getPriceByConfigInfo(SuperBomEntity superBomEntity);
Object getPriceByConfigInfo(SuperBomEntity superBomEntity);
/**
* 根据条件查询价格系数
......
......@@ -28,10 +28,10 @@ public class BasicsPriceInfoServiceImpl implements BasicsPriceInfoService {
* @return
*/
@Override
public void savePriceCoefficient(BasicsPriceInfoEntity basicsPriceInfoEntity) {
public Object savePriceCoefficient(BasicsPriceInfoEntity basicsPriceInfoEntity) {
// 根据产品类别、品牌和superBom删除价格系数
basicsPriceInfoMapper.deletePriceCoefficient(basicsPriceInfoEntity);
// 新增价格系数
basicsPriceInfoMapper.savePriceCoefficient(basicsPriceInfoEntity);
return basicsPriceInfoMapper.savePriceCoefficient(basicsPriceInfoEntity);
}
}
......@@ -77,9 +77,9 @@ public class CtoBomServiceImpl implements CtoBomService {
* @return cto物料集合
*/
@Override
public PageInfo<ConfigurableBomResultDto> getCtoBoms(CtoBomRequestParamDto ctoBomRequestParamDto) {
public PageInfo<ConfigurableBom> getCtoBoms(CtoBomRequestParamDto ctoBomRequestParamDto) {
PageHelper.startPage(ctoBomRequestParamDto.getPage(), ctoBomRequestParamDto.getPerPage());
List<ConfigurableBomResultDto> ctoBoms = ctoBomMapper.getCtoBoms(ctoBomRequestParamDto);
List<ConfigurableBom> ctoBoms = ctoBomMapper.getCtoBoms(ctoBomRequestParamDto);
return new PageInfo(ctoBoms);
}
......
......@@ -50,9 +50,9 @@ public class StandardModelManageServiceImpl implements StandardModelManageServic
*/
@Override
public StandardModelManageViewDto getStandardModel(StandardModelManageDto standardModelManage) {
String bomCode = standardModelManage.getBomCode();
if(!StringUtils.isNotBlank(bomCode)){
throw new BizException(ApiResult.IS_NOT_NULL,"bomCode信息缺失");
String superBomCode = standardModelManage.getSuperBomCode();
if(!StringUtils.isNotBlank(superBomCode)){
throw new BizException(ApiResult.IS_NOT_NULL,"superBomCode信息缺失");
}
StandardModelManageViewDto standardModelManageDtoDto = new StandardModelManageViewDto();
List<Characteristic> cv = standardModelManageMapper.getStandardModel(standardModelManage);
......@@ -84,7 +84,7 @@ public class StandardModelManageServiceImpl implements StandardModelManageServic
//0715 增加数量级cv更新
if(!CollectionUtils.isEmpty(item.getPairCharacteristicValue())){
item.getPairCharacteristicValue().stream().forEach(itemChildren->{
characteristiValue.add(bulderVCode(itemChildren,dto.getBomCode()));
characteristiValue.add(bulderVCode(itemChildren,dto.getSuperBomCode()));
});
}
});
......@@ -95,7 +95,7 @@ public class StandardModelManageServiceImpl implements StandardModelManageServic
standardModelManageMapper.updateDefaultValueZero(characteristi);
//根据特征值编码把特征值更新为1 默认选中
standardModelManageMapper.updateDefaultValueOne(characteristiValue);
//更新cot的configId
//更新cto的configId
ctoBomMapper.updateConfigId(dto);
}
......
......@@ -17,18 +17,36 @@
<delete id="deletePriceCoefficient">
delete from basics_price_info a
<where>
a.product_class_code = #{productClassCode}
and a.brand = #{brand}
and a.super_bom_code = #{superBomCode}
<if test="productClassCode != null and productClassCode !=''">
a.product_class_code = #{productClassCode}
</if>
<if test="brand != null and brand !=''">
and a.brand = #{brand}
</if>
<if test="superBomCode != null and superBomCode !=''">
and a.super_bom_code = #{superBomCode}
</if>
<if test="superBomCode == null ">
and a.super_bom_code is null
</if>
</where>
</delete>
<select id="queryBasicsPriceInfo"
resultType="cn.com.uitech.authorization.pojo.entity.BasicsPriceInfoEntity">
select * from basics_price_info a
<where>
a.product_class_code = #{productClassCode}
and a.brand = #{brand}
and a.super_bom_code = #{superBomCode}
<if test="productClassCode != null and productClassCode !=''">
a.product_class_code = #{productClassCode}
</if>
<if test="brand != null and brand !=''">
and a.brand = #{brand}
</if>
<if test="superBomCode != null and superBomCode !=''">
and a.super_bom_code = #{superBomCode}
</if>
<if test="superBomCode == null ">
and a.super_bom_code is null
</if>
</where>
</select>
</mapper>
......@@ -7,7 +7,6 @@
FROM super_characteristic_info
LEFT JOIN super_bom_info on super_characteristic_info.super_bom_code=super_bom_info.super_bom_code
<where> 1=1
and super_bom_info.is_state=1
<if test="superBomCode!=null and superBomCode!=''">
and super_bom_info.super_bom_code LIKE CONCAT('%','${superBomCode}','%')
</if>
......@@ -139,8 +138,8 @@
select characteristic_name from super_characteristic_info where characteristic_code = #{characteristicCode} and is_show = #{isShow}
</select>
<select id="getCNameByCode" resultType="java.lang.String">
select characteristic_name from super_characteristic_info where characteristic_code = #{characteristicCode}
<select id="getCNameByCode" resultType="cn.com.uitech.authorization.pojo.entity.Characteristic">
select * from super_characteristic_info where characteristic_code = #{characteristicCode} and super_bom_code = #{superBomCode}
</select>
<select id="getVNameByConfigId" resultType="java.lang.String">
......@@ -153,7 +152,7 @@
<select id="getSuperBomInfo" resultType="cn.com.uitech.authorization.pojo.entity.ConfigurableBom">
select * from super_bom_info a
left join configuration_basis b on a.super_bom_code = b.material_code
LEFT JOIN super_bom_sku_info c ON A.super_bom_code = c.super_bom_code
LEFT JOIN super_bom_sku_info c ON A.super_bom_code = c.super_bom_code and cast(b.config_id as varchar) = c.config_id
left join a_productclasscode d on a.product_class_code = d.product_class_code where b.config_id = #{configId}
</select>
......@@ -167,12 +166,24 @@
<if test="characteristicCode != null and characteristicCode!=''">
characteristic_code = #{characteristicCode}
</if>
<if test="characteristicValueName != null and characteristicValueName!=''">
and characteristic_value_name = #{characteristicValueName}
</if>
<if test="characteristicValueCode != null and characteristicValueCode!=''">
and characteristic_value_code = #{characteristicValueCode}
</if>
<if test="superBomCode != null and superBomCode!=''">
and b.super_bom_code = #{superBomCode}
</if>
<if test="patern != null and patern!=''">
and b.patern = #{patern}
</if>
<if test="politicalMiningId != null and politicalMiningId!=''">
and b.political_mining_id = #{politicalMiningId}
</if>
<if test="configId != null and configId!=''">
and b.config_id = #{configId}
</if>
</where>
......
......@@ -315,11 +315,18 @@
<select id="getCharacteristicValueInfoByName"
resultType="cn.com.uitech.authorization.pojo.entity.CharacteristicValue">
select * from super_characteristic_value_info a
left join super_characteristic_info b on a.characteristic_code = b.characteristic_code where characteristic_value_name = #{characteristicValueName} and a.super_bom_code = #{superBomCode}
left join super_characteristic_info b on a.characteristic_code = b.characteristic_code
where characteristic_value_name = #{characteristicValueName}
and a.super_bom_code = #{superBomCode}
and b.characteristic_name= #{characteristicName}
</select>
<select id="getCharacteristicValueInfoByCode"
resultType="cn.com.uitech.authorization.pojo.entity.CharacteristicValue">
select * from super_characteristic_value_info where characteristic_value_name = #{param1} and super_bom_code = #{param2}
select * from super_characteristic_value_info
where characteristic_value_name = #{h3cVCode}
and super_bom_code = #{h3cPn}
<!--and political_mining_id = #{param3}
and patern = #{param4}-->
</select>
</mapper>
......@@ -2,15 +2,9 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.com.uitech.authorization.mapper.CtoBomMapper">
<select id="getCtoBoms" parameterType="cn.com.uitech.authorization.pojo.dto.CtoBomRequestParamDto"
resultType="cn.com.uitech.authorization.pojo.dto.ConfigurableBomResultDto">
resultType="cn.com.uitech.authorization.pojo.entity.ConfigurableBom">
SELECT
a.super_Bom_Code as superBomCode
,a.super_Bom_Name as superBomName
,a.product_Class_Code as productClassCode
,b.product_Class_Name as productClassName
,unis_Sales_Name as unisSalesName
,is_State as isState
,a.brand
*
,c.name as brandName
FROM super_bom_info a
left join a_productclasscode b on a.product_class_code = b.product_class_code
......@@ -23,7 +17,7 @@
and super_bom_name like CONCAT('%','${superBomName}','%')
</if>
<if test="productClassCode!=null and productClassCode!=''">
and product_class_code like CONCAT('%','${productClassCode}','%')
and a.product_class_code like CONCAT('%','${productClassCode}','%')
</if>
<if test="unisSalesName!=null and unisSalesName!=''">
and unis_sales_name like CONCAT('%','${unisSalesName}','%')
......@@ -209,10 +203,10 @@
<!--根据bomCode更新configId-->
<select id="updateConfigId" parameterType="cn.com.uitech.authorization.pojo.dto.StandardModelManageDto">
UPDATE super_bom_info
SET configId = #{configId}
SET config_Id = #{configId}
<where>
<if test="bomCode!=null and bomCode!=''">
bomcode = #{bomCode}
<if test="superBomCode!=null and superBomCode!=''">
super_bom_code = #{superBomCode}
</if>
</where>
</select>
......@@ -384,11 +378,12 @@
and c.is_state = 1
</select>
<select id="getSuperBomInfoBySuperBomCode" resultMap="superBomInfo">
select * from super_bom_info where super_bom_code = #{superBomCode}
<select id="getSuperBomInfoBySuperBomCode" resultType="String">
select config_id from super_bom_sku_info where sku_code = #{skuCode}
</select>
<select id="getSkuInfo" resultType="cn.com.uitech.authorization.pojo.entity.SuperBomSkuInfo">
select * from super_bom_sku_info where cpq_config_id = #{cpqConfigId} and super_bom_code = #{superPartNumber}
</select>
</mapper>
\ No newline at end of file
......@@ -3,13 +3,12 @@
<mapper namespace="cn.com.uitech.authorization.mapper.StandardModelManageMapper">
<resultMap id="standardModelManageMap" type="cn.com.uitech.authorization.pojo.entity.Characteristic">
<result property="characteristicCode" column="characteristicCode"></result>
<result property="name" column="name"></result>
<result property="description" column="description"></result>
<result property="characterType" column="characterType"></result>
<collection property="characteristicValueDtoList" ofType="cn.com.uitech.authorization.pojo.dto.CharacteristicValueDto">
<result property="characteristicValueCode" column="characteristicValueCode"></result>
<result property="name" column="codeName"></result>
<result property="characteristicCode" column="characteristic_code"></result>
<result property="characteristicName" column="characteristic_name"></result>
<result property="characteristicType" column="characteristic_type"></result>
<collection property="characteristicValueList" ofType="cn.com.uitech.authorization.pojo.dto.CharacteristicValueDto">
<result property="characteristicValueCode" column="characteristic_Value_Code"></result>
<result property="characteristicValueName" column="characteristic_Value_name"></result>
</collection>
</resultMap>
......@@ -17,25 +16,24 @@
<select id="getStandardModel" parameterType="cn.com.uitech.authorization.pojo.dto.StandardModelManageDto" resultMap="standardModelManageMap">
SELECT
characteristic.characteristicCode,
characteristic.name,
characteristic.description,
characteristic.characterType,
characteristicvalue.characteristicValueCode,
characteristicvalue.name as "codeName"
FROM characteristic
LEFT JOIN characteristicvalue
ON characteristicvalue.characteristiccode=characteristic.characteristiccode
WHERE characteristic.bomcode=#{bomCode}
characteristic.characteristic_code,
characteristic.characteristic_name,
characteristic.characteristic_type,
characteristicvalue.characteristic_Value_Code,
characteristicvalue.characteristic_Value_name
FROM super_characteristic_info
LEFT JOIN super_characteristic_value_info
ON characteristicvalue.characteristic_code=characteristic.characteristic_code
WHERE characteristic.super_bom_code=#{superBomCode}
</select>
<!--根据特征编码把所有下面的特征值更新为非默认0-->
<update id="updateDefaultValueOne" parameterType="list">
UPDATE characteristicvalue
SET isdefault=1
UPDATE super_characteristic_value_info
SET is_base = 1
<where>
<if test="list!=null and list.size()>0">
and characteristicValueCode in
and characteristic_Value_Code in
<foreach collection="list" item="item" open="(" separator="," close=")">
#{item}
</foreach>
......@@ -46,11 +44,11 @@
<!--根据特征值编码把所有特征值更新为默认1-->
<update id="updateDefaultValueZero" parameterType="list">
UPDATE characteristicvalue
SET isdefault=0
UPDATE super_characteristic_info
SET is_Show=1
<where>
<if test="list!=null and list.size()>0">
and characteristicCode in
and characteristic_Code in
<foreach collection="list" item="item" open="(" separator="," close=")">
#{item}
</foreach>
......
......@@ -26,6 +26,9 @@
<if test="superBomCode!=null and superBomCode!=''.toString()">
a.super_bom_code = #{superBomCode}
</if>
<if test="superBomCode==null ">
a.super_bom_code is null
</if>
<if test="productClassCode!=null and productClassCode!=''.toString()">
and a.product_class_code = #{productClassCode}
</if>
......@@ -44,7 +47,14 @@
<if test="brand != null and brand !=''.toString()">
and brand =#{brand}
</if>
<if test="superBomCode != null and superBomCode !=''.toString()">
<if test="priceType != null ">
and price_type =#{priceType}
</if>
<if test="superBomCode == null ">
and super_bom_code is null
</if>
<if test="superBomCode != '' and superBomCode != null">
and super_bom_code =#{superBomCode}
</if>
</where>
......@@ -104,4 +114,23 @@
order by a.super_bom_code,b.characteristic_code,c.characteristic_value_code
</select>
<select id="getCharacteristicsPrice" resultType="cn.com.uitech.authorization.pojo.entity.SuperBomPriceInfoEntity">
select c.cv_price_id price_id,actual_price, leve0_price, leve1_price, leve2_price, leve3_price,
leve4_price, agent_price from
basics_price_info a INNER JOIN super_characteristic_info b
on a.super_bom_code = b.super_bom_code
INNER JOIN super_character_price_info c
on a.super_bom_code = c.super_bom_code and b.characteristic_code = c.character_code
<where>
<if test="superBomCode != null and superBomCode != ''.toString()">
a.super_bom_code = #{superBomCode}
</if>
<if test="superBomCode==null ">
and a.super_bom_code is null
</if>
<if test="type !=null">
and a.price_type = #{type}
</if>
</where>
</select>
</mapper>
......@@ -82,10 +82,10 @@
</insert>
<select id="getConfigInfoList" resultType="cn.com.uitech.authorization.pojo.entity.SuperBomSkuConfigInfo">
select * from super_bom_sku_config_info where super_bom_code = #{h3cPn} and characteristic_value_code = #{vCode}
select * from super_bom_sku_config_info where config_id = #{configId} and characteristic_value_name = #{vCode}
</select>
<select id="querySkuList" resultType="cn.com.uitech.authorization.pojo.entity.SuperBomSkuInfo">
select * from super_bom_sku_info a left join super_bom_sku_config_info b on a.config_id = b.config_id
select * from super_bom_sku_info a
<where>
<if test="productClassCode!=null and productClassCode!=''.toString()">
a.product_class_code = #{productClassCode}
......@@ -115,4 +115,54 @@
<update id="updateSkuInfo">
update super_bom_sku_info set sncode = #{sncode},product_type = #{productType} ,product_small_type =#{productSmallType},sku_code = #{skuCode} where config_id = #{configId}
</update>
<resultMap id="SuperBomSkuMap" type="cn.com.uitech.authorization.pojo.entity.SuperBomSkuInfo">
<id property="id" column="id"/>
<result property="productClassCode" column="product_class_code"/>
<result property="productClassName" column="product_class_name"/>
<result property="superBomCode" column="super_bom_code"/>
<result property="superBomName" column="super_bom_name"/>
<result property="brand" column="brand"/>
<result property="h3cPn" column="h3c_pn"/>
<result property="h3cPayNo" column="h3c_pay_no"/>
<result property="politicalMiningId" column="political_mining_id"/>
<result property="patern" column="patern"/>
<result property="unisConfigCode" column="unis_config_code"/>
<result property="productType" column="product_type"/>
<result property="productSmallType" column="product_small_type"/>
<result property="isConfig" column="is_config"/>
<result property="description" column="description"/>
<result property="configId" column="config_id"/>
<result property="sncode" column="sncode"/>
<result property="revision" column="revision"/>
<result property="modelStatus" column="model_status"/>
<result property="applyStatus" column="apply_status"/>
<result property="skuCode" column="sku_code"/>
<result property="skuName" column="sku_name"/>
<collection property="characteristicList" ofType="cn.com.uitech.authorization.pojo.entity.SuperBomSkuConfigInfo">
<id property="id" column="id"/>
<result property="configId" column="config_id"/>
<result property="skuCode" column="sku_code"/>
<result property="characteristicCode" column="characteristic_code"/>
<result property="characteristicName" column="characteristic_name"/>
<result property="h3cCCode" column="h3c_c_code"/>
<result property="unisSalesCName" column="unis_sales_c_name"/>
<result property="characteristicValueCode" column="characteristic_value_code"/>
<result property="characteristicValueName" column="characteristic_value_name"/>
<result property="h3cVValue" column="h3c_v_value"/>
<result property="unisSalesVName" column="unis_sales_v_name"/>
</collection>
</resultMap>
<select id="querySkuOne" resultMap="SuperBomSkuMap">
select * from super_bom_sku_info a left join super_bom_sku_config_info b on a.config_id = b.config_id
where a.config_id = #{configId}
</select>
<select id="getSkuInfo" resultMap="SuperBomSkuMap">
select *from super_bom_sku_info where super_bom_code = #{superBomCode} and config_id = #{configId}
</select>
<select id="getConfigId" resultType="java.lang.String">
select config_id from super_bom_sku_info where sku_code = #{skuCode}
</select>
</mapper>
\ No newline at end of file
......@@ -3,7 +3,7 @@
<mapper namespace="cn.com.uitech.authorization.mapper.SuperTableInfoMapper">
<select id="getOne" resultType="cn.com.uitech.authorization.pojo.entity.SuperTableInfo">
select * from super_table_info where table_number = #{tableNumber}
select * from super_table_info where table_number = #{tableNumber} and table_name = #{tableName} and super_bom_code = #{superBomCode}
</select>
......
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