Subversion Repositories SmartDukaan

Rev

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

Rev 8268 Rev 8510
Line 56... Line 56...
56
import java.util.List;
56
import java.util.List;
57
import java.util.Map;
57
import java.util.Map;
58
import java.util.Set;
58
import java.util.Set;
59
import java.util.TreeMap;
59
import java.util.TreeMap;
60
 
60
 
61
import org.apache.commons.chain.CatalogFactory;
-
 
62
import org.apache.commons.collections.CollectionUtils;
61
import org.apache.commons.collections.CollectionUtils;
63
import org.apache.commons.io.IOUtils;
62
import org.apache.commons.io.IOUtils;
64
import org.apache.commons.lang.StringUtils;
63
import org.apache.commons.lang.StringUtils;
65
 
64
 
66
import com.google.gson.Gson;
65
import com.google.gson.Gson;
Line 99... Line 98...
99
		/*contentmigrator.touchEntityState(1008423l);
98
		/*contentmigrator.touchEntityState(1008423l);
100
		contentmigrator.touchEntityState(1008424l);
99
		contentmigrator.touchEntityState(1008424l);
101
		contentmigrator.touchEntityState(1008427l);
100
		contentmigrator.touchEntityState(1008427l);
102
		contentmigrator.touchEntityState(1008428l);*/
101
		contentmigrator.touchEntityState(1008428l);*/
103
 
102
 
104
		contentmigrator.touchEntityState(1008432l);
-
 
105
		contentmigrator.touchEntityState(1008433l);
-
 
106
		contentmigrator.touchEntityState(1008434l);
103
		contentmigrator.changeEntityState();
107
	}
104
	}
108
	
105
	
109
	private void updateSources() throws Exception{
106
	private void updateSources() throws Exception{
110
		Map<Long,List<ExpertReview>> erMap = CreationUtils.getExpertReviews();
107
		Map<Long,List<ExpertReview>> erMap = CreationUtils.getExpertReviews();
111
		for(Map.Entry<Long, List<ExpertReview>> erEntry : erMap.entrySet()){
108
		for(Map.Entry<Long, List<ExpertReview>> erEntry : erMap.entrySet()){
Line 126... Line 123...
126
	}
123
	}
127
	private void touchEntityState(Long eId) throws Exception {
124
	private void touchEntityState(Long eId) throws Exception {
128
		EntityState es = CreationUtils.getEntityState(eId);
125
		EntityState es = CreationUtils.getEntityState(eId);
129
		es.setMerkedReadyOn(new Date());
126
		es.setMerkedReadyOn(new Date());
130
		CreationUtils.updateEntityState(es);
127
		CreationUtils.updateEntityState(es);
131
		System.out.println("Entity touched:" + eId);
128
		//System.out.println("Entity touched:" + eId);
132
	}
129
	}
133
	private void updateModelForBBQ10() throws Exception{
130
	private void updateModelForBBQ10() throws Exception{
134
		Long entityId = 1007315l;
131
		Long entityId = 1007315l;
135
		EntityState e1 = CreationUtils.getEntityState(entityId);
132
		EntityState e1 = CreationUtils.getEntityState(entityId);
136
		Entity e2 = CreationUtils.getEntity(entityId);
133
		Entity e2 = CreationUtils.getEntity(entityId);
Line 662... Line 659...
662
			EntityState state = entitiesState.get(entityId);
659
			EntityState state = entitiesState.get(entityId);
663
			if (state.getCategoryID() == 10002
660
			if (state.getCategoryID() == 10002
664
					|| state.getCategoryID() == 10003
661
					|| state.getCategoryID() == 10003
665
					|| state.getCategoryID() == 10004
662
					|| state.getCategoryID() == 10004
666
					|| state.getCategoryID() == 10005) {
663
					|| state.getCategoryID() == 10005) {
667
				state.setCompletedBy("");
664
				state.setCategoryID(10006);
668
				state.setMerkedReadyBy("");
-
 
669
				// state.setStatus(EntityStatus.ASSIGNED);
-
 
670
				// CreationUtils.updateEntityState(state);
665
				CreationUtils.updateEntityState(state);
671
				System.out.println(entityId + ":" + state.getStatus());
666
				touchEntityState(entityId);
672
			}
667
			}
673
			CreationUtils.updateEntityState(state);
-
 
674
		}
668
		}
675
		return true;
669
		return true;
676
	}
670
	}
677
 
671
 
678
	public boolean migrateDataBack() throws Exception {
672
	public boolean migrateDataBack() throws Exception {