Subversion Repositories SmartDukaan

Rev

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

Rev 30542 Rev 30543
Line 1... Line 1...
1
package com.spice.profitmandi.web.controller;
1
package com.spice.profitmandi.web.controller;
2
 
2
 
3
import java.io.ByteArrayInputStream;
3
import java.io.ByteArrayInputStream;
-
 
4
import java.io.ByteArrayOutputStream;
4
import java.io.IOException;
5
import java.io.IOException;
5
import java.io.InputStream;
6
import java.io.InputStream;
6
import java.time.LocalDate;
7
import java.time.LocalDate;
7
import java.time.LocalDateTime;
8
import java.time.LocalDateTime;
8
import java.time.format.DateTimeFormatter;
9
import java.time.format.DateTimeFormatter;
Line 41... Line 42...
41
 
42
 
42
import com.mongodb.DBObject;
43
import com.mongodb.DBObject;
43
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
44
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
44
import com.spice.profitmandi.common.model.BrandStockPrice;
45
import com.spice.profitmandi.common.model.BrandStockPrice;
45
import com.spice.profitmandi.common.model.CustomRetailer;
46
import com.spice.profitmandi.common.model.CustomRetailer;
-
 
47
import com.spice.profitmandi.common.model.InvoicePdfModel;
46
import com.spice.profitmandi.common.model.ProfitMandiConstants;
48
import com.spice.profitmandi.common.model.ProfitMandiConstants;
47
import com.spice.profitmandi.common.util.FileUtil;
49
import com.spice.profitmandi.common.util.FileUtil;
-
 
50
import com.spice.profitmandi.common.util.PdfUtils;
48
import com.spice.profitmandi.common.web.util.ResponseSender;
51
import com.spice.profitmandi.common.web.util.ResponseSender;
49
import com.spice.profitmandi.dao.entity.auth.AuthUser;
52
import com.spice.profitmandi.dao.entity.auth.AuthUser;
50
import com.spice.profitmandi.dao.entity.auth.PartnerCollectionPlan;
53
import com.spice.profitmandi.dao.entity.auth.PartnerCollectionPlan;
51
import com.spice.profitmandi.dao.entity.auth.PartnerCollectionRemark;
54
import com.spice.profitmandi.dao.entity.auth.PartnerCollectionRemark;
52
import com.spice.profitmandi.dao.entity.auth.PartnerSecondaryPlan;
55
import com.spice.profitmandi.dao.entity.auth.PartnerSecondaryPlan;
53
import com.spice.profitmandi.dao.entity.cs.Ticket;
56
import com.spice.profitmandi.dao.entity.cs.Ticket;
54
import com.spice.profitmandi.dao.entity.cs.TicketCategory;
57
import com.spice.profitmandi.dao.entity.cs.TicketCategory;
55
import com.spice.profitmandi.dao.entity.cs.TicketSubCategory;
58
import com.spice.profitmandi.dao.entity.cs.TicketSubCategory;
56
import com.spice.profitmandi.dao.entity.dtr.User;
59
import com.spice.profitmandi.dao.entity.dtr.User;
57
import com.spice.profitmandi.dao.entity.dtr.UserAccount;
60
import com.spice.profitmandi.dao.entity.dtr.UserAccount;
-
 
61
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
58
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
62
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
59
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
63
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
60
import com.spice.profitmandi.dao.entity.fofo.PartnerOnBoardingPanel;
64
import com.spice.profitmandi.dao.entity.fofo.PartnerOnBoardingPanel;
61
import com.spice.profitmandi.dao.entity.user.FranchiseeActivity;
65
import com.spice.profitmandi.dao.entity.user.FranchiseeActivity;
62
import com.spice.profitmandi.dao.entity.user.FranchiseeVisit;
66
import com.spice.profitmandi.dao.entity.user.FranchiseeVisit;
Line 1276... Line 1280...
1276
		// headers.setContentType(TEXT_CSV_TYPE);
1280
		// headers.setContentType(TEXT_CSV_TYPE);
1277
		// headers.setCacheControl("must-revalidate, post-check=0, pre-check=0");
1281
		// headers.setCacheControl("must-revalidate, post-check=0, pre-check=0");
1278
 
1282
 
1279
		headers.setContentType(MediaType.parseMediaType("application/csv"));
1283
		headers.setContentType(MediaType.parseMediaType("application/csv"));
1280
		headers.set("Content-disposition", "inline; filename=visit-tempplate.csv");
1284
		headers.set("Content-disposition", "inline; filename=visit-tempplate.csv");
1281
		headers.add("Cache-Control", "no-cache, no-store, must-revalidate");
1285
		// headers.add("Cache-Control", "no-cache, no-store, must-revalidate");
1282
		headers.add("Pragma", "no-cache");
1286
		headers.add("Pragma", "no-cache");
1283
		headers.add("Expires", "0");
1287
		headers.add("Expires", "0");
1284
 
1288
 
1285
		headers.setContentLength(byteArrayOutputStream.toByteArray().length);
1289
		headers.setContentLength(byteArrayOutputStream.toByteArray().length);
1286
		final InputStream inputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
1290
		final InputStream inputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());