|
@@ -4,8 +4,6 @@ import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
-
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.http.HttpStatus;
|
|
@@ -38,31 +36,27 @@ public class ExportStructureController extends ControllerSupport{
|
|
|
|
|
|
@ApiOperation(value = "保存导出结构", notes = "保存导出结构")
|
|
|
@PostMapping(value = "/saveExportStructure")
|
|
|
- public ResponseEntity saveExportStructure(HttpServletRequest request,@RequestBody ExportStructure exportStructure){
|
|
|
+ public ResponseEntity<Object> saveExportStructure(@RequestBody ExportStructure exportStructure){
|
|
|
try{
|
|
|
User user = getAccessUser();
|
|
|
- //AccessUser user = (AccessUser) request.getAttribute("accessUser");
|
|
|
exportStructureService.saveExportStructure(exportStructure,user);
|
|
|
- return new ResponseEntity(HttpStatus.OK);
|
|
|
+ return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
}catch(Exception e){
|
|
|
- return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
+ return new ResponseEntity<Object>(HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "分页查询导出结构", notes = "分页查询导出结构")
|
|
|
@PostMapping(value = "/findPageByExportStructure/{curPage}/{pageSize}")
|
|
|
- public ResponseEntity findPageByExportStructure(HttpServletRequest request,
|
|
|
- @PathVariable int curPage,
|
|
|
- @PathVariable int pageSize,
|
|
|
- @RequestBody ExportStructure exportStructure){
|
|
|
+ public ResponseEntity<Object> findPageByExportStructure(@PathVariable int curPage, @PathVariable int pageSize,
|
|
|
+ @RequestBody ExportStructure exportStructure){
|
|
|
try{
|
|
|
User user = getAccessUser();
|
|
|
- //AccessUser user = (AccessUser) request.getAttribute("accessUser");
|
|
|
exportStructure.setOrgId(user.getRootOrgId()+"");
|
|
|
Page<ExportStructure> pageExportStructure = exportStructureService.findPageByExportStructure(exportStructure, curPage, pageSize);
|
|
|
- return new ResponseEntity(pageExportStructure,HttpStatus.OK);
|
|
|
+ return new ResponseEntity<Object>(pageExportStructure,HttpStatus.OK);
|
|
|
}catch(Exception e){
|
|
|
- return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
+ return new ResponseEntity<Object>(HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -76,16 +70,17 @@ public class ExportStructureController extends ControllerSupport{
|
|
|
|
|
|
@ApiOperation(value="根据考试类型查询考试id",notes="根据考试类型查询考试id")
|
|
|
@GetMapping(value="/findExportStructureByExamType/{examType}")
|
|
|
- public ResponseEntity findExportStructureByExamType(@PathVariable String examType){
|
|
|
- List<String> list = exportStructureService.findExportStructureByExamType(examType);
|
|
|
- return new ResponseEntity(list,HttpStatus.OK);
|
|
|
+ public ResponseEntity<Object> findExportStructureByExamType(@PathVariable String examType){
|
|
|
+ User user = getAccessUser();
|
|
|
+ List<String> list = exportStructureService.findExportStructureByExamType(examType,user);
|
|
|
+ return new ResponseEntity<Object>(list,HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value="根据导出结构id删除",notes="根据导出结构删除")
|
|
|
@DeleteMapping(value="/deleteExportStructure/{id}")
|
|
|
- public ResponseEntity deleteExportStructure(@PathVariable String id){
|
|
|
+ public ResponseEntity<Object> deleteExportStructure(@PathVariable String id){
|
|
|
exportStructureService.deleteExportStructure(id);
|
|
|
- return new ResponseEntity(HttpStatus.OK);
|
|
|
+ return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
}
|
|
|
}
|
|
|
|