Commit ec5c2953 by zhaoxiaolei

调用PLM

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