Commit 9580042c by zhaoxiaolei

调用PLM 成功

parent abf6f689
......@@ -98,7 +98,7 @@ public class IntegrateController {
characteristicValue.put("characteristicName", cName);
String characteristicValueCode = itemInfo.getCharacteristicValueCode();
if (!StringUtils.isEmpty(characteristicValueCode)) {
String vName = integrateService.getVNameByCode(characteristicValueCode);
String vName = integrateService.getVNameByCode(characteristicValueCode,characteristicCode);
values.add(vName);
}
featureComponentNames.add(cName);
......@@ -167,7 +167,7 @@ public class IntegrateController {
String characteristicName = (String) item.get("characteristicName");
Characteristic characteristic = integrateService.findByCharacteristicName(characteristicName, selectorEntity.getSuperBomCode());
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("characteristicName", characteristic.getCharacteristicName());
selectedValue.put("characteristicValueCode", characteristicValue.getCharacteristicValueCode());
......@@ -305,5 +305,11 @@ public class IntegrateController {
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
void updateSuperBomSkuInfo(ApplySkuCodeResultDto.data applySkuCodeResultDto);
void updateSuperBomSkuStatus(ApplySkuCodeResultDto.data data);
void updateSuperBomSku(SuperBomSkuInfo superBomSkuInfo);
}
......@@ -94,11 +94,11 @@ public interface CharacteristicValueMapper extends IBaseMapper<CharacteristicVal
void saveBom(CharacteristicValue characteristicValue);
CharacteristicValue findByCharacteristicValueName(String characteristicValueName,String superBomCode);
CharacteristicValue findByCharacteristicValueName(String characteristicName,String characteristicValueName,String superBomCode);
String getName(Object v);
String getVNameByCode(String characteristicValueCode);
String getVNameByCode(String characteristicValueCode,String characteristicCode);
CharacteristicValue getCharacteristicValueInfoByName(String characteristicValueName,String superBomCode,String characteristicName);
......
......@@ -12,4 +12,6 @@ public interface SuperTableInfoItemMapper extends IBaseMapper<SuperTableItemInfo
void saveBom(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{
@ApiModelProperty(name = "description",value = "描述",dataType ="String")
private String description;
@ApiModelProperty(name = "modelStatus",value = "状态",dataType ="String")
private Integer modelStatus;
private String modelStatus;
@ApiModelProperty(name = "type",value = "类型",dataType ="String")
private String type;
@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 {
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 getNameByCode(String characteristicCode,Integer isShow);
String getVNameByCode(String characteristicValueCode);
String getVNameByCode(String characteristicValueCode,String characteristicCode);
Object getSuperBomInfoByConfigId(Map<String, Object> map);
......@@ -46,4 +46,6 @@ public interface IntegrateService {
PageInfo<SuperBomSkuInfo> querySkuList(SuperBomSkuInfo superBomSkuInfo);
Object querySkuOne(String configId);
Object getToken(UserInfo userinfo);
}
......@@ -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.ConsultationConfigurationAndPriceDto;
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.service.CharacteristicValueService;
import cn.com.uitech.authorization.service.CtoBomService;
......@@ -152,7 +153,8 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic
*/
@Override
public Integer editCharacteristicValue(CharacteristicValue dto) {
GetSKUByH3CConfigInfo getSKUByH3CConfigInfo = new GetSKUByH3CConfigInfo();
//getSKUByH3CConfigInfo.setH3CPNList()
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 @@
<update id="updateCharacteristic" parameterType="cn.com.uitech.authorization.pojo.dto.CharacteristicRequestParamDto" >
update super_characteristic_info
<set>
<if test="characteristicName!=null and characteristicName!=''">
set
characteristic_name =#{characteristicName},
</if>
<if test="unisSalesCName!=null and unisSalesCName!=''">
unis_Sales_C_Name =#{unisSalesCName},
</if>
<if test="characteristicType!=null and characteristicType!=''">
characteristic_type =#{characteristicType},
</if>
<if test="H3CCCode!=null and H3CCCode!=''">
h3c_c_code =#{H3CCCode},
</if>
<if test="isHidden!=null ">
is_hidden =#{isHidden}
</if>
</set>
<where>
<if test="characteristicCode!=null and characteristicCode!=''">
where
Characteristic_Code=#{characteristicCode}
</if>
</where>
</update>
<update id="updateVisibleType" parameterType="cn.com.uitech.authorization.pojo.dto.CharacteristicRequestParamDto">
......@@ -194,7 +180,7 @@
sku_code = #{skuCode},
sku_name = #{skuName},
apply_status = #{msg},
sn_code = #{snCode},
sncode = #{snCode},
description = #{description},
product_type =#{productType},
product_small_type =#{productSmallType}
......@@ -204,4 +190,8 @@
<update id="updateSuperBomSkuStatus">
update super_bom_sku_info set msg = #{msg} where config_id = #{configId}
</update>
<update id="updateSuperBomSku">
update super_bom_sku_info set apply_status = #{description} where config_id = #{configId}
</update>
</mapper>
......@@ -65,32 +65,15 @@
<update id="editCharacteristicValue" parameterType="cn.com.uitech.authorization.pojo.entity.CharacteristicValue">
UPDATE super_characteristic_value_info
<set>
<if test="characteristicValueName!=null and characteristicValueName!=''">
set
characteristic_Value_name=#{characteristicValueName},
</if>
<if test="isState!=null">
is_state=#{isState},
</if>
<if test="isShow!=null">
is_Show=#{isShow},
</if>
<if test="zphCode!=null and zphCode!=''">
zph_code=#{zphCode},
</if>
<if test="zphName!=null and zphName!=''">
zph_name=#{zphName},
</if>
<if test="qualifyDate!=null">
qualify_date=#{qualifyDate},
</if>
<if test="unisSalesVName!=null and unisSalesVName!=''">
unis_sales_v_name=#{unisSalesVName},
</if>
<if test="h3cCValue!=null and h3cCValue!=''">
h3c_c_value=#{h3cCValue},
</if>
</set>
h3c_c_value=#{h3cCValue}
<where>
<if test="characteristicValueCode!=null and characteristicValueCode.length>0">
Characteristic_Value_Code=#{characteristicValueCode}
......@@ -232,7 +215,7 @@
</select>
<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>
<insert id="saveLog">
......@@ -246,7 +229,10 @@
unis_sales_v_name,
h3c_c_value,
is_base,
is_show,update_time,insert_time,h3c_deliver_code )
is_show,
update_time,
insert_time,
h3c_deliver_code )
VALUES
(
#{characteristicValueCode},#{characteristicCode},#{characteristicValueName},
......@@ -296,7 +282,7 @@
</insert>
<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 id="getName" resultType="java.lang.String">
......@@ -309,7 +295,7 @@
</select>
<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 id="getCharacteristicValueInfoByName"
......
......@@ -29,39 +29,18 @@
</select>
<update id="updateCtoBomByBomCode" parameterType="cn.com.uitech.authorization.pojo.dto.CtoBomRequestParamDto">
UPDATE super_bom_info
<set>
<if test="superBomName!=null and superBomName!=''">
UPDATE super_bom_info set
super_bom_name=#{superBomName} ,
</if>
<if test="type!=null and type!=''">
type=#{type} ,
</if>
<if test="isState!=null">
is_state=#{isState} ,
</if>
<if test="modelStatus!=null">
model_status=#{modelStatus} ,
</if>
<if test="h3cPn!=null and h3cPn!=''">
h3c_pn=#{h3cPn} ,
</if>
<if test="configId!=null and configId!=''">
config_id=#{configId} ,
</if>
<if test="productClassCode!=null and productClassCode!=''">
product_class_code=#{productClassCode},
</if>
<if test="unisSalesName!=null and unisSalesName!=''">
unis_sales_name=#{unisSalesName},
</if>
</set>
<where>
1=1
<if test="superBomCode!=null">
and super_bom_code=#{superBomCode}
unis_sales_name=#{unisSalesName}
where
<if test="superBomCode!=null and superBomCode!=''">
super_bom_code=#{superBomCode}
</if>
<if test="superBomCodes!=null and superBomCodes.length>0">
and super_bom_code in
......@@ -69,7 +48,6 @@
#{superBomCode}
</foreach>
</if>
</where>
</update>
<select id="getCtoBomsByCode" parameterType="java.lang.String"
......@@ -265,7 +243,9 @@
type = #{type},
model_status = #{modelStatus},
unis_sales_name = #{unisSalesName},
brand = #{brand}
brand = #{brand},
revision = #{revision},
type = #{type}
where super_bom_code = #{superBomCode}
</update>
......
......@@ -5,24 +5,28 @@
<insert id="saveLog">
INSERT INTO super_table_item_info_log (
table_number,group_number,Characteristic_Code,Characteristic_value_Code,
create_time,create_by,id )
create_time,create_by,id,super_bom_code )
VALUES
(
#{tableNumber},#{groupNumber},#{characteristicCode},#{characteristicValueCode},#{createTime},#{createBy},#{id}
#{tableNumber},#{groupNumber},#{characteristicCode},#{characteristicValueCode},#{createTime},#{createBy},#{id},#{superBomCode}
);
</insert>
<insert id="saveBom">
INSERT INTO super_table_item_info (
table_number,group_number,Characteristic_Code,Characteristic_value_Code,
create_time,create_by,id )
create_time,create_by,id,super_bom_code )
VALUES
(
#{tableNumber},#{groupNumber},#{characteristicCode},#{characteristicValueCode},#{createTime},#{createBy},#{id}
#{tableNumber},#{groupNumber},#{characteristicCode},#{characteristicValueCode},#{createTime},#{createBy},#{id},#{superBomCode}
);
</insert>
<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>
<delete id="deleteItemBom">
delete from super_table_item_info where table_number = #{tableNumber} and super_bom_code = #{superBomCode}
</delete>
</mapper>
......@@ -39,8 +39,7 @@
</insert>
<delete id="deleteBom">
delete from super_table_info where super_bom_code = #{superBomCode};
delete from super_table_item_info where super_bom_code = #{superBomCode};
delete from super_table_info where super_bom_code = #{superBomCode} and table_number = #{tableNumber};
</delete>
<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