Commit 13d622c9225151d1081fe7926325dae35f142440
1 parent
465954d0
蓝斯接口
Showing
51 changed files
with
1458 additions
and
477 deletions
Bsth-admin/src/main/java/com/ruoyi/config/BsthSystemConfig.java
0 → 100644
| 1 | +package com.ruoyi.config; | ||
| 2 | + | ||
| 3 | +import lombok.Data; | ||
| 4 | +import org.springframework.beans.factory.annotation.Value; | ||
| 5 | +import org.springframework.stereotype.Component; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * @author liujun | ||
| 9 | + * @date 2024年07月12日 9:32 | ||
| 10 | + */ | ||
| 11 | +@Data | ||
| 12 | +@Component | ||
| 13 | +public class BsthSystemConfig { | ||
| 14 | + @Value("${bsth.upload.image.basePath}") | ||
| 15 | + private String imageBasePath; | ||
| 16 | +} |
Bsth-admin/src/main/java/com/ruoyi/controller/carinfo/CarInfoController.java
| 1 | package com.ruoyi.controller.carinfo; | 1 | package com.ruoyi.controller.carinfo; |
| 2 | 2 | ||
| 3 | +import com.alibaba.fastjson2.JSON; | ||
| 4 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 5 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 3 | import com.ruoyi.common.core.controller.BaseController; | 6 | import com.ruoyi.common.core.controller.BaseController; |
| 4 | -import com.ruoyi.common.core.domain.AjaxResult; | 7 | +import com.ruoyi.common.core.domain.ResponseResult; |
| 8 | +import com.ruoyi.common.utils.poi.ExcelUtil; | ||
| 5 | import com.ruoyi.domain.OrderEntity; | 9 | import com.ruoyi.domain.OrderEntity; |
| 10 | +import com.ruoyi.domain.caiinfo.CarInfo; | ||
| 11 | +import com.ruoyi.domain.caiinfo.dto.CarInfoAddDTO; | ||
| 12 | +import com.ruoyi.domain.caiinfo.dto.CarInfoQueryDTO; | ||
| 13 | +import com.ruoyi.domain.caiinfo.dto.CarInfoUpdateDTO; | ||
| 14 | +import com.ruoyi.domain.caiinfo.vo.CarInfoVO; | ||
| 15 | +import com.ruoyi.service.carinfo.CarInfoService; | ||
| 6 | import io.swagger.annotations.Api; | 16 | import io.swagger.annotations.Api; |
| 7 | import io.swagger.annotations.ApiOperation; | 17 | import io.swagger.annotations.ApiOperation; |
| 8 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 9 | -import org.springframework.web.bind.annotation.RestController; | ||
| 10 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
| 11 | -import org.springframework.web.bind.annotation.*; | ||
| 12 | import org.springframework.beans.BeanUtils; | 18 | import org.springframework.beans.BeanUtils; |
| 13 | - | 19 | +import org.springframework.beans.factory.annotation.Autowired; |
| 14 | import org.springframework.security.access.prepost.PreAuthorize; | 20 | import org.springframework.security.access.prepost.PreAuthorize; |
| 21 | +import org.springframework.web.bind.annotation.*; | ||
| 15 | 22 | ||
| 23 | +import javax.servlet.http.HttpServletResponse; | ||
| 16 | import java.util.*; | 24 | import java.util.*; |
| 17 | import java.util.stream.Collectors; | 25 | import java.util.stream.Collectors; |
| 18 | 26 | ||
| 19 | - | ||
| 20 | -import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 21 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 22 | - | ||
| 23 | -import com.alibaba.fastjson2.JSON; | ||
| 24 | - | ||
| 25 | -import com.ruoyi.common.utils.poi.ExcelUtil; | ||
| 26 | - | ||
| 27 | -import javax.servlet.http.HttpServletResponse; | ||
| 28 | - | ||
| 29 | -import com.ruoyi.service.carinfo.CarInfoService; | ||
| 30 | -import com.ruoyi.domain.caiinfo.vo.CarInfoVO; | ||
| 31 | -import com.ruoyi.domain.caiinfo.dto.CarInfoAddDTO; | ||
| 32 | -import com.ruoyi.domain.caiinfo.dto.CarInfoUpdateDTO; | ||
| 33 | -import com.ruoyi.domain.caiinfo.dto.CarInfoQueryDTO; | ||
| 34 | -import com.ruoyi.domain.caiinfo.CarInfo; | ||
| 35 | - | ||
| 36 | @RestController | 27 | @RestController |
| 37 | @RequestMapping("car/info") | 28 | @RequestMapping("car/info") |
| 38 | @Api(tags="车辆信息") | 29 | @Api(tags="车辆信息") |
| @@ -52,10 +43,10 @@ public class CarInfoController extends BaseController { | @@ -52,10 +43,10 @@ public class CarInfoController extends BaseController { | ||
| 52 | 43 | ||
| 53 | @ApiOperation("根据ID查询详情") | 44 | @ApiOperation("根据ID查询详情") |
| 54 | @GetMapping(value = "/view/{id}") | 45 | @GetMapping(value = "/view/{id}") |
| 55 | - public com.ruoyi.common.core.domain.AjaxResult view(@PathVariable("id") Integer id, org.springframework.ui.Model model) { | 46 | + public ResponseResult<CarInfoVO> view(@PathVariable("id") Integer id, org.springframework.ui.Model model) { |
| 56 | CarInfo source = CarInfoService.getById(id); | 47 | CarInfo source = CarInfoService.getById(id); |
| 57 | 48 | ||
| 58 | - return com.ruoyi.common.core.domain.AjaxResult.success(convert(source)); | 49 | + return ResponseResult.success(convert(source)); |
| 59 | } | 50 | } |
| 60 | 51 | ||
| 61 | 52 | ||
| @@ -72,15 +63,15 @@ public class CarInfoController extends BaseController { | @@ -72,15 +63,15 @@ public class CarInfoController extends BaseController { | ||
| 72 | 63 | ||
| 73 | @PostMapping(value = "list/select") | 64 | @PostMapping(value = "list/select") |
| 74 | @ApiOperation("车辆列表(页面选择)") | 65 | @ApiOperation("车辆列表(页面选择)") |
| 75 | - public AjaxResult listSelect(CarInfoQueryDTO dto) { | 66 | + public ResponseResult<List<CarInfoVO>> listSelect(CarInfoQueryDTO dto) { |
| 76 | CarInfo entity = convert(dto); | 67 | CarInfo entity = convert(dto); |
| 77 | List<CarInfo> selectList = CarInfoService.listOfSelect(entity); | 68 | List<CarInfo> selectList = CarInfoService.listOfSelect(entity); |
| 78 | - return AjaxResult.success(convert(selectList)); | 69 | + return ResponseResult.success(convert(selectList)); |
| 79 | } | 70 | } |
| 80 | 71 | ||
| 81 | @GetMapping(value = "list/select/status") | 72 | @GetMapping(value = "list/select/status") |
| 82 | @ApiOperation("车辆状态选择列表(页面选择)") | 73 | @ApiOperation("车辆状态选择列表(页面选择)") |
| 83 | - public AjaxResult listSelect() { | 74 | + public ResponseResult<List<Map<String,Object>>> listSelect() { |
| 84 | List<Map<String,Object>> results = Arrays.stream(CarInfo.CarStatusEnum.values()).map(c->{ | 75 | List<Map<String,Object>> results = Arrays.stream(CarInfo.CarStatusEnum.values()).map(c->{ |
| 85 | Map<String,Object> map = new HashMap<>(); | 76 | Map<String,Object> map = new HashMap<>(); |
| 86 | map.put("label",c.getLabel()); | 77 | map.put("label",c.getLabel()); |
| @@ -88,37 +79,37 @@ public class CarInfoController extends BaseController { | @@ -88,37 +79,37 @@ public class CarInfoController extends BaseController { | ||
| 88 | 79 | ||
| 89 | return map; | 80 | return map; |
| 90 | }).collect(Collectors.toList()); | 81 | }).collect(Collectors.toList()); |
| 91 | - return AjaxResult.success(results); | 82 | + return ResponseResult.success(results); |
| 92 | } | 83 | } |
| 93 | 84 | ||
| 94 | @PreAuthorize("@ss.hasPermi('car:info:add')") | 85 | @PreAuthorize("@ss.hasPermi('car:info:add')") |
| 95 | @PostMapping(value = "/add") | 86 | @PostMapping(value = "/add") |
| 96 | @ApiOperation("添加车辆信息") | 87 | @ApiOperation("添加车辆信息") |
| 97 | - public com.ruoyi.common.core.domain.AjaxResult add(@ModelAttribute CarInfoAddDTO request) { | 88 | + public ResponseResult add(@ModelAttribute CarInfoAddDTO request) { |
| 98 | CarInfo entity = convert(request); | 89 | CarInfo entity = convert(request); |
| 99 | entity.setCreateBy(getUserId()); | 90 | entity.setCreateBy(getUserId()); |
| 100 | entity.setCreateTime(new Date()); | 91 | entity.setCreateTime(new Date()); |
| 101 | int count = CarInfoService.insertSelective(entity); | 92 | int count = CarInfoService.insertSelective(entity); |
| 102 | - return count > 0 ? com.ruoyi.common.core.domain.AjaxResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.AjaxResult.error("添加数据失败,请稍后再试"); | 93 | + return count > 0 ? ResponseResult.success(Boolean.TRUE) : ResponseResult.error("添加数据失败,请稍后再试"); |
| 103 | } | 94 | } |
| 104 | 95 | ||
| 105 | @PreAuthorize("@ss.hasPermi('car:info:update')") | 96 | @PreAuthorize("@ss.hasPermi('car:info:update')") |
| 106 | @PostMapping(value = "/update") | 97 | @PostMapping(value = "/update") |
| 107 | @ApiOperation("修改车辆信息") | 98 | @ApiOperation("修改车辆信息") |
| 108 | - public com.ruoyi.common.core.domain.AjaxResult update(@ModelAttribute CarInfoUpdateDTO request) { | 99 | + public ResponseResult update(@ModelAttribute CarInfoUpdateDTO request) { |
| 109 | CarInfo entity = convert(request); | 100 | CarInfo entity = convert(request); |
| 110 | entity.setUpdateBy(getUserId()); | 101 | entity.setUpdateBy(getUserId()); |
| 111 | entity.setUpdateTime(new Date()); | 102 | entity.setUpdateTime(new Date()); |
| 112 | boolean flag = CarInfoService.updateByPrimaryKey(entity); | 103 | boolean flag = CarInfoService.updateByPrimaryKey(entity); |
| 113 | - return flag ? com.ruoyi.common.core.domain.AjaxResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.AjaxResult.error("修改数据失败,请稍后再试"); | 104 | + return flag ? ResponseResult.success(Boolean.TRUE) : ResponseResult.error("修改数据失败,请稍后再试"); |
| 114 | } | 105 | } |
| 115 | 106 | ||
| 116 | @PreAuthorize("@ss.hasPermi('car:info:del')") | 107 | @PreAuthorize("@ss.hasPermi('car:info:del')") |
| 117 | @GetMapping(value = "/del/{id}") | 108 | @GetMapping(value = "/del/{id}") |
| 118 | @ApiOperation("删除车辆信息") | 109 | @ApiOperation("删除车辆信息") |
| 119 | - public com.ruoyi.common.core.domain.AjaxResult delById(@PathVariable("id") Integer id) { | 110 | + public ResponseResult delById(@PathVariable("id") Integer id) { |
| 120 | boolean flag = CarInfoService.deleteById(id); | 111 | boolean flag = CarInfoService.deleteById(id); |
| 121 | - return flag ? com.ruoyi.common.core.domain.AjaxResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.AjaxResult.error("操作数据失败,请稍后再试"); | 112 | + return flag ? ResponseResult.success(Boolean.TRUE) : ResponseResult.error("操作数据失败,请稍后再试"); |
| 122 | } | 113 | } |
| 123 | 114 | ||
| 124 | private CarInfo convert(CarInfoQueryDTO source) { | 115 | private CarInfo convert(CarInfoQueryDTO source) { |
Bsth-admin/src/main/java/com/ruoyi/controller/driver/NewDriverController.java
| 1 | package com.ruoyi.controller.driver; | 1 | package com.ruoyi.controller.driver; |
| 2 | 2 | ||
| 3 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 3 | import com.ruoyi.common.core.controller.BaseController; | 4 | import com.ruoyi.common.core.controller.BaseController; |
| 4 | -import com.ruoyi.common.core.domain.AjaxResult; | 5 | +import com.ruoyi.common.core.domain.ResponseResult; |
| 5 | import com.ruoyi.domain.driver.NewDriver; | 6 | import com.ruoyi.domain.driver.NewDriver; |
| 6 | import com.ruoyi.domain.driver.dto.NewDriverAddDTO; | 7 | import com.ruoyi.domain.driver.dto.NewDriverAddDTO; |
| 7 | import com.ruoyi.domain.driver.dto.NewDriverQueryDTO; | 8 | import com.ruoyi.domain.driver.dto.NewDriverQueryDTO; |
| 8 | import com.ruoyi.domain.driver.dto.NewDriverUpdateDTO; | 9 | import com.ruoyi.domain.driver.dto.NewDriverUpdateDTO; |
| 9 | import com.ruoyi.domain.driver.vo.NewDriverVO; | 10 | import com.ruoyi.domain.driver.vo.NewDriverVO; |
| 11 | +import com.ruoyi.service.driver.NewDriverService; | ||
| 10 | import io.swagger.annotations.Api; | 12 | import io.swagger.annotations.Api; |
| 11 | import io.swagger.annotations.ApiOperation; | 13 | import io.swagger.annotations.ApiOperation; |
| 14 | +import org.springframework.beans.BeanUtils; | ||
| 12 | import org.springframework.beans.factory.annotation.Autowired; | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| 13 | -import org.springframework.web.bind.annotation.RestController; | 16 | +import org.springframework.web.bind.annotation.PostMapping; |
| 14 | import org.springframework.web.bind.annotation.RequestMapping; | 17 | import org.springframework.web.bind.annotation.RequestMapping; |
| 15 | -import org.springframework.web.bind.annotation.*; | ||
| 16 | -import org.springframework.beans.BeanUtils; | ||
| 17 | - | 18 | +import org.springframework.web.bind.annotation.RestController; |
| 18 | 19 | ||
| 19 | import java.util.List; | 20 | import java.util.List; |
| 20 | 21 | ||
| 21 | 22 | ||
| 22 | 23 | ||
| 23 | -import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 24 | - | ||
| 25 | - | ||
| 26 | - | ||
| 27 | @RestController | 24 | @RestController |
| 28 | @RequestMapping("new/driver") | 25 | @RequestMapping("new/driver") |
| 29 | @Api(tags = "新-驾驶员信息") | 26 | @Api(tags = "新-驾驶员信息") |
| 30 | public class NewDriverController extends BaseController { | 27 | public class NewDriverController extends BaseController { |
| 31 | @Autowired | 28 | @Autowired |
| 32 | - private com.NewDriverService newDriverService; | 29 | + private NewDriverService newDriverService; |
| 33 | 30 | ||
| 34 | 31 | ||
| 35 | @PostMapping(value = "/list/select") | 32 | @PostMapping(value = "/list/select") |
| 36 | @ApiOperation("(页面选择)") | 33 | @ApiOperation("(页面选择)") |
| 37 | - public AjaxResult listSelect() { | 34 | + public ResponseResult listSelect() { |
| 38 | NewDriver entity = new NewDriver(); | 35 | NewDriver entity = new NewDriver(); |
| 39 | List<NewDriver> selectList = newDriverService.listOfSelect(entity); | 36 | List<NewDriver> selectList = newDriverService.listOfSelect(entity); |
| 40 | - return AjaxResult.success(convert(selectList)); | 37 | + return ResponseResult.success(convert(selectList)); |
| 41 | } | 38 | } |
| 42 | 39 | ||
| 43 | private NewDriver convert(NewDriverQueryDTO source) { | 40 | private NewDriver convert(NewDriverQueryDTO source) { |
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.alibaba.fastjson2.JSON; | ||
| 4 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 5 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 3 | import com.ruoyi.common.core.controller.BaseController; | 6 | import com.ruoyi.common.core.controller.BaseController; |
| 7 | +import com.ruoyi.common.core.domain.ResponseResult; | ||
| 8 | +import com.ruoyi.common.utils.poi.ExcelUtil; | ||
| 9 | +import com.ruoyi.domain.OrderEntity; | ||
| 10 | +import com.ruoyi.domain.driver.healthy.DriverHealthy; | ||
| 11 | +import com.ruoyi.domain.driver.healthy.dto.DriverHealthyAddDTO; | ||
| 12 | +import com.ruoyi.domain.driver.healthy.dto.DriverHealthyQueryDTO; | ||
| 13 | +import com.ruoyi.domain.driver.healthy.dto.DriverHealthyUpdateDTO; | ||
| 14 | +import com.ruoyi.domain.driver.healthy.dto.DriverHealthyUpdateStatusDTO; | ||
| 15 | +import com.ruoyi.domain.driver.healthy.vo.DriverHealthyVO; | ||
| 16 | +import com.ruoyi.service.driver.healthy.DriverHealthyService; | ||
| 4 | import io.swagger.annotations.Api; | 17 | import io.swagger.annotations.Api; |
| 5 | import io.swagger.annotations.ApiOperation; | 18 | import io.swagger.annotations.ApiOperation; |
| 6 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 7 | -import org.springframework.web.bind.annotation.RestController; | ||
| 8 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
| 9 | -import org.springframework.web.bind.annotation.*; | ||
| 10 | import org.springframework.beans.BeanUtils; | 19 | import org.springframework.beans.BeanUtils; |
| 11 | - | 20 | +import org.springframework.beans.factory.annotation.Autowired; |
| 12 | import org.springframework.security.access.prepost.PreAuthorize; | 21 | import org.springframework.security.access.prepost.PreAuthorize; |
| 22 | +import org.springframework.web.bind.annotation.*; | ||
| 13 | 23 | ||
| 24 | +import javax.servlet.http.HttpServletResponse; | ||
| 14 | import java.util.Date; | 25 | import java.util.Date; |
| 15 | import java.util.List; | 26 | import java.util.List; |
| 16 | 27 | ||
| 17 | -import com.ruoyi.domain.OrderEntity; | ||
| 18 | - | ||
| 19 | - | ||
| 20 | -import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 21 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 22 | - | ||
| 23 | -import com.alibaba.fastjson2.JSON; | ||
| 24 | - | ||
| 25 | -import com.ruoyi.common.utils.poi.ExcelUtil; | ||
| 26 | - | ||
| 27 | -import javax.servlet.http.HttpServletResponse; | ||
| 28 | - | ||
| 29 | -import com.ruoyi.service.driver.healthy.DriverHealthyService; | ||
| 30 | -import com.ruoyi.domain.driver.healthy.vo.DriverHealthyVO; | ||
| 31 | -import com.ruoyi.domain.driver.healthy.dto.DriverHealthyAddDTO; | ||
| 32 | -import com.ruoyi.domain.driver.healthy.dto.DriverHealthyUpdateDTO; | ||
| 33 | -import com.ruoyi.domain.driver.healthy.dto.DriverHealthyUpdateStatusDTO; | ||
| 34 | -import com.ruoyi.domain.driver.healthy.dto.DriverHealthyQueryDTO; | ||
| 35 | -import com.ruoyi.domain.driver.healthy.DriverHealthy; | ||
| 36 | - | ||
| 37 | @RestController | 28 | @RestController |
| 38 | @RequestMapping("driver/healthy") | 29 | @RequestMapping("driver/healthy") |
| 39 | @Api(tags="驾驶员健康信息") | 30 | @Api(tags="驾驶员健康信息") |
| @@ -55,10 +46,10 @@ public class DriverHealthyController extends BaseController { | @@ -55,10 +46,10 @@ public class DriverHealthyController extends BaseController { | ||
| 55 | 46 | ||
| 56 | @GetMapping(value = "/view/{id}") | 47 | @GetMapping(value = "/view/{id}") |
| 57 | @ApiOperation("根据ID查看详情") | 48 | @ApiOperation("根据ID查看详情") |
| 58 | - public com.ruoyi.common.core.domain.AjaxResult view(@PathVariable("id") Long id, org.springframework.ui.Model model) { | 49 | + public ResponseResult view(@PathVariable("id") Long id, org.springframework.ui.Model model) { |
| 59 | DriverHealthy source = driverHealthyService.getById(id); | 50 | DriverHealthy source = driverHealthyService.getById(id); |
| 60 | 51 | ||
| 61 | - return com.ruoyi.common.core.domain.AjaxResult.success(convert(source)); | 52 | + return ResponseResult.success(convert(source)); |
| 62 | } | 53 | } |
| 63 | 54 | ||
| 64 | 55 | ||
| @@ -76,35 +67,35 @@ public class DriverHealthyController extends BaseController { | @@ -76,35 +67,35 @@ public class DriverHealthyController extends BaseController { | ||
| 76 | @PreAuthorize("@ss.hasPermi('driver:healthy:add')") | 67 | @PreAuthorize("@ss.hasPermi('driver:healthy:add')") |
| 77 | @PostMapping(value = "/add") | 68 | @PostMapping(value = "/add") |
| 78 | @ApiOperation("添加 ") | 69 | @ApiOperation("添加 ") |
| 79 | - public com.ruoyi.common.core.domain.AjaxResult add(@ModelAttribute DriverHealthyAddDTO request) { | 70 | + public ResponseResult add(@ModelAttribute DriverHealthyAddDTO request) { |
| 80 | request.clearStrEmpty(); | 71 | request.clearStrEmpty(); |
| 81 | DriverHealthy entity = convert(request); | 72 | DriverHealthy entity = convert(request); |
| 82 | entity.setCreateBy(getUserId()); | 73 | entity.setCreateBy(getUserId()); |
| 83 | entity.setCreateTime(new Date()); | 74 | entity.setCreateTime(new Date()); |
| 84 | int count = driverHealthyService.insertSelective(entity); | 75 | int count = driverHealthyService.insertSelective(entity); |
| 85 | - return count > 0 ? com.ruoyi.common.core.domain.AjaxResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.AjaxResult.error("添加数据失败,请稍后再试"); | 76 | + return count > 0 ? ResponseResult.success(Boolean.TRUE) : ResponseResult.error("添加数据失败,请稍后再试"); |
| 86 | } | 77 | } |
| 87 | 78 | ||
| 88 | @PreAuthorize("@ss.hasPermi('driver:healthy:update')") | 79 | @PreAuthorize("@ss.hasPermi('driver:healthy:update')") |
| 89 | @PostMapping(value = "/update") | 80 | @PostMapping(value = "/update") |
| 90 | @ApiOperation("修改 ") | 81 | @ApiOperation("修改 ") |
| 91 | - public com.ruoyi.common.core.domain.AjaxResult update(@ModelAttribute DriverHealthyUpdateDTO request) { | 82 | + public ResponseResult update(@ModelAttribute DriverHealthyUpdateDTO request) { |
| 92 | request.clearStrEmpty(); | 83 | request.clearStrEmpty(); |
| 93 | DriverHealthy entity = convert(request); | 84 | DriverHealthy entity = convert(request); |
| 94 | entity.setUpdateBy(getUserId()); | 85 | entity.setUpdateBy(getUserId()); |
| 95 | entity.setUpdateTime(new Date()); | 86 | entity.setUpdateTime(new Date()); |
| 96 | boolean flag = driverHealthyService.updateByPrimaryKey(entity); | 87 | boolean flag = driverHealthyService.updateByPrimaryKey(entity); |
| 97 | - return flag ? com.ruoyi.common.core.domain.AjaxResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.AjaxResult.error("修改数据失败,请稍后再试"); | 88 | + return flag ? ResponseResult.success(Boolean.TRUE) : ResponseResult.error("修改数据失败,请稍后再试"); |
| 98 | } | 89 | } |
| 99 | 90 | ||
| 100 | @PreAuthorize("@ss.hasPermi('driver:healthy:update:status')") | 91 | @PreAuthorize("@ss.hasPermi('driver:healthy:update:status')") |
| 101 | @PostMapping(value = "/update/status") | 92 | @PostMapping(value = "/update/status") |
| 102 | @ApiOperation("修改状态 ") | 93 | @ApiOperation("修改状态 ") |
| 103 | - public com.ruoyi.common.core.domain.AjaxResult updateState(@ModelAttribute DriverHealthyUpdateStatusDTO request) { | 94 | + public ResponseResult updateState(@ModelAttribute DriverHealthyUpdateStatusDTO request) { |
| 104 | request.clearStrEmpty(); | 95 | request.clearStrEmpty(); |
| 105 | DriverHealthy entity = convert(request); | 96 | DriverHealthy entity = convert(request); |
| 106 | boolean flag = driverHealthyService.updateByPrimaryKey(entity); | 97 | boolean flag = driverHealthyService.updateByPrimaryKey(entity); |
| 107 | - return flag ? com.ruoyi.common.core.domain.AjaxResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.AjaxResult.error("修改数据失败,请稍后再试"); | 98 | + return flag ? ResponseResult.success(Boolean.TRUE) : ResponseResult.error("修改数据失败,请稍后再试"); |
| 108 | } | 99 | } |
| 109 | 100 | ||
| 110 | private DriverHealthy convert(DriverHealthyQueryDTO source) { | 101 | private DriverHealthy convert(DriverHealthyQueryDTO source) { |
Bsth-admin/src/main/java/com/ruoyi/controller/dss/DssDriverController.java
| 1 | package com.ruoyi.controller.dss; | 1 | package com.ruoyi.controller.dss; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.convert.Convert; | 3 | import cn.hutool.core.convert.Convert; |
| 4 | -import cn.hutool.system.UserInfo; | ||
| 5 | import com.ruoyi.common.core.controller.BaseController; | 4 | import com.ruoyi.common.core.controller.BaseController; |
| 6 | import com.ruoyi.common.core.domain.AjaxResult; | 5 | import com.ruoyi.common.core.domain.AjaxResult; |
| 6 | +import com.ruoyi.common.core.domain.ResponseResult; | ||
| 7 | +import com.ruoyi.common.core.domain.entity.SysDictData; | ||
| 8 | +import com.ruoyi.common.exception.file.FileUploadException; | ||
| 7 | import com.ruoyi.domain.driver.NewDriver; | 9 | import com.ruoyi.domain.driver.NewDriver; |
| 8 | import com.ruoyi.domain.driver.dss.syn.DrivePosEnum; | 10 | import com.ruoyi.domain.driver.dss.syn.DrivePosEnum; |
| 9 | import com.ruoyi.domain.driver.dss.syn.login.dto.LoginDriverDTO; | 11 | import com.ruoyi.domain.driver.dss.syn.login.dto.LoginDriverDTO; |
| 10 | import com.ruoyi.domain.driver.dss.syn.login.vo.LoginDriverVo; | 12 | import com.ruoyi.domain.driver.dss.syn.login.vo.LoginDriverVo; |
| 11 | import com.ruoyi.domain.driver.dss.syn.login.vo.LoginUserInfoVo; | 13 | import com.ruoyi.domain.driver.dss.syn.login.vo.LoginUserInfoVo; |
| 14 | +import com.ruoyi.domain.dss.sign.dto.DssSignDTO; | ||
| 15 | +import com.ruoyi.domain.dss.sign.dto.DssSignOutDTO; | ||
| 16 | +import com.ruoyi.domain.dss.sign.vo.DssSignVo; | ||
| 17 | +import com.ruoyi.domain.dss.sign.vo.SignOutVo; | ||
| 18 | +import com.ruoyi.in.domain.SignIn; | ||
| 19 | +import com.ruoyi.in.service.ISignInService; | ||
| 20 | +import com.ruoyi.pojo.response.SignInResponseVo; | ||
| 12 | import com.ruoyi.service.driver.NewDriverService; | 21 | import com.ruoyi.service.driver.NewDriverService; |
| 22 | +import com.ruoyi.service.dss.FaceService; | ||
| 23 | +import com.ruoyi.system.service.ISysDictDataService; | ||
| 13 | import io.swagger.annotations.Api; | 24 | import io.swagger.annotations.Api; |
| 25 | +import io.swagger.annotations.ApiOperation; | ||
| 14 | import lombok.extern.slf4j.Slf4j; | 26 | import lombok.extern.slf4j.Slf4j; |
| 15 | -import org.apache.commons.collections4.CollectionUtils; | 27 | +import org.apache.commons.lang3.StringUtils; |
| 16 | import org.springframework.beans.factory.annotation.Autowired; | 28 | import org.springframework.beans.factory.annotation.Autowired; |
| 17 | import org.springframework.validation.BindingResult; | 29 | import org.springframework.validation.BindingResult; |
| 30 | +import org.springframework.web.bind.annotation.PostMapping; | ||
| 18 | import org.springframework.web.bind.annotation.RequestMapping; | 31 | import org.springframework.web.bind.annotation.RequestMapping; |
| 19 | import org.springframework.web.bind.annotation.RestController; | 32 | import org.springframework.web.bind.annotation.RestController; |
| 20 | 33 | ||
| 21 | import javax.validation.Valid; | 34 | import javax.validation.Valid; |
| 22 | -import java.util.*; | 35 | +import java.io.IOException; |
| 36 | +import java.util.HashSet; | ||
| 37 | +import java.util.Objects; | ||
| 38 | +import java.util.Set; | ||
| 23 | 39 | ||
| 24 | /** | 40 | /** |
| 25 | * @author liujun | 41 | * @author liujun |
| @@ -32,35 +48,73 @@ import java.util.*; | @@ -32,35 +48,73 @@ import java.util.*; | ||
| 32 | public class DssDriverController extends BaseController { | 48 | public class DssDriverController extends BaseController { |
| 33 | @Autowired | 49 | @Autowired |
| 34 | private NewDriverService newDriverService; | 50 | private NewDriverService newDriverService; |
| 51 | + @Autowired | ||
| 52 | + private ISysDictDataService sysDictDataService; | ||
| 53 | + @Autowired | ||
| 54 | + private ISignInService signInService; | ||
| 55 | + @Autowired | ||
| 56 | + private FaceService faceService; | ||
| 57 | + | ||
| 58 | + @PostMapping(value = "Login") | ||
| 59 | + @ApiOperation("人员登录设备") | ||
| 60 | + public ResponseResult<LoginDriverVo> login(@Valid LoginDriverDTO loginDriverDTO, BindingResult bindingResult) { | ||
| 61 | + if (bindingResult.hasErrors()) { | ||
| 62 | + return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | ||
| 63 | + } | ||
| 64 | +// Integer id = checkFace(); | ||
| 65 | +// if (Objects.isNull(id)) { | ||
| 66 | +// return AjaxResult.error("登陆数据错误,无法识别人脸"); | ||
| 67 | +// } | ||
| 68 | +// NewDriver newDriver = newDriverService.getById(id); | ||
| 69 | + NewDriver driver = faceService.checkFace(convertLoginDriverDTO(loginDriverDTO)); | ||
| 70 | + return ResponseResult.success(convertNewDriver(driver)); | ||
| 71 | + } | ||
| 35 | 72 | ||
| 36 | - public AjaxResult login(@Valid LoginDriverDTO loginDriverDTO, BindingResult bindingResult) { | 73 | + @PostMapping(value = "SignIn") |
| 74 | + @ApiOperation("人员签到") | ||
| 75 | + public ResponseResult<DssSignVo> sign(@Valid DssSignDTO dto, BindingResult bindingResult) { | ||
| 37 | if (bindingResult.hasErrors()) { | 76 | if (bindingResult.hasErrors()) { |
| 38 | - return AjaxResult.error(bindingResult.getFieldError().getDefaultMessage()); | 77 | + return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 39 | } | 78 | } |
| 40 | - Integer id = checkFace(); | ||
| 41 | - if (Objects.isNull(id)) { | ||
| 42 | - return AjaxResult.error("登陆数据错误,无法识别人脸"); | 79 | + SignIn signIn = convertSignIn(dto); |
| 80 | + try { | ||
| 81 | + AjaxResult ajaxResult = signInService.addSignIn(signIn); | ||
| 82 | + if (ajaxResult.isSuccess()) { | ||
| 83 | + SignInResponseVo responseVo = (SignInResponseVo) ajaxResult.get(AjaxResult.DATA_TAG); | ||
| 84 | + if (Objects.nonNull(responseVo)) { | ||
| 85 | + return ResponseResult.success(convertSignInVo(responseVo)); | ||
| 86 | + } | ||
| 87 | + } | ||
| 88 | + | ||
| 89 | + return ResponseResult.error(Convert.toInt(ajaxResult.get(AjaxResult.CODE_TAG)), Convert.toStr(ajaxResult.get(AjaxResult.MSG_TAG))); | ||
| 90 | + } catch (FileUploadException | IOException e) { | ||
| 91 | + log.error("签到信息异常,传入的参数为:[{}]", dto, e); | ||
| 92 | + return ResponseResult.error(); | ||
| 43 | } | 93 | } |
| 44 | - NewDriver newDriver = newDriverService.getById(id); | ||
| 45 | - return AjaxResult.success(convertNewDriver(newDriver)); | ||
| 46 | } | 94 | } |
| 47 | 95 | ||
| 48 | - /*** | ||
| 49 | - * 第三方识别人脸 | ||
| 50 | - * @author liujun | ||
| 51 | - * @date 2024/7/11 17:04 | ||
| 52 | - * @return java.lang.Integer | ||
| 53 | - */ | ||
| 54 | - private Integer checkFace() { | ||
| 55 | - List<NewDriver> lists = newDriverService.list(new NewDriver()); | ||
| 56 | - if (CollectionUtils.isEmpty(lists)) { | ||
| 57 | - return null; | 96 | + |
| 97 | + @PostMapping(value = "SignOut") | ||
| 98 | + public ResponseResult<SignOutVo> signOut(@Valid DssSignOutDTO dto, BindingResult bindingResult) { | ||
| 99 | + if (bindingResult.hasErrors()) { | ||
| 100 | + return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | ||
| 58 | } | 101 | } |
| 59 | - //TODO 对接第三方 | ||
| 60 | 102 | ||
| 61 | - return 10; | 103 | + SignIn signIn = convertSignIn(dto); |
| 104 | + try { | ||
| 105 | + AjaxResult ajaxResult = signInService.addSignIn(signIn); | ||
| 106 | + if (Objects.nonNull(ajaxResult) && ajaxResult.isSuccess()) { | ||
| 107 | + return ResponseResult.success(convertSignOutVo(dto)); | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + return ResponseResult.error(Convert.toInt(ajaxResult.get(AjaxResult.CODE_TAG)), Convert.toStr(ajaxResult.get(AjaxResult.MSG_TAG))); | ||
| 111 | + } catch (FileUploadException | IOException e) { | ||
| 112 | + log.error("签到信息异常,传入的参数为:[{}]", dto, e); | ||
| 113 | + return ResponseResult.error(); | ||
| 114 | + } | ||
| 62 | } | 115 | } |
| 63 | 116 | ||
| 117 | + | ||
| 64 | /*** | 118 | /*** |
| 65 | * 登陆转换 | 119 | * 登陆转换 |
| 66 | * @author liujun | 120 | * @author liujun |
| @@ -83,12 +137,15 @@ public class DssDriverController extends BaseController { | @@ -83,12 +137,15 @@ public class DssDriverController extends BaseController { | ||
| 83 | loginDriverVo.setSynContent(newDriver.getSyncontent()); | 137 | loginDriverVo.setSynContent(newDriver.getSyncontent()); |
| 84 | loginDriverVo.setCsn(newDriver.getCsn()); | 138 | loginDriverVo.setCsn(newDriver.getCsn()); |
| 85 | 139 | ||
| 86 | - //TODO 是否强制做检查 | ||
| 87 | - loginDriverVo.setHealthCheck(0); | ||
| 88 | - //TODO 当日最后一次登签的签到状态 | ||
| 89 | - loginDriverVo.setSignInType(0); | ||
| 90 | - //TODO 当日最后一次登签的签退状态 | ||
| 91 | - loginDriverVo.setSignOutType(0); | 140 | + int healThCheck = 0; |
| 141 | + SysDictData dictData = querySystData(newDriver.getPosts(), "healthCheck"); | ||
| 142 | + if (Objects.nonNull(dictData) && StringUtils.isNotEmpty(dictData.getDictValue())) { | ||
| 143 | + healThCheck = Convert.toInt(dictData.getDictValue()); | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + loginDriverVo.setHealthCheck(healThCheck); | ||
| 147 | + loginDriverVo.setSignInType(signInService.signInType(newDriver)); | ||
| 148 | + loginDriverVo.setSignOutType(signInService.signOutType(newDriver)); | ||
| 92 | 149 | ||
| 93 | 150 | ||
| 94 | Set<Integer> postSets = new HashSet<>(); | 151 | Set<Integer> postSets = new HashSet<>(); |
| @@ -104,4 +161,80 @@ public class DssDriverController extends BaseController { | @@ -104,4 +161,80 @@ public class DssDriverController extends BaseController { | ||
| 104 | 161 | ||
| 105 | return loginDriverVo; | 162 | return loginDriverVo; |
| 106 | } | 163 | } |
| 164 | + | ||
| 165 | + /*** | ||
| 166 | + * 查询数据字典 | ||
| 167 | + * @author liujun | ||
| 168 | + * @date 2024/7/12 10:15 | ||
| 169 | + * @return com.ruoyi.common.core.domain.entity.SysDictData | ||
| 170 | + */ | ||
| 171 | + private SysDictData querySystData(String disKey, String type) { | ||
| 172 | + SysDictData sysDictData = new SysDictData(); | ||
| 173 | + sysDictData.setStatus("0"); | ||
| 174 | + sysDictData.setDictType(type); | ||
| 175 | + sysDictData.setDiscKey(disKey); | ||
| 176 | + | ||
| 177 | + | ||
| 178 | + return sysDictDataService.getOne(sysDictData); | ||
| 179 | + } | ||
| 180 | + | ||
| 181 | + private NewDriver convertLoginDriverDTO(LoginDriverDTO loginDriverDTO) { | ||
| 182 | + NewDriver driver = new NewDriver(); | ||
| 183 | + driver.setImage(loginDriverDTO.getAuthValue()); | ||
| 184 | +// driver.setIcCardCode() | ||
| 185 | + return driver; | ||
| 186 | + } | ||
| 187 | + | ||
| 188 | + private SignIn convertSignIn(DssSignDTO dto) { | ||
| 189 | + SignIn signIn = new SignIn(); | ||
| 190 | + signIn.setDeviceId(dto.getDevice()); | ||
| 191 | +// signIn.setImage(); | ||
| 192 | + signIn.setJobCode(dto.getStaffCode()); | ||
| 193 | + signIn.setAlcoholIntake(Convert.toBigDecimal(dto.getTestValue())); | ||
| 194 | + signIn.setCreateTime(dto.getSignTime()); | ||
| 195 | + signIn.setType(1); | ||
| 196 | + | ||
| 197 | +// SysDictData sysDictData = querySystData(null,"drunkenness"); | ||
| 198 | +// if(Objects.nonNull(sysDictData)){ | ||
| 199 | +// | ||
| 200 | +// } | ||
| 201 | + | ||
| 202 | + return signIn; | ||
| 203 | + } | ||
| 204 | + | ||
| 205 | + private SignIn convertSignIn(DssSignOutDTO dto) { | ||
| 206 | + SignIn signIn = new SignIn(); | ||
| 207 | + signIn.setDeviceId(dto.getDevice()); | ||
| 208 | +// signIn.setImage(); | ||
| 209 | + signIn.setJobCode(dto.getDriverCode()); | ||
| 210 | + | ||
| 211 | + signIn.setCreateTime(dto.getLogoutTime()); | ||
| 212 | + signIn.setType(2); | ||
| 213 | + | ||
| 214 | +// SysDictData sysDictData = querySystData(null,"drunkenness"); | ||
| 215 | +// if(Objects.nonNull(sysDictData)){ | ||
| 216 | +// | ||
| 217 | +// } | ||
| 218 | + | ||
| 219 | + return signIn; | ||
| 220 | + } | ||
| 221 | + | ||
| 222 | + private DssSignVo convertSignInVo(SignInResponseVo responseVo) { | ||
| 223 | + DssSignVo vo = new DssSignVo(); | ||
| 224 | + vo.setTestId(Convert.toStr(responseVo.getId())); | ||
| 225 | + | ||
| 226 | + Integer testResult = Objects.equals(responseVo.getExType(), 3) ? 2 : 0; | ||
| 227 | + vo.setTestResult(testResult); | ||
| 228 | + | ||
| 229 | + Integer result = Objects.isNull(responseVo.getStatus()) ? 0 : responseVo.getStatus() - 1; | ||
| 230 | + vo.setResult(result); | ||
| 231 | + | ||
| 232 | + return vo; | ||
| 233 | + } | ||
| 234 | + | ||
| 235 | + private SignOutVo convertSignOutVo(DssSignOutDTO dto) { | ||
| 236 | + return new SignOutVo(dto.getDevice(), dto.getDriverCode(), dto.getLogoutTime()); | ||
| 237 | + } | ||
| 238 | + | ||
| 239 | + | ||
| 107 | } | 240 | } |
Bsth-admin/src/main/java/com/ruoyi/controller/dss/DssEquipmentController.java
| @@ -4,9 +4,9 @@ import cn.hutool.core.convert.Convert; | @@ -4,9 +4,9 @@ import cn.hutool.core.convert.Convert; | ||
| 4 | import com.alibaba.fastjson2.JSON; | 4 | import com.alibaba.fastjson2.JSON; |
| 5 | import com.ruoyi.common.constant.Constants; | 5 | import com.ruoyi.common.constant.Constants; |
| 6 | import com.ruoyi.common.core.controller.BaseController; | 6 | import com.ruoyi.common.core.controller.BaseController; |
| 7 | -import com.ruoyi.common.core.domain.AjaxResult; | 7 | +import com.ruoyi.common.core.domain.ResponseResult; |
| 8 | import com.ruoyi.common.core.domain.entity.SysDictData; | 8 | import com.ruoyi.common.core.domain.entity.SysDictData; |
| 9 | -import com.ruoyi.common.core.domain.entity.SysDictType; | 9 | +import com.ruoyi.common.core.domain.entity.SysUser; |
| 10 | import com.ruoyi.common.core.domain.model.LoginUser; | 10 | import com.ruoyi.common.core.domain.model.LoginUser; |
| 11 | import com.ruoyi.common.utils.MessageUtils; | 11 | import com.ruoyi.common.utils.MessageUtils; |
| 12 | import com.ruoyi.domain.dss.equipment.dto.EquipmentAuthDTO; | 12 | import com.ruoyi.domain.dss.equipment.dto.EquipmentAuthDTO; |
| @@ -31,7 +31,6 @@ import com.ruoyi.system.service.ISysDictDataService; | @@ -31,7 +31,6 @@ import com.ruoyi.system.service.ISysDictDataService; | ||
| 31 | import com.ruoyi.system.service.ISysDictTypeService; | 31 | import com.ruoyi.system.service.ISysDictTypeService; |
| 32 | import io.swagger.annotations.Api; | 32 | import io.swagger.annotations.Api; |
| 33 | import io.swagger.annotations.ApiOperation; | 33 | import io.swagger.annotations.ApiOperation; |
| 34 | -import io.swagger.annotations.ApiParam; | ||
| 35 | import io.swagger.v3.oas.annotations.Parameter; | 34 | import io.swagger.v3.oas.annotations.Parameter; |
| 36 | import lombok.extern.slf4j.Slf4j; | 35 | import lombok.extern.slf4j.Slf4j; |
| 37 | import org.apache.commons.collections4.CollectionUtils; | 36 | import org.apache.commons.collections4.CollectionUtils; |
| @@ -47,7 +46,6 @@ import org.springframework.web.bind.annotation.*; | @@ -47,7 +46,6 @@ import org.springframework.web.bind.annotation.*; | ||
| 47 | 46 | ||
| 48 | import javax.annotation.Resource; | 47 | import javax.annotation.Resource; |
| 49 | import javax.validation.Valid; | 48 | import javax.validation.Valid; |
| 50 | -import java.math.BigDecimal; | ||
| 51 | import java.util.*; | 49 | import java.util.*; |
| 52 | import java.util.stream.Collectors; | 50 | import java.util.stream.Collectors; |
| 53 | 51 | ||
| @@ -81,47 +79,53 @@ public class DssEquipmentController extends BaseController { | @@ -81,47 +79,53 @@ public class DssEquipmentController extends BaseController { | ||
| 81 | 79 | ||
| 82 | @ApiOperation("设备获取访问令牌") | 80 | @ApiOperation("设备获取访问令牌") |
| 83 | @GetMapping("/Auth") | 81 | @GetMapping("/Auth") |
| 84 | - public AjaxResult auth(@Valid EquipmentAuthDTO dto, BindingResult bindingResult) { | 82 | + public ResponseResult auth(@Valid EquipmentAuthDTO dto, BindingResult bindingResult) { |
| 85 | if (bindingResult.hasErrors()) { | 83 | if (bindingResult.hasErrors()) { |
| 86 | - return AjaxResult.error(bindingResult.getFieldError().getDefaultMessage()); | 84 | + return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 87 | } | 85 | } |
| 88 | 86 | ||
| 89 | Equipment equipment = equipmentService.getOneByDeviceId(dto.getDevice()); | 87 | Equipment equipment = equipmentService.getOneByDeviceId(dto.getDevice()); |
| 90 | if (Objects.isNull(equipment)) { | 88 | if (Objects.isNull(equipment)) { |
| 91 | log.info("[{}] equipment is null", dto.getDevice()); | 89 | log.info("[{}] equipment is null", dto.getDevice()); |
| 92 | - return AjaxResult.error("设备号错误,请检查设备号"); | 90 | + return ResponseResult.error("设备号错误,请检查设备号"); |
| 93 | } | 91 | } |
| 94 | UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(equipment.getDeviceId(), equipment.getId()); | 92 | UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(equipment.getDeviceId(), equipment.getId()); |
| 95 | AuthenticationContextHolder.setContext(authenticationToken); | 93 | AuthenticationContextHolder.setContext(authenticationToken); |
| 96 | Authentication authentication = authenticationManager.authenticate(authenticationToken); | 94 | Authentication authentication = authenticationManager.authenticate(authenticationToken); |
| 97 | - AsyncManager.me().execute(AsyncFactory.recordLogininfor(dto.getDevice(), Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"))); | ||
| 98 | - LoginUser loginUser = (LoginUser) authentication.getPrincipal(); | 95 | + AsyncManager.me().execute(AsyncFactory.recordLogininfor(dto.getDevice(), Constants.LOGIN_SUCCESS, MessageUtils.message("equipment.login.success"))); |
| 96 | + //LoginUser loginUser = (LoginUser) authentication.getPrincipal(); | ||
| 97 | + LoginUser loginUser = new LoginUser(); | ||
| 98 | + loginUser.setUserId(equipment.getId()); | ||
| 99 | + loginUser.setDeptId(Convert.toLong(equipment.getDeviceId())); | ||
| 100 | + loginUser.setUser(new SysUser()); | ||
| 101 | + | ||
| 102 | + | ||
| 99 | String token = tokenService.createToken(loginUser, Constants.EQUIPMENT_KEY); | 103 | String token = tokenService.createToken(loginUser, Constants.EQUIPMENT_KEY); |
| 100 | 104 | ||
| 101 | AuthVo vo = new AuthVo(token); | 105 | AuthVo vo = new AuthVo(token); |
| 102 | 106 | ||
| 103 | - return AjaxResult.success(vo); | 107 | + return ResponseResult.success(vo); |
| 104 | } | 108 | } |
| 105 | 109 | ||
| 106 | @PostMapping("/Heartbeat") | 110 | @PostMapping("/Heartbeat") |
| 107 | @ApiOperation("设备报警信息(心跳包)") | 111 | @ApiOperation("设备报警信息(心跳包)") |
| 108 | - public AjaxResult heartbeat(@Valid HeartbeatDTO heartbeatDTO, BindingResult bindingResult) { | 112 | + public ResponseResult heartbeat(@Valid @RequestBody HeartbeatDTO heartbeatDTO, BindingResult bindingResult) { |
| 109 | if (bindingResult.hasErrors()) { | 113 | if (bindingResult.hasErrors()) { |
| 110 | - return AjaxResult.error(bindingResult.getFieldError().getDefaultMessage()); | 114 | + return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 111 | } | 115 | } |
| 112 | List<LingangEquipmentHeartbeat> heartbeats = convertHeartbeatDTO(heartbeatDTO); | 116 | List<LingangEquipmentHeartbeat> heartbeats = convertHeartbeatDTO(heartbeatDTO); |
| 113 | if (CollectionUtils.isNotEmpty(heartbeats)) { | 117 | if (CollectionUtils.isNotEmpty(heartbeats)) { |
| 114 | lingangEquipmentHeartbeatService.saveBatch(heartbeats); | 118 | lingangEquipmentHeartbeatService.saveBatch(heartbeats); |
| 115 | } | 119 | } |
| 116 | - return AjaxResult.success(); | 120 | + return ResponseResult.success(); |
| 117 | } | 121 | } |
| 118 | 122 | ||
| 119 | @GetMapping(value = "/getConfig") | 123 | @GetMapping(value = "/getConfig") |
| 120 | @ApiOperation("设备获取远程参数配置") | 124 | @ApiOperation("设备获取远程参数配置") |
| 121 | @Parameter(name = "device", description = "设备号", required = true) | 125 | @Parameter(name = "device", description = "设备号", required = true) |
| 122 | - public AjaxResult getConfig(@RequestParam(value = "device") String device) { | 126 | + public ResponseResult getConfig(@RequestParam(value = "device") String device) { |
| 123 | if (StringUtils.isEmpty(device)) { | 127 | if (StringUtils.isEmpty(device)) { |
| 124 | - return AjaxResult.error("设备号不能为空"); | 128 | + return ResponseResult.error("设备号不能为空"); |
| 125 | } | 129 | } |
| 126 | 130 | ||
| 127 | Set<String> keys = Arrays.stream(GET_CONFIG_DICT_KEY).collect(Collectors.toSet()); | 131 | Set<String> keys = Arrays.stream(GET_CONFIG_DICT_KEY).collect(Collectors.toSet()); |
| @@ -131,19 +135,19 @@ public class DssEquipmentController extends BaseController { | @@ -131,19 +135,19 @@ public class DssEquipmentController extends BaseController { | ||
| 131 | 135 | ||
| 132 | List<SysDictData> list = sysDictDataService.queryDictDateList(sysDictData, keys); | 136 | List<SysDictData> list = sysDictDataService.queryDictDateList(sysDictData, keys); |
| 133 | EquipmentConfigVo configVo = combitionEquipmentConfigVo(list); | 137 | EquipmentConfigVo configVo = combitionEquipmentConfigVo(list); |
| 134 | - return AjaxResult.success(configVo); | 138 | + return ResponseResult.success(configVo); |
| 135 | } | 139 | } |
| 136 | 140 | ||
| 137 | 141 | ||
| 138 | @PostMapping("/selfcheck") | 142 | @PostMapping("/selfcheck") |
| 139 | @ApiOperation("设备获取远程参数配置") | 143 | @ApiOperation("设备获取远程参数配置") |
| 140 | - public AjaxResult selfCheck(@Valid EquipmentSelfcheckDto equipmentSelfcheckDto, BindingResult bindingResult) { | 144 | + public ResponseResult selfCheck(@Valid EquipmentSelfcheckDto equipmentSelfcheckDto, BindingResult bindingResult) { |
| 141 | if (bindingResult.hasErrors()) { | 145 | if (bindingResult.hasErrors()) { |
| 142 | - return AjaxResult.error(bindingResult.getFieldError().getDefaultMessage()); | 146 | + return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 143 | } | 147 | } |
| 144 | LingangEquimentSelfCheck selfCheck = convertLingangEquimentSelfCheck(equipmentSelfcheckDto); | 148 | LingangEquimentSelfCheck selfCheck = convertLingangEquimentSelfCheck(equipmentSelfcheckDto); |
| 145 | lingangEquimentSelfCheckServicelingangEquimentSelfCheckService.insert(selfCheck); | 149 | lingangEquimentSelfCheckServicelingangEquimentSelfCheckService.insert(selfCheck); |
| 146 | - return AjaxResult.success(); | 150 | + return ResponseResult.success(); |
| 147 | } | 151 | } |
| 148 | 152 | ||
| 149 | private List<LingangEquipmentHeartbeat> convertHeartbeatDTO(HeartbeatDTO heartbeatDTO) { | 153 | private List<LingangEquipmentHeartbeat> convertHeartbeatDTO(HeartbeatDTO heartbeatDTO) { |
Bsth-admin/src/main/java/com/ruoyi/controller/dss/DssFaceController.java
| 1 | package com.ruoyi.controller.dss; | 1 | package com.ruoyi.controller.dss; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | -import cn.hutool.core.convert.Convert; | 4 | +import com.ruoyi.common.TipEnum; |
| 5 | import com.ruoyi.common.core.controller.BaseController; | 5 | import com.ruoyi.common.core.controller.BaseController; |
| 6 | -import com.ruoyi.common.core.domain.AjaxResult; | 6 | +import com.ruoyi.common.core.domain.ResponseResult; |
| 7 | import com.ruoyi.domain.driver.NewDriver; | 7 | import com.ruoyi.domain.driver.NewDriver; |
| 8 | import com.ruoyi.domain.driver.dss.syn.DrivePosEnum; | 8 | import com.ruoyi.domain.driver.dss.syn.DrivePosEnum; |
| 9 | import com.ruoyi.domain.driver.dss.syn.dto.DssDriveQueryDTO; | 9 | import com.ruoyi.domain.driver.dss.syn.dto.DssDriveQueryDTO; |
| 10 | +import com.ruoyi.domain.driver.dss.syn.res.dto.FaceCheckDTO; | ||
| 10 | import com.ruoyi.domain.driver.dss.syn.res.dto.FaceRegisterDTO; | 11 | import com.ruoyi.domain.driver.dss.syn.res.dto.FaceRegisterDTO; |
| 11 | import com.ruoyi.domain.driver.dss.syn.res.dto.ResDataDriveDTO; | 12 | import com.ruoyi.domain.driver.dss.syn.res.dto.ResDataDriveDTO; |
| 13 | +import com.ruoyi.domain.driver.dss.syn.res.vo.FaceCheckVo; | ||
| 12 | import com.ruoyi.domain.driver.dss.syn.vo.DssDriveVo; | 14 | import com.ruoyi.domain.driver.dss.syn.vo.DssDriveVo; |
| 13 | import com.ruoyi.service.driver.NewDriverService; | 15 | import com.ruoyi.service.driver.NewDriverService; |
| 16 | +import com.ruoyi.service.dss.FaceService; | ||
| 14 | import io.swagger.annotations.Api; | 17 | import io.swagger.annotations.Api; |
| 15 | import io.swagger.annotations.ApiOperation; | 18 | import io.swagger.annotations.ApiOperation; |
| 16 | import lombok.extern.slf4j.Slf4j; | 19 | import lombok.extern.slf4j.Slf4j; |
| @@ -22,10 +25,7 @@ import org.springframework.web.bind.annotation.RequestMapping; | @@ -22,10 +25,7 @@ import org.springframework.web.bind.annotation.RequestMapping; | ||
| 22 | import org.springframework.web.bind.annotation.RestController; | 25 | import org.springframework.web.bind.annotation.RestController; |
| 23 | 26 | ||
| 24 | import javax.validation.Valid; | 27 | import javax.validation.Valid; |
| 25 | -import java.util.Collections; | ||
| 26 | -import java.util.HashSet; | ||
| 27 | -import java.util.List; | ||
| 28 | -import java.util.Set; | 28 | +import java.util.*; |
| 29 | import java.util.stream.Collectors; | 29 | import java.util.stream.Collectors; |
| 30 | 30 | ||
| 31 | /** | 31 | /** |
| @@ -41,6 +41,8 @@ public class DssFaceController extends BaseController { | @@ -41,6 +41,8 @@ public class DssFaceController extends BaseController { | ||
| 41 | 41 | ||
| 42 | @Autowired | 42 | @Autowired |
| 43 | private NewDriverService newDriverService; | 43 | private NewDriverService newDriverService; |
| 44 | + @Autowired | ||
| 45 | + private FaceService faceService; | ||
| 44 | 46 | ||
| 45 | @PostMapping("/syn/reqData") | 47 | @PostMapping("/syn/reqData") |
| 46 | @ApiOperation("获取数据库人员信息") | 48 | @ApiOperation("获取数据库人员信息") |
| @@ -51,24 +53,37 @@ public class DssFaceController extends BaseController { | @@ -51,24 +53,37 @@ public class DssFaceController extends BaseController { | ||
| 51 | 53 | ||
| 52 | @ApiOperation("终端同步人脸数据结果上报") | 54 | @ApiOperation("终端同步人脸数据结果上报") |
| 53 | @PostMapping(value = "/syn/resData") | 55 | @PostMapping(value = "/syn/resData") |
| 54 | - public AjaxResult insertDriver(@Valid ResDataDriveDTO dto, BindingResult bindingResult) { | 56 | + public ResponseResult<Object> insertDriver(@Valid ResDataDriveDTO dto, BindingResult bindingResult) { |
| 55 | if (bindingResult.hasErrors()) { | 57 | if (bindingResult.hasErrors()) { |
| 56 | - return AjaxResult.error(bindingResult.getFieldError().getDefaultMessage()); | 58 | + return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 57 | } | 59 | } |
| 58 | NewDriver newDriver = convertNewDriver(dto); | 60 | NewDriver newDriver = convertNewDriver(dto); |
| 59 | - boolean flag = newDriverService.updateClient(newDriver); | ||
| 60 | - return flag ? AjaxResult.success() : AjaxResult.error(); | 61 | + TipEnum errorTipEnum = newDriverService.updateClient(newDriver); |
| 62 | + return new ResponseResult<>(errorTipEnum.getCode(),errorTipEnum.getMsg()); | ||
| 61 | } | 63 | } |
| 62 | 64 | ||
| 63 | @ApiOperation(("人脸注册")) | 65 | @ApiOperation(("人脸注册")) |
| 64 | @PostMapping(value = "FaceRegister") | 66 | @PostMapping(value = "FaceRegister") |
| 65 | - public AjaxResult faceRegister(@Valid FaceRegisterDTO dto, BindingResult bindingResult) { | 67 | + public ResponseResult<Object> faceRegister(@Valid FaceRegisterDTO dto, BindingResult bindingResult) { |
| 66 | if (bindingResult.hasErrors()) { | 68 | if (bindingResult.hasErrors()) { |
| 67 | - return AjaxResult.error(bindingResult.getFieldError().getDefaultMessage()); | 69 | + return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 68 | } | 70 | } |
| 69 | NewDriver newDriver = convertFaceRegister(dto); | 71 | NewDriver newDriver = convertFaceRegister(dto); |
| 70 | - boolean flag = newDriverService.faceRegister(newDriver); | ||
| 71 | - return flag ? AjaxResult.success() : AjaxResult.error(); | 72 | + TipEnum errorTipEnum = newDriverService.faceRegister(newDriver); |
| 73 | + return new ResponseResult<>(errorTipEnum.getCode(),errorTipEnum.getMsg()); | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + @ApiOperation("人脸校验") | ||
| 77 | + @PostMapping(value = "FaceCheck") | ||
| 78 | + public ResponseResult<FaceCheckVo> faceCheck(@Valid FaceCheckDTO dto, BindingResult bindingResult) { | ||
| 79 | + if (bindingResult.hasErrors()) { | ||
| 80 | + return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | ||
| 81 | + } | ||
| 82 | + | ||
| 83 | + NewDriver driver = convertNewDriver(dto); | ||
| 84 | + driver = faceService.checkFace(driver); | ||
| 85 | + | ||
| 86 | + return Objects.isNull(driver) ? ResponseResult.error("登陆匹配失败") : ResponseResult.success(convertFaceCheckVo(driver)); | ||
| 72 | } | 87 | } |
| 73 | 88 | ||
| 74 | 89 | ||
| @@ -123,5 +138,19 @@ public class DssFaceController extends BaseController { | @@ -123,5 +138,19 @@ public class DssFaceController extends BaseController { | ||
| 123 | return newDriver; | 138 | return newDriver; |
| 124 | } | 139 | } |
| 125 | 140 | ||
| 141 | + private NewDriver convertNewDriver(FaceCheckDTO dto) { | ||
| 142 | + NewDriver driver = new NewDriver(); | ||
| 143 | + driver.setImage(dto.getFaceValue()); | ||
| 144 | + return driver; | ||
| 145 | + } | ||
| 146 | + | ||
| 147 | + private FaceCheckVo convertFaceCheckVo(NewDriver driver) { | ||
| 148 | + FaceCheckVo faceCheckVo = new FaceCheckVo(); | ||
| 149 | + faceCheckVo.setDriverCode(driver.getIcRfid()); | ||
| 150 | + | ||
| 151 | + return faceCheckVo; | ||
| 152 | + } | ||
| 153 | + | ||
| 154 | + | ||
| 126 | 155 | ||
| 127 | } | 156 | } |
Bsth-admin/src/main/java/com/ruoyi/controller/dss/KeyBoxController.java
| 1 | package com.ruoyi.controller.dss; | 1 | package com.ruoyi.controller.dss; |
| 2 | 2 | ||
| 3 | -import cn.hutool.core.convert.Convert; | ||
| 4 | import com.alibaba.fastjson2.JSON; | 3 | import com.alibaba.fastjson2.JSON; |
| 5 | import com.ruoyi.common.core.controller.BaseController; | 4 | import com.ruoyi.common.core.controller.BaseController; |
| 6 | -import com.ruoyi.common.core.domain.AjaxResult; | ||
| 7 | -import com.ruoyi.common.utils.StringUtils; | ||
| 8 | -import com.ruoyi.domain.caiinfo.CarInfo; | ||
| 9 | -import com.ruoyi.domain.driver.NewDriver; | 5 | +import com.ruoyi.common.core.domain.ResponseResult; |
| 10 | import com.ruoyi.domain.equipment.linke.log.LingangEquipmentLinkeLog; | 6 | import com.ruoyi.domain.equipment.linke.log.LingangEquipmentLinkeLog; |
| 11 | -import com.ruoyi.domain.keyInfo.KeyInfo; | ||
| 12 | import com.ruoyi.domain.keyInfo.box.dto.KeyBoxQueryDTO; | 7 | import com.ruoyi.domain.keyInfo.box.dto.KeyBoxQueryDTO; |
| 13 | -import com.ruoyi.domain.keyInfo.box.vo.KeyBoxVo; | ||
| 14 | -import com.ruoyi.domain.lin.gang.LingangScheduling; | ||
| 15 | -import com.ruoyi.equipment.domain.Equipment; | ||
| 16 | -import com.ruoyi.equipment.service.IEquipmentService; | ||
| 17 | -import com.ruoyi.in.domain.SignIn; | ||
| 18 | -import com.ruoyi.in.service.ISignInService; | ||
| 19 | -import com.ruoyi.service.SchedulingService; | ||
| 20 | -import com.ruoyi.service.carinfo.CarInfoService; | ||
| 21 | import com.ruoyi.service.dss.KeyBoxVoService; | 8 | import com.ruoyi.service.dss.KeyBoxVoService; |
| 22 | import com.ruoyi.service.equipment.linke.log.LingangEquipmentLinkeLogService; | 9 | import com.ruoyi.service.equipment.linke.log.LingangEquipmentLinkeLogService; |
| 23 | -import com.ruoyi.service.keyinfo.KeyInfoService; | ||
| 24 | -import com.ruoyi.service.lin.gang.LingangSchedulingService; | ||
| 25 | -import com.ruoyi.utils.DateUtil; | ||
| 26 | import io.swagger.annotations.Api; | 10 | import io.swagger.annotations.Api; |
| 27 | import io.swagger.annotations.ApiOperation; | 11 | import io.swagger.annotations.ApiOperation; |
| 28 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -31,10 +15,7 @@ import org.springframework.web.bind.annotation.RequestBody; | @@ -31,10 +15,7 @@ import org.springframework.web.bind.annotation.RequestBody; | ||
| 31 | import org.springframework.web.bind.annotation.RequestMapping; | 15 | import org.springframework.web.bind.annotation.RequestMapping; |
| 32 | import org.springframework.web.bind.annotation.RestController; | 16 | import org.springframework.web.bind.annotation.RestController; |
| 33 | 17 | ||
| 34 | -import java.text.MessageFormat; | ||
| 35 | import java.util.Date; | 18 | import java.util.Date; |
| 36 | -import java.util.List; | ||
| 37 | -import java.util.Objects; | ||
| 38 | 19 | ||
| 39 | /** | 20 | /** |
| 40 | * @author liujun | 21 | * @author liujun |
| @@ -53,7 +34,7 @@ public class KeyBoxController extends BaseController { | @@ -53,7 +34,7 @@ public class KeyBoxController extends BaseController { | ||
| 53 | 34 | ||
| 54 | @PostMapping(value = "/findKey") | 35 | @PostMapping(value = "/findKey") |
| 55 | @ApiOperation("钥匙信息查询") | 36 | @ApiOperation("钥匙信息查询") |
| 56 | - public AjaxResult listSelect(@RequestBody KeyBoxQueryDTO request) { | 37 | + public ResponseResult listSelect(@RequestBody KeyBoxQueryDTO request) { |
| 57 | LingangEquipmentLinkeLog linkeLog = saveLog(request); | 38 | LingangEquipmentLinkeLog linkeLog = saveLog(request); |
| 58 | 39 | ||
| 59 | return keyBoxVoService.listSelect(request,linkeLog); | 40 | return keyBoxVoService.listSelect(request,linkeLog); |
Bsth-admin/src/main/java/com/ruoyi/controller/equipment/heartbeat/LingangEquipmentHeartbeatController.java
| 1 | package com.ruoyi.controller.equipment.heartbeat; | 1 | package com.ruoyi.controller.equipment.heartbeat; |
| 2 | 2 | ||
| 3 | +import com.alibaba.fastjson2.JSON; | ||
| 4 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 5 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 3 | import com.ruoyi.common.core.controller.BaseController; | 6 | import com.ruoyi.common.core.controller.BaseController; |
| 4 | -import com.ruoyi.common.core.domain.AjaxResult; | 7 | +import com.ruoyi.common.core.domain.ResponseResult; |
| 8 | +import com.ruoyi.common.utils.poi.ExcelUtil; | ||
| 9 | +import com.ruoyi.domain.OrderEntity; | ||
| 5 | import com.ruoyi.domain.equipment.heartbeat.LingangEquipmentHeartbeat; | 10 | import com.ruoyi.domain.equipment.heartbeat.LingangEquipmentHeartbeat; |
| 6 | import com.ruoyi.domain.equipment.heartbeat.dto.LingangEquipmentHeartbeatAddDTO; | 11 | import com.ruoyi.domain.equipment.heartbeat.dto.LingangEquipmentHeartbeatAddDTO; |
| 7 | import com.ruoyi.domain.equipment.heartbeat.dto.LingangEquipmentHeartbeatQueryDTO; | 12 | import com.ruoyi.domain.equipment.heartbeat.dto.LingangEquipmentHeartbeatQueryDTO; |
| @@ -10,31 +15,16 @@ import com.ruoyi.domain.equipment.heartbeat.vo.LingangEquipmentHeartbeatVO; | @@ -10,31 +15,16 @@ import com.ruoyi.domain.equipment.heartbeat.vo.LingangEquipmentHeartbeatVO; | ||
| 10 | import com.ruoyi.service.equipment.heartbeat.LingangEquipmentHeartbeatService; | 15 | import com.ruoyi.service.equipment.heartbeat.LingangEquipmentHeartbeatService; |
| 11 | import io.swagger.annotations.Api; | 16 | import io.swagger.annotations.Api; |
| 12 | import io.swagger.annotations.ApiOperation; | 17 | import io.swagger.annotations.ApiOperation; |
| 13 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 14 | -import org.springframework.web.bind.annotation.RestController; | ||
| 15 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
| 16 | -import org.springframework.web.bind.annotation.*; | ||
| 17 | import org.springframework.beans.BeanUtils; | 18 | import org.springframework.beans.BeanUtils; |
| 18 | - | 19 | +import org.springframework.beans.factory.annotation.Autowired; |
| 19 | import org.springframework.security.access.prepost.PreAuthorize; | 20 | import org.springframework.security.access.prepost.PreAuthorize; |
| 20 | - | ||
| 21 | -import java.util.List; | ||
| 22 | -import java.util.Date; | ||
| 23 | - | ||
| 24 | -import com.ruoyi.domain.OrderEntity; | ||
| 25 | - | ||
| 26 | - | ||
| 27 | -import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 28 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 29 | - | ||
| 30 | -import com.alibaba.fastjson2.JSON; | ||
| 31 | - | ||
| 32 | -import com.ruoyi.common.utils.poi.ExcelUtil; | 21 | +import org.springframework.validation.BindingResult; |
| 22 | +import org.springframework.web.bind.annotation.*; | ||
| 33 | 23 | ||
| 34 | import javax.servlet.http.HttpServletResponse; | 24 | import javax.servlet.http.HttpServletResponse; |
| 35 | import javax.validation.Valid; | 25 | import javax.validation.Valid; |
| 36 | - | ||
| 37 | -import org.springframework.validation.BindingResult; | 26 | +import java.util.Date; |
| 27 | +import java.util.List; | ||
| 38 | 28 | ||
| 39 | 29 | ||
| 40 | @RestController | 30 | @RestController |
| @@ -57,10 +47,10 @@ public class LingangEquipmentHeartbeatController extends BaseController { | @@ -57,10 +47,10 @@ public class LingangEquipmentHeartbeatController extends BaseController { | ||
| 57 | 47 | ||
| 58 | @ApiOperation("根据ID查询详情") | 48 | @ApiOperation("根据ID查询详情") |
| 59 | @GetMapping(value = "/view/{id}") | 49 | @GetMapping(value = "/view/{id}") |
| 60 | - public com.ruoyi.common.core.domain.AjaxResult view(@PathVariable("id") Long id, org.springframework.ui.Model model) { | 50 | + public ResponseResult view(@PathVariable("id") Long id, org.springframework.ui.Model model) { |
| 61 | LingangEquipmentHeartbeat source = lingangEquipmentHeartbeatService.getById(id); | 51 | LingangEquipmentHeartbeat source = lingangEquipmentHeartbeatService.getById(id); |
| 62 | 52 | ||
| 63 | - return com.ruoyi.common.core.domain.AjaxResult.success(convert(source)); | 53 | + return ResponseResult.success(convert(source)); |
| 64 | } | 54 | } |
| 65 | 55 | ||
| 66 | 56 | ||
| @@ -77,37 +67,37 @@ public class LingangEquipmentHeartbeatController extends BaseController { | @@ -77,37 +67,37 @@ public class LingangEquipmentHeartbeatController extends BaseController { | ||
| 77 | @ApiOperation("添加") | 67 | @ApiOperation("添加") |
| 78 | @PreAuthorize("@ss.hasPermi('LinGang:equipment:heartbeat:add')") | 68 | @PreAuthorize("@ss.hasPermi('LinGang:equipment:heartbeat:add')") |
| 79 | @PostMapping(value = "/add") | 69 | @PostMapping(value = "/add") |
| 80 | - public com.ruoyi.common.core.domain.AjaxResult add(@Valid @ModelAttribute LingangEquipmentHeartbeatAddDTO request, BindingResult bindingResult) { | 70 | + public ResponseResult add(@Valid @ModelAttribute LingangEquipmentHeartbeatAddDTO request, BindingResult bindingResult) { |
| 81 | if (bindingResult.hasErrors()) { | 71 | if (bindingResult.hasErrors()) { |
| 82 | - return AjaxResult.error(bindingResult.getFieldError().getDefaultMessage()); | 72 | + return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 83 | } | 73 | } |
| 84 | LingangEquipmentHeartbeat entity = convert(request); | 74 | LingangEquipmentHeartbeat entity = convert(request); |
| 85 | entity.setCreateBy(getUserId()); | 75 | entity.setCreateBy(getUserId()); |
| 86 | entity.setCreateTime(new Date()); | 76 | entity.setCreateTime(new Date()); |
| 87 | int count = lingangEquipmentHeartbeatService.insertSelective(entity); | 77 | int count = lingangEquipmentHeartbeatService.insertSelective(entity); |
| 88 | - return count > 0 ? com.ruoyi.common.core.domain.AjaxResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.AjaxResult.error("添加数据失败,请稍后再试"); | 78 | + return count > 0 ? ResponseResult.success(Boolean.TRUE) : ResponseResult.error("添加数据失败,请稍后再试"); |
| 89 | } | 79 | } |
| 90 | 80 | ||
| 91 | @ApiOperation("修改") | 81 | @ApiOperation("修改") |
| 92 | @PreAuthorize("@ss.hasPermi('LinGang:equipment:heartbeat:update')") | 82 | @PreAuthorize("@ss.hasPermi('LinGang:equipment:heartbeat:update')") |
| 93 | @PostMapping(value = "/update") | 83 | @PostMapping(value = "/update") |
| 94 | - public com.ruoyi.common.core.domain.AjaxResult update(@Valid @ModelAttribute LingangEquipmentHeartbeatUpdateDTO request, BindingResult bindingResult) { | 84 | + public ResponseResult update(@Valid @ModelAttribute LingangEquipmentHeartbeatUpdateDTO request, BindingResult bindingResult) { |
| 95 | if (bindingResult.hasErrors()) { | 85 | if (bindingResult.hasErrors()) { |
| 96 | - return AjaxResult.error(bindingResult.getFieldError().getDefaultMessage()); | 86 | + return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 97 | } | 87 | } |
| 98 | LingangEquipmentHeartbeat entity = convert(request); | 88 | LingangEquipmentHeartbeat entity = convert(request); |
| 99 | entity.setUpdateby(getUserId()); | 89 | entity.setUpdateby(getUserId()); |
| 100 | entity.setUpdateTime(new Date()); | 90 | entity.setUpdateTime(new Date()); |
| 101 | boolean flag = lingangEquipmentHeartbeatService.updateByPrimaryKey(entity); | 91 | boolean flag = lingangEquipmentHeartbeatService.updateByPrimaryKey(entity); |
| 102 | - return flag ? com.ruoyi.common.core.domain.AjaxResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.AjaxResult.error("修改数据失败,请稍后再试"); | 92 | + return flag ? ResponseResult.success(Boolean.TRUE) : ResponseResult.error("修改数据失败,请稍后再试"); |
| 103 | } | 93 | } |
| 104 | 94 | ||
| 105 | @PreAuthorize("@ss.hasPermi('LinGang:equipment:heartbeat:del')") | 95 | @PreAuthorize("@ss.hasPermi('LinGang:equipment:heartbeat:del')") |
| 106 | @ApiOperation("删除数据") | 96 | @ApiOperation("删除数据") |
| 107 | @GetMapping(value = "/del/{id}") | 97 | @GetMapping(value = "/del/{id}") |
| 108 | - public com.ruoyi.common.core.domain.AjaxResult delById(@PathVariable("id") Long id) { | 98 | + public ResponseResult delById(@PathVariable("id") Long id) { |
| 109 | boolean flag = lingangEquipmentHeartbeatService.deleteById(id); | 99 | boolean flag = lingangEquipmentHeartbeatService.deleteById(id); |
| 110 | - return flag ? com.ruoyi.common.core.domain.AjaxResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.AjaxResult.error("操作数据失败,请稍后再试"); | 100 | + return flag ? ResponseResult.success(Boolean.TRUE) : ResponseResult.error("操作数据失败,请稍后再试"); |
| 111 | } | 101 | } |
| 112 | 102 | ||
| 113 | private LingangEquipmentHeartbeat convert(LingangEquipmentHeartbeatQueryDTO source) { | 103 | private LingangEquipmentHeartbeat convert(LingangEquipmentHeartbeatQueryDTO source) { |
Bsth-admin/src/main/java/com/ruoyi/controller/equipment/self/check/LingangEquimentSelfCheckController.java
| 1 | package com.ruoyi.controller.equipment.self.check; | 1 | package com.ruoyi.controller.equipment.self.check; |
| 2 | 2 | ||
| 3 | +import com.alibaba.fastjson2.JSON; | ||
| 4 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 5 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 3 | import com.ruoyi.common.core.controller.BaseController; | 6 | import com.ruoyi.common.core.controller.BaseController; |
| 4 | -import com.ruoyi.common.core.domain.AjaxResult; | 7 | +import com.ruoyi.common.core.domain.ResponseResult; |
| 8 | +import com.ruoyi.common.utils.poi.ExcelUtil; | ||
| 9 | +import com.ruoyi.domain.OrderEntity; | ||
| 5 | import com.ruoyi.domain.equipment.self.check.LingangEquimentSelfCheck; | 10 | import com.ruoyi.domain.equipment.self.check.LingangEquimentSelfCheck; |
| 6 | import com.ruoyi.domain.equipment.self.check.dto.LingangEquimentSelfCheckAddDTO; | 11 | import com.ruoyi.domain.equipment.self.check.dto.LingangEquimentSelfCheckAddDTO; |
| 7 | import com.ruoyi.domain.equipment.self.check.dto.LingangEquimentSelfCheckQueryDTO; | 12 | import com.ruoyi.domain.equipment.self.check.dto.LingangEquimentSelfCheckQueryDTO; |
| @@ -11,31 +16,16 @@ import com.ruoyi.domain.equipment.self.check.vo.LingangEquimentSelfCheckVO; | @@ -11,31 +16,16 @@ import com.ruoyi.domain.equipment.self.check.vo.LingangEquimentSelfCheckVO; | ||
| 11 | import com.ruoyi.service.equipment.self.check.LingangEquimentSelfCheckService; | 16 | import com.ruoyi.service.equipment.self.check.LingangEquimentSelfCheckService; |
| 12 | import io.swagger.annotations.Api; | 17 | import io.swagger.annotations.Api; |
| 13 | import io.swagger.annotations.ApiOperation; | 18 | import io.swagger.annotations.ApiOperation; |
| 14 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 15 | -import org.springframework.web.bind.annotation.RestController; | ||
| 16 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
| 17 | -import org.springframework.web.bind.annotation.*; | ||
| 18 | import org.springframework.beans.BeanUtils; | 19 | import org.springframework.beans.BeanUtils; |
| 19 | - | 20 | +import org.springframework.beans.factory.annotation.Autowired; |
| 20 | import org.springframework.security.access.prepost.PreAuthorize; | 21 | import org.springframework.security.access.prepost.PreAuthorize; |
| 21 | - | ||
| 22 | -import java.util.List; | ||
| 23 | -import java.util.Date; | ||
| 24 | - | ||
| 25 | -import com.ruoyi.domain.OrderEntity; | ||
| 26 | - | ||
| 27 | - | ||
| 28 | -import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 29 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 30 | - | ||
| 31 | -import com.alibaba.fastjson2.JSON; | ||
| 32 | - | ||
| 33 | -import com.ruoyi.common.utils.poi.ExcelUtil; | 22 | +import org.springframework.validation.BindingResult; |
| 23 | +import org.springframework.web.bind.annotation.*; | ||
| 34 | 24 | ||
| 35 | import javax.servlet.http.HttpServletResponse; | 25 | import javax.servlet.http.HttpServletResponse; |
| 36 | import javax.validation.Valid; | 26 | import javax.validation.Valid; |
| 37 | - | ||
| 38 | -import org.springframework.validation.BindingResult; | 27 | +import java.util.Date; |
| 28 | +import java.util.List; | ||
| 39 | 29 | ||
| 40 | 30 | ||
| 41 | @RestController | 31 | @RestController |
| @@ -57,10 +47,10 @@ public class LingangEquimentSelfCheckController extends BaseController { | @@ -57,10 +47,10 @@ public class LingangEquimentSelfCheckController extends BaseController { | ||
| 57 | 47 | ||
| 58 | @ApiOperation("根据ID查询详情") | 48 | @ApiOperation("根据ID查询详情") |
| 59 | @GetMapping(value = "/view/{id}") | 49 | @GetMapping(value = "/view/{id}") |
| 60 | - public com.ruoyi.common.core.domain.AjaxResult view(@PathVariable("id") Long id, org.springframework.ui.Model model) { | 50 | + public ResponseResult view(@PathVariable("id") Long id, org.springframework.ui.Model model) { |
| 61 | LingangEquimentSelfCheck source = lingangEquimentSelfCheckService.getById(id); | 51 | LingangEquimentSelfCheck source = lingangEquimentSelfCheckService.getById(id); |
| 62 | 52 | ||
| 63 | - return com.ruoyi.common.core.domain.AjaxResult.success(convert(source)); | 53 | + return ResponseResult.success(convert(source)); |
| 64 | } | 54 | } |
| 65 | 55 | ||
| 66 | 56 | ||
| @@ -77,38 +67,38 @@ public class LingangEquimentSelfCheckController extends BaseController { | @@ -77,38 +67,38 @@ public class LingangEquimentSelfCheckController extends BaseController { | ||
| 77 | @ApiOperation("添加") | 67 | @ApiOperation("添加") |
| 78 | @PreAuthorize("@ss.hasPermi('LinGang:equiment:self:check:add')") | 68 | @PreAuthorize("@ss.hasPermi('LinGang:equiment:self:check:add')") |
| 79 | @PostMapping(value = "/add") | 69 | @PostMapping(value = "/add") |
| 80 | - public com.ruoyi.common.core.domain.AjaxResult add(@Valid @ModelAttribute LingangEquimentSelfCheckAddDTO request, BindingResult bindingResult) { | 70 | + public ResponseResult add(@Valid @ModelAttribute LingangEquimentSelfCheckAddDTO request, BindingResult bindingResult) { |
| 81 | if (bindingResult.hasErrors()) { | 71 | if (bindingResult.hasErrors()) { |
| 82 | - return AjaxResult.error(bindingResult.getFieldError().getDefaultMessage()); | 72 | + return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 83 | } | 73 | } |
| 84 | LingangEquimentSelfCheck entity = convert(request); | 74 | LingangEquimentSelfCheck entity = convert(request); |
| 85 | entity.setCreateBy(getUserId()); | 75 | entity.setCreateBy(getUserId()); |
| 86 | entity.setCreateTime(new Date()); | 76 | entity.setCreateTime(new Date()); |
| 87 | int count = lingangEquimentSelfCheckService.insertSelective(entity); | 77 | int count = lingangEquimentSelfCheckService.insertSelective(entity); |
| 88 | - return count > 0 ? com.ruoyi.common.core.domain.AjaxResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.AjaxResult.error("添加数据失败,请稍后再试"); | 78 | + return count > 0 ? ResponseResult.success(Boolean.TRUE) : ResponseResult.error("添加数据失败,请稍后再试"); |
| 89 | } | 79 | } |
| 90 | 80 | ||
| 91 | @ApiOperation("修改") | 81 | @ApiOperation("修改") |
| 92 | @PreAuthorize("@ss.hasPermi('LinGang:equiment:self:check:update')") | 82 | @PreAuthorize("@ss.hasPermi('LinGang:equiment:self:check:update')") |
| 93 | @PostMapping(value = "/update") | 83 | @PostMapping(value = "/update") |
| 94 | - public com.ruoyi.common.core.domain.AjaxResult update(@Valid @ModelAttribute LingangEquimentSelfCheckUpdateDTO request, BindingResult bindingResult) { | 84 | + public ResponseResult update(@Valid @ModelAttribute LingangEquimentSelfCheckUpdateDTO request, BindingResult bindingResult) { |
| 95 | if (bindingResult.hasErrors()) { | 85 | if (bindingResult.hasErrors()) { |
| 96 | - return AjaxResult.error(bindingResult.getFieldError().getDefaultMessage()); | 86 | + return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 97 | } | 87 | } |
| 98 | LingangEquimentSelfCheck entity = convert(request); | 88 | LingangEquimentSelfCheck entity = convert(request); |
| 99 | entity.setUpdateBy(getUserId()); | 89 | entity.setUpdateBy(getUserId()); |
| 100 | entity.setUpdateTime(new Date()); | 90 | entity.setUpdateTime(new Date()); |
| 101 | boolean flag = lingangEquimentSelfCheckService.updateByPrimaryKey(entity); | 91 | boolean flag = lingangEquimentSelfCheckService.updateByPrimaryKey(entity); |
| 102 | - return flag ? com.ruoyi.common.core.domain.AjaxResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.AjaxResult.error("修改数据失败,请稍后再试"); | 92 | + return flag ? ResponseResult.success(Boolean.TRUE) : ResponseResult.error("修改数据失败,请稍后再试"); |
| 103 | } | 93 | } |
| 104 | 94 | ||
| 105 | @ApiOperation("修改状态") | 95 | @ApiOperation("修改状态") |
| 106 | @PreAuthorize("@ss.hasPermi('LinGang:equiment:self:check:update:status')") | 96 | @PreAuthorize("@ss.hasPermi('LinGang:equiment:self:check:update:status')") |
| 107 | @PostMapping(value = "/update/status") | 97 | @PostMapping(value = "/update/status") |
| 108 | - public com.ruoyi.common.core.domain.AjaxResult updateState(@ModelAttribute LingangEquimentSelfCheckUpdateStatusDTO request) { | 98 | + public ResponseResult updateState(@ModelAttribute LingangEquimentSelfCheckUpdateStatusDTO request) { |
| 109 | LingangEquimentSelfCheck entity = convert(request); | 99 | LingangEquimentSelfCheck entity = convert(request); |
| 110 | boolean flag = lingangEquimentSelfCheckService.updateByPrimaryKey(entity); | 100 | boolean flag = lingangEquimentSelfCheckService.updateByPrimaryKey(entity); |
| 111 | - return flag ? com.ruoyi.common.core.domain.AjaxResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.AjaxResult.error("修改数据失败,请稍后再试"); | 101 | + return flag ? ResponseResult.success(Boolean.TRUE) : ResponseResult.error("修改数据失败,请稍后再试"); |
| 112 | } | 102 | } |
| 113 | 103 | ||
| 114 | private LingangEquimentSelfCheck convert(LingangEquimentSelfCheckQueryDTO source) { | 104 | private LingangEquimentSelfCheck convert(LingangEquimentSelfCheckQueryDTO source) { |
Bsth-admin/src/main/java/com/ruoyi/controller/keyinfo/KeyInfoController.java
| 1 | package com.ruoyi.controller.keyinfo; | 1 | package com.ruoyi.controller.keyinfo; |
| 2 | 2 | ||
| 3 | -import com.ruoyi.common.core.domain.AjaxResult; | 3 | +import com.alibaba.fastjson2.JSON; |
| 4 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 5 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 6 | +import com.ruoyi.common.core.domain.ResponseResult; | ||
| 7 | +import com.ruoyi.common.utils.poi.ExcelUtil; | ||
| 4 | import com.ruoyi.domain.OrderEntity; | 8 | import com.ruoyi.domain.OrderEntity; |
| 5 | import com.ruoyi.domain.keyInfo.KeyInfo; | 9 | import com.ruoyi.domain.keyInfo.KeyInfo; |
| 6 | import com.ruoyi.domain.keyInfo.dto.KeyInfoAddDTO; | 10 | import com.ruoyi.domain.keyInfo.dto.KeyInfoAddDTO; |
| @@ -10,31 +14,20 @@ import com.ruoyi.domain.keyInfo.dto.KeyInfoUpdateStatusDTO; | @@ -10,31 +14,20 @@ import com.ruoyi.domain.keyInfo.dto.KeyInfoUpdateStatusDTO; | ||
| 10 | import com.ruoyi.domain.keyInfo.vo.KeyInfoVO; | 14 | import com.ruoyi.domain.keyInfo.vo.KeyInfoVO; |
| 11 | import com.ruoyi.equipment.domain.Equipment; | 15 | import com.ruoyi.equipment.domain.Equipment; |
| 12 | import com.ruoyi.equipment.service.IEquipmentService; | 16 | import com.ruoyi.equipment.service.IEquipmentService; |
| 13 | -import com.ruoyi.service.carinfo.CarInfoService; | ||
| 14 | import io.swagger.annotations.Api; | 17 | import io.swagger.annotations.Api; |
| 15 | import io.swagger.annotations.ApiOperation; | 18 | import io.swagger.annotations.ApiOperation; |
| 16 | -import jdk.nashorn.internal.runtime.options.Option; | ||
| 17 | import org.apache.commons.collections4.CollectionUtils; | 19 | import org.apache.commons.collections4.CollectionUtils; |
| 18 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 19 | -import org.springframework.web.bind.annotation.RestController; | ||
| 20 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
| 21 | -import org.springframework.web.bind.annotation.*; | ||
| 22 | import org.springframework.beans.BeanUtils; | 20 | import org.springframework.beans.BeanUtils; |
| 23 | - | 21 | +import org.springframework.beans.factory.annotation.Autowired; |
| 24 | import org.springframework.security.access.prepost.PreAuthorize; | 22 | import org.springframework.security.access.prepost.PreAuthorize; |
| 25 | - | ||
| 26 | -import java.util.*; | ||
| 27 | -import java.util.stream.Collectors; | ||
| 28 | - | ||
| 29 | - | ||
| 30 | -import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 31 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 32 | - | ||
| 33 | -import com.alibaba.fastjson2.JSON; | ||
| 34 | - | ||
| 35 | -import com.ruoyi.common.utils.poi.ExcelUtil; | 23 | +import org.springframework.web.bind.annotation.*; |
| 36 | 24 | ||
| 37 | import javax.servlet.http.HttpServletResponse; | 25 | import javax.servlet.http.HttpServletResponse; |
| 26 | +import java.util.List; | ||
| 27 | +import java.util.Objects; | ||
| 28 | +import java.util.Optional; | ||
| 29 | +import java.util.Set; | ||
| 30 | +import java.util.stream.Collectors; | ||
| 38 | 31 | ||
| 39 | 32 | ||
| 40 | @RestController | 33 | @RestController |
| @@ -73,19 +66,19 @@ public class KeyInfoController { | @@ -73,19 +66,19 @@ public class KeyInfoController { | ||
| 73 | 66 | ||
| 74 | @PostMapping(value = "list/select") | 67 | @PostMapping(value = "list/select") |
| 75 | @ApiOperation("(页面选择)") | 68 | @ApiOperation("(页面选择)") |
| 76 | - public AjaxResult listSelect(@RequestBody KeyInfoQueryDTO dto) { | 69 | + public ResponseResult listSelect(@RequestBody KeyInfoQueryDTO dto) { |
| 77 | dto.clearStrEmpty(); | 70 | dto.clearStrEmpty(); |
| 78 | KeyInfo entity = convert(dto); | 71 | KeyInfo entity = convert(dto); |
| 79 | List<KeyInfo> selectList = KeyInfoService.listOfSelect(entity); | 72 | List<KeyInfo> selectList = KeyInfoService.listOfSelect(entity); |
| 80 | - return AjaxResult.success(selectList); | 73 | + return ResponseResult.success(selectList); |
| 81 | } | 74 | } |
| 82 | 75 | ||
| 83 | @GetMapping(value = "/view/{id}") | 76 | @GetMapping(value = "/view/{id}") |
| 84 | @ApiOperation("根据ID查看详情") | 77 | @ApiOperation("根据ID查看详情") |
| 85 | - public com.ruoyi.common.core.domain.AjaxResult view(@PathVariable("id") Integer id, org.springframework.ui.Model model) { | 78 | + public com.ruoyi.common.core.domain.ResponseResult view(@PathVariable("id") Integer id, org.springframework.ui.Model model) { |
| 86 | KeyInfo source = KeyInfoService.getById(id); | 79 | KeyInfo source = KeyInfoService.getById(id); |
| 87 | 80 | ||
| 88 | - return com.ruoyi.common.core.domain.AjaxResult.success(source); | 81 | + return com.ruoyi.common.core.domain.ResponseResult.success(source); |
| 89 | } | 82 | } |
| 90 | 83 | ||
| 91 | @PreAuthorize("@ss.hasPermi('key:info:export')") | 84 | @PreAuthorize("@ss.hasPermi('key:info:export')") |
| @@ -102,31 +95,31 @@ public class KeyInfoController { | @@ -102,31 +95,31 @@ public class KeyInfoController { | ||
| 102 | @PreAuthorize("@ss.hasPermi('key:info:add')") | 95 | @PreAuthorize("@ss.hasPermi('key:info:add')") |
| 103 | @PostMapping(value = "/add") | 96 | @PostMapping(value = "/add") |
| 104 | @ApiOperation("添加") | 97 | @ApiOperation("添加") |
| 105 | - public com.ruoyi.common.core.domain.AjaxResult add(@ModelAttribute KeyInfoAddDTO request) { | 98 | + public com.ruoyi.common.core.domain.ResponseResult add(@ModelAttribute KeyInfoAddDTO request) { |
| 106 | request.clearStrEmpty(); | 99 | request.clearStrEmpty(); |
| 107 | KeyInfo entity = convert(request); | 100 | KeyInfo entity = convert(request); |
| 108 | int count = KeyInfoService.insertSelective(entity); | 101 | int count = KeyInfoService.insertSelective(entity); |
| 109 | - return count > 0 ? com.ruoyi.common.core.domain.AjaxResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.AjaxResult.error("添加数据失败,请稍后再试"); | 102 | + return count > 0 ? com.ruoyi.common.core.domain.ResponseResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.ResponseResult.error("添加数据失败,请稍后再试"); |
| 110 | } | 103 | } |
| 111 | 104 | ||
| 112 | @PreAuthorize("@ss.hasPermi('key:info:update')") | 105 | @PreAuthorize("@ss.hasPermi('key:info:update')") |
| 113 | @PostMapping(value = "/update") | 106 | @PostMapping(value = "/update") |
| 114 | @ApiOperation("修改") | 107 | @ApiOperation("修改") |
| 115 | - public com.ruoyi.common.core.domain.AjaxResult update(@ModelAttribute KeyInfoUpdateDTO request) { | 108 | + public com.ruoyi.common.core.domain.ResponseResult update(@ModelAttribute KeyInfoUpdateDTO request) { |
| 116 | request.clearStrEmpty(); | 109 | request.clearStrEmpty(); |
| 117 | KeyInfo entity = convert(request); | 110 | KeyInfo entity = convert(request); |
| 118 | boolean flag = KeyInfoService.updateByPrimaryKey(entity); | 111 | boolean flag = KeyInfoService.updateByPrimaryKey(entity); |
| 119 | - return flag ? com.ruoyi.common.core.domain.AjaxResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.AjaxResult.error("修改数据失败,请稍后再试"); | 112 | + return flag ? com.ruoyi.common.core.domain.ResponseResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.ResponseResult.error("修改数据失败,请稍后再试"); |
| 120 | } | 113 | } |
| 121 | 114 | ||
| 122 | @PreAuthorize("@ss.hasPermi('key:info:update:status')") | 115 | @PreAuthorize("@ss.hasPermi('key:info:update:status')") |
| 123 | @PostMapping(value = "/update/status") | 116 | @PostMapping(value = "/update/status") |
| 124 | @ApiOperation("修改状态") | 117 | @ApiOperation("修改状态") |
| 125 | - public com.ruoyi.common.core.domain.AjaxResult updateState(@ModelAttribute KeyInfoUpdateStatusDTO request) { | 118 | + public com.ruoyi.common.core.domain.ResponseResult updateState(@ModelAttribute KeyInfoUpdateStatusDTO request) { |
| 126 | request.clearStrEmpty(); | 119 | request.clearStrEmpty(); |
| 127 | KeyInfo entity = convert(request); | 120 | KeyInfo entity = convert(request); |
| 128 | boolean flag = KeyInfoService.updateByPrimaryKey(entity); | 121 | boolean flag = KeyInfoService.updateByPrimaryKey(entity); |
| 129 | - return flag ? com.ruoyi.common.core.domain.AjaxResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.AjaxResult.error("修改数据失败,请稍后再试"); | 122 | + return flag ? com.ruoyi.common.core.domain.ResponseResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.ResponseResult.error("修改数据失败,请稍后再试"); |
| 130 | } | 123 | } |
| 131 | 124 | ||
| 132 | private KeyInfo convert(KeyInfoQueryDTO source) { | 125 | private KeyInfo convert(KeyInfoQueryDTO source) { |
Bsth-admin/src/main/java/com/ruoyi/domain/driver/dss/syn/res/dto/FaceCheckDTO.java
0 → 100644
| 1 | +package com.ruoyi.domain.driver.dss.syn.res.dto; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | +import io.swagger.annotations.ApiModel; | ||
| 5 | +import io.swagger.annotations.ApiModelProperty; | ||
| 6 | +import lombok.AllArgsConstructor; | ||
| 7 | +import lombok.Data; | ||
| 8 | +import lombok.EqualsAndHashCode; | ||
| 9 | +import lombok.NoArgsConstructor; | ||
| 10 | +import lombok.experimental.Accessors; | ||
| 11 | + | ||
| 12 | +import javax.validation.constraints.NotEmpty; | ||
| 13 | +import java.util.Date; | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * @author liujun | ||
| 17 | + * @date 2024年07月12日 10:41 | ||
| 18 | + */ | ||
| 19 | +@Data | ||
| 20 | +@NoArgsConstructor | ||
| 21 | +@AllArgsConstructor | ||
| 22 | +@Accessors(chain = true) | ||
| 23 | +@ApiModel(value = "人脸校验DTO") | ||
| 24 | +@EqualsAndHashCode(callSuper = false) | ||
| 25 | +public class FaceCheckDTO implements java.io.Serializable { | ||
| 26 | + @NotEmpty(message = "设备上线号不能为空") | ||
| 27 | + @ApiModelProperty(value = "设备上线号", required = true) | ||
| 28 | + private String device; | ||
| 29 | + | ||
| 30 | + @NotEmpty(message = "IC卡号不能为空") | ||
| 31 | + @ApiModelProperty(value = "IC卡号", required = true) | ||
| 32 | + private String driverCode; | ||
| 33 | + | ||
| 34 | + @NotEmpty(message = "时间不能为空") | ||
| 35 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 36 | + @ApiModelProperty(value = "时间", required = true) | ||
| 37 | + private Date checkTime; | ||
| 38 | + | ||
| 39 | + @NotEmpty(message = "人脸图片数据不能为空") | ||
| 40 | + @ApiModelProperty(value = "人脸图片数据图片数据格式为BASE64", required = true) | ||
| 41 | + private String faceValue; | ||
| 42 | +} |
Bsth-admin/src/main/java/com/ruoyi/domain/driver/dss/syn/res/vo/FaceCheckVo.java
0 → 100644
| 1 | +package com.ruoyi.domain.driver.dss.syn.res.vo; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModel; | ||
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | +import lombok.AllArgsConstructor; | ||
| 6 | +import lombok.Data; | ||
| 7 | +import lombok.EqualsAndHashCode; | ||
| 8 | +import lombok.NoArgsConstructor; | ||
| 9 | +import lombok.experimental.Accessors; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * @author liujun | ||
| 13 | + * @date 2024年07月12日 10:45 | ||
| 14 | + */ | ||
| 15 | +@Data | ||
| 16 | +@NoArgsConstructor | ||
| 17 | +@AllArgsConstructor | ||
| 18 | +@Accessors(chain = true) | ||
| 19 | +@ApiModel(value = "人脸校验VO") | ||
| 20 | +@EqualsAndHashCode(callSuper = false) | ||
| 21 | +public class FaceCheckVo implements java.io.Serializable { | ||
| 22 | + @ApiModelProperty(value = "IC卡号") | ||
| 23 | + private String driverCode; | ||
| 24 | + @ApiModelProperty(value = "表情 0无情绪,1愤怒,2厌恶,3恐惧,4高兴,5伤心,6惊讶") | ||
| 25 | + private Integer emotion; | ||
| 26 | +} |
Bsth-admin/src/main/java/com/ruoyi/domain/dss/sign/dto/DssSignDTO.java
0 → 100644
| 1 | +package com.ruoyi.domain.dss.sign.dto; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | +import io.swagger.annotations.ApiModel; | ||
| 5 | +import io.swagger.annotations.ApiModelProperty; | ||
| 6 | +import lombok.Data; | ||
| 7 | +import lombok.EqualsAndHashCode; | ||
| 8 | +import lombok.experimental.Accessors; | ||
| 9 | + | ||
| 10 | +import javax.validation.constraints.NotNull; | ||
| 11 | +import java.math.BigDecimal; | ||
| 12 | +import java.util.Date; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * @author liujun | ||
| 16 | + * @date 2024年07月12日 16:44 | ||
| 17 | + */ | ||
| 18 | +@Data | ||
| 19 | +@ApiModel(value = "人员签到") | ||
| 20 | +@Accessors(chain = true) | ||
| 21 | +@EqualsAndHashCode(callSuper = false) | ||
| 22 | +public class DssSignDTO { | ||
| 23 | + @NotNull(message = "设备上线号 不能为空") | ||
| 24 | + @ApiModelProperty(value = "设备上线号", required = true) | ||
| 25 | + private String device; | ||
| 26 | + | ||
| 27 | + @NotNull(message = "设备类型 不能为空") | ||
| 28 | + @ApiModelProperty(value = "设备类型", required = true) | ||
| 29 | + private String deviceType; | ||
| 30 | + | ||
| 31 | + @NotNull(message = "司机卡号 不能为空") | ||
| 32 | + @ApiModelProperty(value = "司机卡号", required = true) | ||
| 33 | + private String driverCode; | ||
| 34 | + | ||
| 35 | + @NotNull(message = "司机工号 不能为空") | ||
| 36 | + @ApiModelProperty(value = "司机工号", required = true) | ||
| 37 | + private String staffCode; | ||
| 38 | + | ||
| 39 | + @NotNull(message = "时间不能为空") | ||
| 40 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 41 | + @ApiModelProperty(value = "时间", required = true) | ||
| 42 | + private Date signTime; | ||
| 43 | + | ||
| 44 | + @ApiModelProperty(value = "酒测记录值") | ||
| 45 | + private Integer testValue; | ||
| 46 | + | ||
| 47 | + @ApiModelProperty(value = "体温度值,null表示不需岗前检测") | ||
| 48 | + private BigDecimal temperature; | ||
| 49 | + | ||
| 50 | + @ApiModelProperty(value = "情绪类型") | ||
| 51 | + private Integer emotion; | ||
| 52 | + | ||
| 53 | + @ApiModelProperty(value = "问卷渠道") | ||
| 54 | + private String channelCode; | ||
| 55 | + | ||
| 56 | + @ApiModelProperty(value = "健康数据有效性; 0:否,1:是") | ||
| 57 | + private String healthCheck; | ||
| 58 | + | ||
| 59 | + @ApiModelProperty(value = "健康数据") | ||
| 60 | + private DssSignHealthDataDTO healthData; | ||
| 61 | + | ||
| 62 | + @ApiModelProperty(value = "答题记录") | ||
| 63 | + private DssSignQuestionRecordDTO questionRecord; | ||
| 64 | +} |
Bsth-admin/src/main/java/com/ruoyi/domain/dss/sign/dto/DssSignHealthDataDTO.java
0 → 100644
| 1 | +package com.ruoyi.domain.dss.sign.dto; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModel; | ||
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | +import lombok.Data; | ||
| 6 | +import lombok.EqualsAndHashCode; | ||
| 7 | +import lombok.experimental.Accessors; | ||
| 8 | + | ||
| 9 | +import java.math.BigDecimal; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * @author liujun | ||
| 13 | + * @date 2024年07月12日 16:45 | ||
| 14 | + */ | ||
| 15 | +@Data | ||
| 16 | +@ApiModel(value = "人员签到-健康数据") | ||
| 17 | +@Accessors(chain = true) | ||
| 18 | +@EqualsAndHashCode(callSuper = false) | ||
| 19 | +public class DssSignHealthDataDTO { | ||
| 20 | + @ApiModelProperty(value = "血压舒张值") | ||
| 21 | + private BigDecimal systolicPressure; | ||
| 22 | + @ApiModelProperty(value = "血压收缩值") | ||
| 23 | + private BigDecimal diastolicPressure; | ||
| 24 | + @ApiModelProperty(value = "血氧值") | ||
| 25 | + private BigDecimal OxygenValue; | ||
| 26 | + @ApiModelProperty(value = "心率值") | ||
| 27 | + private BigDecimal heartRate; | ||
| 28 | + | ||
| 29 | +} |
Bsth-admin/src/main/java/com/ruoyi/domain/dss/sign/dto/DssSignOutDTO.java
0 → 100644
| 1 | +package com.ruoyi.domain.dss.sign.dto; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | +import io.swagger.annotations.ApiModel; | ||
| 5 | +import io.swagger.annotations.ApiModelProperty; | ||
| 6 | +import lombok.Data; | ||
| 7 | +import lombok.EqualsAndHashCode; | ||
| 8 | +import lombok.experimental.Accessors; | ||
| 9 | + | ||
| 10 | +import javax.validation.constraints.NotNull; | ||
| 11 | +import java.util.Date; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * @author liujun | ||
| 15 | + * @date 2024年07月16日 11:29 | ||
| 16 | + */ | ||
| 17 | +@Data | ||
| 18 | +@ApiModel(value = "人员签退") | ||
| 19 | +@Accessors(chain = true) | ||
| 20 | +@EqualsAndHashCode(callSuper = false) | ||
| 21 | +public class DssSignOutDTO implements java.io.Serializable { | ||
| 22 | + | ||
| 23 | + | ||
| 24 | + private static final long serialVersionUID = 3995970715143952495L; | ||
| 25 | + | ||
| 26 | + @NotNull(message = "签退设备上线号 不能为空") | ||
| 27 | + @ApiModelProperty(value = "设备上线号", required = true) | ||
| 28 | + private String device; | ||
| 29 | + @NotNull(message = "签退卡号 不能为空") | ||
| 30 | + @ApiModelProperty(value = "卡号") | ||
| 31 | + private String driverCode; | ||
| 32 | + | ||
| 33 | + @NotNull(message = "签退时间不能为空") | ||
| 34 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 35 | + @ApiModelProperty(value = "设备时间,yyyy-MM-dd HH:mm:ss") | ||
| 36 | + private Date logoutTime; | ||
| 37 | +} |
Bsth-admin/src/main/java/com/ruoyi/domain/dss/sign/dto/DssSignQuestionAnswerDTO.java
0 → 100644
| 1 | +package com.ruoyi.domain.dss.sign.dto; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModel; | ||
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | +import lombok.Data; | ||
| 6 | +import lombok.EqualsAndHashCode; | ||
| 7 | +import lombok.experimental.Accessors; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * @author liujun | ||
| 11 | + * @date 2024年07月12日 16:53 | ||
| 12 | + */ | ||
| 13 | +@Data | ||
| 14 | +@ApiModel(value = "人员签到-问卷答案集合") | ||
| 15 | +@Accessors(chain = true) | ||
| 16 | +@EqualsAndHashCode(callSuper = false) | ||
| 17 | +public class DssSignQuestionAnswerDTO { | ||
| 18 | + @ApiModelProperty("答案编码") | ||
| 19 | + private String answerCode; | ||
| 20 | + @ApiModelProperty("答案描述") | ||
| 21 | + private String answerContent; | ||
| 22 | + @ApiModelProperty("答案日期") | ||
| 23 | + private String answerDate; | ||
| 24 | + @ApiModelProperty("记录明细ID") | ||
| 25 | + private String detailId; | ||
| 26 | + @ApiModelProperty("题目ID") | ||
| 27 | + private String questionId; | ||
| 28 | + @ApiModelProperty("题目序号") | ||
| 29 | + private String questionNo; | ||
| 30 | + @ApiModelProperty("题目标题") | ||
| 31 | + private String questionTitle; | ||
| 32 | + @ApiModelProperty("题目类型") | ||
| 33 | + private String questionType; | ||
| 34 | + @ApiModelProperty("调查记录ID") | ||
| 35 | + private String recordId; | ||
| 36 | +} |
Bsth-admin/src/main/java/com/ruoyi/domain/dss/sign/dto/DssSignQuestionRecordDTO.java
0 → 100644
| 1 | +package com.ruoyi.domain.dss.sign.dto; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModel; | ||
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | +import lombok.Data; | ||
| 6 | +import lombok.EqualsAndHashCode; | ||
| 7 | +import lombok.experimental.Accessors; | ||
| 8 | + | ||
| 9 | +import java.util.List; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * @author liujun | ||
| 13 | + * @date 2024年07月12日 16:49 | ||
| 14 | + */ | ||
| 15 | +@Data | ||
| 16 | +@ApiModel(value = "人员签到-答题记录") | ||
| 17 | +@Accessors(chain = true) | ||
| 18 | +@EqualsAndHashCode(callSuper = false) | ||
| 19 | +public class DssSignQuestionRecordDTO { | ||
| 20 | + @ApiModelProperty(value = "渠道ID") | ||
| 21 | + private String channelId; | ||
| 22 | + @ApiModelProperty(value = "渠道编码") | ||
| 23 | + private String channelCode; | ||
| 24 | + @ApiModelProperty(value = "渠道名称") | ||
| 25 | + private String channelName; | ||
| 26 | + @ApiModelProperty(value = "设备ID") | ||
| 27 | + private String deviceId; | ||
| 28 | + @ApiModelProperty(value = "用户所属组织ID") | ||
| 29 | + private String orgId; | ||
| 30 | + @ApiModelProperty(value = "用户所属组织名称") | ||
| 31 | + private String orgName; | ||
| 32 | + @ApiModelProperty(value = "题库ID") | ||
| 33 | + private String subjectId; | ||
| 34 | + @ApiModelProperty(value = "题库标题") | ||
| 35 | + private String subjectName; | ||
| 36 | + @ApiModelProperty(value = "用户编码") | ||
| 37 | + private String userCode; | ||
| 38 | + @ApiModelProperty(value = "用户ID") | ||
| 39 | + private String userId; | ||
| 40 | + @ApiModelProperty(value = "用户姓名") | ||
| 41 | + private String userName; | ||
| 42 | + @ApiModelProperty(value = "问卷答案集合") | ||
| 43 | + private List<DssSignQuestionAnswerDTO> questionAnswerList; | ||
| 44 | +} |
Bsth-admin/src/main/java/com/ruoyi/domain/dss/sign/vo/DssSignHealthDataVo.java
0 → 100644
| 1 | +package com.ruoyi.domain.dss.sign.vo; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModel; | ||
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | +import lombok.AllArgsConstructor; | ||
| 6 | +import lombok.Data; | ||
| 7 | +import lombok.NoArgsConstructor; | ||
| 8 | +import lombok.experimental.Accessors; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * @author liujun | ||
| 12 | + * @date 2024年07月16日 10:46 | ||
| 13 | + */ | ||
| 14 | +@Data | ||
| 15 | +@NoArgsConstructor | ||
| 16 | +@AllArgsConstructor | ||
| 17 | +@Accessors(chain = true) | ||
| 18 | +@ApiModel(value = "人员签到-健康检测结果VO") | ||
| 19 | +public class DssSignHealthDataVo implements java.io.Serializable { | ||
| 20 | + | ||
| 21 | + private static final long serialVersionUID = 8312913668942617700L; | ||
| 22 | + | ||
| 23 | + @ApiModelProperty(value = "血压舒张 0:正常 1:低 2:高") | ||
| 24 | + private Integer systolicPressure; | ||
| 25 | + @ApiModelProperty(value = "血压收缩 0:正常 1:低 2:高") | ||
| 26 | + private Integer diastolicPressure; | ||
| 27 | + @ApiModelProperty(value = "血氧 0:正常 1:低 2:高") | ||
| 28 | + private Integer oxygenValue; | ||
| 29 | + @ApiModelProperty(value = "心率 0:正常 1:低 2:高") | ||
| 30 | + private Integer heartRate; | ||
| 31 | +} |
Bsth-admin/src/main/java/com/ruoyi/domain/dss/sign/vo/DssSignVo.java
0 → 100644
| 1 | +package com.ruoyi.domain.dss.sign.vo; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModel; | ||
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | +import lombok.AllArgsConstructor; | ||
| 6 | +import lombok.Data; | ||
| 7 | +import lombok.NoArgsConstructor; | ||
| 8 | +import lombok.experimental.Accessors; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * @author liujun | ||
| 12 | + * @date 2024年07月16日 10:41 | ||
| 13 | + */ | ||
| 14 | +@Data | ||
| 15 | +@NoArgsConstructor | ||
| 16 | +@AllArgsConstructor | ||
| 17 | +@Accessors(chain = true) | ||
| 18 | +@ApiModel(value = "人员签到VO") | ||
| 19 | +public class DssSignVo implements java.io.Serializable { | ||
| 20 | + @ApiModelProperty(value = "酒测记录Id") | ||
| 21 | + private String testId; | ||
| 22 | + @ApiModelProperty(value = "酒精测试结果 0:正常 1:饮酒 2:醉酒", example = "1") | ||
| 23 | + private Integer testResult; | ||
| 24 | + @ApiModelProperty(value = "体温测试结果 0:正常 1:异常", example = "1") | ||
| 25 | + private Integer tempResult; | ||
| 26 | + | ||
| 27 | + @ApiModelProperty(value = "签到结果 0:签到成功 1:签到失败", example = "1") | ||
| 28 | + private Integer result; | ||
| 29 | + | ||
| 30 | + @ApiModelProperty(value = "问卷ID") | ||
| 31 | + private String quesId; | ||
| 32 | + | ||
| 33 | + @ApiModelProperty(value = "健康检测结果") | ||
| 34 | + private DssSignHealthDataVo healthData; | ||
| 35 | +} |
Bsth-admin/src/main/java/com/ruoyi/domain/dss/sign/vo/SignOutVo.java
0 → 100644
| 1 | +package com.ruoyi.domain.dss.sign.vo; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModel; | ||
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | +import lombok.AllArgsConstructor; | ||
| 6 | +import lombok.Data; | ||
| 7 | +import lombok.NoArgsConstructor; | ||
| 8 | +import lombok.experimental.Accessors; | ||
| 9 | + | ||
| 10 | +import java.util.Date; | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * @author liujun | ||
| 14 | + * @date 2024年07月16日 13:08 | ||
| 15 | + */ | ||
| 16 | +@Data | ||
| 17 | +@NoArgsConstructor | ||
| 18 | +@AllArgsConstructor | ||
| 19 | +@Accessors(chain = true) | ||
| 20 | +@ApiModel(value = "人员签退VO") | ||
| 21 | +public class SignOutVo { | ||
| 22 | + @ApiModelProperty(value = "设备上线号") | ||
| 23 | + private String device; | ||
| 24 | + @ApiModelProperty(value = "卡号") | ||
| 25 | + private String driverCode; | ||
| 26 | + | ||
| 27 | + @ApiModelProperty(value = "设备时间,yyyy-MM-dd HH:mm:ss") | ||
| 28 | + private Date logoutTime; | ||
| 29 | +} |
Bsth-admin/src/main/java/com/ruoyi/equipment/service/IEquipmentService.java
| 1 | package com.ruoyi.equipment.service; | 1 | package com.ruoyi.equipment.service; |
| 2 | 2 | ||
| 3 | -import java.util.Collection; | ||
| 4 | -import java.util.List; | ||
| 5 | - | ||
| 6 | import com.baomidou.mybatisplus.extension.service.IService; | 3 | import com.baomidou.mybatisplus.extension.service.IService; |
| 7 | -import com.ruoyi.domain.keyInfo.KeyInfo; | ||
| 8 | import com.ruoyi.equipment.domain.Equipment; | 4 | import com.ruoyi.equipment.domain.Equipment; |
| 9 | import com.ruoyi.equipment.domain.EquipmentLog; | 5 | import com.ruoyi.equipment.domain.EquipmentLog; |
| 10 | import com.ruoyi.pojo.vo.EquipmentResponseVo; | 6 | import com.ruoyi.pojo.vo.EquipmentResponseVo; |
| 11 | 7 | ||
| 8 | +import java.util.Collection; | ||
| 9 | +import java.util.List; | ||
| 10 | + | ||
| 12 | /** | 11 | /** |
| 13 | * 设备信息Service接口 | 12 | * 设备信息Service接口 |
| 14 | * | 13 | * |
| @@ -34,6 +33,15 @@ public interface IEquipmentService extends IService<Equipment> { | @@ -34,6 +33,15 @@ public interface IEquipmentService extends IService<Equipment> { | ||
| 34 | Equipment getOneByDeviceId(String deviceId); | 33 | Equipment getOneByDeviceId(String deviceId); |
| 35 | 34 | ||
| 36 | /*** | 35 | /*** |
| 36 | + * 根据设备号查询设备信息 | ||
| 37 | + * @author liujun | ||
| 38 | + * @date 2024/7/5 15:23 | ||
| 39 | + * @param deviceId | ||
| 40 | + * @return com.ruoyi.equipment.domain.Equipment | ||
| 41 | + */ | ||
| 42 | + Equipment getOne(Equipment equipment); | ||
| 43 | + | ||
| 44 | + /*** | ||
| 37 | *用于页面选择 | 45 | *用于页面选择 |
| 38 | * @author liujun | 46 | * @author liujun |
| 39 | * @date 2024/6/21 20:51 | 47 | * @date 2024/6/21 20:51 |
Bsth-admin/src/main/java/com/ruoyi/equipment/service/impl/EquipmentServiceImpl.java
| 1 | package com.ruoyi.equipment.service.impl; | 1 | package com.ruoyi.equipment.service.impl; |
| 2 | 2 | ||
| 3 | -import java.util.Collection; | ||
| 4 | -import java.util.Collections; | ||
| 5 | -import java.util.List; | ||
| 6 | -import java.util.Objects; | ||
| 7 | -import java.util.stream.Collectors; | ||
| 8 | - | 3 | +import cn.hutool.core.convert.Convert; |
| 9 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 4 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| 10 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| 11 | import com.ruoyi.common.utils.DateUtils; | 6 | import com.ruoyi.common.utils.DateUtils; |
| 12 | import com.ruoyi.common.utils.SecurityUtils; | 7 | import com.ruoyi.common.utils.SecurityUtils; |
| 13 | import com.ruoyi.common.utils.StringUtils; | 8 | import com.ruoyi.common.utils.StringUtils; |
| 14 | -import com.ruoyi.domain.keyInfo.KeyInfo; | 9 | +import com.ruoyi.equipment.domain.Equipment; |
| 15 | import com.ruoyi.equipment.domain.EquipmentLog; | 10 | import com.ruoyi.equipment.domain.EquipmentLog; |
| 16 | -import com.ruoyi.mapper.keyinfo.KeyInfoMapper; | 11 | +import com.ruoyi.equipment.mapper.EquipmentMapper; |
| 12 | +import com.ruoyi.equipment.service.IEquipmentService; | ||
| 17 | import com.ruoyi.pojo.equipment.EquipmentOnline; | 13 | import com.ruoyi.pojo.equipment.EquipmentOnline; |
| 18 | import com.ruoyi.pojo.vo.EquipmentResponseVo; | 14 | import com.ruoyi.pojo.vo.EquipmentResponseVo; |
| 19 | import org.springframework.beans.factory.annotation.Autowired; | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| 16 | +import org.springframework.security.core.GrantedAuthority; | ||
| 17 | +import org.springframework.security.core.userdetails.UserDetails; | ||
| 18 | +import org.springframework.security.core.userdetails.UserDetailsService; | ||
| 19 | +import org.springframework.security.core.userdetails.UsernameNotFoundException; | ||
| 20 | import org.springframework.stereotype.Service; | 20 | import org.springframework.stereotype.Service; |
| 21 | -import com.ruoyi.equipment.mapper.EquipmentMapper; | ||
| 22 | -import com.ruoyi.equipment.domain.Equipment; | ||
| 23 | -import com.ruoyi.equipment.service.IEquipmentService; | ||
| 24 | import org.springframework.util.CollectionUtils; | 21 | import org.springframework.util.CollectionUtils; |
| 25 | -import org.springframework.web.bind.annotation.ModelAttribute; | ||
| 26 | 22 | ||
| 27 | import javax.annotation.Resource; | 23 | import javax.annotation.Resource; |
| 24 | +import java.util.Collection; | ||
| 25 | +import java.util.Collections; | ||
| 26 | +import java.util.List; | ||
| 27 | +import java.util.Objects; | ||
| 28 | +import java.util.stream.Collectors; | ||
| 28 | 29 | ||
| 29 | /** | 30 | /** |
| 30 | * 设备信息Service业务层处理 | 31 | * 设备信息Service业务层处理 |
| @@ -33,7 +34,7 @@ import javax.annotation.Resource; | @@ -33,7 +34,7 @@ import javax.annotation.Resource; | ||
| 33 | * @date 2023-07-05 | 34 | * @date 2023-07-05 |
| 34 | */ | 35 | */ |
| 35 | @Service | 36 | @Service |
| 36 | -public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment> implements IEquipmentService { | 37 | +public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment> implements IEquipmentService, UserDetailsService { |
| 37 | @Autowired | 38 | @Autowired |
| 38 | private EquipmentMapper equipmentMapper; | 39 | private EquipmentMapper equipmentMapper; |
| 39 | 40 | ||
| @@ -59,6 +60,12 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment | @@ -59,6 +60,12 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment | ||
| 59 | } | 60 | } |
| 60 | 61 | ||
| 61 | @Override | 62 | @Override |
| 63 | + public Equipment getOne(Equipment equipment) { | ||
| 64 | + LambdaQueryWrapper<Equipment> wrapper = new LambdaQueryWrapper<>(equipment); | ||
| 65 | + return getOne(wrapper); | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + @Override | ||
| 62 | public List<Equipment> listOfSelect(Equipment equipment) { | 69 | public List<Equipment> listOfSelect(Equipment equipment) { |
| 63 | 70 | ||
| 64 | return equipmentMapper.queryIdsiteNameBypromise(equipment.getPromise()); | 71 | return equipmentMapper.queryIdsiteNameBypromise(equipment.getPromise()); |
| @@ -160,4 +167,49 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment | @@ -160,4 +167,49 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment | ||
| 160 | List<String> equipment = list.stream().map(Equipment::getSiteName).distinct().collect(Collectors.toList()); | 167 | List<String> equipment = list.stream().map(Equipment::getSiteName).distinct().collect(Collectors.toList()); |
| 161 | return equipment; | 168 | return equipment; |
| 162 | } | 169 | } |
| 170 | + | ||
| 171 | + @Override | ||
| 172 | + public UserDetails loadUserByUsername(String deviceId) throws UsernameNotFoundException { | ||
| 173 | + Equipment equipment = getOneByDeviceId(deviceId); | ||
| 174 | + if (Objects.isNull(equipment)) { | ||
| 175 | + return null; | ||
| 176 | + } | ||
| 177 | + | ||
| 178 | + return new UserDetails() { | ||
| 179 | + @Override | ||
| 180 | + public Collection<? extends GrantedAuthority> getAuthorities() { | ||
| 181 | + return null; | ||
| 182 | + } | ||
| 183 | + | ||
| 184 | + @Override | ||
| 185 | + public String getPassword() { | ||
| 186 | + return SecurityUtils.encryptPassword(Convert.toStr(equipment.getId())); | ||
| 187 | + } | ||
| 188 | + | ||
| 189 | + @Override | ||
| 190 | + public String getUsername() { | ||
| 191 | + return deviceId; | ||
| 192 | + } | ||
| 193 | + | ||
| 194 | + @Override | ||
| 195 | + public boolean isAccountNonExpired() { | ||
| 196 | + return true; | ||
| 197 | + } | ||
| 198 | + | ||
| 199 | + @Override | ||
| 200 | + public boolean isAccountNonLocked() { | ||
| 201 | + return true; | ||
| 202 | + } | ||
| 203 | + | ||
| 204 | + @Override | ||
| 205 | + public boolean isCredentialsNonExpired() { | ||
| 206 | + return true; | ||
| 207 | + } | ||
| 208 | + | ||
| 209 | + @Override | ||
| 210 | + public boolean isEnabled() { | ||
| 211 | + return true; | ||
| 212 | + } | ||
| 213 | + }; | ||
| 214 | + } | ||
| 163 | } | 215 | } |
Bsth-admin/src/main/java/com/ruoyi/in/service/ISignInService.java
| @@ -5,6 +5,7 @@ import java.util.List; | @@ -5,6 +5,7 @@ import java.util.List; | ||
| 5 | 5 | ||
| 6 | import com.ruoyi.common.core.domain.AjaxResult; | 6 | import com.ruoyi.common.core.domain.AjaxResult; |
| 7 | import com.ruoyi.common.exception.file.FileUploadException; | 7 | import com.ruoyi.common.exception.file.FileUploadException; |
| 8 | +import com.ruoyi.domain.driver.NewDriver; | ||
| 8 | import com.ruoyi.in.domain.SignIn; | 9 | import com.ruoyi.in.domain.SignIn; |
| 9 | import com.ruoyi.pojo.response.SignInResponseVo; | 10 | import com.ruoyi.pojo.response.SignInResponseVo; |
| 10 | 11 | ||
| @@ -12,15 +13,14 @@ import javax.servlet.http.HttpServletRequest; | @@ -12,15 +13,14 @@ import javax.servlet.http.HttpServletRequest; | ||
| 12 | 13 | ||
| 13 | /** | 14 | /** |
| 14 | * 签到Service接口 | 15 | * 签到Service接口 |
| 15 | - * | 16 | + * |
| 16 | * @author guzijian | 17 | * @author guzijian |
| 17 | * @date 2023-07-05 | 18 | * @date 2023-07-05 |
| 18 | */ | 19 | */ |
| 19 | -public interface ISignInService | ||
| 20 | -{ | 20 | +public interface ISignInService { |
| 21 | /** | 21 | /** |
| 22 | * 查询签到 | 22 | * 查询签到 |
| 23 | - * | 23 | + * |
| 24 | * @param id 签到主键 | 24 | * @param id 签到主键 |
| 25 | * @return 签到 | 25 | * @return 签到 |
| 26 | */ | 26 | */ |
| @@ -28,7 +28,7 @@ public interface ISignInService | @@ -28,7 +28,7 @@ public interface ISignInService | ||
| 28 | 28 | ||
| 29 | /** | 29 | /** |
| 30 | * 查询签到列表 | 30 | * 查询签到列表 |
| 31 | - * | 31 | + * |
| 32 | * @param signIn 签到 | 32 | * @param signIn 签到 |
| 33 | * @return 签到集合 | 33 | * @return 签到集合 |
| 34 | */ | 34 | */ |
| @@ -36,7 +36,7 @@ public interface ISignInService | @@ -36,7 +36,7 @@ public interface ISignInService | ||
| 36 | 36 | ||
| 37 | /** | 37 | /** |
| 38 | * 修改签到 | 38 | * 修改签到 |
| 39 | - * | 39 | + * |
| 40 | * @param signIn 签到 | 40 | * @param signIn 签到 |
| 41 | * @return 结果 | 41 | * @return 结果 |
| 42 | */ | 42 | */ |
| @@ -44,7 +44,7 @@ public interface ISignInService | @@ -44,7 +44,7 @@ public interface ISignInService | ||
| 44 | 44 | ||
| 45 | /** | 45 | /** |
| 46 | * 批量删除签到 | 46 | * 批量删除签到 |
| 47 | - * | 47 | + * |
| 48 | * @param ids 需要删除的签到主键集合 | 48 | * @param ids 需要删除的签到主键集合 |
| 49 | * @return 结果 | 49 | * @return 结果 |
| 50 | */ | 50 | */ |
| @@ -52,7 +52,7 @@ public interface ISignInService | @@ -52,7 +52,7 @@ public interface ISignInService | ||
| 52 | 52 | ||
| 53 | /** | 53 | /** |
| 54 | * 删除签到信息 | 54 | * 删除签到信息 |
| 55 | - * | 55 | + * |
| 56 | * @param id 签到主键 | 56 | * @param id 签到主键 |
| 57 | * @return 结果 | 57 | * @return 结果 |
| 58 | */ | 58 | */ |
| @@ -60,6 +60,7 @@ public interface ISignInService | @@ -60,6 +60,7 @@ public interface ISignInService | ||
| 60 | 60 | ||
| 61 | /** | 61 | /** |
| 62 | * 设备签到 | 62 | * 设备签到 |
| 63 | + * | ||
| 63 | * @param signIn | 64 | * @param signIn |
| 64 | * @return | 65 | * @return |
| 65 | */ | 66 | */ |
| @@ -67,9 +68,29 @@ public interface ISignInService | @@ -67,9 +68,29 @@ public interface ISignInService | ||
| 67 | 68 | ||
| 68 | String repairSignRecord(HttpServletRequest request); | 69 | String repairSignRecord(HttpServletRequest request); |
| 69 | 70 | ||
| 70 | - String repairAllSignRecord(HttpServletRequest request,String date); | 71 | + String repairAllSignRecord(HttpServletRequest request, String date); |
| 71 | 72 | ||
| 72 | AjaxResult supplementarySignature(SignIn signIn); | 73 | AjaxResult supplementarySignature(SignIn signIn); |
| 73 | 74 | ||
| 74 | List<SignInResponseVo> selectSignInByIds(List<Long> collect); | 75 | List<SignInResponseVo> selectSignInByIds(List<Long> collect); |
| 76 | + | ||
| 77 | + /*** | ||
| 78 | + *当日最后一次登签的签到状态 | ||
| 79 | + * | ||
| 80 | + * @author liujun | ||
| 81 | + * @date 2024/7/12 10:25 | ||
| 82 | + * @param driver | ||
| 83 | + * @return int 0:未签到,1:已签到 | ||
| 84 | + */ | ||
| 85 | + int signInType(NewDriver driver); | ||
| 86 | + | ||
| 87 | + /*** | ||
| 88 | + *当日最后一次登签的签退状态 | ||
| 89 | + * | ||
| 90 | + * @author liujun | ||
| 91 | + * @date 2024/7/12 10:25 | ||
| 92 | + * @param driver | ||
| 93 | + * @return int 0:未签到,1:已签到 | ||
| 94 | + */ | ||
| 95 | + int signOutType(NewDriver driver); | ||
| 75 | } | 96 | } |
Bsth-admin/src/main/java/com/ruoyi/in/service/impl/SignInServiceImpl.java
| @@ -25,6 +25,7 @@ import com.ruoyi.common.utils.StringUtils; | @@ -25,6 +25,7 @@ import com.ruoyi.common.utils.StringUtils; | ||
| 25 | import com.ruoyi.common.utils.ip.IpUtils; | 25 | import com.ruoyi.common.utils.ip.IpUtils; |
| 26 | import com.ruoyi.common.utils.uuid.Seq; | 26 | import com.ruoyi.common.utils.uuid.Seq; |
| 27 | import com.ruoyi.common.utils.uuid.UUID; | 27 | import com.ruoyi.common.utils.uuid.UUID; |
| 28 | +import com.ruoyi.domain.driver.NewDriver; | ||
| 28 | import com.ruoyi.driver.domain.Driver; | 29 | import com.ruoyi.driver.domain.Driver; |
| 29 | import com.ruoyi.driver.mapper.DriverMapper; | 30 | import com.ruoyi.driver.mapper.DriverMapper; |
| 30 | import com.ruoyi.driver.mapper.DriverSchedulingMapper; | 31 | import com.ruoyi.driver.mapper.DriverSchedulingMapper; |
| @@ -319,6 +320,18 @@ public class SignInServiceImpl implements ISignInService { | @@ -319,6 +320,18 @@ public class SignInServiceImpl implements ISignInService { | ||
| 319 | return signInMapper.selectSignInByIds(collect); | 320 | return signInMapper.selectSignInByIds(collect); |
| 320 | } | 321 | } |
| 321 | 322 | ||
| 323 | + @Override | ||
| 324 | + public int signInType(NewDriver driver) { | ||
| 325 | + //TODO | ||
| 326 | + return 0; | ||
| 327 | + } | ||
| 328 | + | ||
| 329 | + @Override | ||
| 330 | + public int signOutType(NewDriver driver) { | ||
| 331 | + //TODO | ||
| 332 | + return 0; | ||
| 333 | + } | ||
| 334 | + | ||
| 322 | 335 | ||
| 323 | private String handleDate(String dateString) { | 336 | private String handleDate(String dateString) { |
| 324 | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd"); | 337 | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd"); |
Bsth-admin/src/main/java/com/ruoyi/service/IUserDetailsService.java
0 → 100644
Bsth-admin/src/main/java/com/ruoyi/service/driver/NewDriverService.java
| 1 | package com.ruoyi.service.driver; | 1 | package com.ruoyi.service.driver; |
| 2 | 2 | ||
| 3 | -import com.baomidou.mybatisplus.extension.service.IService; | ||
| 4 | import com.baomidou.mybatisplus.core.metadata.IPage; | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; |
| 5 | - | ||
| 6 | -import java.util.List; | ||
| 7 | - | 4 | +import com.baomidou.mybatisplus.extension.service.IService; |
| 5 | +import com.ruoyi.common.TipEnum; | ||
| 8 | import com.ruoyi.domain.OrderEntity; | 6 | import com.ruoyi.domain.OrderEntity; |
| 9 | import com.ruoyi.domain.driver.NewDriver; | 7 | import com.ruoyi.domain.driver.NewDriver; |
| 10 | 8 | ||
| 9 | +import java.util.List; | ||
| 10 | + | ||
| 11 | 11 | ||
| 12 | public interface NewDriverService extends IService<NewDriver> { | 12 | public interface NewDriverService extends IService<NewDriver> { |
| 13 | /** | 13 | /** |
| @@ -55,7 +55,7 @@ public interface NewDriverService extends IService<NewDriver> { | @@ -55,7 +55,7 @@ public interface NewDriverService extends IService<NewDriver> { | ||
| 55 | * @author liujun | 55 | * @author liujun |
| 56 | * @date 2024/7/11 16:07 | 56 | * @date 2024/7/11 16:07 |
| 57 | */ | 57 | */ |
| 58 | - boolean updateClient(NewDriver entity); | 58 | + TipEnum updateClient(NewDriver entity); |
| 59 | 59 | ||
| 60 | /*** | 60 | /*** |
| 61 | * 人脸注册 | 61 | * 人脸注册 |
| @@ -64,7 +64,7 @@ public interface NewDriverService extends IService<NewDriver> { | @@ -64,7 +64,7 @@ public interface NewDriverService extends IService<NewDriver> { | ||
| 64 | * @param entity | 64 | * @param entity |
| 65 | * @return boolean | 65 | * @return boolean |
| 66 | */ | 66 | */ |
| 67 | - boolean faceRegister(NewDriver entity); | 67 | + TipEnum faceRegister(NewDriver entity); |
| 68 | 68 | ||
| 69 | boolean deleteById(java.lang.String jobCode); | 69 | boolean deleteById(java.lang.String jobCode); |
| 70 | } | 70 | } |
| 71 | \ No newline at end of file | 71 | \ No newline at end of file |
Bsth-admin/src/main/java/com/ruoyi/service/dss/FaceService.java
0 → 100644
| 1 | +package com.ruoyi.service.dss; | ||
| 2 | + | ||
| 3 | +import com.ruoyi.domain.driver.NewDriver; | ||
| 4 | + | ||
| 5 | +/** | ||
| 6 | + * @author liujun | ||
| 7 | + * @date 2024年07月12日 10:50 | ||
| 8 | + */ | ||
| 9 | +public interface FaceService { | ||
| 10 | + /*** | ||
| 11 | + * 校验人脸 | ||
| 12 | + * @author liujun | ||
| 13 | + * @date 2024/7/12 10:50 | ||
| 14 | + * @param driver 图片的base64字符串放到了image | ||
| 15 | + * @return com.ruoyi.domain.driver.NewDriver | ||
| 16 | + */ | ||
| 17 | + NewDriver checkFace(NewDriver driver); | ||
| 18 | + | ||
| 19 | +} |
Bsth-admin/src/main/java/com/ruoyi/service/dss/KeyBoxVoService.java
| 1 | package com.ruoyi.service.dss; | 1 | package com.ruoyi.service.dss; |
| 2 | 2 | ||
| 3 | -import com.ruoyi.common.core.domain.AjaxResult; | 3 | +import com.ruoyi.common.core.domain.ResponseResult; |
| 4 | import com.ruoyi.domain.equipment.linke.log.LingangEquipmentLinkeLog; | 4 | import com.ruoyi.domain.equipment.linke.log.LingangEquipmentLinkeLog; |
| 5 | import com.ruoyi.domain.keyInfo.box.dto.KeyBoxQueryDTO; | 5 | import com.ruoyi.domain.keyInfo.box.dto.KeyBoxQueryDTO; |
| 6 | 6 | ||
| @@ -11,5 +11,5 @@ import com.ruoyi.domain.keyInfo.box.dto.KeyBoxQueryDTO; | @@ -11,5 +11,5 @@ import com.ruoyi.domain.keyInfo.box.dto.KeyBoxQueryDTO; | ||
| 11 | */ | 11 | */ |
| 12 | public interface KeyBoxVoService { | 12 | public interface KeyBoxVoService { |
| 13 | /**钥匙信息查询*/ | 13 | /**钥匙信息查询*/ |
| 14 | - AjaxResult listSelect( KeyBoxQueryDTO request, LingangEquipmentLinkeLog linkeLog); | 14 | + ResponseResult listSelect(KeyBoxQueryDTO request, LingangEquipmentLinkeLog linkeLog); |
| 15 | } | 15 | } |
Bsth-admin/src/main/java/com/ruoyi/service/impl/LingGangUserDetailsServiceImpl.java
0 → 100644
| 1 | +package com.ruoyi.service.impl; | ||
| 2 | + | ||
| 3 | +import com.ruoyi.equipment.service.impl.EquipmentServiceImpl; | ||
| 4 | +import com.ruoyi.framework.web.service.UserDetailsServiceImpl; | ||
| 5 | +import com.ruoyi.service.IUserDetailsService; | ||
| 6 | +import org.springframework.security.core.userdetails.UserDetails; | ||
| 7 | +import org.springframework.security.core.userdetails.UserDetailsService; | ||
| 8 | +import org.springframework.security.core.userdetails.UsernameNotFoundException; | ||
| 9 | +import org.springframework.stereotype.Service; | ||
| 10 | + | ||
| 11 | +import javax.annotation.Resource; | ||
| 12 | +import java.util.Objects; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * @author liujun | ||
| 16 | + * @date 2024年07月16日 13:37 | ||
| 17 | + */ | ||
| 18 | +@Service(value="com.ruoyi.service.impl.LingGangUserDetailsServiceImpl") | ||
| 19 | +public class LingGangUserDetailsServiceImpl implements IUserDetailsService { | ||
| 20 | + @Resource(type = UserDetailsServiceImpl.class) | ||
| 21 | + private UserDetailsService userDetailsService; | ||
| 22 | + | ||
| 23 | + @Resource(type = EquipmentServiceImpl.class) | ||
| 24 | + private UserDetailsService equipmentService; | ||
| 25 | + | ||
| 26 | + @Override | ||
| 27 | + public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { | ||
| 28 | + UserDetails userDetails = equipmentService.loadUserByUsername(username); | ||
| 29 | + if (Objects.isNull(userDetails)) { | ||
| 30 | + userDetails = userDetailsService.loadUserByUsername(username); | ||
| 31 | + } | ||
| 32 | + return userDetails; | ||
| 33 | + } | ||
| 34 | +} |
Bsth-admin/src/main/java/com/ruoyi/service/impl/carinfo/CarInfoServiceImpl.java
| 1 | package com.ruoyi.service.impl.carinfo; | 1 | package com.ruoyi.service.impl.carinfo; |
| 2 | 2 | ||
| 3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
| 4 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 5 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 6 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
| 7 | +import com.github.pagehelper.PageHelper; | ||
| 3 | import com.ruoyi.domain.OrderEntity; | 8 | import com.ruoyi.domain.OrderEntity; |
| 4 | import com.ruoyi.domain.caiinfo.CarInfo; | 9 | import com.ruoyi.domain.caiinfo.CarInfo; |
| 5 | -import com.ruoyi.equipment.domain.Equipment; | 10 | +import com.ruoyi.mapper.carinfo.CarInfoMapper; |
| 6 | import com.ruoyi.service.carinfo.CarInfoService; | 11 | import com.ruoyi.service.carinfo.CarInfoService; |
| 7 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | import org.springframework.stereotype.Service; | 13 | import org.springframework.stereotype.Service; |
| 9 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
| 10 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
| 11 | -import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 12 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 13 | - | ||
| 14 | -import com.github.pagehelper.PageHelper; | ||
| 15 | - | ||
| 16 | -import javax.servlet.http.HttpServletResponse; | 14 | +import org.springframework.util.CollectionUtils; |
| 17 | 15 | ||
| 18 | import java.util.Collection; | 16 | import java.util.Collection; |
| 19 | import java.util.Collections; | 17 | import java.util.Collections; |
| 20 | import java.util.List; | 18 | import java.util.List; |
| 21 | 19 | ||
| 22 | -import com.ruoyi.domain.caiinfo.CarInfo; | ||
| 23 | -import com.ruoyi.mapper.carinfo.CarInfoMapper; | ||
| 24 | -import com.ruoyi.service.carinfo.CarInfoService; | ||
| 25 | -import org.springframework.util.CollectionUtils; | ||
| 26 | - | ||
| 27 | @Service | 20 | @Service |
| 28 | public class CarInfoServiceImpl extends ServiceImpl<CarInfoMapper, CarInfo> implements CarInfoService { | 21 | public class CarInfoServiceImpl extends ServiceImpl<CarInfoMapper, CarInfo> implements CarInfoService { |
| 29 | @Autowired | 22 | @Autowired |
| @@ -180,6 +173,8 @@ public class CarInfoServiceImpl extends ServiceImpl<CarInfoMapper, CarInfo> impl | @@ -180,6 +173,8 @@ public class CarInfoServiceImpl extends ServiceImpl<CarInfoMapper, CarInfo> impl | ||
| 180 | if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "updateTime")) { | 173 | if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "updateTime")) { |
| 181 | wrapper.orderByDesc(CarInfo::getUpdateTime); | 174 | wrapper.orderByDesc(CarInfo::getUpdateTime); |
| 182 | } | 175 | } |
| 176 | + }else{ | ||
| 177 | + wrapper.orderByDesc(CarInfo::getCreateTime); | ||
| 183 | } | 178 | } |
| 184 | } | 179 | } |
| 185 | } | 180 | } |
| 186 | \ No newline at end of file | 181 | \ No newline at end of file |
Bsth-admin/src/main/java/com/ruoyi/service/impl/driver/NewDriverServiceImpl.java
| 1 | package com.ruoyi.service.impl.driver; | 1 | package com.ruoyi.service.impl.driver; |
| 2 | 2 | ||
| 3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
| 3 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | 4 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| 4 | -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; | 5 | +import com.baomidou.mybatisplus.core.metadata.IPage; |
| 6 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 7 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
| 8 | +import com.github.pagehelper.PageHelper; | ||
| 9 | +import com.ruoyi.common.TipEnum; | ||
| 10 | +import com.ruoyi.common.core.domain.ResponseResult; | ||
| 5 | import com.ruoyi.common.utils.StringUtils; | 11 | import com.ruoyi.common.utils.StringUtils; |
| 12 | +import com.ruoyi.common.utils.file.FileUploadUtils; | ||
| 13 | +import com.ruoyi.config.BsthSystemConfig; | ||
| 14 | +import com.ruoyi.domain.OrderEntity; | ||
| 6 | import com.ruoyi.domain.driver.NewDriver; | 15 | import com.ruoyi.domain.driver.NewDriver; |
| 7 | import com.ruoyi.mapper.driver.NewDriverMapper; | 16 | import com.ruoyi.mapper.driver.NewDriverMapper; |
| 8 | import com.ruoyi.service.driver.NewDriverService; | 17 | import com.ruoyi.service.driver.NewDriverService; |
| 18 | +import lombok.extern.slf4j.Slf4j; | ||
| 9 | import org.apache.commons.collections4.CollectionUtils; | 19 | import org.apache.commons.collections4.CollectionUtils; |
| 10 | import org.springframework.beans.factory.annotation.Autowired; | 20 | import org.springframework.beans.factory.annotation.Autowired; |
| 11 | import org.springframework.stereotype.Service; | 21 | import org.springframework.stereotype.Service; |
| 12 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
| 13 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
| 14 | -import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 15 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 16 | - | ||
| 17 | -import com.github.pagehelper.PageHelper; | ||
| 18 | - | ||
| 19 | -import javax.servlet.http.HttpServletResponse; | ||
| 20 | 22 | ||
| 21 | -import java.util.Collection; | ||
| 22 | -import java.util.Collections; | ||
| 23 | -import java.util.List; | ||
| 24 | - | ||
| 25 | -import com.ruoyi.domain.OrderEntity; | 23 | +import java.io.File; |
| 24 | +import java.util.*; | ||
| 26 | 25 | ||
| 27 | @Service | 26 | @Service |
| 27 | +@Slf4j | ||
| 28 | public class NewDriverServiceImpl extends ServiceImpl<NewDriverMapper, NewDriver> implements NewDriverService { | 28 | public class NewDriverServiceImpl extends ServiceImpl<NewDriverMapper, NewDriver> implements NewDriverService { |
| 29 | @Autowired | 29 | @Autowired |
| 30 | private NewDriverMapper newDriverMapper; | 30 | private NewDriverMapper newDriverMapper; |
| 31 | + @Autowired | ||
| 32 | + private BsthSystemConfig bsthSystemConfig; | ||
| 31 | 33 | ||
| 32 | /** | 34 | /** |
| 33 | * 分页查询 | 35 | * 分页查询 |
| @@ -116,26 +118,56 @@ public class NewDriverServiceImpl extends ServiceImpl<NewDriverMapper, NewDriver | @@ -116,26 +118,56 @@ public class NewDriverServiceImpl extends ServiceImpl<NewDriverMapper, NewDriver | ||
| 116 | } | 118 | } |
| 117 | 119 | ||
| 118 | @Override | 120 | @Override |
| 119 | - public boolean updateClient(NewDriver entity) { | ||
| 120 | - LambdaUpdateWrapper<NewDriver> wrapper = new LambdaUpdateWrapper<NewDriver>(); | 121 | + public TipEnum updateClient(NewDriver entity) { |
| 122 | + NewDriver driver = new NewDriver(); | ||
| 123 | + driver.setJobCode(entity.getJobCode()); | ||
| 124 | + NewDriver source = getOne(driver); | ||
| 125 | + if (Objects.isNull(source)) { | ||
| 126 | + log.info("[{}]找不到数据", entity); | ||
| 127 | + return TipEnum.TIP_404; | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + LambdaUpdateWrapper<NewDriver> wrapper = new LambdaUpdateWrapper<>(); | ||
| 121 | 131 | ||
| 122 | wrapper.set(NewDriver::getImage, entity.getImage()).set(NewDriver::getFaceFeature, entity.getFaceFeature()) | 132 | wrapper.set(NewDriver::getImage, entity.getImage()).set(NewDriver::getFaceFeature, entity.getFaceFeature()) |
| 123 | .set(NewDriver::getBlueTooth, entity.getBlueTooth()).set(NewDriver::getInteger, entity.getInteger()) | 133 | .set(NewDriver::getBlueTooth, entity.getBlueTooth()).set(NewDriver::getInteger, entity.getInteger()) |
| 124 | .set(NewDriver::getSyncontent, entity.getSyncontent()).set(NewDriver::getCsn, entity.getCsn()) | 134 | .set(NewDriver::getSyncontent, entity.getSyncontent()).set(NewDriver::getCsn, entity.getCsn()) |
| 125 | - .eq(NewDriver::getJobCode, entity.getJobCode()); | ||
| 126 | - | ||
| 127 | - return update(wrapper); | 135 | + .eq(NewDriver::getId, entity.getJobCode()); |
| 136 | + boolean flag = update(wrapper); | ||
| 137 | + return flag ? TipEnum.TIP_200 : TipEnum.TIP_500; | ||
| 128 | } | 138 | } |
| 129 | 139 | ||
| 130 | @Override | 140 | @Override |
| 131 | - public boolean faceRegister(NewDriver entity) { | 141 | + public TipEnum faceRegister(NewDriver entity) { |
| 142 | + NewDriver driver = new NewDriver(); | ||
| 143 | + driver.setIdRfid(entity.getIcCardCode()); | ||
| 144 | + NewDriver source = getOne(driver); | ||
| 145 | + if (Objects.isNull(source)) { | ||
| 146 | + log.info("[{}]找不到数据", entity); | ||
| 147 | + return TipEnum.TIP_404; | ||
| 148 | + } | ||
| 132 | LambdaUpdateWrapper<NewDriver> wrapper = new LambdaUpdateWrapper<NewDriver>(); | 149 | LambdaUpdateWrapper<NewDriver> wrapper = new LambdaUpdateWrapper<NewDriver>(); |
| 133 | - //TODO 保存图片信息 | 150 | + StringBuilder builder = new StringBuilder(bsthSystemConfig.getImageBasePath()); |
| 151 | + builder.append(File.separator); | ||
| 152 | + builder.append(source.getId()); | ||
| 153 | + builder.append(File.separator); | ||
| 154 | + builder.append("image"); | ||
| 155 | + | ||
| 156 | + ResponseResult<String> resultObj = FileUploadUtils.uploadBase64OfImage(builder.toString(), UUID.randomUUID().toString(). | ||
| 157 | + replaceAll("-", ""), "png", entity.getImage()); | ||
| 158 | + if (!resultObj.isSuccess()) { | ||
| 159 | + return TipEnum.getObjByCode(resultObj.getCode()); | ||
| 160 | + } | ||
| 161 | + | ||
| 162 | + String result = StringUtils.substringAfter(resultObj.getData(), bsthSystemConfig.getImageBasePath() + File.separator); | ||
| 163 | + entity.setImage(result); | ||
| 164 | + | ||
| 134 | wrapper.set(NewDriver::getImage, entity.getImage()) | 165 | wrapper.set(NewDriver::getImage, entity.getImage()) |
| 135 | .set(NewDriver::getFaceSignIn, entity.getFaceSignIn()) | 166 | .set(NewDriver::getFaceSignIn, entity.getFaceSignIn()) |
| 136 | .set(NewDriver::getSignInEquipment, entity.getFaceSignIn()) | 167 | .set(NewDriver::getSignInEquipment, entity.getFaceSignIn()) |
| 137 | - .eq(NewDriver::getJobCode, entity.getIcCardCode()); | ||
| 138 | - return update(wrapper); | 168 | + .eq(NewDriver::getId, source.getId()); |
| 169 | + boolean flag = update(wrapper); | ||
| 170 | + return flag ? TipEnum.TIP_200 : TipEnum.TIP_500; | ||
| 139 | } | 171 | } |
| 140 | 172 | ||
| 141 | /***根据主键删除数据*/ | 173 | /***根据主键删除数据*/ |
| @@ -280,6 +312,8 @@ public class NewDriverServiceImpl extends ServiceImpl<NewDriverMapper, NewDriver | @@ -280,6 +312,8 @@ public class NewDriverServiceImpl extends ServiceImpl<NewDriverMapper, NewDriver | ||
| 280 | if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "fleetName")) { | 312 | if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "fleetName")) { |
| 281 | wrapper.orderByDesc(NewDriver::getFleetName); | 313 | wrapper.orderByDesc(NewDriver::getFleetName); |
| 282 | } | 314 | } |
| 315 | + } else { | ||
| 316 | + wrapper.orderByDesc(NewDriver::getId); | ||
| 283 | } | 317 | } |
| 284 | } | 318 | } |
| 285 | 319 |
Bsth-admin/src/main/java/com/ruoyi/service/impl/dss/FaceServiceImpl.java
0 → 100644
| 1 | +package com.ruoyi.service.impl.dss; | ||
| 2 | + | ||
| 3 | +import com.ruoyi.domain.driver.NewDriver; | ||
| 4 | +import com.ruoyi.service.driver.NewDriverService; | ||
| 5 | +import com.ruoyi.service.dss.FaceService; | ||
| 6 | +import lombok.extern.slf4j.Slf4j; | ||
| 7 | +import org.apache.commons.collections4.CollectionUtils; | ||
| 8 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 9 | +import org.springframework.stereotype.Service; | ||
| 10 | + | ||
| 11 | +import java.util.List; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * @author liujun | ||
| 15 | + * @date 2024年07月12日 10:51 | ||
| 16 | + */ | ||
| 17 | +@Service | ||
| 18 | +@Slf4j | ||
| 19 | +public class FaceServiceImpl implements FaceService { | ||
| 20 | + @Autowired | ||
| 21 | + private NewDriverService newDriverService; | ||
| 22 | + | ||
| 23 | + @Override | ||
| 24 | + public NewDriver checkFace(NewDriver driver) { | ||
| 25 | + List<NewDriver> drivers = newDriverService.list(new NewDriver()); | ||
| 26 | + return checkFace(drivers); | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + private NewDriver checkFace(List<NewDriver> drivers) { | ||
| 30 | + if (CollectionUtils.isEmpty(drivers)) { | ||
| 31 | + return null; | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + return null; | ||
| 35 | + } | ||
| 36 | +} |
Bsth-admin/src/main/java/com/ruoyi/service/impl/dss/KeyBoxVoServiceImpl.java
| @@ -2,7 +2,7 @@ package com.ruoyi.service.impl.dss; | @@ -2,7 +2,7 @@ package com.ruoyi.service.impl.dss; | ||
| 2 | 2 | ||
| 3 | import cn.hutool.core.convert.Convert; | 3 | import cn.hutool.core.convert.Convert; |
| 4 | import com.ruoyi.common.constant.HttpStatus; | 4 | import com.ruoyi.common.constant.HttpStatus; |
| 5 | -import com.ruoyi.common.core.domain.AjaxResult; | 5 | +import com.ruoyi.common.core.domain.ResponseResult; |
| 6 | import com.ruoyi.common.utils.StringUtils; | 6 | import com.ruoyi.common.utils.StringUtils; |
| 7 | import com.ruoyi.domain.caiinfo.CarInfo; | 7 | import com.ruoyi.domain.caiinfo.CarInfo; |
| 8 | import com.ruoyi.domain.equipment.linke.log.LingangEquipmentLinkeLog; | 8 | import com.ruoyi.domain.equipment.linke.log.LingangEquipmentLinkeLog; |
| @@ -46,7 +46,7 @@ public class KeyBoxVoServiceImpl implements KeyBoxVoService { | @@ -46,7 +46,7 @@ public class KeyBoxVoServiceImpl implements KeyBoxVoService { | ||
| 46 | private LingangEquipmentLinkeLogService lingangEquipmentLinkeLogService; | 46 | private LingangEquipmentLinkeLogService lingangEquipmentLinkeLogService; |
| 47 | 47 | ||
| 48 | @Override | 48 | @Override |
| 49 | - public AjaxResult listSelect(KeyBoxQueryDTO request, LingangEquipmentLinkeLog linkeLog) { | 49 | + public ResponseResult listSelect(KeyBoxQueryDTO request, LingangEquipmentLinkeLog linkeLog) { |
| 50 | LingangScheduling lingangScheduling = queryScheduling(request); | 50 | LingangScheduling lingangScheduling = queryScheduling(request); |
| 51 | if (Objects.isNull(lingangScheduling)) { | 51 | if (Objects.isNull(lingangScheduling)) { |
| 52 | String msg = MessageFormat.format("工号[{0}]在[{1}]没有排班信息", request.getStaffCode(), request.getTime()); | 52 | String msg = MessageFormat.format("工号[{0}]在[{1}]没有排班信息", request.getStaffCode(), request.getTime()); |
| @@ -54,7 +54,7 @@ public class KeyBoxVoServiceImpl implements KeyBoxVoService { | @@ -54,7 +54,7 @@ public class KeyBoxVoServiceImpl implements KeyBoxVoService { | ||
| 54 | linkeLog.setResult(msg); | 54 | linkeLog.setResult(msg); |
| 55 | lingangEquipmentLinkeLogService.updateByPrimaryKey(linkeLog); | 55 | lingangEquipmentLinkeLogService.updateByPrimaryKey(linkeLog); |
| 56 | 56 | ||
| 57 | - return AjaxResult.error(msg); | 57 | + return ResponseResult.error(msg); |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | SignIn signIn = querySignIn(lingangScheduling.getSignInId()); | 60 | SignIn signIn = querySignIn(lingangScheduling.getSignInId()); |
| @@ -62,7 +62,7 @@ public class KeyBoxVoServiceImpl implements KeyBoxVoService { | @@ -62,7 +62,7 @@ public class KeyBoxVoServiceImpl implements KeyBoxVoService { | ||
| 62 | lingangEquipmentLinkeLogService.updateByPrimaryKey(linkeLog, MessageFormat.format("工号[{0}]在[{1}]没有签到或签退信息;[{2}]", request.getStaffCode(), request.getTime(), lingangScheduling.getSignInId()), HttpStatus.ERROR); | 62 | lingangEquipmentLinkeLogService.updateByPrimaryKey(linkeLog, MessageFormat.format("工号[{0}]在[{1}]没有签到或签退信息;[{2}]", request.getStaffCode(), request.getTime(), lingangScheduling.getSignInId()), HttpStatus.ERROR); |
| 63 | 63 | ||
| 64 | 64 | ||
| 65 | - return AjaxResult.error(MessageFormat.format("工号[{0}]在[{1}]没有签到或签退信息", request.getStaffCode(), request.getTime())); | 65 | + return ResponseResult.error(MessageFormat.format("工号[{0}]在[{1}]没有签到或签退信息", request.getStaffCode(), request.getTime())); |
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | KeyInfo keyInfo = queryKeyInfo(lingangScheduling.getKeyInfoId()); | 68 | KeyInfo keyInfo = queryKeyInfo(lingangScheduling.getKeyInfoId()); |
| @@ -70,7 +70,7 @@ public class KeyBoxVoServiceImpl implements KeyBoxVoService { | @@ -70,7 +70,7 @@ public class KeyBoxVoServiceImpl implements KeyBoxVoService { | ||
| 70 | lingangEquipmentLinkeLogService.updateByPrimaryKey(linkeLog, MessageFormat.format("工号[{0}]在[{1}]没有分配钥匙;[{2}]", request.getStaffCode(), request.getTime(), lingangScheduling.getKeyInfoId()), HttpStatus.ERROR); | 70 | lingangEquipmentLinkeLogService.updateByPrimaryKey(linkeLog, MessageFormat.format("工号[{0}]在[{1}]没有分配钥匙;[{2}]", request.getStaffCode(), request.getTime(), lingangScheduling.getKeyInfoId()), HttpStatus.ERROR); |
| 71 | 71 | ||
| 72 | 72 | ||
| 73 | - return AjaxResult.error(MessageFormat.format("工号[{0}]在[{1}]没有分配钥匙", request.getStaffCode(), request.getTime())); | 73 | + return ResponseResult.error(MessageFormat.format("工号[{0}]在[{1}]没有分配钥匙", request.getStaffCode(), request.getTime())); |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | 76 | ||
| @@ -78,7 +78,7 @@ public class KeyBoxVoServiceImpl implements KeyBoxVoService { | @@ -78,7 +78,7 @@ public class KeyBoxVoServiceImpl implements KeyBoxVoService { | ||
| 78 | if (Objects.isNull(equipment)) { | 78 | if (Objects.isNull(equipment)) { |
| 79 | lingangEquipmentLinkeLogService.updateByPrimaryKey(linkeLog, MessageFormat.format("工号[{0}]在[{1}]找不到设备信息;[{2}]", request.getStaffCode(), request.getTime(), signIn.getDeviceId()), HttpStatus.ERROR); | 79 | lingangEquipmentLinkeLogService.updateByPrimaryKey(linkeLog, MessageFormat.format("工号[{0}]在[{1}]找不到设备信息;[{2}]", request.getStaffCode(), request.getTime(), signIn.getDeviceId()), HttpStatus.ERROR); |
| 80 | 80 | ||
| 81 | - return AjaxResult.error(MessageFormat.format("工号[{0}]在[{1}]找不到设备信息", request.getStaffCode(), request.getTime())); | 81 | + return ResponseResult.error(MessageFormat.format("工号[{0}]在[{1}]找不到设备信息", request.getStaffCode(), request.getTime())); |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | CarInfo carInfo = queryCarInfo(lingangScheduling.getNbbm()); | 84 | CarInfo carInfo = queryCarInfo(lingangScheduling.getNbbm()); |
| @@ -86,7 +86,7 @@ public class KeyBoxVoServiceImpl implements KeyBoxVoService { | @@ -86,7 +86,7 @@ public class KeyBoxVoServiceImpl implements KeyBoxVoService { | ||
| 86 | lingangEquipmentLinkeLogService.updateByPrimaryKey(linkeLog, MessageFormat.format("工号[{0}]在[{1}]找不到设备信息;[{2}]", request.getStaffCode(), request.getTime(), lingangScheduling.getNbbm()), HttpStatus.ERROR); | 86 | lingangEquipmentLinkeLogService.updateByPrimaryKey(linkeLog, MessageFormat.format("工号[{0}]在[{1}]找不到设备信息;[{2}]", request.getStaffCode(), request.getTime(), lingangScheduling.getNbbm()), HttpStatus.ERROR); |
| 87 | 87 | ||
| 88 | 88 | ||
| 89 | - return AjaxResult.error(MessageFormat.format("工号[{0}]在[{1}]找不到车辆信息", request.getStaffCode(), request.getTime())); | 89 | + return ResponseResult.error(MessageFormat.format("工号[{0}]在[{1}]找不到车辆信息", request.getStaffCode(), request.getTime())); |
| 90 | } | 90 | } |
| 91 | KeyBoxVo keyBoxVo = new KeyBoxVo(); | 91 | KeyBoxVo keyBoxVo = new KeyBoxVo(); |
| 92 | keyBoxVo.setCabinetNo(Convert.toStr(keyInfo.getCabinetno())); | 92 | keyBoxVo.setCabinetNo(Convert.toStr(keyInfo.getCabinetno())); |
| @@ -98,7 +98,7 @@ public class KeyBoxVoServiceImpl implements KeyBoxVoService { | @@ -98,7 +98,7 @@ public class KeyBoxVoServiceImpl implements KeyBoxVoService { | ||
| 98 | keyBoxVo.setParkingNo(carInfo.getParkingNo()); | 98 | keyBoxVo.setParkingNo(carInfo.getParkingNo()); |
| 99 | 99 | ||
| 100 | lingangEquipmentLinkeLogService.updateByPrimaryKey(linkeLog, null, HttpStatus.SUCCESS); | 100 | lingangEquipmentLinkeLogService.updateByPrimaryKey(linkeLog, null, HttpStatus.SUCCESS); |
| 101 | - return AjaxResult.success(keyBoxVo); | 101 | + return ResponseResult.success(keyBoxVo); |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | 104 |
Bsth-admin/src/main/java/com/ruoyi/service/impl/equipment/heartbeat/LingangEquipmentHeartbeatServiceImpl.java
| 1 | package com.ruoyi.service.impl.equipment.heartbeat; | 1 | package com.ruoyi.service.impl.equipment.heartbeat; |
| 2 | 2 | ||
| 3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
| 4 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 5 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 6 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
| 7 | +import com.github.pagehelper.PageHelper; | ||
| 8 | +import com.ruoyi.domain.OrderEntity; | ||
| 3 | import com.ruoyi.domain.equipment.heartbeat.LingangEquipmentHeartbeat; | 9 | import com.ruoyi.domain.equipment.heartbeat.LingangEquipmentHeartbeat; |
| 4 | import com.ruoyi.mapper.equipment.heartbeat.LingangEquipmentHeartbeatMapper; | 10 | import com.ruoyi.mapper.equipment.heartbeat.LingangEquipmentHeartbeatMapper; |
| 5 | import com.ruoyi.service.equipment.heartbeat.LingangEquipmentHeartbeatService; | 11 | import com.ruoyi.service.equipment.heartbeat.LingangEquipmentHeartbeatService; |
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | import org.springframework.stereotype.Service; | 13 | 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 | 14 | ||
| 16 | import java.util.Collections; | 15 | import java.util.Collections; |
| 17 | import java.util.List; | 16 | import java.util.List; |
| 18 | 17 | ||
| 19 | -import com.ruoyi.domain.OrderEntity; | ||
| 20 | - | ||
| 21 | @Service | 18 | @Service |
| 22 | /**设备心跳包 Service实现类*/ | 19 | /**设备心跳包 Service实现类*/ |
| 23 | public class LingangEquipmentHeartbeatServiceImpl extends ServiceImpl<LingangEquipmentHeartbeatMapper, LingangEquipmentHeartbeat> implements LingangEquipmentHeartbeatService { | 20 | public class LingangEquipmentHeartbeatServiceImpl extends ServiceImpl<LingangEquipmentHeartbeatMapper, LingangEquipmentHeartbeat> implements LingangEquipmentHeartbeatService { |
| @@ -157,6 +154,8 @@ public class LingangEquipmentHeartbeatServiceImpl extends ServiceImpl<LingangEqu | @@ -157,6 +154,8 @@ public class LingangEquipmentHeartbeatServiceImpl extends ServiceImpl<LingangEqu | ||
| 157 | if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "updateby")) { | 154 | if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "updateby")) { |
| 158 | wrapper.orderByDesc(LingangEquipmentHeartbeat::getUpdateby); | 155 | wrapper.orderByDesc(LingangEquipmentHeartbeat::getUpdateby); |
| 159 | } | 156 | } |
| 157 | + }else{ | ||
| 158 | + wrapper.orderByDesc(LingangEquipmentHeartbeat::getCreateTime); | ||
| 160 | } | 159 | } |
| 161 | } | 160 | } |
| 162 | } | 161 | } |
| 163 | \ No newline at end of file | 162 | \ No newline at end of file |
Bsth-admin/src/main/java/com/ruoyi/service/impl/equipment/linke/log/LingangEquipmentLinkeLogServiceImpl.java
| 1 | package com.ruoyi.service.impl.equipment.linke.log; | 1 | package com.ruoyi.service.impl.equipment.linke.log; |
| 2 | 2 | ||
| 3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
| 4 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 5 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 6 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
| 7 | +import com.github.pagehelper.PageHelper; | ||
| 8 | +import com.ruoyi.domain.OrderEntity; | ||
| 3 | import com.ruoyi.domain.equipment.linke.log.LingangEquipmentLinkeLog; | 9 | import com.ruoyi.domain.equipment.linke.log.LingangEquipmentLinkeLog; |
| 4 | import com.ruoyi.mapper.equipment.linke.log.LingangEquipmentLinkeLogMapper; | 10 | import com.ruoyi.mapper.equipment.linke.log.LingangEquipmentLinkeLogMapper; |
| 5 | import com.ruoyi.service.equipment.linke.log.LingangEquipmentLinkeLogService; | 11 | import com.ruoyi.service.equipment.linke.log.LingangEquipmentLinkeLogService; |
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | import org.springframework.stereotype.Service; | 13 | 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 | 14 | ||
| 16 | import java.util.Collections; | 15 | import java.util.Collections; |
| 17 | import java.util.Date; | 16 | import java.util.Date; |
| 18 | import java.util.List; | 17 | import java.util.List; |
| 19 | 18 | ||
| 20 | -import com.ruoyi.domain.OrderEntity; | ||
| 21 | - | ||
| 22 | @Service | 19 | @Service |
| 23 | /**设备链接日志 Service实现类*/ | 20 | /**设备链接日志 Service实现类*/ |
| 24 | public class LingangEquipmentLinkeLogServiceImpl extends ServiceImpl<LingangEquipmentLinkeLogMapper, LingangEquipmentLinkeLog> implements LingangEquipmentLinkeLogService { | 21 | public class LingangEquipmentLinkeLogServiceImpl extends ServiceImpl<LingangEquipmentLinkeLogMapper, LingangEquipmentLinkeLog> implements LingangEquipmentLinkeLogService { |
| @@ -138,6 +135,8 @@ public class LingangEquipmentLinkeLogServiceImpl extends ServiceImpl<LingangEqui | @@ -138,6 +135,8 @@ public class LingangEquipmentLinkeLogServiceImpl extends ServiceImpl<LingangEqui | ||
| 138 | if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "createTime")) { | 135 | if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "createTime")) { |
| 139 | wrapper.orderByDesc(LingangEquipmentLinkeLog::getCreateTime); | 136 | wrapper.orderByDesc(LingangEquipmentLinkeLog::getCreateTime); |
| 140 | } | 137 | } |
| 138 | + }else{ | ||
| 139 | + wrapper.orderByDesc(LingangEquipmentLinkeLog::getCreateTime); | ||
| 141 | } | 140 | } |
| 142 | } | 141 | } |
| 143 | } | 142 | } |
| 144 | \ No newline at end of file | 143 | \ No newline at end of file |
Bsth-admin/src/main/java/com/ruoyi/service/impl/equipment/self/check/LingangEquimentSelfCheckServiceImpl.java
| 1 | package com.ruoyi.service.impl.equipment.self.check; | 1 | package com.ruoyi.service.impl.equipment.self.check; |
| 2 | 2 | ||
| 3 | -import com.ruoyi.common.utils.StringUtils; | 3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| 4 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 5 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 6 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
| 7 | +import com.github.pagehelper.PageHelper; | ||
| 8 | +import com.ruoyi.domain.OrderEntity; | ||
| 4 | import com.ruoyi.domain.equipment.self.check.LingangEquimentSelfCheck; | 9 | import com.ruoyi.domain.equipment.self.check.LingangEquimentSelfCheck; |
| 5 | import com.ruoyi.eexception.domain.EquipmentException; | 10 | import com.ruoyi.eexception.domain.EquipmentException; |
| 6 | import com.ruoyi.eexception.service.IEquipmentExceptionService; | 11 | import com.ruoyi.eexception.service.IEquipmentExceptionService; |
| 7 | import com.ruoyi.mapper.equipment.self.check.LingangEquimentSelfCheckMapper; | 12 | import com.ruoyi.mapper.equipment.self.check.LingangEquimentSelfCheckMapper; |
| 8 | import com.ruoyi.service.equipment.self.check.LingangEquimentSelfCheckService; | 13 | import com.ruoyi.service.equipment.self.check.LingangEquimentSelfCheckService; |
| 9 | -import org.apache.commons.collections4.CollectionUtils; | ||
| 10 | import org.springframework.beans.factory.annotation.Autowired; | 14 | import org.springframework.beans.factory.annotation.Autowired; |
| 11 | import org.springframework.stereotype.Service; | 15 | import org.springframework.stereotype.Service; |
| 12 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
| 13 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
| 14 | -import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 15 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 16 | - | ||
| 17 | -import com.github.pagehelper.PageHelper; | ||
| 18 | 16 | ||
| 19 | import java.util.Collections; | 17 | import java.util.Collections; |
| 20 | import java.util.Date; | 18 | import java.util.Date; |
| 21 | import java.util.List; | 19 | import java.util.List; |
| 22 | import java.util.Objects; | 20 | import java.util.Objects; |
| 23 | 21 | ||
| 24 | -import com.ruoyi.domain.OrderEntity; | ||
| 25 | - | ||
| 26 | @Service | 22 | @Service |
| 27 | /**设备自检 Service实现类*/ | 23 | /**设备自检 Service实现类*/ |
| 28 | public class LingangEquimentSelfCheckServiceImpl extends ServiceImpl<LingangEquimentSelfCheckMapper, LingangEquimentSelfCheck> implements LingangEquimentSelfCheckService { | 24 | public class LingangEquimentSelfCheckServiceImpl extends ServiceImpl<LingangEquimentSelfCheckMapper, LingangEquimentSelfCheck> implements LingangEquimentSelfCheckService { |
| @@ -190,6 +186,8 @@ public class LingangEquimentSelfCheckServiceImpl extends ServiceImpl<LingangEqui | @@ -190,6 +186,8 @@ public class LingangEquimentSelfCheckServiceImpl extends ServiceImpl<LingangEqui | ||
| 190 | if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "iskeybox")) { | 186 | if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "iskeybox")) { |
| 191 | wrapper.orderByDesc(LingangEquimentSelfCheck::getIskeybox); | 187 | wrapper.orderByDesc(LingangEquimentSelfCheck::getIskeybox); |
| 192 | } | 188 | } |
| 189 | + }else{ | ||
| 190 | + wrapper.orderByDesc(LingangEquimentSelfCheck::getId); | ||
| 193 | } | 191 | } |
| 194 | } | 192 | } |
| 195 | 193 |
Bsth-admin/src/main/java/com/ruoyi/service/impl/keyinfo/KeyInfoServiceImpl.java
| 1 | package com.ruoyi.service.impl.keyinfo; | 1 | package com.ruoyi.service.impl.keyinfo; |
| 2 | 2 | ||
| 3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
| 4 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 5 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 6 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
| 7 | +import com.github.pagehelper.PageHelper; | ||
| 3 | import com.ruoyi.domain.OrderEntity; | 8 | import com.ruoyi.domain.OrderEntity; |
| 4 | import com.ruoyi.domain.keyInfo.KeyInfo; | 9 | import com.ruoyi.domain.keyInfo.KeyInfo; |
| 5 | import com.ruoyi.service.keyinfo.KeyInfoService; | 10 | import com.ruoyi.service.keyinfo.KeyInfoService; |
| 6 | import org.apache.commons.lang3.StringUtils; | 11 | import org.apache.commons.lang3.StringUtils; |
| 7 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | import org.springframework.stereotype.Service; | 13 | import org.springframework.stereotype.Service; |
| 9 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
| 10 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
| 11 | -import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 12 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 13 | - | ||
| 14 | -import com.github.pagehelper.PageHelper; | ||
| 15 | - | ||
| 16 | -import javax.servlet.http.HttpServletResponse; | ||
| 17 | 14 | ||
| 18 | import java.util.Collections; | 15 | import java.util.Collections; |
| 19 | import java.util.List; | 16 | import java.util.List; |
| @@ -178,6 +175,8 @@ public class KeyInfoServiceImpl extends ServiceImpl<com.ruoyi.mapper.keyinfo.Key | @@ -178,6 +175,8 @@ public class KeyInfoServiceImpl extends ServiceImpl<com.ruoyi.mapper.keyinfo.Key | ||
| 178 | if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "plateNum")) { | 175 | if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "plateNum")) { |
| 179 | wrapper.orderByDesc(KeyInfo::getPlateNum); | 176 | wrapper.orderByDesc(KeyInfo::getPlateNum); |
| 180 | } | 177 | } |
| 178 | + }else{ | ||
| 179 | + wrapper.orderByDesc(KeyInfo::getCreateTime); | ||
| 181 | } | 180 | } |
| 182 | 181 | ||
| 183 | } | 182 | } |
Bsth-admin/src/main/java/com/ruoyi/service/impl/lin/gang/LingangSchedulingServiceImpl.java
| 1 | package com.ruoyi.service.impl.lin.gang; | 1 | package com.ruoyi.service.impl.lin.gang; |
| 2 | 2 | ||
| 3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
| 4 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 5 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 6 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
| 7 | +import com.github.pagehelper.PageHelper; | ||
| 8 | +import com.ruoyi.domain.OrderEntity; | ||
| 3 | import com.ruoyi.domain.lin.gang.LingangScheduling; | 9 | import com.ruoyi.domain.lin.gang.LingangScheduling; |
| 4 | import com.ruoyi.mapper.lin.gang.LingangSchedulingMapper; | 10 | import com.ruoyi.mapper.lin.gang.LingangSchedulingMapper; |
| 5 | import com.ruoyi.service.lin.gang.LingangSchedulingService; | 11 | import com.ruoyi.service.lin.gang.LingangSchedulingService; |
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | import org.springframework.stereotype.Service; | 13 | 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 | 14 | ||
| 15 | -import javax.servlet.http.HttpServletResponse; | ||
| 16 | - | ||
| 17 | -import java.util.Collection; | ||
| 18 | import java.util.Collections; | 15 | import java.util.Collections; |
| 19 | import java.util.List; | 16 | import java.util.List; |
| 20 | 17 | ||
| 21 | -import com.ruoyi.domain.OrderEntity; | ||
| 22 | - | ||
| 23 | @Service | 18 | @Service |
| 24 | /** Service实现类*/ | 19 | /** Service实现类*/ |
| 25 | public class LingangSchedulingServiceImpl extends ServiceImpl<LingangSchedulingMapper, LingangScheduling> implements LingangSchedulingService { | 20 | public class LingangSchedulingServiceImpl extends ServiceImpl<LingangSchedulingMapper, LingangScheduling> implements LingangSchedulingService { |
| @@ -214,6 +209,8 @@ public class LingangSchedulingServiceImpl extends ServiceImpl<LingangSchedulingM | @@ -214,6 +209,8 @@ public class LingangSchedulingServiceImpl extends ServiceImpl<LingangSchedulingM | ||
| 214 | if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "remark")) { | 209 | if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "remark")) { |
| 215 | wrapper.orderByDesc(LingangScheduling::getRemark); | 210 | wrapper.orderByDesc(LingangScheduling::getRemark); |
| 216 | } | 211 | } |
| 212 | + }else{ | ||
| 213 | + wrapper.orderByDesc(LingangScheduling::getId); | ||
| 217 | } | 214 | } |
| 218 | } | 215 | } |
| 219 | } | 216 | } |
| 220 | \ No newline at end of file | 217 | \ No newline at end of file |
Bsth-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java
| 1 | package com.ruoyi.web.core.config; | 1 | package com.ruoyi.web.core.config; |
| 2 | 2 | ||
| 3 | -import java.util.ArrayList; | ||
| 4 | -import java.util.List; | ||
| 5 | - | ||
| 6 | -import io.swagger.annotations.Api; | 3 | +import cn.hutool.core.convert.Convert; |
| 4 | +import com.ruoyi.common.TipEnum; | ||
| 5 | +import com.ruoyi.common.config.RuoYiConfig; | ||
| 6 | +import io.swagger.annotations.ApiOperation; | ||
| 7 | +import io.swagger.models.auth.In; | ||
| 7 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | import org.springframework.beans.factory.annotation.Value; | 9 | import org.springframework.beans.factory.annotation.Value; |
| 9 | -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
| 10 | import org.springframework.context.annotation.Bean; | 10 | import org.springframework.context.annotation.Bean; |
| 11 | import org.springframework.context.annotation.Configuration; | 11 | import org.springframework.context.annotation.Configuration; |
| 12 | -import com.ruoyi.common.config.RuoYiConfig; | ||
| 13 | -import io.swagger.annotations.ApiOperation; | ||
| 14 | -import io.swagger.models.auth.In; | ||
| 15 | import springfox.documentation.builders.ApiInfoBuilder; | 12 | import springfox.documentation.builders.ApiInfoBuilder; |
| 16 | import springfox.documentation.builders.PathSelectors; | 13 | import springfox.documentation.builders.PathSelectors; |
| 17 | import springfox.documentation.builders.RequestHandlerSelectors; | 14 | import springfox.documentation.builders.RequestHandlerSelectors; |
| 18 | -import springfox.documentation.service.ApiInfo; | ||
| 19 | -import springfox.documentation.service.ApiKey; | ||
| 20 | -import springfox.documentation.service.AuthorizationScope; | ||
| 21 | -import springfox.documentation.service.Contact; | ||
| 22 | -import springfox.documentation.service.SecurityReference; | ||
| 23 | -import springfox.documentation.service.SecurityScheme; | 15 | +import springfox.documentation.builders.ResponseBuilder; |
| 16 | +import springfox.documentation.service.*; | ||
| 24 | import springfox.documentation.spi.DocumentationType; | 17 | import springfox.documentation.spi.DocumentationType; |
| 25 | import springfox.documentation.spi.service.contexts.SecurityContext; | 18 | import springfox.documentation.spi.service.contexts.SecurityContext; |
| 26 | import springfox.documentation.spring.web.plugins.Docket; | 19 | import springfox.documentation.spring.web.plugins.Docket; |
| 27 | 20 | ||
| 21 | +import java.util.ArrayList; | ||
| 22 | +import java.util.Arrays; | ||
| 23 | +import java.util.List; | ||
| 24 | +import java.util.stream.Collectors; | ||
| 25 | + | ||
| 28 | /** | 26 | /** |
| 29 | * Swagger2的接口配置 | 27 | * Swagger2的接口配置 |
| 30 | * | 28 | * |
| @@ -51,7 +49,10 @@ public class SwaggerConfig | @@ -51,7 +49,10 @@ public class SwaggerConfig | ||
| 51 | @Bean | 49 | @Bean |
| 52 | public Docket createRestApi() | 50 | public Docket createRestApi() |
| 53 | { | 51 | { |
| 52 | + List<Response> tips= Arrays.stream(TipEnum.values()).map(err-> new ResponseBuilder().code(Convert.toStr(err.getCode())).description(err.getMsg()).build()).collect(Collectors.toList()); | ||
| 54 | return new Docket(DocumentationType.OAS_30) | 53 | return new Docket(DocumentationType.OAS_30) |
| 54 | + .globalResponses(org.springframework.http.HttpMethod.GET,tips) | ||
| 55 | + .globalResponses(org.springframework.http.HttpMethod.POST,tips) | ||
| 55 | // 是否启用Swagger | 56 | // 是否启用Swagger |
| 56 | .enable(enabled) | 57 | .enable(enabled) |
| 57 | // 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息) | 58 | // 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息) |
Bsth-admin/src/main/resources/application-druid-dev.yml
| @@ -194,4 +194,8 @@ netty: | @@ -194,4 +194,8 @@ netty: | ||
| 194 | catalogue: | 194 | catalogue: |
| 195 | image: device/image | 195 | image: device/image |
| 196 | speech: device/speech | 196 | speech: device/speech |
| 197 | - port: 8989 | ||
| 198 | \ No newline at end of file | 197 | \ No newline at end of file |
| 198 | + port: 8989 | ||
| 199 | +bsth: | ||
| 200 | + upload: | ||
| 201 | + image: | ||
| 202 | + basePath: D:/temp/temp/bsth/upload | ||
| 199 | \ No newline at end of file | 203 | \ No newline at end of file |
Bsth-admin/src/main/resources/i18n/messages.properties
| @@ -20,6 +20,7 @@ user.password.not.valid=* 5-50个字符 | @@ -20,6 +20,7 @@ user.password.not.valid=* 5-50个字符 | ||
| 20 | user.email.not.valid=邮箱格式错误 | 20 | user.email.not.valid=邮箱格式错误 |
| 21 | user.mobile.phone.number.not.valid=手机号格式错误 | 21 | user.mobile.phone.number.not.valid=手机号格式错误 |
| 22 | user.login.success=登录成功 | 22 | user.login.success=登录成功 |
| 23 | +equipment.login.success=登录成功 | ||
| 23 | user.register.success=注册成功 | 24 | user.register.success=注册成功 |
| 24 | user.notfound=请重新登录 | 25 | user.notfound=请重新登录 |
| 25 | user.forcelogout=管理员强制退出,请重新登录 | 26 | user.forcelogout=管理员强制退出,请重新登录 |
Bsth-admin/src/main/resources/mapper/driver/NewDriverMapper.xml
| @@ -2,8 +2,8 @@ | @@ -2,8 +2,8 @@ | ||
| 2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| 3 | <mapper namespace="com.ruoyi.mapper.driver.NewDriverMapper"> | 3 | <mapper namespace="com.ruoyi.mapper.driver.NewDriverMapper"> |
| 4 | <resultMap id="BaseResultMap" type="com.ruoyi.domain.driver.NewDriver"> | 4 | <resultMap id="BaseResultMap" type="com.ruoyi.domain.driver.NewDriver"> |
| 5 | - <result column="id" jdbcType="INTEGER" property="id"/> | ||
| 6 | - <id column="job_code" jdbcType="VARCHAR" property="jobCode"/> | 5 | + <id column="id" jdbcType="INTEGER" property="id"/> |
| 6 | + <result column="job_code" jdbcType="VARCHAR" property="jobCode"/> | ||
| 7 | <result column="company_code" jdbcType="VARCHAR" property="companyCode"/> | 7 | <result column="company_code" jdbcType="VARCHAR" property="companyCode"/> |
| 8 | <result column="branche_company_code" jdbcType="VARCHAR" property="brancheCompanyCode"/> | 8 | <result column="branche_company_code" jdbcType="VARCHAR" property="brancheCompanyCode"/> |
| 9 | <result column="personnel_name" jdbcType="VARCHAR" property="personnelName"/> | 9 | <result column="personnel_name" jdbcType="VARCHAR" property="personnelName"/> |
Bsth-admin/src/main/resources/mapper/equipment/LingangEquimentSelfCheckMapper.xml
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | <result column="device" jdbcType="VARCHAR" property="device"/> | 6 | <result column="device" jdbcType="VARCHAR" property="device"/> |
| 7 | <result column="app_version" jdbcType="VARCHAR" property="appVersion"/> | 7 | <result column="app_version" jdbcType="VARCHAR" property="appVersion"/> |
| 8 | <result column="wine" jdbcType="INTEGER" property="wine"/> | 8 | <result column="wine" jdbcType="INTEGER" property="wine"/> |
| 9 | - <result column="cameras" jdbcType="JSON" property="cameras"/> | 9 | + <result column="cameras" jdbcType="VARCHAR" property="cameras"/> |
| 10 | <result column="therm" jdbcType="INTEGER" property="therm"/> | 10 | <result column="therm" jdbcType="INTEGER" property="therm"/> |
| 11 | <result column="horn" jdbcType="INTEGER" property="horn"/> | 11 | <result column="horn" jdbcType="INTEGER" property="horn"/> |
| 12 | <result column="mike" jdbcType="INTEGER" property="mike"/> | 12 | <result column="mike" jdbcType="INTEGER" property="mike"/> |
Bsth-common/pom.xml
| @@ -148,6 +148,12 @@ | @@ -148,6 +148,12 @@ | ||
| 148 | <groupId>javax.servlet</groupId> | 148 | <groupId>javax.servlet</groupId> |
| 149 | <artifactId>javax.servlet-api</artifactId> | 149 | <artifactId>javax.servlet-api</artifactId> |
| 150 | </dependency> | 150 | </dependency> |
| 151 | + <dependency> | ||
| 152 | + <groupId>com.baomidou</groupId> | ||
| 153 | + <artifactId>mybatis-plus-annotation</artifactId> | ||
| 154 | + <version>3.4.1</version> | ||
| 155 | + <scope>compile</scope> | ||
| 156 | + </dependency> | ||
| 151 | 157 | ||
| 152 | </dependencies> | 158 | </dependencies> |
| 153 | 159 |
Bsth-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java
| 1 | package com.ruoyi.common.core.domain; | 1 | package com.ruoyi.common.core.domain; |
| 2 | 2 | ||
| 3 | +import com.baomidou.mybatisplus.annotation.TableField; | ||
| 4 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 5 | +import com.fasterxml.jackson.annotation.JsonIgnore; | ||
| 6 | +import com.fasterxml.jackson.annotation.JsonInclude; | ||
| 7 | + | ||
| 3 | import java.io.Serializable; | 8 | import java.io.Serializable; |
| 4 | import java.util.Date; | 9 | import java.util.Date; |
| 5 | import java.util.HashMap; | 10 | import java.util.HashMap; |
| 6 | import java.util.Map; | 11 | import java.util.Map; |
| 7 | -import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 8 | -import com.fasterxml.jackson.annotation.JsonIgnore; | ||
| 9 | -import com.fasterxml.jackson.annotation.JsonInclude; | ||
| 10 | 12 | ||
| 11 | /** | 13 | /** |
| 12 | * Entity基类 | 14 | * Entity基类 |
| @@ -19,6 +21,7 @@ public class BaseEntity implements Serializable | @@ -19,6 +21,7 @@ public class BaseEntity implements Serializable | ||
| 19 | 21 | ||
| 20 | /** 搜索值 */ | 22 | /** 搜索值 */ |
| 21 | @JsonIgnore | 23 | @JsonIgnore |
| 24 | + @TableField(exist = false) | ||
| 22 | private String searchValue; | 25 | private String searchValue; |
| 23 | 26 | ||
| 24 | /** 创建者 */ | 27 | /** 创建者 */ |
| @@ -36,10 +39,12 @@ public class BaseEntity implements Serializable | @@ -36,10 +39,12 @@ public class BaseEntity implements Serializable | ||
| 36 | private Date updateTime; | 39 | private Date updateTime; |
| 37 | 40 | ||
| 38 | /** 备注 */ | 41 | /** 备注 */ |
| 42 | + @TableField(exist = false) | ||
| 39 | private String remark; | 43 | private String remark; |
| 40 | 44 | ||
| 41 | /** 请求参数 */ | 45 | /** 请求参数 */ |
| 42 | @JsonInclude(JsonInclude.Include.NON_EMPTY) | 46 | @JsonInclude(JsonInclude.Include.NON_EMPTY) |
| 47 | + @TableField(exist = false) | ||
| 43 | private Map<String, Object> params; | 48 | private Map<String, Object> params; |
| 44 | 49 | ||
| 45 | public String getSearchValue() | 50 | public String getSearchValue() |
Bsth-common/src/main/java/com/ruoyi/common/core/domain/ResponseResult.java
0 → 100644
| 1 | +package com.ruoyi.common.core.domain; | ||
| 2 | + | ||
| 3 | +import com.ruoyi.common.constant.HttpStatus; | ||
| 4 | + | ||
| 5 | +import java.util.Objects; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * @author liujun | ||
| 9 | + * @date 2024年07月12日 11:33 | ||
| 10 | + */ | ||
| 11 | +public class ResponseResult <T>{ | ||
| 12 | + private int code= 500; | ||
| 13 | + private String msg; | ||
| 14 | + private T data; | ||
| 15 | + | ||
| 16 | + public int getCode() { | ||
| 17 | + return code; | ||
| 18 | + } | ||
| 19 | + | ||
| 20 | + public void setCode(int code) { | ||
| 21 | + this.code = code; | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + public String getMsg() { | ||
| 25 | + return msg; | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + public void setMsg(String msg) { | ||
| 29 | + this.msg = msg; | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + public T getData() { | ||
| 33 | + return data; | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + public void setData(T data) { | ||
| 37 | + this.data = data; | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + public ResponseResult() | ||
| 41 | + { | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + /** | ||
| 45 | + * 初始化一个新创建的 AjaxResult 对象 | ||
| 46 | + * | ||
| 47 | + * @param code 状态码 | ||
| 48 | + * @param msg 返回内容 | ||
| 49 | + */ | ||
| 50 | + public ResponseResult(int code, String msg) | ||
| 51 | + { | ||
| 52 | + this.code = code; | ||
| 53 | + this.msg = msg; | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + /** | ||
| 57 | + * 初始化一个新创建的 AjaxResult 对象 | ||
| 58 | + * | ||
| 59 | + * @param code 状态码 | ||
| 60 | + */ | ||
| 61 | + public ResponseResult(int code) | ||
| 62 | + { | ||
| 63 | + this.code = code; | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + /** | ||
| 67 | + * 初始化一个新创建的 AjaxResult 对象 | ||
| 68 | + * | ||
| 69 | + * @param code 状态码 | ||
| 70 | + * @param msg 返回内容 | ||
| 71 | + * @param data 数据对象 | ||
| 72 | + */ | ||
| 73 | + public ResponseResult(int code, String msg, T data) | ||
| 74 | + { | ||
| 75 | + this.code = code; | ||
| 76 | + this.msg = msg; | ||
| 77 | + this.data= data; | ||
| 78 | + | ||
| 79 | + } | ||
| 80 | + | ||
| 81 | + /** | ||
| 82 | + * 返回成功消息 | ||
| 83 | + * | ||
| 84 | + * @return 成功消息 | ||
| 85 | + */ | ||
| 86 | + public static <T>ResponseResult<T> success() | ||
| 87 | + { | ||
| 88 | + return ResponseResult.success("操作成功"); | ||
| 89 | + } | ||
| 90 | + | ||
| 91 | + /** | ||
| 92 | + * 返回成功数据 | ||
| 93 | + * | ||
| 94 | + * @return 成功消息 | ||
| 95 | + */ | ||
| 96 | + public static <T>ResponseResult<T> success(T data) | ||
| 97 | + { | ||
| 98 | + return ResponseResult.success("操作成功", data); | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + /** | ||
| 102 | + * 返回成功消息 | ||
| 103 | + * | ||
| 104 | + * @param msg 返回内容 | ||
| 105 | + * @return 成功消息 | ||
| 106 | + */ | ||
| 107 | + public static <T>ResponseResult<T> success(String msg) | ||
| 108 | + { | ||
| 109 | + return ResponseResult.success(msg, null); | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + /** | ||
| 113 | + * 返回成功消息 | ||
| 114 | + * | ||
| 115 | + * @param msg 返回内容 | ||
| 116 | + * @param data 数据对象 | ||
| 117 | + * @return 成功消息 | ||
| 118 | + */ | ||
| 119 | + public static <T>ResponseResult<T> success(String msg, T data) | ||
| 120 | + { | ||
| 121 | + return new ResponseResult(HttpStatus.SUCCESS, msg, data); | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + /** | ||
| 125 | + * 返回警告消息 | ||
| 126 | + * | ||
| 127 | + * @param msg 返回内容 | ||
| 128 | + * @return 警告消息 | ||
| 129 | + */ | ||
| 130 | + public static <T>ResponseResult<T> warn(String msg) | ||
| 131 | + { | ||
| 132 | + return ResponseResult.warn(msg, null); | ||
| 133 | + } | ||
| 134 | + | ||
| 135 | + /** | ||
| 136 | + * 返回警告消息 | ||
| 137 | + * | ||
| 138 | + * @param msg 返回内容 | ||
| 139 | + * @param data 数据对象 | ||
| 140 | + * @return 警告消息 | ||
| 141 | + */ | ||
| 142 | + public static <T>ResponseResult<T> warn(String msg, Object data) | ||
| 143 | + { | ||
| 144 | + return new ResponseResult(HttpStatus.WARN, msg, data); | ||
| 145 | + } | ||
| 146 | + | ||
| 147 | + /** | ||
| 148 | + * 返回错误消息 | ||
| 149 | + * | ||
| 150 | + * @return 错误消息 | ||
| 151 | + */ | ||
| 152 | + public static <T>ResponseResult<T> error() | ||
| 153 | + { | ||
| 154 | + return ResponseResult.error("操作失败"); | ||
| 155 | + } | ||
| 156 | + | ||
| 157 | + /** | ||
| 158 | + * 返回错误消息 | ||
| 159 | + * | ||
| 160 | + * @param msg 返回内容 | ||
| 161 | + * @return 错误消息 | ||
| 162 | + */ | ||
| 163 | + public static <T>ResponseResult<T> error(String msg) | ||
| 164 | + { | ||
| 165 | + return ResponseResult.error(msg, null); | ||
| 166 | + } | ||
| 167 | + | ||
| 168 | + /** | ||
| 169 | + * 返回错误消息 | ||
| 170 | + * | ||
| 171 | + * @param msg 返回内容 | ||
| 172 | + * @param data 数据对象 | ||
| 173 | + * @return 错误消息 | ||
| 174 | + */ | ||
| 175 | + public static <T>ResponseResult<T> error(String msg, Object data) | ||
| 176 | + { | ||
| 177 | + return new ResponseResult(HttpStatus.ERROR, msg, data); | ||
| 178 | + } | ||
| 179 | + | ||
| 180 | + /** | ||
| 181 | + * 返回错误消息 | ||
| 182 | + * | ||
| 183 | + * @param code 状态码 | ||
| 184 | + * @param msg 返回内容 | ||
| 185 | + * @return 错误消息 | ||
| 186 | + */ | ||
| 187 | + public static <T>ResponseResult<T> error(int code, String msg) | ||
| 188 | + { | ||
| 189 | + return new ResponseResult(code, msg, null); | ||
| 190 | + } | ||
| 191 | + | ||
| 192 | + /** | ||
| 193 | + * 是否为成功消息 | ||
| 194 | + * | ||
| 195 | + * @return 结果 | ||
| 196 | + */ | ||
| 197 | + public boolean isSuccess() | ||
| 198 | + { | ||
| 199 | + return Objects.equals(HttpStatus.SUCCESS, this.getCode()); | ||
| 200 | + } | ||
| 201 | + | ||
| 202 | + /** | ||
| 203 | + * 是否为警告消息 | ||
| 204 | + * | ||
| 205 | + * @return 结果 | ||
| 206 | + */ | ||
| 207 | + public boolean isWarn() | ||
| 208 | + { | ||
| 209 | + return Objects.equals(HttpStatus.WARN,this.getCode()); | ||
| 210 | + } | ||
| 211 | + | ||
| 212 | + /** | ||
| 213 | + * 是否为错误消息 | ||
| 214 | + * | ||
| 215 | + * @return 结果 | ||
| 216 | + */ | ||
| 217 | + public boolean isError() | ||
| 218 | + { | ||
| 219 | + return Objects.equals(HttpStatus.ERROR,this.getCode()); | ||
| 220 | + } | ||
| 221 | + | ||
| 222 | + | ||
| 223 | + | ||
| 224 | +} |
Bsth-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java
| 1 | package com.ruoyi.common.utils.file; | 1 | package com.ruoyi.common.utils.file; |
| 2 | 2 | ||
| 3 | -import java.io.File; | ||
| 4 | -import java.io.IOException; | ||
| 5 | -import java.nio.file.Paths; | ||
| 6 | -import java.util.Objects; | ||
| 7 | -import org.apache.commons.io.FilenameUtils; | ||
| 8 | -import org.springframework.web.multipart.MultipartFile; | ||
| 9 | import com.ruoyi.common.config.RuoYiConfig; | 3 | import com.ruoyi.common.config.RuoYiConfig; |
| 10 | import com.ruoyi.common.constant.Constants; | 4 | import com.ruoyi.common.constant.Constants; |
| 5 | +import com.ruoyi.common.core.domain.ResponseResult; | ||
| 11 | import com.ruoyi.common.exception.file.FileNameLengthLimitExceededException; | 6 | import com.ruoyi.common.exception.file.FileNameLengthLimitExceededException; |
| 12 | import com.ruoyi.common.exception.file.FileSizeLimitExceededException; | 7 | import com.ruoyi.common.exception.file.FileSizeLimitExceededException; |
| 13 | import com.ruoyi.common.exception.file.InvalidExtensionException; | 8 | import com.ruoyi.common.exception.file.InvalidExtensionException; |
| 14 | import com.ruoyi.common.utils.DateUtils; | 9 | import com.ruoyi.common.utils.DateUtils; |
| 15 | import com.ruoyi.common.utils.StringUtils; | 10 | import com.ruoyi.common.utils.StringUtils; |
| 11 | +import com.ruoyi.common.utils.sign.Base64; | ||
| 16 | import com.ruoyi.common.utils.uuid.Seq; | 12 | import com.ruoyi.common.utils.uuid.Seq; |
| 13 | +import org.apache.commons.io.FileUtils; | ||
| 14 | +import org.apache.commons.io.FilenameUtils; | ||
| 15 | +import org.apache.commons.io.IOUtils; | ||
| 16 | +import org.apache.commons.lang3.ArrayUtils; | ||
| 17 | +import org.slf4j.Logger; | ||
| 18 | +import org.slf4j.LoggerFactory; | ||
| 19 | +import org.springframework.web.multipart.MultipartFile; | ||
| 20 | + | ||
| 21 | +import javax.imageio.ImageIO; | ||
| 22 | +import java.awt.image.BufferedImage; | ||
| 23 | +import java.io.ByteArrayInputStream; | ||
| 24 | +import java.io.File; | ||
| 25 | +import java.io.IOException; | ||
| 26 | +import java.nio.file.Paths; | ||
| 27 | +import java.util.Objects; | ||
| 17 | 28 | ||
| 18 | /** | 29 | /** |
| 19 | * 文件上传工具类 | 30 | * 文件上传工具类 |
| 20 | * | 31 | * |
| 21 | * @author ruoyi | 32 | * @author ruoyi |
| 22 | */ | 33 | */ |
| 23 | -public class FileUploadUtils | ||
| 24 | -{ | 34 | +public class FileUploadUtils { |
| 35 | + private final static Logger LOGGER = LoggerFactory.getLogger(FileUploadUtils.class); | ||
| 25 | /** | 36 | /** |
| 26 | * 默认大小 50M | 37 | * 默认大小 50M |
| 27 | */ | 38 | */ |
| @@ -37,13 +48,11 @@ public class FileUploadUtils | @@ -37,13 +48,11 @@ public class FileUploadUtils | ||
| 37 | */ | 48 | */ |
| 38 | private static String defaultBaseDir = RuoYiConfig.getProfile(); | 49 | private static String defaultBaseDir = RuoYiConfig.getProfile(); |
| 39 | 50 | ||
| 40 | - public static void setDefaultBaseDir(String defaultBaseDir) | ||
| 41 | - { | 51 | + public static void setDefaultBaseDir(String defaultBaseDir) { |
| 42 | FileUploadUtils.defaultBaseDir = defaultBaseDir; | 52 | FileUploadUtils.defaultBaseDir = defaultBaseDir; |
| 43 | } | 53 | } |
| 44 | 54 | ||
| 45 | - public static String getDefaultBaseDir() | ||
| 46 | - { | 55 | + public static String getDefaultBaseDir() { |
| 47 | return defaultBaseDir; | 56 | return defaultBaseDir; |
| 48 | } | 57 | } |
| 49 | 58 | ||
| @@ -54,14 +63,10 @@ public class FileUploadUtils | @@ -54,14 +63,10 @@ public class FileUploadUtils | ||
| 54 | * @return 文件名称 | 63 | * @return 文件名称 |
| 55 | * @throws Exception | 64 | * @throws Exception |
| 56 | */ | 65 | */ |
| 57 | - public static final String upload(MultipartFile file) throws IOException | ||
| 58 | - { | ||
| 59 | - try | ||
| 60 | - { | 66 | + public static final String upload(MultipartFile file) throws IOException { |
| 67 | + try { | ||
| 61 | return upload(getDefaultBaseDir(), file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION); | 68 | return upload(getDefaultBaseDir(), file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION); |
| 62 | - } | ||
| 63 | - catch (Exception e) | ||
| 64 | - { | 69 | + } catch (Exception e) { |
| 65 | throw new IOException(e.getMessage(), e); | 70 | throw new IOException(e.getMessage(), e); |
| 66 | } | 71 | } |
| 67 | } | 72 | } |
| @@ -70,18 +75,14 @@ public class FileUploadUtils | @@ -70,18 +75,14 @@ public class FileUploadUtils | ||
| 70 | * 根据文件路径上传 | 75 | * 根据文件路径上传 |
| 71 | * | 76 | * |
| 72 | * @param baseDir 相对应用的基目录 | 77 | * @param baseDir 相对应用的基目录 |
| 73 | - * @param file 上传的文件 | 78 | + * @param file 上传的文件 |
| 74 | * @return 文件名称 | 79 | * @return 文件名称 |
| 75 | * @throws IOException | 80 | * @throws IOException |
| 76 | */ | 81 | */ |
| 77 | - public static final String upload(String baseDir, MultipartFile file) throws IOException | ||
| 78 | - { | ||
| 79 | - try | ||
| 80 | - { | 82 | + public static final String upload(String baseDir, MultipartFile file) throws IOException { |
| 83 | + try { | ||
| 81 | return upload(baseDir, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION); | 84 | return upload(baseDir, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION); |
| 82 | - } | ||
| 83 | - catch (Exception e) | ||
| 84 | - { | 85 | + } catch (Exception e) { |
| 85 | throw new IOException(e.getMessage(), e); | 86 | throw new IOException(e.getMessage(), e); |
| 86 | } | 87 | } |
| 87 | } | 88 | } |
| @@ -89,22 +90,20 @@ public class FileUploadUtils | @@ -89,22 +90,20 @@ public class FileUploadUtils | ||
| 89 | /** | 90 | /** |
| 90 | * 文件上传 | 91 | * 文件上传 |
| 91 | * | 92 | * |
| 92 | - * @param baseDir 相对应用的基目录 | ||
| 93 | - * @param file 上传的文件 | 93 | + * @param baseDir 相对应用的基目录 |
| 94 | + * @param file 上传的文件 | ||
| 94 | * @param allowedExtension 上传文件类型 | 95 | * @param allowedExtension 上传文件类型 |
| 95 | * @return 返回上传成功的文件名 | 96 | * @return 返回上传成功的文件名 |
| 96 | - * @throws FileSizeLimitExceededException 如果超出最大大小 | 97 | + * @throws FileSizeLimitExceededException 如果超出最大大小 |
| 97 | * @throws FileNameLengthLimitExceededException 文件名太长 | 98 | * @throws FileNameLengthLimitExceededException 文件名太长 |
| 98 | - * @throws IOException 比如读写文件出错时 | ||
| 99 | - * @throws InvalidExtensionException 文件校验异常 | 99 | + * @throws IOException 比如读写文件出错时 |
| 100 | + * @throws InvalidExtensionException 文件校验异常 | ||
| 100 | */ | 101 | */ |
| 101 | public static final String upload(String baseDir, MultipartFile file, String[] allowedExtension) | 102 | public static final String upload(String baseDir, MultipartFile file, String[] allowedExtension) |
| 102 | throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException, | 103 | throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException, |
| 103 | - InvalidExtensionException | ||
| 104 | - { | 104 | + InvalidExtensionException { |
| 105 | int fileNamelength = Objects.requireNonNull(file.getOriginalFilename()).length(); | 105 | int fileNamelength = Objects.requireNonNull(file.getOriginalFilename()).length(); |
| 106 | - if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH) | ||
| 107 | - { | 106 | + if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH) { |
| 108 | throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH); | 107 | throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH); |
| 109 | } | 108 | } |
| 110 | 109 | ||
| @@ -117,31 +116,77 @@ public class FileUploadUtils | @@ -117,31 +116,77 @@ public class FileUploadUtils | ||
| 117 | return getPathFileName(baseDir, fileName); | 116 | return getPathFileName(baseDir, fileName); |
| 118 | } | 117 | } |
| 119 | 118 | ||
| 119 | + /*** | ||
| 120 | + * 上传Base64内容的文件 | ||
| 121 | + * @author liujun | ||
| 122 | + * @date 2024/7/12 9:18 | ||
| 123 | + * @param filePath 上传的路径 | ||
| 124 | + * @param fileName 上传文件名称 | ||
| 125 | + * @param type 文件类型 | ||
| 126 | + * @param uploadContent 文件内容 | ||
| 127 | + * | ||
| 128 | + * @return ResponseResult 文件上传成功返回文件路径;上传异常返回500;文件超大返回1;不是图片返回2 | ||
| 129 | + */ | ||
| 130 | + public static ResponseResult<String> uploadBase64OfImage(String filePath, String fileName, String type, String uploadContent) { | ||
| 131 | + ByteArrayInputStream byteArrayInputStream = null; | ||
| 132 | + BufferedImage bufferedImage = null; | ||
| 133 | + try { | ||
| 134 | + File file = new File(filePath); | ||
| 135 | + if (!file.isDirectory()) { | ||
| 136 | + FileUtils.forceMkdir(file); | ||
| 137 | + } | ||
| 138 | + byte[] content = Base64.decode(uploadContent); | ||
| 139 | + if (ArrayUtils.getLength(content) > DEFAULT_MAX_SIZE) { | ||
| 140 | + LOGGER.info("[{}]上传的图片超过了50M", filePath); | ||
| 141 | + return new ResponseResult<>(1); | ||
| 142 | + } | ||
| 143 | + byteArrayInputStream = new ByteArrayInputStream(content); | ||
| 144 | + bufferedImage = ImageIO.read(byteArrayInputStream); | ||
| 145 | + if (Objects.isNull(bufferedImage)) { | ||
| 146 | + LOGGER.info("[{}]上传的不是图片", filePath); | ||
| 147 | + return new ResponseResult<>(2); | ||
| 148 | + } | ||
| 149 | + | ||
| 150 | + | ||
| 151 | + StringBuilder path = new StringBuilder(); | ||
| 152 | + path.append(filePath); | ||
| 153 | + path.append(File.separator); | ||
| 154 | + path.append(fileName); | ||
| 155 | + path.append("."); | ||
| 156 | + path.append(type); | ||
| 157 | + | ||
| 158 | + boolean flag = ImageIO.write(bufferedImage, type, new File(path.toString())); | ||
| 159 | + bufferedImage.flush(); | ||
| 160 | + | ||
| 161 | + return flag ? ResponseResult.success(path.toString()) : new ResponseResult<>(500); | ||
| 162 | + } catch (Exception e) { | ||
| 163 | + LOGGER.error("上传图片异常,上传的路径为:[{}]", filePath); | ||
| 164 | + } finally { | ||
| 165 | + IOUtils.closeQuietly(byteArrayInputStream); | ||
| 166 | + } | ||
| 167 | + return new ResponseResult<>(500); | ||
| 168 | + } | ||
| 169 | + | ||
| 120 | /** | 170 | /** |
| 121 | * 编码文件名 | 171 | * 编码文件名 |
| 122 | */ | 172 | */ |
| 123 | - public static final String extractFilename(MultipartFile file) | ||
| 124 | - { | 173 | + public static final String extractFilename(MultipartFile file) { |
| 125 | return StringUtils.format("{}/{}_{}.{}", DateUtils.datePath(), | 174 | return StringUtils.format("{}/{}_{}.{}", DateUtils.datePath(), |
| 126 | FilenameUtils.getBaseName(file.getOriginalFilename()), Seq.getId(Seq.uploadSeqType), getExtension(file)); | 175 | FilenameUtils.getBaseName(file.getOriginalFilename()), Seq.getId(Seq.uploadSeqType), getExtension(file)); |
| 127 | } | 176 | } |
| 128 | 177 | ||
| 129 | - public static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException | ||
| 130 | - { | 178 | + public static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException { |
| 131 | File desc = new File(uploadDir + File.separator + fileName); | 179 | File desc = new File(uploadDir + File.separator + fileName); |
| 132 | 180 | ||
| 133 | - if (!desc.exists()) | ||
| 134 | - { | ||
| 135 | - if (!desc.getParentFile().exists()) | ||
| 136 | - { | 181 | + if (!desc.exists()) { |
| 182 | + if (!desc.getParentFile().exists()) { | ||
| 137 | desc.getParentFile().mkdirs(); | 183 | desc.getParentFile().mkdirs(); |
| 138 | } | 184 | } |
| 139 | } | 185 | } |
| 140 | return desc; | 186 | return desc; |
| 141 | } | 187 | } |
| 142 | 188 | ||
| 143 | - public static final String getPathFileName(String uploadDir, String fileName) throws IOException | ||
| 144 | - { | 189 | + public static final String getPathFileName(String uploadDir, String fileName) throws IOException { |
| 145 | int dirLastIndex = RuoYiConfig.getProfile().length() + 1; | 190 | int dirLastIndex = RuoYiConfig.getProfile().length() + 1; |
| 146 | String currentDir = StringUtils.substring(uploadDir, dirLastIndex); | 191 | String currentDir = StringUtils.substring(uploadDir, dirLastIndex); |
| 147 | return Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName; | 192 | return Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName; |
| @@ -156,40 +201,28 @@ public class FileUploadUtils | @@ -156,40 +201,28 @@ public class FileUploadUtils | ||
| 156 | * @throws InvalidExtensionException | 201 | * @throws InvalidExtensionException |
| 157 | */ | 202 | */ |
| 158 | public static final void assertAllowed(MultipartFile file, String[] allowedExtension) | 203 | public static final void assertAllowed(MultipartFile file, String[] allowedExtension) |
| 159 | - throws FileSizeLimitExceededException, InvalidExtensionException | ||
| 160 | - { | 204 | + throws FileSizeLimitExceededException, InvalidExtensionException { |
| 161 | long size = file.getSize(); | 205 | long size = file.getSize(); |
| 162 | - if (size > DEFAULT_MAX_SIZE) | ||
| 163 | - { | 206 | + if (size > DEFAULT_MAX_SIZE) { |
| 164 | throw new FileSizeLimitExceededException(DEFAULT_MAX_SIZE / 1024 / 1024); | 207 | throw new FileSizeLimitExceededException(DEFAULT_MAX_SIZE / 1024 / 1024); |
| 165 | } | 208 | } |
| 166 | 209 | ||
| 167 | String fileName = file.getOriginalFilename(); | 210 | String fileName = file.getOriginalFilename(); |
| 168 | String extension = getExtension(file); | 211 | String extension = getExtension(file); |
| 169 | - if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension)) | ||
| 170 | - { | ||
| 171 | - if (allowedExtension == MimeTypeUtils.IMAGE_EXTENSION) | ||
| 172 | - { | 212 | + if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension)) { |
| 213 | + if (allowedExtension == MimeTypeUtils.IMAGE_EXTENSION) { | ||
| 173 | throw new InvalidExtensionException.InvalidImageExtensionException(allowedExtension, extension, | 214 | throw new InvalidExtensionException.InvalidImageExtensionException(allowedExtension, extension, |
| 174 | fileName); | 215 | fileName); |
| 175 | - } | ||
| 176 | - else if (allowedExtension == MimeTypeUtils.FLASH_EXTENSION) | ||
| 177 | - { | 216 | + } else if (allowedExtension == MimeTypeUtils.FLASH_EXTENSION) { |
| 178 | throw new InvalidExtensionException.InvalidFlashExtensionException(allowedExtension, extension, | 217 | throw new InvalidExtensionException.InvalidFlashExtensionException(allowedExtension, extension, |
| 179 | fileName); | 218 | fileName); |
| 180 | - } | ||
| 181 | - else if (allowedExtension == MimeTypeUtils.MEDIA_EXTENSION) | ||
| 182 | - { | 219 | + } else if (allowedExtension == MimeTypeUtils.MEDIA_EXTENSION) { |
| 183 | throw new InvalidExtensionException.InvalidMediaExtensionException(allowedExtension, extension, | 220 | throw new InvalidExtensionException.InvalidMediaExtensionException(allowedExtension, extension, |
| 184 | fileName); | 221 | fileName); |
| 185 | - } | ||
| 186 | - else if (allowedExtension == MimeTypeUtils.VIDEO_EXTENSION) | ||
| 187 | - { | 222 | + } else if (allowedExtension == MimeTypeUtils.VIDEO_EXTENSION) { |
| 188 | throw new InvalidExtensionException.InvalidVideoExtensionException(allowedExtension, extension, | 223 | throw new InvalidExtensionException.InvalidVideoExtensionException(allowedExtension, extension, |
| 189 | fileName); | 224 | fileName); |
| 190 | - } | ||
| 191 | - else | ||
| 192 | - { | 225 | + } else { |
| 193 | throw new InvalidExtensionException(allowedExtension, extension, fileName); | 226 | throw new InvalidExtensionException(allowedExtension, extension, fileName); |
| 194 | } | 227 | } |
| 195 | } | 228 | } |
| @@ -202,12 +235,9 @@ public class FileUploadUtils | @@ -202,12 +235,9 @@ public class FileUploadUtils | ||
| 202 | * @param allowedExtension | 235 | * @param allowedExtension |
| 203 | * @return | 236 | * @return |
| 204 | */ | 237 | */ |
| 205 | - public static final boolean isAllowedExtension(String extension, String[] allowedExtension) | ||
| 206 | - { | ||
| 207 | - for (String str : allowedExtension) | ||
| 208 | - { | ||
| 209 | - if (str.equalsIgnoreCase(extension)) | ||
| 210 | - { | 238 | + public static final boolean isAllowedExtension(String extension, String[] allowedExtension) { |
| 239 | + for (String str : allowedExtension) { | ||
| 240 | + if (str.equalsIgnoreCase(extension)) { | ||
| 211 | return true; | 241 | return true; |
| 212 | } | 242 | } |
| 213 | } | 243 | } |
| @@ -220,13 +250,12 @@ public class FileUploadUtils | @@ -220,13 +250,12 @@ public class FileUploadUtils | ||
| 220 | * @param file 表单文件 | 250 | * @param file 表单文件 |
| 221 | * @return 后缀名 | 251 | * @return 后缀名 |
| 222 | */ | 252 | */ |
| 223 | - public static final String getExtension(MultipartFile file) | ||
| 224 | - { | 253 | + public static final String getExtension(MultipartFile file) { |
| 225 | String extension = FilenameUtils.getExtension(file.getOriginalFilename()); | 254 | String extension = FilenameUtils.getExtension(file.getOriginalFilename()); |
| 226 | - if (StringUtils.isEmpty(extension)) | ||
| 227 | - { | 255 | + if (StringUtils.isEmpty(extension)) { |
| 228 | extension = MimeTypeUtils.getExtension(Objects.requireNonNull(file.getContentType())); | 256 | extension = MimeTypeUtils.getExtension(Objects.requireNonNull(file.getContentType())); |
| 229 | } | 257 | } |
| 230 | return extension; | 258 | return extension; |
| 231 | } | 259 | } |
| 260 | + | ||
| 232 | } | 261 | } |
Bsth-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
| @@ -20,6 +20,8 @@ import com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter; | @@ -20,6 +20,8 @@ import com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter; | ||
| 20 | import com.ruoyi.framework.security.handle.AuthenticationEntryPointImpl; | 20 | import com.ruoyi.framework.security.handle.AuthenticationEntryPointImpl; |
| 21 | import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl; | 21 | import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl; |
| 22 | 22 | ||
| 23 | +import javax.annotation.Resource; | ||
| 24 | + | ||
| 23 | /** | 25 | /** |
| 24 | * spring security配置 | 26 | * spring security配置 |
| 25 | * | 27 | * |
| @@ -31,8 +33,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter | @@ -31,8 +33,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter | ||
| 31 | /** | 33 | /** |
| 32 | * 自定义用户认证逻辑 | 34 | * 自定义用户认证逻辑 |
| 33 | */ | 35 | */ |
| 34 | - @Autowired | 36 | + @Resource(name="com.ruoyi.service.impl.LingGangUserDetailsServiceImpl") |
| 35 | private UserDetailsService userDetailsService; | 37 | private UserDetailsService userDetailsService; |
| 38 | + | ||
| 39 | + | ||
| 36 | 40 | ||
| 37 | /** | 41 | /** |
| 38 | * 认证失败处理类 | 42 | * 认证失败处理类 |
Bsth-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java
| @@ -24,6 +24,8 @@ public interface ISysDictDataService extends IService<SysDictData> { | @@ -24,6 +24,8 @@ public interface ISysDictDataService extends IService<SysDictData> { | ||
| 24 | 24 | ||
| 25 | List<SysDictData> queryDictDateList(SysDictData dictData, Collection<String> types); | 25 | List<SysDictData> queryDictDateList(SysDictData dictData, Collection<String> types); |
| 26 | 26 | ||
| 27 | + SysDictData getOne(SysDictData sysDictData); | ||
| 28 | + | ||
| 27 | /** | 29 | /** |
| 28 | * 根据字典类型和字典键值查询字典数据信息 | 30 | * 根据字典类型和字典键值查询字典数据信息 |
| 29 | * | 31 | * |
Bsth-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java
| @@ -49,6 +49,12 @@ public class SysDictDataServiceImpl extends ServiceImpl<SysDictDataMapper, SysDi | @@ -49,6 +49,12 @@ public class SysDictDataServiceImpl extends ServiceImpl<SysDictDataMapper, SysDi | ||
| 49 | return list(wrapper); | 49 | return list(wrapper); |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | + @Override | ||
| 53 | + public SysDictData getOne(SysDictData sysDictData) { | ||
| 54 | + LambdaQueryWrapper<SysDictData> wrapper = new LambdaQueryWrapper<>(sysDictData); | ||
| 55 | + return getOne(wrapper); | ||
| 56 | + } | ||
| 57 | + | ||
| 52 | /** | 58 | /** |
| 53 | * 根据字典类型和字典键值查询字典数据信息 | 59 | * 根据字典类型和字典键值查询字典数据信息 |
| 54 | * | 60 | * |