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);
}
......
package cn.com.uitech.authorization.service.impl;
import cn.com.uitech.authorization.controller.GetSKUByH3CConfigInfo;
import cn.com.uitech.authorization.exception.BizException;
import cn.com.uitech.authorization.pojo.entity.GetSKUByH3CConfigInfo;
import cn.com.uitech.authorization.exception.BusinessException;
import cn.com.uitech.authorization.mapper.*;
import cn.com.uitech.authorization.pojo.dto.*;
......@@ -14,6 +13,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import javassist.expr.Instanceof;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -28,7 +28,6 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.client.RestTemplate;
import springfox.documentation.spring.web.json.Json;
import java.sql.Timestamp;
import java.util.*;
......@@ -76,6 +75,7 @@ public class IntegrateServiceImpl implements IntegrateService {
configurableBom.setDescription(saveSuperBomInputDto.getDescription());
configurableBom.setModelStatus(saveSuperBomInputDto.getStatusCode());
configurableBom.setProductClassCode(saveSuperBomInputDto.getClassification());
configurableBom.setProductClassName(saveSuperBomInputDto.getClassification());
configurableBom.setUnisSalesName(saveSuperBomInputDto.getScuxItemName());
configurableBom.setBrand(saveSuperBomInputDto.getBrand());
ConfigurableBom getOne = ctoBomMapper.getCtoBomsByCode(configurableBom.getSuperBomCode(), configurableBom.getProductClassName());
......@@ -121,7 +121,7 @@ public class IntegrateServiceImpl implements IntegrateService {
characteristic.setCharacteristicCode(saveSuperCharacterInputDto.getOptionNumber());
characteristic.setCharacteristicName(saveSuperCharacterInputDto.getOptionName());
characteristic.setSuperBomCode(saveSuperCharacterInputDto.getSuperNumber());
characteristic.setIsHidden(0);
characteristic.setIsShow(0);
characteristic.setCharacteristicType("否");
Characteristic getOne = characteristicMapper.selectByCode(characteristic);
if (!ObjectUtils.isEmpty(getOne)) {
......@@ -165,6 +165,8 @@ public class IntegrateServiceImpl implements IntegrateService {
characteristicValue.setZphCode(saveSuperCharacterValueInputDto.getZphCode());
characteristicValue.setZphName(saveSuperCharacterValueInputDto.getZphName());
characteristicValue.setH3cDeliverCode(saveSuperCharacterValueInputDto.getH3cDeliverCode());
characteristicValue.setUnisSalesVName(saveSuperCharacterValueInputDto.getChoiceName());
characteristicValue.setUnisSalesCName(saveSuperCharacterValueInputDto.getOptionNumber());
CharacteristicValue getOne = characteristicValueMapper.selectByCode(characteristicValue);
if (!ObjectUtils.isEmpty(getOne)) {
BeanUtils.copyProperties(characteristicValue, getOne);
......@@ -190,57 +192,69 @@ public class IntegrateServiceImpl implements IntegrateService {
}
@Override
public GetProductOutDto SetSuperTableInfo(SaveTableInputDto saveTableInputDtos) {
public GetProductOutDto SetSuperTableInfo(List<SaveTableInputDto> saveTableInputDtos) {
GetProductOutDto result = new GetProductOutDto();
try {
if (!ObjectUtils.isEmpty(saveTableInputDtos)) {
List<String> superBomCodeList = saveTableInputDtos.getSuperBomCode();
superBomCodeList.forEach(superBomCode->{
SuperTableInfo superTableInfo = new SuperTableInfo();
superTableInfo.setId(sequence.nextId());
superTableInfo.setSuperBomCode(superBomCode);
superTableInfo.setTableNumber(saveTableInputDtos.getTableNumber());
superTableInfo.setTableName(saveTableInputDtos.getTableName());
SuperTableInfo getOne = superTableInfoMapper.getOne(superTableInfo);
if (!ObjectUtils.isEmpty(getOne)) {
BeanUtils.copyProperties(superTableInfo, getOne);
SuperTableInfoLog log = new SuperTableInfoLog();
BeanUtils.copyProperties(getOne, log);
log.setCreateTime(new Timestamp(System.currentTimeMillis()));
log.setCreateBy(SecurityService.getPrincipal().getCode());
superTableInfoMapper.saveLog(log);
superTableInfoMapper.deleteBom(getOne);
superTableInfoMapper.saveBom(getOne);
if (!CollectionUtils.isEmpty(saveTableInputDtos.getTableLists())) {
List<SaveTableInputDto.SuperTableItemDto> tableLists = saveTableInputDtos.getTableLists();
for (SaveTableInputDto.SuperTableItemDto tableItem : tableLists) {
SuperTableItemInfo item = new SuperTableItemInfo();
item.setId(sequence.nextId());
item.setGroupNumber(tableItem.getLineCode());
item.setSuperBomCode(superBomCode);
item.setTableNumber(saveTableInputDtos.getTableNumber());
item.setCharacteristicCode(tableItem.getCharacteristicCode());
item.setCharacteristicValueCode(tableItem.getCharacteristicValueCode());
item.setCreateBy(SecurityService.getPrincipal().getCode());
item.setCreateTime(new Timestamp(System.currentTimeMillis()));
SuperTableItemInfoLog itemLog = new SuperTableItemInfoLog();
BeanUtils.copyProperties(item, itemLog);
superTableInfoItemMapper.saveLog(itemLog);
superTableInfoItemMapper.saveBom(item);
for (SaveTableInputDto saveTableInputDto : saveTableInputDtos) {
if (!ObjectUtils.isEmpty(saveTableInputDtos)) {
List<String> superBomCodeList = saveTableInputDto.getSuperBomCode();
for (String superBomCode : superBomCodeList) {
SuperTableInfo superTableInfo = new SuperTableInfo();
superTableInfo.setId(sequence.nextId());
superTableInfo.setSuperBomCode(superBomCode);
superTableInfo.setTableNumber(saveTableInputDto.getTableNumber());
superTableInfo.setTableName(saveTableInputDto.getTableName());
SuperTableInfo getOne = superTableInfoMapper.getOne(superTableInfo);
if (!ObjectUtils.isEmpty(getOne)) {
BeanUtils.copyProperties(superTableInfo, getOne);
SuperTableInfoLog log = new SuperTableInfoLog();
BeanUtils.copyProperties(getOne, log);
log.setCreateTime(new Timestamp(System.currentTimeMillis()));
log.setCreateBy(SecurityService.getPrincipal().getCode());
superTableInfoMapper.saveLog(log);
superTableInfoMapper.deleteBom(getOne);
superTableInfoMapper.saveBom(getOne);
if (!CollectionUtils.isEmpty(saveTableInputDto.getTableLists())) {
List<SaveTableInputDto.SuperTableItemDto> tableLists = saveTableInputDto.getTableLists();
for (SaveTableInputDto.SuperTableItemDto tableItem : tableLists) {
SuperTableItemInfo item = new SuperTableItemInfo();
item.setId(sequence.nextId());
item.setGroupNumber(tableItem.getLineCode());
item.setSuperBomCode(superBomCode);
item.setTableNumber(saveTableInputDto.getTableNumber());
item.setCharacteristicCode(tableItem.getCharacteristicCode());
item.setCharacteristicValueCode(tableItem.getCharacteristicValueCode());
item.setCreateBy(SecurityService.getPrincipal().getCode());
item.setCreateTime(new Timestamp(System.currentTimeMillis()));
SuperTableItemInfoLog itemLog = new SuperTableItemInfoLog();
BeanUtils.copyProperties(item, itemLog);
superTableInfoItemMapper.saveLog(itemLog);
superTableInfoItemMapper.saveBom(item);
}
}
result.setMsg(ApiResult.SUCCESS.getMsg());
result.setCode(ApiResult.SUCCESS.getCode());
} else {
SuperTableInfoLog log = new SuperTableInfoLog();
BeanUtils.copyProperties(superTableInfo, log);
log.setCreateTime(new Timestamp(System.currentTimeMillis()));
log.setCreateBy(SecurityService.getPrincipal().getCode());
superTableInfoMapper.saveLog(log);
superTableInfoMapper.saveBom(superTableInfo);
result.setMsg(ApiResult.SUCCESS.getMsg());
result.setCode(ApiResult.SUCCESS.getCode());
}
} else {
SuperTableInfoLog log = new SuperTableInfoLog();
BeanUtils.copyProperties(superTableInfo, log);
log.setCreateTime(new Timestamp(System.currentTimeMillis()));
log.setCreateBy(SecurityService.getPrincipal().getCode());
superTableInfoMapper.saveLog(log);
superTableInfoMapper.saveBom(superTableInfo);
}
});
}
}
} catch (Exception e) {
throw new BusinessException(ApiResult.INTERNAL_SERVER_ERROR.getMsg());
result.setMsg(ApiResult.INTERNAL_SERVER_ERROR.getMsg());
result.setCode(ApiResult.INTERNAL_SERVER_ERROR.getCode());
result.setData(new BusinessException());
return result;
}
return result;
}
......@@ -272,19 +286,20 @@ public class IntegrateServiceImpl implements IntegrateService {
}
@Override
public String getCNameByCode(String characteristicCode) {
return characteristicMapper.getCNameByCode(characteristicCode);
public Characteristic getCNameByCode(String characteristicCode,String superBomCode) {
return characteristicMapper.getCNameByCode(characteristicCode,superBomCode);
}
@Override
public Object GetSKUByConfigInfo(SuperBomSkuInfo superBomSkuInfo) {
GetProductOutDto result = new GetProductOutDto();
if (!ObjectUtils.isEmpty(superBomSkuInfo)) {
if (!CollectionUtils.isEmpty(superBomSkuInfo.getCharacteristicList())) {
List<SuperBomSkuConfigInfo> characteristicList = superBomSkuInfo.getCharacteristicList();
Boolean flag = true;
for (SuperBomSkuConfigInfo superBomSkuConfigInfo : characteristicList) {
SuperBomSkuConfigInfo skuConfigInfo = characteristicMapper.checkConfig(superBomSkuConfigInfo.getCharacteristicCode(), superBomSkuConfigInfo.getCharacteristicValueCode(), superBomSkuInfo.getSuperBomCode());
if (!ObjectUtils.isEmpty(skuConfigInfo)) {
SuperBomSkuConfigInfo skuConfigInfo = characteristicMapper.checkConfig(superBomSkuConfigInfo.getCharacteristicCode(), superBomSkuConfigInfo.getCharacteristicValueName(), superBomSkuInfo.getSuperBomCode(), superBomSkuInfo.getPatern(), superBomSkuInfo.getPoliticalMiningId(), superBomSkuInfo.getConfigId(), superBomSkuConfigInfo.getCharacteristicValueCode());
if (ObjectUtils.isEmpty(skuConfigInfo)) {
//撞配不通过 保存SKU信息 调用申请SKU接口 applySkuCode
SuperBomSkuConfigInfo config = new SuperBomSkuConfigInfo();
BeanUtils.copyProperties(superBomSkuConfigInfo, config);
......@@ -297,18 +312,26 @@ public class IntegrateServiceImpl implements IntegrateService {
//调用PLM申请sku号 返回后修改sku数据返回
ApplySkuCodeResultDto applySkuCodeResultDto = applySkuCode(superBomSkuInfo);
if (applySkuCodeResultDto.getCode().equals(200)) {
ApplySkuCodeResultDto.data data = applySkuCodeResultDto.getData();
data.setConfigId(superBomSkuInfo.getConfigId());
data.setMsg("已回号");
characteristicMapper.updateSuperBomSkuInfo(data);
if (applySkuCodeResultDto.getCode().equals(200)) {
ApplySkuCodeResultDto.data data = applySkuCodeResultDto.getData();
data.setConfigId(superBomSkuInfo.getConfigId());
data.setMsg("已回号");
characteristicMapper.updateSuperBomSkuInfo(data);
superBomSkuInfo.setSkuCode(data.getSkuCode());
superBomSkuInfo.setSkuName(data.getSkuName());
} else {
ApplySkuCodeResultDto.data data = applySkuCodeResultDto.getData();
data.setConfigId(superBomSkuInfo.getConfigId());
data.setMsg("未回号");
characteristicMapper.updateSuperBomSkuStatus(data);
superBomSkuInfo.setSkuCode(data.getSkuCode());
superBomSkuInfo.setSkuName(data.getSkuName());
}
} else {
ApplySkuCodeResultDto.data data = applySkuCodeResultDto.getData();
data.setConfigId(superBomSkuInfo.getConfigId());
data.setMsg("未回号");
characteristicMapper.updateSuperBomSkuStatus(data);
result.setMsg(applySkuCodeResultDto.getMsg());
result.setCode(applySkuCodeResultDto.getCode());
return result;
}
} else if (flag) {
return superBomSkuInfo;
}
}
}
......@@ -318,7 +341,30 @@ public class IntegrateServiceImpl implements IntegrateService {
@Override
public Object GetConfigBySUKINFO(SuperBomSkuInfo superBomSkuInfo) {
//撞配
return GetSKUByConfigInfo(superBomSkuInfo);
SuperBomSkuInfo returnSkuInfo = new SuperBomSkuInfo();
GetProductOutDto result = new GetProductOutDto();
Object ob = GetSKUByConfigInfo(superBomSkuInfo);
boolean flag = ob instanceof SuperBomSkuInfo;
if(flag){
returnSkuInfo = (SuperBomSkuInfo)ob;
SuperBomSkuInfo getSkuInfo = superBomSkuInfoMapper.getSkuInfo(returnSkuInfo);
if(ObjectUtils.isEmpty(getSkuInfo)){
result.setCode(ApiResult.INTERNAL_SERVER_ERROR.getCode());
result.setMsg("该配置不存在");
return result;
}
superBomSkuInfo.setSkuCode(getSkuInfo.getSkuCode());
superBomSkuInfo.setSkuName(getSkuInfo.getSkuName());
return superBomSkuInfo;
}else{
GetProductOutDto ss = (GetProductOutDto)ob;
result.setCode(ss.getCode());
result.setMsg(ss.getMsg());
return result;
}
}
/**
......@@ -333,6 +379,12 @@ public class IntegrateServiceImpl implements IntegrateService {
return new PageInfo<>(superBomSkuInfoMapper.querySkuList(superBomSkuInfo));
}
@Override
public Object querySkuOne(String configId) {
return superBomSkuInfoMapper.querySkuOne(configId);
}
/**
* @return Configid, SKUCode,SKUCode,产品型号,产品小型好,69码
......@@ -344,59 +396,68 @@ public class IntegrateServiceImpl implements IntegrateService {
public ApplySkuCodeResultDto applySkuCode(SuperBomSkuInfo superBomSkuInfo) {
ApplySkuCodeResultDto dto = new ApplySkuCodeResultDto();
//调用PLM 申请skuCode
RestTemplate restTemplate = new RestTemplate();
HttpHeaders tokenHeader = getHttpHeaderPlmToken();
HttpEntity<String> tokenRequestEntity = new HttpEntity<>(null, tokenHeader);
ResponseEntity<String> getToken = restTemplate.exchange(plmUrlToken, HttpMethod.GET, tokenRequestEntity, String.class);
String body = getToken.getBody();
Map<String, Object> o = (Map<String, Object>) JSONObject.parse(body);
List item = (List) o.get("items");
Map<String, Object> o1 = (Map<String, Object>) item.get(0);
Map<String, Object> attributes = (Map<String, Object>) o1.get("attributes");
String nonce = (String) attributes.get("nonce");
//封装调用plm接口的数据
ToPLMDto toPLMDto = new ToPLMDto();
toPLMDto.setConfigId(superBomSkuInfo.getConfigId());
toPLMDto.setSpecial(false);
toPLMDto.setSuperNumber(superBomSkuInfo.getSuperBomName());
toPLMDto.setH3cSuperNumber(superBomSkuInfo.getH3cPn());
toPLMDto.setGovernmentId(superBomSkuInfo.getPoliticalMiningId());
toPLMDto.setModel(superBomSkuInfo.getPatern());
toPLMDto.setSpecialDescription(superBomSkuInfo.getDescription());
List<ToPLMDto.OptionChoiceMap> maps = new ArrayList<>();
List<SuperBomSkuConfigInfo> characteristicList = superBomSkuInfo.getCharacteristicList();
if (!CollectionUtils.isEmpty(characteristicList)) {
for (SuperBomSkuConfigInfo superBomSkuConfigInfo : characteristicList) {
ToPLMDto.OptionChoiceMap map = new ToPLMDto.OptionChoiceMap();
map.setSpecial(false);
map.setOption(superBomSkuConfigInfo.getCharacteristicName());
map.setChoice(superBomSkuConfigInfo.getCharacteristicValueName());
map.setSpecialDescription(superBomSkuInfo.getDescription());
maps.add(map);
try {
//调用PLM 申请skuCode
RestTemplate restTemplate = new RestTemplate();
HttpHeaders tokenHeader = getHttpHeaderPlmToken();
HttpEntity<String> tokenRequestEntity = new HttpEntity<>(null, tokenHeader);
ResponseEntity<String> getToken = restTemplate.exchange(plmUrlToken, HttpMethod.GET, tokenRequestEntity, String.class);
String body = getToken.getBody();
Map<String, Object> o = (Map<String, Object>) JSONObject.parse(body);
List item = (List) o.get("items");
Map<String, Object> o1 = (Map<String, Object>) item.get(0);
Map<String, Object> attributes = (Map<String, Object>) o1.get("attributes");
String nonce = (String) attributes.get("nonce");
//封装调用plm接口的数据
ToPLMDto toPLMDto = new ToPLMDto();
toPLMDto.setConfigId(superBomSkuInfo.getConfigId());
toPLMDto.setSpecial(false);
toPLMDto.setSuperNumber(superBomSkuInfo.getSuperBomCode());
toPLMDto.setH3cSuperNumber(superBomSkuInfo.getH3cPn());
toPLMDto.setGovernmentId(superBomSkuInfo.getPoliticalMiningId());
toPLMDto.setModel(superBomSkuInfo.getPatern());
toPLMDto.setSpecialDescription(superBomSkuInfo.getDescription());
List<ToPLMDto.OptionChoiceMap> maps = new ArrayList<>();
List<SuperBomSkuConfigInfo> characteristicList = superBomSkuInfo.getCharacteristicList();
if (!CollectionUtils.isEmpty(characteristicList)) {
for (SuperBomSkuConfigInfo superBomSkuConfigInfo : characteristicList) {
ToPLMDto.OptionChoiceMap map = new ToPLMDto.OptionChoiceMap();
map.setSpecial(false);
map.setOption(superBomSkuConfigInfo.getCharacteristicName());
map.setChoice(superBomSkuConfigInfo.getCharacteristicValueName());
map.setSpecialDescription(superBomSkuInfo.getDescription());
maps.add(map);
}
}
}
toPLMDto.setOptionChoiceMaps(maps);
HttpHeaders headers = getHttpHeaderPlm(nonce);
HttpEntity httpEntity = new HttpEntity<>(JSONObject.toJSON(toPLMDto), headers);
Map<String, Object> map = (Map<String, Object>) restTemplate.exchange(plmUrl, HttpMethod.POST, httpEntity, Object.class).getBody();
Integer code = (Integer) map.get("code");
if (!ObjectUtils.isEmpty(code)) {
if (code.equals(200)) {
Map<String, Object> data = (Map<String, Object>) map.get("data");
ApplySkuCodeResultDto.data data1 = new ApplySkuCodeResultDto.data();
data1.setSkuCode(String.valueOf(data.get("skuNo")));
data1.setSkuName(String.valueOf(data.get("skuName")));
data1.setH3cSuperNumber(String.valueOf(data.get("h3cSuperNumber")));
dto.setMsg(String.valueOf(map.get("messsage")));
dto.setCode(code);
dto.setData(data1);
} else {
dto.setCode(code);
dto.setMsg(String.valueOf(map.get("messsage")));
dto.setData((ApplySkuCodeResultDto.data) map.get("data"));
toPLMDto.setOptionChoiceMaps(maps);
HttpHeaders headers = getHttpHeaderPlm(nonce);
HttpEntity httpEntity = new HttpEntity<>(JSONObject.toJSON(toPLMDto), headers);
Map<String, Object> map = (Map<String, Object>) restTemplate.exchange(plmUrl, HttpMethod.POST, httpEntity, Object.class).getBody();
Integer code = (Integer) map.get("code");
if (!ObjectUtils.isEmpty(code)) {
if (code.equals(200)) {
Map<String, Object> data = (Map<String, Object>) map.get("data");
ApplySkuCodeResultDto.data data1 = new ApplySkuCodeResultDto.data();
data1.setSkuCode(String.valueOf(data.get("skuNo")));
data1.setSkuName(String.valueOf(data.get("skuName")));
data1.setH3cSuperNumber(String.valueOf(data.get("h3cSuperNumber")));
dto.setMsg(String.valueOf(map.get("messsage")));
dto.setCode(code);
dto.setData(data1);
} else {
dto.setCode(code);
dto.setMsg(String.valueOf(map.get("messsage")));
dto.setData((ApplySkuCodeResultDto.data) map.get("data"));
}
}
} catch (Exception e) {
dto.setMsg("该配置在CPQ不存在,调用PLM申请回号失败!");
dto.setCode(500);
return dto;
}
return dto;
}
......@@ -415,9 +476,8 @@ public class IntegrateServiceImpl implements IntegrateService {
configurableBom = characteristicMapper.getSuperBomInfo(Long.valueOf(configId));
} else if (!StringUtils.isEmpty(skuCode)) {
//根据skucode查询 skucode 就是申请回号的code
configurableBom = ctoBomMapper.getSuperBomInfoBySuperBomCode(skuCode);
} else {
String config = ctoBomMapper.getSuperBomInfoBySuperBomCode(skuCode);
configurableBom = characteristicMapper.getSuperBomInfo(Long.valueOf(config));
}
//根据特征值名称获取物料的信息
Map<String, Object> supBomInfoMap = new HashMap<>();
......@@ -442,7 +502,8 @@ public class IntegrateServiceImpl implements IntegrateService {
selectedCharacteristicList.forEach(item -> {
CharacteristicAndValueDto cDto = new CharacteristicAndValueDto();
String characteristicValueName = (String) item.get("characteristicValueName");
CharacteristicValue characteristicValue = characteristicValueMapper.getCharacteristicValueInfoByName(characteristicValueName, finalConfigurableBom.getSuperBomCode());
String characteristicName = (String) item.get("characteristicName");
CharacteristicValue characteristicValue = characteristicValueMapper.getCharacteristicValueInfoByName(characteristicValueName, finalConfigurableBom.getSuperBomCode(), characteristicName);
cDto.setCharacteristicCode(characteristicValue.getCharacteristicCode());
cDto.setCharacteristicName(characteristicValue.getCharacteristicName());
cDto.setUnisSalesCName(characteristicValue.getUnisSalesCName());
......@@ -495,7 +556,6 @@ public class IntegrateServiceImpl implements IntegrateService {
@Override
public Object GetSKUByH3CConfigInfo(GetSKUByH3CConfigInfo configSkuInfo) {
GetProductOutDto result = new GetProductOutDto();
/*
1.使用H3CPN匹配SKU表中SuperBOM
......@@ -503,6 +563,7 @@ public class IntegrateServiceImpl implements IntegrateService {
3.匹配不成功的,先查看配置是否满足VT约束,满足以后调用生成配置接口,获取配置JSON后GetSKUByConfigInfo 找PLM申请SKU
不支持特配,是否特配,默认不是
* */
GetProductOutDto result = new GetProductOutDto();
if (!CollectionUtils.isEmpty(configSkuInfo.getH3CPNList())) {
List<GetSKUByH3CConfigInfo.H3CPNList> h3CPNList = configSkuInfo.getH3CPNList();
......@@ -510,51 +571,87 @@ public class IntegrateServiceImpl implements IntegrateService {
if (!CollectionUtils.isEmpty(cpnList.getSelectedCharacteristicList())) {
List<GetSKUByH3CConfigInfo.KeyValues> selectedCharacteristicList = cpnList.getSelectedCharacteristicList();
for (GetSKUByH3CConfigInfo.KeyValues keyValues : selectedCharacteristicList) {
//SuperBomSkuConfigInfo superBomSkuConfigInfo = superBomSkuInfoMapper.getConfigInfoList(item.getH3cPn(),keyValues.getH3cVCode());
CharacteristicValue characteristicValue = characteristicValueMapper.getCharacteristicValueInfoByCode(keyValues.getH3cVCode(), cpnList.getH3cPn());
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)) {
result.setMsg("CPQ数据验证失败,失败原因:" + keyValues.getH3cVCode() + "关系未维护!");
result.setCode(ApiResult.INTERNAL_SERVER_ERROR.getCode());
return result;
cpnList.setMsg("CPQ数据验证失败,失败原因:" + keyValues.getH3cVCode() + "关系未维护!");
cpnList.setCode(ApiResult.INTERNAL_SERVER_ERROR.getCode());
return configSkuInfo;
} else {
//不为空时校验是否下架
if (characteristicValue.getIsShow() == 0) {
result.setMsg("CPQ数据验证失败,失败原因:" + characteristicValue.getCharacteristicValueCode() + "已下架!");
result.setCode(ApiResult.INTERNAL_SERVER_ERROR.getCode());
return result;
if (characteristicValue.getIsState() == 0) {
cpnList.setMsg("CPQ数据验证失败,失败原因:" + characteristicValue.getCharacteristicValueCode() + "已下架!");
cpnList.setCode(ApiResult.INTERNAL_SERVER_ERROR.getCode());
return configSkuInfo;
}
}
}
//没有下架 撞配 封装 撞配信息
SuperBomSkuInfo superBomSkuInfo = new SuperBomSkuInfo();
List<SuperBomSkuConfigInfo> configs = new ArrayList<>();
SuperBomSkuConfigInfo superBomSkuConfigInfo = new SuperBomSkuConfigInfo();
superBomSkuInfo.setSuperBomCode(cpnList.getH3cPn());
superBomSkuInfo.setConfigId(cpnList.getConfigId());
superBomSkuInfo = superBomSkuInfoMapper.getSkuInfo(superBomSkuInfo);
for (GetSKUByH3CConfigInfo.KeyValues keyValues : selectedCharacteristicList) {
superBomSkuConfigInfo.setCharacteristicValueCode(keyValues.getH3cVCode());
SuperBomSkuConfigInfo superBomSkuConfigInfo = superBomSkuInfoMapper.getConfigInfoList(cpnList.getConfigId(), keyValues.getH3cVCode());
configs.add(superBomSkuConfigInfo);
}
superBomSkuInfo.setCharacteristicList(configs);
//撞配 找PLM申请SKU
SuperBomSkuInfo skuInfo = (SuperBomSkuInfo) GetSKUByConfigInfo(superBomSkuInfo);
if (!ObjectUtils.isEmpty(skuInfo)) {
result.setCode(ApiResult.SUCCESS.getCode());
result.setMsg(ApiResult.SUCCESS.getMsg());
result.setData(skuInfo);
ApplySkuCodeResultDto skuInfo = applySkuCode(superBomSkuInfo);
if (skuInfo.getCode().equals(200)) {
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());
characteristicMapper.updateSuperBomSkuInfo(data);
} else {
ApplySkuCodeResultDto.data data = skuInfo.getData();
data.setConfigId(superBomSkuInfo.getConfigId());
data.setMsg("未回号");
cpnList.setCode(skuInfo.getCode());
cpnList.setMsg(skuInfo.getMsg());
characteristicMapper.updateSuperBomSkuStatus(data);
}
} else {
result.setMsg(skuInfo.getMsg());
result.setCode(skuInfo.getCode());
return result;
}
}
}
}
return result;
return configSkuInfo;
}
@Override
public Object getConfigInfo(GetConfigurationInputDTO getConfigurationInputDTO) {
if (CollectionUtils.isEmpty(getConfigurationInputDTO.getConfigIds())) {
if (!StringUtils.isEmpty(getConfigurationInputDTO.getSkuCode())) {
String configId = superBomSkuInfoMapper.getConfigId(getConfigurationInputDTO.getSkuCode());
List<Long> configIds = new ArrayList<>();
Long aLong = Long.valueOf(configId);
configIds.add(aLong);
getConfigurationInputDTO.setConfigIds(configIds);
} else {
return "请输入skuCode/ConfigId";
}
}
RestTemplate restTemplate = new RestTemplate();
HttpHeaders headers = getHttpHeader();
HttpEntity<String> requestEntity = new HttpEntity<String>(JSON.toJSONString(getConfigurationInputDTO), headers);
ResponseEntity<String> responseEntity = restTemplate.exchange("http://127.0.0.1:8080/api/v1/selector/configurations", HttpMethod.POST, requestEntity, String.class);
ResponseEntity<String> responseEntity = restTemplate.exchange("http://10.0.4.24:8080/api/v1/selector/configurations", HttpMethod.POST, requestEntity, String.class);
JSONObject object = JSONObject.parseObject(responseEntity.getBody());
if (!ObjectUtils.isEmpty(object)) {
Object data = object.get("data");
......
......@@ -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);
}
......
......@@ -3,6 +3,7 @@ package cn.com.uitech.authorization.service.impl;
import cn.com.uitech.authorization.exception.BusinessException;
import cn.com.uitech.authorization.mapper.BasicsPriceInfoMapper;
import cn.com.uitech.authorization.mapper.SuperBomPriceCalculateMapper;
import cn.com.uitech.authorization.pojo.dto.GetProductOutDto;
import cn.com.uitech.authorization.pojo.entity.*;
import cn.com.uitech.authorization.service.BasicsPriceInfoService;
import cn.com.uitech.authorization.service.SuperBomPriceCalculateService;
......@@ -41,66 +42,93 @@ public class SuperBomPriceCalculateServiceImpl implements SuperBomPriceCalculate
* @return
*/
@Override
public SuperBomPriceInfoEntity getPriceByConfigInfo(SuperBomEntity superBomEntity) {
public Object getPriceByConfigInfo(SuperBomEntity superBomEntity) {
// 1、获取cto价格信息
SuperBomPriceInfoEntity superBomPriceInfoEntity = new SuperBomPriceInfoEntity();
GetProductOutDto result = new GetProductOutDto();
// 计算后的成本信息
String bomCodeTemp = superBomEntity.getSuperBomCode();
List<Characteristics> selectedCharacteristicList = superBomEntity.getCharacteristicList();
// 查询各级别价格系数以及定价方法是标准成本还是市场定价
BasicsPriceInfoEntity basicsPriceInfoEntity = basicsPriceInfoMapper.queryBasicsPriceInfo(superBomEntity);
// 成本定价法 使用标准成本价*各级别系数计算
if ("0".equals(basicsPriceInfoEntity.getPriceType())) {
selectedCharacteristicList.forEach(characteristics -> {
SuperBomPriceInfoEntity characteristicBomPriceInfo = getSuperBomPriceInfoEntity(superBomEntity, superBomPriceInfoEntity, characteristics);
if (ObjectUtils.isEmpty(basicsPriceInfoEntity)) {
superBomEntity.setSuperBomCode(null);
basicsPriceInfoEntity = basicsPriceInfoMapper.queryBasicsPriceInfo(superBomEntity);
if (ObjectUtils.isEmpty(basicsPriceInfoEntity)) {
result.setMsg("请维护价格系数");
result.setCode(500);
return result;
}
}
if (!ObjectUtils.isEmpty(basicsPriceInfoEntity)) {
// 成本定价法 使用标准成本价*各级别系数计算
if ("0".equals(basicsPriceInfoEntity.getPriceType())) {
BasicsPriceInfoEntity finalBasicsPriceInfoEntity = basicsPriceInfoEntity;
for (Characteristics characteristics : selectedCharacteristicList) {
superBomEntity.setSuperBomCode(bomCodeTemp);
SuperBomPriceInfoEntity characteristicBomPriceInfo = getSuperBomPriceInfoEntity(superBomEntity, superBomPriceInfoEntity, characteristics);
if (ObjectUtils.isEmpty(characteristicBomPriceInfo)) {
result.setMsg("请维护价格系数");
result.setCode(500);
return result;
}
/*
一级价格调整价
*/
characteristics.setLeve1Price(characteristicBomPriceInfo.getLeve1Price().equals(BigDecimal.ZERO) ? characteristicBomPriceInfo.getLeve0Price().multiply(basicsPriceInfoEntity.getLeve1Ratio()) : characteristicBomPriceInfo.getLeve1Price());
superBomPriceInfoEntity.setLeve1Price(superBomPriceInfoEntity.getLeve1Price().add(characteristics.getLeve1Price()));
characteristics.setLeve1Price(characteristicBomPriceInfo.getLeve1Price().equals(BigDecimal.ZERO) ? characteristicBomPriceInfo.getLeve0Price().multiply(finalBasicsPriceInfoEntity.getLeve1Ratio()) : characteristicBomPriceInfo.getLeve1Price());
superBomPriceInfoEntity.setLeve1Price(superBomPriceInfoEntity.getLeve1Price().add(characteristics.getLeve1Price()));
/*
二级价格调整价
*/
characteristics.setLeve2Price(characteristicBomPriceInfo.getLeve2Price().equals(BigDecimal.ZERO) ? characteristicBomPriceInfo.getLeve0Price().multiply(basicsPriceInfoEntity.getLeve2Ratio()) : characteristicBomPriceInfo.getLeve2Price());
superBomPriceInfoEntity.setLeve2Price(superBomPriceInfoEntity.getLeve2Price().add(characteristics.getLeve2Price()));
characteristics.setLeve2Price(characteristicBomPriceInfo.getLeve2Price().equals(BigDecimal.ZERO) ? characteristicBomPriceInfo.getLeve0Price().multiply(finalBasicsPriceInfoEntity.getLeve2Ratio()) : characteristicBomPriceInfo.getLeve2Price());
superBomPriceInfoEntity.setLeve2Price(superBomPriceInfoEntity.getLeve2Price().add(characteristics.getLeve2Price()));
/*
三级价格调整价
*/
characteristics.setLeve3Price(characteristicBomPriceInfo.getLeve3Price().equals(BigDecimal.ZERO) ? characteristicBomPriceInfo.getLeve0Price().multiply(basicsPriceInfoEntity.getLeve3Ratio()) : characteristicBomPriceInfo.getLeve3Price());
superBomPriceInfoEntity.setLeve3Price(superBomPriceInfoEntity.getLeve3Price().add(characteristics.getLeve3Price()));
characteristics.setLeve3Price(characteristicBomPriceInfo.getLeve3Price().equals(BigDecimal.ZERO) ? characteristicBomPriceInfo.getLeve0Price().multiply(finalBasicsPriceInfoEntity.getLeve3Ratio()) : characteristicBomPriceInfo.getLeve3Price());
superBomPriceInfoEntity.setLeve3Price(superBomPriceInfoEntity.getLeve3Price().add(characteristics.getLeve3Price()));
/*
四级价格调整价
*/
characteristics.setLeve4Price(characteristicBomPriceInfo.getLeve4Price().equals(BigDecimal.ZERO) ? characteristicBomPriceInfo.getLeve0Price().multiply(basicsPriceInfoEntity.getLeve4Ratio()) : characteristicBomPriceInfo.getLeve4Price());
superBomPriceInfoEntity.setLeve4Price(superBomPriceInfoEntity.getLeve4Price().add(characteristics.getLeve4Price()));
});
} else {
// 市场定价法 使用代理价*各级别系数计算
selectedCharacteristicList.forEach(characteristics -> {
// 3、查询特征值价格信息
SuperBomPriceInfoEntity characteristicBomPriceInfo = getSuperBomPriceInfoEntity(superBomEntity, superBomPriceInfoEntity, characteristics);
characteristics.setLeve4Price(characteristicBomPriceInfo.getLeve4Price().equals(BigDecimal.ZERO) ? characteristicBomPriceInfo.getLeve0Price().multiply(finalBasicsPriceInfoEntity.getLeve4Ratio()) : characteristicBomPriceInfo.getLeve4Price());
superBomPriceInfoEntity.setLeve4Price(superBomPriceInfoEntity.getLeve4Price().add(characteristics.getLeve4Price()));
}
} else {
// 市场定价法 使用代理价*各级别系数计算
BasicsPriceInfoEntity finalBasicsPriceInfoEntity1 = basicsPriceInfoEntity;
for (Characteristics characteristics : selectedCharacteristicList) {
superBomEntity.setSuperBomCode(bomCodeTemp);
// 3、查询特征值价格信息
SuperBomPriceInfoEntity characteristicBomPriceInfo = getSuperBomPriceInfoEntity(superBomEntity, superBomPriceInfoEntity, characteristics);
if (ObjectUtils.isEmpty(characteristicBomPriceInfo)) {
result.setMsg("请维护价格系数");
result.setCode(500);
return result;
}
/*
一级价格调整价
*/
characteristics.setLeve1Price(characteristicBomPriceInfo.getLeve1Price().equals(BigDecimal.ZERO) ? characteristicBomPriceInfo.getAgentPrice().multiply(basicsPriceInfoEntity.getLeve1Ratio()) : characteristicBomPriceInfo.getLeve1Price());
superBomPriceInfoEntity.setLeve1Price(superBomPriceInfoEntity.getLeve1Price().add(characteristics.getLeve1Price()));
characteristics.setLeve1Price(characteristicBomPriceInfo.getLeve1Price().equals(BigDecimal.ZERO) ? characteristicBomPriceInfo.getAgentPrice().multiply(finalBasicsPriceInfoEntity1.getLeve1Ratio()) : characteristicBomPriceInfo.getLeve1Price());
superBomPriceInfoEntity.setLeve1Price(superBomPriceInfoEntity.getLeve1Price().add(characteristics.getLeve1Price()));
/*
二级价格调整价
*/
characteristics.setLeve2Price(characteristicBomPriceInfo.getLeve2Price().equals(BigDecimal.ZERO) ? characteristicBomPriceInfo.getAgentPrice().multiply(basicsPriceInfoEntity.getLeve2Ratio()) : characteristicBomPriceInfo.getLeve2Price());
superBomPriceInfoEntity.setLeve2Price(superBomPriceInfoEntity.getLeve2Price().add(characteristics.getLeve2Price()));
characteristics.setLeve2Price(characteristicBomPriceInfo.getLeve2Price().equals(BigDecimal.ZERO) ? characteristicBomPriceInfo.getAgentPrice().multiply(finalBasicsPriceInfoEntity1.getLeve2Ratio()) : characteristicBomPriceInfo.getLeve2Price());
superBomPriceInfoEntity.setLeve2Price(superBomPriceInfoEntity.getLeve2Price().add(characteristics.getLeve2Price()));
/*
三级价格调整价
*/
characteristics.setLeve3Price(characteristicBomPriceInfo.getLeve3Price().equals(BigDecimal.ZERO) ? characteristicBomPriceInfo.getAgentPrice().multiply(basicsPriceInfoEntity.getLeve3Ratio()) : characteristicBomPriceInfo.getLeve3Price());
superBomPriceInfoEntity.setLeve3Price(superBomPriceInfoEntity.getLeve3Price().add(characteristics.getLeve3Price()));
characteristics.setLeve3Price(characteristicBomPriceInfo.getLeve3Price().equals(BigDecimal.ZERO) ? characteristicBomPriceInfo.getAgentPrice().multiply(finalBasicsPriceInfoEntity1.getLeve3Ratio()) : characteristicBomPriceInfo.getLeve3Price());
superBomPriceInfoEntity.setLeve3Price(superBomPriceInfoEntity.getLeve3Price().add(characteristics.getLeve3Price()));
/*
四级价格调整价
*/
characteristics.setLeve4Price(characteristicBomPriceInfo.getLeve4Price().equals(BigDecimal.ZERO) ? characteristicBomPriceInfo.getAgentPrice().multiply(basicsPriceInfoEntity.getLeve4Ratio()) : characteristicBomPriceInfo.getLeve4Price());
superBomPriceInfoEntity.setLeve4Price(superBomPriceInfoEntity.getLeve4Price().add(characteristics.getLeve4Price()));
});
characteristics.setLeve4Price(characteristicBomPriceInfo.getLeve4Price().equals(BigDecimal.ZERO) ? characteristicBomPriceInfo.getAgentPrice().multiply(finalBasicsPriceInfoEntity1.getLeve4Ratio()) : characteristicBomPriceInfo.getLeve4Price());
superBomPriceInfoEntity.setLeve4Price(superBomPriceInfoEntity.getLeve4Price().add(characteristics.getLeve4Price()));
}
}
}
superBomPriceInfoEntity.setSelectedCharacteristicList(selectedCharacteristicList);
return superBomPriceInfoEntity;
}
......@@ -115,22 +143,38 @@ public class SuperBomPriceCalculateServiceImpl implements SuperBomPriceCalculate
*/
private SuperBomPriceInfoEntity getSuperBomPriceInfoEntity(SuperBomEntity superBomEntity, SuperBomPriceInfoEntity superBomPriceInfoEntity, Characteristics characteristics) {
SuperBomPriceInfoEntity characteristicBomPriceInfo = superBomPriceCalculateMapper.getCharacteristicsPriceInfo(superBomEntity.getSuperBomCode(), superBomEntity.getProductClassCode(), characteristics.getCharacteristicValueCode());
// 计算根据系数计算价格
if (ObjectUtils.isEmpty(characteristicBomPriceInfo)) {
characteristics.setCharacteristicValueCode(null);
characteristicBomPriceInfo = superBomPriceCalculateMapper.getCharacteristicsPriceInfo(superBomEntity.getSuperBomCode(), superBomEntity.getProductClassCode(), characteristics.getCharacteristicValueCode());
if (ObjectUtils.isEmpty(characteristicBomPriceInfo)) {
Integer type = 1;
characteristicBomPriceInfo = superBomPriceCalculateMapper.getCharacteristicsPrice(superBomEntity.getSuperBomCode(), type);
if (ObjectUtils.isEmpty(characteristicBomPriceInfo)) {
Integer type2 = 2;
characteristicBomPriceInfo = superBomPriceCalculateMapper.getCharacteristicsPrice(superBomEntity.getSuperBomCode(), type2);
if (ObjectUtils.isEmpty(characteristicBomPriceInfo)) {
return null;
}
}
}
} else {
// 计算根据系数计算价格
/*
标准成本价
*/
characteristics.setLeve0Price(characteristicBomPriceInfo.getLeve0Price());
superBomPriceInfoEntity.setLeve0Price(superBomPriceInfoEntity.getLeve0Price().add(characteristicBomPriceInfo.getLeve0Price()));
characteristics.setLeve0Price(characteristicBomPriceInfo.getLeve0Price());
superBomPriceInfoEntity.setLeve0Price(superBomPriceInfoEntity.getLeve0Price().add(characteristicBomPriceInfo.getLeve0Price()));
/*
真实成本价
*/
characteristics.setActualPrice(characteristicBomPriceInfo.getActualPrice());
superBomPriceInfoEntity.setActualPrice(superBomPriceInfoEntity.getActualPrice().add(characteristicBomPriceInfo.getActualPrice()));
characteristics.setActualPrice(characteristicBomPriceInfo.getActualPrice());
superBomPriceInfoEntity.setActualPrice(superBomPriceInfoEntity.getActualPrice().add(characteristicBomPriceInfo.getActualPrice()));
/*
代理价
*/
characteristics.setAgentPrice(characteristicBomPriceInfo.getAgentPrice());
superBomPriceInfoEntity.setAgentPrice(superBomPriceInfoEntity.getAgentPrice().add(characteristicBomPriceInfo.getAgentPrice()));
characteristics.setAgentPrice(characteristicBomPriceInfo.getAgentPrice());
superBomPriceInfoEntity.setAgentPrice(superBomPriceInfoEntity.getAgentPrice().add(characteristicBomPriceInfo.getAgentPrice()));
}
return characteristicBomPriceInfo;
}
......
......@@ -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