Subversion Repositories SmartDukaan

Rev

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

Rev 33501 Rev 33973
Line 3... Line 3...
3
import com.google.gson.Gson;
3
import com.google.gson.Gson;
4
import com.jcraft.jsch.*;
4
import com.jcraft.jsch.*;
5
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
5
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
6
import com.spice.profitmandi.common.solr.SolrService;
6
import com.spice.profitmandi.common.solr.SolrService;
7
import com.spice.profitmandi.dao.entity.catalog.Item;
7
import com.spice.profitmandi.dao.entity.catalog.Item;
-
 
8
import com.spice.profitmandi.dao.entity.catalog.SuperCatalog;
8
import com.spice.profitmandi.dao.entity.cs.PartnerRegion;
9
import com.spice.profitmandi.dao.entity.cs.PartnerRegion;
9
import com.spice.profitmandi.dao.entity.cs.Region;
10
import com.spice.profitmandi.dao.entity.cs.Region;
10
import com.spice.profitmandi.dao.entity.dtr.DocumentUrl;
11
import com.spice.profitmandi.dao.entity.dtr.DocumentUrl;
11
import com.spice.profitmandi.dao.entity.fofo.PrintResource;
12
import com.spice.profitmandi.dao.entity.fofo.PrintResource;
12
import com.spice.profitmandi.dao.entity.fofo.PrintResourceRegion;
13
import com.spice.profitmandi.dao.entity.fofo.PrintResourceRegion;
13
import com.spice.profitmandi.dao.entity.user.User;
14
import com.spice.profitmandi.dao.entity.user.User;
14
import com.spice.profitmandi.dao.model.*;
15
import com.spice.profitmandi.dao.model.*;
15
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
16
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
16
import com.spice.profitmandi.dao.repository.catalog.FocusedModelRepository;
17
import com.spice.profitmandi.dao.repository.catalog.FocusedModelRepository;
17
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
18
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
-
 
19
import com.spice.profitmandi.dao.repository.catalog.SuperCatalogRepository;
18
import com.spice.profitmandi.dao.repository.cs.PartnerRegionRepository;
20
import com.spice.profitmandi.dao.repository.cs.PartnerRegionRepository;
19
import com.spice.profitmandi.dao.repository.cs.RegionRepository;
21
import com.spice.profitmandi.dao.repository.cs.RegionRepository;
20
import com.spice.profitmandi.dao.repository.dtr.DocumentUrlRepository;
22
import com.spice.profitmandi.dao.repository.dtr.DocumentUrlRepository;
21
import com.spice.profitmandi.dao.repository.dtr.Mongo;
23
import com.spice.profitmandi.dao.repository.dtr.Mongo;
22
import com.spice.profitmandi.dao.repository.fofo.PrintResourceRegionRepository;
24
import com.spice.profitmandi.dao.repository.fofo.PrintResourceRegionRepository;
Line 81... Line 83...
81
	RegionRepository regionRepository;
83
	RegionRepository regionRepository;
82
	@Autowired
84
	@Autowired
83
	PrintResourceRegionRepository printResourceRegionRepository;
85
	PrintResourceRegionRepository printResourceRegionRepository;
84
	@Autowired
86
	@Autowired
85
	PartnerRegionRepository partnerRegionRepository;
87
	PartnerRegionRepository partnerRegionRepository;
-
 
88
	@Autowired
-
 
89
	SuperCatalogRepository superCatalogRepository;
86
 
90
 
87
	private Gson gson = new Gson();
91
	private Gson gson = new Gson();
88
 
92
 
89
	public static final int Entity_Id = 0;
93
	public static final int Entity_Id = 0;
90
	public static final int Title = 1;
94
	public static final int Title = 1;
Line 120... Line 124...
120
			throws Exception {
124
			throws Exception {
121
		List<ContentPojo> contentPojos = readFile(file);
125
		List<ContentPojo> contentPojos = readFile(file);
122
		for (ContentPojo contentPojo : contentPojos) {
126
		for (ContentPojo contentPojo : contentPojos) {
123
			mongoClient.persistEntity(contentPojo);
127
			mongoClient.persistEntity(contentPojo);
124
		}
128
		}
-
 
129
		//List<SuperCatalog> superCatalog = superCatalogRepository.selectAll();
-
 
130
 
125
		model.addAttribute("response1", mvcResponseSender.createResponseString(true));
131
		model.addAttribute("response1", mvcResponseSender.createResponseString(true));
126
		return "response";
132
		return "response";
127
	}
133
	}
128
 
134
 
129
	@Autowired
135
	@Autowired
Line 306... Line 312...
306
		return "response";
312
		return "response";
307
	}
313
	}
308
 
314
 
309
	@GetMapping(value = "/content/index")
315
	@GetMapping(value = "/content/index")
310
	public String index(HttpServletRequest request, Model model) throws Exception {
316
	public String index(HttpServletRequest request, Model model) throws Exception {
-
 
317
 
311
		return "content";
318
		return "content";
312
	}
319
	}
313
 
320
 
314
	private List<ContentPojo> readFile(MultipartFile file) throws Exception {
321
	private List<ContentPojo> readFile(MultipartFile file) throws Exception {
315
		CSVParser parser = new CSVParser(new InputStreamReader(file.getInputStream()), CSVFormat.DEFAULT);
322
		CSVParser parser = new CSVParser(new InputStreamReader(file.getInputStream()), CSVFormat.DEFAULT);