|
@@ -17,6 +17,7 @@ import com.bowintek.practice.vo.SubjectfieldVo;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
@@ -95,6 +96,7 @@ public class SubjectController {
|
|
|
|
|
|
return RespGenerstor.success(result);
|
|
|
}
|
|
|
+
|
|
|
@ResponseBody
|
|
|
@PostMapping("/delete")
|
|
|
public BaseResponse delete(@RequestBody List<String> idList) {
|
|
@@ -108,8 +110,12 @@ public class SubjectController {
|
|
|
@ResponseBody
|
|
|
@GetMapping("/exportSubject")
|
|
|
public void exportSubject(HttpServletResponse response,
|
|
|
- @RequestParam(required = false) List<String> idList,
|
|
|
+ @RequestParam(required = false) String ids,
|
|
|
String subjectName, String tabName, String tabCode) throws Exception {
|
|
|
+ List<String> idList = null;
|
|
|
+ if (!stringUtils.IsNullOrEmpty(ids)) {
|
|
|
+ idList = Arrays.stream(ids.split(",")).toList();
|
|
|
+ }
|
|
|
List<SubjectVo> dataList = subjectService.getList(1, 9999, subjectName, tabName,
|
|
|
tabCode, idList).getList();
|
|
|
|
|
@@ -139,7 +145,7 @@ public class SubjectController {
|
|
|
List<SubjectfieldVo> result = subjectService.importData(dataList, accountService.getLoginUserID());
|
|
|
|
|
|
if (result.stream().filter(it -> !stringUtils.IsNullOrEmpty(it.getErrorMessage())).collect(Collectors.toList()).size() > 0) {
|
|
|
- return RespGenerstor.fail(BaseErrorEnum.IMPORT_DATA_ERROR, result);
|
|
|
+ return RespGenerstor.fail(BaseErrorEnum.IMPORT_DATA_ERROR, result);
|
|
|
} else {
|
|
|
return RespGenerstor.success(result);
|
|
|
}
|