Commit 131c84e933e880a92ed20e278d3d2d5e7b7a642a
1 parent
fc89a99b
酒测未通过审核
Showing
6 changed files
with
199 additions
and
11 deletions
Bsth-admin/src/main/java/com/ruoyi/controller/dss/DssCarInfoController.java
| 1 | package com.ruoyi.controller.dss; | 1 | package com.ruoyi.controller.dss; |
| 2 | 2 | ||
| 3 | +import com.ruoyi.common.TipEnum; | ||
| 3 | import com.ruoyi.common.core.domain.ResponseResult; | 4 | import com.ruoyi.common.core.domain.ResponseResult; |
| 4 | import com.ruoyi.domain.caiinfo.CarInfo; | 5 | import com.ruoyi.domain.caiinfo.CarInfo; |
| 5 | import com.ruoyi.domain.dss.car.info.dto.GetPlatesDTO; | 6 | import com.ruoyi.domain.dss.car.info.dto.GetPlatesDTO; |
| 7 | +import com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter; | ||
| 6 | import com.ruoyi.service.carinfo.CarInfoService; | 8 | import com.ruoyi.service.carinfo.CarInfoService; |
| 7 | import io.swagger.annotations.Api; | 9 | import io.swagger.annotations.Api; |
| 8 | import io.swagger.annotations.ApiOperation; | 10 | import io.swagger.annotations.ApiOperation; |
| 11 | +import lombok.extern.slf4j.Slf4j; | ||
| 9 | import org.apache.commons.collections4.CollectionUtils; | 12 | import org.apache.commons.collections4.CollectionUtils; |
| 10 | import org.apache.commons.lang3.StringUtils; | 13 | import org.apache.commons.lang3.StringUtils; |
| 11 | import org.springframework.beans.factory.annotation.Autowired; | 14 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -24,6 +27,7 @@ import java.util.stream.Collectors; | @@ -24,6 +27,7 @@ import java.util.stream.Collectors; | ||
| 24 | * @author liujun | 27 | * @author liujun |
| 25 | * @date 2024年07月16日 15:13 | 28 | * @date 2024年07月16日 15:13 |
| 26 | */ | 29 | */ |
| 30 | +@Slf4j | ||
| 27 | @RestController | 31 | @RestController |
| 28 | @RequestMapping("/dss") | 32 | @RequestMapping("/dss") |
| 29 | @Api(tags = "【蓝斯一期】车辆信息") | 33 | @Api(tags = "【蓝斯一期】车辆信息") |
| @@ -38,6 +42,12 @@ public class DssCarInfoController { | @@ -38,6 +42,12 @@ public class DssCarInfoController { | ||
| 38 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | 42 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 39 | } | 43 | } |
| 40 | 44 | ||
| 45 | + String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); | ||
| 46 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 47 | + log.info(msg); | ||
| 48 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 49 | + } | ||
| 50 | + | ||
| 41 | CarInfo carInfo = convertCarInfo(dto); | 51 | CarInfo carInfo = convertCarInfo(dto); |
| 42 | if (StringUtils.isEmpty(carInfo.getPlateNum())) { | 52 | if (StringUtils.isEmpty(carInfo.getPlateNum())) { |
| 43 | return ResponseResult.success(); | 53 | return ResponseResult.success(); |
Bsth-admin/src/main/java/com/ruoyi/controller/dss/DssDriverController.java
| @@ -3,6 +3,7 @@ package com.ruoyi.controller.dss; | @@ -3,6 +3,7 @@ package com.ruoyi.controller.dss; | ||
| 3 | import cn.hutool.core.convert.Convert; | 3 | import cn.hutool.core.convert.Convert; |
| 4 | import com.baomidou.mybatisplus.core.metadata.IPage; | 4 | import com.baomidou.mybatisplus.core.metadata.IPage; |
| 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| 6 | +import com.ruoyi.common.TipEnum; | ||
| 6 | import com.ruoyi.common.core.controller.BaseController; | 7 | import com.ruoyi.common.core.controller.BaseController; |
| 7 | import com.ruoyi.common.core.domain.AjaxResult; | 8 | import com.ruoyi.common.core.domain.AjaxResult; |
| 8 | import com.ruoyi.common.core.domain.ResponseResult; | 9 | import com.ruoyi.common.core.domain.ResponseResult; |
| @@ -33,6 +34,7 @@ import com.ruoyi.domain.sign.in.resource.LinggangSignInResource; | @@ -33,6 +34,7 @@ import com.ruoyi.domain.sign.in.resource.LinggangSignInResource; | ||
| 33 | import com.ruoyi.equipment.domain.Equipment; | 34 | import com.ruoyi.equipment.domain.Equipment; |
| 34 | import com.ruoyi.equipment.service.IEquipmentService; | 35 | import com.ruoyi.equipment.service.IEquipmentService; |
| 35 | import com.ruoyi.exception.InterruptException; | 36 | import com.ruoyi.exception.InterruptException; |
| 37 | +import com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter; | ||
| 36 | import com.ruoyi.in.domain.SignIn; | 38 | import com.ruoyi.in.domain.SignIn; |
| 37 | import com.ruoyi.in.service.ISignInService; | 39 | import com.ruoyi.in.service.ISignInService; |
| 38 | import com.ruoyi.pojo.response.SignInResponseVo; | 40 | import com.ruoyi.pojo.response.SignInResponseVo; |
| @@ -92,6 +94,13 @@ public class DssDriverController extends BaseController { | @@ -92,6 +94,13 @@ public class DssDriverController extends BaseController { | ||
| 92 | if (bindingResult.hasErrors()) { | 94 | if (bindingResult.hasErrors()) { |
| 93 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | 95 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 94 | } | 96 | } |
| 97 | + | ||
| 98 | + String msg = JwtAuthenticationTokenFilter.validateDevice(loginDriverDTO.getDevice()); | ||
| 99 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 100 | + log.info(msg); | ||
| 101 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 102 | + } | ||
| 103 | + | ||
| 95 | NewDriver driver = null; | 104 | NewDriver driver = null; |
| 96 | if (Objects.equals(loginDriverDTO.getAuthType(), 1)) { | 105 | if (Objects.equals(loginDriverDTO.getAuthType(), 1)) { |
| 97 | NewDriver sDriver = new NewDriver(); | 106 | NewDriver sDriver = new NewDriver(); |
| @@ -113,6 +122,13 @@ public class DssDriverController extends BaseController { | @@ -113,6 +122,13 @@ public class DssDriverController extends BaseController { | ||
| 113 | if (bindingResult.hasErrors()) { | 122 | if (bindingResult.hasErrors()) { |
| 114 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | 123 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 115 | } | 124 | } |
| 125 | + | ||
| 126 | + String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); | ||
| 127 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 128 | + log.info(msg); | ||
| 129 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 130 | + } | ||
| 131 | + | ||
| 116 | SignIn signIn = convertSignIn(dto); | 132 | SignIn signIn = convertSignIn(dto); |
| 117 | try { | 133 | try { |
| 118 | AjaxResult ajaxResult = signInService.addSignIn(signIn); | 134 | AjaxResult ajaxResult = signInService.addSignIn(signIn); |
| @@ -150,6 +166,12 @@ public class DssDriverController extends BaseController { | @@ -150,6 +166,12 @@ public class DssDriverController extends BaseController { | ||
| 150 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | 166 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 151 | } | 167 | } |
| 152 | 168 | ||
| 169 | + String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); | ||
| 170 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 171 | + log.info(msg); | ||
| 172 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 173 | + } | ||
| 174 | + | ||
| 153 | SignIn signIn = convertSignIn(dto); | 175 | SignIn signIn = convertSignIn(dto); |
| 154 | try { | 176 | try { |
| 155 | AjaxResult ajaxResult = signInService.addSignIn(signIn); | 177 | AjaxResult ajaxResult = signInService.addSignIn(signIn); |
| @@ -176,6 +198,11 @@ public class DssDriverController extends BaseController { | @@ -176,6 +198,11 @@ public class DssDriverController extends BaseController { | ||
| 176 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | 198 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 177 | } | 199 | } |
| 178 | 200 | ||
| 201 | + String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); | ||
| 202 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 203 | + log.info(msg); | ||
| 204 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 205 | + } | ||
| 179 | 206 | ||
| 180 | SignIn signIn = convertSignIn(dto); | 207 | SignIn signIn = convertSignIn(dto); |
| 181 | SignIn dataSignIn = signInService.getLastOne(signIn); | 208 | SignIn dataSignIn = signInService.getLastOne(signIn); |
| @@ -189,6 +216,12 @@ public class DssDriverController extends BaseController { | @@ -189,6 +216,12 @@ public class DssDriverController extends BaseController { | ||
| 189 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | 216 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 190 | } | 217 | } |
| 191 | 218 | ||
| 219 | + String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); | ||
| 220 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 221 | + log.info(msg); | ||
| 222 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 223 | + } | ||
| 224 | + | ||
| 192 | LinggangScheduling scheduling = convertScheduling(dto); | 225 | LinggangScheduling scheduling = convertScheduling(dto); |
| 193 | IPage<LinggangScheduling> iPage = schedulingService.pageList(new Page<LinggangScheduling>(dto.getPageNumber(), dto.getPageRow()), scheduling, new OrderEntity()); | 226 | IPage<LinggangScheduling> iPage = schedulingService.pageList(new Page<LinggangScheduling>(dto.getPageNumber(), dto.getPageRow()), scheduling, new OrderEntity()); |
| 194 | 227 | ||
| @@ -213,6 +246,12 @@ public class DssDriverController extends BaseController { | @@ -213,6 +246,12 @@ public class DssDriverController extends BaseController { | ||
| 213 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | 246 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 214 | } | 247 | } |
| 215 | 248 | ||
| 249 | + String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); | ||
| 250 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 251 | + log.info(msg); | ||
| 252 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 253 | + } | ||
| 254 | + | ||
| 216 | NewDriver newDriver = convertGetBeforeWorkListDTO(dto); | 255 | NewDriver newDriver = convertGetBeforeWorkListDTO(dto); |
| 217 | SignIn signIn = convertSignIn(dto); | 256 | SignIn signIn = convertSignIn(dto); |
| 218 | 257 | ||
| @@ -251,6 +290,13 @@ public class DssDriverController extends BaseController { | @@ -251,6 +290,13 @@ public class DssDriverController extends BaseController { | ||
| 251 | if (bindingResult.hasErrors()) { | 290 | if (bindingResult.hasErrors()) { |
| 252 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | 291 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 253 | } | 292 | } |
| 293 | + | ||
| 294 | + String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); | ||
| 295 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 296 | + log.info(msg); | ||
| 297 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 298 | + } | ||
| 299 | + | ||
| 254 | List<LinggangSignInResource> convertLinggangSignInResources = convertLinggangSignInResource(dto); | 300 | List<LinggangSignInResource> convertLinggangSignInResources = convertLinggangSignInResource(dto); |
| 255 | try { | 301 | try { |
| 256 | boolean flag = signInResourceService.insertImage(convertLinggangSignInResources); | 302 | boolean flag = signInResourceService.insertImage(convertLinggangSignInResources); |
| @@ -268,6 +314,13 @@ public class DssDriverController extends BaseController { | @@ -268,6 +314,13 @@ public class DssDriverController extends BaseController { | ||
| 268 | if (bindingResult.hasErrors()) { | 314 | if (bindingResult.hasErrors()) { |
| 269 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | 315 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 270 | } | 316 | } |
| 317 | + | ||
| 318 | + String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); | ||
| 319 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 320 | + log.info(msg); | ||
| 321 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 322 | + } | ||
| 323 | + | ||
| 271 | LinggangSignInResource resource = cconvertLinggangSignInResource(dto); | 324 | LinggangSignInResource resource = cconvertLinggangSignInResource(dto); |
| 272 | try { | 325 | try { |
| 273 | boolean flag = signInResourceService.insertVoide(resource); | 326 | boolean flag = signInResourceService.insertVoide(resource); |
Bsth-admin/src/main/java/com/ruoyi/controller/dss/DssEquipmentController.java
| @@ -2,6 +2,7 @@ package com.ruoyi.controller.dss; | @@ -2,6 +2,7 @@ package com.ruoyi.controller.dss; | ||
| 2 | 2 | ||
| 3 | import cn.hutool.core.convert.Convert; | 3 | import cn.hutool.core.convert.Convert; |
| 4 | import com.alibaba.fastjson2.JSON; | 4 | import com.alibaba.fastjson2.JSON; |
| 5 | +import com.ruoyi.common.TipEnum; | ||
| 5 | import com.ruoyi.common.constant.Constants; | 6 | import com.ruoyi.common.constant.Constants; |
| 6 | import com.ruoyi.common.core.controller.BaseController; | 7 | import com.ruoyi.common.core.controller.BaseController; |
| 7 | import com.ruoyi.common.core.domain.ResponseResult; | 8 | import com.ruoyi.common.core.domain.ResponseResult; |
| @@ -24,6 +25,7 @@ import com.ruoyi.equipment.service.IEquipmentService; | @@ -24,6 +25,7 @@ import com.ruoyi.equipment.service.IEquipmentService; | ||
| 24 | import com.ruoyi.framework.manager.AsyncManager; | 25 | import com.ruoyi.framework.manager.AsyncManager; |
| 25 | import com.ruoyi.framework.manager.factory.AsyncFactory; | 26 | import com.ruoyi.framework.manager.factory.AsyncFactory; |
| 26 | import com.ruoyi.framework.security.context.AuthenticationContextHolder; | 27 | import com.ruoyi.framework.security.context.AuthenticationContextHolder; |
| 28 | +import com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter; | ||
| 27 | import com.ruoyi.framework.web.service.TokenService; | 29 | import com.ruoyi.framework.web.service.TokenService; |
| 28 | import com.ruoyi.service.equipment.heartbeat.LingangEquipmentHeartbeatService; | 30 | import com.ruoyi.service.equipment.heartbeat.LingangEquipmentHeartbeatService; |
| 29 | import com.ruoyi.service.equipment.self.check.LingangEquimentSelfCheckService; | 31 | import com.ruoyi.service.equipment.self.check.LingangEquimentSelfCheckService; |
| @@ -113,6 +115,13 @@ public class DssEquipmentController extends BaseController { | @@ -113,6 +115,13 @@ public class DssEquipmentController extends BaseController { | ||
| 113 | if (bindingResult.hasErrors()) { | 115 | if (bindingResult.hasErrors()) { |
| 114 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | 116 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 115 | } | 117 | } |
| 118 | + | ||
| 119 | + String msg = JwtAuthenticationTokenFilter.validateDevice(heartbeatDTO.getDevice()); | ||
| 120 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 121 | + log.info(msg); | ||
| 122 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 123 | + } | ||
| 124 | + | ||
| 116 | List<LingangEquipmentHeartbeat> heartbeats = convertHeartbeatDTO(heartbeatDTO); | 125 | List<LingangEquipmentHeartbeat> heartbeats = convertHeartbeatDTO(heartbeatDTO); |
| 117 | if (CollectionUtils.isNotEmpty(heartbeats)) { | 126 | if (CollectionUtils.isNotEmpty(heartbeats)) { |
| 118 | lingangEquipmentHeartbeatService.saveBatch(heartbeats); | 127 | lingangEquipmentHeartbeatService.saveBatch(heartbeats); |
| @@ -128,6 +137,13 @@ public class DssEquipmentController extends BaseController { | @@ -128,6 +137,13 @@ public class DssEquipmentController extends BaseController { | ||
| 128 | return ResponseResult.error("设备号不能为空"); | 137 | return ResponseResult.error("设备号不能为空"); |
| 129 | } | 138 | } |
| 130 | 139 | ||
| 140 | + String msg = JwtAuthenticationTokenFilter.validateDevice(device); | ||
| 141 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 142 | + log.info(msg); | ||
| 143 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + | ||
| 131 | Set<String> keys = Arrays.stream(GET_CONFIG_DICT_KEY).collect(Collectors.toSet()); | 147 | Set<String> keys = Arrays.stream(GET_CONFIG_DICT_KEY).collect(Collectors.toSet()); |
| 132 | 148 | ||
| 133 | SysDictData sysDictData = new SysDictData(); | 149 | SysDictData sysDictData = new SysDictData(); |
| @@ -144,6 +160,13 @@ public class DssEquipmentController extends BaseController { | @@ -144,6 +160,13 @@ public class DssEquipmentController extends BaseController { | ||
| 144 | @ApiOperation("设备获取远程参数配置") | 160 | @ApiOperation("设备获取远程参数配置") |
| 145 | @Parameter(name = "device", description = "设备号", required = true) | 161 | @Parameter(name = "device", description = "设备号", required = true) |
| 146 | public ResponseResult<EquipmentConfigVo> getConfigV1_1(@RequestParam(value = "device") String device) { | 162 | public ResponseResult<EquipmentConfigVo> getConfigV1_1(@RequestParam(value = "device") String device) { |
| 163 | + | ||
| 164 | + String msg = JwtAuthenticationTokenFilter.validateDevice(device); | ||
| 165 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 166 | + log.info(msg); | ||
| 167 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 168 | + } | ||
| 169 | + | ||
| 147 | return getConfig(device); | 170 | return getConfig(device); |
| 148 | } | 171 | } |
| 149 | 172 | ||
| @@ -154,6 +177,13 @@ public class DssEquipmentController extends BaseController { | @@ -154,6 +177,13 @@ public class DssEquipmentController extends BaseController { | ||
| 154 | if (bindingResult.hasErrors()) { | 177 | if (bindingResult.hasErrors()) { |
| 155 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | 178 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 156 | } | 179 | } |
| 180 | + | ||
| 181 | + String msg = JwtAuthenticationTokenFilter.validateDevice(equipmentSelfcheckDto.getDevice()); | ||
| 182 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 183 | + log.info(msg); | ||
| 184 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 185 | + } | ||
| 186 | + | ||
| 157 | LingangEquimentSelfCheck selfCheck = convertLingangEquimentSelfCheck(equipmentSelfcheckDto); | 187 | LingangEquimentSelfCheck selfCheck = convertLingangEquimentSelfCheck(equipmentSelfcheckDto); |
| 158 | lingangEquimentSelfCheckServicelingangEquimentSelfCheckService.insert(selfCheck); | 188 | lingangEquimentSelfCheckServicelingangEquimentSelfCheckService.insert(selfCheck); |
| 159 | return ResponseResult.success(); | 189 | return ResponseResult.success(); |
Bsth-admin/src/main/java/com/ruoyi/controller/dss/DssFaceController.java
| @@ -17,6 +17,7 @@ import com.ruoyi.domain.driver.dss.syn.res.dto.ResDataDriveDTO; | @@ -17,6 +17,7 @@ import com.ruoyi.domain.driver.dss.syn.res.dto.ResDataDriveDTO; | ||
| 17 | import com.ruoyi.domain.driver.dss.syn.res.vo.FaceCheckVo; | 17 | import com.ruoyi.domain.driver.dss.syn.res.vo.FaceCheckVo; |
| 18 | import com.ruoyi.domain.driver.dss.syn.res.vo.ReqDataVo; | 18 | import com.ruoyi.domain.driver.dss.syn.res.vo.ReqDataVo; |
| 19 | import com.ruoyi.domain.driver.dss.syn.vo.DssDriveVo; | 19 | import com.ruoyi.domain.driver.dss.syn.vo.DssDriveVo; |
| 20 | +import com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter; | ||
| 20 | import com.ruoyi.service.driver.NewDriverService; | 21 | import com.ruoyi.service.driver.NewDriverService; |
| 21 | import com.ruoyi.service.dss.FaceService; | 22 | import com.ruoyi.service.dss.FaceService; |
| 22 | import com.ruoyi.utils.HttpClientUtil; | 23 | import com.ruoyi.utils.HttpClientUtil; |
| @@ -68,6 +69,12 @@ public class DssFaceController extends BaseController { | @@ -68,6 +69,12 @@ public class DssFaceController extends BaseController { | ||
| 68 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | 69 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 69 | } | 70 | } |
| 70 | 71 | ||
| 72 | + String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); | ||
| 73 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 74 | + log.info(msg); | ||
| 75 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 76 | + } | ||
| 77 | + | ||
| 71 | NewDriver driver = new NewDriver(); | 78 | NewDriver driver = new NewDriver(); |
| 72 | driver.setPosts("驾驶员"); | 79 | driver.setPosts("驾驶员"); |
| 73 | List<NewDriver> drivers = newDriverService.list(driver); | 80 | List<NewDriver> drivers = newDriverService.list(driver); |
| @@ -77,10 +84,18 @@ public class DssFaceController extends BaseController { | @@ -77,10 +84,18 @@ public class DssFaceController extends BaseController { | ||
| 77 | 84 | ||
| 78 | @PostMapping("/Driver/syn/reqData") | 85 | @PostMapping("/Driver/syn/reqData") |
| 79 | @ApiOperation("获取数据库人员信息") | 86 | @ApiOperation("获取数据库人员信息") |
| 80 | - public List<DssDriveVo> queryDriver(@Valid @RequestBody DssDriveQueryDTO dto, BindingResult bindingResult) { | 87 | + public ResponseResult<List<DssDriveVo>> queryDriver(@Valid @RequestBody DssDriveQueryDTO dto, BindingResult bindingResult) { |
| 88 | + if (bindingResult.hasErrors()) { | ||
| 89 | + return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | ||
| 90 | + } | ||
| 91 | + String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); | ||
| 92 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 93 | + log.info(msg); | ||
| 94 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 95 | + } | ||
| 81 | 96 | ||
| 82 | List<NewDriver> drivers = newDriverService.list(); | 97 | List<NewDriver> drivers = newDriverService.list(); |
| 83 | - return convertDssDriveVo(drivers); | 98 | + return ResponseResult.success(convertDssDriveVo(drivers)); |
| 84 | } | 99 | } |
| 85 | 100 | ||
| 86 | @ApiOperation("终端同步人脸数据结果上报") | 101 | @ApiOperation("终端同步人脸数据结果上报") |
| @@ -89,6 +104,13 @@ public class DssFaceController extends BaseController { | @@ -89,6 +104,13 @@ public class DssFaceController extends BaseController { | ||
| 89 | if (bindingResult.hasErrors()) { | 104 | if (bindingResult.hasErrors()) { |
| 90 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | 105 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 91 | } | 106 | } |
| 107 | + | ||
| 108 | + String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); | ||
| 109 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 110 | + log.info(msg); | ||
| 111 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 112 | + } | ||
| 113 | + | ||
| 92 | log.info("client data:[{}]",dto); | 114 | log.info("client data:[{}]",dto); |
| 93 | // NewDriver newDriver = convertNewDriver(dto); | 115 | // NewDriver newDriver = convertNewDriver(dto); |
| 94 | // TipEnum errorTipEnum = newDriverService.updateClient(newDriver); | 116 | // TipEnum errorTipEnum = newDriverService.updateClient(newDriver); |
| @@ -102,6 +124,12 @@ public class DssFaceController extends BaseController { | @@ -102,6 +124,12 @@ public class DssFaceController extends BaseController { | ||
| 102 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | 124 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 103 | } | 125 | } |
| 104 | 126 | ||
| 127 | + String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); | ||
| 128 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 129 | + log.info(msg); | ||
| 130 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 131 | + } | ||
| 132 | + | ||
| 105 | Map<String, Object> parentMap = new HashMap<>(); | 133 | Map<String, Object> parentMap = new HashMap<>(); |
| 106 | parentMap.put("method", "getfacelitefeature"); | 134 | parentMap.put("method", "getfacelitefeature"); |
| 107 | parentMap.put("faceid", "1"); | 135 | parentMap.put("faceid", "1"); |
| @@ -152,6 +180,12 @@ public class DssFaceController extends BaseController { | @@ -152,6 +180,12 @@ public class DssFaceController extends BaseController { | ||
| 152 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | 180 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 153 | } | 181 | } |
| 154 | 182 | ||
| 183 | + String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); | ||
| 184 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 185 | + log.info(msg); | ||
| 186 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 187 | + } | ||
| 188 | + | ||
| 155 | NewDriver driver = convertNewDriver(dto); | 189 | NewDriver driver = convertNewDriver(dto); |
| 156 | driver = faceService.checkFace(driver); | 190 | driver = faceService.checkFace(driver); |
| 157 | 191 |
Bsth-admin/src/main/java/com/ruoyi/controller/dss/KeyBoxController.java
| @@ -25,6 +25,7 @@ import com.ruoyi.domain.scheduling.LinggangScheduling; | @@ -25,6 +25,7 @@ import com.ruoyi.domain.scheduling.LinggangScheduling; | ||
| 25 | import com.ruoyi.domain.venue.info.LinggangVenueInfo; | 25 | import com.ruoyi.domain.venue.info.LinggangVenueInfo; |
| 26 | import com.ruoyi.equipment.domain.Equipment; | 26 | import com.ruoyi.equipment.domain.Equipment; |
| 27 | import com.ruoyi.equipment.service.IEquipmentService; | 27 | import com.ruoyi.equipment.service.IEquipmentService; |
| 28 | +import com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter; | ||
| 28 | import com.ruoyi.service.carinfo.CarInfoService; | 29 | import com.ruoyi.service.carinfo.CarInfoService; |
| 29 | import com.ruoyi.service.driver.NewDriverService; | 30 | import com.ruoyi.service.driver.NewDriverService; |
| 30 | import com.ruoyi.service.dss.KeyBoxVoService; | 31 | import com.ruoyi.service.dss.KeyBoxVoService; |
| @@ -36,6 +37,7 @@ import com.ruoyi.service.venue.info.LinggangVenueInfoService; | @@ -36,6 +37,7 @@ import com.ruoyi.service.venue.info.LinggangVenueInfoService; | ||
| 36 | import com.ruoyi.utils.DateUtil; | 37 | import com.ruoyi.utils.DateUtil; |
| 37 | import io.swagger.annotations.Api; | 38 | import io.swagger.annotations.Api; |
| 38 | import io.swagger.annotations.ApiOperation; | 39 | import io.swagger.annotations.ApiOperation; |
| 40 | +import lombok.extern.slf4j.Slf4j; | ||
| 39 | import org.apache.commons.collections4.CollectionUtils; | 41 | import org.apache.commons.collections4.CollectionUtils; |
| 40 | import org.apache.commons.lang3.StringUtils; | 42 | import org.apache.commons.lang3.StringUtils; |
| 41 | import org.springframework.beans.BeanUtils; | 43 | import org.springframework.beans.BeanUtils; |
| @@ -56,6 +58,7 @@ import java.util.stream.Collectors; | @@ -56,6 +58,7 @@ import java.util.stream.Collectors; | ||
| 56 | * @author liujun | 58 | * @author liujun |
| 57 | * @date 2024年06月25日 13:04 | 59 | * @date 2024年06月25日 13:04 |
| 58 | */ | 60 | */ |
| 61 | +@Slf4j | ||
| 59 | @RestController | 62 | @RestController |
| 60 | @RequestMapping("/dss") | 63 | @RequestMapping("/dss") |
| 61 | @Api(tags = "【蓝斯一期】钥匙信息") | 64 | @Api(tags = "【蓝斯一期】钥匙信息") |
| @@ -88,6 +91,12 @@ public class KeyBoxController extends BaseController { | @@ -88,6 +91,12 @@ public class KeyBoxController extends BaseController { | ||
| 88 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | 91 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 89 | } | 92 | } |
| 90 | 93 | ||
| 94 | + String msg = JwtAuthenticationTokenFilter.validateDevice(request.getDevice()); | ||
| 95 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 96 | + log.info(msg); | ||
| 97 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 98 | + } | ||
| 99 | + | ||
| 91 | LingangEquipmentLinkeLog linkeLog = saveLog(request); | 100 | LingangEquipmentLinkeLog linkeLog = saveLog(request); |
| 92 | 101 | ||
| 93 | return keyBoxVoService.listSelect(request, linkeLog); | 102 | return keyBoxVoService.listSelect(request, linkeLog); |
| @@ -99,6 +108,14 @@ public class KeyBoxController extends BaseController { | @@ -99,6 +108,14 @@ public class KeyBoxController extends BaseController { | ||
| 99 | if (bindingResult.hasErrors()) { | 108 | if (bindingResult.hasErrors()) { |
| 100 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | 109 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 101 | } | 110 | } |
| 111 | + | ||
| 112 | + String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); | ||
| 113 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 114 | + log.info(msg); | ||
| 115 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 116 | + } | ||
| 117 | + | ||
| 118 | + | ||
| 102 | try { | 119 | try { |
| 103 | LinggangScheduling scheduling = queryScheduling(dto); | 120 | LinggangScheduling scheduling = queryScheduling(dto); |
| 104 | if (Objects.isNull(scheduling)) { | 121 | if (Objects.isNull(scheduling)) { |
| @@ -141,6 +158,12 @@ public class KeyBoxController extends BaseController { | @@ -141,6 +158,12 @@ public class KeyBoxController extends BaseController { | ||
| 141 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | 158 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 142 | } | 159 | } |
| 143 | 160 | ||
| 161 | + String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); | ||
| 162 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 163 | + log.info(msg); | ||
| 164 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 165 | + } | ||
| 166 | + | ||
| 144 | try { | 167 | try { |
| 145 | 168 | ||
| 146 | Equipment equipment = queryEquipment(dto.getDevice()); | 169 | Equipment equipment = queryEquipment(dto.getDevice()); |
| @@ -216,6 +239,13 @@ public class KeyBoxController extends BaseController { | @@ -216,6 +239,13 @@ public class KeyBoxController extends BaseController { | ||
| 216 | if (bindingResult.hasErrors()) { | 239 | if (bindingResult.hasErrors()) { |
| 217 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | 240 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 218 | } | 241 | } |
| 242 | + | ||
| 243 | + String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); | ||
| 244 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 245 | + log.info(msg); | ||
| 246 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 247 | + } | ||
| 248 | + | ||
| 219 | Equipment equipment = queryEquipment(dto.getDevice()); | 249 | Equipment equipment = queryEquipment(dto.getDevice()); |
| 220 | if (Objects.isNull(equipment)) { | 250 | if (Objects.isNull(equipment)) { |
| 221 | logger.info("根据DTO的数据无法查询设备信息:[{}]", dto); | 251 | logger.info("根据DTO的数据无法查询设备信息:[{}]", dto); |
| @@ -233,6 +263,14 @@ public class KeyBoxController extends BaseController { | @@ -233,6 +263,14 @@ public class KeyBoxController extends BaseController { | ||
| 233 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | 263 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 234 | } | 264 | } |
| 235 | 265 | ||
| 266 | + String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); | ||
| 267 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 268 | + log.info(msg); | ||
| 269 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 270 | + } | ||
| 271 | + | ||
| 272 | + | ||
| 273 | + | ||
| 236 | LinggangKeyWorkLocation entity = new LinggangKeyWorkLocation(); | 274 | LinggangKeyWorkLocation entity = new LinggangKeyWorkLocation(); |
| 237 | entity.setDevice(dto.getDevice()); | 275 | entity.setDevice(dto.getDevice()); |
| 238 | List<LinggangKeyWorkLocation> schedulings = linggangKeyWorkLocationService.list(entity); | 276 | List<LinggangKeyWorkLocation> schedulings = linggangKeyWorkLocationService.list(entity); |
| @@ -267,6 +305,14 @@ public class KeyBoxController extends BaseController { | @@ -267,6 +305,14 @@ public class KeyBoxController extends BaseController { | ||
| 267 | if (bindingResult.hasErrors()) { | 305 | if (bindingResult.hasErrors()) { |
| 268 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | 306 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 269 | } | 307 | } |
| 308 | + | ||
| 309 | + String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); | ||
| 310 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 311 | + log.info(msg); | ||
| 312 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 313 | + } | ||
| 314 | + | ||
| 315 | + | ||
| 270 | LinggangKeyWorkLocation entity = new LinggangKeyWorkLocation(); | 316 | LinggangKeyWorkLocation entity = new LinggangKeyWorkLocation(); |
| 271 | entity.setDevice(dto.getDevice()); | 317 | entity.setDevice(dto.getDevice()); |
| 272 | entity.setType(2); | 318 | entity.setType(2); |
| @@ -324,6 +370,14 @@ public class KeyBoxController extends BaseController { | @@ -324,6 +370,14 @@ public class KeyBoxController extends BaseController { | ||
| 324 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | 370 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 325 | } | 371 | } |
| 326 | 372 | ||
| 373 | + String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); | ||
| 374 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 375 | + log.info(msg); | ||
| 376 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 377 | + } | ||
| 378 | + | ||
| 379 | + | ||
| 380 | + | ||
| 327 | LinggangKeyWorkLocation entity = new LinggangKeyWorkLocation(); | 381 | LinggangKeyWorkLocation entity = new LinggangKeyWorkLocation(); |
| 328 | entity.setDevice(dto.getDevice()); | 382 | entity.setDevice(dto.getDevice()); |
| 329 | entity.setType(2); | 383 | entity.setType(2); |
| @@ -366,6 +420,13 @@ public class KeyBoxController extends BaseController { | @@ -366,6 +420,13 @@ public class KeyBoxController extends BaseController { | ||
| 366 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | 420 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 367 | } | 421 | } |
| 368 | 422 | ||
| 423 | + String msg = JwtAuthenticationTokenFilter.validateDevice(dto.getDevice()); | ||
| 424 | + if(StringUtils.isNotEmpty(msg)){ | ||
| 425 | + log.info(msg); | ||
| 426 | + return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | ||
| 427 | + } | ||
| 428 | + | ||
| 429 | + | ||
| 369 | Set<Integer> keyInfoIds = null; | 430 | Set<Integer> keyInfoIds = null; |
| 370 | List<KeyInfo> keyInfos = null; | 431 | List<KeyInfo> keyInfos = null; |
| 371 | LinggangKeyWorkLocation keyWorkLocation = new LinggangKeyWorkLocation(); | 432 | LinggangKeyWorkLocation keyWorkLocation = new LinggangKeyWorkLocation(); |
Bsth-framework/src/main/java/com/ruoyi/framework/security/filter/JwtAuthenticationTokenFilter.java
| @@ -53,16 +53,16 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter { | @@ -53,16 +53,16 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter { | ||
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | public static String validateDevice(String device) { | 55 | public static String validateDevice(String device) { |
| 56 | -// LoginUser loginUser = SecurityUtils.getLoginUser(); | ||
| 57 | -// if(Objects.isNull(loginUser)){ | ||
| 58 | -// return "没有登陆信息"; | ||
| 59 | -// } | ||
| 60 | -// | ||
| 61 | -// if(org.apache.commons.lang3.StringUtils.equals(device,Convert.toStr(loginUser.getDeptId()))){ | 56 | + LoginUser loginUser = SecurityUtils.getLoginUser(); |
| 57 | + if(Objects.isNull(loginUser)){ | ||
| 58 | + return "没有登陆信息"; | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + if(org.apache.commons.lang3.StringUtils.equals(device,Convert.toStr(loginUser.getDeptId()))){ | ||
| 62 | return null; | 62 | return null; |
| 63 | -// } | ||
| 64 | -// | ||
| 65 | -// return "登陆的设备和token不匹配"; | 63 | + } |
| 64 | + | ||
| 65 | + return "登陆的设备和token不匹配"; | ||
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | public static HttpServletRequest getRequest() { | 68 | public static HttpServletRequest getRequest() { |