Commit 7c751cae by zhaoxiaolei

调用PLM

parent c563ea75
package cn.com.uitech.authorization.controller;
import cn.com.uitech.authorization.mapper.SuperTableInfoMapper;
import cn.com.uitech.authorization.pojo.dto.*;
import cn.com.uitech.authorization.pojo.entity.*;
import cn.com.uitech.authorization.service.IntegrateService;
import cn.com.uitech.authorization.utils.CrmResponseEntity;
import cn.com.uitech.authorization.utils.RedisHelper;
import cn.com.uitech.authorization.utils.RedisKey;
import cn.com.uitech.authorization.utils.ResultGenerator;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.util.CollectionUtils;
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.client.RestTemplate;
import cn.com.uitech.authorization.mapper.SuperTableInfoMapper;
import cn.com.uitech.authorization.pojo.dto.*;
import cn.com.uitech.authorization.pojo.entity.*;
import cn.com.uitech.authorization.service.IntegrateService;
import cn.com.uitech.authorization.utils.CrmResponseEntity;
import cn.com.uitech.authorization.utils.RedisHelper;
import cn.com.uitech.authorization.utils.RedisKey;
import cn.com.uitech.authorization.utils.ResultGenerator;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.util.CollectionUtils;
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.client.RestTemplate;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/integrate")
......@@ -46,31 +46,31 @@ public class IntegrateController {
@PostMapping("/setSuperBOMInfo")
@ApiOperation(value = "集成SuperBom", notes = "集成SuperBom", httpMethod = "POST")
@ApiOperation(value = "集成SuperBom", notes = "setSuperBOMInfo", httpMethod = "POST")
public CrmResponseEntity<?> setSuperBOMInfo(@RequestBody List<SaveSuperBomInputDto> saveSuperBomInputDtos) {
return ResultGenerator.genSuccessResult(integrateService.setSuperBOMInfo(saveSuperBomInputDtos));
}
@PostMapping("/setSuperCharacterInfo")
@ApiOperation(value = "集成特征", notes = "集成特征", httpMethod = "POST")
@ApiOperation(value = "集成特征", notes = "setSuperCharacterInfo", httpMethod = "POST")
public CrmResponseEntity<?> setSuperCharacterInfo(@RequestBody List<SaveSuperCharacterInputDto> saveSuperCharacterInputDtos) {
return ResultGenerator.genSuccessResult(integrateService.setSuperCharacterInfo(saveSuperCharacterInputDtos));
}
@PostMapping("/setSuperCharacterValueInfo")
@ApiOperation(value = "集成特征值", notes = "集成特征值", httpMethod = "POST")
@ApiOperation(value = "集成特征值", notes = "setSuperCharacterValueInfo", httpMethod = "POST")
public CrmResponseEntity<?> setSuperCharacterValueInfo(@RequestBody List<SaveSuperCharacterValueInputDto> saveSuperCharacterValueInputDtos) {
return ResultGenerator.genSuccessResult(integrateService.setSuperCharacterValueInfo(saveSuperCharacterValueInputDtos));
}
@PostMapping("/SetSuperTableInfo")
@ApiOperation(value = "集成OD约束关系", notes = "集成OD约束关系", httpMethod = "POST")
@ApiOperation(value = "集成OD约束关系", notes = "SetSuperTableInfo", httpMethod = "POST")
public CrmResponseEntity<?> SetSuperTableInfo(@RequestBody SaveTableInputDto saveTableInputDtos) {
return ResultGenerator.genSuccessResult(integrateService.SetSuperTableInfo(saveTableInputDtos));
}
@PostMapping("/initializationData")
@ApiOperation(value = "initializationData", notes = "选配器初始化接口", httpMethod = "POST")
@ApiOperation(value = "选配器初始化", notes = "initializationData", httpMethod = "POST")
public Object initializationData(@RequestBody SelectorEntity selectorEntity) {
String redis = redisHelper.get(RedisKey.getVariantTableKey(selectorEntity.getSystem(), selectorEntity.getProductClassCode(), selectorEntity.getSuperBomCode()));
if (ObjectUtils.isEmpty(redis)) {
......@@ -192,7 +192,7 @@ public class IntegrateController {
}
@PostMapping("/preVerify")
@ApiOperation(value = "preVerify", notes = "选配器前置验证", httpMethod = "POST")
@ApiOperation(value = "选配器前置验证", notes = "preVerify", httpMethod = "POST")
public Object preVerify(@RequestBody PreVerifyInputDTO preVerifyInputDTO,
Errors errors) {
RestTemplate restTemplate = new RestTemplate();
......@@ -222,7 +222,7 @@ public class IntegrateController {
}
@PostMapping("/postVerify")
@ApiOperation(value = "postVerify", notes = "选配器后置验证", httpMethod = "POST")
@ApiOperation(value = "选配器后置验证", notes = "postVerify", httpMethod = "POST")
public Object preVerify(@RequestBody PostVerifyInputDTO postVerifyInputDTO,
Errors errors) {
RestTemplate restTemplate = new RestTemplate();
......@@ -234,7 +234,7 @@ public class IntegrateController {
}
@PostMapping("/buildConfiguration")
@ApiOperation(value = "buildConfiguration", notes = "生成配置", httpMethod = "POST")
@ApiOperation(value = "生成配置", notes = "buildConfiguration", httpMethod = "POST")
public Object buildConfiguration(@RequestBody BuildConfigurationInputDTO buildConfigurationInputDTO,
Errors errors) {
RestTemplate restTemplate = new RestTemplate();
......@@ -260,42 +260,41 @@ public class IntegrateController {
}
@PostMapping("/getConfigurations")
@ApiOperation(value = "getConfigurations", notes = "根据configId获取配置", httpMethod = "POST")
@ApiOperation(value = "根据configId获取配置", notes = "getConfigurations", httpMethod = "POST")
public Object getConfigurations(@RequestBody GetConfigurationInputDTO getConfigurationInputDTO,
Errors errors) {
return integrateService.getConfigInfo(getConfigurationInputDTO);
}
@PostMapping("/GetConfigBySUKINFO")
@ApiOperation(value = "GetConfigBySUKINFO", notes = "SKU配置接口CRM", httpMethod = "POST")
@ApiOperation(value = "SKU配置接口CRM", notes = "GetConfigBySUKINFO", httpMethod = "POST")
public CrmResponseEntity<?> GetConfigBySUKINFO(@RequestBody SuperBomSkuInfo superBomSkuInfo){
return ResultGenerator.genSuccessResult(integrateService.GetConfigBySUKINFO(superBomSkuInfo));
}
@PostMapping("/GetSKUByConfigInfo")
@ApiOperation(value = "GetSKUByConfigInfo", notes = "撞配", httpMethod = "POST")
@ApiOperation(value = "撞配", notes = "GetSKUByConfigInfo", httpMethod = "POST")
public CrmResponseEntity<?> GetSKUByConfigInfo(@RequestBody SuperBomSkuInfo superBomSkuInfo){
return ResultGenerator.genSuccessResult(integrateService.GetSKUByConfigInfo(superBomSkuInfo));
}
@PostMapping("/GetSKUByH3CConfigInfo")
@ApiOperation(value = "GetSKUByH3CConfigInfo", notes = "SKU配置接口H3C", httpMethod = "POST")
@ApiOperation(value = "SKU配置接口H3C", notes = "GetSKUByH3CConfigInfo", httpMethod = "POST")
public CrmResponseEntity<?> GetSKUByH3CConfigInfo(@RequestBody GetSKUByH3CConfigInfo configSkuInfo){
return ResultGenerator.genSuccessResult(integrateService.GetSKUByH3CConfigInfo(configSkuInfo));
}
@PostMapping("/saveSukInfo")
@ApiOperation(value = "applySukCode", notes = "保存Sku信息CPQ", httpMethod = "POST")
@ApiOperation(value = "保存Sku信息CPQ", notes = "applySukCode", httpMethod = "POST")
public CrmResponseEntity<?> saveSukInfo(@RequestBody SuperBomSkuInfo superBomSkuInfo){
return ResultGenerator.genSuccessResult(integrateService.saveSukInfo(superBomSkuInfo));
}
@PostMapping("/querySkuList")
@ApiOperation(value = "querySkuList", notes = "查询sku信息", httpMethod = "POST")
@ApiOperation(value = "查询sku信息List", notes = "querySkuList", httpMethod = "POST")
public CrmResponseEntity<?> querySkuList(@RequestBody SuperBomSkuInfo superBomSkuInfo){
List<SuperBomSkuInfo> list = integrateService.querySkuList(superBomSkuInfo);
return ResultGenerator.genSuccessResult(list);
return ResultGenerator.genSuccessResult(integrateService.querySkuList(superBomSkuInfo));
}
......
......@@ -81,5 +81,7 @@ public interface CharacteristicMapper extends IBaseMapper<Characteristic>, Inser
SuperBomSkuConfigInfo checkConfig(String characteristicCode, String characteristicValueCode,String superBomCode);
void updateSuperBomSkuInfo(ApplySkuCodeResultDto applySkuCodeResultDto);
void updateSuperBomSkuInfo(ApplySkuCodeResultDto.data applySkuCodeResultDto);
void updateSuperBomSkuStatus(ApplySkuCodeResultDto.data data);
}
......@@ -23,7 +23,7 @@ public interface CtoBomMapper extends IBaseMapper<ConfigurableBom>
* @param ctoBomRequestParamDto
* @return cto物料集合
*/
List<ConfigurableBom> getCtoBoms(CtoBomRequestParamDto ctoBomRequestParamDto);
List<ConfigurableBomResultDto> getCtoBoms(CtoBomRequestParamDto ctoBomRequestParamDto);
/**
* 根据bomcode修改cto物料
......
......@@ -19,4 +19,5 @@ public interface SuperBomSkuInfoMapper extends IBaseMapper<SuperBomSkuInfo> {
void updateSkuInfo(ApplySkuCodeResultDto applySkuCodeResultDto);
List<SuperBomSkuInfo> querySkuList(SuperBomSkuInfo superBomSkuInfo);
}
......@@ -16,11 +16,21 @@ import java.io.Serializable;
@ToString
public class ApplySkuCodeResultDto implements Serializable {
// Configid,SKUCode,SKUCode,产品型号,产品小型好,69码
private String configId;
private String skuCode;
private String productType;
private String productSmallType;
private String sncode;
private data data;
@Accessors(chain = true)
@NoArgsConstructor
@Getter
@Setter
@ToString
public static class data{
private String skuCode;
private String skuName;
private String h3cSuperNumber;
private String configId;
private String msg;
}
private String msg;
private Integer code;
}
package cn.com.uitech.authorization.pojo.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.List;
@Accessors(chain = true)
@NoArgsConstructor
@Getter
@Setter
@ToString
public class ConfigurableBomResultDto implements Serializable{
private static final long serialVersionUID = -4988257241712574537L;
@ApiModelProperty(name = "superBomCode", value = "物料编码", dataType = "String")
private String superBomCode;
@ApiModelProperty(name = "superBomName", value = "cto名字", dataType = "String")
private String superBomName;
@ApiModelProperty(name = "productClassCode", value = "产品组编号", dataType = "String")
private String productClassCode;
@ApiModelProperty(name = "productClassName", value = "产品组编号", dataType = "String")
private String productClassName;
@ApiModelProperty(name = "unisSalesName", value = "Unis销售名称", dataType = "String")
private String unisSalesName;
@ApiModelProperty(name = "isState", value = "是否启用", dataType = "Integer")
private Integer isState;
@ApiModelProperty(name = "brand", value = "品牌", dataType = "String")
private String brand;
@ApiModelProperty(name = "brandName", value = "品牌", dataType = "String")
private String brandName;
}
......@@ -95,6 +95,9 @@ public class ConfigurableBom implements Serializable{
@Column(name = "brand")
@ApiModelProperty(name = "brand", value = "品牌", dataType = "String")
private String brand;
@Transient
@ApiModelProperty(name = "brandName", value = "品牌", dataType = "String")
private String brandName;
private List<Characteristic> characteristicList;
......
package cn.com.uitech.authorization.pojo.entity;
import cn.com.uitech.authorization.pojo.dto.BasePageDto;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
......@@ -17,7 +18,7 @@ import java.util.List;
@Setter
@ToString
@Table(name = "super_bom_sku_info")
public class SuperBomSkuInfo implements Serializable {
public class SuperBomSkuInfo extends BasePageDto implements Serializable {
private static final long serialVersionUID = 1L;
......
package cn.com.uitech.authorization.service;
import cn.com.uitech.authorization.pojo.dto.ComponentCargoDto;
import cn.com.uitech.authorization.pojo.dto.CtoBomDto;
import cn.com.uitech.authorization.pojo.dto.CtoBomRequestParamDto;
import cn.com.uitech.authorization.pojo.dto.IndustryDto;
import cn.com.uitech.authorization.pojo.dto.*;
import cn.com.uitech.authorization.pojo.entity.BomStatusEntity;
import cn.com.uitech.authorization.pojo.entity.ConfigurableBom;
import com.github.pagehelper.PageInfo;
......@@ -22,7 +19,7 @@ public interface CtoBomService {
* @param ctoBomRequestParamDto
* @return cto物料集合
*/
PageInfo<ConfigurableBom> getCtoBoms(CtoBomRequestParamDto ctoBomRequestParamDto);
PageInfo<ConfigurableBomResultDto> getCtoBoms(CtoBomRequestParamDto ctoBomRequestParamDto);
/**
* 根据bomcode修改cto物料
......
......@@ -3,6 +3,7 @@ package cn.com.uitech.authorization.service;
import cn.com.uitech.authorization.controller.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;
......@@ -43,5 +44,6 @@ public interface IntegrateService {
Object GetConfigBySUKINFO(SuperBomSkuInfo superBomSkuInfo);
List<SuperBomSkuInfo> querySkuList(SuperBomSkuInfo superBomSkuInfo);
PageInfo<SuperBomSkuInfo> querySkuList(SuperBomSkuInfo superBomSkuInfo);
}
......@@ -6,6 +6,7 @@ import cn.com.uitech.authorization.mapper.CtoBomMapper;
import cn.com.uitech.authorization.mapper.PricecalexpressionMapper;
import cn.com.uitech.authorization.mapper.ProductDescriptionMapper;
import cn.com.uitech.authorization.pojo.dto.ComponentCargoDto;
import cn.com.uitech.authorization.pojo.dto.ConfigurableBomResultDto;
import cn.com.uitech.authorization.pojo.dto.CtoBomRequestParamDto;
import cn.com.uitech.authorization.pojo.entity.BomStatusEntity;
import cn.com.uitech.authorization.pojo.entity.ConfigurableBom;
......@@ -76,9 +77,9 @@ public class CtoBomServiceImpl implements CtoBomService {
* @return cto物料集合
*/
@Override
public PageInfo<ConfigurableBom> getCtoBoms(CtoBomRequestParamDto ctoBomRequestParamDto) {
public PageInfo<ConfigurableBomResultDto> getCtoBoms(CtoBomRequestParamDto ctoBomRequestParamDto) {
PageHelper.startPage(ctoBomRequestParamDto.getPage(), ctoBomRequestParamDto.getPerPage());
List<ConfigurableBom> ctoBoms = ctoBomMapper.getCtoBoms(ctoBomRequestParamDto);
List<ConfigurableBomResultDto> ctoBoms = ctoBomMapper.getCtoBoms(ctoBomRequestParamDto);
return new PageInfo(ctoBoms);
}
......
......@@ -12,6 +12,8 @@ import cn.com.uitech.authorization.utils.ApiResult;
import cn.com.uitech.authorization.utils.Sequence;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -26,12 +28,10 @@ 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.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
@Service
......@@ -291,14 +291,22 @@ public class IntegrateServiceImpl implements IntegrateService {
config.setId(sequence.nextId());
superBomSkuInfoMapper.saveSkuConfig(config);
flag = false;
} else {
return superBomSkuInfo;
}
}
if (flag.equals(false)) {
//调用PLM申请sku号 返回后修改sku数据返回
ApplySkuCodeResultDto applySkuCodeResultDto = applySkuCode(superBomSkuInfo);
characteristicMapper.updateSuperBomSkuInfo(applySkuCodeResultDto);
if (applySkuCodeResultDto.getCode().equals(200)) {
ApplySkuCodeResultDto.data data = applySkuCodeResultDto.getData();
data.setConfigId(superBomSkuInfo.getConfigId());
data.setMsg("已回号");
characteristicMapper.updateSuperBomSkuInfo(data);
} else {
ApplySkuCodeResultDto.data data = applySkuCodeResultDto.getData();
data.setConfigId(superBomSkuInfo.getConfigId());
data.setMsg("未回号");
characteristicMapper.updateSuperBomSkuStatus(data);
}
} else if (flag) {
return superBomSkuInfo;
}
......@@ -320,10 +328,12 @@ public class IntegrateServiceImpl implements IntegrateService {
* @return
*/
@Override
public List<SuperBomSkuInfo> querySkuList(SuperBomSkuInfo superBomSkuInfo) {
return superBomSkuInfoMapper.querySkuList(superBomSkuInfo);
public PageInfo<SuperBomSkuInfo> querySkuList(SuperBomSkuInfo superBomSkuInfo) {
PageHelper.startPage(superBomSkuInfo.getPage(), superBomSkuInfo.getPerPage());
return new PageInfo<>(superBomSkuInfoMapper.querySkuList(superBomSkuInfo));
}
/**
* @return Configid, SKUCode,SKUCode,产品型号,产品小型好,69码
* @Author 赵晓雷
......@@ -331,6 +341,7 @@ public class IntegrateServiceImpl implements IntegrateService {
* @Date 2021/11/29 15:01
* @Param 选配器出参+申请SKU参数,是否政采,模式
**/
public ApplySkuCodeResultDto applySkuCode(SuperBomSkuInfo superBomSkuInfo) {
ApplySkuCodeResultDto dto = new ApplySkuCodeResultDto();
//调用PLM 申请skuCode
......@@ -368,15 +379,25 @@ public class IntegrateServiceImpl implements IntegrateService {
}
toPLMDto.setOptionChoiceMaps(maps);
HttpHeaders headers = getHttpHeaderPlm(nonce);
HttpEntity<Object> requestEntity = new HttpEntity<>(JSON.toJSON(toPLMDto), headers);
Object o2 = restTemplate.exchange(plmUrl, HttpMethod.POST, requestEntity, Object.class);
/*JSONObject object = JSONObject.parseObject(responseEntity.toString());
object.get("data");
dto.setConfigId("ConfigId");
dto.setProductSmallType("产品小型号");
dto.setProductType("产品型号");
dto.setSkuCode("SkuCode");
dto.setSncode("69码");*/
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"));
}
}
return dto;
}
......@@ -561,11 +582,24 @@ public class IntegrateServiceImpl implements IntegrateService {
//保存完成后申请SKU 调用PLM申请SKU编号
ApplySkuCodeResultDto applySkuCodeResultDto = applySkuCode(superBomSkuInfo);
//根据 ConfigId 修改 产品小型号 产品型号 SkuCode 69码
if (!ObjectUtils.isEmpty(applySkuCodeResultDto)) {
superBomSkuInfoMapper.updateSkuInfo(applySkuCodeResultDto);
if (applySkuCodeResultDto.getCode().equals(200)) {
ApplySkuCodeResultDto.data data = applySkuCodeResultDto.getData();
data.setConfigId(superBomSkuInfo.getConfigId());
data.setMsg("已回号");
characteristicMapper.updateSuperBomSkuInfo(data);
result.setCode(applySkuCodeResultDto.getCode());
result.setMsg(applySkuCodeResultDto.getMsg());
} else {
ApplySkuCodeResultDto.data data = applySkuCodeResultDto.getData();
data.setConfigId(superBomSkuInfo.getConfigId());
data.setMsg("未回号");
characteristicMapper.updateSuperBomSkuStatus(data);
result.setCode(applySkuCodeResultDto.getCode());
result.setMsg(applySkuCodeResultDto.getMsg());
result.setData(applySkuCodeResultDto);
return result;
}
result.setCode(ApiResult.SUCCESS.getCode());
result.setMsg(ApiResult.SUCCESS.getMsg());
} catch (Exception e) {
new BusinessException(ApiResult.INTERNAL_SERVER_ERROR.getMsg());
}
......@@ -583,6 +617,7 @@ public class IntegrateServiceImpl implements IntegrateService {
headers.add("Content-Type", "application/json");
headers.add("Authorization", headerAuthorization);
headers.add("CSRF_NONCE", headerTokenMsg);
//headers.add("Expect", "100-continue");
return headers;
}
......
......@@ -179,6 +179,10 @@
</select>
<update id="updateSuperBomSkuInfo">
update super_bom_sku_info where sku_code = #{skuCode},sncode = #{sncode},product_type = #{productType},product_small_type = #{productSmallType} where config_id = #{configId}
update super_bom_sku_info set sku_code = #{skuCode},sku_name = #{skuName},apply_status = #{msg} where config_id = #{configId}
</update>
<update id="updateSuperBomSkuStatus">
update super_bom_sku_info set msg = #{msg} where config_id = #{configId}
</update>
</mapper>
......@@ -2,9 +2,19 @@
<!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.entity.ConfigurableBom">
SELECT *
FROM super_bom_info
resultType="cn.com.uitech.authorization.pojo.dto.ConfigurableBomResultDto">
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
left join brand c on c.code = a.brand
<where>
<if test="superBomCode!=null and superBomCode!=''">
super_bom_code like CONCAT('%','${superBomCode}','%')
......
......@@ -85,7 +85,7 @@
select * from super_bom_sku_config_info where super_bom_code = #{h3cPn} and characteristic_value_code = #{vCode}
</select>
<select id="querySkuList" resultType="cn.com.uitech.authorization.pojo.entity.SuperBomSkuInfo">
select * from super_bom_sku_info a
select * from super_bom_sku_info a left join super_bom_sku_config_info b on a.config_id = b.config_id
<where>
<if test="productClassCode!=null and productClassCode!=''.toString()">
a.product_class_code = #{productClassCode}
......
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