Commit 9580042c by zhaoxiaolei

调用PLM 成功

parent abf6f689
...@@ -98,7 +98,7 @@ public class IntegrateController { ...@@ -98,7 +98,7 @@ public class IntegrateController {
characteristicValue.put("characteristicName", cName); characteristicValue.put("characteristicName", cName);
String characteristicValueCode = itemInfo.getCharacteristicValueCode(); String characteristicValueCode = itemInfo.getCharacteristicValueCode();
if (!StringUtils.isEmpty(characteristicValueCode)) { if (!StringUtils.isEmpty(characteristicValueCode)) {
String vName = integrateService.getVNameByCode(characteristicValueCode); String vName = integrateService.getVNameByCode(characteristicValueCode,characteristicCode);
values.add(vName); values.add(vName);
} }
featureComponentNames.add(cName); featureComponentNames.add(cName);
...@@ -167,7 +167,7 @@ public class IntegrateController { ...@@ -167,7 +167,7 @@ public class IntegrateController {
String characteristicName = (String) item.get("characteristicName"); String characteristicName = (String) item.get("characteristicName");
Characteristic characteristic = integrateService.findByCharacteristicName(characteristicName, selectorEntity.getSuperBomCode()); Characteristic characteristic = integrateService.findByCharacteristicName(characteristicName, selectorEntity.getSuperBomCode());
String characteristicValueName = (String) item.get("characteristicValueName"); String characteristicValueName = (String) item.get("characteristicValueName");
CharacteristicValue characteristicValue = integrateService.findByCharacteristicValueName(characteristicValueName, selectorEntity.getSuperBomCode()); CharacteristicValue characteristicValue = integrateService.findByCharacteristicValueName(characteristic.getCharacteristicCode(),characteristicValueName, selectorEntity.getSuperBomCode());
selectedValue.put("characteristicCode", characteristic.getCharacteristicCode()); selectedValue.put("characteristicCode", characteristic.getCharacteristicCode());
selectedValue.put("characteristicName", characteristic.getCharacteristicName()); selectedValue.put("characteristicName", characteristic.getCharacteristicName());
selectedValue.put("characteristicValueCode", characteristicValue.getCharacteristicValueCode()); selectedValue.put("characteristicValueCode", characteristicValue.getCharacteristicValueCode());
...@@ -305,5 +305,11 @@ public class IntegrateController { ...@@ -305,5 +305,11 @@ public class IntegrateController {
return ResultGenerator.genSuccessResult(integrateService.querySkuOne(configId)); return ResultGenerator.genSuccessResult(integrateService.querySkuOne(configId));
} }
@PostMapping("/getToken")
@ApiOperation(value = "获取token", notes = "getToken", httpMethod = "POST")
public CrmResponseEntity<?> getToken(@RequestBody UserInfo userinfo) {
return ResultGenerator.genSuccessResult(integrateService.getToken(userinfo));
}
} }
...@@ -84,4 +84,6 @@ public interface CharacteristicMapper extends IBaseMapper<Characteristic>, Inser ...@@ -84,4 +84,6 @@ public interface CharacteristicMapper extends IBaseMapper<Characteristic>, Inser
void updateSuperBomSkuInfo(ApplySkuCodeResultDto.data applySkuCodeResultDto); void updateSuperBomSkuInfo(ApplySkuCodeResultDto.data applySkuCodeResultDto);
void updateSuperBomSkuStatus(ApplySkuCodeResultDto.data data); void updateSuperBomSkuStatus(ApplySkuCodeResultDto.data data);
void updateSuperBomSku(SuperBomSkuInfo superBomSkuInfo);
} }
...@@ -94,11 +94,11 @@ public interface CharacteristicValueMapper extends IBaseMapper<CharacteristicVal ...@@ -94,11 +94,11 @@ public interface CharacteristicValueMapper extends IBaseMapper<CharacteristicVal
void saveBom(CharacteristicValue characteristicValue); void saveBom(CharacteristicValue characteristicValue);
CharacteristicValue findByCharacteristicValueName(String characteristicValueName,String superBomCode); CharacteristicValue findByCharacteristicValueName(String characteristicName,String characteristicValueName,String superBomCode);
String getName(Object v); String getName(Object v);
String getVNameByCode(String characteristicValueCode); String getVNameByCode(String characteristicValueCode,String characteristicCode);
CharacteristicValue getCharacteristicValueInfoByName(String characteristicValueName,String superBomCode,String characteristicName); CharacteristicValue getCharacteristicValueInfoByName(String characteristicValueName,String superBomCode,String characteristicName);
......
...@@ -12,4 +12,6 @@ public interface SuperTableInfoItemMapper extends IBaseMapper<SuperTableItemInfo ...@@ -12,4 +12,6 @@ public interface SuperTableInfoItemMapper extends IBaseMapper<SuperTableItemInfo
void saveBom(SuperTableItemInfo item); void saveBom(SuperTableItemInfo item);
SuperTableItemInfo getOne(SuperTableItemInfo item); SuperTableItemInfo getOne(SuperTableItemInfo item);
void deleteItemBom(String tableNumber,String superBomCode);
} }
package cn.com.uitech.authorization.mapper;
import cn.com.uitech.authorization.pojo.entity.UserInfo;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface UserInfoMapper extends IBaseMapper<UserInfo> {
UserInfo getUser(UserInfo userinfo);
}
...@@ -46,7 +46,7 @@ public class CtoBomRequestParamDto extends BasePageDto implements Serializable{ ...@@ -46,7 +46,7 @@ public class CtoBomRequestParamDto extends BasePageDto implements Serializable{
@ApiModelProperty(name = "description",value = "描述",dataType ="String") @ApiModelProperty(name = "description",value = "描述",dataType ="String")
private String description; private String description;
@ApiModelProperty(name = "modelStatus",value = "状态",dataType ="String") @ApiModelProperty(name = "modelStatus",value = "状态",dataType ="String")
private Integer modelStatus; private String modelStatus;
@ApiModelProperty(name = "type",value = "类型",dataType ="String") @ApiModelProperty(name = "type",value = "类型",dataType ="String")
private String type; private String type;
@ApiModelProperty(name = "productClassCode",value = "产品组",dataType ="String") @ApiModelProperty(name = "productClassCode",value = "产品组",dataType ="String")
......
package cn.com.uitech.authorization.pojo.entity;
import io.swagger.annotations.ApiModel;
import lombok.*;
import lombok.experimental.Accessors;
import javax.persistence.Column;
import javax.persistence.Table;
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@ToString
@Table(name = "user_info")
@Builder
@ApiModel("user_info")
public class UserInfo {
@Column(name = "user_code")
private String userCode;
@Column(name = "pass_word")
private String password;
@Column(name = "user_name")
private String userName;
}
...@@ -21,13 +21,13 @@ public interface IntegrateService { ...@@ -21,13 +21,13 @@ public interface IntegrateService {
Characteristic findByCharacteristicName(String characteristicName,String superBomCode); Characteristic findByCharacteristicName(String characteristicName,String superBomCode);
CharacteristicValue findByCharacteristicValueName(String characteristicValueName,String superBomCode); CharacteristicValue findByCharacteristicValueName(String characteristicName,String characteristicValueName,String superBomCode);
String getName(Object v); String getName(Object v);
String getNameByCode(String characteristicCode,Integer isShow); String getNameByCode(String characteristicCode,Integer isShow);
String getVNameByCode(String characteristicValueCode); String getVNameByCode(String characteristicValueCode,String characteristicCode);
Object getSuperBomInfoByConfigId(Map<String, Object> map); Object getSuperBomInfoByConfigId(Map<String, Object> map);
...@@ -46,4 +46,6 @@ public interface IntegrateService { ...@@ -46,4 +46,6 @@ public interface IntegrateService {
PageInfo<SuperBomSkuInfo> querySkuList(SuperBomSkuInfo superBomSkuInfo); PageInfo<SuperBomSkuInfo> querySkuList(SuperBomSkuInfo superBomSkuInfo);
Object querySkuOne(String configId); Object querySkuOne(String configId);
Object getToken(UserInfo userinfo);
} }
...@@ -13,6 +13,7 @@ import cn.com.uitech.authorization.pojo.dto.CharacteristicValueRequestParamDto; ...@@ -13,6 +13,7 @@ import cn.com.uitech.authorization.pojo.dto.CharacteristicValueRequestParamDto;
import cn.com.uitech.authorization.pojo.dto.ComponentCargoDto; import cn.com.uitech.authorization.pojo.dto.ComponentCargoDto;
import cn.com.uitech.authorization.pojo.dto.ConsultationConfigurationAndPriceDto; import cn.com.uitech.authorization.pojo.dto.ConsultationConfigurationAndPriceDto;
import cn.com.uitech.authorization.pojo.entity.CharacteristicValue; import cn.com.uitech.authorization.pojo.entity.CharacteristicValue;
import cn.com.uitech.authorization.pojo.entity.GetSKUByH3CConfigInfo;
import cn.com.uitech.authorization.pojo.entity.OdRelation; import cn.com.uitech.authorization.pojo.entity.OdRelation;
import cn.com.uitech.authorization.service.CharacteristicValueService; import cn.com.uitech.authorization.service.CharacteristicValueService;
import cn.com.uitech.authorization.service.CtoBomService; import cn.com.uitech.authorization.service.CtoBomService;
...@@ -152,7 +153,8 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic ...@@ -152,7 +153,8 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic
*/ */
@Override @Override
public Integer editCharacteristicValue(CharacteristicValue dto) { public Integer editCharacteristicValue(CharacteristicValue dto) {
GetSKUByH3CConfigInfo getSKUByH3CConfigInfo = new GetSKUByH3CConfigInfo();
//getSKUByH3CConfigInfo.setH3CPNList()
return characteristicValueMapper.editCharacteristicValue(dto); return characteristicValueMapper.editCharacteristicValue(dto);
} }
......
package cn.com.uitech.authorization.utils;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class MD5Util {
public static String getMD5Str(String str) {
byte[] digest = null;
try {
MessageDigest md5 = MessageDigest.getInstance("md5");
digest = md5.digest(str.getBytes("utf-8"));
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
//16是表示转换为16进制数
String md5Str = new BigInteger(1, digest).toString(16);
return md5Str;
}
}
\ No newline at end of file
...@@ -24,28 +24,14 @@ ...@@ -24,28 +24,14 @@
<update id="updateCharacteristic" parameterType="cn.com.uitech.authorization.pojo.dto.CharacteristicRequestParamDto" > <update id="updateCharacteristic" parameterType="cn.com.uitech.authorization.pojo.dto.CharacteristicRequestParamDto" >
update super_characteristic_info update super_characteristic_info
<set> set
<if test="characteristicName!=null and characteristicName!=''">
characteristic_name =#{characteristicName}, characteristic_name =#{characteristicName},
</if>
<if test="unisSalesCName!=null and unisSalesCName!=''">
unis_Sales_C_Name =#{unisSalesCName}, unis_Sales_C_Name =#{unisSalesCName},
</if>
<if test="characteristicType!=null and characteristicType!=''">
characteristic_type =#{characteristicType}, characteristic_type =#{characteristicType},
</if>
<if test="H3CCCode!=null and H3CCCode!=''">
h3c_c_code =#{H3CCCode}, h3c_c_code =#{H3CCCode},
</if>
<if test="isHidden!=null ">
is_hidden =#{isHidden} is_hidden =#{isHidden}
</if> where
</set>
<where>
<if test="characteristicCode!=null and characteristicCode!=''">
Characteristic_Code=#{characteristicCode} Characteristic_Code=#{characteristicCode}
</if>
</where>
</update> </update>
<update id="updateVisibleType" parameterType="cn.com.uitech.authorization.pojo.dto.CharacteristicRequestParamDto"> <update id="updateVisibleType" parameterType="cn.com.uitech.authorization.pojo.dto.CharacteristicRequestParamDto">
...@@ -194,7 +180,7 @@ ...@@ -194,7 +180,7 @@
sku_code = #{skuCode}, sku_code = #{skuCode},
sku_name = #{skuName}, sku_name = #{skuName},
apply_status = #{msg}, apply_status = #{msg},
sn_code = #{snCode}, sncode = #{snCode},
description = #{description}, description = #{description},
product_type =#{productType}, product_type =#{productType},
product_small_type =#{productSmallType} product_small_type =#{productSmallType}
...@@ -204,4 +190,8 @@ ...@@ -204,4 +190,8 @@
<update id="updateSuperBomSkuStatus"> <update id="updateSuperBomSkuStatus">
update super_bom_sku_info set msg = #{msg} where config_id = #{configId} update super_bom_sku_info set msg = #{msg} where config_id = #{configId}
</update> </update>
<update id="updateSuperBomSku">
update super_bom_sku_info set apply_status = #{description} where config_id = #{configId}
</update>
</mapper> </mapper>
...@@ -65,32 +65,15 @@ ...@@ -65,32 +65,15 @@
<update id="editCharacteristicValue" parameterType="cn.com.uitech.authorization.pojo.entity.CharacteristicValue"> <update id="editCharacteristicValue" parameterType="cn.com.uitech.authorization.pojo.entity.CharacteristicValue">
UPDATE super_characteristic_value_info UPDATE super_characteristic_value_info
<set> set
<if test="characteristicValueName!=null and characteristicValueName!=''">
characteristic_Value_name=#{characteristicValueName}, characteristic_Value_name=#{characteristicValueName},
</if>
<if test="isState!=null">
is_state=#{isState}, is_state=#{isState},
</if>
<if test="isShow!=null">
is_Show=#{isShow}, is_Show=#{isShow},
</if>
<if test="zphCode!=null and zphCode!=''">
zph_code=#{zphCode}, zph_code=#{zphCode},
</if>
<if test="zphName!=null and zphName!=''">
zph_name=#{zphName}, zph_name=#{zphName},
</if>
<if test="qualifyDate!=null">
qualify_date=#{qualifyDate}, qualify_date=#{qualifyDate},
</if>
<if test="unisSalesVName!=null and unisSalesVName!=''">
unis_sales_v_name=#{unisSalesVName}, unis_sales_v_name=#{unisSalesVName},
</if> h3c_c_value=#{h3cCValue}
<if test="h3cCValue!=null and h3cCValue!=''">
h3c_c_value=#{h3cCValue},
</if>
</set>
<where> <where>
<if test="characteristicValueCode!=null and characteristicValueCode.length>0"> <if test="characteristicValueCode!=null and characteristicValueCode.length>0">
Characteristic_Value_Code=#{characteristicValueCode} Characteristic_Value_Code=#{characteristicValueCode}
...@@ -232,7 +215,7 @@ ...@@ -232,7 +215,7 @@
</select> </select>
<select id="selectByCode" resultType="cn.com.uitech.authorization.pojo.entity.CharacteristicValue"> <select id="selectByCode" resultType="cn.com.uitech.authorization.pojo.entity.CharacteristicValue">
select * from super_characteristic_value_info where Characteristic_Value_Code=#{characteristicValueCode} select * from super_characteristic_value_info where Characteristic_Value_Code=#{characteristicValueCode} and Characteristic_Code = #{characteristicCode}
</select> </select>
<insert id="saveLog"> <insert id="saveLog">
...@@ -246,7 +229,10 @@ ...@@ -246,7 +229,10 @@
unis_sales_v_name, unis_sales_v_name,
h3c_c_value, h3c_c_value,
is_base, is_base,
is_show,update_time,insert_time,h3c_deliver_code ) is_show,
update_time,
insert_time,
h3c_deliver_code )
VALUES VALUES
( (
#{characteristicValueCode},#{characteristicCode},#{characteristicValueName}, #{characteristicValueCode},#{characteristicCode},#{characteristicValueName},
...@@ -296,7 +282,7 @@ ...@@ -296,7 +282,7 @@
</insert> </insert>
<select id="findByCharacteristicValueName" resultType="cn.com.uitech.authorization.pojo.entity.CharacteristicValue"> <select id="findByCharacteristicValueName" resultType="cn.com.uitech.authorization.pojo.entity.CharacteristicValue">
select * from super_characteristic_value_info where characteristic_value_name = #{characteristicValueName} and super_bom_code = #{superBomCode} select * from super_characteristic_value_info where characteristic_code = #{characteristicName} and characteristic_value_name = #{characteristicValueName} and super_bom_code = #{superBomCode}
</select> </select>
<select id="getName" resultType="java.lang.String"> <select id="getName" resultType="java.lang.String">
...@@ -309,7 +295,7 @@ ...@@ -309,7 +295,7 @@
</select> </select>
<select id="getVNameByCode" resultType="java.lang.String"> <select id="getVNameByCode" resultType="java.lang.String">
select characteristic_value_name from super_characteristic_value_info where characteristic_value_code = #{characteristicValueCode} select characteristic_value_name from super_characteristic_value_info where characteristic_value_code = #{characteristicValueCode} and characteristic_code = #{characteristicCode}
</select> </select>
<select id="getCharacteristicValueInfoByName" <select id="getCharacteristicValueInfoByName"
......
...@@ -29,39 +29,18 @@ ...@@ -29,39 +29,18 @@
</select> </select>
<update id="updateCtoBomByBomCode" parameterType="cn.com.uitech.authorization.pojo.dto.CtoBomRequestParamDto"> <update id="updateCtoBomByBomCode" parameterType="cn.com.uitech.authorization.pojo.dto.CtoBomRequestParamDto">
UPDATE super_bom_info UPDATE super_bom_info set
<set>
<if test="superBomName!=null and superBomName!=''">
super_bom_name=#{superBomName} , super_bom_name=#{superBomName} ,
</if>
<if test="type!=null and type!=''">
type=#{type} , type=#{type} ,
</if>
<if test="isState!=null">
is_state=#{isState} , is_state=#{isState} ,
</if>
<if test="modelStatus!=null">
model_status=#{modelStatus} , model_status=#{modelStatus} ,
</if>
<if test="h3cPn!=null and h3cPn!=''">
h3c_pn=#{h3cPn} , h3c_pn=#{h3cPn} ,
</if>
<if test="configId!=null and configId!=''">
config_id=#{configId} , config_id=#{configId} ,
</if>
<if test="productClassCode!=null and productClassCode!=''">
product_class_code=#{productClassCode}, product_class_code=#{productClassCode},
</if> unis_sales_name=#{unisSalesName}
<if test="unisSalesName!=null and unisSalesName!=''"> where
unis_sales_name=#{unisSalesName}, <if test="superBomCode!=null and superBomCode!=''">
</if> super_bom_code=#{superBomCode}
</set>
<where>
1=1
<if test="superBomCode!=null">
and super_bom_code=#{superBomCode}
</if> </if>
<if test="superBomCodes!=null and superBomCodes.length>0"> <if test="superBomCodes!=null and superBomCodes.length>0">
and super_bom_code in and super_bom_code in
...@@ -69,7 +48,6 @@ ...@@ -69,7 +48,6 @@
#{superBomCode} #{superBomCode}
</foreach> </foreach>
</if> </if>
</where>
</update> </update>
<select id="getCtoBomsByCode" parameterType="java.lang.String" <select id="getCtoBomsByCode" parameterType="java.lang.String"
...@@ -265,7 +243,9 @@ ...@@ -265,7 +243,9 @@
type = #{type}, type = #{type},
model_status = #{modelStatus}, model_status = #{modelStatus},
unis_sales_name = #{unisSalesName}, unis_sales_name = #{unisSalesName},
brand = #{brand} brand = #{brand},
revision = #{revision},
type = #{type}
where super_bom_code = #{superBomCode} where super_bom_code = #{superBomCode}
</update> </update>
......
...@@ -5,24 +5,28 @@ ...@@ -5,24 +5,28 @@
<insert id="saveLog"> <insert id="saveLog">
INSERT INTO super_table_item_info_log ( INSERT INTO super_table_item_info_log (
table_number,group_number,Characteristic_Code,Characteristic_value_Code, table_number,group_number,Characteristic_Code,Characteristic_value_Code,
create_time,create_by,id ) create_time,create_by,id,super_bom_code )
VALUES VALUES
( (
#{tableNumber},#{groupNumber},#{characteristicCode},#{characteristicValueCode},#{createTime},#{createBy},#{id} #{tableNumber},#{groupNumber},#{characteristicCode},#{characteristicValueCode},#{createTime},#{createBy},#{id},#{superBomCode}
); );
</insert> </insert>
<insert id="saveBom"> <insert id="saveBom">
INSERT INTO super_table_item_info ( INSERT INTO super_table_item_info (
table_number,group_number,Characteristic_Code,Characteristic_value_Code, table_number,group_number,Characteristic_Code,Characteristic_value_Code,
create_time,create_by,id ) create_time,create_by,id,super_bom_code )
VALUES VALUES
( (
#{tableNumber},#{groupNumber},#{characteristicCode},#{characteristicValueCode},#{createTime},#{createBy},#{id} #{tableNumber},#{groupNumber},#{characteristicCode},#{characteristicValueCode},#{createTime},#{createBy},#{id},#{superBomCode}
); );
</insert> </insert>
<select id="getOne" resultType="cn.com.uitech.authorization.pojo.entity.SuperTableItemInfo"> <select id="getOne" resultType="cn.com.uitech.authorization.pojo.entity.SuperTableItemInfo">
select * from super_table_item_info where super_bom_code = #{superBomCode} and Characteristic_value_Code = #{characteristicValueCode} select * from super_table_item_info where super_bom_code = #{superBomCode} and Characteristic_value_Code = #{characteristicValueCode}
</select> </select>
<delete id="deleteItemBom">
delete from super_table_item_info where table_number = #{tableNumber} and super_bom_code = #{superBomCode}
</delete>
</mapper> </mapper>
...@@ -39,8 +39,7 @@ ...@@ -39,8 +39,7 @@
</insert> </insert>
<delete id="deleteBom"> <delete id="deleteBom">
delete from super_table_info where super_bom_code = #{superBomCode}; delete from super_table_info where super_bom_code = #{superBomCode} and table_number = #{tableNumber};
delete from super_table_item_info where super_bom_code = #{superBomCode};
</delete> </delete>
<resultMap id="baseResultMap" type="cn.com.uitech.authorization.pojo.dto.SuperTableInfoDto"> <resultMap id="baseResultMap" type="cn.com.uitech.authorization.pojo.dto.SuperTableInfoDto">
......
<?xml version="1.0" encoding="UTF-8"?>
<!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.UserInfoMapper">
<select id="getUser" resultType="cn.com.uitech.authorization.pojo.entity.UserInfo">
select * from user_info where user_code = #{userCode} and pass_word = #{password}
</select>
</mapper>
\ No newline at end of file
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