|
|
@@ -8,12 +8,11 @@ import com.goafanti.customer.bo.InputUserClueList;
|
|
|
import com.goafanti.customer.bo.OutUserClueExcel;
|
|
|
import com.goafanti.customer.service.UserClueService;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.List;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/api/admin/userClue")
|
|
|
@@ -39,10 +38,26 @@ public class UserClueApiController extends BaseApiController{
|
|
|
* 导出客户线索模版
|
|
|
* @return
|
|
|
*/
|
|
|
+ @GetMapping("/import")
|
|
|
+ public Result importUserClue( @RequestParam(value = "file", required = false) MultipartFile file) {
|
|
|
+ NewExcelUtil<OutUserClueExcel> excelUtil=new NewExcelUtil<>(OutUserClueExcel.class);
|
|
|
+ List<OutUserClueExcel> list =null;
|
|
|
+ try {
|
|
|
+ list=excelUtil.importExcel(file.getInputStream(),1);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ return new Result().data(userClueService.importUserClue(list));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出客户线索模版
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@GetMapping("/exportTemplate")
|
|
|
public Result exportList( ) {
|
|
|
NewExcelUtil<OutUserClueExcel> excelUtil=new NewExcelUtil<>(OutUserClueExcel.class);
|
|
|
- return excelUtil.exportExcel(null,"签单客户统计表",uploadPath);
|
|
|
+ return excelUtil.exportExcel(null,"客户线索模版",uploadPath);
|
|
|
}
|
|
|
|
|
|
/**
|