Commit 107c7f4b by yangkuo

增加接口

parent 5ddf32e1
...@@ -76,4 +76,14 @@ public class ConfiguratorV2Controller { ...@@ -76,4 +76,14 @@ public class ConfiguratorV2Controller {
businessKeyHelper.getDataSourceFlag(postValidationInputV2DTO.getBusinessKey())); businessKeyHelper.getDataSourceFlag(postValidationInputV2DTO.getBusinessKey()));
} }
@ApiOperation(value = "异常验证", notes = "异常验证")
@PostMapping(value = "/tellMeWhy")
@ResponseStatus(HttpStatus.OK)
// @BizLog(action = "异常验证")
public TellMeWhyOutputDTO tellMeWhy(@RequestBody TellMeWhyInputDTO tellMeWhyInputDTO) {
return configuratorV2Service.tellMeWhy(tellMeWhyInputDTO,
businessKeyHelper.getTokenByBusinessKey(tellMeWhyInputDTO.getBusinessKey()),
businessKeyHelper.getDataSourceFlag(tellMeWhyInputDTO.getBusinessKey()));
}
} }
package cn.com.uitech.config.dto;
//import com.lenovo.ccb.common.annotation.Key;
//import com.lenovo.ccb.common.annotation.Module;
import lombok.*;
import java.util.List;
/**
* @author leafinsight
*/
@Data
@Getter
@Setter
@NoArgsConstructor
@ToString
//@Module("异常验证")
public class TellMeWhyInputDTO {
// @Key(index=1,description = "业务关键字")
private String businessKey;
private String division;
private String bomCode;
// @Key(index=2,description = "操作人")
private String userCode;
private String role;
private String characteristicCode;
private String characteristicValueCode;
private List<BomInitializeOutputV2DTO.CharacteristicValuesBean> totalCharacteristicList;
private List<PreValidationInputV2DTO.SelectedCharacteristicBean> selectedCharacteristicList;
private String token;
private Boolean forceSelection;
private List<AttributesBeanDTO> attributes;
}
package cn.com.uitech.config.dto;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import java.util.List;
/**
* @author leafinsight
*/
@Getter
@Setter
@NoArgsConstructor
@ToString
public class TellMeWhyOutputDTO {
private List<String> conflictCharacteristicList;
private List<BomInitializeOutputV2DTO.CharacteristicValuesBean> activeValues;
private List<PreValidationInputV2DTO.SelectedCharacteristicBean> selectedCharacteristicList;
private String message;
private Boolean result;
private Boolean forceSelectionResult;
}
package cn.com.uitech.config.service; package cn.com.uitech.config.service;
import cn.com.uitech.config.dto.*; import cn.com.uitech.config.dto.*;
import cn.com.uitech.config.entity.ODData;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
public interface ConfiguratorV2Service { public interface ConfiguratorV2Service {
...@@ -17,6 +24,7 @@ public interface ConfiguratorV2Service { ...@@ -17,6 +24,7 @@ public interface ConfiguratorV2Service {
*/ */
PreValidationOutputV2DTO preValidate(PreValidationInputV2DTO preValidationInputV2DTO, String token, String dataSourceFlag) ; PreValidationOutputV2DTO preValidate(PreValidationInputV2DTO preValidationInputV2DTO, String token, String dataSourceFlag) ;
TellMeWhyOutputDTO tellMeWhy(TellMeWhyInputDTO tellMeWhyInputDTO, String token, String dataSourceFlag);
} }
...@@ -242,6 +242,7 @@ public class ConfiguratorCacheServiceImpl implements ConfiguratorCacheService { ...@@ -242,6 +242,7 @@ public class ConfiguratorCacheServiceImpl implements ConfiguratorCacheService {
//是新的VT table //是新的VT table
if (!aryData.containsKey(value.getId())) { if (!aryData.containsKey(value.getId())) {
ODData odData = new ODData(); ODData odData = new ODData();
//第一个key是行号(lineCode)第二个key是r3Code value是v值code
Map<Integer, Map<String, List<String>>> arySingleVT = new HashMap<>(); Map<Integer, Map<String, List<String>>> arySingleVT = new HashMap<>();
Map<String, List<String>> aryLineVT = new HashMap<>(); Map<String, List<String>> aryLineVT = new HashMap<>();
List<String> aryCV = new ArrayList<>(); List<String> aryCV = new ArrayList<>();
...@@ -250,8 +251,7 @@ public class ConfiguratorCacheServiceImpl implements ConfiguratorCacheService { ...@@ -250,8 +251,7 @@ public class ConfiguratorCacheServiceImpl implements ConfiguratorCacheService {
arySingleVT.put(value.getLinecode(), aryLineVT); arySingleVT.put(value.getLinecode(), aryLineVT);
List<String> aryR3Code = new ArrayList<>(); List<String> aryR3Code = new ArrayList<>();
for (ODChar odChar : aryChar for (ODChar odChar : aryChar ) {
) {
if (value.getId().equals(odChar.getIdVT())) { if (value.getId().equals(odChar.getIdVT())) {
aryR3Code.add(odChar.getField().toString()); aryR3Code.add(odChar.getField().toString());
} }
...@@ -263,7 +263,7 @@ public class ConfiguratorCacheServiceImpl implements ConfiguratorCacheService { ...@@ -263,7 +263,7 @@ public class ConfiguratorCacheServiceImpl implements ConfiguratorCacheService {
} else { } else {
ODData odData = aryData.get(value.getId()); ODData odData = aryData.get(value.getId());
Map<Integer, Map<String, List<String>>> arySingleVT = odData.getAryData(); Map<Integer, Map<String, List<String>>> arySingleVT = odData.getAryData();
//是全新的行 //是全新的行 判断是否存在当前的行号 不存在则添加进去
if (!arySingleVT.containsKey((value.getLinecode()))) { if (!arySingleVT.containsKey((value.getLinecode()))) {
Map<String, List<String>> aryLineVT = new HashMap<>(); Map<String, List<String>> aryLineVT = new HashMap<>();
List<String> aryCV = new ArrayList<>(); List<String> aryCV = new ArrayList<>();
...@@ -273,7 +273,7 @@ public class ConfiguratorCacheServiceImpl implements ConfiguratorCacheService { ...@@ -273,7 +273,7 @@ public class ConfiguratorCacheServiceImpl implements ConfiguratorCacheService {
aryData.put(value.getId(), odData); aryData.put(value.getId(), odData);
} else { } else {
Map<String, List<String>> aryLineVT = aryData.get(value.getId()).getAryData().get(value.getLinecode()); Map<String, List<String>> aryLineVT = aryData.get(value.getId()).getAryData().get(value.getLinecode());
//是全新的特征 //是全新的特征 判断当前行号下是存在本次循环的特征,没有则直接添加
if (!aryLineVT.containsKey(value.getR3Code().toString())) { if (!aryLineVT.containsKey(value.getR3Code().toString())) {
List<String> aryCV = new ArrayList<>(); List<String> aryCV = new ArrayList<>();
aryCV.add(value.getR3VCode().toString()); aryCV.add(value.getR3VCode().toString());
......
...@@ -3,6 +3,7 @@ server: ...@@ -3,6 +3,7 @@ server:
spring: spring:
redis: redis:
host: ${REDIS_HOST:10.101.49.3} host: ${REDIS_HOST:10.101.49.3}
port: ${REDIS_PORT:6379} port: ${REDIS_PORT:6379}
password: "CiEz-1309" password: "CiEz-1309"
cto-database: 14 cto-database: 14
......
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