TTInfoDetailController.java
1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.bsth.controller.schedule;
import com.bsth.common.ResponseCode;
import com.bsth.controller.BaseController;
import com.bsth.entity.schedule.TTInfoDetail;
import com.bsth.service.schedule.TTInfoDetailServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.util.HashMap;
import java.util.Map;
/**
* Created by xu on 16/7/2.
*/
@RestController
@RequestMapping("tidc")
public class TTInfoDetailController extends BaseController<TTInfoDetail, Long> {
@Autowired
private TTInfoDetailServiceImpl ttInfoDetailService;
@RequestMapping(value = "/dataImportExtend", method = RequestMethod.POST)
public Map<String, Object> uploadDataAndImport(
MultipartFile file, String xlmc, String ttinfoname, String tccname) throws Exception {
Map<String, Object> resultMap = new HashMap<>();
try {
ttInfoDetailService.fileDataImport(file, xlmc, ttinfoname, tccname);
resultMap.put("status", ResponseCode.SUCCESS);
resultMap.put("msg", "导入成功");
} catch (Exception exp) {
exp.printStackTrace();
throw exp;
}
return resultMap;
}
}