| 28495 |
tejbeer |
1 |
package com.spice.profitmandi.web.controller;
|
|
|
2 |
|
|
|
3 |
import java.io.File;
|
|
|
4 |
import java.util.List;
|
|
|
5 |
|
|
|
6 |
import javax.servlet.http.HttpServletRequest;
|
|
|
7 |
import javax.servlet.http.HttpServletResponse;
|
|
|
8 |
|
|
|
9 |
import org.apache.logging.log4j.LogManager;
|
|
|
10 |
import org.apache.logging.log4j.Logger;
|
|
|
11 |
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
12 |
import org.springframework.stereotype.Controller;
|
|
|
13 |
import org.springframework.transaction.annotation.Transactional;
|
|
|
14 |
import org.springframework.ui.Model;
|
|
|
15 |
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
16 |
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
17 |
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
18 |
|
|
|
19 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
|
|
20 |
import com.spice.profitmandi.dao.entity.catalog.StateGstRate;
|
|
|
21 |
import com.spice.profitmandi.dao.entity.dtr.Document;
|
|
|
22 |
import com.spice.profitmandi.dao.repository.dtr.DocumentRepository;
|
|
|
23 |
import com.spice.profitmandi.web.util.MVCResponseSender;
|
|
|
24 |
import com.spice.profitmandi.dao.repository.catalog.StateGstRateRepository;
|
|
|
25 |
@Controller
|
|
|
26 |
@Transactional(rollbackFor = Throwable.class)
|
|
|
27 |
public class TaxationController {
|
|
|
28 |
|
|
|
29 |
|
|
|
30 |
@Autowired
|
|
|
31 |
private DocumentRepository documentRepository;
|
|
|
32 |
|
|
|
33 |
|
|
|
34 |
@Autowired
|
|
|
35 |
private StateGstRateRepository StateGstRateRepository;
|
|
|
36 |
|
|
|
37 |
@Autowired
|
|
|
38 |
private MVCResponseSender mvcResponseSender;
|
|
|
39 |
|
|
|
40 |
|
|
|
41 |
@Autowired
|
|
|
42 |
private ResponseSender<?> responseSender;
|
|
|
43 |
|
|
|
44 |
private static final Logger LOGGER = LogManager.getLogger(SellerController.class);
|
|
|
45 |
|
|
|
46 |
@RequestMapping(value = "/csvFileUploader", method = RequestMethod.POST)
|
|
|
47 |
public String getFileUploader(HttpServletRequest request, Model model ,HttpServletResponse response,
|
|
|
48 |
@PathVariable(value = "fileName") String fileName) throws Throwable {
|
|
|
49 |
List<StateGstRate> sgtFileName = documentRepository.csvFileUploaderStateGstRate(fileName);
|
|
|
50 |
|
|
|
51 |
LOGGER.info("sgtFileName"+sgtFileName);
|
|
|
52 |
|
|
|
53 |
model.addAttribute("responseSTG", mvcResponseSender.createResponseString(true));
|
|
|
54 |
return "response";
|
|
|
55 |
|
|
|
56 |
|
|
|
57 |
}
|
|
|
58 |
|
|
|
59 |
}
|