Commit 5798085c93c9ceaa5b4f9682a8ddde7b4510ad7b
1 parent
c43ba5a1
添加文档生成
Showing
26 changed files
with
463 additions
and
23 deletions
Bsth-admin/src/main/java/com/ruoyi/controller/carinfo/CarInfoController.java
| @@ -3,6 +3,7 @@ package com.ruoyi.controller.carinfo; | @@ -3,6 +3,7 @@ package com.ruoyi.controller.carinfo; | ||
| 3 | import com.ruoyi.common.core.controller.BaseController; | 3 | import com.ruoyi.common.core.controller.BaseController; |
| 4 | import com.ruoyi.common.core.domain.AjaxResult; | 4 | import com.ruoyi.common.core.domain.AjaxResult; |
| 5 | import com.ruoyi.domain.OrderEntity; | 5 | import com.ruoyi.domain.OrderEntity; |
| 6 | +import io.swagger.annotations.Api; | ||
| 6 | import io.swagger.annotations.ApiOperation; | 7 | import io.swagger.annotations.ApiOperation; |
| 7 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | import org.springframework.web.bind.annotation.RestController; | 9 | import org.springframework.web.bind.annotation.RestController; |
| @@ -34,11 +35,13 @@ import com.ruoyi.domain.caiinfo.CarInfo; | @@ -34,11 +35,13 @@ import com.ruoyi.domain.caiinfo.CarInfo; | ||
| 34 | 35 | ||
| 35 | @RestController | 36 | @RestController |
| 36 | @RequestMapping("car/info") | 37 | @RequestMapping("car/info") |
| 38 | +@Api(tags="车辆信息") | ||
| 37 | public class CarInfoController extends BaseController { | 39 | public class CarInfoController extends BaseController { |
| 38 | @Autowired | 40 | @Autowired |
| 39 | private CarInfoService CarInfoService; | 41 | private CarInfoService CarInfoService; |
| 40 | 42 | ||
| 41 | @PreAuthorize("@ss.hasPermi('car:info:list:limit:page:limit')") | 43 | @PreAuthorize("@ss.hasPermi('car:info:list:limit:page:limit')") |
| 44 | + @ApiOperation("分页查询") | ||
| 42 | @PostMapping(value = "/list/limit/{page}/{pageLimit}") | 45 | @PostMapping(value = "/list/limit/{page}/{pageLimit}") |
| 43 | public String listLimit(@ModelAttribute CarInfoQueryDTO request, OrderEntity orderEntity, @PathVariable Integer page, @PathVariable Integer pageLimit, org.springframework.ui.Model model) { | 46 | public String listLimit(@ModelAttribute CarInfoQueryDTO request, OrderEntity orderEntity, @PathVariable Integer page, @PathVariable Integer pageLimit, org.springframework.ui.Model model) { |
| 44 | CarInfo entity = convert(request); | 47 | CarInfo entity = convert(request); |
| @@ -47,7 +50,7 @@ public class CarInfoController extends BaseController { | @@ -47,7 +50,7 @@ public class CarInfoController extends BaseController { | ||
| 47 | return JSON.toJSONString(convert(response)); | 50 | return JSON.toJSONString(convert(response)); |
| 48 | } | 51 | } |
| 49 | 52 | ||
| 50 | - | 53 | + @ApiOperation("根据ID查询详情") |
| 51 | @GetMapping(value = "/view/{id}") | 54 | @GetMapping(value = "/view/{id}") |
| 52 | public com.ruoyi.common.core.domain.AjaxResult view(@PathVariable("id") Integer id, org.springframework.ui.Model model) { | 55 | public com.ruoyi.common.core.domain.AjaxResult view(@PathVariable("id") Integer id, org.springframework.ui.Model model) { |
| 53 | CarInfo source = CarInfoService.getById(id); | 56 | CarInfo source = CarInfoService.getById(id); |
| @@ -59,6 +62,7 @@ public class CarInfoController extends BaseController { | @@ -59,6 +62,7 @@ public class CarInfoController extends BaseController { | ||
| 59 | 62 | ||
| 60 | @PreAuthorize("@ss.hasPermi('car:info:export')") | 63 | @PreAuthorize("@ss.hasPermi('car:info:export')") |
| 61 | @PostMapping("/export") | 64 | @PostMapping("/export") |
| 65 | + @ApiOperation("导出") | ||
| 62 | public void export(HttpServletResponse response, CarInfo entity) { | 66 | public void export(HttpServletResponse response, CarInfo entity) { |
| 63 | List<CarInfo> list = CarInfoService.list(entity); | 67 | List<CarInfo> list = CarInfoService.list(entity); |
| 64 | ExcelUtil<CarInfo> util = new ExcelUtil<CarInfo>(CarInfo.class); | 68 | ExcelUtil<CarInfo> util = new ExcelUtil<CarInfo>(CarInfo.class); |
| @@ -89,6 +93,7 @@ public class CarInfoController extends BaseController { | @@ -89,6 +93,7 @@ public class CarInfoController extends BaseController { | ||
| 89 | 93 | ||
| 90 | @PreAuthorize("@ss.hasPermi('car:info:add')") | 94 | @PreAuthorize("@ss.hasPermi('car:info:add')") |
| 91 | @PostMapping(value = "/add") | 95 | @PostMapping(value = "/add") |
| 96 | + @ApiOperation("添加车辆信息") | ||
| 92 | public com.ruoyi.common.core.domain.AjaxResult add(@ModelAttribute CarInfoAddDTO request) { | 97 | public com.ruoyi.common.core.domain.AjaxResult add(@ModelAttribute CarInfoAddDTO request) { |
| 93 | CarInfo entity = convert(request); | 98 | CarInfo entity = convert(request); |
| 94 | entity.setCreateBy(getUserId()); | 99 | entity.setCreateBy(getUserId()); |
| @@ -99,6 +104,7 @@ public class CarInfoController extends BaseController { | @@ -99,6 +104,7 @@ public class CarInfoController extends BaseController { | ||
| 99 | 104 | ||
| 100 | @PreAuthorize("@ss.hasPermi('car:info:update')") | 105 | @PreAuthorize("@ss.hasPermi('car:info:update')") |
| 101 | @PostMapping(value = "/update") | 106 | @PostMapping(value = "/update") |
| 107 | + @ApiOperation("修改车辆信息") | ||
| 102 | public com.ruoyi.common.core.domain.AjaxResult update(@ModelAttribute CarInfoUpdateDTO request) { | 108 | public com.ruoyi.common.core.domain.AjaxResult update(@ModelAttribute CarInfoUpdateDTO request) { |
| 103 | CarInfo entity = convert(request); | 109 | CarInfo entity = convert(request); |
| 104 | entity.setUpdateBy(getUserId()); | 110 | entity.setUpdateBy(getUserId()); |
| @@ -109,6 +115,7 @@ public class CarInfoController extends BaseController { | @@ -109,6 +115,7 @@ public class CarInfoController extends BaseController { | ||
| 109 | 115 | ||
| 110 | @PreAuthorize("@ss.hasPermi('car:info:del')") | 116 | @PreAuthorize("@ss.hasPermi('car:info:del')") |
| 111 | @GetMapping(value = "/del/{id}") | 117 | @GetMapping(value = "/del/{id}") |
| 118 | + @ApiOperation("删除车辆信息") | ||
| 112 | public com.ruoyi.common.core.domain.AjaxResult delById(@PathVariable("id") Integer id) { | 119 | public com.ruoyi.common.core.domain.AjaxResult delById(@PathVariable("id") Integer id) { |
| 113 | boolean flag = CarInfoService.deleteById(id); | 120 | boolean flag = CarInfoService.deleteById(id); |
| 114 | return flag ? com.ruoyi.common.core.domain.AjaxResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.AjaxResult.error("操作数据失败,请稍后再试"); | 121 | return flag ? com.ruoyi.common.core.domain.AjaxResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.AjaxResult.error("操作数据失败,请稍后再试"); |
Bsth-admin/src/main/java/com/ruoyi/controller/driver/NewDriverController.java
0 → 100644
| 1 | +package com.ruoyi.controller.driver; | ||
| 2 | + | ||
| 3 | +import com.ruoyi.common.core.controller.BaseController; | ||
| 4 | +import com.ruoyi.common.core.domain.AjaxResult; | ||
| 5 | +import com.ruoyi.domain.driver.NewDriver; | ||
| 6 | +import com.ruoyi.domain.driver.dto.NewDriverAddDTO; | ||
| 7 | +import com.ruoyi.domain.driver.dto.NewDriverQueryDTO; | ||
| 8 | +import com.ruoyi.domain.driver.dto.NewDriverUpdateDTO; | ||
| 9 | +import com.ruoyi.domain.driver.vo.NewDriverVO; | ||
| 10 | +import io.swagger.annotations.Api; | ||
| 11 | +import io.swagger.annotations.ApiOperation; | ||
| 12 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 13 | +import org.springframework.web.bind.annotation.RestController; | ||
| 14 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 15 | +import org.springframework.web.bind.annotation.*; | ||
| 16 | +import org.springframework.beans.BeanUtils; | ||
| 17 | + | ||
| 18 | + | ||
| 19 | +import java.util.List; | ||
| 20 | + | ||
| 21 | + | ||
| 22 | + | ||
| 23 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 24 | + | ||
| 25 | + | ||
| 26 | + | ||
| 27 | +@RestController | ||
| 28 | +@RequestMapping("new/driver") | ||
| 29 | +@Api(tags = "新-驾驶员信息") | ||
| 30 | +public class NewDriverController extends BaseController { | ||
| 31 | + @Autowired | ||
| 32 | + private com.NewDriverService newDriverService; | ||
| 33 | + | ||
| 34 | + | ||
| 35 | + @PostMapping(value = "/list/select") | ||
| 36 | + @ApiOperation("(页面选择)") | ||
| 37 | + public AjaxResult listSelect() { | ||
| 38 | + NewDriver entity = new NewDriver(); | ||
| 39 | + List<NewDriver> selectList = newDriverService.listOfSelect(entity); | ||
| 40 | + return AjaxResult.success(convert(selectList)); | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + private NewDriver convert(NewDriverQueryDTO source) { | ||
| 44 | + return java.util.Optional.ofNullable(source).map(sc -> { | ||
| 45 | + NewDriver target = new NewDriver(); | ||
| 46 | + BeanUtils.copyProperties(sc, target); | ||
| 47 | + return target; | ||
| 48 | + }).orElse(null); | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + private NewDriver convert(NewDriverUpdateDTO source) { | ||
| 52 | + return java.util.Optional.ofNullable(source).map(sc -> { | ||
| 53 | + NewDriver target = new NewDriver(); | ||
| 54 | + BeanUtils.copyProperties(sc, target); | ||
| 55 | + return target; | ||
| 56 | + }).orElse(null); | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + | ||
| 60 | + private NewDriver convert(NewDriverAddDTO source) { | ||
| 61 | + return java.util.Optional.ofNullable(source).map(sc -> { | ||
| 62 | + NewDriver target = new NewDriver(); | ||
| 63 | + BeanUtils.copyProperties(sc, target); | ||
| 64 | + return target; | ||
| 65 | + }).orElseGet(null); | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + private NewDriverVO convert(NewDriver source) { | ||
| 69 | + return java.util.Optional.ofNullable(source).map(sc -> { | ||
| 70 | + NewDriverVO target = new NewDriverVO(); | ||
| 71 | + BeanUtils.copyProperties(source, target); | ||
| 72 | + return target; | ||
| 73 | + }).orElseGet(null); | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + private List<NewDriverVO> convert(List<NewDriver> sources) { | ||
| 77 | + return java.util.Optional.ofNullable(sources).map(scs -> { | ||
| 78 | + return scs.stream().map(source -> { | ||
| 79 | + return convert(source); | ||
| 80 | + }).collect(java.util.stream.Collectors.toList()); | ||
| 81 | + }).orElseGet(null); | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + private IPage<NewDriverVO> convert(IPage<NewDriver> sources) { | ||
| 85 | + return java.util.Optional.ofNullable(sources).map(scs -> { | ||
| 86 | + IPage<NewDriverVO> target = new com.baomidou.mybatisplus.extension.plugins.pagination.Page(); | ||
| 87 | + BeanUtils.copyProperties(scs, target); | ||
| 88 | + List<NewDriverVO> voNames = convert(scs.getRecords()); | ||
| 89 | + target.setRecords(voNames); | ||
| 90 | + | ||
| 91 | + return target; | ||
| 92 | + }).orElseGet(null); | ||
| 93 | + } | ||
| 94 | +} | ||
| 0 | \ No newline at end of file | 95 | \ No newline at end of file |
Bsth-admin/src/main/java/com/ruoyi/controller/driver/healthy/DriverHealthyController.java
| 1 | package com.ruoyi.controller.driver.healthy; | 1 | package com.ruoyi.controller.driver.healthy; |
| 2 | 2 | ||
| 3 | import com.ruoyi.common.core.controller.BaseController; | 3 | import com.ruoyi.common.core.controller.BaseController; |
| 4 | -import com.ruoyi.common.core.domain.AjaxResult; | 4 | +import io.swagger.annotations.Api; |
| 5 | import io.swagger.annotations.ApiOperation; | 5 | import io.swagger.annotations.ApiOperation; |
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | import org.springframework.web.bind.annotation.RestController; | 7 | import org.springframework.web.bind.annotation.RestController; |
| @@ -36,12 +36,14 @@ import com.ruoyi.domain.driver.healthy.DriverHealthy; | @@ -36,12 +36,14 @@ import com.ruoyi.domain.driver.healthy.DriverHealthy; | ||
| 36 | 36 | ||
| 37 | @RestController | 37 | @RestController |
| 38 | @RequestMapping("driver/healthy") | 38 | @RequestMapping("driver/healthy") |
| 39 | +@Api(tags="驾驶员健康信息") | ||
| 39 | public class DriverHealthyController extends BaseController { | 40 | public class DriverHealthyController extends BaseController { |
| 40 | @Autowired | 41 | @Autowired |
| 41 | private DriverHealthyService driverHealthyService; | 42 | private DriverHealthyService driverHealthyService; |
| 42 | 43 | ||
| 43 | @PreAuthorize("@ss.hasPermi('driver:healthy:list:limit:page:limit')") | 44 | @PreAuthorize("@ss.hasPermi('driver:healthy:list:limit:page:limit')") |
| 44 | @PostMapping(value = "/list/limit/{page}/{pageLimit}") | 45 | @PostMapping(value = "/list/limit/{page}/{pageLimit}") |
| 46 | + @ApiOperation("分页查询") | ||
| 45 | public String listLimit(@ModelAttribute DriverHealthyQueryDTO request, @ModelAttribute OrderEntity orderEntity, @PathVariable Integer page, @PathVariable Integer pageLimit, org.springframework.ui.Model model) { | 47 | public String listLimit(@ModelAttribute DriverHealthyQueryDTO request, @ModelAttribute OrderEntity orderEntity, @PathVariable Integer page, @PathVariable Integer pageLimit, org.springframework.ui.Model model) { |
| 46 | request.clearStrEmpty(); | 48 | request.clearStrEmpty(); |
| 47 | DriverHealthy entity = convert(request); | 49 | DriverHealthy entity = convert(request); |
| @@ -52,6 +54,7 @@ public class DriverHealthyController extends BaseController { | @@ -52,6 +54,7 @@ public class DriverHealthyController extends BaseController { | ||
| 52 | 54 | ||
| 53 | 55 | ||
| 54 | @GetMapping(value = "/view/{id}") | 56 | @GetMapping(value = "/view/{id}") |
| 57 | + @ApiOperation("根据ID查看详情") | ||
| 55 | public com.ruoyi.common.core.domain.AjaxResult view(@PathVariable("id") Long id, org.springframework.ui.Model model) { | 58 | public com.ruoyi.common.core.domain.AjaxResult view(@PathVariable("id") Long id, org.springframework.ui.Model model) { |
| 56 | DriverHealthy source = driverHealthyService.getById(id); | 59 | DriverHealthy source = driverHealthyService.getById(id); |
| 57 | 60 | ||
| @@ -61,6 +64,7 @@ public class DriverHealthyController extends BaseController { | @@ -61,6 +64,7 @@ public class DriverHealthyController extends BaseController { | ||
| 61 | 64 | ||
| 62 | @PreAuthorize("@ss.hasPermi('driver:healthy:export')") | 65 | @PreAuthorize("@ss.hasPermi('driver:healthy:export')") |
| 63 | @PostMapping("/export") | 66 | @PostMapping("/export") |
| 67 | + @ApiOperation("导出") | ||
| 64 | public void export(HttpServletResponse response, @RequestBody DriverHealthyQueryDTO request) { | 68 | public void export(HttpServletResponse response, @RequestBody DriverHealthyQueryDTO request) { |
| 65 | request.clearStrEmpty(); | 69 | request.clearStrEmpty(); |
| 66 | DriverHealthy entity = convert(request); | 70 | DriverHealthy entity = convert(request); |
| @@ -71,6 +75,7 @@ public class DriverHealthyController extends BaseController { | @@ -71,6 +75,7 @@ public class DriverHealthyController extends BaseController { | ||
| 71 | 75 | ||
| 72 | @PreAuthorize("@ss.hasPermi('driver:healthy:add')") | 76 | @PreAuthorize("@ss.hasPermi('driver:healthy:add')") |
| 73 | @PostMapping(value = "/add") | 77 | @PostMapping(value = "/add") |
| 78 | + @ApiOperation("添加 ") | ||
| 74 | public com.ruoyi.common.core.domain.AjaxResult add(@ModelAttribute DriverHealthyAddDTO request) { | 79 | public com.ruoyi.common.core.domain.AjaxResult add(@ModelAttribute DriverHealthyAddDTO request) { |
| 75 | request.clearStrEmpty(); | 80 | request.clearStrEmpty(); |
| 76 | DriverHealthy entity = convert(request); | 81 | DriverHealthy entity = convert(request); |
| @@ -82,6 +87,7 @@ public class DriverHealthyController extends BaseController { | @@ -82,6 +87,7 @@ public class DriverHealthyController extends BaseController { | ||
| 82 | 87 | ||
| 83 | @PreAuthorize("@ss.hasPermi('driver:healthy:update')") | 88 | @PreAuthorize("@ss.hasPermi('driver:healthy:update')") |
| 84 | @PostMapping(value = "/update") | 89 | @PostMapping(value = "/update") |
| 90 | + @ApiOperation("修改 ") | ||
| 85 | public com.ruoyi.common.core.domain.AjaxResult update(@ModelAttribute DriverHealthyUpdateDTO request) { | 91 | public com.ruoyi.common.core.domain.AjaxResult update(@ModelAttribute DriverHealthyUpdateDTO request) { |
| 86 | request.clearStrEmpty(); | 92 | request.clearStrEmpty(); |
| 87 | DriverHealthy entity = convert(request); | 93 | DriverHealthy entity = convert(request); |
| @@ -93,6 +99,7 @@ public class DriverHealthyController extends BaseController { | @@ -93,6 +99,7 @@ public class DriverHealthyController extends BaseController { | ||
| 93 | 99 | ||
| 94 | @PreAuthorize("@ss.hasPermi('driver:healthy:update:status')") | 100 | @PreAuthorize("@ss.hasPermi('driver:healthy:update:status')") |
| 95 | @PostMapping(value = "/update/status") | 101 | @PostMapping(value = "/update/status") |
| 102 | + @ApiOperation("修改状态 ") | ||
| 96 | public com.ruoyi.common.core.domain.AjaxResult updateState(@ModelAttribute DriverHealthyUpdateStatusDTO request) { | 103 | public com.ruoyi.common.core.domain.AjaxResult updateState(@ModelAttribute DriverHealthyUpdateStatusDTO request) { |
| 97 | request.clearStrEmpty(); | 104 | request.clearStrEmpty(); |
| 98 | DriverHealthy entity = convert(request); | 105 | DriverHealthy entity = convert(request); |
Bsth-admin/src/main/java/com/ruoyi/controller/keyinfo/KeyInfoController.java
| @@ -11,6 +11,7 @@ import com.ruoyi.domain.keyInfo.vo.KeyInfoVO; | @@ -11,6 +11,7 @@ import com.ruoyi.domain.keyInfo.vo.KeyInfoVO; | ||
| 11 | import com.ruoyi.equipment.domain.Equipment; | 11 | import com.ruoyi.equipment.domain.Equipment; |
| 12 | import com.ruoyi.equipment.service.IEquipmentService; | 12 | import com.ruoyi.equipment.service.IEquipmentService; |
| 13 | import com.ruoyi.service.carinfo.CarInfoService; | 13 | import com.ruoyi.service.carinfo.CarInfoService; |
| 14 | +import io.swagger.annotations.Api; | ||
| 14 | import io.swagger.annotations.ApiOperation; | 15 | import io.swagger.annotations.ApiOperation; |
| 15 | import jdk.nashorn.internal.runtime.options.Option; | 16 | import jdk.nashorn.internal.runtime.options.Option; |
| 16 | import org.apache.commons.collections4.CollectionUtils; | 17 | import org.apache.commons.collections4.CollectionUtils; |
| @@ -38,6 +39,7 @@ import javax.servlet.http.HttpServletResponse; | @@ -38,6 +39,7 @@ import javax.servlet.http.HttpServletResponse; | ||
| 38 | 39 | ||
| 39 | @RestController | 40 | @RestController |
| 40 | @RequestMapping("key/info") | 41 | @RequestMapping("key/info") |
| 42 | +@Api(tags = "钥匙管理") | ||
| 41 | public class KeyInfoController { | 43 | public class KeyInfoController { |
| 42 | @Autowired | 44 | @Autowired |
| 43 | private com.ruoyi.service.keyinfo.KeyInfoService KeyInfoService; | 45 | private com.ruoyi.service.keyinfo.KeyInfoService KeyInfoService; |
| @@ -46,6 +48,7 @@ public class KeyInfoController { | @@ -46,6 +48,7 @@ public class KeyInfoController { | ||
| 46 | 48 | ||
| 47 | @PreAuthorize("@ss.hasPermi('key:info:list:limit:page:limit')") | 49 | @PreAuthorize("@ss.hasPermi('key:info:list:limit:page:limit')") |
| 48 | @PostMapping(value = "/list/limit/{page}/{pageLimit}") | 50 | @PostMapping(value = "/list/limit/{page}/{pageLimit}") |
| 51 | + @ApiOperation("分页查询") | ||
| 49 | public String listLimit(@ModelAttribute KeyInfoQueryDTO request, @ModelAttribute OrderEntity orderEntity, @PathVariable Integer page, @PathVariable Integer pageLimit, org.springframework.ui.Model model) { | 52 | public String listLimit(@ModelAttribute KeyInfoQueryDTO request, @ModelAttribute OrderEntity orderEntity, @PathVariable Integer page, @PathVariable Integer pageLimit, org.springframework.ui.Model model) { |
| 50 | request.clearStrEmpty(); | 53 | request.clearStrEmpty(); |
| 51 | KeyInfo entity = convert(request); | 54 | KeyInfo entity = convert(request); |
| @@ -69,7 +72,7 @@ public class KeyInfoController { | @@ -69,7 +72,7 @@ public class KeyInfoController { | ||
| 69 | } | 72 | } |
| 70 | 73 | ||
| 71 | @PostMapping(value = "list/select") | 74 | @PostMapping(value = "list/select") |
| 72 | - @ApiOperation("设备列表(页面选择)") | 75 | + @ApiOperation("(页面选择)") |
| 73 | public AjaxResult listSelect(@RequestBody KeyInfoQueryDTO dto) { | 76 | public AjaxResult listSelect(@RequestBody KeyInfoQueryDTO dto) { |
| 74 | dto.clearStrEmpty(); | 77 | dto.clearStrEmpty(); |
| 75 | KeyInfo entity = convert(dto); | 78 | KeyInfo entity = convert(dto); |
| @@ -78,6 +81,7 @@ public class KeyInfoController { | @@ -78,6 +81,7 @@ public class KeyInfoController { | ||
| 78 | } | 81 | } |
| 79 | 82 | ||
| 80 | @GetMapping(value = "/view/{id}") | 83 | @GetMapping(value = "/view/{id}") |
| 84 | + @ApiOperation("根据ID查看详情") | ||
| 81 | public com.ruoyi.common.core.domain.AjaxResult view(@PathVariable("id") Integer id, org.springframework.ui.Model model) { | 85 | public com.ruoyi.common.core.domain.AjaxResult view(@PathVariable("id") Integer id, org.springframework.ui.Model model) { |
| 82 | KeyInfo source = KeyInfoService.getById(id); | 86 | KeyInfo source = KeyInfoService.getById(id); |
| 83 | 87 | ||
| @@ -86,6 +90,7 @@ public class KeyInfoController { | @@ -86,6 +90,7 @@ public class KeyInfoController { | ||
| 86 | 90 | ||
| 87 | @PreAuthorize("@ss.hasPermi('key:info:export')") | 91 | @PreAuthorize("@ss.hasPermi('key:info:export')") |
| 88 | @PostMapping("/export") | 92 | @PostMapping("/export") |
| 93 | + @ApiOperation("导出") | ||
| 89 | public void export(HttpServletResponse response, KeyInfoQueryDTO dto) { | 94 | public void export(HttpServletResponse response, KeyInfoQueryDTO dto) { |
| 90 | dto.clearStrEmpty(); | 95 | dto.clearStrEmpty(); |
| 91 | KeyInfo entity = convert(dto); | 96 | KeyInfo entity = convert(dto); |
| @@ -96,6 +101,7 @@ public class KeyInfoController { | @@ -96,6 +101,7 @@ public class KeyInfoController { | ||
| 96 | 101 | ||
| 97 | @PreAuthorize("@ss.hasPermi('key:info:add')") | 102 | @PreAuthorize("@ss.hasPermi('key:info:add')") |
| 98 | @PostMapping(value = "/add") | 103 | @PostMapping(value = "/add") |
| 104 | + @ApiOperation("添加") | ||
| 99 | public com.ruoyi.common.core.domain.AjaxResult add(@ModelAttribute KeyInfoAddDTO request) { | 105 | public com.ruoyi.common.core.domain.AjaxResult add(@ModelAttribute KeyInfoAddDTO request) { |
| 100 | request.clearStrEmpty(); | 106 | request.clearStrEmpty(); |
| 101 | KeyInfo entity = convert(request); | 107 | KeyInfo entity = convert(request); |
| @@ -105,6 +111,7 @@ public class KeyInfoController { | @@ -105,6 +111,7 @@ public class KeyInfoController { | ||
| 105 | 111 | ||
| 106 | @PreAuthorize("@ss.hasPermi('key:info:update')") | 112 | @PreAuthorize("@ss.hasPermi('key:info:update')") |
| 107 | @PostMapping(value = "/update") | 113 | @PostMapping(value = "/update") |
| 114 | + @ApiOperation("修改") | ||
| 108 | public com.ruoyi.common.core.domain.AjaxResult update(@ModelAttribute KeyInfoUpdateDTO request) { | 115 | public com.ruoyi.common.core.domain.AjaxResult update(@ModelAttribute KeyInfoUpdateDTO request) { |
| 109 | request.clearStrEmpty(); | 116 | request.clearStrEmpty(); |
| 110 | KeyInfo entity = convert(request); | 117 | KeyInfo entity = convert(request); |
| @@ -114,6 +121,7 @@ public class KeyInfoController { | @@ -114,6 +121,7 @@ public class KeyInfoController { | ||
| 114 | 121 | ||
| 115 | @PreAuthorize("@ss.hasPermi('key:info:update:status')") | 122 | @PreAuthorize("@ss.hasPermi('key:info:update:status')") |
| 116 | @PostMapping(value = "/update/status") | 123 | @PostMapping(value = "/update/status") |
| 124 | + @ApiOperation("修改状态") | ||
| 117 | public com.ruoyi.common.core.domain.AjaxResult updateState(@ModelAttribute KeyInfoUpdateStatusDTO request) { | 125 | public com.ruoyi.common.core.domain.AjaxResult updateState(@ModelAttribute KeyInfoUpdateStatusDTO request) { |
| 118 | request.clearStrEmpty(); | 126 | request.clearStrEmpty(); |
| 119 | KeyInfo entity = convert(request); | 127 | KeyInfo entity = convert(request); |
Bsth-admin/src/main/java/com/ruoyi/domain/caiinfo/dto/CarInfoAddDTO.java
| @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | ||
| 7 | import lombok.experimental.Accessors; | 7 | import lombok.experimental.Accessors; |
| 8 | 8 | ||
| 9 | @Data | 9 | @Data |
| 10 | -@ApiModel | 10 | +@ApiModel(value="车辆的新增DTO") |
| 11 | @Accessors(chain = true) | 11 | @Accessors(chain = true) |
| 12 | @EqualsAndHashCode(callSuper = false) | 12 | @EqualsAndHashCode(callSuper = false) |
| 13 | public class CarInfoAddDTO implements java.io.Serializable { | 13 | public class CarInfoAddDTO implements java.io.Serializable { |
Bsth-admin/src/main/java/com/ruoyi/domain/caiinfo/dto/CarInfoQueryDTO.java
| @@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode; | @@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode; | ||
| 8 | import lombok.experimental.Accessors; | 8 | import lombok.experimental.Accessors; |
| 9 | 9 | ||
| 10 | @Data | 10 | @Data |
| 11 | -@ApiModel | 11 | +@ApiModel(value="车辆的查询DTO") |
| 12 | @Accessors(chain = true) | 12 | @Accessors(chain = true) |
| 13 | @EqualsAndHashCode(callSuper = false) | 13 | @EqualsAndHashCode(callSuper = false) |
| 14 | public class CarInfoQueryDTO implements java.io.Serializable { | 14 | public class CarInfoQueryDTO implements java.io.Serializable { |
Bsth-admin/src/main/java/com/ruoyi/domain/caiinfo/dto/CarInfoUpdateDTO.java
| @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | ||
| 7 | import lombok.experimental.Accessors; | 7 | import lombok.experimental.Accessors; |
| 8 | 8 | ||
| 9 | @Data | 9 | @Data |
| 10 | -@ApiModel | 10 | +@ApiModel(value="车辆的修改DTO") |
| 11 | @Accessors(chain = true) | 11 | @Accessors(chain = true) |
| 12 | @EqualsAndHashCode(callSuper = false) | 12 | @EqualsAndHashCode(callSuper = false) |
| 13 | public class CarInfoUpdateDTO implements java.io.Serializable { | 13 | public class CarInfoUpdateDTO implements java.io.Serializable { |
Bsth-admin/src/main/java/com/ruoyi/domain/caiinfo/vo/CarInfoVO.java
| @@ -12,7 +12,7 @@ import lombok.experimental.Accessors; | @@ -12,7 +12,7 @@ import lombok.experimental.Accessors; | ||
| 12 | import java.util.Objects; | 12 | import java.util.Objects; |
| 13 | 13 | ||
| 14 | @Data | 14 | @Data |
| 15 | -@ApiModel | 15 | +@ApiModel(value="车辆的VO") |
| 16 | @EqualsAndHashCode(callSuper = false) | 16 | @EqualsAndHashCode(callSuper = false) |
| 17 | public class CarInfoVO implements java.io.Serializable { | 17 | public class CarInfoVO implements java.io.Serializable { |
| 18 | private static final long serialVersionUID = 522735525L; | 18 | private static final long serialVersionUID = 522735525L; |
Bsth-admin/src/main/java/com/ruoyi/domain/driver/dto/NewDriverAddDTO.java
| @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | ||
| 7 | import lombok.experimental.Accessors; | 7 | import lombok.experimental.Accessors; |
| 8 | 8 | ||
| 9 | @Data | 9 | @Data |
| 10 | -@ApiModel | 10 | +@ApiModel(value="司机信息的添加DTO") |
| 11 | @Accessors(chain = true) | 11 | @Accessors(chain = true) |
| 12 | @EqualsAndHashCode(callSuper = false) | 12 | @EqualsAndHashCode(callSuper = false) |
| 13 | public class NewDriverAddDTO implements java.io.Serializable { | 13 | public class NewDriverAddDTO implements java.io.Serializable { |
Bsth-admin/src/main/java/com/ruoyi/domain/driver/dto/NewDriverQueryDTO.java
| @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | ||
| 7 | import lombok.experimental.Accessors; | 7 | import lombok.experimental.Accessors; |
| 8 | 8 | ||
| 9 | @Data | 9 | @Data |
| 10 | -@ApiModel | 10 | +@ApiModel(value="司机信息的查询DTO") |
| 11 | @Accessors(chain = true) | 11 | @Accessors(chain = true) |
| 12 | @EqualsAndHashCode(callSuper = false) | 12 | @EqualsAndHashCode(callSuper = false) |
| 13 | public class NewDriverQueryDTO implements java.io.Serializable { | 13 | public class NewDriverQueryDTO implements java.io.Serializable { |
Bsth-admin/src/main/java/com/ruoyi/domain/driver/dto/NewDriverUpdateDTO.java
| @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | ||
| 7 | import lombok.experimental.Accessors; | 7 | import lombok.experimental.Accessors; |
| 8 | 8 | ||
| 9 | @Data | 9 | @Data |
| 10 | -@ApiModel | 10 | +@ApiModel(value="司机信息的修改DTO") |
| 11 | @Accessors(chain = true) | 11 | @Accessors(chain = true) |
| 12 | @EqualsAndHashCode(callSuper = false) | 12 | @EqualsAndHashCode(callSuper = false) |
| 13 | public class NewDriverUpdateDTO implements java.io.Serializable { | 13 | public class NewDriverUpdateDTO implements java.io.Serializable { |
Bsth-admin/src/main/java/com/ruoyi/domain/driver/healthy/dto/DriverHealthyAddDTO.java
| @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | ||
| 7 | import lombok.experimental.Accessors; | 7 | import lombok.experimental.Accessors; |
| 8 | 8 | ||
| 9 | @Data | 9 | @Data |
| 10 | -@ApiModel | 10 | +@ApiModel(value="司机健康信息的新增DTO") |
| 11 | @Accessors(chain = true) | 11 | @Accessors(chain = true) |
| 12 | @EqualsAndHashCode(callSuper = false) | 12 | @EqualsAndHashCode(callSuper = false) |
| 13 | public class DriverHealthyAddDTO implements java.io.Serializable { | 13 | public class DriverHealthyAddDTO implements java.io.Serializable { |
Bsth-admin/src/main/java/com/ruoyi/domain/driver/healthy/dto/DriverHealthyQueryDTO.java
| @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | ||
| 7 | import lombok.experimental.Accessors; | 7 | import lombok.experimental.Accessors; |
| 8 | 8 | ||
| 9 | @Data | 9 | @Data |
| 10 | -@ApiModel | 10 | +@ApiModel(value="司机健康信息的查询DTO") |
| 11 | @Accessors(chain = true) | 11 | @Accessors(chain = true) |
| 12 | @EqualsAndHashCode(callSuper = false) | 12 | @EqualsAndHashCode(callSuper = false) |
| 13 | public class DriverHealthyQueryDTO implements java.io.Serializable { | 13 | public class DriverHealthyQueryDTO implements java.io.Serializable { |
Bsth-admin/src/main/java/com/ruoyi/domain/driver/healthy/dto/DriverHealthyUpdateDTO.java
| @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | ||
| 7 | import lombok.experimental.Accessors; | 7 | import lombok.experimental.Accessors; |
| 8 | 8 | ||
| 9 | @Data | 9 | @Data |
| 10 | -@ApiModel | 10 | +@ApiModel(value="司机健康信息的修改DTO") |
| 11 | @Accessors(chain = true) | 11 | @Accessors(chain = true) |
| 12 | @EqualsAndHashCode(callSuper = false) | 12 | @EqualsAndHashCode(callSuper = false) |
| 13 | public class DriverHealthyUpdateDTO implements java.io.Serializable { | 13 | public class DriverHealthyUpdateDTO implements java.io.Serializable { |
Bsth-admin/src/main/java/com/ruoyi/domain/driver/healthy/dto/DriverHealthyUpdateStatusDTO.java
| @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | ||
| 7 | import lombok.experimental.Accessors; | 7 | import lombok.experimental.Accessors; |
| 8 | 8 | ||
| 9 | @Data | 9 | @Data |
| 10 | -@ApiModel | 10 | +@ApiModel(value="司机健康信息的修改状态DTO") |
| 11 | @Accessors(chain = true) | 11 | @Accessors(chain = true) |
| 12 | @EqualsAndHashCode(callSuper = false) | 12 | @EqualsAndHashCode(callSuper = false) |
| 13 | public class DriverHealthyUpdateStatusDTO implements java.io.Serializable { | 13 | public class DriverHealthyUpdateStatusDTO implements java.io.Serializable { |
Bsth-admin/src/main/java/com/ruoyi/domain/driver/healthy/vo/DriverHealthyVO.java
| @@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode; | @@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode; | ||
| 8 | import lombok.experimental.Accessors; | 8 | import lombok.experimental.Accessors; |
| 9 | 9 | ||
| 10 | @Data | 10 | @Data |
| 11 | -@ApiModel | 11 | +@ApiModel(value="司机健康信息的VO") |
| 12 | @Accessors(chain = true) | 12 | @Accessors(chain = true) |
| 13 | @EqualsAndHashCode(callSuper = false) | 13 | @EqualsAndHashCode(callSuper = false) |
| 14 | public class DriverHealthyVO implements java.io.Serializable { | 14 | public class DriverHealthyVO implements java.io.Serializable { |
Bsth-admin/src/main/java/com/ruoyi/domain/driver/vo/NewDriverVO.java
| @@ -9,7 +9,7 @@ import lombok.experimental.Accessors; | @@ -9,7 +9,7 @@ import lombok.experimental.Accessors; | ||
| 9 | import org.apache.commons.lang3.StringUtils; | 9 | import org.apache.commons.lang3.StringUtils; |
| 10 | 10 | ||
| 11 | @Data | 11 | @Data |
| 12 | -@ApiModel | 12 | +@ApiModel(value="司机信息的VO") |
| 13 | @Accessors(chain = true) | 13 | @Accessors(chain = true) |
| 14 | @EqualsAndHashCode(callSuper = false) | 14 | @EqualsAndHashCode(callSuper = false) |
| 15 | public class NewDriverVO implements java.io.Serializable { | 15 | public class NewDriverVO implements java.io.Serializable { |
Bsth-admin/src/main/java/com/ruoyi/domain/keyInfo/dto/KeyInfoAddDTO.java
| @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | ||
| 7 | import lombok.experimental.Accessors; | 7 | import lombok.experimental.Accessors; |
| 8 | 8 | ||
| 9 | @Data | 9 | @Data |
| 10 | -@ApiModel | 10 | +@ApiModel(value="钥匙信息的添加DTO") |
| 11 | @Accessors(chain = true) | 11 | @Accessors(chain = true) |
| 12 | @EqualsAndHashCode(callSuper = false) | 12 | @EqualsAndHashCode(callSuper = false) |
| 13 | public class KeyInfoAddDTO implements java.io.Serializable { | 13 | public class KeyInfoAddDTO implements java.io.Serializable { |
Bsth-admin/src/main/java/com/ruoyi/domain/keyInfo/dto/KeyInfoQueryDTO.java
| @@ -8,9 +8,10 @@ import lombok.EqualsAndHashCode; | @@ -8,9 +8,10 @@ import lombok.EqualsAndHashCode; | ||
| 8 | import lombok.experimental.Accessors; | 8 | import lombok.experimental.Accessors; |
| 9 | 9 | ||
| 10 | @Data | 10 | @Data |
| 11 | -@ApiModel | 11 | +@ApiModel(value="钥匙信息的查询DTO") |
| 12 | @Accessors(chain = true) | 12 | @Accessors(chain = true) |
| 13 | @EqualsAndHashCode(callSuper = false) | 13 | @EqualsAndHashCode(callSuper = false) |
| 14 | + | ||
| 14 | public class KeyInfoQueryDTO implements java.io.Serializable { | 15 | public class KeyInfoQueryDTO implements java.io.Serializable { |
| 15 | private static final long serialVersionUID = 397900919L; | 16 | private static final long serialVersionUID = 397900919L; |
| 16 | 17 |
Bsth-admin/src/main/java/com/ruoyi/domain/keyInfo/dto/KeyInfoUpdateDTO.java
| @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | ||
| 7 | import lombok.experimental.Accessors; | 7 | import lombok.experimental.Accessors; |
| 8 | 8 | ||
| 9 | @Data | 9 | @Data |
| 10 | -@ApiModel | 10 | +@ApiModel(value="钥匙信息的修改DTO") |
| 11 | @Accessors(chain = true) | 11 | @Accessors(chain = true) |
| 12 | @EqualsAndHashCode(callSuper = false) | 12 | @EqualsAndHashCode(callSuper = false) |
| 13 | public class KeyInfoUpdateDTO implements java.io.Serializable { | 13 | public class KeyInfoUpdateDTO implements java.io.Serializable { |
Bsth-admin/src/main/java/com/ruoyi/domain/keyInfo/dto/KeyInfoUpdateStatusDTO.java
| @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | ||
| 7 | import lombok.experimental.Accessors; | 7 | import lombok.experimental.Accessors; |
| 8 | 8 | ||
| 9 | @Data | 9 | @Data |
| 10 | -@ApiModel | 10 | +@ApiModel(value="钥匙信息的修改状态DTO") |
| 11 | @Accessors(chain = true) | 11 | @Accessors(chain = true) |
| 12 | @EqualsAndHashCode(callSuper = false) | 12 | @EqualsAndHashCode(callSuper = false) |
| 13 | public class KeyInfoUpdateStatusDTO implements java.io.Serializable { | 13 | public class KeyInfoUpdateStatusDTO implements java.io.Serializable { |
Bsth-admin/src/main/java/com/ruoyi/domain/keyInfo/vo/KeyInfoVO.java
| @@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode; | @@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode; | ||
| 8 | import lombok.experimental.Accessors; | 8 | import lombok.experimental.Accessors; |
| 9 | 9 | ||
| 10 | @Data | 10 | @Data |
| 11 | -@ApiModel | 11 | +@ApiModel(value="钥匙信息的VO") |
| 12 | @Accessors(chain = true) | 12 | @Accessors(chain = true) |
| 13 | @EqualsAndHashCode(callSuper = false) | 13 | @EqualsAndHashCode(callSuper = false) |
| 14 | public class KeyInfoVO implements java.io.Serializable { | 14 | public class KeyInfoVO implements java.io.Serializable { |
Bsth-admin/src/main/java/com/ruoyi/mapper/driver/NewDriverMapper.java
0 → 100644
| 1 | +package com.ruoyi.mapper.driver; | ||
| 2 | + | ||
| 3 | +import com.ruoyi.domain.driver.NewDriver; | ||
| 4 | +import org.apache.ibatis.annotations.Mapper; | ||
| 5 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
| 6 | + | ||
| 7 | + | ||
| 8 | +@Mapper | ||
| 9 | +public interface NewDriverMapper extends BaseMapper<NewDriver> { | ||
| 10 | + /** | ||
| 11 | + * 插入有值的列 | ||
| 12 | + */ | ||
| 13 | + int insertSelective(NewDriver name); | ||
| 14 | +} | ||
| 0 | \ No newline at end of file | 15 | \ No newline at end of file |
Bsth-admin/src/main/java/com/ruoyi/service/driver/NewDriverService.java
0 → 100644
| 1 | +package com; | ||
| 2 | + | ||
| 3 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
| 4 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 5 | + | ||
| 6 | +import java.util.List; | ||
| 7 | + | ||
| 8 | +import com.ruoyi.domain.OrderEntity; | ||
| 9 | +import com.ruoyi.domain.driver.NewDriver; | ||
| 10 | + | ||
| 11 | + | ||
| 12 | +public interface NewDriverService extends IService<NewDriver> { | ||
| 13 | + /** | ||
| 14 | + * 分页查询 | ||
| 15 | + */ | ||
| 16 | + IPage<NewDriver> pageList(com.baomidou.mybatisplus.extension.plugins.pagination.Page<NewDriver> page, NewDriver entity, OrderEntity orderEntity); | ||
| 17 | + | ||
| 18 | + /** | ||
| 19 | + * 带条件查询 | ||
| 20 | + */ | ||
| 21 | + List<NewDriver> list(NewDriver entity); | ||
| 22 | + | ||
| 23 | + List<NewDriver> listOfIds(java.util.Collection<java.lang.String> ids); | ||
| 24 | + | ||
| 25 | + /*** | ||
| 26 | + *用于页面选择 | ||
| 27 | + */ | ||
| 28 | + List<NewDriver> listOfSelect(NewDriver entity); | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * 条件查询只返回一条数据的方法 | ||
| 32 | + */ | ||
| 33 | + NewDriver getOne(NewDriver entity); | ||
| 34 | + | ||
| 35 | + Integer countId(NewDriver entity); | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * 插入有值的列 | ||
| 39 | + */ | ||
| 40 | + int insertSelective(NewDriver entity); | ||
| 41 | + | ||
| 42 | + /***插入数据*/ | ||
| 43 | + boolean insert(NewDriver entity); | ||
| 44 | + | ||
| 45 | + /** | ||
| 46 | + * 根据主键修改数据 | ||
| 47 | + */ | ||
| 48 | + boolean updateByPrimaryKey(NewDriver entity); | ||
| 49 | + | ||
| 50 | + boolean deleteById(java.lang.String jobCode); | ||
| 51 | +} | ||
| 0 | \ No newline at end of file | 52 | \ No newline at end of file |
Bsth-admin/src/main/java/com/ruoyi/service/impl/driver/NewDriverServiceImpl.java
0 → 100644
| 1 | +package com.ruoyi.service.impl.driver; | ||
| 2 | + | ||
| 3 | +import com.ruoyi.domain.driver.NewDriver; | ||
| 4 | +import com.ruoyi.mapper.driver.NewDriverMapper; | ||
| 5 | +import org.apache.commons.collections4.CollectionUtils; | ||
| 6 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 7 | +import org.springframework.stereotype.Service; | ||
| 8 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
| 9 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
| 10 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 11 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 12 | + | ||
| 13 | +import com.github.pagehelper.PageHelper; | ||
| 14 | + | ||
| 15 | +import javax.servlet.http.HttpServletResponse; | ||
| 16 | + | ||
| 17 | +import java.util.Collection; | ||
| 18 | +import java.util.Collections; | ||
| 19 | +import java.util.List; | ||
| 20 | + | ||
| 21 | +import com.ruoyi.domain.OrderEntity; | ||
| 22 | + | ||
| 23 | +@Service | ||
| 24 | +public class NewDriverServiceImpl extends ServiceImpl<NewDriverMapper, NewDriver> implements com.NewDriverService { | ||
| 25 | + @Autowired | ||
| 26 | + private NewDriverMapper newDriverMapper; | ||
| 27 | + | ||
| 28 | + /** | ||
| 29 | + * 分页查询 | ||
| 30 | + */ | ||
| 31 | + @Override | ||
| 32 | + public IPage<NewDriver> pageList(Page<NewDriver> page, NewDriver entity, OrderEntity orderEntity) { | ||
| 33 | + LambdaQueryWrapper<NewDriver> countWrapper = new LambdaQueryWrapper<>(entity); | ||
| 34 | + countWrapper.select(NewDriver::getJobCode); | ||
| 35 | + int count = count(countWrapper); | ||
| 36 | + | ||
| 37 | + List<NewDriver> lists = Collections.emptyList(); | ||
| 38 | + if (count > 0) { | ||
| 39 | + PageHelper.startPage((int) page.getCurrent(), (int) page.getSize(), false); | ||
| 40 | + LambdaQueryWrapper<NewDriver> selectWrapper = new LambdaQueryWrapper<>(entity); | ||
| 41 | + orderColumn(selectWrapper, orderEntity); | ||
| 42 | + lists = list(selectWrapper); | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + IPage<NewDriver> returnPage = new Page<NewDriver>(); | ||
| 46 | + returnPage.setRecords(lists); | ||
| 47 | + returnPage.setPages(count % page.getSize() == 0 ? count / page.getSize() : count / page.getSize() + 1); | ||
| 48 | + returnPage.setCurrent(page.getCurrent()); | ||
| 49 | + returnPage.setSize(page.getSize()); | ||
| 50 | + returnPage.setTotal(count); | ||
| 51 | + | ||
| 52 | + return returnPage; | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + @Override | ||
| 56 | + public List<NewDriver> list(NewDriver entity) { | ||
| 57 | + return list(new LambdaQueryWrapper<>(entity)); | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + @Override | ||
| 61 | + public List<NewDriver> listOfIds(Collection<String> ids) { | ||
| 62 | + if (CollectionUtils.isEmpty(ids)) { | ||
| 63 | + return Collections.emptyList(); | ||
| 64 | + } | ||
| 65 | + LambdaQueryWrapper<NewDriver> wrapper = new LambdaQueryWrapper<>(); | ||
| 66 | + wrapper.in(NewDriver::getId, ids); | ||
| 67 | + return list(wrapper); | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + @Override | ||
| 71 | + public List<NewDriver> listOfSelect(NewDriver entity) { | ||
| 72 | + LambdaQueryWrapper<NewDriver> wrapper = new LambdaQueryWrapper<>(entity); | ||
| 73 | + wrapper.select(NewDriver::getId, NewDriver::getJobCode, NewDriver::getPersonnelName); | ||
| 74 | + return list(wrapper); | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + @Override | ||
| 78 | + public NewDriver getOne(NewDriver entity) { | ||
| 79 | + return getOne(new LambdaQueryWrapper<>(entity)); | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + @Override | ||
| 83 | + public Integer countId(NewDriver entity) { | ||
| 84 | + LambdaQueryWrapper<NewDriver> wrapper = new LambdaQueryWrapper<>(entity); | ||
| 85 | + wrapper.select(NewDriver::getJobCode); | ||
| 86 | + return count(wrapper); | ||
| 87 | + } | ||
| 88 | + | ||
| 89 | + | ||
| 90 | + /** | ||
| 91 | + * 插入有值的列 | ||
| 92 | + */ | ||
| 93 | + @Override | ||
| 94 | + public int insertSelective(NewDriver entity) { | ||
| 95 | + return newDriverMapper.insertSelective(entity); | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + /** | ||
| 99 | + * 插入数据 | ||
| 100 | + */ | ||
| 101 | + @Override | ||
| 102 | + public boolean insert(NewDriver entity) { | ||
| 103 | + return save(entity); | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + /** | ||
| 107 | + * 根据主键修改数据 | ||
| 108 | + */ | ||
| 109 | + @Override | ||
| 110 | + public boolean updateByPrimaryKey(NewDriver entity) { | ||
| 111 | + return updateById(entity); | ||
| 112 | + } | ||
| 113 | + | ||
| 114 | + /***根据主键删除数据*/ | ||
| 115 | + @Override | ||
| 116 | + public boolean deleteById(java.lang.String jobCode) { | ||
| 117 | + return removeById(jobCode); | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | + | ||
| 121 | + public static void orderColumn(LambdaQueryWrapper<NewDriver> wrapper, com.ruoyi.domain.OrderEntity orderEntity) { | ||
| 122 | + if (org.apache.commons.lang3.StringUtils.equals("ascending", orderEntity.getOrder())) { | ||
| 123 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "id")) { | ||
| 124 | + wrapper.orderByAsc(NewDriver::getId); | ||
| 125 | + } | ||
| 126 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "jobCode")) { | ||
| 127 | + wrapper.orderByAsc(NewDriver::getJobCode); | ||
| 128 | + } | ||
| 129 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "companyCode")) { | ||
| 130 | + wrapper.orderByAsc(NewDriver::getCompanyCode); | ||
| 131 | + } | ||
| 132 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "brancheCompanyCode")) { | ||
| 133 | + wrapper.orderByAsc(NewDriver::getBrancheCompanyCode); | ||
| 134 | + } | ||
| 135 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "personnelName")) { | ||
| 136 | + wrapper.orderByAsc(NewDriver::getPersonnelName); | ||
| 137 | + } | ||
| 138 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "papersCode")) { | ||
| 139 | + wrapper.orderByAsc(NewDriver::getPapersCode); | ||
| 140 | + } | ||
| 141 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "icCardCode")) { | ||
| 142 | + wrapper.orderByAsc(NewDriver::getIcCardCode); | ||
| 143 | + } | ||
| 144 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "personnelType")) { | ||
| 145 | + wrapper.orderByAsc(NewDriver::getPersonnelType); | ||
| 146 | + } | ||
| 147 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "posts")) { | ||
| 148 | + wrapper.orderByAsc(NewDriver::getPosts); | ||
| 149 | + } | ||
| 150 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "card")) { | ||
| 151 | + wrapper.orderByAsc(NewDriver::getCard); | ||
| 152 | + } | ||
| 153 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "telphone")) { | ||
| 154 | + wrapper.orderByAsc(NewDriver::getTelphone); | ||
| 155 | + } | ||
| 156 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "icRfid")) { | ||
| 157 | + wrapper.orderByAsc(NewDriver::getIcRfid); | ||
| 158 | + } | ||
| 159 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "idRfid")) { | ||
| 160 | + wrapper.orderByAsc(NewDriver::getIdRfid); | ||
| 161 | + } | ||
| 162 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "tagRfid")) { | ||
| 163 | + wrapper.orderByAsc(NewDriver::getTagRfid); | ||
| 164 | + } | ||
| 165 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "remark")) { | ||
| 166 | + wrapper.orderByAsc(NewDriver::getRemark); | ||
| 167 | + } | ||
| 168 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "lineName")) { | ||
| 169 | + wrapper.orderByAsc(NewDriver::getLineName); | ||
| 170 | + } | ||
| 171 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "lineCode")) { | ||
| 172 | + wrapper.orderByAsc(NewDriver::getLineCode); | ||
| 173 | + } | ||
| 174 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "faceSignIn")) { | ||
| 175 | + wrapper.orderByAsc(NewDriver::getFaceSignIn); | ||
| 176 | + } | ||
| 177 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "image")) { | ||
| 178 | + wrapper.orderByAsc(NewDriver::getImage); | ||
| 179 | + } | ||
| 180 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "updateTime")) { | ||
| 181 | + wrapper.orderByAsc(NewDriver::getUpdateTime); | ||
| 182 | + } | ||
| 183 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "signInEquipment")) { | ||
| 184 | + wrapper.orderByAsc(NewDriver::getSignInEquipment); | ||
| 185 | + } | ||
| 186 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "fleetName")) { | ||
| 187 | + wrapper.orderByAsc(NewDriver::getFleetName); | ||
| 188 | + } | ||
| 189 | + } else if (org.apache.commons.lang3.StringUtils.equals("descending", orderEntity.getOrder())) { | ||
| 190 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "id")) { | ||
| 191 | + wrapper.orderByDesc(NewDriver::getId); | ||
| 192 | + } | ||
| 193 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "jobCode")) { | ||
| 194 | + wrapper.orderByDesc(NewDriver::getJobCode); | ||
| 195 | + } | ||
| 196 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "companyCode")) { | ||
| 197 | + wrapper.orderByDesc(NewDriver::getCompanyCode); | ||
| 198 | + } | ||
| 199 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "brancheCompanyCode")) { | ||
| 200 | + wrapper.orderByDesc(NewDriver::getBrancheCompanyCode); | ||
| 201 | + } | ||
| 202 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "personnelName")) { | ||
| 203 | + wrapper.orderByDesc(NewDriver::getPersonnelName); | ||
| 204 | + } | ||
| 205 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "papersCode")) { | ||
| 206 | + wrapper.orderByDesc(NewDriver::getPapersCode); | ||
| 207 | + } | ||
| 208 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "icCardCode")) { | ||
| 209 | + wrapper.orderByDesc(NewDriver::getIcCardCode); | ||
| 210 | + } | ||
| 211 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "personnelType")) { | ||
| 212 | + wrapper.orderByDesc(NewDriver::getPersonnelType); | ||
| 213 | + } | ||
| 214 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "posts")) { | ||
| 215 | + wrapper.orderByDesc(NewDriver::getPosts); | ||
| 216 | + } | ||
| 217 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "card")) { | ||
| 218 | + wrapper.orderByDesc(NewDriver::getCard); | ||
| 219 | + } | ||
| 220 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "telphone")) { | ||
| 221 | + wrapper.orderByDesc(NewDriver::getTelphone); | ||
| 222 | + } | ||
| 223 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "icRfid")) { | ||
| 224 | + wrapper.orderByDesc(NewDriver::getIcRfid); | ||
| 225 | + } | ||
| 226 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "idRfid")) { | ||
| 227 | + wrapper.orderByDesc(NewDriver::getIdRfid); | ||
| 228 | + } | ||
| 229 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "tagRfid")) { | ||
| 230 | + wrapper.orderByDesc(NewDriver::getTagRfid); | ||
| 231 | + } | ||
| 232 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "remark")) { | ||
| 233 | + wrapper.orderByDesc(NewDriver::getRemark); | ||
| 234 | + } | ||
| 235 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "lineName")) { | ||
| 236 | + wrapper.orderByDesc(NewDriver::getLineName); | ||
| 237 | + } | ||
| 238 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "lineCode")) { | ||
| 239 | + wrapper.orderByDesc(NewDriver::getLineCode); | ||
| 240 | + } | ||
| 241 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "faceSignIn")) { | ||
| 242 | + wrapper.orderByDesc(NewDriver::getFaceSignIn); | ||
| 243 | + } | ||
| 244 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "image")) { | ||
| 245 | + wrapper.orderByDesc(NewDriver::getImage); | ||
| 246 | + } | ||
| 247 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "updateTime")) { | ||
| 248 | + wrapper.orderByDesc(NewDriver::getUpdateTime); | ||
| 249 | + } | ||
| 250 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "signInEquipment")) { | ||
| 251 | + wrapper.orderByDesc(NewDriver::getSignInEquipment); | ||
| 252 | + } | ||
| 253 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "fleetName")) { | ||
| 254 | + wrapper.orderByDesc(NewDriver::getFleetName); | ||
| 255 | + } | ||
| 256 | + } | ||
| 257 | + } | ||
| 258 | +} | ||
| 0 | \ No newline at end of file | 259 | \ No newline at end of file |
Bsth-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java
| @@ -59,9 +59,9 @@ public class SwaggerConfig | @@ -59,9 +59,9 @@ public class SwaggerConfig | ||
| 59 | // 设置哪些接口暴露给Swagger展示 | 59 | // 设置哪些接口暴露给Swagger展示 |
| 60 | .select() | 60 | .select() |
| 61 | // 扫描所有有注解的api,用这种方式更灵活 | 61 | // 扫描所有有注解的api,用这种方式更灵活 |
| 62 | - .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) | 62 | + // .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) |
| 63 | // 扫描指定包中的swagger注解 | 63 | // 扫描指定包中的swagger注解 |
| 64 | - // .apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger")) | 64 | + .apis(RequestHandlerSelectors.basePackage("com.ruoyi")) |
| 65 | // 扫描所有 | 65 | // 扫描所有 |
| 66 | .apis(RequestHandlerSelectors.any()) | 66 | .apis(RequestHandlerSelectors.any()) |
| 67 | .paths(PathSelectors.any()) | 67 | .paths(PathSelectors.any()) |