Commit f753a40a by zhaoxiaolei

增加日志

parent 18539078
......@@ -313,7 +313,7 @@ public class IntegrateController {
@ApiOperation(value = "撞配", notes = "GetSKUByConfigInfo", httpMethod = "POST")
public CrmResponseEntity<?> GetSKUByConfigInfo(@RequestBody SuperBomSkuInfo superBomSkuInfo,HttpServletRequest request){
superBomSkuInfo.setApplyUser(request.getHeader("UserCode"));
return ResultGenerator.genSuccessResult(integrateService.GetSKUByConfigInfo(superBomSkuInfo,request));
return ResultGenerator.genSuccessResult(integrateService.GetSKUByConfigInfo(superBomSkuInfo,request,0));
}
@PostMapping("/GetSKUByH3CConfigInfo")
......
......@@ -3,6 +3,7 @@ package cn.com.uitech.authorization.mapper;
import cn.com.uitech.authorization.pojo.dto.ApplySkuCodeResultDto;
import cn.com.uitech.authorization.pojo.entity.SuperBomSkuConfigInfo;
import cn.com.uitech.authorization.pojo.entity.SuperBomSkuInfo;
import cn.com.uitech.authorization.pojo.entity.SuperBomSkuInfoLogOpera;
import org.apache.ibatis.annotations.Mapper;
import java.util.ArrayList;
......@@ -34,4 +35,6 @@ public interface SuperBomSkuInfoMapper extends IBaseMapper<SuperBomSkuInfo> {
void updateSkuStatus(SuperBomSkuInfo returnSkuInfo);
void updateSkuStatusH3c(String configId,String skuCode,String skuName,String description,String productType,String productSmallType);
void saveLogOpera(SuperBomSkuInfoLogOpera logOpera);
}
package cn.com.uitech.authorization.pojo.entity;
import cn.com.uitech.authorization.pojo.dto.BasePageDto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
@Accessors(chain = true)
@NoArgsConstructor
@Getter
@Setter
@ToString
@Table(name = "super_bom_sku_info_log_opera")
public class SuperBomSkuInfoLogOpera extends BasePageDto implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 产品类型
*/
@Column(name = "product_class_code")
private String productClassCode;
/**
* 产品类型
*/
@Column(name = "product_class_name")
private String productClassName;
/**
* 编码
*/
@Column(name = "super_bom_code")
private String superBomCode;
/**
* 名称
*/
@Column(name = "super_bom_name")
private String superBomName;
/**
* 品牌
*/
@Column(name = "brand")
private String brand;
/**
* h3c_pn
*/
@Column(name = "h3c_pn")
private String h3cPn;
/**
* h3c交付代码
*/
@Column(name = "h3c_pay_no")
private String h3cPayNo;
/**
* 政采标识
*/
@Column(name = "political_mining_id")
private String politicalMiningId;
/**
* 模式
*/
@Column(name = "patern")
private String patern;
/**
* unis配置识别码
*/
@Column(name = "unis_config_code")
private String unisConfigCode;
/**
* 产品型号
*/
@Column(name = "product_type")
private String productType;
/**
* 产品型号(小型号)
*/
@Column(name = "product_small_type")
private String productSmallType;
/**
* 是否特配
*/
@Column(name = "is_config")
private String isConfig;
/**
* 特配描述
*/
@Column(name = "description")
private String description;
/**
* 特配描述
*/
@Column(name = "description_bom")
private String descriptionBom;
/**
* cpqconfigid
*/
@Column(name = "config_id")
private String configId;
/**
* 69码
*/
@Column(name = "sncode")
private String sncode;
/**
* 版本
*/
@Column(name = "revision")
private String revision;
/**
* 物料状态
*/
@Column(name = "model_status")
private String modelStatus;
/**
* 已回号/未回号
*/
@Column(name = "apply_status")
private String applyStatus;
/**
* 已回号/未回号
*/
@Column(name = "apply_user")
private String applyUser;
/**
* 已回号/未回号
*/
@Column(name = "apply_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date applyTime;
/**
* 集成来的
*/
@Column(name = "sku_code")
private String skuCode;
/**
* 集成来的
*/
@Column(name = "sku_name")
private String skuName;
/**
* 单位
*/
@Column(name = "unit")
private String unit;
@Column(name = "plm_msg")
private String plmMsg;
/**
* id
*/
@Column(name = "id")
private String id;
/**
* setUnisSalesName
*/
@Transient
private String unisSalesName;
private Timestamp updateTime;
private String updateUser;
private String opera;
@Transient
private String token;
private List<SuperBomSkuConfigInfo> characteristicList;
}
\ No newline at end of file
......@@ -36,7 +36,7 @@ public interface IntegrateService {
Characteristic getCNameByCode(String characteristicName,String superBomCode);
Object GetSKUByConfigInfo(SuperBomSkuInfo superBomSkuInfo,HttpServletRequest request);
Object GetSKUByConfigInfo(SuperBomSkuInfo superBomSkuInfo,HttpServletRequest request,Integer temp);
Object GetConfigBySUKINFO(SuperBomSkuInfo superBomSkuInfo,HttpServletRequest request);
......
......@@ -402,7 +402,7 @@ public class IntegrateServiceImpl implements IntegrateService {
* @Param [superBomSkuInfo]
* @return java.lang.Object
**/
public Object GetSKUByConfigInfo(SuperBomSkuInfo superBomSkuInfo, HttpServletRequest request) {
public Object GetSKUByConfigInfo(SuperBomSkuInfo superBomSkuInfo, HttpServletRequest request,Integer temp) {
GetProductOutDto result = new GetProductOutDto();
//checkToken(superBomSkuInfo.getToken());
......@@ -420,6 +420,19 @@ public class IntegrateServiceImpl implements IntegrateService {
//根据 政采 模式 品牌 superbom 查询sku主信息 没有查询到信息
//撞配不通过 保存SKU信息&config信息 调用申请SKU接口 applySkuCode
superBomSkuInfo.setId(sequence.nextId());
SuperBomSkuInfoLogOpera logOpera = new SuperBomSkuInfoLogOpera();
BeanUtils.copyProperties(superBomSkuInfo,logOpera);
logOpera.setUpdateUser(request.getHeader("UserCode"));
if(temp==1){
logOpera.setOpera("/integrate/saveSukInfo");
}else if(temp == 2){
logOpera.setOpera("/integrate/GetSKUByH3CConfigInfo");
}else if(temp == 3){
logOpera.setOpera("/integrate/GetConfigBySUKINFO");
}else if(temp == 0){
logOpera.setOpera("/integrate/GetSKUByConfigInfo");
}
superBomSkuInfoMapper.saveLogOpera(logOpera);
superBomSkuInfoMapper.saveSkuInfo(superBomSkuInfo);
List<SuperBomSkuConfigInfo> characteristicList = superBomSkuInfo.getCharacteristicList();
characteristicList.forEach(item -> {
......@@ -523,6 +536,19 @@ public class IntegrateServiceImpl implements IntegrateService {
//根据 政采 模式 品牌 superbom 查询sku主信息 没有查询到信息
//撞配不通过 保存SKU信息&config信息 调用申请SKU接口 applySkuCode
superBomSkuInfo.setId(sequence.nextId());
SuperBomSkuInfoLogOpera logOpera = new SuperBomSkuInfoLogOpera();
BeanUtils.copyProperties(superBomSkuInfo,logOpera);
logOpera.setUpdateUser(request.getHeader("UserCode"));
if(temp==1){
logOpera.setOpera("/integrate/saveSukInfo");
}else if(temp == 2){
logOpera.setOpera("/integrate/GetSKUByH3CConfigInfo");
}else if(temp == 3){
logOpera.setOpera("/integrate/GetConfigBySUKINFO");
}else if(temp == 0){
logOpera.setOpera("/integrate/GetSKUByConfigInfo");
}
superBomSkuInfoMapper.saveLogOpera(logOpera);
superBomSkuInfoMapper.saveSkuInfo(superBomSkuInfo);
List<SuperBomSkuConfigInfo> characteristicList = superBomSkuInfo.getCharacteristicList();
characteristicList.forEach(item -> {
......@@ -568,6 +594,19 @@ public class IntegrateServiceImpl implements IntegrateService {
//撞配不通过 保存SKU信息&config信息 调用申请SKU接口 applySkuCode
if (flag.equals(false)) {
superBomSkuInfo.setId(sequence.nextId());
SuperBomSkuInfoLogOpera logOpera = new SuperBomSkuInfoLogOpera();
BeanUtils.copyProperties(superBomSkuInfo,logOpera);
logOpera.setUpdateUser(request.getHeader("UserCode"));
if(temp==1){
logOpera.setOpera("/integrate/saveSukInfo");
}else if(temp == 2){
logOpera.setOpera("/integrate/GetSKUByH3CConfigInfo");
}else if(temp == 3){
logOpera.setOpera("/integrate/GetConfigBySUKINFO");
}else if(temp == 0){
logOpera.setOpera("/integrate/GetSKUByConfigInfo");
}
superBomSkuInfoMapper.saveLogOpera(logOpera);
superBomSkuInfoMapper.saveSkuInfo(superBomSkuInfo);
List<SuperBomSkuConfigInfo> characteristicList = superBomSkuInfo.getCharacteristicList();
characteristicList.forEach(item -> {
......@@ -641,7 +680,7 @@ public class IntegrateServiceImpl implements IntegrateService {
//checkToken(superBomSkuInfo.getToken());
//撞配
Object ob = GetSKUByConfigInfo(superBomSkuInfo, request);
Object ob = GetSKUByConfigInfo(superBomSkuInfo, request,3);
boolean flag = ob instanceof GetProductOutDto;
if (flag) {
Object o = JSONObject.toJSON(ob);
......@@ -862,7 +901,12 @@ public class IntegrateServiceImpl implements IntegrateService {
//封装调用plm接口的数据
ToPLMDto toPLMDto = new ToPLMDto();
toPLMDto.setConfigId(superBomSkuInfo.getConfigId());
toPLMDto.setSpecial(false);
String isConfig = superBomSkuInfo.getIsConfig();
if(isConfig.equals("是")){
toPLMDto.setSpecial(true);
}else{
toPLMDto.setSpecial(false);
}
toPLMDto.setSuperNumber(superBomSkuInfo.getSuperBomCode());
toPLMDto.setH3cSuperNumber(superBomSkuInfo.getH3cPn());
toPLMDto.setGovernmentId(superBomSkuInfo.getPoliticalMiningId());
......@@ -873,7 +917,11 @@ public class IntegrateServiceImpl implements IntegrateService {
if (!CollectionUtils.isEmpty(characteristicList)) {
for (SuperBomSkuConfigInfo superBomSkuConfigInfo : characteristicList) {
ToPLMDto.OptionChoiceMap map1 = new ToPLMDto.OptionChoiceMap();
map1.setSpecial(false);
if(isConfig.equals("是")){
map1.setSpecial(true);
}else{
map1.setSpecial(false);
}
map1.setOption(superBomSkuConfigInfo.getCharacteristicName());
map1.setChoice(superBomSkuConfigInfo.getCharacteristicValueName());
map1.setSpecialDescription(superBomSkuInfo.getDescription());
......@@ -1211,7 +1259,7 @@ public class IntegrateServiceImpl implements IntegrateService {
Map<String, Object> preVerifyMap = (Map<String, Object>) JSONObject.toJSON(preVerify);
if (preVerifyMap.get("result").equals(true)) {
//撞配 找PLM申请SKU
Object ob = GetSKUByConfigInfo(superBomSkuInfo, request);
Object ob = GetSKUByConfigInfo(superBomSkuInfo, request,2);
boolean flag1 = ob instanceof GetProductOutDto;
if (flag1) {
Object o1 = JSONObject.toJSON(ob);
......@@ -1328,7 +1376,7 @@ public class IntegrateServiceImpl implements IntegrateService {
**/
public Object saveSukInfo(SuperBomSkuInfo superBomSkuInfo, HttpServletRequest request) {
GetProductOutDto result = new GetProductOutDto();
Object ob = GetSKUByConfigInfo(superBomSkuInfo, request);
Object ob = GetSKUByConfigInfo(superBomSkuInfo, request,1);
boolean flag = ob instanceof GetProductOutDto;
if (flag) {
Object o = JSONObject.toJSON(ob);
......
......@@ -213,4 +213,66 @@
product_small_type = #{productSmallType}
where config_id = #{configId}
</update>
<insert id="saveLogOpera">
insert into super_bom_sku_info_log_opera(
product_class_code
,product_class_name
,super_bom_code
,super_bom_name
,brand
,h3c_pn
,h3c_pay_no
,political_mining_id
,patern
,unis_config_code
,product_type
,product_small_type
,is_config
,description
,config_id
,sncode
,revision
,model_status
,apply_status
,sku_code
,sku_name
,apply_user
,apply_time
,description_bom
,id
,update_time
,update_user
,opera
) values (
#{productClassCode},
#{productClassName},
#{superBomCode},
#{superBomName},
#{brand},
#{h3cPn},
#{h3cPayNo},
#{politicalMiningId},
#{patern},
#{unisConfigCode},
#{productType},
#{productSmallType},
#{isConfig},
#{description},
#{configId},
#{sncode},
#{revision},
#{modelStatus},
#{applyStatus},
#{skuCode},
#{skuName},
#{applyUser},
now(),
#{descriptionBom},
#{id},
now(),
#{updateUser},
#{opera}
)
</insert>
</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