|
@@ -11,6 +11,10 @@ import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
import org.jeecg.common.system.base.controller.JeecgController;
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
|
import org.jeecg.config.JeecgBaseConfig;
|
|
|
+import org.jeecg.modules.projectChbSwf.entity.ProjectChbSwf;
|
|
|
+import org.jeecg.modules.projectChbSwf.service.IProjectChbSwfService;
|
|
|
+import org.jeecg.modules.projectChbWxf.entity.ProjectChbWxf;
|
|
|
+import org.jeecg.modules.projectChbWxf.service.IProjectChbWxfService;
|
|
|
import org.jeecg.modules.projectChbZyf.entity.ProjectChbZyf;
|
|
|
import org.jeecg.modules.projectChbZyf.service.IProjectChbZyfService;
|
|
|
import org.jeecg.modules.projectImportList.entity.ProjectImportList;
|
|
@@ -48,10 +52,16 @@ public class ProjectImportListController extends JeecgController<ProjectImportLi
|
|
|
private IProjectChbZyfService zyfService;
|
|
|
@Autowired
|
|
|
@SuppressWarnings("all")
|
|
|
+ private IProjectChbWxfService wxfService;
|
|
|
+ @Autowired
|
|
|
+ @SuppressWarnings("all")
|
|
|
+ private IProjectChbSwfService swfService;
|
|
|
+ @Autowired
|
|
|
+ @SuppressWarnings("all")
|
|
|
private JeecgBaseConfig jeecgBaseConfig;
|
|
|
|
|
|
/**
|
|
|
- * 通过excel导入数据
|
|
|
+ * 通过excel导入数据——————原表数据
|
|
|
*
|
|
|
* @param request
|
|
|
* @param response
|
|
@@ -63,30 +73,6 @@ public class ProjectImportListController extends JeecgController<ProjectImportLi
|
|
|
return super.importExcel(request, response, ProjectImportList.class);
|
|
|
}
|
|
|
|
|
|
-// public InputStream getFileStream(String strUrl) {
|
|
|
-// InputStream inputStream = null;
|
|
|
-// try {
|
|
|
-// URL httpUrl = new URL(strUrl);
|
|
|
-// HttpURLConnection httpURLConnection = (HttpURLConnection) httpUrl.openConnection();
|
|
|
-// httpURLConnection.setConnectTimeout(1000 * 3);
|
|
|
-// httpURLConnection.setReadTimeout(1000 * 20);
|
|
|
-// httpURLConnection.connect();
|
|
|
-// inputStream = httpURLConnection.getInputStream();
|
|
|
-// byte[] in = StreamUtils.copyToByteArray(inputStream);
|
|
|
-// return new ByteArrayInputStream(in);
|
|
|
-// } catch (Exception e) {
|
|
|
-// log.error(e.getMessage(), e);
|
|
|
-//// throw new ApplicationException(10086, "获取文件内容失败,请重新上传");
|
|
|
-// } finally {
|
|
|
-// if (inputStream != null) {
|
|
|
-// try {
|
|
|
-// inputStream.close();
|
|
|
-// } catch (IOException e) {
|
|
|
-// log.error("inputStream.close", e);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
|
|
|
/**
|
|
|
* 通过excel导入其他表的数据
|
|
@@ -107,27 +93,23 @@ public class ProjectImportListController extends JeecgController<ProjectImportLi
|
|
|
result.setCode(500);
|
|
|
result.setMessage("请选择正确的导入类型!");
|
|
|
|
|
|
- System.out.println(projectImportList.getFileType());
|
|
|
-
|
|
|
-// String url = "D:/opt/upFiles/" +
|
|
|
-
|
|
|
String url = jeecgBaseConfig.getPath().getUpload() + "/"+ projectImportList.getFileAddress();
|
|
|
-
|
|
|
-// MultipartFile file = new
|
|
|
- return zyfService.importExcel1(url, ProjectChbZyf.class);
|
|
|
-
|
|
|
-// if(projectImportList.getFileType().equals("1")){
|
|
|
-// return result;
|
|
|
-// }else if(projectImportList.getFileType().equals("2")){
|
|
|
-// return result;
|
|
|
-// }else if(projectImportList.getFileType().equals("3")){
|
|
|
-// return result;
|
|
|
-// }else if(projectImportList.getFileType().equals("4")){
|
|
|
-// return zyfService.importExcel1(request, response, ProjectChbZyf.class);
|
|
|
-// }else {
|
|
|
-// return result;
|
|
|
-// }
|
|
|
-// return zyfService.importExcel1(request, response, ProjectChbZyf.class);
|
|
|
+ // String url = "D:/opt/upFiles/" +
|
|
|
+ System.out.println(projectImportList.getFileType());
|
|
|
+ System.out.println("文件地址为:"+url);
|
|
|
+
|
|
|
+
|
|
|
+ if(projectImportList.getFileType().equals("1")){ //项目预算
|
|
|
+ return result;
|
|
|
+ }else if(projectImportList.getFileType().equals("2")){ //外协费
|
|
|
+ return wxfService.importExcel1(url, ProjectChbWxf.class);
|
|
|
+ }else if(projectImportList.getFileType().equals("3")){ //事务费
|
|
|
+ return swfService.importExcel1(url, ProjectChbSwf.class);
|
|
|
+ }else if(projectImportList.getFileType().equals("4")){ //专用费
|
|
|
+ return zyfService.importExcel1(url, ProjectChbZyf.class);
|
|
|
+ }else {
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|