Subversion Repositories SmartDukaan

Rev

Rev 11873 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 11873 Rev 13035
Line 44... Line 44...
44
import java.util.ArrayList;
44
import java.util.ArrayList;
45
import java.util.Arrays;
45
import java.util.Arrays;
46
import java.util.Collection;
46
import java.util.Collection;
47
import java.util.Date;
47
import java.util.Date;
48
import java.util.HashMap;
48
import java.util.HashMap;
-
 
49
import java.util.Iterator;
49
import java.util.List;
50
import java.util.List;
50
import java.util.Locale;
51
import java.util.Locale;
51
import java.util.Map;
52
import java.util.Map;
52
import java.util.Set;
53
import java.util.Set;
53
import java.util.StringTokenizer;
54
import java.util.StringTokenizer;
Line 1132... Line 1133...
1132
		if (new Date().getTime() - lastEntityCreation.getTime() > 20*60*1000) {
1133
		if (new Date().getTime() - lastEntityCreation.getTime() > 20*60*1000) {
1133
			try {
1134
			try {
1134
				CatalogClient csc = new CatalogClient();
1135
				CatalogClient csc = new CatalogClient();
1135
				in.shop2020.model.v1.catalog.CatalogService.Client iclient = csc.getClient();
1136
				in.shop2020.model.v1.catalog.CatalogService.Client iclient = csc.getClient();
1136
				List<Item> items = iclient.getAllItemsByStatus(status.IN_PROCESS);
1137
				List<Item> items = iclient.getAllItemsByStatus(status.IN_PROCESS);
-
 
1138
				List<Item> partiallyActive = (iclient.getAllItemsByStatus(status.PARTIALLY_ACTIVE));
-
 
1139
				
-
 
1140
				Iterator<Item> itemIterator = partiallyActive.iterator();
-
 
1141
				//Ignore items with categories not available in Content Model
-
 
1142
				while(itemIterator.hasNext()){
-
 
1143
					Item item = itemIterator.next();
-
 
1144
					if(item.isSetCategory()){
-
 
1145
						Category cat = defs.getCategory(item.getCategory());
-
 
1146
						if (cat == null) itemIterator.remove();
-
 
1147
					}
-
 
1148
				}
-
 
1149
				items.addAll(partiallyActive);
1137
				for(Item item: items){
1150
				for(Item item: items){
1138
					long entityID = item.getCatalogItemId();
1151
					long entityID = item.getCatalogItemId();
1139
					if(!this.entitiesState.containsKey(entityID)){
1152
					if(!this.entitiesState.containsKey(entityID)){
1140
						log.info("#### Going to add the entity with id: ####" + entityID);
1153
						log.info("#### Going to add the entity with id: ####" + entityID);
1141
						Entity entity = new Entity(entityID, -1);
1154
						Entity entity = new Entity(entityID, -1);