| File was renamed from ard-admin/src/main/java/com/ard/web/controller/route/ArdRouteGroupingController.java |
| | |
| | | import com.ard.common.core.page.TableDataInfo; |
| | | import com.ard.common.enums.BusinessType; |
| | | import com.ard.common.utils.poi.ExcelUtil; |
| | | import com.ard.route.domain.route.ArdRouteGrouping; |
| | | import com.ard.route.domain.route.ArdRouteGroup; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ard.route.service.IArdRouteGroupingService; |
| | | import com.ard.route.service.IArdRouteGroupService; |
| | | |
| | | /** |
| | | * 分组Controller |
| | |
| | | @Api(tags = "分组管理") |
| | | @RestController |
| | | @RequestMapping("/route/grouping") |
| | | public class ArdRouteGroupingController extends BaseController { |
| | | public class ArdRouteGroupController extends BaseController { |
| | | |
| | | @Autowired |
| | | private IArdRouteGroupingService ardRouteGroupingService; |
| | | private IArdRouteGroupService ardRouteGroupService; |
| | | |
| | | /** |
| | | * 查询分组列表 |
| | | */ |
| | | @ApiOperation("查询分组列表") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ArdRouteGrouping ardRouteGrouping) { |
| | | public TableDataInfo list(ArdRouteGroup ardRouteGroup) { |
| | | //startPage(); |
| | | List<ArdRouteGrouping> list = ardRouteGroupingService.selectArdRouteGroupingList(ardRouteGrouping); |
| | | List<ArdRouteGroup> list = ardRouteGroupService.selectArdRouteGroupList(ardRouteGroup); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | |
| | | @ApiOperation("导出分组列表") |
| | | @Log(title = "分组", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, ArdRouteGrouping ardRouteGrouping) { |
| | | List<ArdRouteGrouping> list = ardRouteGroupingService.selectArdRouteGroupingList(ardRouteGrouping); |
| | | ExcelUtil<ArdRouteGrouping> util = new ExcelUtil<ArdRouteGrouping>(ArdRouteGrouping.class); |
| | | public void export(HttpServletResponse response, ArdRouteGroup ardRouteGroup) { |
| | | List<ArdRouteGroup> list = ardRouteGroupService.selectArdRouteGroupList(ardRouteGroup); |
| | | ExcelUtil<ArdRouteGroup> util = new ExcelUtil<ArdRouteGroup>(ArdRouteGroup.class); |
| | | util.exportExcel(response, list, "分组数据"); |
| | | } |
| | | |
| | |
| | | @ApiOperation("获取分组详细信息") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") String id) { |
| | | return success(ardRouteGroupingService.selectArdRouteGroupingById(id)); |
| | | return success(ardRouteGroupService.selectArdRouteGroupById(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation("新增分组") |
| | | @Log(title = "分组", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ArdRouteGrouping ardRouteGrouping) { |
| | | ardRouteGrouping.setCreateBy(getUsername()); |
| | | return toAjax(ardRouteGroupingService.insertArdRouteGrouping(ardRouteGrouping)); |
| | | public AjaxResult add(@RequestBody ArdRouteGroup ardRouteGroup) { |
| | | ardRouteGroup.setCreateBy(getUsername()); |
| | | return toAjax(ardRouteGroupService.insertArdRouteGroup(ardRouteGroup)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation("修改分组") |
| | | @Log(title = "分组", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ArdRouteGrouping ardRouteGrouping) { |
| | | ardRouteGrouping.setUpdateBy(getUsername()); |
| | | return toAjax(ardRouteGroupingService.updateArdRouteGrouping(ardRouteGrouping)); |
| | | public AjaxResult edit(@RequestBody ArdRouteGroup ardRouteGroup) { |
| | | ardRouteGroup.setUpdateBy(getUsername()); |
| | | return toAjax(ardRouteGroupService.updateArdRouteGroup(ardRouteGroup)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable String[] ids) { |
| | | try { |
| | | Map<String, Integer> result = ardRouteGroupingService.deleteArdRouteGroupingByIds(ids); |
| | | Map<String, Integer> result = ardRouteGroupService.deleteArdRouteGroupByIds(ids); |
| | | if (!result.isEmpty()) { |
| | | return AjaxResult.success("删除成功:分组删除" + result.get("groupingCount") + ",航线删除" + result.get("informationCount")); |
| | | } else { |