|
@@ -20,7 +20,7 @@ public class VenderMapProcessor implements Processor {
|
|
|
//第二层map的key为厂商名称、产品名称等,指向厂商id
|
|
|
//2.第一层为DPManufacturerID、DPSpecificationID、DPSupplierID、DPInsurerID、DPMaintainerID时
|
|
|
//第二层为厂商id指向厂商id 或 型号id指向厂商id
|
|
|
- Map<String, Map> nameMap = new HashMap<>();
|
|
|
+ Map<String, Map<String, String>> nameMap = new HashMap<>();
|
|
|
String jsonStr = exchange.getIn().getBody(String.class);
|
|
|
System.out.println(jsonStr);
|
|
|
JSONObject json = JSONObject.parseObject(jsonStr);
|
|
@@ -34,7 +34,7 @@ public class VenderMapProcessor implements Processor {
|
|
|
exchange.getIn().setBody(exchange.getProperty("projectList"));
|
|
|
}
|
|
|
|
|
|
- public void buildNameMap(AllVender venders, Map<String, Map> nameMap) {
|
|
|
+ public void buildNameMap(AllVender venders, Map<String, Map<String, String>> nameMap) {
|
|
|
initMap(nameMap);
|
|
|
List<Manu> manuList = venders.getManuList();
|
|
|
List<Supp> suppList = venders.getSuppList();
|
|
@@ -46,15 +46,15 @@ public class VenderMapProcessor implements Processor {
|
|
|
handleMtn(nameMap,maintnList);
|
|
|
}
|
|
|
|
|
|
- public void initMap(Map<String, Map> nameMap) {
|
|
|
- String[] keyList = new String[]{"Manufacturer", "Brand", "Specification", "Supplier", "Insurer", "InsuranceNum", "Maintainer",
|
|
|
- "DPManufacturerID", "DPSpecificationID", "DPSupplierID", "DPInsurerID", "DPMaintainerID"};
|
|
|
+ public void initMap(Map<String, Map<String, String>> nameMap) {
|
|
|
+ String[] keyList = new String[]{"Manufacturer", "Brand", "Specification", "Supplier", "Insurer", "InsuranceNum"
|
|
|
+ , "AllInsuranceNum", "Maintainer", "DPManufacturerID", "DPSpecificationID", "DPSupplierID", "DPInsurerID", "DPMaintainerID"};
|
|
|
for (String key : keyList) {
|
|
|
nameMap.put(key, new HashMap<String, String>());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void handleMtn(Map<String, Map> nameMap, List<Maintn> maintnList){
|
|
|
+ public void handleMtn(Map<String, Map<String, String>> nameMap, List<Maintn> maintnList){
|
|
|
Set<String> visitedMaintainer = new HashSet<>();
|
|
|
Set<String> conflictMaintainer = new HashSet<>();
|
|
|
Map<String, String> maintainer = nameMap.get("Maintainer");
|
|
@@ -65,13 +65,14 @@ public class VenderMapProcessor implements Processor {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void handleInsurer(Map<String, Map> nameMap, List<Insure> insureList){
|
|
|
+ public void handleInsurer(Map<String, Map<String, String>> nameMap, List<Insure> insureList){
|
|
|
Date now = new Date();
|
|
|
Set<String> visitedInsurer = new HashSet<>();
|
|
|
Set<String> conflictInsurer = new HashSet<>();
|
|
|
Map<String, String> insurer = nameMap.get("Insurer");
|
|
|
Map<String, String> dpInsurerID = nameMap.get("DPInsurerID");
|
|
|
Map<String, String> insuranceNum = nameMap.get("InsuranceNum");
|
|
|
+ Map<String, String> allInsuranceNum = nameMap.get("AllInsuranceNum");
|
|
|
for(Insure i : insureList ){
|
|
|
fillMap(insurer,i.getName(),i.getVenderId(),visitedInsurer,conflictInsurer);
|
|
|
dpInsurerID.put(i.getVenderId(),i.getVenderId());
|
|
@@ -79,11 +80,12 @@ public class VenderMapProcessor implements Processor {
|
|
|
if(c.underWarranty(now)){
|
|
|
insuranceNum.put(c.getInsuranceNo(),i.getVenderId());
|
|
|
}
|
|
|
+ allInsuranceNum.put(c.getInsuranceNo(),i.getVenderId());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void handleSupplier(Map<String, Map> nameMap, List<Supp> suppList){
|
|
|
+ public void handleSupplier(Map<String, Map<String, String>> nameMap, List<Supp> suppList){
|
|
|
Set<String> visitedSupplier = new HashSet<>();
|
|
|
Set<String> conflictSupplier = new HashSet<>();
|
|
|
Map<String, String> supplier = nameMap.get("Supplier");
|
|
@@ -94,7 +96,7 @@ public class VenderMapProcessor implements Processor {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void handleMaunfacturer(Map<String, Map> nameMap, List<Manu> manuList) {
|
|
|
+ public void handleMaunfacturer(Map<String, Map<String, String>> nameMap, List<Manu> manuList) {
|
|
|
Set<String> visitedManufacturer = new HashSet<>();
|
|
|
Set<String> conflictManufacturer = new HashSet<>();
|
|
|
Set<String> visitedBrand = new HashSet<>();
|