Commit 59404a89 by zhaoxiaolei

更改 特征特征值 查询条件

添加处理历史数据代码
parent 44801616
package cn.com.uitech.authorization.controller;
import cn.com.uitech.authorization.pojo.dto.CtoConstrainDto;
import cn.com.uitech.authorization.pojo.entity.Characteristic;
import cn.com.uitech.authorization.pojo.entity.CharacteristicValue;
import cn.com.uitech.authorization.pojo.entity.ConfigurableBom;
import cn.com.uitech.authorization.service.*;
import cn.com.uitech.authorization.service.CharacteristicService;
import cn.com.uitech.authorization.service.CharacteristicValueService;
import cn.com.uitech.authorization.service.CtoBomService;
import cn.com.uitech.authorization.service.SecurityService;
import cn.com.uitech.authorization.utils.CrmResponseEntity;
import cn.com.uitech.authorization.utils.ResultGenerator;
import io.swagger.annotations.Api;
......@@ -38,8 +40,6 @@ public class ConfigController {
@Autowired
private CharacteristicValueService characteristicValueService;
@Autowired
private CtoConstrainService ctoConstrainService;
/**
* @Description: cto 物料初始化
......@@ -51,7 +51,6 @@ public class ConfigController {
public CrmResponseEntity<?> insertCto(@RequestBody List<ConfigurableBom> configurableBoms) {
ctoBomService.insertCto(configurableBoms);
String code = SecurityService.getPrincipal().getCode();
log.info(code,"{} cto数据维护成功,插入的数据是:{}",configurableBoms);
return ResultGenerator.genSuccessResult(code+" cto数据维护成功");
}
......@@ -65,7 +64,6 @@ public class ConfigController {
public CrmResponseEntity<?> insertList(@RequestBody List<Characteristic> characteristics){
characteristicService.insertList(characteristics);
String code = SecurityService.getPrincipal().getCode();
log.info(code,"{} 特征数据维护成功,插入的数据是:{}",characteristics);
return ResultGenerator.genSuccessResult(code+" 特征数据维护成功");
}
......@@ -79,21 +77,6 @@ public class ConfigController {
public CrmResponseEntity<?> insertListV(@RequestBody List<CharacteristicValue> characteristicValues){
characteristicValueService.insertListV(characteristicValues);
String code = SecurityService.getPrincipal().getCode();
log.info(code,"{} 特征值数据维护成功,插入的数据是:{}",characteristicValues);
return ResultGenerator.genSuccessResult(code+" 特征值数据维护成功");
}
/**
* @Description: cto 限配关系 物料初始化
* @param ctoConstrainDtoList
* @return
*/
@PostMapping("/insertCtoConstrain")
@ApiOperation(value = "Cto限配关系维护", notes = "Cto限配关系维护", httpMethod = "POST")
public CrmResponseEntity<?> insertCtoConstrain(@RequestBody List<CtoConstrainDto> ctoConstrainDtoList) {
ctoConstrainService.insertCtoConstrain(ctoConstrainDtoList);
String code = SecurityService.getPrincipal().getCode();
log.info(code,"{} ctoconstrain数据维护成功,插入的数据是:{}",ctoConstrainDtoList);
return ResultGenerator.genSuccessResult(code+" ctoconstrain数据维护成功");
}
}
......@@ -14,8 +14,6 @@ import cn.com.uitech.authorization.utils.ResultGenerator;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
......@@ -32,7 +30,6 @@ import java.util.List;
@Api(tags = "CtoBom CTO物料维护")
public class CtoBomController {
private static final Logger logger = LoggerFactory.getLogger(CtoBomController.class);
@Autowired
private CtoBomService ctoBomService;
......@@ -61,7 +58,6 @@ public class CtoBomController {
public CrmResponseEntity<?> updateCtoBomByBomCode(@Validated({EditSave.class}) @RequestBody CtoBomRequestParamDto ctoBomRequestParamDto) {
Integer rows = ctoBomService.updateCtoBomByBomCode(ctoBomRequestParamDto);
String code = SecurityService.getPrincipal().getCode();
logger.info("基础信息CTO维护 修改 ,操作人:{},物料{}",code,ctoBomRequestParamDto.getSuperBomCode());
return ResultGenerator.genSuccessResult(rows);
}
......@@ -87,7 +83,6 @@ public class CtoBomController {
public CrmResponseEntity<?> updateIsPresaleByBomCode(@Validated({BathUpdate.class}) @RequestBody CtoBomRequestParamDto ctoBomRequestParamDto) {
Integer rows = ctoBomService.updateIsPresaleByBomCode(ctoBomRequestParamDto);
String code = SecurityService.getPrincipal().getCode();
logger.info("基础信息CTO维护 批量更新 ,操作人:{},物料:{}",code,ctoBomRequestParamDto.getSuperBomCodes().toString());
return ResultGenerator.genSuccessResult(rows);
}
......@@ -136,7 +131,6 @@ public class CtoBomController {
public CrmResponseEntity<?> updateInsertCustomerbelongtoByBom(@RequestBody BomStatusEntity bomStatusEntity) {
ctoBomService.updateInsertCustomerbelongtoByBom(bomStatusEntity);
String code = SecurityService.getPrincipal().getCode();
logger.info("基础信息CTO维护 cto 客户处可卖批量更新 ,操作人:{},物料:{}",code,bomStatusEntity.getBomCode());
return ResultGenerator.genSuccessResult();
}
......
......@@ -154,7 +154,7 @@ public class IntegrateController {
List<Map<String,Object>> resultCharacteristicList = (List<Map<String, Object>>) map.get("characteristicList");
// 根据英文名称查询中文名称
resultCharacteristicList.forEach(resultCharacteristic->{
resultCharacteristic.put("unisCName",superTableInfoMapper.findCNameByName((String) resultCharacteristic.get("name")));
resultCharacteristic.put("unisCName",superTableInfoMapper.findCNameByName((String) resultCharacteristic.get("name"),selectorEntity.getSuperBomCode()));
List<Map<String,Object>> vList= (List<Map<String, Object>>) resultCharacteristic.get("values");
vList.forEach(v->{
v.put("unisVName",superTableInfoMapper.findVNameByName((String) v.get("name")));
......
package cn.com.uitech.authorization.controller;
import cn.com.uitech.authorization.pojo.dto.BoproductMTMTransDto;
import cn.com.uitech.authorization.pojo.dto.PLMDocumentFromCRMDto;
import cn.com.uitech.authorization.service.BoProductInfoService;
import cn.com.uitech.authorization.service.PlmWebService;
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.beans.factory.annotation.Autowired;
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 javax.validation.Valid;
/**
* PLM交互接口
* @author xinsy
* @date 2020/5/11
*/
@RestController
@RequestMapping("/Plm")
@Api(tags = {"PLM 交互"})
public class PlmInteractionController {
@Autowired
private BoProductInfoService boProductInfoService;
@Autowired
private PlmWebService plmWebService;
/**
*FP/NP回号
*/
@PostMapping("/updateBoproductForMTM")
@ApiOperation(value = "FP/NP回号", notes = "FP/NP回号", httpMethod = "POST")
public CrmResponseEntity<String> updateBoproductForMTM(@Valid @RequestBody BoproductMTMTransDto dto){
return ResultGenerator.genSuccessResult(boProductInfoService.updateBoproductForMTM(dto));
}
/**
* lms - FP/NP回号
*/
@PostMapping("/lmsReturnMtm")
@ApiOperation(value = "lmsFP/NP回号", notes = "FP/NP回号", httpMethod = "POST")
public CrmResponseEntity<String> lmsReturnMtm(@Valid @RequestBody BoproductMTMTransDto dto){
return ResultGenerator.genSuccessResult(boProductInfoService.lmsReturnMtm(dto));
}
/**
* FP/NP申请
*
*/
@PostMapping("/sendPLMDocumentFromCRM")
@ApiOperation(value = "FP/NP申请", notes = "【注意】测试该接口请将\"10.101.49.6 plmdev.legendcf.com\" \n" +
"添加至本地\\Windows\\System32\\drivers\\etc hosts文件中", httpMethod = "POST")
public CrmResponseEntity<String> sendPLMDocumentFromCRM(@RequestBody PLMDocumentFromCRMDto dto) throws Exception{
return ResultGenerator.genSuccessResult(plmWebService.sendPLMDocumentFromCRM(dto));
}
/**
* FP/NP申请
*
*/
@PostMapping("/lmsSendPLMDocumentFromCRM")
@ApiOperation(value = "FP/NP申请", notes = "【注意】测试该接口请将\"10.101.49.6 plmdev.legendcf.com\" \n" +
"添加至本地\\Windows\\System32\\drivers\\etc hosts文件中", httpMethod = "POST")
public CrmResponseEntity<String> lmsSendPLMDocumentFromCRM(@RequestBody PLMDocumentFromCRMDto dto) throws Exception{
return ResultGenerator.genSuccessResult(plmWebService.lmsSendPLMDocumentFromCRM(dto));
}
@PostMapping("/lmsSendPLMFromCRM")
public CrmResponseEntity<Boolean> lmsCallMtmNoApplyFor(@RequestBody String json){
return ResultGenerator.genSuccessResult(plmWebService.lmsCallMtmNoApplyFor(json));
}
}
package cn.com.uitech.authorization.controller;
import cn.com.uitech.authorization.pojo.dto.PriceParamsDto;
import cn.com.uitech.authorization.pojo.entity.Pricecalexpression;
import cn.com.uitech.authorization.service.PricecalexpressionService;
import cn.com.uitech.authorization.utils.CrmResponseEntity;
import cn.com.uitech.authorization.utils.ResultGenerator;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/price")
@Api(tags = {"price 价格体系维护"})
public class PriceController {
@Autowired
private PricecalexpressionService pricecalexpressionService;
/**
  * @description: 查询列表
  * @param priceParamsDto
  */
@PostMapping("/getPriceModelList")
@ApiOperation(value = "查询列表", notes = "查询列表", httpMethod = "POST", response = CrmResponseEntity.class)
public CrmResponseEntity<PageInfo> getPriceModelList(@RequestBody PriceParamsDto priceParamsDto) {
return ResultGenerator.genSuccessResult(pricecalexpressionService.getPriceModelList(priceParamsDto));
}
/**
  * @description: 修改成本定价法OR市场定价法
  * @param pricecalexpression
  */
@PutMapping("/updatePriceMod")
@ApiOperation(value = "修改成本定价法OR市场定价法", notes = "修改成本定价法OR市场定价法", httpMethod = "PUT", response = CrmResponseEntity.class)
public CrmResponseEntity<?> updatePriceMod(@RequestBody Pricecalexpression pricecalexpression) {
return ResultGenerator.genSuccessResult(pricecalexpressionService.updatePriceMod(pricecalexpression));
}
/**
  * @description: 查询成本定价法OR市场定价法列表
  * @param priceParamsDto
  */
@PostMapping("/getPriceModModel")
@ApiOperation(value = "查询成本定价法OR市场定价法列表", notes = "查询成本定价法OR市场定价法列表", httpMethod = "POST", response = CrmResponseEntity.class)
public CrmResponseEntity<Pricecalexpression> getPriceModList(@RequestBody PriceParamsDto priceParamsDto) {
return ResultGenerator.genSuccessResult(pricecalexpressionService.getPriceModModel(priceParamsDto));
}
/**
  * @description: 修改价格
  * @param pricecalexpression
  */
@PutMapping("/updatePriceModel")
@ApiOperation(value = "修改价格", notes = "修改价格", httpMethod = "PUT", response = CrmResponseEntity.class)
public CrmResponseEntity<?> updatePriceModel(@RequestBody Pricecalexpression pricecalexpression) {
return ResultGenerator.genSuccessResult(pricecalexpressionService.updatePriceModel(pricecalexpression));
}
/**
  * @description: 刷入标准成本--标配
  * @param pricecalexpression
  */
@PutMapping("/updatePriceStandard")
@ApiOperation(value = "刷入标准成本--标配", notes = "刷入标准成本--标配", httpMethod = "PUT", response = CrmResponseEntity.class)
public CrmResponseEntity<?> updatePriceStandard(@RequestBody Pricecalexpression pricecalexpression) {
return ResultGenerator.genSuccessResult(pricecalexpressionService.updatePriceStandard(pricecalexpression));
}
/**
  * @description: 刷入4X成本--标配
  * @param pricecalexpression
  */
@PutMapping("/updatePriceFourLevelStandard")
@ApiOperation(value = "刷入4X成本--标配", notes = "刷入4X成本--标配", httpMethod = "PUT", response = CrmResponseEntity.class)
public CrmResponseEntity<?> updatePriceFourLevelStandard(@RequestBody Pricecalexpression pricecalexpression) {
return ResultGenerator.genSuccessResult(pricecalexpressionService.updatePriceFourLevelStandard(pricecalexpression));
}
/**
  * @description: 刷入标准成本--常规特配
  * @param pricecalexpression
  */
@PutMapping("/updatePriceCto")
@ApiOperation(value = "刷入标准成本--常规特配", notes = "刷入标准成本--常规特配", httpMethod = "PUT", response = CrmResponseEntity.class)
public CrmResponseEntity<?> updatePriceCto(@RequestBody Pricecalexpression pricecalexpression) {
return ResultGenerator.genSuccessResult(pricecalexpressionService.updatePriceCto(pricecalexpression));
}
/**
  * @description: 刷入4X成本--常规特配
  * @param pricecalexpression
  */
@PutMapping("/updatePriceFourLevelCto")
@ApiOperation(value = "刷入4X成本--常规特配", notes = "刷入4X成本--常规特配", httpMethod = "PUT", response = CrmResponseEntity.class)
public CrmResponseEntity<?> updatePriceFourLevelCto(@RequestBody Pricecalexpression pricecalexpression) {
return ResultGenerator.genSuccessResult(pricecalexpressionService.updatePriceFourLevelCto(pricecalexpression));
}
/**
  * @description: 根据产品组、类别、层次、产品名称查询相应数据
  * @param pricecalexpression
  * @return PriceAndOdInfoDTO
  */
@PostMapping("/getPriceAndOdInfo")
@ApiOperation(value = "根据产品组、类别、层次、产品名称查询相应数据", notes = "根据产品组、类别、层次、产品名称查询相应数据", httpMethod = "POST", response = CrmResponseEntity.class)
public CrmResponseEntity<?> getPriceAndOdInfo(@RequestBody Pricecalexpression pricecalexpression){
return ResultGenerator.genSuccessResult(pricecalexpressionService.getPriceAndOdInfo(pricecalexpression));
}
}
package cn.com.uitech.authorization.controller;
import cn.com.uitech.authorization.service.TempServer;
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.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/temp")
@Api(tags = "temp 集成接口")
public class TempController {
@Autowired
private TempServer tempServer;
@GetMapping("/deployTemp")
@ApiOperation(value = "deployTemp",notes = "模拟调用集成数据",httpMethod = "GET")
public CrmResponseEntity<?> deployTemp(){
return ResultGenerator.genSuccessResult(tempServer.getTempList());
}
}
package cn.com.uitech.authorization.mapper;
import cn.com.uitech.authorization.pojo.dto.BoProductInfoForMDto;
import cn.com.uitech.authorization.pojo.dto.BoproductMTMDto;
import cn.com.uitech.authorization.pojo.entity.BoProductInfo;
import org.apache.ibatis.annotations.Mapper;
/**
* @author yangkuo
* @date 2020/4/27 21:24
* 商机产品mapper
*/
@Mapper
public interface BoProductInfoMapper extends IBaseMapper<BoProductInfo> {
/**
*
* @param dto
*/
int updateBoproductForMTM(BoproductMTMDto dto);
Integer updateBoproductForMTMofM(BoProductInfoForMDto forMDto);
}
package cn.com.uitech.authorization.mapper;
import cn.com.uitech.authorization.pojo.entity.CtoVariantTable;
import org.apache.ibatis.annotations.Mapper;
import tk.mybatis.mapper.common.special.InsertListMapper;
@Mapper
public interface CtoVariantTableMapper extends IBaseMapper<CtoVariantTable>, InsertListMapper<CtoVariantTable> {
void insertData(CtoVariantTable variantTable);
}
package cn.com.uitech.authorization.mapper;
import cn.com.uitech.authorization.pojo.dto.PriceAndOdInfoDTO;
import cn.com.uitech.authorization.pojo.dto.PriceHistory;
import cn.com.uitech.authorization.pojo.dto.PriceParamsDto;
import cn.com.uitech.authorization.pojo.entity.Price;
import cn.com.uitech.authorization.pojo.entity.PriceInfoDto;
import cn.com.uitech.authorization.pojo.entity.Pricecalexpression;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author Zhaoxl
*/
@Mapper
public interface PricecalexpressionMapper extends IBaseMapper<Pricecalexpression> {
/**
*
* @param priceParamsDto
* @return
*/
List<PriceInfoDto> getPriceStandModelList(PriceParamsDto priceParamsDto);
/**
*
* @param pricecalexpression
* @return
*/
Pricecalexpression getPriceModInfo(Pricecalexpression pricecalexpression);
/**
*
* @param priceParamsDto
* @return
*/
Integer getFatherPhId(PriceParamsDto priceParamsDto);
/**
*
* @param pricecalexpression
* @return
*/
Integer insertPriceModInfo(Pricecalexpression pricecalexpression);
/**
*
* @param pricecalexpression
* @return
*/
Integer updatePriceMod(Pricecalexpression pricecalexpression);
/**
*
* @param priceParamsDto
* @return
*/
Pricecalexpression getPriceModModel(PriceParamsDto priceParamsDto);
/**
*
* @param phId
* @return
*/
Integer getLevel(Integer phId);
/**
*
* @param pricecalexpression
*/
void updateStandardBomModel(Pricecalexpression pricecalexpression);
/**
*
* @param pricecalexpression
* @return
*/
Integer updatePriceConfirm(Pricecalexpression pricecalexpression);
/**
*
* @param pricecalexpression
* @return
*/
Integer updatePriceStandard(Pricecalexpression pricecalexpression);
/**
*
* @param pricecalexpression
* @return
*/
Integer updatePriceFourLevelStandard(Pricecalexpression pricecalexpression);
/**
*
* @param priceId
* @return
*/
Price getPriceInfo(Integer priceId);
/**
*
* @param pricecalexpression
* @return
*/
Integer insertPrice(Pricecalexpression pricecalexpression);
/**
*
* @return
*/
Integer selectMaxId();
/**
*
* @param pricecalexpression
* @return
*/
Integer updateCtoBomModel(Pricecalexpression pricecalexpression);
/**
*
* @param pricecalexpression
* @return
*/
Integer updatePriceCto(Pricecalexpression pricecalexpression);
/**
*
* @param pricecalexpression
* @return
*/
Integer updatePriceFourLevelCto(Pricecalexpression pricecalexpression);
/**
*
* @param priceParamsDto
* @return
*/
List<PriceInfoDto> getPriceCtoModelList(PriceParamsDto priceParamsDto);
/**
* 查询部件价格维护列表
* @param priceParamsDto
* @return PriceInfoDto
*/
List<PriceInfoDto> getPriceCtoTypeModelList(PriceParamsDto priceParamsDto);
void deletePriceMod(Pricecalexpression pricecalexpression);
/**
* 查询价格信息 od关系
* @param pricecalexpression
* @return
*/
PriceAndOdInfoDTO getPriceAndOdInfo(Pricecalexpression pricecalexpression);
Integer updatePricecale(Pricecalexpression pricecalexpression);
Integer getPhId(String bomCode, String productGroupCode);
void saveHistoryInfo(PriceHistory priceHistory);
void updateValueModel(Pricecalexpression pricecalexpression);
}
......@@ -27,12 +27,12 @@ public interface StandardModelManageMapper extends IBaseMapper<Characteristic>{
* @param characteristi
* @return 行数
*/
void updateDefaultValueZero(@Param("list") List<String> characteristi);
void updateDefaultValueZero(@Param("list") List<String> characteristi,@Param("superBomCode") String superBomCode);
/**
* 修改特征的默认值为1
* @param characteristiValue
* @return 行数
*/
void updateDefaultValueOne(List<String> characteristiValue);
void updateDefaultValueOne(@Param("list") List<String> characteristiValue,@Param("superBomCode") String superBomCode);
}
......@@ -30,7 +30,7 @@ public interface SuperTableInfoMapper extends IBaseMapper<SuperTableInfo>{
List<String> findVName(@Param("tablenumber") String tablenumber, @Param("characteristiccode") String characteristiccode, @Param("groupNumber") String groupNumber);
String findCNameByName(@Param("name") String name);
String findCNameByName(@Param("name") String name,String superBomCode);
String findVNameByName(@Param("name") String name);
}
package cn.com.uitech.authorization.mapper;
import cn.com.uitech.authorization.pojo.dto.DeployTempParam;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TempMapper {
DeployTempParam getTempList();
void updateTemp(DeployTempParam deployTempParam);
}
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 javax.persistence.Column;
import javax.persistence.Table;
@Accessors(chain = true)
@NoArgsConstructor
@Getter
@Setter
@ToString
@Table(name = "deploy_temp_item")
public class DeployTempItemParam {
@Column(name = "old_sku_code")
@ApiModelProperty(name = "oldSkuCode", value = "oldSkuCode", dataType = "String")
private String oldSkuCode;
@Column(name = "characteristic_code")
@ApiModelProperty(name = "characteristicCode", value = "特征code", dataType = "String")
private String characteristicCode;
@Column(name = "characteristic_name")
@ApiModelProperty(name = "characteristicName", value = "特征name", dataType = "String")
private String characteristicName;
@Column(name = "characteristic_value_code")
@ApiModelProperty(name = "characteristicValueCode", value = "特征值code", dataType = "String")
private String characteristicValueCode;
@Column(name = "characteristic_value_name")
@ApiModelProperty(name = "characteristicValueName", value = "特征值name", dataType = "String")
private String characteristicValueName;
}
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 javax.persistence.Column;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.List;
@Accessors(chain = true)
@NoArgsConstructor
@Getter
@Setter
@ToString
@Table(name = "deploy_temp")
public class DeployTempParam implements Serializable {
private static final long serialVersionUID = -4988257241712574537L;
@Column(name = "old_sku_code")
@ApiModelProperty(name = "oldSkuCode", value = "oldSkuCode", dataType = "String")
private String oldSkuCode;
@Column(name = "old_sku_name")
@ApiModelProperty(name = "oldSkuName", value = "oldSkuCode", dataType = "String")
private String oldSkuName;
@Column(name = "product_class_code")
@ApiModelProperty(name = "productClassCode", value = "产品类型code", dataType = "String")
private String productClassCode;
@Column(name = "product_class_name")
@ApiModelProperty(name = "productClassName", value = "产品类型名称", dataType = "String")
private String productClassName;
@Column(name = "super_bom_code")
@ApiModelProperty(name = "superBomCode", value = "superBomCode", dataType = "String")
private String superBomCode;
@Column(name = "super_bom_name")
@ApiModelProperty(name = "superBomName", value = "superBomName", dataType = "String")
private String superBomName;
@Column(name = "brand")
@ApiModelProperty(name = "brand", value = "品牌", dataType = "String")
private String brand;
@Column(name = "political_mining_id")
@ApiModelProperty(name = "politicalMiningId", value = "是否政采", dataType = "String")
private String politicalMiningId;
@Column(name = "patern")
@ApiModelProperty(name = "patern", value = "模式", dataType = "String")
private String patern;
@Column(name = "status")
@ApiModelProperty(name = "status", value = "状态", dataType = "String")
private String status;
@Column(name = "description")
@ApiModelProperty(name = "description", value = "描述", dataType = "String")
private String description;
private List<DeployTempItemParam> deployTempItemParams;
}
package cn.com.uitech.authorization.service;
import cn.com.uitech.authorization.pojo.dto.BoproductMTMTransDto;
/**
*/
public interface BoProductInfoService {
/**
* 修改产品MTM号
* @param dto
* @return
*/
String updateBoproductForMTM(BoproductMTMTransDto dto);
String lmsReturnMtm(BoproductMTMTransDto dto);
}
package cn.com.uitech.authorization.service;
import cn.com.uitech.authorization.pojo.dto.CtoConstrainDto;
import java.util.List;
/**
* @author xinsy
* @date 2021/8/26 12:49
* CTO 限配关系物料维护
*/
public interface CtoConstrainService {
void insertCtoConstrain(List<CtoConstrainDto> ctoConstrainDtoList);
}
package cn.com.uitech.authorization.service;
import cn.com.uitech.authorization.pojo.dto.PLMDocumentFromCRMDto;
public interface PlmWebService {
String sendPLMDocumentFromCRM(PLMDocumentFromCRMDto dto) throws Exception;
/**
* @param json
* @return 发起申请mtm号请求
*/
Boolean callMtmNoApplyFor(org.json.JSONObject json);
Boolean lmsCallMtmNoApplyFor(String json);
String lmsSendPLMDocumentFromCRM(PLMDocumentFromCRMDto dto) throws Exception;
}
package cn.com.uitech.authorization.service;
import cn.com.uitech.authorization.pojo.dto.PriceAndOdInfoDTO;
import cn.com.uitech.authorization.pojo.dto.PriceParamsDto;
import cn.com.uitech.authorization.pojo.entity.PriceInfoDto;
import cn.com.uitech.authorization.pojo.entity.Pricecalexpression;
import com.github.pagehelper.PageInfo;
public interface PricecalexpressionService {
PageInfo<PriceInfoDto> getPriceModelList(PriceParamsDto priceParamsDto);
Integer updatePriceMod(Pricecalexpression pricecalexpression);
Pricecalexpression getPriceModModel(PriceParamsDto priceParamsDto);
String updatePriceModel(Pricecalexpression pricecalexpression);
Integer updatePriceStandard(Pricecalexpression pricecalexpression);
Integer updatePriceFourLevelStandard(Pricecalexpression pricecalexpression);
Integer updatePriceCto(Pricecalexpression pricecalexpression);
Integer updatePriceFourLevelCto(Pricecalexpression pricecalexpression);
PriceAndOdInfoDTO getPriceAndOdInfo(Pricecalexpression pricecalexpression);
}
package cn.com.uitech.authorization.service;
public interface TempServer {
Object getTempList();
}
......@@ -82,6 +82,7 @@ public class CharacteristicServiceImpl implements CharacteristicService {
Condition condition = characteristicMapper.getCondition();
Example.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("characteristicCode", characteristicRequestParamDto.getCharacteristicCode());
criteria.andEqualTo("superBomCode", characteristicRequestParamDto.getSuperBomCode());
return characteristicMapper.selectOneByExample(condition);
}
......
......@@ -4,17 +4,12 @@ import cn.com.uitech.authorization.annotation.FieldNameMapping;
import cn.com.uitech.authorization.enums.CtoStatusEnum;
import cn.com.uitech.authorization.enums.SalesVisibleEnum;
import cn.com.uitech.authorization.exception.BizException;
import cn.com.uitech.authorization.mapper.CharacteristicMapper;
import cn.com.uitech.authorization.mapper.CharacteristicValueMapper;
import cn.com.uitech.authorization.mapper.CtoBomMapper;
import cn.com.uitech.authorization.mapper.OdRelationMapper;
import cn.com.uitech.authorization.pojo.dto.*;
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;
import cn.com.uitech.authorization.service.SecurityService;
import cn.com.uitech.authorization.utils.ApiResult;
import cn.com.uitech.authorization.utils.ProductExportUtils;
import com.alibaba.fastjson.JSON;
......@@ -32,8 +27,6 @@ import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
......@@ -79,7 +72,6 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic
@Value("${plm.urlH}")
private String plmUrlH;
private static Logger logger = LoggerFactory.getLogger(CharacteristicValueServiceImpl.class);
/**
* 分页查询特征值数据
......@@ -236,7 +228,6 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic
SXSSFWorkbook sxssfWorkbook = ProductExportUtils.getSXSSFWorkbook(sheetName, titList, datalist);
ProductExportUtils.export(sxssfWorkbook, sheetName + name, response);
} catch (Exception e) {
logger.error("导出失败原因是:", e);
throw new BizException(ApiResult.INTERNAL_SERVER_ERROR, e.getMessage());
}
......@@ -300,7 +291,6 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic
int result = 0;
//判断文件是否为空
if (null == file || file.isEmpty()) {
logger.error("特征值上传文件批量更新-上传的文件是空的");
throw new BizException(ApiResult.API_REQ_DATA_IS_FAIL, "特征值上传文件批量更新-上传文件为空");
}
//读取文件内容
......@@ -312,7 +302,6 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic
return String.valueOf(checkFileIsNnull);
}
} else {
logger.error("特征值上传文件批量更新-上传文件没有读取到数据.");
}
updateData(list);
......@@ -325,7 +314,6 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic
* @根据特征值编码和产品组更新特征表
*/
public void updateData(List<CharacteristicValueExportDto> list) {
logger.info("特征值上传文件批量更新-更新特征值表开始");
//更新数据库里数据
ArrayList<CharacteristicValue> updateList = new ArrayList<>();
list.stream().forEach((dto) -> {
......@@ -341,7 +329,6 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic
condition.createCriteria().andEqualTo("characteristicValueCode", c.getCharacteristicValueCode());
characteristicValueMapper.updateByExampleSelective(c, condition);
}
logger.info("特征值上传文件批量更新-更新特征值表成功");
}
;
......@@ -352,7 +339,6 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic
* @desc 对上传的数据做非空校验
*/
public ArrayList<String> checkFileIsNnull(List<CharacteristicValueExportDto> list) {
logger.info("特征值上传文件批量更新-上传文件非空检验开始");
ArrayList<String> checkList = new ArrayList<>();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < list.size(); i++) {
......@@ -371,7 +357,6 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic
checkList.add(sb.toString());
}
}
logger.info("特征值上传文件批量更新-上传文件非空检验结束");
return checkList;
}
......@@ -382,7 +367,6 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic
* @desc 解析上传文件
*/
public List<CharacteristicValueExportDto> uploadExcl(MultipartFile file) {
logger.info("特征值上传文件批量更新-读取文件数据开始");
long startDate = Calendar.getInstance().getTimeInMillis();
List<CharacteristicValueExportDto> list = Lists.newArrayList();
......@@ -408,11 +392,9 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic
}
}
} catch (Exception e) {
logger.error("特征值上传文件批量更新-文件读取失败原因是:", e.getMessage());
e.printStackTrace();
}
long endDate = Calendar.getInstance().getTimeInMillis();
logger.info("特征值上传文件批量更新-读取文件数据完成,用时:" + String.valueOf(endDate - startDate));
return list;
}
......@@ -435,7 +417,6 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic
dto.setBomStatus(getCellValueByCell(row.getCell(5)));
}
} catch (Exception e) {
logger.error("特征值上传文件批量更新-读取上传数据转对象失败原因:", e.getMessage());
e.printStackTrace();
}
return dto;
......@@ -506,7 +487,6 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
String name = simpleDateFormat.format(new Date());
String fileName = bomCode + name + ".xlsx";
logger.info("文件名:" + fileName);
setResponseHeader(reponse, fileName);
os = reponse.getOutputStream();
......@@ -514,14 +494,12 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic
}
} catch (Exception e) {
e.printStackTrace();
logger.error("excel导出错误:" + e);
} finally {
try {
if (os != null) {
os.close();
}
} catch (Exception e) {
logger.error("关闭输出流错误!", e);
}
}
}
......@@ -537,7 +515,6 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic
fileName = new String(fileName.getBytes(), "ISO8859-1");
} catch (Exception e) {
e.printStackTrace();
logger.error("excel导出错误:" + e);
}
response.setHeader("Access-Control-Expose-Headers", fileName);
response.setContentType("application/octet-stream;charset=ISO8859-1");
......@@ -546,7 +523,6 @@ public class CharacteristicValueServiceImpl implements CharacteristicValueServic
response.addHeader("Cache-Control", "no-cache");
} catch (Exception ex) {
ex.printStackTrace();
logger.error("excel导出错误:" + ex);
}
}
......
package cn.com.uitech.authorization.service.impl;
import cn.com.uitech.authorization.exception.BizException;
import cn.com.uitech.authorization.mapper.BomStatusMapper;
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;
import cn.com.uitech.authorization.pojo.entity.ProductDescription;
import cn.com.uitech.authorization.pojo.entity.ProductGroup;
import cn.com.uitech.authorization.service.CtoBomService;
import cn.com.uitech.authorization.utils.ApiResult;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import tk.mybatis.mapper.entity.Condition;
import tk.mybatis.mapper.entity.Example;
import java.sql.Timestamp;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Set;
/**
* @author yangkuo
......@@ -54,11 +44,6 @@ public class CtoBomServiceImpl implements CtoBomService {
@Autowired
private BomStatusMapper bomStatusMapper;
private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(CtoBomServiceImpl.class);
private DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss SSS");
/**
* 分页查询cto物料信息
*
......
package cn.com.uitech.authorization.service.impl;
import cn.com.uitech.authorization.exception.BizException;
import cn.com.uitech.authorization.mapper.CtoConstrainMapper;
import cn.com.uitech.authorization.mapper.CtoVariantTableMapper;
import cn.com.uitech.authorization.pojo.dto.CtoConstrainDto;
import cn.com.uitech.authorization.pojo.entity.CtoConstrain;
import cn.com.uitech.authorization.pojo.entity.CtoVariantTable;
import cn.com.uitech.authorization.service.CtoConstrainService;
import cn.com.uitech.authorization.utils.ApiResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import tk.mybatis.mapper.entity.Condition;
import java.util.List;
import java.util.Objects;
@Service
public class CtoConstrainServiceImpl implements CtoConstrainService {
@Autowired
private CtoConstrainMapper ctoConstrainMapper;
@Autowired
private CtoVariantTableMapper ctoVariantTableMapper;
private static final Logger logger = LoggerFactory.getLogger(CtoConstrainServiceImpl.class);
@Override
public void insertCtoConstrain(List<CtoConstrainDto> ctoConstrainDtoList) {
if(CollectionUtils.isEmpty(ctoConstrainDtoList)){
throw new BizException(ApiResult.SERVER_CHECK_DATA_IS_ERROR,"数据不能为空");
}
for (CtoConstrainDto ctoConstrainDto : ctoConstrainDtoList) {
Condition condition = ctoConstrainMapper.getCondition();
condition.createCriteria().andEqualTo("vtName", ctoConstrainDto.getVtName());
CtoConstrain ctoConstrain = ctoConstrainMapper.selectOneByExample(condition);
//非空删除原数据
if(!Objects.isNull(ctoConstrain)){
logger.info("非空删除原数据");
ctoConstrainMapper.deleteByExample(condition);
Condition tableMapperCondition = ctoVariantTableMapper.getCondition();
tableMapperCondition.createCriteria().andEqualTo("vtName", ctoConstrainDto.getVtName());
ctoVariantTableMapper.deleteByExample(tableMapperCondition);
}
CtoConstrain ctoConstrainEntity = new CtoConstrain();
BeanUtils.copyProperties(ctoConstrainDto, ctoConstrainEntity);
ctoConstrainMapper.insert(ctoConstrainEntity);
logger.info("ctoConstrain数据插入完成");
List<CtoVariantTable> ctoVariantTables = ctoConstrainDto.getCtoVariantTables();
if(!CollectionUtils.isEmpty(ctoVariantTables)){
for (CtoVariantTable variantTable : ctoVariantTables) {
variantTable.setVtName(ctoConstrainDto.getVtName());
ctoVariantTableMapper.insertData(variantTable);
}
logger.info("ctoVariantTable数据插入完成");
}
}
}
}
......@@ -382,7 +382,7 @@ public class IntegrateServiceImpl implements IntegrateService {
//1.申请SKU->验证配置是否存在->存在->是否生成SKU->生成SKU->返回SKU信息
superBomSkuInfo.setSkuCode(getSkuByConfigId.getSkuCode());
superBomSkuInfo.setSkuName(getSkuByConfigId.getSkuName());
result.setMsg("配置已存在SKUCode:"+superBomSkuInfo.getSkuCode());
result.setMsg("配置已存在:SKUCode:"+superBomSkuInfo.getSkuCode());
result.setCode(500);
result.setData(superBomSkuInfo);
return result;
......
package cn.com.uitech.authorization.service.impl;
import cn.com.uitech.authorization.constant.ResourceNameConstant;
import cn.com.uitech.authorization.exception.BizException;
import cn.com.uitech.authorization.pojo.dto.PLMDocumentFromCRMDto;
import cn.com.uitech.authorization.service.PlmWebService;
import cn.com.uitech.authorization.utils.ApiResult;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.rpc.client.RPCServiceClient;
import org.apache.axis2.transport.http.HTTPAuthenticator;
import org.apache.axis2.transport.http.HTTPConstants;
import org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.xml.namespace.QName;
/**
* @author xinsy
*/
@Service
public class PlmWebServiceImpl implements PlmWebService {
@Value("${webservices.username}")
private String username;
@Value("${webservices.password}")
private String password;
@Value("${webservices.url}")
private String url;
@Value("${webservices.namespace}")
private String namespace;
@Value("${webservices.interfaces}")
private String interfaces;
@Value("${webservices.lms-url}")
private String lmsUrl;
@Value("${webservices.lms-interfaces}")
private String lmsInterfaces;
private static Logger logger = LoggerFactory.getLogger(PlmWebServiceImpl.class);
@Override
public String sendPLMDocumentFromCRM(PLMDocumentFromCRMDto dto) throws Exception{
RPCServiceClient serviceClient = new RPCServiceClient();
Options options = serviceClient.getOptions();
HTTPAuthenticator httpAuthenticator = new HttpTransportPropertiesImpl.Authenticator();
httpAuthenticator.setUsername(username);
httpAuthenticator.setPassword(password);
options.setProperty(HTTPConstants.AUTHENTICATE,httpAuthenticator);
options.setProperty(HTTPConstants.CHAR_SET_ENCODING,"UTF-8");
EndpointReference endpointReferenceUri=new EndpointReference(url);
options.setTo(endpointReferenceUri);
serviceClient.setOptions(options);
//转unioncode
// String param = gbEncoding(dto.getCreatePLMDocumentFromCRM());
Object[] opAddEntryArgs = new Object[]{"createPLMDocumentFromCRM", dto.getCreatePLMDocumentFromCRM()};
Class[] classes = new Class[] {String.class};
QName opAddEntry = new QName(namespace, interfaces);
Object object= serviceClient.invokeBlocking(opAddEntry, opAddEntryArgs, classes)[0];
return object.toString();
}
/**
* @param json
* @return 发起申请mtm号请求
*/
@Override
public Boolean callMtmNoApplyFor(JSONObject json ){
if(null == json){
throw new BizException(ApiResult.IS_NOT_NULL,"请求windChill接口无参数");
}
logger.info("开始请求mtm号申请接口");
logger.info("mtm号申请接口 参数: "+json.toString());
PLMDocumentFromCRMDto dto = new PLMDocumentFromCRMDto(json.toString());
try {
long startTime = System.currentTimeMillis(); //获取开始时间
String s = sendPLMDocumentFrom(dto);
long endTime = System.currentTimeMillis(); //返回时间
System.out.println("程序运行时间:" + (endTime - startTime) + "ms"); //输出程序运行时间
logger.info("程序运行时间:" + (endTime - startTime) + "ms");
logger.info("mtm号申请接口 返回结果:"+s);
if(ResourceNameConstant.OK.equalsIgnoreCase(s)){
logger.info("mtm号申请成功");
return true;
}else{
throw new BizException(ApiResult.EXPIRED,"MTM号申请在Windchill没有下单成功");
}
} catch (Exception e){
e.printStackTrace();
logger.info("mtm号申请失败");
throw new BizException(ApiResult.FAIL,"Windchill申请MTM号接口故障");
}
}
/**
* @param json
* @return 发起申请mtm号请求
*/
@Override
public Boolean lmsCallMtmNoApplyFor(String json ){
if(null == json){
throw new BizException(ApiResult.IS_NOT_NULL,"请求windChill接口无参数");
}
logger.info("开始请求mtm号申请接口");
logger.info("mtm号申请接口 参数: "+json.toString());
PLMDocumentFromCRMDto dto = new PLMDocumentFromCRMDto(json.toString());
try {
long startTime = System.currentTimeMillis(); //获取开始时间
String s = lmsSendPLMDocumentFromCRM(dto);
long endTime = System.currentTimeMillis(); //返回时间
System.out.println("程序运行时间:" + (endTime - startTime) + "ms"); //输出程序运行时间
logger.info("程序运行时间:" + (endTime - startTime) + "ms");
logger.info("mtm号申请接口 返回结果:"+s);
if(ResourceNameConstant.OK.equalsIgnoreCase(s)){
logger.info("mtm号申请成功");
return true;
}else{
throw new BizException(ApiResult.EXPIRED,"MTM号申请在Windchill没有下单成功");
}
} catch (Exception e){
e.printStackTrace();
logger.info("mtm号申请失败");
throw new BizException(ApiResult.FAIL,"Windchill申请MTM号接口故障");
}
}
@Override
public String lmsSendPLMDocumentFromCRM(PLMDocumentFromCRMDto dto) throws Exception {
RPCServiceClient serviceClient = new RPCServiceClient();
Options options = serviceClient.getOptions();
HTTPAuthenticator httpAuthenticator = new HttpTransportPropertiesImpl.Authenticator();
httpAuthenticator.setUsername(username);
httpAuthenticator.setPassword(password);
options.setProperty(HTTPConstants.AUTHENTICATE,httpAuthenticator);
options.setProperty(HTTPConstants.CHAR_SET_ENCODING,"UTF-8");
EndpointReference endpointReferenceUri=new EndpointReference(lmsUrl);
options.setTo(endpointReferenceUri);
serviceClient.setOptions(options);
//转unioncode
// String param = gbEncoding(dto.getCreatePLMDocumentFromCRM());
Object[] opAddEntryArgs = new Object[]{"createPLMDocumentFromCRM", dto.getCreatePLMDocumentFromCRM()};
Class[] classes = new Class[] {String.class};
QName opAddEntry = new QName(namespace, lmsInterfaces);
Object object= serviceClient.invokeBlocking(opAddEntry, opAddEntryArgs, classes)[0];
return object.toString();
}
/**
* @desc 调用windchill 的webService
* @param dto
* @return
* @throws Exception
*/
public String sendPLMDocumentFrom(PLMDocumentFromCRMDto dto) throws Exception{
RPCServiceClient serviceClient = new RPCServiceClient();
Options options = serviceClient.getOptions();
HTTPAuthenticator httpAuthenticator = new HttpTransportPropertiesImpl.Authenticator();
httpAuthenticator.setUsername(username);
httpAuthenticator.setPassword(password);
options.setProperty(HTTPConstants.AUTHENTICATE,httpAuthenticator);
options.setProperty(HTTPConstants.CHAR_SET_ENCODING,"UTF-8");
EndpointReference endpointReferenceUri=new EndpointReference(url);
options.setTo(endpointReferenceUri);
serviceClient.setOptions(options);
//转unioncode
// String param = gbEncoding(dto.getCreatePLMDocumentFromCRM());
Object[] opAddEntryArgs = new Object[]{"createPLMDocumentFromCRM", dto.getCreatePLMDocumentFromCRM()};
Class[] classes = new Class[] {String.class};
QName opAddEntry = new QName(namespace, interfaces);
Object object= serviceClient.invokeBlocking(opAddEntry, opAddEntryArgs, classes)[0];
return object.toString();
}
}
......@@ -12,8 +12,6 @@ import cn.com.uitech.authorization.pojo.entity.Characteristic;
import cn.com.uitech.authorization.service.StandardModelManageService;
import cn.com.uitech.authorization.utils.ApiResult;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -32,7 +30,6 @@ import java.util.List;
@Transactional(rollbackFor = Exception.class)
public class StandardModelManageServiceImpl implements StandardModelManageService {
private static Logger LOGGER = LoggerFactory.getLogger(StandardModelManageServiceImpl.class);
@Autowired
private CtoBomMapper ctoBomMapper;
......@@ -92,9 +89,9 @@ public class StandardModelManageServiceImpl implements StandardModelManageServic
throw new BizException(ApiResult.API_REQ_DATA_IS_FAIL);
}
//根据特征编码把下面所有的特征值更行成0非默认
standardModelManageMapper.updateDefaultValueZero(characteristi);
standardModelManageMapper.updateDefaultValueZero(characteristi,dto.getSuperBomCode());
//根据特征值编码把特征值更新为1 默认选中
standardModelManageMapper.updateDefaultValueOne(characteristiValue);
standardModelManageMapper.updateDefaultValueOne(characteristiValue,dto.getSuperBomCode());
//更新cto的configId
ctoBomMapper.updateConfigId(dto);
}
......@@ -106,7 +103,6 @@ public class StandardModelManageServiceImpl implements StandardModelManageServic
* @param bomCode
*/
public String bulderVCode(StandardModelManageCodeDto children,String bomCode){
LOGGER.info("基准机型管理开始构建数量cv的特征值code");
String characteristicCode = children.getCharacteristicCode();
String characteristicValueCode = children.getCharacteristicValueCode();
int len = 10 - characteristicCode.length();
......@@ -114,7 +110,6 @@ public class StandardModelManageServiceImpl implements StandardModelManageServic
String vCode ="0000"+characteristicValueCode;
String code = bomCode+("000000000".substring(0,len))+characteristicCode+(vCode.substring(vCode.length()-4,vCode.length()));
LOGGER.info("基准机型管理数量cv的特征值code是:"+code);
return code;
}
......
package cn.com.uitech.authorization.service.impl;
import cn.com.uitech.authorization.controller.IntegrateController;
import cn.com.uitech.authorization.mapper.TempMapper;
import cn.com.uitech.authorization.pojo.dto.BuildConfigurationInputDTO;
import cn.com.uitech.authorization.pojo.dto.DeployTempItemParam;
import cn.com.uitech.authorization.pojo.dto.DeployTempParam;
import cn.com.uitech.authorization.pojo.dto.GetProductOutDto;
import cn.com.uitech.authorization.pojo.entity.SelectorEntity;
import cn.com.uitech.authorization.pojo.entity.SuperBomSkuConfigInfo;
import cn.com.uitech.authorization.pojo.entity.SuperBomSkuInfo;
import cn.com.uitech.authorization.service.TempServer;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Service
@Transactional
public class TempServiceImpl implements TempServer {
@Autowired
private TempMapper tempMapper;
@Autowired
private IntegrateController integrateController;
@Autowired
private IntegrateServiceImpl integrateService;
@Override
public Object getTempList() {
GetProductOutDto result = new GetProductOutDto();
//获取未开始的信息进行操作
DeployTempParam deployTempParam = tempMapper.getTempList();
if(!ObjectUtils.isEmpty(deployTempParam)){
//循环生成configid,保存sku信息,申请sku
//构建生成配置参数
BuildConfigurationInputDTO buildConfigurationInputDTO = new BuildConfigurationInputDTO();
buildConfigurationInputDTO.setProductGroupCode(deployTempParam.getProductClassCode());
buildConfigurationInputDTO.setProductClassCode(deployTempParam.getProductClassCode());
buildConfigurationInputDTO.setMaterialCode(deployTempParam.getSuperBomCode());
buildConfigurationInputDTO.setOperator("system");
buildConfigurationInputDTO.setSelectedComplete(true);
//构建初始化接口 获取sessionId
SelectorEntity selectorEntity = new SelectorEntity();
selectorEntity.setIsShow(1);
selectorEntity.setOperator("system");
selectorEntity.setSystem("ZG");
selectorEntity.setProductClassCode(deployTempParam.getProductClassCode());
selectorEntity.setSuperBomCode(deployTempParam.getSuperBomCode());
Object initializationData = integrateController.initializationData(selectorEntity);
Map<String,Object> initMap= (Map<String, Object>) JSONObject.toJSON(initializationData);
Map<String,Object> dataMap = (Map<String, Object>) initMap.get("data");
String sessionId = (String) dataMap.get("sessionId");
buildConfigurationInputDTO.setSessionId(sessionId);
List<BuildConfigurationInputDTO.SelectedCharacteristicListBean> selectedCharacteristicListBeans = new ArrayList<>();
//获取的未开始的item信息
deployTempParam.getDeployTempItemParams().forEach(selectedCharacteristic->{
BuildConfigurationInputDTO.SelectedCharacteristicListBean selectedCharacteristicListBean = new BuildConfigurationInputDTO.SelectedCharacteristicListBean();
//根据 list里面的vcode 查询v信息和c信息 赋值到 生成配置的对象里
selectedCharacteristicListBean.setCharacteristicName(selectedCharacteristic.getCharacteristicName());
selectedCharacteristicListBean.setCharacteristicValueName(selectedCharacteristic.getCharacteristicValueName());
selectedCharacteristicListBean.setQuantity(1);
selectedCharacteristicListBeans.add(selectedCharacteristicListBean);
});
buildConfigurationInputDTO.setSelectedCharacteristicList(selectedCharacteristicListBeans);
buildConfigurationInputDTO.setKeyValues(null);
Object buildConfiguration = integrateController.buildConfiguration(buildConfigurationInputDTO, null);
Map<String,Object> buildConfigurationMap = (Map<String, Object>) JSONObject.toJSON(buildConfiguration);
String configId = (String) buildConfigurationMap.get("configId");
SuperBomSkuInfo skuInfo = new SuperBomSkuInfo();
skuInfo.setConfigId(configId);
skuInfo.setPoliticalMiningId(deployTempParam.getPoliticalMiningId());
skuInfo.setPatern(deployTempParam.getPatern());
skuInfo.setBrand(deployTempParam.getBrand());
skuInfo.setSuperBomCode(deployTempParam.getSuperBomCode());
skuInfo.setSuperBomName(deployTempParam.getSuperBomName());
skuInfo.setProductClassCode(deployTempParam.getProductClassCode());
skuInfo.setProductClassName(deployTempParam.getProductClassName());
List<SuperBomSkuConfigInfo> configInfoList = new ArrayList<>();
List<DeployTempItemParam> deployTempItemParams = deployTempParam.getDeployTempItemParams();
deployTempItemParams.forEach(param->{
SuperBomSkuConfigInfo configInfo = new SuperBomSkuConfigInfo();
configInfo.setCharacteristicCode(param.getCharacteristicCode());
configInfo.setCharacteristicName(param.getCharacteristicName());
configInfo.setCharacteristicValueCode(param.getCharacteristicValueCode());
configInfo.setCharacteristicValueName(param.getCharacteristicValueName());
configInfoList.add(configInfo);
});
skuInfo.setCharacteristicList(configInfoList);
Object object = integrateService.GetSKUByConfigInfo(skuInfo);
boolean flag = object instanceof GetProductOutDto;
if(flag){
Object o = JSONObject.toJSON(object);
Map<String, Object> map = (Map<String, Object>) o;
Integer code = (Integer) map.get("code");
if (code.equals(200)) {
JSONObject data = (JSONObject) map.get("data");
result.setCode(200);
result.setData(data);
} else {
String msg = (String) map.get("msg");
if(msg.contains("配置已存在:SKUCode:")){
String skuCode = msg.substring(14, msg.length());
deployTempParam.setStatus("已完成");
deployTempParam.setDescription(skuCode);
tempMapper.updateTemp(deployTempParam);
}else{
deployTempParam.setStatus("失败");
deployTempParam.setDescription(msg);
tempMapper.updateTemp(deployTempParam);
}
result.setCode(code);
result.setMsg(msg);
}
}
}else{
result.setCode(200);
result.setMsg("数据初始化完成");
}
return result;
}
}
package cn.com.uitech.authorization.utils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.http.HttpServletRequest;
/**
......@@ -11,8 +9,7 @@ import javax.servlet.http.HttpServletRequest;
* @date 2018/8/13 12:42
*/
public class IPUtils {
private static Logger logger = LoggerFactory.getLogger(IPUtils.class);
/**
* 获取IP地址
* 使用Nginx等反向代理软件, 则不能通过request.getRemoteAddr()获取IP地址
......@@ -38,7 +35,6 @@ public class IPUtils {
ip = request.getRemoteAddr();
}
} catch (Exception e) {
logger.error("IPUtils ERROR ", e);
}
// //使用代理,则获取第一个IP地址
......
......@@ -3,8 +3,6 @@ package cn.com.uitech.authorization.utils;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.List;
......@@ -21,7 +19,6 @@ public class JsonUtils {
public static final ObjectMapper mapper = new ObjectMapper();
private static final Logger logger = LoggerFactory.getLogger(JsonUtils.class);
//json化
public static String toString(Object obj) {
......@@ -34,7 +31,6 @@ public class JsonUtils {
try {
return mapper.writeValueAsString(obj);
} catch (JsonProcessingException e) {
logger.error("json序列化出错:" + obj, e);
return null;
}
}
......@@ -44,7 +40,6 @@ public class JsonUtils {
try {
return mapper.readValue(json, tClass);
} catch (IOException e) {
logger.error("json解析出错:" + json, e);
return null;
}
}
......@@ -54,7 +49,6 @@ public class JsonUtils {
try {
return mapper.readValue(json, mapper.getTypeFactory().constructCollectionType(List.class, eClass));
} catch (IOException e) {
logger.error("json解析出错:" + json, e);
return null;
}
}
......@@ -64,7 +58,6 @@ public class JsonUtils {
try {
return mapper.readValue(json, mapper.getTypeFactory().constructMapType(Map.class, kClass, vClass));
} catch (IOException e) {
logger.error("json解析出错:" + json, e);
return null;
}
}
......@@ -74,7 +67,6 @@ public class JsonUtils {
try {
return mapper.readValue(json, type);
} catch (IOException e) {
logger.error("json解析出错:" + json, e);
return null;
}
}
......
......@@ -11,7 +11,7 @@
b.*,
c.is_State as bomStatus
FROM super_characteristic_value_info a
LEFT JOIN super_characteristic_info b ON a.Characteristic_Code=b.Characteristic_Code
LEFT JOIN super_characteristic_info b ON a.Characteristic_Code=b.Characteristic_Code and a.super_bom_code=b.super_bom_code
LEFT JOIN super_bom_info c ON a.super_bom_code=c.super_bom_code
LEFT JOIN a_productclasscode d on c.product_class_code=d.product_class_code
<where>
......@@ -143,11 +143,17 @@
b.characteristic_name as characteristicName
FROM super_characteristic_value_info a
LEFT JOIN super_characteristic_info b ON
a.Characteristic_Code=b.Characteristic_Code
a.Characteristic_Code=b.Characteristic_Code and A.super_BOM_Code = b.super_BOM_Code
LEFT JOIN super_bom_info c ON a.super_BOM_Code=c.super_BOM_Code
<where>
<if test="characteristicValueCode!=null and characteristicValueCode!=''">
Characteristic_Value_Code=#{characteristicValueCode}
a.Characteristic_Value_Code=#{characteristicValueCode}
</if>
<if test="characteristicCode!=null and characteristicCode!=''">
and b.Characteristic_Code=#{characteristicCode}
</if>
<if test="superBomCode!=null and superBomCode!=''">
and c.super_bom_code=#{superBomCode}
</if>
</where>
) a
......@@ -316,7 +322,9 @@
<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
left join super_characteristic_info b
on a.characteristic_code = b.characteristic_code
and a.super_bom_code = b.super_bom_code
where characteristic_value_name = #{characteristicValueName}
and a.super_bom_code = #{superBomCode}
and b.characteristic_name= #{characteristicName}
......
......@@ -249,7 +249,6 @@
update super_bom_info set
super_bom_name = #{superBomName},
description = #{description},
type = #{type},
model_status = #{modelStatus},
unis_sales_name = #{unisSalesName},
brand = #{brand},
......@@ -341,7 +340,7 @@
FROM
super_bom_info
A LEFT JOIN super_characteristic_info b ON A.super_bom_code = b.super_bom_code
LEFT JOIN super_characteristic_value_info C ON b.characteristic_code = C.characteristic_code
LEFT JOIN super_characteristic_value_info C ON b.characteristic_code = C.characteristic_code and A.super_bom_code = c.super_bom_code
WHERE
A.super_bom_code = #{ superBomCode }
AND A.product_class_code = #{ productClassCode}
......@@ -359,7 +358,7 @@
FROM
super_bom_info
A LEFT JOIN super_characteristic_info b ON A.super_bom_code = b.super_bom_code
LEFT JOIN super_characteristic_value_info C ON b.characteristic_code = C.characteristic_code
LEFT JOIN super_characteristic_value_info C ON b.characteristic_code = C.characteristic_code and A.super_bom_code = c.super_bom_code
WHERE
A.super_bom_code = #{ materialCode }
AND A.product_class_code = #{ productGroupCode}
......
<?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.CtoVariantTableMapper">
<insert id="insertData" parameterType="cn.com.uitech.authorization.pojo.entity.CtoVariantTable">
INSERT INTO ctovarianttable(vtname, linecode, r3code, r3value)
VALUES (#{vtName},#{lineCode},#{r3Code},#{r3Value});
</insert>
</mapper>
\ No newline at end of file
......@@ -23,12 +23,12 @@
characteristicvalue.characteristic_Value_name
FROM super_characteristic_info
LEFT JOIN super_characteristic_value_info
ON characteristicvalue.characteristic_code=characteristic.characteristic_code
ON characteristicvalue.characteristic_code=characteristic.characteristic_code and super_characteristic_info.super_bom_code = super_characteristic_value_info.super_bom_code
WHERE characteristic.super_bom_code=#{superBomCode}
</select>
<!--根据特征编码把所有下面的特征值更新为非默认0-->
<update id="updateDefaultValueOne" parameterType="list">
<update id="updateDefaultValueOne">
UPDATE super_characteristic_value_info
SET is_base = 1
<where>
......@@ -38,12 +38,15 @@
#{item}
</foreach>
</if>
<if test="superBomCode !=null and superBomCode !='' ">
and super_bom_code = #{superBomCode}
</if>
</where>
</update>
<!--根据特征值编码把所有特征值更新为默认1-->
<update id="updateDefaultValueZero" parameterType="list">
<update id="updateDefaultValueZero" >
UPDATE super_characteristic_info
SET is_Show=1
<where>
......@@ -53,6 +56,9 @@
#{item}
</foreach>
</if>
<if test="superBomCode !=null and superBomCode !='' ">
and super_bom_code = #{superBomCode}
</if>
</where>
</update>
......
......@@ -65,13 +65,13 @@
select distinct group_number groupnumber from super_table_item_info where table_number = #{tablenumber}
</select>
<select id="findCName" resultType="map">
select distinct c.characteristic_code characteristiccode,c.characteristic_name characteristicname from super_table_item_info b left join super_characteristic_info c on b.characteristic_code = c.characteristic_code where b.table_number =#{tablenumber} and b.group_number = #{groupNumber}
select distinct c.characteristic_code characteristiccode,c.characteristic_name characteristicname from super_table_item_info b left join super_characteristic_info c on b.characteristic_code = c.characteristic_code and b.super_bom_code=c.super_bom_code where b.table_number =#{tablenumber} and b.group_number = #{groupNumber}
</select>
<select id="findVName" resultType="java.lang.String">
select distinct COALESCE(d.characteristic_value_name,'None') from super_table_item_info b left join super_characteristic_value_info d on b.characteristic_value_code = d.characteristic_value_code where b.table_number =#{tablenumber} and b.group_number = #{groupNumber} and b.characteristic_code = #{characteristiccode}
select distinct COALESCE(d.characteristic_value_name,'None') from super_table_item_info b left join super_characteristic_value_info d on b.characteristic_value_code = d.characteristic_value_code and b.super_bom_code=d.super_bom_code where b.table_number =#{tablenumber} and b.group_number = #{groupNumber} and b.characteristic_code = #{characteristiccode}
</select>
<select id="findCNameByName" resultType="java.lang.String">
select unis_sales_c_name from super_characteristic_info where characteristic_name = #{name}
select unis_sales_c_name from super_characteristic_info where characteristic_name = #{name} and super_bom_code = #{superBomCode}
</select>
<select id="findVNameByName" resultType="java.lang.String">
select unis_sales_v_name from super_characteristic_value_info where characteristic_value_name = #{name} limit 1
......
<?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.TempMapper">
<resultMap id="DeployTempMap" type="cn.com.uitech.authorization.pojo.dto.DeployTempParam">
<result property="oldSkuCode" column="old_sku_code"/>
<result property="oldSkuName" column="old_sku_name"/>
<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="politicalMiningId" column="political_mining_id"/>
<result property="patern" column="patern"/>
<result property="status" column="status"/>
<result property="description" column="description"/>
<collection property="deployTempItemParams" ofType="cn.com.uitech.authorization.pojo.dto.DeployTempItemParam">
<result property="oldSkuCode" column="old_sku_code"/>
<result property="characteristicCode" column="characteristic_code"/>
<result property="characteristicName" column="characteristic_name"/>
<result property="characteristicValueCode" column="characteristic_value_code"/>
<result property="characteristicValueName" column="characteristic_value_name"/>
</collection>
</resultMap>
<select id="getTempList" resultMap="DeployTempMap">
select * from deploy_temp a left join deploy_temp_item b on a.old_sku_code = b.old_sku_code
where a.status = '未开始'
</select>
<update id="updateTemp">
update deploy_temp set description = #{description} , status = #{status} where old_sku_code = #{oldSkuCode}
</update>
</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