|
@@ -7,10 +7,12 @@ import lombok.RequiredArgsConstructor;
|
|
import org.eco.als.domain.bo.WarningBo;
|
|
import org.eco.als.domain.bo.WarningBo;
|
|
import org.eco.als.domain.vo.WarningImportVo;
|
|
import org.eco.als.domain.vo.WarningImportVo;
|
|
import org.eco.als.domain.vo.WarningVo;
|
|
import org.eco.als.domain.vo.WarningVo;
|
|
|
|
+import org.eco.als.listener.WarningImportListener;
|
|
import org.eco.als.service.IWarningService;
|
|
import org.eco.als.service.IWarningService;
|
|
import org.eco.common.core.core.domain.CommonResult;
|
|
import org.eco.common.core.core.domain.CommonResult;
|
|
import org.eco.common.core.core.domain.model.LoginUser;
|
|
import org.eco.common.core.core.domain.model.LoginUser;
|
|
import org.eco.common.core.core.page.PageResult;
|
|
import org.eco.common.core.core.page.PageResult;
|
|
|
|
+import org.eco.common.excel.core.ExcelResult;
|
|
import org.eco.common.excel.utils.ExcelUtil;
|
|
import org.eco.common.excel.utils.ExcelUtil;
|
|
import org.eco.common.log.annotation.Log;
|
|
import org.eco.common.log.annotation.Log;
|
|
import org.eco.common.log.enums.BusinessType;
|
|
import org.eco.common.log.enums.BusinessType;
|
|
@@ -18,18 +20,11 @@ import org.eco.common.security.utils.LoginHelper;
|
|
import org.eco.common.web.annotation.RepeatSubmit;
|
|
import org.eco.common.web.annotation.RepeatSubmit;
|
|
import org.eco.common.web.core.BaseController;
|
|
import org.eco.common.web.core.BaseController;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
-import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.PutMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
-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 org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
+import java.io.IOException;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
-import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 警告信息Controller
|
|
* 警告信息Controller
|
|
@@ -54,20 +49,20 @@ public class WarningController extends BaseController {
|
|
return CommonResult.success(warningService.selectPage(warningBo));
|
|
return CommonResult.success(warningService.selectPage(warningBo));
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 导出警告信息列表
|
|
|
|
- */
|
|
|
|
- @SaCheckPermission("als:warning:export")
|
|
|
|
- @Log(title = "警告信息", businessType = BusinessType.EXPORT)
|
|
|
|
- @PostMapping("/export")
|
|
|
|
- public CommonResult<Void> export(HttpServletResponse response, WarningBo warningBo) {
|
|
|
|
- LoginUser loginUser = LoginHelper.getLoginUser();
|
|
|
|
- List<WarningVo> list = warningService.selectList(warningBo);
|
|
|
|
- warningService.asyncExport(list, "警告信息", loginUser);
|
|
|
|
- return CommonResult.success();
|
|
|
|
- }
|
|
|
|
|
|
+// /**
|
|
|
|
+// * 导出警告信息列表
|
|
|
|
+// */
|
|
|
|
+// @SaCheckPermission("als:warning:export")
|
|
|
|
+// @Log(title = "警告信息", businessType = BusinessType.EXPORT)
|
|
|
|
+// @PostMapping("/export")
|
|
|
|
+// public CommonResult<Void> export(HttpServletResponse response, WarningBo warningBo) {
|
|
|
|
+// LoginUser loginUser = LoginHelper.getLoginUser();
|
|
|
|
+// List<WarningVo> list = warningService.selectList(warningBo);
|
|
|
|
+//// warningService.asyncExport(list, "警告信息", loginUser);
|
|
|
|
+// return CommonResult.success();
|
|
|
|
+// }
|
|
|
|
|
|
- @SaCheckPermission("als:warning:import")
|
|
|
|
|
|
+// @SaCheckPermission("als:warning:import")
|
|
@PostMapping("/importTemplate")
|
|
@PostMapping("/importTemplate")
|
|
public void importTemplate(HttpServletResponse response) {
|
|
public void importTemplate(HttpServletResponse response) {
|
|
ExcelUtil.exportExcel(new ArrayList<>(), "警告信息", WarningImportVo.class, response);
|
|
ExcelUtil.exportExcel(new ArrayList<>(), "警告信息", WarningImportVo.class, response);
|
|
@@ -79,10 +74,10 @@ public class WarningController extends BaseController {
|
|
@Log(title = "警告信息", businessType = BusinessType.IMPORT)
|
|
@Log(title = "警告信息", businessType = BusinessType.IMPORT)
|
|
@SaCheckPermission("als:warning:import")
|
|
@SaCheckPermission("als:warning:import")
|
|
@PostMapping("/importData")
|
|
@PostMapping("/importData")
|
|
- public CommonResult<Void> importData(MultipartFile file, boolean updateSupport) {
|
|
|
|
|
|
+ public CommonResult<Void> importData(MultipartFile file, boolean updateSupport, String sortieNo) throws IOException {
|
|
LoginUser loginUser = LoginHelper.getLoginUser();
|
|
LoginUser loginUser = LoginHelper.getLoginUser();
|
|
- warningService.asyncImportData(file, updateSupport, loginUser);
|
|
|
|
- return CommonResult.success();
|
|
|
|
|
|
+ ExcelResult<WarningImportVo> result = ExcelUtil.importExcel(file.getInputStream(), WarningImportVo.class, new WarningImportListener(updateSupport, loginUser, sortieNo));
|
|
|
|
+ return CommonResult.success(result.getAnalysis().getLogInfo());
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|