Commit 465954d092edb5d67bae622678be6e8e2fcfccc0

Authored by liujun001
1 parent 17f3bc80

对接蓝斯接口

Showing 64 changed files with 3502 additions and 236 deletions
Bsth-admin/src/main/java/com/ruoyi/controller/dss/DriverHeartbeatController.java
... ... @@ -2,7 +2,9 @@ package com.ruoyi.controller.dss;
2 2  
3 3 import com.ruoyi.common.core.controller.BaseController;
4 4 import com.ruoyi.common.core.domain.AjaxResult;
  5 +import com.ruoyi.equipment.service.IEquipmentService;
5 6 import io.swagger.annotations.Api;
  7 +import org.springframework.beans.factory.annotation.Autowired;
6 8 import org.springframework.web.bind.annotation.RequestMapping;
7 9 import org.springframework.web.bind.annotation.RestController;
8 10  
... ... @@ -11,10 +13,17 @@ import org.springframework.web.bind.annotation.RestController;
11 13 * @date 2024年06月25日 16:38
12 14 */
13 15 @RestController
14   -@RequestMapping("/dss/Driver/Heartbeat")
  16 +@RequestMapping("/dss/Driver")
15 17 @Api(tags = "【蓝斯一期】岗前设备报警信息")
16 18 public class DriverHeartbeatController extends BaseController {
17   - public AjaxResult AddHeartbeat(){
  19 + @Autowired
  20 + private IEquipmentService equipmentService;
  21 + public AjaxResult auth(){
18 22  
  23 +// Auth
  24 + return null;
19 25 }
  26 +// public AjaxResult AddHeartbeat(){
  27 +//
  28 +// }
20 29 }
... ...
Bsth-admin/src/main/java/com/ruoyi/controller/dss/DssDriverController.java 0 → 100644
  1 +package com.ruoyi.controller.dss;
  2 +
  3 +import cn.hutool.core.convert.Convert;
  4 +import cn.hutool.system.UserInfo;
  5 +import com.ruoyi.common.core.controller.BaseController;
  6 +import com.ruoyi.common.core.domain.AjaxResult;
  7 +import com.ruoyi.domain.driver.NewDriver;
  8 +import com.ruoyi.domain.driver.dss.syn.DrivePosEnum;
  9 +import com.ruoyi.domain.driver.dss.syn.login.dto.LoginDriverDTO;
  10 +import com.ruoyi.domain.driver.dss.syn.login.vo.LoginDriverVo;
  11 +import com.ruoyi.domain.driver.dss.syn.login.vo.LoginUserInfoVo;
  12 +import com.ruoyi.service.driver.NewDriverService;
  13 +import io.swagger.annotations.Api;
  14 +import lombok.extern.slf4j.Slf4j;
  15 +import org.apache.commons.collections4.CollectionUtils;
  16 +import org.springframework.beans.factory.annotation.Autowired;
  17 +import org.springframework.validation.BindingResult;
  18 +import org.springframework.web.bind.annotation.RequestMapping;
  19 +import org.springframework.web.bind.annotation.RestController;
  20 +
  21 +import javax.validation.Valid;
  22 +import java.util.*;
  23 +
  24 +/**
  25 + * @author liujun
  26 + * @date 2024年07月11日 16:37
  27 + */
  28 +@RestController
  29 +@Slf4j
  30 +@RequestMapping("/dss/Driver")
  31 +@Api(tags = "【蓝斯一期】人员信息")
  32 +public class DssDriverController extends BaseController {
  33 + @Autowired
  34 + private NewDriverService newDriverService;
  35 +
  36 + public AjaxResult login(@Valid LoginDriverDTO loginDriverDTO, BindingResult bindingResult) {
  37 + if (bindingResult.hasErrors()) {
  38 + return AjaxResult.error(bindingResult.getFieldError().getDefaultMessage());
  39 + }
  40 + Integer id = checkFace();
  41 + if (Objects.isNull(id)) {
  42 + return AjaxResult.error("登陆数据错误,无法识别人脸");
  43 + }
  44 + NewDriver newDriver = newDriverService.getById(id);
  45 + return AjaxResult.success(convertNewDriver(newDriver));
  46 + }
  47 +
  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;
  58 + }
  59 + //TODO 对接第三方
  60 +
  61 + return 10;
  62 + }
  63 +
  64 + /***
  65 + * 登陆转换
  66 + * @author liujun
  67 + * @date 2024/7/11 17:26
  68 + * @param newDriver
  69 + * @return com.ruoyi.domain.driver.dss.syn.login.vo.LoginDriverVo
  70 + */
  71 + private LoginDriverVo convertNewDriver(NewDriver newDriver) {
  72 + LoginDriverVo loginDriverVo = new LoginDriverVo();
  73 + loginDriverVo.setDriverCode(newDriver.getIcRfid());
  74 + loginDriverVo.setDriverName(newDriver.getPersonnelName());
  75 + loginDriverVo.setWorkCode(newDriver.getJobCode());
  76 + loginDriverVo.setStaffCode(newDriver.getJobCode());
  77 + loginDriverVo.setStaffType(DrivePosEnum.getObjValueOfLabel(newDriver.getPosts()));
  78 + loginDriverVo.setCropFacePhotoUrl(newDriver.getImage());
  79 + loginDriverVo.setBlueTooth(newDriver.getBlueTooth());
  80 +
  81 + loginDriverVo.setFaceFeature(newDriver.getFaceFeature());
  82 + loginDriverVo.setSynState(newDriver.getInteger());
  83 + loginDriverVo.setSynContent(newDriver.getSyncontent());
  84 + loginDriverVo.setCsn(newDriver.getCsn());
  85 +
  86 + //TODO 是否强制做检查
  87 + loginDriverVo.setHealthCheck(0);
  88 + //TODO 当日最后一次登签的签到状态
  89 + loginDriverVo.setSignInType(0);
  90 + //TODO 当日最后一次登签的签退状态
  91 + loginDriverVo.setSignOutType(0);
  92 +
  93 +
  94 + Set<Integer> postSets = new HashSet<>();
  95 + loginDriverVo.setStaffTypeItem(postSets);
  96 +
  97 + LoginUserInfoVo loginUserInfoVo = new LoginUserInfoVo();
  98 + loginUserInfoVo.setStaffId(Convert.toStr(newDriver.getId()));
  99 + loginUserInfoVo.setStaffName(newDriver.getPersonnelName());
  100 + loginUserInfoVo.setIcCardNo(newDriver.getIcRfid());
  101 + loginUserInfoVo.setFacePhotoPath(newDriver.getImage());
  102 +
  103 + loginDriverVo.setUserInfo(loginUserInfoVo);
  104 +
  105 + return loginDriverVo;
  106 + }
  107 +}
... ...
Bsth-admin/src/main/java/com/ruoyi/controller/dss/DssEquipmentController.java 0 → 100644
  1 +package com.ruoyi.controller.dss;
  2 +
  3 +import cn.hutool.core.convert.Convert;
  4 +import com.alibaba.fastjson2.JSON;
  5 +import com.ruoyi.common.constant.Constants;
  6 +import com.ruoyi.common.core.controller.BaseController;
  7 +import com.ruoyi.common.core.domain.AjaxResult;
  8 +import com.ruoyi.common.core.domain.entity.SysDictData;
  9 +import com.ruoyi.common.core.domain.entity.SysDictType;
  10 +import com.ruoyi.common.core.domain.model.LoginUser;
  11 +import com.ruoyi.common.utils.MessageUtils;
  12 +import com.ruoyi.domain.dss.equipment.dto.EquipmentAuthDTO;
  13 +import com.ruoyi.domain.dss.equipment.dto.EquipmentSelfcheckCamerasDto;
  14 +import com.ruoyi.domain.dss.equipment.dto.EquipmentSelfcheckDto;
  15 +import com.ruoyi.domain.dss.equipment.dto.HeartbeatDTO;
  16 +import com.ruoyi.domain.dss.equipment.vo.AuthVo;
  17 +import com.ruoyi.domain.dss.equipment.vo.EquimentAddressParamVo;
  18 +import com.ruoyi.domain.dss.equipment.vo.EquimentVideoParamVo;
  19 +import com.ruoyi.domain.dss.equipment.vo.EquipmentConfigVo;
  20 +import com.ruoyi.domain.equipment.heartbeat.LingangEquipmentHeartbeat;
  21 +import com.ruoyi.domain.equipment.self.check.LingangEquimentSelfCheck;
  22 +import com.ruoyi.equipment.domain.Equipment;
  23 +import com.ruoyi.equipment.service.IEquipmentService;
  24 +import com.ruoyi.framework.manager.AsyncManager;
  25 +import com.ruoyi.framework.manager.factory.AsyncFactory;
  26 +import com.ruoyi.framework.security.context.AuthenticationContextHolder;
  27 +import com.ruoyi.framework.web.service.TokenService;
  28 +import com.ruoyi.service.equipment.heartbeat.LingangEquipmentHeartbeatService;
  29 +import com.ruoyi.service.equipment.self.check.LingangEquimentSelfCheckService;
  30 +import com.ruoyi.system.service.ISysDictDataService;
  31 +import com.ruoyi.system.service.ISysDictTypeService;
  32 +import io.swagger.annotations.Api;
  33 +import io.swagger.annotations.ApiOperation;
  34 +import io.swagger.annotations.ApiParam;
  35 +import io.swagger.v3.oas.annotations.Parameter;
  36 +import lombok.extern.slf4j.Slf4j;
  37 +import org.apache.commons.collections4.CollectionUtils;
  38 +import org.apache.commons.lang3.ArrayUtils;
  39 +import org.apache.commons.lang3.StringUtils;
  40 +import org.springframework.beans.BeanUtils;
  41 +import org.springframework.beans.factory.annotation.Autowired;
  42 +import org.springframework.security.authentication.AuthenticationManager;
  43 +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
  44 +import org.springframework.security.core.Authentication;
  45 +import org.springframework.validation.BindingResult;
  46 +import org.springframework.web.bind.annotation.*;
  47 +
  48 +import javax.annotation.Resource;
  49 +import javax.validation.Valid;
  50 +import java.math.BigDecimal;
  51 +import java.util.*;
  52 +import java.util.stream.Collectors;
  53 +
  54 +/**
  55 + * @author liujun
  56 + * @date 2024年07月05日 15:29
  57 + */
  58 +@RestController
  59 +@Slf4j
  60 +@RequestMapping("/dss/Driver")
  61 +@Api(tags = "【蓝斯一期】设备信息")
  62 +public class DssEquipmentController extends BaseController {
  63 + @Autowired
  64 + private IEquipmentService equipmentService;
  65 + @Resource
  66 + private AuthenticationManager authenticationManager;
  67 + @Autowired
  68 + private TokenService tokenService;
  69 + @Autowired
  70 + private LingangEquipmentHeartbeatService lingangEquipmentHeartbeatService;
  71 + @Autowired
  72 + private ISysDictTypeService sysDictTypeService;
  73 + @Autowired
  74 + private ISysDictDataService sysDictDataService;
  75 + @Autowired
  76 + private LingangEquimentSelfCheckService lingangEquimentSelfCheckServicelingangEquimentSelfCheckService;
  77 +
  78 +
  79 + private static final String[] GET_CONFIG_DICT_KEY = {"drinking", "drunkenness", "videoParam", "addressParam"};
  80 +
  81 +
  82 + @ApiOperation("设备获取访问令牌")
  83 + @GetMapping("/Auth")
  84 + public AjaxResult auth(@Valid EquipmentAuthDTO dto, BindingResult bindingResult) {
  85 + if (bindingResult.hasErrors()) {
  86 + return AjaxResult.error(bindingResult.getFieldError().getDefaultMessage());
  87 + }
  88 +
  89 + Equipment equipment = equipmentService.getOneByDeviceId(dto.getDevice());
  90 + if (Objects.isNull(equipment)) {
  91 + log.info("[{}] equipment is null", dto.getDevice());
  92 + return AjaxResult.error("设备号错误,请检查设备号");
  93 + }
  94 + UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(equipment.getDeviceId(), equipment.getId());
  95 + AuthenticationContextHolder.setContext(authenticationToken);
  96 + 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();
  99 + String token = tokenService.createToken(loginUser, Constants.EQUIPMENT_KEY);
  100 +
  101 + AuthVo vo = new AuthVo(token);
  102 +
  103 + return AjaxResult.success(vo);
  104 + }
  105 +
  106 + @PostMapping("/Heartbeat")
  107 + @ApiOperation("设备报警信息(心跳包)")
  108 + public AjaxResult heartbeat(@Valid HeartbeatDTO heartbeatDTO, BindingResult bindingResult) {
  109 + if (bindingResult.hasErrors()) {
  110 + return AjaxResult.error(bindingResult.getFieldError().getDefaultMessage());
  111 + }
  112 + List<LingangEquipmentHeartbeat> heartbeats = convertHeartbeatDTO(heartbeatDTO);
  113 + if (CollectionUtils.isNotEmpty(heartbeats)) {
  114 + lingangEquipmentHeartbeatService.saveBatch(heartbeats);
  115 + }
  116 + return AjaxResult.success();
  117 + }
  118 +
  119 + @GetMapping(value = "/getConfig")
  120 + @ApiOperation("设备获取远程参数配置")
  121 + @Parameter(name = "device", description = "设备号", required = true)
  122 + public AjaxResult getConfig(@RequestParam(value = "device") String device) {
  123 + if (StringUtils.isEmpty(device)) {
  124 + return AjaxResult.error("设备号不能为空");
  125 + }
  126 +
  127 + Set<String> keys = Arrays.stream(GET_CONFIG_DICT_KEY).collect(Collectors.toSet());
  128 +
  129 + SysDictData sysDictData = new SysDictData();
  130 + sysDictData.setStatus(Constants.ENABLE_STR);
  131 +
  132 + List<SysDictData> list = sysDictDataService.queryDictDateList(sysDictData, keys);
  133 + EquipmentConfigVo configVo = combitionEquipmentConfigVo(list);
  134 + return AjaxResult.success(configVo);
  135 + }
  136 +
  137 +
  138 + @PostMapping("/selfcheck")
  139 + @ApiOperation("设备获取远程参数配置")
  140 + public AjaxResult selfCheck(@Valid EquipmentSelfcheckDto equipmentSelfcheckDto, BindingResult bindingResult) {
  141 + if (bindingResult.hasErrors()) {
  142 + return AjaxResult.error(bindingResult.getFieldError().getDefaultMessage());
  143 + }
  144 + LingangEquimentSelfCheck selfCheck = convertLingangEquimentSelfCheck(equipmentSelfcheckDto);
  145 + lingangEquimentSelfCheckServicelingangEquimentSelfCheckService.insert(selfCheck);
  146 + return AjaxResult.success();
  147 + }
  148 +
  149 + private List<LingangEquipmentHeartbeat> convertHeartbeatDTO(HeartbeatDTO heartbeatDTO) {
  150 + if (Objects.isNull(heartbeatDTO)) {
  151 + return Collections.emptyList();
  152 + }
  153 + int length = ArrayUtils.getLength(heartbeatDTO.getAlarm());
  154 +
  155 + List<LingangEquipmentHeartbeat> heartbeats = new ArrayList<>(length);
  156 + if (length == 0) {
  157 + heartbeats.add(convertHeartbeatDTO(heartbeatDTO, null));
  158 + } else {
  159 + for (int i = 0; i < length; i++) {
  160 + heartbeats.add(convertHeartbeatDTO(heartbeatDTO, heartbeatDTO.getAlarm()[i]));
  161 + }
  162 + }
  163 + return heartbeats;
  164 + }
  165 +
  166 + private LingangEquipmentHeartbeat convertHeartbeatDTO(HeartbeatDTO heartbeatDTO, Integer alarm) {
  167 + LingangEquipmentHeartbeat heartbeat = new LingangEquipmentHeartbeat();
  168 + heartbeat.setAlarm(alarm);
  169 + heartbeat.setTime(heartbeatDTO.getTime());
  170 + heartbeat.setDevice(heartbeatDTO.getDevice());
  171 + heartbeat.setCreateTime(new Date());
  172 + if (CollectionUtils.isNotEmpty(heartbeatDTO.getExKeys())) {
  173 + heartbeat.setExkeys(JSON.toJSONString(heartbeatDTO.getExKeys()));
  174 + }
  175 + return heartbeat;
  176 + }
  177 +
  178 + private EquipmentConfigVo combitionEquipmentConfigVo(List<SysDictData> sysDictDatas) {
  179 + if (CollectionUtils.isEmpty(sysDictDatas)) {
  180 + return null;
  181 + }
  182 + EquipmentConfigVo configVo = new EquipmentConfigVo();
  183 + EquimentVideoParamVo equimentVideoParamVo = new EquimentVideoParamVo();
  184 + EquimentAddressParamVo equimentAddressParamVo = new EquimentAddressParamVo();
  185 +
  186 + for (SysDictData sysDictData : sysDictDatas) {
  187 + if (Objects.equals(sysDictData.getDictType(), "drinking") && StringUtils.isNotEmpty(sysDictData.getDictValue())) {
  188 + configVo.setDrinking(Convert.toBigDecimal(sysDictData.getDictValue()));
  189 + } else if (Objects.equals(sysDictData.getDictType(), "drunkenness") && StringUtils.isNotEmpty(sysDictData.getDictValue())) {
  190 + configVo.setDrunkenness(Convert.toBigDecimal(sysDictData.getDictValue()));
  191 + } else if (Objects.equals(sysDictData.getDictType(), "videoParam") && StringUtils.isNotEmpty(sysDictData.getDictValue())) {
  192 + if (StringUtils.equals(sysDictData.getDiscKey(), "upflag")) {
  193 + equimentVideoParamVo.setUpflag(Convert.toInt(sysDictData.getDictValue()));
  194 + } else if (StringUtils.equals(sysDictData.getDiscKey(), "timespan")) {
  195 + equimentVideoParamVo.setTimespan(Convert.toInt(sysDictData.getDictValue()));
  196 + } else if (StringUtils.equals(sysDictData.getDiscKey(), "url")) {
  197 + equimentVideoParamVo.setUrl(sysDictData.getDictValue());
  198 + } else if (StringUtils.equals(sysDictData.getDiscKey(), "saveday")) {
  199 + equimentVideoParamVo.setSaveday(Convert.toInt(sysDictData.getDictValue()));
  200 + } else if (StringUtils.equals(sysDictData.getDiscKey(), "videoTimeSlot")) {
  201 + equimentVideoParamVo.setVideoTimeSlot(sysDictData.getDictValue());
  202 + }
  203 + } else if (Objects.equals(sysDictData.getDictType(), "addressParam") && StringUtils.isNotEmpty(sysDictData.getDictValue())) {
  204 + if (StringUtils.equals(sysDictData.getDiscKey(), "upgradeAddress")) {
  205 + equimentAddressParamVo.setUpgradeAddress(sysDictData.getDictValue());
  206 + } else if (StringUtils.equals(sysDictData.getDiscKey(), "integer")) {
  207 + equimentAddressParamVo.setInteger(Convert.toInt(sysDictData.getDictValue()));
  208 + }
  209 + }
  210 + }
  211 +
  212 + configVo.setAddressParam(equimentAddressParamVo);
  213 + configVo.setVideoParam(equimentVideoParamVo);
  214 + return configVo;
  215 + }
  216 +
  217 + private LingangEquimentSelfCheck convertLingangEquimentSelfCheck(EquipmentSelfcheckDto dto) {
  218 + LingangEquimentSelfCheck selfCheck = new LingangEquimentSelfCheck();
  219 + BeanUtils.copyProperties(dto, selfCheck);
  220 + if (CollectionUtils.isNotEmpty(dto.getCameras())) {
  221 + selfCheck.setCameras(JSON.toJSONString(dto.getCameras()));
  222 + Optional<EquipmentSelfcheckCamerasDto> optional = dto.getCameras().stream().filter(c->Objects.equals(c.getStatus(),1)).findFirst();
  223 + selfCheck.setCamerasSaveExceptionFlag(optional.isPresent());
  224 + }
  225 +
  226 + return selfCheck;
  227 + }
  228 +
  229 +
  230 +}
... ...
Bsth-admin/src/main/java/com/ruoyi/controller/dss/DssFaceController.java 0 → 100644
  1 +package com.ruoyi.controller.dss;
  2 +
  3 +
  4 +import cn.hutool.core.convert.Convert;
  5 +import com.ruoyi.common.core.controller.BaseController;
  6 +import com.ruoyi.common.core.domain.AjaxResult;
  7 +import com.ruoyi.domain.driver.NewDriver;
  8 +import com.ruoyi.domain.driver.dss.syn.DrivePosEnum;
  9 +import com.ruoyi.domain.driver.dss.syn.dto.DssDriveQueryDTO;
  10 +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.vo.DssDriveVo;
  13 +import com.ruoyi.service.driver.NewDriverService;
  14 +import io.swagger.annotations.Api;
  15 +import io.swagger.annotations.ApiOperation;
  16 +import lombok.extern.slf4j.Slf4j;
  17 +import org.apache.commons.collections4.CollectionUtils;
  18 +import org.springframework.beans.factory.annotation.Autowired;
  19 +import org.springframework.validation.BindingResult;
  20 +import org.springframework.web.bind.annotation.PostMapping;
  21 +import org.springframework.web.bind.annotation.RequestMapping;
  22 +import org.springframework.web.bind.annotation.RestController;
  23 +
  24 +import javax.validation.Valid;
  25 +import java.util.Collections;
  26 +import java.util.HashSet;
  27 +import java.util.List;
  28 +import java.util.Set;
  29 +import java.util.stream.Collectors;
  30 +
  31 +/**
  32 + * @author liujun
  33 + * @date 2024年07月11日 14:07
  34 + */
  35 +
  36 +@Slf4j
  37 +@RestController
  38 +@RequestMapping("/dss/Driver")
  39 +@Api(tags = "【蓝斯一期】人脸信息")
  40 +public class DssFaceController extends BaseController {
  41 +
  42 + @Autowired
  43 + private NewDriverService newDriverService;
  44 +
  45 + @PostMapping("/syn/reqData")
  46 + @ApiOperation("获取数据库人员信息")
  47 + public List<DssDriveVo> queryDriver(@Valid DssDriveQueryDTO dto, BindingResult bindingResult) {
  48 + List<NewDriver> drivers = newDriverService.list();
  49 + return convertDssDriveVo(drivers);
  50 + }
  51 +
  52 + @ApiOperation("终端同步人脸数据结果上报")
  53 + @PostMapping(value = "/syn/resData")
  54 + public AjaxResult insertDriver(@Valid ResDataDriveDTO dto, BindingResult bindingResult) {
  55 + if (bindingResult.hasErrors()) {
  56 + return AjaxResult.error(bindingResult.getFieldError().getDefaultMessage());
  57 + }
  58 + NewDriver newDriver = convertNewDriver(dto);
  59 + boolean flag = newDriverService.updateClient(newDriver);
  60 + return flag ? AjaxResult.success() : AjaxResult.error();
  61 + }
  62 +
  63 + @ApiOperation(("人脸注册"))
  64 + @PostMapping(value = "FaceRegister")
  65 + public AjaxResult faceRegister(@Valid FaceRegisterDTO dto, BindingResult bindingResult) {
  66 + if (bindingResult.hasErrors()) {
  67 + return AjaxResult.error(bindingResult.getFieldError().getDefaultMessage());
  68 + }
  69 + NewDriver newDriver = convertFaceRegister(dto);
  70 + boolean flag = newDriverService.faceRegister(newDriver);
  71 + return flag ? AjaxResult.success() : AjaxResult.error();
  72 + }
  73 +
  74 +
  75 + private List<DssDriveVo> convertDssDriveVo(List<NewDriver> newDrivers) {
  76 + if (CollectionUtils.isEmpty(newDrivers)) {
  77 + return Collections.emptyList();
  78 + }
  79 +
  80 + return newDrivers.stream().map(driver -> {
  81 + DssDriveVo vo = new DssDriveVo();
  82 + vo.setStaffId(driver.getJobCode());
  83 + vo.setStaffName(driver.getPersonnelName());
  84 + vo.setIcCardNo(driver.getIcCardCode());
  85 + vo.setFacePhotoPath(driver.getImage());
  86 + vo.setCsn(driver.getIdRfid());
  87 + vo.setFaceFeature(driver.getFaceFeature());
  88 + vo.setBlueTooth(driver.getBlueTooth());
  89 + vo.setSynContent(driver.getSyncontent());
  90 +
  91 + Integer post = DrivePosEnum.getObjValueOfLabel(driver.getPosts());
  92 + Set<Integer> posts = new HashSet<>();
  93 + posts.add(post);
  94 +
  95 + vo.setStaffTypeItem(posts);
  96 +
  97 + return vo;
  98 + }).collect(Collectors.toList());
  99 + }
  100 +
  101 + private NewDriver convertNewDriver(ResDataDriveDTO dto) {
  102 + NewDriver newDriver = new NewDriver();
  103 + newDriver.setJobCode(dto.getStaffId());
  104 +// newDriver.setPersonnelName(dto.getStaffName());
  105 +// newDriver.setIcCardCode(dto.getIcCardNo());
  106 + newDriver.setImage(dto.getFacePhotoPath());
  107 + newDriver.setFaceFeature(dto.getFaceFeature());
  108 + newDriver.setBlueTooth(dto.getBlueTooth());
  109 + newDriver.setInteger(dto.getInteger());
  110 + newDriver.setSyncontent((dto.getSynContent()));
  111 + newDriver.setCsn(dto.getCsn());
  112 +
  113 + return null;
  114 + }
  115 +
  116 + private NewDriver convertFaceRegister(FaceRegisterDTO dto) {
  117 + NewDriver newDriver = new NewDriver();
  118 + newDriver.setIcCardCode(dto.getFaceValue());
  119 + newDriver.setFaceSignIn(1);
  120 + newDriver.setSignInEquipment(dto.getDriverCode());
  121 + newDriver.setImage(dto.getFaceValue());
  122 +
  123 + return newDriver;
  124 + }
  125 +
  126 +
  127 +}
... ...
Bsth-admin/src/main/java/com/ruoyi/controller/equipment/heartbeat/LingangEquipmentHeartbeatController.java 0 → 100644
  1 +package com.ruoyi.controller.equipment.heartbeat;
  2 +
  3 +import com.ruoyi.common.core.controller.BaseController;
  4 +import com.ruoyi.common.core.domain.AjaxResult;
  5 +import com.ruoyi.domain.equipment.heartbeat.LingangEquipmentHeartbeat;
  6 +import com.ruoyi.domain.equipment.heartbeat.dto.LingangEquipmentHeartbeatAddDTO;
  7 +import com.ruoyi.domain.equipment.heartbeat.dto.LingangEquipmentHeartbeatQueryDTO;
  8 +import com.ruoyi.domain.equipment.heartbeat.dto.LingangEquipmentHeartbeatUpdateDTO;
  9 +import com.ruoyi.domain.equipment.heartbeat.vo.LingangEquipmentHeartbeatVO;
  10 +import com.ruoyi.service.equipment.heartbeat.LingangEquipmentHeartbeatService;
  11 +import io.swagger.annotations.Api;
  12 +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 +
  19 +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;
  33 +
  34 +import javax.servlet.http.HttpServletResponse;
  35 +import javax.validation.Valid;
  36 +
  37 +import org.springframework.validation.BindingResult;
  38 +
  39 +
  40 +@RestController
  41 +@Api(tags = "设备心跳包")
  42 +@RequestMapping("LinGang/equipment/heartbeat")
  43 +public class LingangEquipmentHeartbeatController extends BaseController {
  44 + @Autowired
  45 + private LingangEquipmentHeartbeatService lingangEquipmentHeartbeatService;
  46 +
  47 + @ApiOperation("分页查询")
  48 + @PreAuthorize("@ss.hasPermi('LinGang:equipment:heartbeat:list:limit:page:limit')")
  49 + @PostMapping(value = "/list/limit/{page}/{pageLimit}")
  50 + public String listLimit(@ModelAttribute LingangEquipmentHeartbeatQueryDTO request, @ModelAttribute OrderEntity orderEntity, @PathVariable Integer page, @PathVariable Integer pageLimit, org.springframework.ui.Model model) {
  51 +
  52 + LingangEquipmentHeartbeat entity = convert(request);
  53 + IPage<LingangEquipmentHeartbeat> response = lingangEquipmentHeartbeatService.pageList(new Page<LingangEquipmentHeartbeat>(page, pageLimit), entity, orderEntity);
  54 +
  55 + return JSON.toJSONString(convert(response));
  56 + }
  57 +
  58 + @ApiOperation("根据ID查询详情")
  59 + @GetMapping(value = "/view/{id}")
  60 + public com.ruoyi.common.core.domain.AjaxResult view(@PathVariable("id") Long id, org.springframework.ui.Model model) {
  61 + LingangEquipmentHeartbeat source = lingangEquipmentHeartbeatService.getById(id);
  62 +
  63 + return com.ruoyi.common.core.domain.AjaxResult.success(convert(source));
  64 + }
  65 +
  66 +
  67 + @PreAuthorize("@ss.hasPermi('LinGang:equipment:heartbeat:export')")
  68 + @ApiOperation("导出")
  69 + @PostMapping("/export")
  70 + public void export(HttpServletResponse response, @RequestBody LingangEquipmentHeartbeatQueryDTO request) {
  71 + LingangEquipmentHeartbeat entity = convert(request);
  72 + List<LingangEquipmentHeartbeat> list = lingangEquipmentHeartbeatService.list(entity);
  73 + ExcelUtil<LingangEquipmentHeartbeat> util = new ExcelUtil<LingangEquipmentHeartbeat>(LingangEquipmentHeartbeat.class);
  74 + util.exportExcel(response, list, "LingangEquipmentHeartbeat");
  75 + }
  76 +
  77 + @ApiOperation("添加")
  78 + @PreAuthorize("@ss.hasPermi('LinGang:equipment:heartbeat:add')")
  79 + @PostMapping(value = "/add")
  80 + public com.ruoyi.common.core.domain.AjaxResult add(@Valid @ModelAttribute LingangEquipmentHeartbeatAddDTO request, BindingResult bindingResult) {
  81 + if (bindingResult.hasErrors()) {
  82 + return AjaxResult.error(bindingResult.getFieldError().getDefaultMessage());
  83 + }
  84 + LingangEquipmentHeartbeat entity = convert(request);
  85 + entity.setCreateBy(getUserId());
  86 + entity.setCreateTime(new Date());
  87 + 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("添加数据失败,请稍后再试");
  89 + }
  90 +
  91 + @ApiOperation("修改")
  92 + @PreAuthorize("@ss.hasPermi('LinGang:equipment:heartbeat:update')")
  93 + @PostMapping(value = "/update")
  94 + public com.ruoyi.common.core.domain.AjaxResult update(@Valid @ModelAttribute LingangEquipmentHeartbeatUpdateDTO request, BindingResult bindingResult) {
  95 + if (bindingResult.hasErrors()) {
  96 + return AjaxResult.error(bindingResult.getFieldError().getDefaultMessage());
  97 + }
  98 + LingangEquipmentHeartbeat entity = convert(request);
  99 + entity.setUpdateby(getUserId());
  100 + entity.setUpdateTime(new Date());
  101 + boolean flag = lingangEquipmentHeartbeatService.updateByPrimaryKey(entity);
  102 + return flag ? com.ruoyi.common.core.domain.AjaxResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.AjaxResult.error("修改数据失败,请稍后再试");
  103 + }
  104 +
  105 + @PreAuthorize("@ss.hasPermi('LinGang:equipment:heartbeat:del')")
  106 + @ApiOperation("删除数据")
  107 + @GetMapping(value = "/del/{id}")
  108 + public com.ruoyi.common.core.domain.AjaxResult delById(@PathVariable("id") Long id) {
  109 + boolean flag = lingangEquipmentHeartbeatService.deleteById(id);
  110 + return flag ? com.ruoyi.common.core.domain.AjaxResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.AjaxResult.error("操作数据失败,请稍后再试");
  111 + }
  112 +
  113 + private LingangEquipmentHeartbeat convert(LingangEquipmentHeartbeatQueryDTO source) {
  114 + return java.util.Optional.ofNullable(source).map(sc -> {
  115 + LingangEquipmentHeartbeat target = new LingangEquipmentHeartbeat();
  116 + BeanUtils.copyProperties(sc, target);
  117 + return target;
  118 + }).orElse(null);
  119 + }
  120 +
  121 + private LingangEquipmentHeartbeat convert(LingangEquipmentHeartbeatUpdateDTO source) {
  122 + return java.util.Optional.ofNullable(source).map(sc -> {
  123 + LingangEquipmentHeartbeat target = new LingangEquipmentHeartbeat();
  124 + BeanUtils.copyProperties(sc, target);
  125 + return target;
  126 + }).orElse(null);
  127 + }
  128 +
  129 +
  130 + private LingangEquipmentHeartbeat convert(LingangEquipmentHeartbeatAddDTO source) {
  131 + return java.util.Optional.ofNullable(source).map(sc -> {
  132 + LingangEquipmentHeartbeat target = new LingangEquipmentHeartbeat();
  133 + BeanUtils.copyProperties(sc, target);
  134 + return target;
  135 + }).orElseGet(null);
  136 + }
  137 +
  138 + private LingangEquipmentHeartbeatVO convert(LingangEquipmentHeartbeat source) {
  139 + return java.util.Optional.ofNullable(source).map(sc -> {
  140 + LingangEquipmentHeartbeatVO target = new LingangEquipmentHeartbeatVO();
  141 + BeanUtils.copyProperties(source, target);
  142 + return target;
  143 + }).orElseGet(null);
  144 + }
  145 +
  146 + private List<LingangEquipmentHeartbeatVO> convert(List<LingangEquipmentHeartbeat> sources) {
  147 + return java.util.Optional.ofNullable(sources).map(scs -> {
  148 + return scs.stream().map(source -> {
  149 + return convert(source);
  150 + }).collect(java.util.stream.Collectors.toList());
  151 + }).orElseGet(null);
  152 + }
  153 +
  154 + private IPage<LingangEquipmentHeartbeatVO> convert(IPage<LingangEquipmentHeartbeat> sources) {
  155 + return java.util.Optional.ofNullable(sources).map(scs -> {
  156 + IPage<LingangEquipmentHeartbeatVO> target = new Page();
  157 + BeanUtils.copyProperties(scs, target);
  158 + List<LingangEquipmentHeartbeatVO> voNames = convert(scs.getRecords());
  159 + target.setRecords(voNames);
  160 +
  161 + return target;
  162 + }).orElseGet(null);
  163 + }
  164 +}
0 165 \ No newline at end of file
... ...
Bsth-admin/src/main/java/com/ruoyi/controller/equipment/self/check/LingangEquimentSelfCheckController.java 0 → 100644
  1 +package com.ruoyi.controller.equipment.self.check;
  2 +
  3 +import com.ruoyi.common.core.controller.BaseController;
  4 +import com.ruoyi.common.core.domain.AjaxResult;
  5 +import com.ruoyi.domain.equipment.self.check.LingangEquimentSelfCheck;
  6 +import com.ruoyi.domain.equipment.self.check.dto.LingangEquimentSelfCheckAddDTO;
  7 +import com.ruoyi.domain.equipment.self.check.dto.LingangEquimentSelfCheckQueryDTO;
  8 +import com.ruoyi.domain.equipment.self.check.dto.LingangEquimentSelfCheckUpdateDTO;
  9 +import com.ruoyi.domain.equipment.self.check.dto.LingangEquimentSelfCheckUpdateStatusDTO;
  10 +import com.ruoyi.domain.equipment.self.check.vo.LingangEquimentSelfCheckVO;
  11 +import com.ruoyi.service.equipment.self.check.LingangEquimentSelfCheckService;
  12 +import io.swagger.annotations.Api;
  13 +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 +
  20 +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;
  34 +
  35 +import javax.servlet.http.HttpServletResponse;
  36 +import javax.validation.Valid;
  37 +
  38 +import org.springframework.validation.BindingResult;
  39 +
  40 +
  41 +@RestController
  42 +@Api(tags = "设备自检")
  43 +@RequestMapping("LinGang/equiment/self/check")
  44 +public class LingangEquimentSelfCheckController extends BaseController {
  45 + @Autowired
  46 + private LingangEquimentSelfCheckService lingangEquimentSelfCheckService;
  47 +
  48 + @ApiOperation("分页查询")
  49 + @PreAuthorize("@ss.hasPermi('LinGang:equiment:self:check:list:limit:page:limit')")
  50 + @PostMapping(value = "/list/limit/{page}/{pageLimit}")
  51 + public String listLimit(@ModelAttribute LingangEquimentSelfCheckQueryDTO request, @ModelAttribute OrderEntity orderEntity, @PathVariable Integer page, @PathVariable Integer pageLimit, org.springframework.ui.Model model) {
  52 + LingangEquimentSelfCheck entity = convert(request);
  53 + IPage<LingangEquimentSelfCheck> response = lingangEquimentSelfCheckService.pageList(new Page<LingangEquimentSelfCheck>(page, pageLimit), entity, orderEntity);
  54 +
  55 + return JSON.toJSONString(convert(response));
  56 + }
  57 +
  58 + @ApiOperation("根据ID查询详情")
  59 + @GetMapping(value = "/view/{id}")
  60 + public com.ruoyi.common.core.domain.AjaxResult view(@PathVariable("id") Long id, org.springframework.ui.Model model) {
  61 + LingangEquimentSelfCheck source = lingangEquimentSelfCheckService.getById(id);
  62 +
  63 + return com.ruoyi.common.core.domain.AjaxResult.success(convert(source));
  64 + }
  65 +
  66 +
  67 + @PreAuthorize("@ss.hasPermi('LinGang:equiment:self:check:export')")
  68 + @ApiOperation("导出")
  69 + @PostMapping("/export")
  70 + public void export(HttpServletResponse response, @RequestBody LingangEquimentSelfCheckQueryDTO request) {
  71 + LingangEquimentSelfCheck entity = convert(request);
  72 + List<LingangEquimentSelfCheck> list = lingangEquimentSelfCheckService.list(entity);
  73 + ExcelUtil<LingangEquimentSelfCheck> util = new ExcelUtil<LingangEquimentSelfCheck>(LingangEquimentSelfCheck.class);
  74 + util.exportExcel(response, list, "LingangEquimentSelfCheck");
  75 + }
  76 +
  77 + @ApiOperation("添加")
  78 + @PreAuthorize("@ss.hasPermi('LinGang:equiment:self:check:add')")
  79 + @PostMapping(value = "/add")
  80 + public com.ruoyi.common.core.domain.AjaxResult add(@Valid @ModelAttribute LingangEquimentSelfCheckAddDTO request, BindingResult bindingResult) {
  81 + if (bindingResult.hasErrors()) {
  82 + return AjaxResult.error(bindingResult.getFieldError().getDefaultMessage());
  83 + }
  84 + LingangEquimentSelfCheck entity = convert(request);
  85 + entity.setCreateBy(getUserId());
  86 + entity.setCreateTime(new Date());
  87 + 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("添加数据失败,请稍后再试");
  89 + }
  90 +
  91 + @ApiOperation("修改")
  92 + @PreAuthorize("@ss.hasPermi('LinGang:equiment:self:check:update')")
  93 + @PostMapping(value = "/update")
  94 + public com.ruoyi.common.core.domain.AjaxResult update(@Valid @ModelAttribute LingangEquimentSelfCheckUpdateDTO request, BindingResult bindingResult) {
  95 + if (bindingResult.hasErrors()) {
  96 + return AjaxResult.error(bindingResult.getFieldError().getDefaultMessage());
  97 + }
  98 + LingangEquimentSelfCheck entity = convert(request);
  99 + entity.setUpdateBy(getUserId());
  100 + entity.setUpdateTime(new Date());
  101 + boolean flag = lingangEquimentSelfCheckService.updateByPrimaryKey(entity);
  102 + return flag ? com.ruoyi.common.core.domain.AjaxResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.AjaxResult.error("修改数据失败,请稍后再试");
  103 + }
  104 +
  105 + @ApiOperation("修改状态")
  106 + @PreAuthorize("@ss.hasPermi('LinGang:equiment:self:check:update:status')")
  107 + @PostMapping(value = "/update/status")
  108 + public com.ruoyi.common.core.domain.AjaxResult updateState(@ModelAttribute LingangEquimentSelfCheckUpdateStatusDTO request) {
  109 + LingangEquimentSelfCheck entity = convert(request);
  110 + boolean flag = lingangEquimentSelfCheckService.updateByPrimaryKey(entity);
  111 + return flag ? com.ruoyi.common.core.domain.AjaxResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.AjaxResult.error("修改数据失败,请稍后再试");
  112 + }
  113 +
  114 + private LingangEquimentSelfCheck convert(LingangEquimentSelfCheckQueryDTO source) {
  115 + return java.util.Optional.ofNullable(source).map(sc -> {
  116 + LingangEquimentSelfCheck target = new LingangEquimentSelfCheck();
  117 + BeanUtils.copyProperties(sc, target);
  118 + return target;
  119 + }).orElse(null);
  120 + }
  121 +
  122 + private LingangEquimentSelfCheck convert(LingangEquimentSelfCheckUpdateDTO source) {
  123 + return java.util.Optional.ofNullable(source).map(sc -> {
  124 + LingangEquimentSelfCheck target = new LingangEquimentSelfCheck();
  125 + BeanUtils.copyProperties(sc, target);
  126 + return target;
  127 + }).orElse(null);
  128 + }
  129 +
  130 + private LingangEquimentSelfCheck convert(LingangEquimentSelfCheckUpdateStatusDTO source) {
  131 + return java.util.Optional.ofNullable(source).map(sc -> {
  132 + LingangEquimentSelfCheck target = new LingangEquimentSelfCheck();
  133 + BeanUtils.copyProperties(sc, target);
  134 + return target;
  135 + }).orElse(null);
  136 + }
  137 +
  138 + private LingangEquimentSelfCheck convert(LingangEquimentSelfCheckAddDTO source) {
  139 + return java.util.Optional.ofNullable(source).map(sc -> {
  140 + LingangEquimentSelfCheck target = new LingangEquimentSelfCheck();
  141 + BeanUtils.copyProperties(sc, target);
  142 + return target;
  143 + }).orElseGet(null);
  144 + }
  145 +
  146 + private LingangEquimentSelfCheckVO convert(LingangEquimentSelfCheck source) {
  147 + return java.util.Optional.ofNullable(source).map(sc -> {
  148 + LingangEquimentSelfCheckVO target = new LingangEquimentSelfCheckVO();
  149 + BeanUtils.copyProperties(source, target);
  150 + return target;
  151 + }).orElseGet(null);
  152 + }
  153 +
  154 + private List<LingangEquimentSelfCheckVO> convert(List<LingangEquimentSelfCheck> sources) {
  155 + return java.util.Optional.ofNullable(sources).map(scs -> {
  156 + return scs.stream().map(source -> {
  157 + return convert(source);
  158 + }).collect(java.util.stream.Collectors.toList());
  159 + }).orElseGet(null);
  160 + }
  161 +
  162 + private IPage<LingangEquimentSelfCheckVO> convert(IPage<LingangEquimentSelfCheck> sources) {
  163 + return java.util.Optional.ofNullable(sources).map(scs -> {
  164 + IPage<LingangEquimentSelfCheckVO> target = new Page();
  165 + BeanUtils.copyProperties(scs, target);
  166 + List<LingangEquimentSelfCheckVO> voNames = convert(scs.getRecords());
  167 + target.setRecords(voNames);
  168 +
  169 + return target;
  170 + }).orElseGet(null);
  171 + }
  172 +}
0 173 \ No newline at end of file
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/driver/NewDriver.java
... ... @@ -128,6 +128,31 @@ public class NewDriver {
128 128 private String fleetName;
129 129  
130 130  
  131 + /***人脸识别特征*/
  132 + @Excel(name = "人脸识别特征")
  133 + private java.lang.String faceFeature;
  134 +
  135 +
  136 + /***手环mac地址*/
  137 + @Excel(name = "手环mac地址")
  138 + private java.lang.String blueTooth;
  139 +
  140 +
  141 + /***同步结果状态;0成功,1失败*/
  142 + @Excel(name = "同步结果状态;0成功,1失败")
  143 + private java.lang.Integer integer;
  144 +
  145 +
  146 + /***同步内容*/
  147 + @Excel(name = "同步内容")
  148 + private java.lang.String syncontent;
  149 +
  150 +
  151 + /***物理卡号*/
  152 + @Excel(name = "物理卡号")
  153 + private java.lang.String csn;
  154 +
  155 +
131 156 @Override
132 157 public String toString() {
133 158 return com.alibaba.fastjson2.JSON.toJSONString(this);
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/driver/dss/syn/DrivePosEnum.java 0 → 100644
  1 +package com.ruoyi.domain.driver.dss.syn;
  2 +
  3 +import org.apache.commons.lang3.StringUtils;
  4 +
  5 +import java.util.Arrays;
  6 +import java.util.Objects;
  7 +import java.util.Optional;
  8 +
  9 +public enum DrivePosEnum {
  10 + FLIGHT_ATTENDANTS(1, "乘务员"),
  11 + DRIVER(2, "驾驶员"),
  12 + CENTRALIZED_DISPATCH_CENTER(3, "集调中心"),
  13 + INSPECTION(4, "稽查"),
  14 + TICKETING(5, "票务"),
  15 + MANAGEMENT_PERSONNEL(6, "行管员"),
  16 + COLLECTION(7, "采集"),
  17 + MAINTENANCE_PERSONNEL(8, "机务员"),
  18 + DEPUTY_TEAM_LEADER(9, "副队长(工勤岗)"),
  19 + CLERKS(10, "办事员"),
  20 + ACCOUNTING_PERSONNEL(11, "核算员"),
  21 + SCHEDULING(12, "调度"),
  22 + INTERN_DRIVER(13, "实习驾驶员"),
  23 + STATION_STAFF(14, "站员"),
  24 + MECHANIC(15, "机工"),
  25 + STAFF(16, "科员"),
  26 + CAPTAIN(17, "队长"),
  27 + SECRETARY_OF_THE_FLEET_BRANCH(18, "车队支部书记"),
  28 + STATISTICIAN(19, "统计员"),
  29 + BORROWING(20, "借用"),
  30 + DISPATCH_PERSONNEL(21, "调派员"),
  31 + INTERN_FLIGHT_ATTENDANTS(22, "实习乘务员"),
  32 + DEPUTY_TEAM_LEADER_23(23, "副队长"),
  33 + ;
  34 + private Integer value;
  35 + private String label;
  36 +
  37 + DrivePosEnum(Integer value, String label) {
  38 + this.value = value;
  39 + this.label = label;
  40 + }
  41 +
  42 +
  43 + public Integer getValue() {
  44 + return value;
  45 + }
  46 +
  47 + public String getLabel() {
  48 + return label;
  49 + }
  50 +
  51 + public static DrivePosEnum getObjOfLabel(String label) {
  52 + if (StringUtils.isEmpty(label)) {
  53 + return null;
  54 + }
  55 + DrivePosEnum[] drivePosEnums = DrivePosEnum.values();
  56 + Optional<DrivePosEnum> option = Arrays.stream(drivePosEnums).filter(d -> Objects.equals(d.getLabel(), label)).findFirst();
  57 + return option.isPresent() ? option.get() : null;
  58 + }
  59 +
  60 + public static Integer getObjValueOfLabel(String label) {
  61 + DrivePosEnum drivePosEnum = getObjOfLabel(label);
  62 + return Objects.isNull(drivePosEnum) ? null : drivePosEnum.getValue();
  63 + }
  64 +}
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/driver/dss/syn/dto/DssDriveQueryDTO.java 0 → 100644
  1 +package com.ruoyi.domain.driver.dss.syn.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月11日 14:14
  12 + */
  13 +@Data
  14 +@ApiModel(value = "司机信息的DTO")
  15 +@Accessors(chain = true)
  16 +@EqualsAndHashCode(callSuper = false)
  17 +public class DssDriveQueryDTO implements java.io.Serializable {
  18 +
  19 + private static final long serialVersionUID = 3923463555521298326L;
  20 + @ApiModelProperty(value = "设备上线号", required = true)
  21 + private String device;
  22 + @ApiModelProperty(value = "设备ID", required = true)
  23 + private String deviceId;
  24 + @ApiModelProperty(value = "终端人脸数据版本 null终端无记录")
  25 + private String versionNo;
  26 +}
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/driver/dss/syn/login/dto/LoginDriverDTO.java 0 → 100644
  1 +package com.ruoyi.domain.driver.dss.syn.login.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月11日 16:39
  16 + */
  17 +@Data
  18 +@ApiModel(value = "人员登录设备")
  19 +@Accessors(chain = true)
  20 +@EqualsAndHashCode(callSuper = false)
  21 +public class LoginDriverDTO implements java.io.Serializable {
  22 +
  23 + private static final long serialVersionUID = -1677262685203673206L;
  24 + @NotNull(message = "设备上线号不能为空")
  25 + @ApiModelProperty(value = "设备上线号", required = true)
  26 + private String device;
  27 +
  28 + @NotNull(message = "登录校验类型不能为空")
  29 + @ApiModelProperty(value = "登录校验类型;0:卡号登录,1:人脸登录", required = true)
  30 + private String authType;
  31 +
  32 + @NotNull(message = "登录校验信息 不能为空")
  33 + @ApiModelProperty(value = "登录校验类型; 登录校验信息 卡号或人脸图片数据,图片数据格式为BASE64", required = true)
  34 + private String authValue;
  35 +
  36 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  37 + @ApiModelProperty(value = "登录校验时间:yyyy-MM-dd HH:mm:ss")
  38 + private Date authTime;
  39 +
  40 +
  41 +}
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/driver/dss/syn/login/vo/LoginDriverVo.java 0 → 100644
  1 +package com.ruoyi.domain.driver.dss.syn.login.vo;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonProperty;
  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 java.util.Set;
  13 +
  14 +/**
  15 + * @author liujun
  16 + * @date 2024年07月11日 16:49
  17 + */
  18 +@Data
  19 +@NoArgsConstructor
  20 +@AllArgsConstructor
  21 +@Accessors(chain = true)
  22 +@ApiModel(value = "人员登录设备")
  23 +@EqualsAndHashCode(callSuper = false)
  24 +public class LoginDriverVo {
  25 + @ApiModelProperty("IC卡号")
  26 + private String driverCode;
  27 + @ApiModelProperty("司机名称")
  28 + private String driverName;
  29 + @ApiModelProperty("司机工号")
  30 + private String workCode;
  31 + @ApiModelProperty("司机工号")
  32 + private String staffCode;
  33 + @ApiModelProperty("角色编码")
  34 + private Integer staffType;
  35 +
  36 + @ApiModelProperty("人脸信息")
  37 + @JsonProperty("userInfoDto")
  38 + private LoginUserInfoVo userInfo;
  39 +
  40 + @ApiModelProperty("解析后的访问图片地址")
  41 + private String cropFacePhotoUrl;
  42 + @ApiModelProperty("角色编码列表:1员工,2司机,3钥匙柜管理员,4移车员")
  43 + private Set<Integer> staffTypeItem;
  44 +
  45 + @ApiModelProperty("手环蓝牙名称")
  46 + private String blueTooth;
  47 + @ApiModelProperty("岗前检测要求:0:否,1:强制")
  48 + private Integer healthCheck;
  49 +
  50 + @ApiModelProperty("当日最后一次登签的签到状态:0:未签到,1:已签到")
  51 + private Integer signInType;
  52 + @ApiModelProperty("当日最后一次登签的签退状态:0:未签退,1:已签退")
  53 + private Integer signOutType;
  54 +
  55 + @ApiModelProperty(value = "人脸识别特征值")
  56 + private String faceFeature;
  57 + @ApiModelProperty(value = "同步状态")
  58 + private Integer synState;
  59 + @ApiModelProperty(value = "同步内容")
  60 + private String synContent;
  61 + @ApiModelProperty(value = "员工物理卡号")
  62 + private String csn;
  63 +
  64 +}
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/driver/dss/syn/login/vo/LoginUserInfoVo.java 0 → 100644
  1 +package com.ruoyi.domain.driver.dss.syn.login.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月11日 16:57
  14 + */
  15 +@Data
  16 +@NoArgsConstructor
  17 +@AllArgsConstructor
  18 +@Accessors(chain = true)
  19 +@ApiModel(value = "人脸信息")
  20 +@EqualsAndHashCode(callSuper = false)
  21 +public class LoginUserInfoVo implements java.io.Serializable {
  22 + private static final long serialVersionUID = -9051242373397682607L;
  23 +
  24 + @ApiModelProperty("员工id")
  25 + private String staffId;
  26 + @ApiModelProperty("员工姓名")
  27 + private String staffName;
  28 + @ApiModelProperty("IC卡号")
  29 + private String icCardNo;
  30 + @ApiModelProperty("原始图片地址")
  31 + private String facePhotoPath;
  32 +}
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/driver/dss/syn/res/dto/FaceRegisterDTO.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.NotNull;
  13 +import java.util.Date;
  14 +
  15 +/**
  16 + * @author liujun
  17 + * @date 2024年07月11日 17:29
  18 + */
  19 +@Data
  20 +@NoArgsConstructor
  21 +@AllArgsConstructor
  22 +@Accessors(chain = true)
  23 +@ApiModel(value = "人脸注册")
  24 +@EqualsAndHashCode(callSuper = false)
  25 +public class FaceRegisterDTO implements java.io.Serializable {
  26 +
  27 + private static final long serialVersionUID = 228485023686482474L;
  28 + @NotNull(message = "设备上线号 不能为空")
  29 + @ApiModelProperty(value = "设备上线号", required = true)
  30 + private String device;
  31 + @NotNull(message = "IC卡号 不能为空")
  32 + @ApiModelProperty(value = "IC卡号", required = true)
  33 + private String driverCode;
  34 +
  35 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  36 + @ApiModelProperty(value = "时间")
  37 + private Date regTime;
  38 + @NotNull(message = "人脸图片数据 不能为空")
  39 + @ApiModelProperty(value = "人脸图片数据", required = true)
  40 + private String faceValue;
  41 +}
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/driver/dss/syn/res/dto/ResDataDriveDTO.java 0 → 100644
  1 +package com.ruoyi.domain.driver.dss.syn.res.dto;
  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 +import javax.validation.constraints.NotNull;
  12 +import java.util.Set;
  13 +
  14 +/**
  15 + * @author liujun
  16 + * @date 2024年07月11日 15:04
  17 + */
  18 +@Data
  19 +@NoArgsConstructor
  20 +@AllArgsConstructor
  21 +@Accessors(chain = true)
  22 +@ApiModel(value = "终端同步人脸数据结果上报")
  23 +@EqualsAndHashCode(callSuper = false)
  24 +public class ResDataDriveDTO implements java.io.Serializable {
  25 +
  26 + private static final long serialVersionUID = -815323242596921313L;
  27 + @NotNull(message = "服务器人脸信息版本号不能为空")
  28 + @ApiModelProperty(value = "服务器人脸信息版本号", required = true)
  29 + private String versionNo;
  30 +
  31 + @NotNull(message = "设备上线号不能为空")
  32 + @ApiModelProperty(value = "设备上线号", required = true)
  33 + private String device;
  34 +
  35 + @NotNull(message = "设备ID不能为空")
  36 + @ApiModelProperty(value = "设备ID", required = true)
  37 + private String deviceId;
  38 +
  39 + @NotNull(message = "员工id不能为空")
  40 + @ApiModelProperty(value = "员工id", required = true)
  41 + private String staffId;
  42 + @ApiModelProperty(value = "员工姓名")
  43 + private String staffName;
  44 + @ApiModelProperty(value = "IC卡号")
  45 + private String icCardNo;
  46 + @ApiModelProperty(value = "原始图片地址")
  47 + private String facePhotoPath;
  48 + @ApiModelProperty(value = "人脸识别特征值")
  49 + private String faceFeature;
  50 + @ApiModelProperty(value = "手环mac地址")
  51 + private String blueTooth;
  52 + @ApiModelProperty(value = "工号")
  53 + private String staffCode;
  54 +
  55 + @NotNull(message = "同步结果状态不能为空")
  56 + @ApiModelProperty(value = "同步结果状态;0成功,1失败", required = true, example = "1")
  57 + private Integer integer;
  58 +
  59 + @NotNull(message = "同步内容不能为空")
  60 + @ApiModelProperty(value = "同步内容", required = true)
  61 + private String synContent;
  62 +
  63 + @NotNull(message = "物理卡号不能为空")
  64 + @ApiModelProperty(value = "物理卡号", required = true)
  65 + private String csn;
  66 +
  67 + @ApiModelProperty(value = "角色类型列表")
  68 + private Set<Integer> staffTypeItem;
  69 +}
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/driver/dss/syn/vo/DssDriveVo.java 0 → 100644
  1 +package com.ruoyi.domain.driver.dss.syn.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 +import java.util.Set;
  12 +
  13 +/**
  14 + * @author liujun
  15 + * @date 2024年07月11日 14:02
  16 + */
  17 +@Data
  18 +@NoArgsConstructor
  19 +@AllArgsConstructor
  20 +@Accessors(chain = true)
  21 +@ApiModel(value = "终端同步人脸数据VO")
  22 +@EqualsAndHashCode(callSuper = false)
  23 +public class DssDriveVo {
  24 + @ApiModelProperty("员工id")
  25 + private String staffId;
  26 + @ApiModelProperty("员工姓名")
  27 + private String staffName;
  28 + @ApiModelProperty("IC卡号")
  29 + private String icCardNo;
  30 + @ApiModelProperty("原始图片地址")
  31 + private String facePhotoPath;
  32 + @ApiModelProperty(value = "人脸识别特征值")
  33 + private String faceFeature;
  34 + @ApiModelProperty(value = "手环mac地址")
  35 + private String blueTooth;
  36 + @ApiModelProperty(value = "同步状态", example = "1")
  37 + private Integer synState;
  38 + @ApiModelProperty(value = "同步内容")
  39 + private String synContent;
  40 +
  41 + @ApiModelProperty("物理卡号")
  42 + private String csn;
  43 + @ApiModelProperty("角色类型 1:员工 2:驾驶员 3管理员 4移车员")
  44 + private Set<Integer> staffTypeItem;
  45 +}
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/driver/dto/NewDriverAddDTO.java
... ... @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode;
7 7 import lombok.experimental.Accessors;
8 8  
9 9 @Data
10   -@ApiModel(value="司机信息的添加DTO")
  10 +@ApiModel(value = "司机信息的添加DTO")
11 11 @Accessors(chain = true)
12 12 @EqualsAndHashCode(callSuper = false)
13 13 public class NewDriverAddDTO implements java.io.Serializable {
... ... @@ -79,10 +79,26 @@ public class NewDriverAddDTO implements java.io.Serializable {
79 79 /***车队名称*/
80 80 @ApiModelProperty(value = "车队名称")
81 81 private String fleetName;
  82 + /***人脸识别特征*/
  83 + @ApiModelProperty(value = "人脸识别特征")
  84 + private java.lang.String faceFeature;
  85 + /***手环mac地址*/
  86 + @ApiModelProperty(value = "手环mac地址")
  87 + private java.lang.String blueTooth;
  88 + /***同步结果状态;0成功,1失败*/
  89 + @ApiModelProperty(value = "同步结果状态;0成功,1失败", example = "1")
  90 + private java.lang.Integer integer;
  91 + /***同步内容*/
  92 + @ApiModelProperty(value = "同步内容")
  93 + private java.lang.String syncontent;
  94 + /***物理卡号*/
  95 + @ApiModelProperty(value = "物理卡号")
  96 + private java.lang.String csn;
82 97 /***操作人员*/
83 98 @ApiModelProperty(value = "操作人员")
84 99 private String operator;
85 100  
  101 +
86 102 public void clearStrEmpty() {
87 103 if (org.apache.commons.lang3.StringUtils.isEmpty(this.jobCode)) {
88 104 this.jobCode = null;
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/driver/dto/NewDriverQueryDTO.java
... ... @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode;
7 7 import lombok.experimental.Accessors;
8 8  
9 9 @Data
10   -@ApiModel(value="司机信息的查询DTO")
  10 +@ApiModel(value = "司机信息的查询DTO")
11 11 @Accessors(chain = true)
12 12 @EqualsAndHashCode(callSuper = false)
13 13 public class NewDriverQueryDTO implements java.io.Serializable {
... ... @@ -80,6 +80,22 @@ public class NewDriverQueryDTO implements java.io.Serializable {
80 80 @ApiModelProperty(value = "车队名称")
81 81 private String fleetName;
82 82  
  83 + /***人脸识别特征*/
  84 + @ApiModelProperty(value = "人脸识别特征")
  85 + private java.lang.String faceFeature;
  86 + /***手环mac地址*/
  87 + @ApiModelProperty(value = "手环mac地址")
  88 + private java.lang.String blueTooth;
  89 + /***同步结果状态;0成功,1失败*/
  90 + @ApiModelProperty(value = "同步结果状态;0成功,1失败", example = "1")
  91 + private java.lang.Integer integer;
  92 + /***同步内容*/
  93 + @ApiModelProperty(value = "同步内容")
  94 + private java.lang.String syncontent;
  95 + /***物理卡号*/
  96 + @ApiModelProperty(value = "物理卡号")
  97 + private java.lang.String csn;
  98 +
83 99 public void clearStrEmpty() {
84 100 if (org.apache.commons.lang3.StringUtils.isEmpty(this.jobCode)) {
85 101 this.jobCode = null;
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/driver/dto/NewDriverUpdateDTO.java
... ... @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode;
7 7 import lombok.experimental.Accessors;
8 8  
9 9 @Data
10   -@ApiModel(value="司机信息的修改DTO")
  10 +@ApiModel(value = "司机信息的修改DTO")
11 11 @Accessors(chain = true)
12 12 @EqualsAndHashCode(callSuper = false)
13 13 public class NewDriverUpdateDTO implements java.io.Serializable {
... ... @@ -79,6 +79,22 @@ public class NewDriverUpdateDTO implements java.io.Serializable {
79 79 /***车队名称*/
80 80 @ApiModelProperty(value = "车队名称")
81 81 private String fleetName;
  82 +
  83 + /***人脸识别特征*/
  84 + @ApiModelProperty(value = "人脸识别特征")
  85 + private java.lang.String faceFeature;
  86 + /***手环mac地址*/
  87 + @ApiModelProperty(value = "手环mac地址")
  88 + private java.lang.String blueTooth;
  89 + /***同步结果状态;0成功,1失败*/
  90 + @ApiModelProperty(value = "同步结果状态;0成功,1失败", example = "1")
  91 + private java.lang.Integer integer;
  92 + /***同步内容*/
  93 + @ApiModelProperty(value = "同步内容")
  94 + private java.lang.String syncontent;
  95 + /***物理卡号*/
  96 + @ApiModelProperty(value = "物理卡号")
  97 + private java.lang.String csn;
82 98 /***操作人员*/
83 99 @ApiModelProperty(value = "操作人员")
84 100 private String operator;
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/driver/vo/NewDriverVO.java
... ... @@ -9,7 +9,7 @@ import lombok.experimental.Accessors;
9 9 import org.apache.commons.lang3.StringUtils;
10 10  
11 11 @Data
12   -@ApiModel(value="司机信息的VO")
  12 +@ApiModel(value = "司机信息的VO")
13 13 @Accessors(chain = true)
14 14 @EqualsAndHashCode(callSuper = false)
15 15 public class NewDriverVO implements java.io.Serializable {
... ... @@ -82,6 +82,22 @@ public class NewDriverVO implements java.io.Serializable {
82 82 @ApiModelProperty(value = "车队名称")
83 83 private String fleetName;
84 84  
  85 + /***人脸识别特征*/
  86 + @ApiModelProperty(value = "人脸识别特征")
  87 + private java.lang.String faceFeature;
  88 + /***手环mac地址*/
  89 + @ApiModelProperty(value = "手环mac地址")
  90 + private java.lang.String blueTooth;
  91 + /***同步结果状态;0成功,1失败*/
  92 + @ApiModelProperty(value = "同步结果状态;0成功,1失败", example = "1")
  93 + private java.lang.Integer integer;
  94 + /***同步内容*/
  95 + @ApiModelProperty(value = "同步内容")
  96 + private java.lang.String syncontent;
  97 + /***物理卡号*/
  98 + @ApiModelProperty(value = "物理卡号")
  99 + private java.lang.String csn;
  100 +
85 101  
86 102 public String getPersonnelNameAndJobCode() {
87 103 if (StringUtils.isNotEmpty(this.getPersonnelName()) && StringUtils.isNotEmpty(this.getJobCode())) {
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/dss/equipment/dto/EquipmentAuthDTO.java 0 → 100644
  1 +package com.ruoyi.domain.dss.equipment.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 javax.validation.constraints.NotNull;
  10 +import java.util.Date;
  11 +
  12 +/**
  13 + * @author liujun
  14 + * @date 2024年07月05日 15:26
  15 + */
  16 +@Data
  17 +@ApiModel(value = "设备获取访问令牌")
  18 +@Accessors(chain = true)
  19 +@EqualsAndHashCode(callSuper = false)
  20 +public class EquipmentAuthDTO {
  21 + @NotNull(message = "设备号不能为空")
  22 + @ApiModelProperty(value = "设备上线号", required = true)
  23 + private String device;
  24 + @ApiModelProperty(value = "获取token设备时间", required = true)
  25 + private Date authTime;
  26 +}
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/dss/equipment/dto/EquipmentSelfcheckCamerasDto.java 0 → 100644
  1 +package com.ruoyi.domain.dss.equipment.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 javax.validation.constraints.NotNull;
  10 +
  11 +/**
  12 + * @author liujun
  13 + * @date 2024年07月11日 10:54
  14 + */
  15 +@Data
  16 +@ApiModel(value = "设备自检-摄像头状态")
  17 +@Accessors(chain = true)
  18 +@EqualsAndHashCode(callSuper = false)
  19 +public class EquipmentSelfcheckCamerasDto implements java.io.Serializable {
  20 +
  21 +
  22 + private static final long serialVersionUID = 4430525531496917296L;
  23 +
  24 + @NotNull(message = "摄像头编号不能为空")
  25 + @ApiModelProperty(value = "摄像头编号", required = true, example = "1")
  26 + private Integer camera;
  27 + @NotNull(message = "摄像头状态不能为空")
  28 + @ApiModelProperty(value = "状态 0正常,1故障,2未检测到", required = true, example = "1")
  29 + private Integer status;
  30 +}
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/dss/equipment/dto/EquipmentSelfcheckDto.java 0 → 100644
  1 +package com.ruoyi.domain.dss.equipment.dto;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +import com.fasterxml.jackson.annotation.JsonProperty;
  5 +import io.swagger.annotations.ApiModel;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import lombok.Data;
  8 +import lombok.EqualsAndHashCode;
  9 +import lombok.experimental.Accessors;
  10 +
  11 +import javax.validation.constraints.NotNull;
  12 +import java.util.Date;
  13 +import java.util.List;
  14 +
  15 +/**
  16 + * @author liujun
  17 + * @date 2024年07月11日 10:54
  18 + */
  19 +@Data
  20 +@ApiModel(value = "设备自检DTO")
  21 +@Accessors(chain = true)
  22 +@EqualsAndHashCode(callSuper = false)
  23 +public class EquipmentSelfcheckDto implements java.io.Serializable {
  24 +
  25 + private static final long serialVersionUID = 1874941263694729359L;
  26 +
  27 + @NotNull(message = "设备上线号不能为空")
  28 + @ApiModelProperty(value = "设备上线号", required = true)
  29 + private String device;
  30 +
  31 + @NotNull(message = "设备应用版本号不能为空")
  32 + @ApiModelProperty(value = "设备应用版本号", required = true)
  33 + @JsonProperty("app_version")
  34 + private String appVersion;
  35 +
  36 + @ApiModelProperty(value = "酒测仪状态:1正常,2故障,null/3未检测到")
  37 + private Integer wine;
  38 +
  39 + @NotNull(message = "摄像头不能为空")
  40 + @ApiModelProperty(value = "摄像头状态", required = true)
  41 + private List<EquipmentSelfcheckCamerasDto> cameras;
  42 +
  43 + @ApiModelProperty(value = "测温仪状态:1正常,2故障,null/3未检测到", example = "1")
  44 + private Integer therm;
  45 +
  46 + @ApiModelProperty(value = "喇叭状态:1正常,2故障,null/3未检测到", example = "1")
  47 + private Integer horn;
  48 +
  49 + @ApiModelProperty(value = "麦克风状态:1正常,2故障,null/3未检测到", example = "1")
  50 + private Integer mike;
  51 +
  52 + @ApiModelProperty(value = "锁控状态:1正常,2故障,null/3未检测到", example = "1")
  53 + private Integer lock;
  54 +
  55 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  56 + @ApiModelProperty(value = "时间格式为:yyyy-MM-dd HH:mm:ss")
  57 + private Date time;
  58 +
  59 + @ApiModelProperty(value = "设备类型")
  60 + private String deviceTyp;
  61 +
  62 + @ApiModelProperty(value = "是否拥有钥匙柜外设:null/0:否,1:是", example = "1")
  63 + private Integer isKeybox;
  64 +
  65 +
  66 +}
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/dss/equipment/dto/ExKeysDTO.java 0 → 100644
  1 +package com.ruoyi.domain.dss.equipment.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 javax.validation.constraints.NotNull;
  10 +
  11 +/**
  12 + * @author liujun
  13 + * @date 2024年07月05日 16:34
  14 + */
  15 +@Data
  16 +@ApiModel(value = "钥匙孔位异常信息")
  17 +@Accessors(chain = true)
  18 +@EqualsAndHashCode(callSuper = false)
  19 +public class ExKeysDTO implements java.io.Serializable {
  20 +
  21 + private static final long serialVersionUID = -6900289229012374739L;
  22 + @NotNull(message = "设备号不能为空")
  23 + @ApiModelProperty(value = "设备上线号", required = true)
  24 + private String device;
  25 + @NotNull(message = "钥匙位号不能为空")
  26 + @ApiModelProperty(value = "钥匙位号", required = true)
  27 + private Integer key;
  28 + @ApiModelProperty(value = "场站车位编号")
  29 + private String parkCode;
  30 + @ApiModelProperty(value = "车牌")
  31 + private String plate;
  32 +}
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/dss/equipment/dto/HeartbeatDTO.java 0 → 100644
  1 +package com.ruoyi.domain.dss.equipment.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 +import java.util.List;
  13 +
  14 +/**
  15 + * @author liujun
  16 + * @date 2024年07月05日 16:30
  17 + */
  18 +@Data
  19 +@ApiModel(value = "设备报警信息(心跳包)")
  20 +@Accessors(chain = true)
  21 +@EqualsAndHashCode(callSuper = false)
  22 +public class HeartbeatDTO implements java.io.Serializable {
  23 +
  24 +
  25 + private static final long serialVersionUID = 5168784920496912635L;
  26 +
  27 + @NotNull(message = "设备号不能为空")
  28 + @ApiModelProperty(value = "设备上线号", required = true)
  29 + private String device;
  30 +
  31 + @NotNull(message = "时间不能为空")
  32 + @ApiModelProperty(value = "时间 格式:utc:yyyy-MM-dd HH:mm:ss", required = true)
  33 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  34 + private Date time;
  35 +
  36 + @ApiModelProperty(value = "报警类型列表;0:钥匙孔位异常报警")
  37 + private Integer[] alarm;
  38 +
  39 + @ApiModelProperty(value = "钥匙孔位异常信息列表")
  40 + private List<ExKeysDTO> exKeys;
  41 +
  42 +
  43 +}
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/dss/equipment/vo/AuthVo.java 0 → 100644
  1 +package com.ruoyi.domain.dss.equipment.vo;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonProperty;
  4 +import io.swagger.annotations.ApiModel;
  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月05日 15:59
  14 + */
  15 +@Data
  16 +@NoArgsConstructor
  17 +@AllArgsConstructor
  18 +@ApiModel(value = "设备获取访问令牌")
  19 +@Accessors(chain = true)
  20 +@EqualsAndHashCode(callSuper = false)
  21 +public class AuthVo {
  22 + @JsonProperty("access_token")
  23 + private String accessToken;
  24 +}
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/dss/equipment/vo/EquimentAddressParamVo.java 0 → 100644
  1 +package com.ruoyi.domain.dss.equipment.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月05日 17:40
  14 + */
  15 +@Data
  16 +@NoArgsConstructor
  17 +@AllArgsConstructor
  18 +@ApiModel(value = "升级设置")
  19 +@Accessors(chain = true)
  20 +@EqualsAndHashCode(callSuper = false)
  21 +public class EquimentAddressParamVo {
  22 + @ApiModelProperty(value = "升级地址")
  23 + private String upgradeAddress;
  24 + @ApiModelProperty(value = "端口", example = "1")
  25 + private Integer integer;
  26 +}
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/dss/equipment/vo/EquimentVideoParamVo.java 0 → 100644
  1 +package com.ruoyi.domain.dss.equipment.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月05日 17:39
  14 + */
  15 +@Data
  16 +@NoArgsConstructor
  17 +@AllArgsConstructor
  18 +@ApiModel(value = "升级设置")
  19 +@Accessors(chain = true)
  20 +@EqualsAndHashCode(callSuper = false)
  21 +public class EquimentVideoParamVo {
  22 + @ApiModelProperty(value = "视频是否上传 0 不上传, 1 上传", example = "1")
  23 + private Integer upflag;
  24 + @ApiModelProperty(value = "视频上传上传间隔单位:秒", example = "1")
  25 + private Integer timespan;
  26 + @ApiModelProperty(value = "视频上传地址果为空,采用原先上传地址")
  27 + private String url;
  28 + @ApiModelProperty(value = "本地视频保留天数", example = "1")
  29 + private Integer saveday;
  30 + @ApiModelProperty(value = "上传时间段", example = "1")
  31 + private String videoTimeSlot;
  32 +}
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/dss/equipment/vo/EquipmentConfigVo.java 0 → 100644
  1 +package com.ruoyi.domain.dss.equipment.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 +import java.math.BigDecimal;
  12 +
  13 +/**
  14 + * @author liujun
  15 + * @date 2024年07月05日 17:37
  16 + */
  17 +@Data
  18 +@NoArgsConstructor
  19 +@AllArgsConstructor
  20 +@ApiModel(value = "设备获取远程参数配置")
  21 +@Accessors(chain = true)
  22 +@EqualsAndHashCode(callSuper = false)
  23 +public class EquipmentConfigVo implements java.io.Serializable {
  24 +
  25 + private static final long serialVersionUID = -3893021736941993364L;
  26 + private Integer promiseSwitch;
  27 +
  28 + @ApiModelProperty(value = "饮酒限制值")
  29 + private BigDecimal drinking;
  30 + @ApiModelProperty(value = "醉酒限制值")
  31 + private BigDecimal drunkenness;
  32 + @ApiModelProperty(value = "视频参数")
  33 + private EquimentVideoParamVo videoParam;
  34 + @ApiModelProperty(value = "升级设置")
  35 + private EquimentAddressParamVo addressParam;
  36 +}
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/equipment/heartbeat/LingangEquipmentHeartbeat.java 0 → 100644
  1 +package com.ruoyi.domain.equipment.heartbeat;
  2 +
  3 +import lombok.Data;
  4 +import com.baomidou.mybatisplus.annotation.IdType;
  5 +import com.baomidou.mybatisplus.annotation.TableField;
  6 +import com.baomidou.mybatisplus.annotation.TableId;
  7 +import com.baomidou.mybatisplus.annotation.TableName;
  8 +import org.apache.commons.lang3.StringUtils;
  9 +import lombok.EqualsAndHashCode;
  10 +import lombok.experimental.Accessors;
  11 +import lombok.extern.slf4j.Slf4j;
  12 +import lombok.NoArgsConstructor;
  13 +import lombok.AllArgsConstructor;
  14 +import com.ruoyi.common.annotation.Excel;
  15 +
  16 +
  17 +@Data
  18 +@Slf4j
  19 +@NoArgsConstructor
  20 +@AllArgsConstructor
  21 +@Accessors(chain = true)
  22 +@EqualsAndHashCode(callSuper = false)
  23 +@TableName("equipment_heartbeat")
  24 +/**设备心跳包 实体*/
  25 +public class LingangEquipmentHeartbeat {
  26 + /***主键*/
  27 + @TableId(value = "id", type = IdType.AUTO)
  28 + @Excel(name = "主键")
  29 + private Long id;
  30 +
  31 +
  32 + /***设备号*/
  33 + @Excel(name = "设备号")
  34 + private String device;
  35 +
  36 +
  37 + /***时间*/
  38 + @Excel(name = "时间")
  39 + private java.util.Date time;
  40 +
  41 +
  42 + /***报价类型,0:钥匙孔位异常报警*/
  43 + @Excel(name = "报价类型,0:钥匙孔位异常报警")
  44 + private Integer alarm;
  45 +
  46 +
  47 + /***钥匙孔位异常信息*/
  48 + @Excel(name = "钥匙孔位异常信息")
  49 + private String exkeys;
  50 +
  51 +
  52 + /***创建时间*/
  53 + @Excel(name = "创建时间")
  54 + private java.util.Date createTime;
  55 +
  56 +
  57 + /***创建人员*/
  58 + @Excel(name = "创建人员")
  59 + private Long createBy;
  60 +
  61 +
  62 + /***修改时间*/
  63 + @Excel(name = "修改时间")
  64 + private java.util.Date updateTime;
  65 +
  66 +
  67 + /***修改人员*/
  68 + @Excel(name = "修改人员")
  69 + private Long updateby;
  70 +
  71 +
  72 + @Override
  73 + public String toString() {
  74 + return com.alibaba.fastjson2.JSON.toJSONString(this);
  75 + }
  76 +}
0 77 \ No newline at end of file
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/equipment/heartbeat/dto/LingangEquipmentHeartbeatAddDTO.java 0 → 100644
  1 +package com.ruoyi.domain.equipment.heartbeat.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 +@Data
  10 +@ApiModel(value = "设备心跳包的添加DTO")
  11 +@Accessors(chain = true)
  12 +@EqualsAndHashCode(callSuper = false)
  13 +/**设备心跳包 DTO*/
  14 +public class LingangEquipmentHeartbeatAddDTO implements java.io.Serializable {
  15 + private static final long serialVersionUID = 215432779L;
  16 +
  17 + /***主键*/
  18 + @ApiModelProperty(value = "主键", example = "1")
  19 + private Long id;
  20 + /***设备号*/
  21 + @ApiModelProperty(value = "设备号")
  22 + private String device;
  23 + /***时间*/
  24 + @ApiModelProperty(value = "时间")
  25 + private java.util.Date time;
  26 + /***报价类型,0:钥匙孔位异常报警*/
  27 + @ApiModelProperty(value = "报价类型,0:钥匙孔位异常报警", example = "1")
  28 + private Integer alarm;
  29 + /***钥匙孔位异常信息*/
  30 + @ApiModelProperty(value = "钥匙孔位异常信息")
  31 + private String exkeys;
  32 + /***创建时间*/
  33 + @ApiModelProperty(value = "创建时间")
  34 + private java.util.Date createTime;
  35 + /***创建人员*/
  36 + @ApiModelProperty(value = "创建人员")
  37 + private String createBy;
  38 + /***修改时间*/
  39 + @ApiModelProperty(value = "修改时间")
  40 + private java.util.Date updateTime;
  41 + /***修改人员*/
  42 + @ApiModelProperty(value = "修改人员")
  43 + private String updateby;
  44 + /***操作人员*/
  45 + @ApiModelProperty(value = "操作人员")
  46 + private String operator;
  47 +
  48 +
  49 + @Override
  50 + public String toString() {
  51 + return com.alibaba.fastjson2.JSON.toJSONString(this);
  52 + }
  53 +}
0 54 \ No newline at end of file
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/equipment/heartbeat/dto/LingangEquipmentHeartbeatQueryDTO.java 0 → 100644
  1 +package com.ruoyi.domain.equipment.heartbeat.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 +@Data
  10 +@ApiModel(value = "设备心跳包的查询DTO")
  11 +@Accessors(chain = true)
  12 +@EqualsAndHashCode(callSuper = false)
  13 +/**设备心跳包 DTO*/
  14 +public class LingangEquipmentHeartbeatQueryDTO implements java.io.Serializable {
  15 + private static final long serialVersionUID = 324800120L;
  16 +
  17 + /***主键*/
  18 + @ApiModelProperty(value = "主键", example = "1")
  19 + private Long id;
  20 + /***设备号*/
  21 + @ApiModelProperty(value = "设备号")
  22 + private String device;
  23 + /***时间*/
  24 + @ApiModelProperty(value = "时间")
  25 + private java.util.Date time;
  26 + /***报价类型,0:钥匙孔位异常报警*/
  27 + @ApiModelProperty(value = "报价类型,0:钥匙孔位异常报警", example = "1")
  28 + private Integer alarm;
  29 + /***钥匙孔位异常信息*/
  30 + @ApiModelProperty(value = "钥匙孔位异常信息")
  31 + private String exkeys;
  32 + /***创建时间*/
  33 + @ApiModelProperty(value = "创建时间")
  34 + private java.util.Date createTime;
  35 + /***创建人员*/
  36 + @ApiModelProperty(value = "创建人员")
  37 + private String createBy;
  38 + /***修改时间*/
  39 + @ApiModelProperty(value = "修改时间")
  40 + private java.util.Date updateTime;
  41 + /***修改人员*/
  42 + @ApiModelProperty(value = "修改人员")
  43 + private String updateby;
  44 +
  45 +
  46 +
  47 + @Override
  48 + public String toString() {
  49 + return com.alibaba.fastjson2.JSON.toJSONString(this);
  50 + }
  51 +}
0 52 \ No newline at end of file
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/equipment/heartbeat/dto/LingangEquipmentHeartbeatUpdateDTO.java 0 → 100644
  1 +package com.ruoyi.domain.equipment.heartbeat.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 +@Data
  10 +@ApiModel(value = "设备心跳包的修改DTO")
  11 +@Accessors(chain = true)
  12 +@EqualsAndHashCode(callSuper = false)
  13 +/**设备心跳包 DTO*/
  14 +public class LingangEquipmentHeartbeatUpdateDTO implements java.io.Serializable {
  15 + private static final long serialVersionUID = 216573576L;
  16 +
  17 + /***主键*/
  18 + @ApiModelProperty(value = "主键", example = "1")
  19 + private Long id;
  20 + /***设备号*/
  21 + @ApiModelProperty(value = "设备号")
  22 + private String device;
  23 + /***时间*/
  24 + @ApiModelProperty(value = "时间")
  25 + private java.util.Date time;
  26 + /***报价类型,0:钥匙孔位异常报警*/
  27 + @ApiModelProperty(value = "报价类型,0:钥匙孔位异常报警", example = "1")
  28 + private Integer alarm;
  29 + /***钥匙孔位异常信息*/
  30 + @ApiModelProperty(value = "钥匙孔位异常信息")
  31 + private String exkeys;
  32 + /***创建时间*/
  33 + @ApiModelProperty(value = "创建时间")
  34 + private java.util.Date createTime;
  35 + /***创建人员*/
  36 + @ApiModelProperty(value = "创建人员")
  37 + private String createBy;
  38 + /***修改时间*/
  39 + @ApiModelProperty(value = "修改时间")
  40 + private java.util.Date updateTime;
  41 + /***修改人员*/
  42 + @ApiModelProperty(value = "修改人员")
  43 + private String updateby;
  44 + /***操作人员*/
  45 + @ApiModelProperty(value = "操作人员")
  46 + private String operator;
  47 +
  48 +
  49 + @Override
  50 + public String toString() {
  51 + return com.alibaba.fastjson2.JSON.toJSONString(this);
  52 + }
  53 +}
0 54 \ No newline at end of file
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/equipment/heartbeat/vo/LingangEquipmentHeartbeatVO.java 0 → 100644
  1 +package com.ruoyi.domain.equipment.heartbeat.vo;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +import lombok.Data;
  7 +import lombok.EqualsAndHashCode;
  8 +import lombok.experimental.Accessors;
  9 +import lombok.NoArgsConstructor;
  10 +import lombok.AllArgsConstructor;
  11 +
  12 +@Data
  13 +@NoArgsConstructor
  14 +@AllArgsConstructor
  15 +@ApiModel(value = "设备心跳包的VO")
  16 +@Accessors(chain = true)
  17 +@EqualsAndHashCode(callSuper = false)
  18 +/**设备心跳包 VO*/
  19 +public class LingangEquipmentHeartbeatVO implements java.io.Serializable {
  20 + private static final long serialVersionUID = 546198584L;
  21 +
  22 + /***主键*/
  23 + @ApiModelProperty(value = "主键", example = "1")
  24 + private Long id;
  25 + /***设备号*/
  26 + @ApiModelProperty(value = "设备号")
  27 + private String device;
  28 + /***时间*/
  29 + @ApiModelProperty(value = "时间")
  30 + private java.util.Date time;
  31 + /***报价类型,0:钥匙孔位异常报警*/
  32 + @ApiModelProperty(value = "报价类型,0:钥匙孔位异常报警", example = "1")
  33 + private Integer alarm;
  34 + /***钥匙孔位异常信息*/
  35 + @ApiModelProperty(value = "钥匙孔位异常信息")
  36 + private String exkeys;
  37 + /***创建时间*/
  38 + @ApiModelProperty(value = "创建时间")
  39 + private java.util.Date createTime;
  40 + /***创建人员*/
  41 + @ApiModelProperty(value = "创建人员")
  42 + private String createBy;
  43 + /***修改时间*/
  44 + @ApiModelProperty(value = "修改时间")
  45 + private java.util.Date updateTime;
  46 + /***修改人员*/
  47 + @ApiModelProperty(value = "修改人员")
  48 + private String updateby;
  49 +
  50 +
  51 + @Override
  52 + public String toString() {
  53 + return com.alibaba.fastjson2.JSON.toJSONString(this);
  54 + }
  55 +}
0 56 \ No newline at end of file
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/equipment/self/check/LingangEquimentSelfCheck.java 0 → 100644
  1 +package com.ruoyi.domain.equipment.self.check;
  2 +
  3 +import lombok.Data;
  4 +import com.baomidou.mybatisplus.annotation.IdType;
  5 +import com.baomidou.mybatisplus.annotation.TableField;
  6 +import com.baomidou.mybatisplus.annotation.TableId;
  7 +import com.baomidou.mybatisplus.annotation.TableName;
  8 +import org.apache.commons.lang3.StringUtils;
  9 +import lombok.EqualsAndHashCode;
  10 +import lombok.experimental.Accessors;
  11 +import lombok.extern.slf4j.Slf4j;
  12 +import lombok.NoArgsConstructor;
  13 +import lombok.AllArgsConstructor;
  14 +import com.ruoyi.common.annotation.Excel;
  15 +
  16 +
  17 +@Data
  18 +@Slf4j
  19 +@NoArgsConstructor
  20 +@AllArgsConstructor
  21 +@Accessors(chain = true)
  22 +@EqualsAndHashCode(callSuper = false)
  23 +@TableName("equiment_self_check")
  24 +/**设备自检 实体*/
  25 +public class LingangEquimentSelfCheck {
  26 + /***ID*/
  27 + @TableId(value = "id", type = IdType.AUTO)
  28 + @Excel(name = "ID")
  29 + private java.lang.Long id;
  30 +
  31 +
  32 + /***设备号*/
  33 + @Excel(name = "设备号")
  34 + private java.lang.String device;
  35 +
  36 +
  37 + /***设备版本号*/
  38 + @Excel(name = "设备版本号")
  39 + private java.lang.String appVersion;
  40 +
  41 +
  42 + /***酒测仪状态 1正常,2故障,null/3未检测到*/
  43 + @Excel(name = "酒测仪状态 1正常,2故障,null/3未检测到")
  44 + private java.lang.Integer wine;
  45 +
  46 +
  47 + /***摄像头状态*/
  48 + @Excel(name = "摄像头状态")
  49 + private java.lang.String cameras;
  50 +
  51 + @TableField(exist = false)
  52 + private Boolean camerasSaveExceptionFlag;
  53 +
  54 +
  55 + /***测温仪状态 1正常,2故障,null/3未检测到*/
  56 + @Excel(name = "测温仪状态 1正常,2故障,null/3未检测到")
  57 + private java.lang.Integer therm;
  58 +
  59 +
  60 + /***喇叭状态 1正常,2故障,null/3未检测到*/
  61 + @Excel(name = "喇叭状态 1正常,2故障,null/3未检测到")
  62 + private java.lang.Integer horn;
  63 +
  64 +
  65 + /***麦克风状态 1正常,2故障,null/3未检测到*/
  66 + @Excel(name = "麦克风状态 1正常,2故障,null/3未检测到")
  67 + private java.lang.Integer mike;
  68 +
  69 +
  70 + /***锁控状态 1正常,2故障,null/3未检测到*/
  71 + @Excel(name = "锁控状态 1正常,2故障,null/3未检测到")
  72 + private java.lang.Integer lock;
  73 +
  74 +
  75 + /***设备传过来的时间*/
  76 + @Excel(name = "设备传过来的时间")
  77 + private java.util.Date time;
  78 +
  79 +
  80 + /***设备类型*/
  81 + @Excel(name = "设备类型")
  82 + private java.lang.String devicetype;
  83 +
  84 +
  85 + /***是否拥有钥匙柜外设 null/0:否,1:是*/
  86 + @Excel(name = "是否拥有钥匙柜外设 null/0:否,1:是")
  87 + private java.lang.Boolean iskeybox;
  88 +
  89 +
  90 + /***异常ID*/
  91 + @Excel(name = "异常ID")
  92 + private java.lang.Long quipmentExceptionId;
  93 +
  94 +
  95 + /***创建人员*/
  96 + @Excel(name = "创建人员")
  97 + private Long createBy;
  98 +
  99 +
  100 + /***创建时间*/
  101 + @Excel(name = "创建时间")
  102 + private java.util.Date createTime;
  103 +
  104 +
  105 + /***修改人员*/
  106 + @Excel(name = "修改人员")
  107 + private Long updateBy;
  108 +
  109 +
  110 + /***修改时间*/
  111 + @Excel(name = "修改时间")
  112 + private java.util.Date updateTime;
  113 +
  114 +
  115 + @Override
  116 + public String toString() {
  117 + return com.alibaba.fastjson2.JSON.toJSONString(this);
  118 + }
  119 +}
0 120 \ No newline at end of file
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/equipment/self/check/dto/LingangEquimentSelfCheckAddDTO.java 0 → 100644
  1 +package com.ruoyi.domain.equipment.self.check.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 +@Data
  10 +@ApiModel(value = "设备自检的添加DTO")
  11 +@Accessors(chain = true)
  12 +@EqualsAndHashCode(callSuper = false)
  13 +/**设备自检 DTO*/
  14 +public class LingangEquimentSelfCheckAddDTO implements java.io.Serializable {
  15 + private static final long serialVersionUID = 223622531L;
  16 +
  17 + /***ID*/
  18 + @ApiModelProperty(value = "ID", example = "1")
  19 + private Long id;
  20 + /***设备号*/
  21 + @ApiModelProperty(value = "设备号")
  22 + private String device;
  23 + /***设备版本号*/
  24 + @ApiModelProperty(value = "设备版本号")
  25 + private String appVersion;
  26 + /***酒测仪状态 1正常,2故障,null/3未检测到*/
  27 + @ApiModelProperty(value = "酒测仪状态 1正常,2故障,null/3未检测到", example = "1")
  28 + private Integer wine;
  29 + /***摄像头状态*/
  30 + @ApiModelProperty(value = "摄像头状态")
  31 + private String cameras;
  32 + /***测温仪状态 1正常,2故障,null/3未检测到*/
  33 + @ApiModelProperty(value = "测温仪状态 1正常,2故障,null/3未检测到", example = "1")
  34 + private Integer therm;
  35 + /***喇叭状态 1正常,2故障,null/3未检测到*/
  36 + @ApiModelProperty(value = "喇叭状态 1正常,2故障,null/3未检测到", example = "1")
  37 + private Integer horn;
  38 + /***麦克风状态 1正常,2故障,null/3未检测到*/
  39 + @ApiModelProperty(value = "麦克风状态 1正常,2故障,null/3未检测到", example = "1")
  40 + private Integer mike;
  41 + /***锁控状态 1正常,2故障,null/3未检测到*/
  42 + @ApiModelProperty(value = "锁控状态 1正常,2故障,null/3未检测到", example = "1")
  43 + private Integer lock;
  44 + /***设备传过来的时间*/
  45 + @ApiModelProperty(value = "设备传过来的时间")
  46 + private java.util.Date time;
  47 + /***设备类型*/
  48 + @ApiModelProperty(value = "设备类型")
  49 + private String devicetype;
  50 + /***是否拥有钥匙柜外设 null/0:否,1:是*/
  51 + @ApiModelProperty(value = "是否拥有钥匙柜外设 null/0:否,1:是")
  52 + private Boolean iskeybox;
  53 + /***异常ID*/
  54 + @ApiModelProperty(value = "异常ID", example = "1")
  55 + private Long quipmentExceptionId;
  56 +
  57 +
  58 + @Override
  59 + public String toString() {
  60 + return com.alibaba.fastjson2.JSON.toJSONString(this);
  61 + }
  62 +}
0 63 \ No newline at end of file
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/equipment/self/check/dto/LingangEquimentSelfCheckQueryDTO.java 0 → 100644
  1 +package com.ruoyi.domain.equipment.self.check.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 +@Data
  10 +@ApiModel(value = "设备自检的查询DTO")
  11 +@Accessors(chain = true)
  12 +@EqualsAndHashCode(callSuper = false)
  13 +/**设备自检 DTO*/
  14 +public class LingangEquimentSelfCheckQueryDTO implements java.io.Serializable {
  15 + private static final long serialVersionUID = 242538649L;
  16 +
  17 + /***ID*/
  18 + @ApiModelProperty(value = "ID", example = "1")
  19 + private Long id;
  20 + /***设备号*/
  21 + @ApiModelProperty(value = "设备号")
  22 + private String device;
  23 + /***设备版本号*/
  24 + @ApiModelProperty(value = "设备版本号")
  25 + private String appVersion;
  26 + /***酒测仪状态 1正常,2故障,null/3未检测到*/
  27 + @ApiModelProperty(value = "酒测仪状态 1正常,2故障,null/3未检测到", example = "1")
  28 + private Integer wine;
  29 + /***摄像头状态*/
  30 + @ApiModelProperty(value = "摄像头状态")
  31 + private String cameras;
  32 + /***测温仪状态 1正常,2故障,null/3未检测到*/
  33 + @ApiModelProperty(value = "测温仪状态 1正常,2故障,null/3未检测到", example = "1")
  34 + private Integer therm;
  35 + /***喇叭状态 1正常,2故障,null/3未检测到*/
  36 + @ApiModelProperty(value = "喇叭状态 1正常,2故障,null/3未检测到", example = "1")
  37 + private Integer horn;
  38 + /***麦克风状态 1正常,2故障,null/3未检测到*/
  39 + @ApiModelProperty(value = "麦克风状态 1正常,2故障,null/3未检测到", example = "1")
  40 + private Integer mike;
  41 + /***锁控状态 1正常,2故障,null/3未检测到*/
  42 + @ApiModelProperty(value = "锁控状态 1正常,2故障,null/3未检测到", example = "1")
  43 + private Integer lock;
  44 + /***设备传过来的时间*/
  45 + @ApiModelProperty(value = "设备传过来的时间")
  46 + private java.util.Date time;
  47 + /***设备类型*/
  48 + @ApiModelProperty(value = "设备类型")
  49 + private String devicetype;
  50 + /***是否拥有钥匙柜外设 null/0:否,1:是*/
  51 + @ApiModelProperty(value = "是否拥有钥匙柜外设 null/0:否,1:是")
  52 + private Boolean iskeybox;
  53 + /***异常ID*/
  54 + @ApiModelProperty(value = "异常ID", example = "1")
  55 + private Long quipmentExceptionId;
  56 + /***创建人员*/
  57 + @ApiModelProperty(value = "创建人员")
  58 + private Long createBy;
  59 + /***创建时间*/
  60 + @ApiModelProperty(value = "创建时间")
  61 + private java.util.Date createTime;
  62 + /***修改人员*/
  63 + @ApiModelProperty(value = "修改人员")
  64 + private Long updateBy;
  65 + /***修改时间*/
  66 + @ApiModelProperty(value = "修改时间")
  67 + private java.util.Date updateTime;
  68 +
  69 +
  70 + @Override
  71 + public String toString() {
  72 + return com.alibaba.fastjson2.JSON.toJSONString(this);
  73 + }
  74 +}
0 75 \ No newline at end of file
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/equipment/self/check/dto/LingangEquimentSelfCheckUpdateDTO.java 0 → 100644
  1 +package com.ruoyi.domain.equipment.self.check.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 +@Data
  10 +@ApiModel(value = "设备自检的修改DTO")
  11 +@Accessors(chain = true)
  12 +@EqualsAndHashCode(callSuper = false)
  13 +/**设备自检 DTO*/
  14 +public class LingangEquimentSelfCheckUpdateDTO implements java.io.Serializable {
  15 + private static final long serialVersionUID = 294106603L;
  16 +
  17 + /***ID*/
  18 + @ApiModelProperty(value = "ID", example = "1")
  19 + private Long id;
  20 + /***设备号*/
  21 + @ApiModelProperty(value = "设备号")
  22 + private String device;
  23 + /***设备版本号*/
  24 + @ApiModelProperty(value = "设备版本号")
  25 + private String appVersion;
  26 + /***酒测仪状态 1正常,2故障,null/3未检测到*/
  27 + @ApiModelProperty(value = "酒测仪状态 1正常,2故障,null/3未检测到", example = "1")
  28 + private Integer wine;
  29 + /***摄像头状态*/
  30 + @ApiModelProperty(value = "摄像头状态")
  31 + private String cameras;
  32 + /***测温仪状态 1正常,2故障,null/3未检测到*/
  33 + @ApiModelProperty(value = "测温仪状态 1正常,2故障,null/3未检测到", example = "1")
  34 + private Integer therm;
  35 + /***喇叭状态 1正常,2故障,null/3未检测到*/
  36 + @ApiModelProperty(value = "喇叭状态 1正常,2故障,null/3未检测到", example = "1")
  37 + private Integer horn;
  38 + /***麦克风状态 1正常,2故障,null/3未检测到*/
  39 + @ApiModelProperty(value = "麦克风状态 1正常,2故障,null/3未检测到", example = "1")
  40 + private Integer mike;
  41 + /***锁控状态 1正常,2故障,null/3未检测到*/
  42 + @ApiModelProperty(value = "锁控状态 1正常,2故障,null/3未检测到", example = "1")
  43 + private Integer lock;
  44 + /***设备传过来的时间*/
  45 + @ApiModelProperty(value = "设备传过来的时间")
  46 + private java.util.Date time;
  47 + /***设备类型*/
  48 + @ApiModelProperty(value = "设备类型")
  49 + private String devicetype;
  50 + /***是否拥有钥匙柜外设 null/0:否,1:是*/
  51 + @ApiModelProperty(value = "是否拥有钥匙柜外设 null/0:否,1:是")
  52 + private Boolean iskeybox;
  53 + /***异常ID*/
  54 + @ApiModelProperty(value = "异常ID", example = "1")
  55 + private Long quipmentExceptionId;
  56 +
  57 +
  58 + @Override
  59 + public String toString() {
  60 + return com.alibaba.fastjson2.JSON.toJSONString(this);
  61 + }
  62 +}
0 63 \ No newline at end of file
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/equipment/self/check/dto/LingangEquimentSelfCheckUpdateStatusDTO.java 0 → 100644
  1 +package com.ruoyi.domain.equipment.self.check.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 +@Data
  10 +@ApiModel(value = "设备自检的修改状态DTO")
  11 +@Accessors(chain = true)
  12 +@EqualsAndHashCode(callSuper = false)
  13 +/**设备自检 DTO*/
  14 +public class LingangEquimentSelfCheckUpdateStatusDTO implements java.io.Serializable {
  15 + private static final long serialVersionUID = 507773646L;
  16 +
  17 + /***ID*/
  18 + @ApiModelProperty(value = "ID", example = "1")
  19 + private Long id;
  20 + /***设备号*/
  21 + @ApiModelProperty(value = "设备号")
  22 + private String device;
  23 + /***设备版本号*/
  24 + @ApiModelProperty(value = "设备版本号")
  25 + private String appVersion;
  26 + /***酒测仪状态 1正常,2故障,null/3未检测到*/
  27 + @ApiModelProperty(value = "酒测仪状态 1正常,2故障,null/3未检测到", example = "1")
  28 + private Integer wine;
  29 + /***摄像头状态*/
  30 + @ApiModelProperty(value = "摄像头状态")
  31 + private String cameras;
  32 + /***测温仪状态 1正常,2故障,null/3未检测到*/
  33 + @ApiModelProperty(value = "测温仪状态 1正常,2故障,null/3未检测到", example = "1")
  34 + private Integer therm;
  35 + /***喇叭状态 1正常,2故障,null/3未检测到*/
  36 + @ApiModelProperty(value = "喇叭状态 1正常,2故障,null/3未检测到", example = "1")
  37 + private Integer horn;
  38 + /***麦克风状态 1正常,2故障,null/3未检测到*/
  39 + @ApiModelProperty(value = "麦克风状态 1正常,2故障,null/3未检测到", example = "1")
  40 + private Integer mike;
  41 + /***锁控状态 1正常,2故障,null/3未检测到*/
  42 + @ApiModelProperty(value = "锁控状态 1正常,2故障,null/3未检测到", example = "1")
  43 + private Integer lock;
  44 + /***设备传过来的时间*/
  45 + @ApiModelProperty(value = "设备传过来的时间")
  46 + private java.util.Date time;
  47 + /***设备类型*/
  48 + @ApiModelProperty(value = "设备类型")
  49 + private String devicetype;
  50 + /***是否拥有钥匙柜外设 null/0:否,1:是*/
  51 + @ApiModelProperty(value = "是否拥有钥匙柜外设 null/0:否,1:是")
  52 + private Boolean iskeybox;
  53 + /***异常ID*/
  54 + @ApiModelProperty(value = "异常ID", example = "1")
  55 + private Long quipmentExceptionId;
  56 +
  57 +
  58 + @Override
  59 + public String toString() {
  60 + return com.alibaba.fastjson2.JSON.toJSONString(this);
  61 + }
  62 +}
0 63 \ No newline at end of file
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/equipment/self/check/vo/LingangEquimentSelfCheckVO.java 0 → 100644
  1 +package com.ruoyi.domain.equipment.self.check.vo;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +import lombok.Data;
  7 +import lombok.EqualsAndHashCode;
  8 +import lombok.experimental.Accessors;
  9 +import lombok.NoArgsConstructor;
  10 +import lombok.AllArgsConstructor;
  11 +
  12 +@Data
  13 +@NoArgsConstructor
  14 +@AllArgsConstructor
  15 +@ApiModel(value = "设备自检的VO")
  16 +@Accessors(chain = true)
  17 +@EqualsAndHashCode(callSuper = false)
  18 +/**设备自检 VO*/
  19 +public class LingangEquimentSelfCheckVO implements java.io.Serializable {
  20 + private static final long serialVersionUID = 884043618L;
  21 +
  22 + /***ID*/
  23 + @ApiModelProperty(value = "ID", example = "1")
  24 + private Long id;
  25 + /***设备号*/
  26 + @ApiModelProperty(value = "设备号")
  27 + private String device;
  28 + /***设备版本号*/
  29 + @ApiModelProperty(value = "设备版本号")
  30 + private String appVersion;
  31 + /***酒测仪状态 1正常,2故障,null/3未检测到*/
  32 + @ApiModelProperty(value = "酒测仪状态 1正常,2故障,null/3未检测到", example = "1")
  33 + private Integer wine;
  34 + /***摄像头状态*/
  35 + @ApiModelProperty(value = "摄像头状态")
  36 + private String cameras;
  37 + /***测温仪状态 1正常,2故障,null/3未检测到*/
  38 + @ApiModelProperty(value = "测温仪状态 1正常,2故障,null/3未检测到", example = "1")
  39 + private Integer therm;
  40 + /***喇叭状态 1正常,2故障,null/3未检测到*/
  41 + @ApiModelProperty(value = "喇叭状态 1正常,2故障,null/3未检测到", example = "1")
  42 + private Integer horn;
  43 + /***麦克风状态 1正常,2故障,null/3未检测到*/
  44 + @ApiModelProperty(value = "麦克风状态 1正常,2故障,null/3未检测到", example = "1")
  45 + private Integer mike;
  46 + /***锁控状态 1正常,2故障,null/3未检测到*/
  47 + @ApiModelProperty(value = "锁控状态 1正常,2故障,null/3未检测到", example = "1")
  48 + private Integer lock;
  49 + /***设备传过来的时间*/
  50 + @ApiModelProperty(value = "设备传过来的时间")
  51 + private java.util.Date time;
  52 + /***设备类型*/
  53 + @ApiModelProperty(value = "设备类型")
  54 + private String devicetype;
  55 + /***是否拥有钥匙柜外设 null/0:否,1:是*/
  56 + @ApiModelProperty(value = "是否拥有钥匙柜外设 null/0:否,1:是")
  57 + private Boolean iskeybox;
  58 + /***异常ID*/
  59 + @ApiModelProperty(value = "异常ID", example = "1")
  60 + private Integer quipmentExceptionId;
  61 + /***创建人员*/
  62 + @ApiModelProperty(value = "创建人员")
  63 + private Long createBy;
  64 + /***创建时间*/
  65 + @ApiModelProperty(value = "创建时间")
  66 + private java.util.Date createTime;
  67 + /***修改人员*/
  68 + @ApiModelProperty(value = "修改人员")
  69 + private Long updateBy;
  70 + /***修改时间*/
  71 + @ApiModelProperty(value = "修改时间")
  72 + private java.util.Date updateTime;
  73 +
  74 +
  75 + @Override
  76 + public String toString() {
  77 + return com.alibaba.fastjson2.JSON.toJSONString(this);
  78 + }
  79 +}
0 80 \ No newline at end of file
... ...
Bsth-admin/src/main/java/com/ruoyi/equipment/service/IEquipmentService.java
... ... @@ -11,19 +11,28 @@ import com.ruoyi.pojo.vo.EquipmentResponseVo;
11 11  
12 12 /**
13 13 * 设备信息Service接口
14   - *
  14 + *
15 15 * @author guzijian
16 16 * @date 2023-07-05
17 17 */
18   -public interface IEquipmentService extends IService<Equipment>
19   -{
  18 +public interface IEquipmentService extends IService<Equipment> {
20 19 /**
21 20 * 查询设备信息
22   - *
  21 + *
23 22 * @param id 设备信息主键
24 23 * @return 设备信息
25 24 */
26 25 public Equipment selectEquipmentById(Long id);
  26 +
  27 + /***
  28 + * 根据设备号查询设备信息
  29 + * @author liujun
  30 + * @date 2024/7/5 15:23
  31 + * @param deviceId
  32 + * @return com.ruoyi.equipment.domain.Equipment
  33 + */
  34 + Equipment getOneByDeviceId(String deviceId);
  35 +
27 36 /***
28 37 *用于页面选择
29 38 * @author liujun
... ... @@ -44,7 +53,7 @@ public interface IEquipmentService extends IService&lt;Equipment&gt;
44 53  
45 54 /**
46 55 * 查询设备信息列表
47   - *
  56 + *
48 57 * @param equipment 设备信息
49 58 * @return 设备信息集合
50 59 */
... ... @@ -52,7 +61,7 @@ public interface IEquipmentService extends IService&lt;Equipment&gt;
52 61  
53 62 /**
54 63 * 新增设备信息
55   - *
  64 + *
56 65 * @param equipment 设备信息
57 66 * @return 结果
58 67 */
... ... @@ -60,7 +69,7 @@ public interface IEquipmentService extends IService&lt;Equipment&gt;
60 69  
61 70 /**
62 71 * 修改设备信息
63   - *
  72 + *
64 73 * @param equipment 设备信息
65 74 * @return 结果
66 75 */
... ... @@ -68,7 +77,7 @@ public interface IEquipmentService extends IService&lt;Equipment&gt;
68 77  
69 78 /**
70 79 * 批量删除设备信息
71   - *
  80 + *
72 81 * @param ids 需要删除的设备信息主键集合
73 82 * @return 结果
74 83 */
... ... @@ -76,7 +85,7 @@ public interface IEquipmentService extends IService&lt;Equipment&gt;
76 85  
77 86 /**
78 87 * 删除设备信息信息
79   - *
  88 + *
80 89 * @param id 设备信息主键
81 90 * @return 结果
82 91 */
... ...
Bsth-admin/src/main/java/com/ruoyi/equipment/service/impl/EquipmentServiceImpl.java
... ... @@ -52,6 +52,13 @@ public class EquipmentServiceImpl extends ServiceImpl&lt;EquipmentMapper, Equipment
52 52 }
53 53  
54 54 @Override
  55 + public Equipment getOneByDeviceId(String deviceId) {
  56 + LambdaQueryWrapper<Equipment> wrapper = new LambdaQueryWrapper<>();
  57 + wrapper.eq(Equipment::getDeviceId, deviceId);
  58 + return getOne(wrapper);
  59 + }
  60 +
  61 + @Override
55 62 public List<Equipment> listOfSelect(Equipment equipment) {
56 63  
57 64 return equipmentMapper.queryIdsiteNameBypromise(equipment.getPromise());
... ...
Bsth-admin/src/main/java/com/ruoyi/mapper/equipment/heartbeat/LingangEquipmentHeartbeatMapper.java 0 → 100644
  1 +package com.ruoyi.mapper.equipment.heartbeat;
  2 +
  3 +import com.ruoyi.domain.equipment.heartbeat.LingangEquipmentHeartbeat;
  4 +import org.apache.ibatis.annotations.Mapper;
  5 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  6 +
  7 +
  8 +@Mapper
  9 +/**设备心跳包 Mapper接口*/
  10 +public interface LingangEquipmentHeartbeatMapper extends BaseMapper<LingangEquipmentHeartbeat> {
  11 + /**
  12 + * 插入有值的列
  13 + */
  14 + int insertSelective(LingangEquipmentHeartbeat name);
  15 +}
0 16 \ No newline at end of file
... ...
Bsth-admin/src/main/java/com/ruoyi/mapper/equipment/self/check/LingangEquimentSelfCheckMapper.java 0 → 100644
  1 +package com.ruoyi.mapper.equipment.self.check;
  2 +
  3 +import com.ruoyi.domain.equipment.self.check.LingangEquimentSelfCheck;
  4 +import org.apache.ibatis.annotations.Mapper;
  5 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  6 +
  7 +
  8 +@Mapper
  9 +/**设备自检 Mapper接口*/
  10 +public interface LingangEquimentSelfCheckMapper extends BaseMapper<LingangEquimentSelfCheck> {
  11 + /**
  12 + * 插入有值的列
  13 + */
  14 + int insertSelective(LingangEquimentSelfCheck name);
  15 +}
0 16 \ No newline at end of file
... ...
Bsth-admin/src/main/java/com/ruoyi/service/driver/NewDriverService.java
1   -package com;
  1 +package com.ruoyi.service.driver;
2 2  
3 3 import com.baomidou.mybatisplus.extension.service.IService;
4 4 import com.baomidou.mybatisplus.core.metadata.IPage;
... ... @@ -47,5 +47,24 @@ public interface NewDriverService extends IService&lt;NewDriver&gt; {
47 47 */
48 48 boolean updateByPrimaryKey(NewDriver entity);
49 49  
  50 + /**
  51 + * 同步客户端人脸数据
  52 + *
  53 + * @param entity
  54 + * @return boolean
  55 + * @author liujun
  56 + * @date 2024/7/11 16:07
  57 + */
  58 + boolean updateClient(NewDriver entity);
  59 +
  60 + /***
  61 + * 人脸注册
  62 + * @author liujun
  63 + * @date 2024/7/11 17:36
  64 + * @param entity
  65 + * @return boolean
  66 + */
  67 + boolean faceRegister(NewDriver entity);
  68 +
50 69 boolean deleteById(java.lang.String jobCode);
51 70 }
52 71 \ No newline at end of file
... ...
Bsth-admin/src/main/java/com/ruoyi/service/equipment/heartbeat/LingangEquipmentHeartbeatService.java 0 → 100644
  1 +package com.ruoyi.service.equipment.heartbeat;
  2 +
  3 +import com.baomidou.mybatisplus.extension.service.IService;
  4 +import com.baomidou.mybatisplus.core.metadata.IPage;
  5 +
  6 +import java.util.List;
  7 +
  8 +import com.ruoyi.domain.OrderEntity;
  9 +import com.ruoyi.domain.equipment.heartbeat.LingangEquipmentHeartbeat;
  10 +
  11 +
  12 +/**
  13 + * 设备心跳包 Service接口
  14 + */
  15 +public interface LingangEquipmentHeartbeatService extends IService<LingangEquipmentHeartbeat> {
  16 + /**
  17 + * 分页查询
  18 + */
  19 + IPage<LingangEquipmentHeartbeat> pageList(com.baomidou.mybatisplus.extension.plugins.pagination.Page<LingangEquipmentHeartbeat> page, LingangEquipmentHeartbeat entity, OrderEntity orderEntity);
  20 +
  21 + /**
  22 + * 带条件查询
  23 + */
  24 + List<LingangEquipmentHeartbeat> list(LingangEquipmentHeartbeat entity);
  25 +
  26 +
  27 +
  28 + /**
  29 + * 条件查询只返回一条数据的方法
  30 + */
  31 + LingangEquipmentHeartbeat getOne(LingangEquipmentHeartbeat entity);
  32 +
  33 + Integer countId(LingangEquipmentHeartbeat entity);
  34 +
  35 + /**
  36 + * 插入有值的列
  37 + */
  38 + int insertSelective(LingangEquipmentHeartbeat entity);
  39 +
  40 + /***插入数据*/
  41 + boolean insert(LingangEquipmentHeartbeat entity);
  42 +
  43 +
  44 +
  45 + /**
  46 + * 根据主键修改数据
  47 + */
  48 + boolean updateByPrimaryKey(LingangEquipmentHeartbeat entity);
  49 +
  50 + boolean deleteById(Long id);
  51 +}
0 52 \ No newline at end of file
... ...
Bsth-admin/src/main/java/com/ruoyi/service/equipment/self/check/LingangEquimentSelfCheckService.java 0 → 100644
  1 +package com.ruoyi.service.equipment.self.check;
  2 +
  3 +
  4 +import java.util.List;
  5 +
  6 +import com.baomidou.mybatisplus.core.metadata.IPage;
  7 +import com.baomidou.mybatisplus.extension.service.IService;
  8 +import com.ruoyi.domain.OrderEntity;
  9 +import com.ruoyi.domain.equipment.self.check.LingangEquimentSelfCheck;
  10 +
  11 +
  12 +/**
  13 + * 设备自检 Service接口
  14 + */
  15 +public interface LingangEquimentSelfCheckService extends IService<LingangEquimentSelfCheck> {
  16 + /**
  17 + * 分页查询
  18 + */
  19 + IPage<LingangEquimentSelfCheck> pageList(com.baomidou.mybatisplus.extension.plugins.pagination.Page<LingangEquimentSelfCheck> page, LingangEquimentSelfCheck entity, OrderEntity orderEntity);
  20 +
  21 + /**
  22 + * 带条件查询
  23 + */
  24 + List<LingangEquimentSelfCheck> list(LingangEquimentSelfCheck entity);
  25 +
  26 +
  27 +
  28 + /**
  29 + * 条件查询只返回一条数据的方法
  30 + */
  31 + LingangEquimentSelfCheck getOne(LingangEquimentSelfCheck entity);
  32 +
  33 + Integer countId(LingangEquimentSelfCheck entity);
  34 +
  35 + /**
  36 + * 插入有值的列
  37 + */
  38 + int insertSelective(LingangEquimentSelfCheck entity);
  39 +
  40 + /***插入数据*/
  41 + boolean insert(LingangEquimentSelfCheck entity);
  42 +
  43 + /**
  44 + * 根据主键修改数据
  45 + */
  46 + boolean updateByPrimaryKey(LingangEquimentSelfCheck entity);
  47 +
  48 + boolean deleteById(Long id);
  49 +
  50 +}
0 51 \ No newline at end of file
... ...
Bsth-admin/src/main/java/com/ruoyi/service/impl/driver/NewDriverServiceImpl.java
1 1 package com.ruoyi.service.impl.driver;
2 2  
  3 +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
  4 +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
  5 +import com.ruoyi.common.utils.StringUtils;
3 6 import com.ruoyi.domain.driver.NewDriver;
4 7 import com.ruoyi.mapper.driver.NewDriverMapper;
  8 +import com.ruoyi.service.driver.NewDriverService;
5 9 import org.apache.commons.collections4.CollectionUtils;
6 10 import org.springframework.beans.factory.annotation.Autowired;
7 11 import org.springframework.stereotype.Service;
... ... @@ -21,7 +25,7 @@ import java.util.List;
21 25 import com.ruoyi.domain.OrderEntity;
22 26  
23 27 @Service
24   -public class NewDriverServiceImpl extends ServiceImpl<NewDriverMapper, NewDriver> implements com.NewDriverService {
  28 +public class NewDriverServiceImpl extends ServiceImpl<NewDriverMapper, NewDriver> implements NewDriverService {
25 29 @Autowired
26 30 private NewDriverMapper newDriverMapper;
27 31  
... ... @@ -111,6 +115,29 @@ public class NewDriverServiceImpl extends ServiceImpl&lt;NewDriverMapper, NewDriver
111 115 return updateById(entity);
112 116 }
113 117  
  118 + @Override
  119 + public boolean updateClient(NewDriver entity) {
  120 + LambdaUpdateWrapper<NewDriver> wrapper = new LambdaUpdateWrapper<NewDriver>();
  121 +
  122 + wrapper.set(NewDriver::getImage, entity.getImage()).set(NewDriver::getFaceFeature, entity.getFaceFeature())
  123 + .set(NewDriver::getBlueTooth, entity.getBlueTooth()).set(NewDriver::getInteger, entity.getInteger())
  124 + .set(NewDriver::getSyncontent, entity.getSyncontent()).set(NewDriver::getCsn, entity.getCsn())
  125 + .eq(NewDriver::getJobCode, entity.getJobCode());
  126 +
  127 + return update(wrapper);
  128 + }
  129 +
  130 + @Override
  131 + public boolean faceRegister(NewDriver entity) {
  132 + LambdaUpdateWrapper<NewDriver> wrapper = new LambdaUpdateWrapper<NewDriver>();
  133 + //TODO 保存图片信息
  134 + wrapper.set(NewDriver::getImage, entity.getImage())
  135 + .set(NewDriver::getFaceSignIn, entity.getFaceSignIn())
  136 + .set(NewDriver::getSignInEquipment, entity.getFaceSignIn())
  137 + .eq(NewDriver::getJobCode, entity.getIcCardCode());
  138 + return update(wrapper);
  139 + }
  140 +
114 141 /***根据主键删除数据*/
115 142 @Override
116 143 public boolean deleteById(java.lang.String jobCode) {
... ... @@ -255,4 +282,5 @@ public class NewDriverServiceImpl extends ServiceImpl&lt;NewDriverMapper, NewDriver
255 282 }
256 283 }
257 284 }
  285 +
258 286 }
259 287 \ No newline at end of file
... ...
Bsth-admin/src/main/java/com/ruoyi/service/impl/equipment/heartbeat/LingangEquipmentHeartbeatServiceImpl.java 0 → 100644
  1 +package com.ruoyi.service.impl.equipment.heartbeat;
  2 +
  3 +import com.ruoyi.domain.equipment.heartbeat.LingangEquipmentHeartbeat;
  4 +import com.ruoyi.mapper.equipment.heartbeat.LingangEquipmentHeartbeatMapper;
  5 +import com.ruoyi.service.equipment.heartbeat.LingangEquipmentHeartbeatService;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.stereotype.Service;
  8 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  9 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  10 +import com.baomidou.mybatisplus.core.metadata.IPage;
  11 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  12 +
  13 +import com.github.pagehelper.PageHelper;
  14 +
  15 +
  16 +import java.util.Collections;
  17 +import java.util.List;
  18 +
  19 +import com.ruoyi.domain.OrderEntity;
  20 +
  21 +@Service
  22 +/**设备心跳包 Service实现类*/
  23 +public class LingangEquipmentHeartbeatServiceImpl extends ServiceImpl<LingangEquipmentHeartbeatMapper, LingangEquipmentHeartbeat> implements LingangEquipmentHeartbeatService {
  24 + @Autowired
  25 + private LingangEquipmentHeartbeatMapper lingangEquipmentHeartbeatMapper;
  26 +
  27 + /**
  28 + * 分页查询
  29 + */
  30 + @Override
  31 + public IPage<LingangEquipmentHeartbeat> pageList(Page<LingangEquipmentHeartbeat> page, LingangEquipmentHeartbeat entity, OrderEntity orderEntity) {
  32 + LambdaQueryWrapper<LingangEquipmentHeartbeat> countWrapper = new LambdaQueryWrapper<>(entity);
  33 + countWrapper.select(LingangEquipmentHeartbeat::getId);
  34 + int count = count(countWrapper);
  35 +
  36 + List<LingangEquipmentHeartbeat> lists = Collections.emptyList();
  37 + if (count > 0) {
  38 + PageHelper.startPage((int) page.getCurrent(), (int) page.getSize(), false);
  39 + LambdaQueryWrapper<LingangEquipmentHeartbeat> selectWrapper = new LambdaQueryWrapper<>(entity);
  40 + orderColumn(selectWrapper, orderEntity);
  41 + lists = list(selectWrapper);
  42 + }
  43 +
  44 + IPage<LingangEquipmentHeartbeat> returnPage = new Page<LingangEquipmentHeartbeat>();
  45 + returnPage.setRecords(lists);
  46 + returnPage.setPages(count % page.getSize() == 0 ? count / page.getSize() : count / page.getSize() + 1);
  47 + returnPage.setCurrent(page.getCurrent());
  48 + returnPage.setSize(page.getSize());
  49 + returnPage.setTotal(count);
  50 +
  51 + return returnPage;
  52 + }
  53 +
  54 + @Override
  55 + public List<LingangEquipmentHeartbeat> list(LingangEquipmentHeartbeat entity) {
  56 + return list(new LambdaQueryWrapper<>(entity));
  57 + }
  58 +
  59 + @Override
  60 + public LingangEquipmentHeartbeat getOne(LingangEquipmentHeartbeat entity) {
  61 + return getOne(new LambdaQueryWrapper<>(entity));
  62 + }
  63 +
  64 + @Override
  65 + public Integer countId(LingangEquipmentHeartbeat entity) {
  66 + LambdaQueryWrapper<LingangEquipmentHeartbeat> wrapper = new LambdaQueryWrapper<>(entity);
  67 + wrapper.select(LingangEquipmentHeartbeat::getId);
  68 + return count(wrapper);
  69 + }
  70 +
  71 +
  72 + /**
  73 + * 插入有值的列
  74 + */
  75 + @Override
  76 + public int insertSelective(LingangEquipmentHeartbeat entity) {
  77 + return lingangEquipmentHeartbeatMapper.insertSelective(entity);
  78 + }
  79 +
  80 + /**
  81 + * 插入数据
  82 + */
  83 + @Override
  84 + public boolean insert(LingangEquipmentHeartbeat entity) {
  85 + return save(entity);
  86 + }
  87 +
  88 + /**
  89 + * 根据主键修改数据
  90 + */
  91 + @Override
  92 + public boolean updateByPrimaryKey(LingangEquipmentHeartbeat entity) {
  93 + return updateById(entity);
  94 + }
  95 +
  96 + /***根据主键删除数据*/
  97 + @Override
  98 + public boolean deleteById(Long id) {
  99 + return removeById(id);
  100 + }
  101 +
  102 +
  103 + public static void orderColumn(LambdaQueryWrapper<LingangEquipmentHeartbeat> wrapper, OrderEntity orderEntity) {
  104 + if (org.apache.commons.lang3.StringUtils.equals("ascending", orderEntity.getOrder())) {
  105 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "id")) {
  106 + wrapper.orderByAsc(LingangEquipmentHeartbeat::getId);
  107 + }
  108 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "device")) {
  109 + wrapper.orderByAsc(LingangEquipmentHeartbeat::getDevice);
  110 + }
  111 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "time")) {
  112 + wrapper.orderByAsc(LingangEquipmentHeartbeat::getTime);
  113 + }
  114 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "alarm")) {
  115 + wrapper.orderByAsc(LingangEquipmentHeartbeat::getAlarm);
  116 + }
  117 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "exkeys")) {
  118 + wrapper.orderByAsc(LingangEquipmentHeartbeat::getExkeys);
  119 + }
  120 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "createTime")) {
  121 + wrapper.orderByAsc(LingangEquipmentHeartbeat::getCreateTime);
  122 + }
  123 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "createBy")) {
  124 + wrapper.orderByAsc(LingangEquipmentHeartbeat::getCreateBy);
  125 + }
  126 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "updateTime")) {
  127 + wrapper.orderByAsc(LingangEquipmentHeartbeat::getUpdateTime);
  128 + }
  129 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "updateby")) {
  130 + wrapper.orderByAsc(LingangEquipmentHeartbeat::getUpdateby);
  131 + }
  132 + } else if (org.apache.commons.lang3.StringUtils.equals("descending", orderEntity.getOrder())) {
  133 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "id")) {
  134 + wrapper.orderByDesc(LingangEquipmentHeartbeat::getId);
  135 + }
  136 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "device")) {
  137 + wrapper.orderByDesc(LingangEquipmentHeartbeat::getDevice);
  138 + }
  139 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "time")) {
  140 + wrapper.orderByDesc(LingangEquipmentHeartbeat::getTime);
  141 + }
  142 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "alarm")) {
  143 + wrapper.orderByDesc(LingangEquipmentHeartbeat::getAlarm);
  144 + }
  145 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "exkeys")) {
  146 + wrapper.orderByDesc(LingangEquipmentHeartbeat::getExkeys);
  147 + }
  148 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "createTime")) {
  149 + wrapper.orderByDesc(LingangEquipmentHeartbeat::getCreateTime);
  150 + }
  151 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "createBy")) {
  152 + wrapper.orderByDesc(LingangEquipmentHeartbeat::getCreateBy);
  153 + }
  154 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "updateTime")) {
  155 + wrapper.orderByDesc(LingangEquipmentHeartbeat::getUpdateTime);
  156 + }
  157 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "updateby")) {
  158 + wrapper.orderByDesc(LingangEquipmentHeartbeat::getUpdateby);
  159 + }
  160 + }
  161 + }
  162 +}
0 163 \ No newline at end of file
... ...
Bsth-admin/src/main/java/com/ruoyi/service/impl/equipment/self/check/LingangEquimentSelfCheckServiceImpl.java 0 → 100644
  1 +package com.ruoyi.service.impl.equipment.self.check;
  2 +
  3 +import com.ruoyi.common.utils.StringUtils;
  4 +import com.ruoyi.domain.equipment.self.check.LingangEquimentSelfCheck;
  5 +import com.ruoyi.eexception.domain.EquipmentException;
  6 +import com.ruoyi.eexception.service.IEquipmentExceptionService;
  7 +import com.ruoyi.mapper.equipment.self.check.LingangEquimentSelfCheckMapper;
  8 +import com.ruoyi.service.equipment.self.check.LingangEquimentSelfCheckService;
  9 +import org.apache.commons.collections4.CollectionUtils;
  10 +import org.springframework.beans.factory.annotation.Autowired;
  11 +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 java.util.Collections;
  20 +import java.util.Date;
  21 +import java.util.List;
  22 +import java.util.Objects;
  23 +
  24 +import com.ruoyi.domain.OrderEntity;
  25 +
  26 +@Service
  27 +/**设备自检 Service实现类*/
  28 +public class LingangEquimentSelfCheckServiceImpl extends ServiceImpl<LingangEquimentSelfCheckMapper, LingangEquimentSelfCheck> implements LingangEquimentSelfCheckService {
  29 + @Autowired
  30 + private LingangEquimentSelfCheckMapper lingangEquimentSelfCheckMapper;
  31 + @Autowired
  32 + private IEquipmentExceptionService equipmentExceptionService;
  33 +
  34 + /**
  35 + * 分页查询
  36 + */
  37 + @Override
  38 + public IPage<LingangEquimentSelfCheck> pageList(Page<LingangEquimentSelfCheck> page, LingangEquimentSelfCheck entity, OrderEntity orderEntity) {
  39 + LambdaQueryWrapper<LingangEquimentSelfCheck> countWrapper = new LambdaQueryWrapper<>(entity);
  40 + countWrapper.select(LingangEquimentSelfCheck::getId);
  41 + int count = count(countWrapper);
  42 +
  43 + List<LingangEquimentSelfCheck> lists = Collections.emptyList();
  44 + if (count > 0) {
  45 + PageHelper.startPage((int) page.getCurrent(), (int) page.getSize(), false);
  46 + LambdaQueryWrapper<LingangEquimentSelfCheck> selectWrapper = new LambdaQueryWrapper<>(entity);
  47 + orderColumn(selectWrapper, orderEntity);
  48 + lists = list(selectWrapper);
  49 + }
  50 +
  51 + IPage<LingangEquimentSelfCheck> returnPage = new Page<LingangEquimentSelfCheck>();
  52 + returnPage.setRecords(lists);
  53 + returnPage.setPages(count % page.getSize() == 0 ? count / page.getSize() : count / page.getSize() + 1);
  54 + returnPage.setCurrent(page.getCurrent());
  55 + returnPage.setSize(page.getSize());
  56 + returnPage.setTotal(count);
  57 +
  58 + return returnPage;
  59 + }
  60 +
  61 + @Override
  62 + public List<LingangEquimentSelfCheck> list(LingangEquimentSelfCheck entity) {
  63 + return list(new LambdaQueryWrapper<>(entity));
  64 + }
  65 +
  66 +
  67 + @Override
  68 + public LingangEquimentSelfCheck getOne(LingangEquimentSelfCheck entity) {
  69 + return getOne(new LambdaQueryWrapper<>(entity));
  70 + }
  71 +
  72 + @Override
  73 + public Integer countId(LingangEquimentSelfCheck entity) {
  74 + LambdaQueryWrapper<LingangEquimentSelfCheck> wrapper = new LambdaQueryWrapper<>(entity);
  75 + wrapper.select(LingangEquimentSelfCheck::getId);
  76 + return count(wrapper);
  77 + }
  78 +
  79 +
  80 + /**
  81 + * 插入有值的列
  82 + */
  83 + @Override
  84 + public int insertSelective(LingangEquimentSelfCheck entity) {
  85 + return lingangEquimentSelfCheckMapper.insertSelective(entity);
  86 + }
  87 +
  88 + /**
  89 + * 插入数据
  90 + */
  91 + @Override
  92 + public boolean insert(LingangEquimentSelfCheck entity) {
  93 + if (Objects.equals(entity.getWine(), 2) || Objects.equals(2, entity.getTherm()) || Objects.equals(2, entity.getHorn())
  94 + || Objects.equals(2, entity.getMike()) || Objects.equals(2, entity.getLock()) ||
  95 + Objects.equals(entity.getCamerasSaveExceptionFlag(), Boolean.TRUE)) {
  96 + EquipmentException equipmentException = insertEquipmentException(entity);
  97 + entity.setQuipmentExceptionId(equipmentException.getId());
  98 + }
  99 +
  100 + return save(entity);
  101 + }
  102 +
  103 + /**
  104 + * 根据主键修改数据
  105 + */
  106 + @Override
  107 + public boolean updateByPrimaryKey(LingangEquimentSelfCheck entity) {
  108 + return updateById(entity);
  109 + }
  110 +
  111 + /***根据主键删除数据*/
  112 + @Override
  113 + public boolean deleteById(Long id) {
  114 + return removeById(id);
  115 + }
  116 +
  117 +
  118 + public static void orderColumn(LambdaQueryWrapper<LingangEquimentSelfCheck> wrapper, OrderEntity orderEntity) {
  119 + if (org.apache.commons.lang3.StringUtils.equals("ascending", orderEntity.getOrder())) {
  120 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "id")) {
  121 + wrapper.orderByAsc(LingangEquimentSelfCheck::getId);
  122 + }
  123 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "device")) {
  124 + wrapper.orderByAsc(LingangEquimentSelfCheck::getDevice);
  125 + }
  126 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "appVersion")) {
  127 + wrapper.orderByAsc(LingangEquimentSelfCheck::getAppVersion);
  128 + }
  129 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "wine")) {
  130 + wrapper.orderByAsc(LingangEquimentSelfCheck::getWine);
  131 + }
  132 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "cameras")) {
  133 + wrapper.orderByAsc(LingangEquimentSelfCheck::getCameras);
  134 + }
  135 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "therm")) {
  136 + wrapper.orderByAsc(LingangEquimentSelfCheck::getTherm);
  137 + }
  138 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "horn")) {
  139 + wrapper.orderByAsc(LingangEquimentSelfCheck::getHorn);
  140 + }
  141 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "mike")) {
  142 + wrapper.orderByAsc(LingangEquimentSelfCheck::getMike);
  143 + }
  144 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "lock")) {
  145 + wrapper.orderByAsc(LingangEquimentSelfCheck::getLock);
  146 + }
  147 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "time")) {
  148 + wrapper.orderByAsc(LingangEquimentSelfCheck::getTime);
  149 + }
  150 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "devicetype")) {
  151 + wrapper.orderByAsc(LingangEquimentSelfCheck::getDevicetype);
  152 + }
  153 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "iskeybox")) {
  154 + wrapper.orderByAsc(LingangEquimentSelfCheck::getIskeybox);
  155 + }
  156 + } else if (org.apache.commons.lang3.StringUtils.equals("descending", orderEntity.getOrder())) {
  157 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "id")) {
  158 + wrapper.orderByDesc(LingangEquimentSelfCheck::getId);
  159 + }
  160 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "device")) {
  161 + wrapper.orderByDesc(LingangEquimentSelfCheck::getDevice);
  162 + }
  163 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "appVersion")) {
  164 + wrapper.orderByDesc(LingangEquimentSelfCheck::getAppVersion);
  165 + }
  166 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "wine")) {
  167 + wrapper.orderByDesc(LingangEquimentSelfCheck::getWine);
  168 + }
  169 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "cameras")) {
  170 + wrapper.orderByDesc(LingangEquimentSelfCheck::getCameras);
  171 + }
  172 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "therm")) {
  173 + wrapper.orderByDesc(LingangEquimentSelfCheck::getTherm);
  174 + }
  175 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "horn")) {
  176 + wrapper.orderByDesc(LingangEquimentSelfCheck::getHorn);
  177 + }
  178 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "mike")) {
  179 + wrapper.orderByDesc(LingangEquimentSelfCheck::getMike);
  180 + }
  181 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "lock")) {
  182 + wrapper.orderByDesc(LingangEquimentSelfCheck::getLock);
  183 + }
  184 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "time")) {
  185 + wrapper.orderByDesc(LingangEquimentSelfCheck::getTime);
  186 + }
  187 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "devicetype")) {
  188 + wrapper.orderByDesc(LingangEquimentSelfCheck::getDevicetype);
  189 + }
  190 + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "iskeybox")) {
  191 + wrapper.orderByDesc(LingangEquimentSelfCheck::getIskeybox);
  192 + }
  193 + }
  194 + }
  195 +
  196 + /***
  197 + * 添加设备异常信息
  198 + * @author liujun
  199 + * @date 2024/7/11 13:17
  200 + * @param entity
  201 + */
  202 + private EquipmentException insertEquipmentException(LingangEquimentSelfCheck entity) {
  203 + EquipmentException equipmentException = new EquipmentException();
  204 + equipmentException.setDeviceId(entity.getDevice());
  205 + equipmentException.setStatus(1);
  206 + equipmentException.setCreateTime(new Date());
  207 + equipmentException.setRemark("自检异常");
  208 + equipmentException.setExType(4);
  209 +
  210 + equipmentExceptionService.insertEquipmentException(equipmentException);
  211 +
  212 + return equipmentException;
  213 + }
  214 +}
0 215 \ No newline at end of file
... ...
Bsth-admin/src/main/resources/mapper/driver/NewDriverMapper.xml
1 1 <?xml version="1.0" encoding="UTF-8"?>
2 2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3 <mapper namespace="com.ruoyi.mapper.driver.NewDriverMapper">
4   -
  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"/>
  7 + <result column="company_code" jdbcType="VARCHAR" property="companyCode"/>
  8 + <result column="branche_company_code" jdbcType="VARCHAR" property="brancheCompanyCode"/>
  9 + <result column="personnel_name" jdbcType="VARCHAR" property="personnelName"/>
  10 + <result column="papers_code" jdbcType="VARCHAR" property="papersCode"/>
  11 + <result column="ic_card_code" jdbcType="VARCHAR" property="icCardCode"/>
  12 + <result column="personnel_type" jdbcType="VARCHAR" property="personnelType"/>
  13 + <result column="posts" jdbcType="VARCHAR" property="posts"/>
  14 + <result column="card" jdbcType="VARCHAR" property="card"/>
  15 + <result column="telphone" jdbcType="VARCHAR" property="telphone"/>
  16 + <result column="ic_rfid" jdbcType="VARCHAR" property="icRfid"/>
  17 + <result column="id_rfid" jdbcType="VARCHAR" property="idRfid"/>
  18 + <result column="tag_rfid" jdbcType="VARCHAR" property="tagRfid"/>
  19 + <result column="remark" jdbcType="VARCHAR" property="remark"/>
  20 + <result column="line_name" jdbcType="VARCHAR" property="lineName"/>
  21 + <result column="line_code" jdbcType="VARCHAR" property="lineCode"/>
  22 + <result column="face_sign_in" jdbcType="TINYINT" property="faceSignIn"/>
  23 + <result column="image" jdbcType="VARCHAR" property="image"/>
  24 + <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  25 + <result column="sign_in_equipment" jdbcType="VARCHAR" property="signInEquipment"/>
  26 + <result column="fleet_name" jdbcType="VARCHAR" property="fleetName"/>
  27 + <result column="face_Feature" jdbcType="VARCHAR" property="faceFeature"/>
  28 + <result column="blue_Tooth" jdbcType="VARCHAR" property="blueTooth"/>
  29 + <result column="integer" jdbcType="INTEGER" property="integer"/>
  30 + <result column="synContent" jdbcType="VARCHAR" property="syncontent"/>
  31 + <result column="csn" jdbcType="VARCHAR" property="csn"/>
  32 + </resultMap>
5 33  
6 34 <insert id="insertSelective" keyColumn="job_code" keyProperty="jobCode" useGeneratedKeys="true"
7 35 parameterType="com.ruoyi.domain.driver.NewDriver">
... ... @@ -11,12 +39,12 @@
11 39  
12 40 <sql id="columns">
13 41 id
14   - , job_code , company_code , branche_company_code , personnel_name , papers_code , ic_card_code , personnel_type , posts , card , telphone , ic_rfid , id_rfid , tag_rfid , remark , line_name , line_code , face_sign_in , image , update_time , sign_in_equipment , fleet_name
  42 + , job_code , company_code , branche_company_code , personnel_name , papers_code , ic_card_code , personnel_type , posts , card , telphone , ic_rfid , id_rfid , tag_rfid , remark , line_name , line_code , face_sign_in , image , update_time , sign_in_equipment , fleet_name , face_Feature , blue_Tooth , integer , synContent , csn
15 43 </sql>
16 44  
17 45 <sql id="insert_columns">
18 46 id
19   - , job_code , company_code , branche_company_code , personnel_name , papers_code , ic_card_code , personnel_type , posts , card , telphone , ic_rfid , id_rfid , tag_rfid , remark , line_name , line_code , face_sign_in , image , update_time , sign_in_equipment , fleet_name
  47 + , job_code , company_code , branche_company_code , personnel_name , papers_code , ic_card_code , personnel_type , posts , card , telphone , ic_rfid , id_rfid , tag_rfid , remark , line_name , line_code , face_sign_in , image , update_time , sign_in_equipment , fleet_name , face_Feature , blue_Tooth , integer , synContent , csn
20 48 </sql>
21 49  
22 50 <sql id="insert_values">
... ... @@ -42,7 +70,12 @@
42 70 #{image},
43 71 #{updateTime},
44 72 #{signInEquipment},
45   - #{fleetName}
  73 + #{fleetName},
  74 + #{faceFeature},
  75 + #{blueTooth},
  76 + #{integer},
  77 + #{syncontent},
  78 + #{csn}
46 79 </sql>
47 80  
48 81 <sql id="insertSelectiveColumn">
... ... @@ -69,6 +102,11 @@
69 102 <if test="null!=updateTime">update_time,</if>
70 103 <if test="null!=signInEquipment">sign_in_equipment,</if>
71 104 <if test="null!=fleetName">fleet_name,</if>
  105 + <if test="null!=faceFeature">face_Feature,</if>
  106 + <if test="null!=blueTooth">blue_Tooth,</if>
  107 + <if test="null!=integer">integer,</if>
  108 + <if test="null!=syncontent">synContent,</if>
  109 + <if test="null!=csn">csn,</if>
72 110 </trim>
73 111 </sql>
74 112  
... ... @@ -96,6 +134,11 @@
96 134 <if test="null!=updateTime">#{updateTime,jdbcType=TIMESTAMP},</if>
97 135 <if test="null!=signInEquipment">#{signInEquipment,jdbcType=VARCHAR},</if>
98 136 <if test="null!=fleetName">#{fleetName,jdbcType=VARCHAR},</if>
  137 + <if test="null!=faceFeature">#{faceFeature,jdbcType=VARCHAR},</if>
  138 + <if test="null!=blueTooth">#{blueTooth,jdbcType=VARCHAR},</if>
  139 + <if test="null!=integer">#{integer,jdbcType=INTEGER},</if>
  140 + <if test="null!=syncontent">#{syncontent,jdbcType=VARCHAR},</if>
  141 + <if test="null!=csn">#{csn,jdbcType=VARCHAR},</if>
99 142 </trim>
100 143 </sql>
101 144  
... ... @@ -123,6 +166,11 @@
123 166 <if test="null!=updateTime">update_time = #{updateTime,jdbcType=TIMESTAMP},</if>
124 167 <if test="null!=signInEquipment">sign_in_equipment = #{signInEquipment,jdbcType=VARCHAR},</if>
125 168 <if test="null!=fleetName">fleet_name = #{fleetName,jdbcType=VARCHAR},</if>
  169 + <if test="null!=faceFeature">face_Feature = #{faceFeature,jdbcType=VARCHAR},</if>
  170 + <if test="null!=blueTooth">blue_Tooth = #{blueTooth,jdbcType=VARCHAR},</if>
  171 + <if test="null!=integer">integer = #{integer,jdbcType=INTEGER},</if>
  172 + <if test="null!=syncontent">synContent = #{syncontent,jdbcType=VARCHAR},</if>
  173 + <if test="null!=csn">csn = #{csn,jdbcType=VARCHAR},</if>
126 174 </set>
127 175 </sql>
128 176  
... ... @@ -149,5 +197,10 @@
149 197 <if test="null!=updateTime">AND update_time = #{updateTime,jdbcType=TIMESTAMP},</if>
150 198 <if test="null!=signInEquipment">AND sign_in_equipment = #{signInEquipment,jdbcType=VARCHAR},</if>
151 199 <if test="null!=fleetName">AND fleet_name = #{fleetName,jdbcType=VARCHAR},</if>
  200 + <if test="null!=faceFeature">AND face_Feature = #{faceFeature,jdbcType=VARCHAR},</if>
  201 + <if test="null!=blueTooth">AND blue_Tooth = #{blueTooth,jdbcType=VARCHAR},</if>
  202 + <if test="null!=integer">AND integer = #{integer,jdbcType=INTEGER},</if>
  203 + <if test="null!=syncontent">AND synContent = #{syncontent,jdbcType=VARCHAR},</if>
  204 + <if test="null!=csn">AND csn = #{csn,jdbcType=VARCHAR},</if>
152 205 </sql>
153 206 </mapper>
154 207 \ No newline at end of file
... ...
Bsth-admin/src/main/resources/mapper/equipment/LingangEquimentSelfCheckMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  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.equipment.self.check.LingangEquimentSelfCheckMapper">
  4 + <resultMap id="BaseResultMap" type="com.ruoyi.domain.equipment.self.check.LingangEquimentSelfCheck">
  5 + <id column="id" jdbcType="BIGINT" property="id"/>
  6 + <result column="device" jdbcType="VARCHAR" property="device"/>
  7 + <result column="app_version" jdbcType="VARCHAR" property="appVersion"/>
  8 + <result column="wine" jdbcType="INTEGER" property="wine"/>
  9 + <result column="cameras" jdbcType="JSON" property="cameras"/>
  10 + <result column="therm" jdbcType="INTEGER" property="therm"/>
  11 + <result column="horn" jdbcType="INTEGER" property="horn"/>
  12 + <result column="mike" jdbcType="INTEGER" property="mike"/>
  13 + <result column="lock" jdbcType="INTEGER" property="lock"/>
  14 + <result column="time" jdbcType="TIMESTAMP" property="time"/>
  15 + <result column="deviceType" jdbcType="VARCHAR" property="devicetype"/>
  16 + <result column="isKeybox" jdbcType="BIT" property="iskeybox"/>
  17 + <result column="quipment_exception_id" jdbcType="INTEGER" property="quipmentExceptionId"/>
  18 + <result column="create_by" jdbcType="VARCHAR" property="createBy"/>
  19 + <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  20 + <result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
  21 + <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  22 + </resultMap>
  23 +
  24 + <insert id="insertSelective" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
  25 + parameterType="com.ruoyi.domain.equipment.self.check.LingangEquimentSelfCheck">
  26 + INSERT INTO equiment_self_check
  27 + <include refid="insertSelectiveColumn"></include>
  28 + <include refid="insertSelectiveValue"></include>
  29 + </insert>
  30 +
  31 + <sql id="columns">
  32 + id
  33 + , device , app_version , wine , cameras , therm , horn , mike , lock , ·time · , deviceType , isKeybox , quipment_exception_id , create_by , create_time , update_by , update_time
  34 + </sql>
  35 +
  36 + <sql id="insert_columns">
  37 + id
  38 + , device , app_version , wine , cameras , therm , horn , mike , lock , ·time · , deviceType , isKeybox , quipment_exception_id , create_by , create_time , update_by , update_time
  39 + </sql>
  40 +
  41 + <sql id="insert_values">
  42 + #{id}
  43 + ,
  44 + #{device},
  45 + #{appVersion},
  46 + #{wine},
  47 + #{cameras},
  48 + #{therm},
  49 + #{horn},
  50 + #{mike},
  51 + #{lock},
  52 + #{time},
  53 + #{devicetype},
  54 + #{iskeybox},
  55 + #{quipmentExceptionId},
  56 + #{createBy},
  57 + #{createTime},
  58 + #{updateBy},
  59 + #{updateTime}
  60 + </sql>
  61 +
  62 + <sql id="insertSelectiveColumn">
  63 + <trim prefix="(" suffix=")" suffixOverrides=",">
  64 + <if test="null!=id">id,</if>
  65 + <if test="null!=device">device,</if>
  66 + <if test="null!=appVersion">app_version,</if>
  67 + <if test="null!=wine">wine,</if>
  68 + <if test="null!=cameras">cameras,</if>
  69 + <if test="null!=therm">therm,</if>
  70 + <if test="null!=horn">horn,</if>
  71 + <if test="null!=mike">mike,</if>
  72 + <if test="null!=lock">lock,</if>
  73 + <if test="null!=time">·time·,</if>
  74 + <if test="null!=devicetype">deviceType,</if>
  75 + <if test="null!=iskeybox">isKeybox,</if>
  76 + <if test="null!=quipmentExceptionId">quipment_exception_id,</if>
  77 + <if test="null!=createBy">create_by,</if>
  78 + <if test="null!=createTime">create_time,</if>
  79 + <if test="null!=updateBy">update_by,</if>
  80 + <if test="null!=updateTime">update_time,</if>
  81 + </trim>
  82 + </sql>
  83 +
  84 + <sql id="insertSelectiveValue">
  85 + <trim prefix="values (" suffix=")" suffixOverrides=",">
  86 + <if test="null!=id">#{id,jdbcType=BIGINT},</if>
  87 + <if test="null!=device">#{device,jdbcType=VARCHAR},</if>
  88 + <if test="null!=appVersion">#{appVersion,jdbcType=VARCHAR},</if>
  89 + <if test="null!=wine">#{wine,jdbcType=INTEGER},</if>
  90 + <if test="null!=cameras">#{cameras,jdbcType=JSON},</if>
  91 + <if test="null!=therm">#{therm,jdbcType=INTEGER},</if>
  92 + <if test="null!=horn">#{horn,jdbcType=INTEGER},</if>
  93 + <if test="null!=mike">#{mike,jdbcType=INTEGER},</if>
  94 + <if test="null!=lock">#{lock,jdbcType=INTEGER},</if>
  95 + <if test="null!=time">#{time,jdbcType=TIMESTAMP},</if>
  96 + <if test="null!=devicetype">#{devicetype,jdbcType=VARCHAR},</if>
  97 + <if test="null!=iskeybox">#{iskeybox,jdbcType=BIT},</if>
  98 + <if test="null!=quipmentExceptionId">#{quipmentExceptionId,jdbcType=INTEGER},</if>
  99 + <if test="null!=createBy">#{createBy,jdbcType=VARCHAR},</if>
  100 + <if test="null!=createTime">#{createTime,jdbcType=TIMESTAMP},</if>
  101 + <if test="null!=updateBy">#{updateBy,jdbcType=VARCHAR},</if>
  102 + <if test="null!=updateTime">#{updateTime,jdbcType=TIMESTAMP},</if>
  103 + </trim>
  104 + </sql>
  105 +
  106 + <sql id="updateByPrimaryKeySelectiveSql">
  107 + <set>
  108 + <if test="null!=id">id = #{id,jdbcType=BIGINT},</if>
  109 + <if test="null!=device">device = #{device,jdbcType=VARCHAR},</if>
  110 + <if test="null!=appVersion">app_version = #{appVersion,jdbcType=VARCHAR},</if>
  111 + <if test="null!=wine">wine = #{wine,jdbcType=INTEGER},</if>
  112 + <if test="null!=cameras">cameras = #{cameras,jdbcType=JSON},</if>
  113 + <if test="null!=therm">therm = #{therm,jdbcType=INTEGER},</if>
  114 + <if test="null!=horn">horn = #{horn,jdbcType=INTEGER},</if>
  115 + <if test="null!=mike">mike = #{mike,jdbcType=INTEGER},</if>
  116 + <if test="null!=lock">lock = #{lock,jdbcType=INTEGER},</if>
  117 + <if test="null!=time">·time· = #{time,jdbcType=TIMESTAMP},</if>
  118 + <if test="null!=devicetype">deviceType = #{devicetype,jdbcType=VARCHAR},</if>
  119 + <if test="null!=iskeybox">isKeybox = #{iskeybox,jdbcType=BIT},</if>
  120 + <if test="null!=quipmentExceptionId">quipment_exception_id = #{quipmentExceptionId,jdbcType=INTEGER},</if>
  121 + <if test="null!=createBy">create_by = #{createBy,jdbcType=VARCHAR},</if>
  122 + <if test="null!=createTime">create_time = #{createTime,jdbcType=TIMESTAMP},</if>
  123 + <if test="null!=updateBy">update_by = #{updateBy,jdbcType=VARCHAR},</if>
  124 + <if test="null!=updateTime">update_time = #{updateTime,jdbcType=TIMESTAMP},</if>
  125 + </set>
  126 + </sql>
  127 +
  128 + <sql id="where">
  129 + <if test="null!=id">AND id = #{id,jdbcType=BIGINT},</if>
  130 + <if test="null!=device">AND device = #{device,jdbcType=VARCHAR},</if>
  131 + <if test="null!=appVersion">AND app_version = #{appVersion,jdbcType=VARCHAR},</if>
  132 + <if test="null!=wine">AND wine = #{wine,jdbcType=INTEGER},</if>
  133 + <if test="null!=cameras">AND cameras = #{cameras,jdbcType=JSON},</if>
  134 + <if test="null!=therm">AND therm = #{therm,jdbcType=INTEGER},</if>
  135 + <if test="null!=horn">AND horn = #{horn,jdbcType=INTEGER},</if>
  136 + <if test="null!=mike">AND mike = #{mike,jdbcType=INTEGER},</if>
  137 + <if test="null!=lock">AND lock = #{lock,jdbcType=INTEGER},</if>
  138 + <if test="null!=time">AND ·time· = #{time,jdbcType=TIMESTAMP},</if>
  139 + <if test="null!=devicetype">AND deviceType = #{devicetype,jdbcType=VARCHAR},</if>
  140 + <if test="null!=iskeybox">AND isKeybox = #{iskeybox,jdbcType=BIT},</if>
  141 + <if test="null!=quipmentExceptionId">AND quipment_exception_id = #{quipmentExceptionId,jdbcType=INTEGER},</if>
  142 + <if test="null!=createBy">AND create_by = #{createBy,jdbcType=VARCHAR},</if>
  143 + <if test="null!=createTime">AND create_time = #{createTime,jdbcType=TIMESTAMP},</if>
  144 + <if test="null!=updateBy">AND update_by = #{updateBy,jdbcType=VARCHAR},</if>
  145 + <if test="null!=updateTime">AND update_time = #{updateTime,jdbcType=TIMESTAMP},</if>
  146 + </sql>
  147 +</mapper>
0 148 \ No newline at end of file
... ...
Bsth-admin/src/main/resources/mapper/equipment/heartbeat/LingangEquipmentHeartbeatMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  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.equipment.heartbeat.LingangEquipmentHeartbeatMapper">
  4 + <resultMap id="BaseResultMap" type="com.ruoyi.domain.equipment.heartbeat.LingangEquipmentHeartbeat">
  5 + <id column="id" jdbcType="BIGINT" property="id"/>
  6 + <result column="device" jdbcType="VARCHAR" property="device"/>
  7 + <result column="time" jdbcType="TIMESTAMP" property="time"/>
  8 + <result column="alarm" jdbcType="INTEGER" property="alarm"/>
  9 + <result column="exKeys" jdbcType="VARCHAR" property="exkeys"/>
  10 + <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  11 + <result column="create_by" jdbcType="VARCHAR" property="createBy"/>
  12 + <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  13 + <result column="updateBy" jdbcType="VARCHAR" property="updateby"/>
  14 + </resultMap>
  15 +
  16 + <insert id="insertSelective" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
  17 + parameterType="com.ruoyi.domain.equipment.heartbeat.LingangEquipmentHeartbeat">
  18 + INSERT INTO equipment_heartbeat
  19 + <include refid="insertSelectiveColumn"></include>
  20 + <include refid="insertSelectiveValue"></include>
  21 + </insert>
  22 +
  23 + <sql id="columns">
  24 + id
  25 + , device , time , alarm , exKeys , create_time , create_by , update_time , updateBy
  26 + </sql>
  27 +
  28 + <sql id="insert_columns">
  29 + id
  30 + , device , time , alarm , exKeys , create_time , create_by , update_time , updateBy
  31 + </sql>
  32 +
  33 + <sql id="insert_values">
  34 + #{id}
  35 + ,
  36 + #{device},
  37 + #{time},
  38 + #{alarm},
  39 + #{exkeys},
  40 + #{createTime},
  41 + #{createBy},
  42 + #{updateTime},
  43 + #{updateby}
  44 + </sql>
  45 +
  46 + <sql id="insertSelectiveColumn">
  47 + <trim prefix="(" suffix=")" suffixOverrides=",">
  48 + <if test="null!=id">id,</if>
  49 + <if test="null!=device">device,</if>
  50 + <if test="null!=time">time,</if>
  51 + <if test="null!=alarm">alarm,</if>
  52 + <if test="null!=exkeys">exKeys,</if>
  53 + <if test="null!=createTime">create_time,</if>
  54 + <if test="null!=createBy">create_by,</if>
  55 + <if test="null!=updateTime">update_time,</if>
  56 + <if test="null!=updateby">updateBy,</if>
  57 + </trim>
  58 + </sql>
  59 +
  60 + <sql id="insertSelectiveValue">
  61 + <trim prefix="values (" suffix=")" suffixOverrides=",">
  62 + <if test="null!=id">#{id,jdbcType=BIGINT},</if>
  63 + <if test="null!=device">#{device,jdbcType=VARCHAR},</if>
  64 + <if test="null!=time">#{time,jdbcType=TIMESTAMP},</if>
  65 + <if test="null!=alarm">#{alarm,jdbcType=INTEGER},</if>
  66 + <if test="null!=exkeys">#{exkeys,jdbcType=VARCHAR},</if>
  67 + <if test="null!=createTime">#{createTime,jdbcType=TIMESTAMP},</if>
  68 + <if test="null!=createBy">#{createBy,jdbcType=VARCHAR},</if>
  69 + <if test="null!=updateTime">#{updateTime,jdbcType=TIMESTAMP},</if>
  70 + <if test="null!=updateby">#{updateby,jdbcType=VARCHAR},</if>
  71 + </trim>
  72 + </sql>
  73 +
  74 + <sql id="updateByPrimaryKeySelectiveSql">
  75 + <set>
  76 + <if test="null!=id">id = #{id,jdbcType=BIGINT},</if>
  77 + <if test="null!=device">device = #{device,jdbcType=VARCHAR},</if>
  78 + <if test="null!=time">time = #{time,jdbcType=TIMESTAMP},</if>
  79 + <if test="null!=alarm">alarm = #{alarm,jdbcType=INTEGER},</if>
  80 + <if test="null!=exkeys">exKeys = #{exkeys,jdbcType=VARCHAR},</if>
  81 + <if test="null!=createTime">create_time = #{createTime,jdbcType=TIMESTAMP},</if>
  82 + <if test="null!=createBy">create_by = #{createBy,jdbcType=VARCHAR},</if>
  83 + <if test="null!=updateTime">update_time = #{updateTime,jdbcType=TIMESTAMP},</if>
  84 + <if test="null!=updateby">updateBy = #{updateby,jdbcType=VARCHAR},</if>
  85 + </set>
  86 + </sql>
  87 +
  88 + <sql id="where">
  89 + <if test="null!=id">AND id = #{id,jdbcType=BIGINT},</if>
  90 + <if test="null!=device">AND device = #{device,jdbcType=VARCHAR},</if>
  91 + <if test="null!=time">AND time = #{time,jdbcType=TIMESTAMP},</if>
  92 + <if test="null!=alarm">AND alarm = #{alarm,jdbcType=INTEGER},</if>
  93 + <if test="null!=exkeys">AND exKeys = #{exkeys,jdbcType=VARCHAR},</if>
  94 + <if test="null!=createTime">AND create_time = #{createTime,jdbcType=TIMESTAMP},</if>
  95 + <if test="null!=createBy">AND create_by = #{createBy,jdbcType=VARCHAR},</if>
  96 + <if test="null!=updateTime">AND update_time = #{updateTime,jdbcType=TIMESTAMP},</if>
  97 + <if test="null!=updateby">AND updateBy = #{updateby,jdbcType=VARCHAR},</if>
  98 + </sql>
  99 +</mapper>
0 100 \ No newline at end of file
... ...
Bsth-common/src/main/java/com/ruoyi/common/constant/Constants.java
... ... @@ -4,11 +4,10 @@ import io.jsonwebtoken.Claims;
4 4  
5 5 /**
6 6 * 通用常量信息
7   - *
  7 + *
8 8 * @author ruoyi
9 9 */
10   -public class Constants
11   -{
  10 +public class Constants {
12 11 /**
13 12 * UTF-8 字符集
14 13 */
... ... @@ -63,7 +62,7 @@ public class Constants
63 62 * 登录失败
64 63 */
65 64 public static final String LOGIN_FAIL = "Error";
66   -
  65 +
67 66 /**
68 67 * 验证码有效期(分钟)
69 68 */
... ... @@ -85,6 +84,11 @@ public class Constants
85 84 public static final String LOGIN_USER_KEY = "login_user_key";
86 85  
87 86 /**
  87 + * 令牌前缀
  88 + */
  89 + public static final String EQUIPMENT_KEY = "equipment_key";
  90 +
  91 + /**
88 92 * 用户ID
89 93 */
90 94 public static final String JWT_USERID = "userid";
... ... @@ -132,11 +136,16 @@ public class Constants
132 136 /**
133 137 * 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加)
134 138 */
135   - public static final String[] JOB_WHITELIST_STR = { "com.ruoyi" };
  139 + public static final String[] JOB_WHITELIST_STR = {"com.ruoyi"};
  140 +
  141 + /**
  142 + * 启用
  143 + */
  144 + public static final String ENABLE_STR = "0";
136 145  
137 146 /**
138 147 * 定时任务违规的字符
139 148 */
140   - public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
141   - "org.springframework", "org.apache", "com.ruoyi.common.utils.file", "com.ruoyi.common.config" };
  149 + public static final String[] JOB_ERROR_STR = {"java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
  150 + "org.springframework", "org.apache", "com.ruoyi.common.utils.file", "com.ruoyi.common.config"};
142 151 }
... ...
Bsth-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java
... ... @@ -2,6 +2,7 @@ package com.ruoyi.common.core.domain.entity;
2 2  
3 3 import javax.validation.constraints.NotBlank;
4 4 import javax.validation.constraints.Size;
  5 +
5 6 import org.apache.commons.lang3.builder.ToStringBuilder;
6 7 import org.apache.commons.lang3.builder.ToStringStyle;
7 8 import com.ruoyi.common.annotation.Excel;
... ... @@ -11,166 +12,175 @@ import com.ruoyi.common.core.domain.BaseEntity;
11 12  
12 13 /**
13 14 * 字典数据表 sys_dict_data
14   - *
  15 + *
15 16 * @author ruoyi
16 17 */
17   -public class SysDictData extends BaseEntity
18   -{
  18 +public class SysDictData extends BaseEntity {
19 19 private static final long serialVersionUID = 1L;
20 20  
21   - /** 字典编码 */
  21 + /**
  22 + * 字典编码
  23 + */
22 24 @Excel(name = "字典编码", cellType = ColumnType.NUMERIC)
23 25 private Long dictCode;
24 26  
25   - /** 字典排序 */
  27 + /**
  28 + * 字典排序
  29 + */
26 30 @Excel(name = "字典排序", cellType = ColumnType.NUMERIC)
27 31 private Long dictSort;
28 32  
29   - /** 字典标签 */
  33 + /**
  34 + * 字典标签
  35 + */
30 36 @Excel(name = "字典标签")
31 37 private String dictLabel;
32 38  
33   - /** 字典键值 */
  39 + /**
  40 + * 字典键值
  41 + */
34 42 @Excel(name = "字典键值")
35 43 private String dictValue;
36 44  
37   - /** 字典类型 */
  45 + /**
  46 + * 字典类型
  47 + */
38 48 @Excel(name = "字典类型")
39 49 private String dictType;
40 50  
41   - /** 样式属性(其他样式扩展) */
  51 + @Excel(name = "字典关键字")
  52 + private String discKey;
  53 +
  54 + /**
  55 + * 样式属性(其他样式扩展)
  56 + */
42 57 private String cssClass;
43 58  
44   - /** 表格字典样式 */
  59 + /**
  60 + * 表格字典样式
  61 + */
45 62 private String listClass;
46 63  
47   - /** 是否默认(Y是 N否) */
  64 + /**
  65 + * 是否默认(Y是 N否)
  66 + */
48 67 @Excel(name = "是否默认", readConverterExp = "Y=是,N=否")
49 68 private String isDefault;
50 69  
51   - /** 状态(0正常 1停用) */
  70 + /**
  71 + * 状态(0正常 1停用)
  72 + */
52 73 @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
53 74 private String status;
54 75  
55   - public Long getDictCode()
56   - {
  76 + public Long getDictCode() {
57 77 return dictCode;
58 78 }
59 79  
60   - public void setDictCode(Long dictCode)
61   - {
  80 + public void setDictCode(Long dictCode) {
62 81 this.dictCode = dictCode;
63 82 }
64 83  
65   - public Long getDictSort()
66   - {
  84 + public Long getDictSort() {
67 85 return dictSort;
68 86 }
69 87  
70   - public void setDictSort(Long dictSort)
71   - {
  88 + public void setDictSort(Long dictSort) {
72 89 this.dictSort = dictSort;
73 90 }
74 91  
75 92 @NotBlank(message = "字典标签不能为空")
76 93 @Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符")
77   - public String getDictLabel()
78   - {
  94 + public String getDictLabel() {
79 95 return dictLabel;
80 96 }
81 97  
82   - public void setDictLabel(String dictLabel)
83   - {
  98 + public void setDictLabel(String dictLabel) {
84 99 this.dictLabel = dictLabel;
85 100 }
86 101  
87 102 @NotBlank(message = "字典键值不能为空")
88 103 @Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符")
89   - public String getDictValue()
90   - {
  104 + public String getDictValue() {
91 105 return dictValue;
92 106 }
93 107  
94   - public void setDictValue(String dictValue)
95   - {
  108 + public void setDictValue(String dictValue) {
96 109 this.dictValue = dictValue;
97 110 }
98 111  
99 112 @NotBlank(message = "字典类型不能为空")
100 113 @Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符")
101   - public String getDictType()
102   - {
  114 + public String getDictType() {
103 115 return dictType;
104 116 }
105 117  
106   - public void setDictType(String dictType)
107   - {
  118 + public void setDictType(String dictType) {
108 119 this.dictType = dictType;
109 120 }
110 121  
111 122 @Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符")
112   - public String getCssClass()
113   - {
  123 + public String getCssClass() {
114 124 return cssClass;
115 125 }
116 126  
117   - public void setCssClass(String cssClass)
118   - {
  127 + public void setCssClass(String cssClass) {
119 128 this.cssClass = cssClass;
120 129 }
121 130  
122   - public String getListClass()
123   - {
  131 + public String getListClass() {
124 132 return listClass;
125 133 }
126 134  
127   - public void setListClass(String listClass)
128   - {
  135 + public void setListClass(String listClass) {
129 136 this.listClass = listClass;
130 137 }
131 138  
132   - public boolean getDefault()
133   - {
  139 + public boolean getDefault() {
134 140 return UserConstants.YES.equals(this.isDefault);
135 141 }
136 142  
137   - public String getIsDefault()
138   - {
  143 + public String getIsDefault() {
139 144 return isDefault;
140 145 }
141 146  
142   - public void setIsDefault(String isDefault)
143   - {
  147 + public void setIsDefault(String isDefault) {
144 148 this.isDefault = isDefault;
145 149 }
146 150  
147   - public String getStatus()
148   - {
  151 + public String getStatus() {
149 152 return status;
150 153 }
151 154  
152   - public void setStatus(String status)
153   - {
  155 + public void setStatus(String status) {
154 156 this.status = status;
155 157 }
156   -
  158 +
  159 + public String getDiscKey() {
  160 + return discKey;
  161 + }
  162 +
  163 + public void setDiscKey(String discKey) {
  164 + this.discKey = discKey;
  165 + }
  166 +
157 167 @Override
158 168 public String toString() {
159   - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
160   - .append("dictCode", getDictCode())
161   - .append("dictSort", getDictSort())
162   - .append("dictLabel", getDictLabel())
163   - .append("dictValue", getDictValue())
164   - .append("dictType", getDictType())
165   - .append("cssClass", getCssClass())
166   - .append("listClass", getListClass())
167   - .append("isDefault", getIsDefault())
168   - .append("status", getStatus())
169   - .append("createBy", getCreateBy())
170   - .append("createTime", getCreateTime())
171   - .append("updateBy", getUpdateBy())
172   - .append("updateTime", getUpdateTime())
173   - .append("remark", getRemark())
174   - .toString();
  169 + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
  170 + .append("dictCode", getDictCode())
  171 + .append("dictSort", getDictSort())
  172 + .append("dictLabel", getDictLabel())
  173 + .append("dictValue", getDictValue())
  174 + .append("dictType", getDictType())
  175 + .append("cssClass", getCssClass())
  176 + .append("listClass", getListClass())
  177 + .append("isDefault", getIsDefault())
  178 + .append("status", getStatus())
  179 + .append("createBy", getCreateBy())
  180 + .append("createTime", getCreateTime())
  181 + .append("updateBy", getUpdateBy())
  182 + .append("updateTime", getUpdateTime())
  183 + .append("remark", getRemark())
  184 + .toString();
175 185 }
176 186 }
... ...
Bsth-framework/pom.xml
... ... @@ -63,6 +63,17 @@
63 63 <groupId>com.Bsth</groupId>
64 64 <artifactId>Bsth-system</artifactId>
65 65 </dependency>
  66 + <dependency>
  67 + <groupId>cn.hutool</groupId>
  68 + <artifactId>hutool-all</artifactId>
  69 + <version>5.7.12</version>
  70 + <scope>compile</scope>
  71 + </dependency>
  72 + <dependency>
  73 + <groupId>org.projectlombok</groupId>
  74 + <artifactId>lombok</artifactId>
  75 + <scope>provided</scope>
  76 + </dependency>
66 77  
67 78 </dependencies>
68 79  
... ...
Bsth-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
... ... @@ -111,7 +111,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
111 111 // 过滤请求
112 112 .authorizeRequests()
113 113 // 对于登录login 注册register 验证码captchaImage 允许匿名访问
114   - .antMatchers("/big/view/queryNumberByType","/big/view/queryLineInfo/*","/big/view/querySignDetails","/report/list/**","/system/dict/data/**","/app/version/check/**","/app/checkDeviceHeart","/app/download","/driver/**","/in/**","/eexception/**","/equipment/**","/report/**","/login", "/register", "/captchaImage").permitAll()
  114 + .antMatchers("/big/view/queryNumberByType","/big/view/queryLineInfo/*","/big/view/querySignDetails","/report/list/**","/system/dict/data/**",
  115 + "/app/version/check/**","/app/checkDeviceHeart","/app/download","/driver/**","/in/**","/eexception/**","/equipment/**",
  116 + "/report/**","/login", "/register", "/captchaImage","/dss/Driver/Auth").permitAll()
115 117 // 静态资源,可匿名访问
116 118 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
117 119 .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
... ...
Bsth-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java
... ... @@ -5,8 +5,10 @@ import java.util.Map;
5 5 import java.util.concurrent.TimeUnit;
6 6 import javax.servlet.http.HttpServletRequest;
7 7  
  8 +import cn.hutool.core.convert.Convert;
8 9 import com.ruoyi.common.core.domain.entity.SysUser;
9 10 import com.ruoyi.system.service.ISysUserService;
  11 +import lombok.extern.slf4j.Slf4j;
10 12 import org.springframework.beans.factory.annotation.Autowired;
11 13 import org.springframework.beans.factory.annotation.Value;
12 14 import org.springframework.stereotype.Component;
... ... @@ -30,8 +32,8 @@ import io.jsonwebtoken.SignatureAlgorithm;
30 32 * @author ruoyi
31 33 */
32 34 @Component
33   -public class TokenService
34   -{
  35 +@Slf4j
  36 +public class TokenService {
35 37 // 令牌自定义标识
36 38 @Value("${token.header}")
37 39 private String header;
... ... @@ -61,23 +63,27 @@ public class TokenService
61 63 *
62 64 * @return 用户信息
63 65 */
64   - public LoginUser getLoginUser(HttpServletRequest request)
65   - {
  66 + public LoginUser getLoginUser(HttpServletRequest request) {
66 67 // 获取请求携带的令牌
67 68 String token = getToken(request);
68   - if (StringUtils.isNotEmpty(token))
69   - {
70   - try
71   - {
  69 + if (StringUtils.isNotEmpty(token)) {
  70 + try {
72 71 Claims claims = parseToken(token);
  72 + String uuid = null;
  73 + if (claims.containsKey(Constants.LOGIN_USER_KEY)) {
  74 + uuid = Convert.toStr(claims.get(Constants.LOGIN_USER_KEY));
  75 + } else if (claims.containsKey(Constants.EQUIPMENT_KEY)) {
  76 + uuid = Convert.toStr(claims.get(Constants.EQUIPMENT_KEY));
  77 + } else {
  78 + return null;
  79 + }
73 80 // 解析对应的权限以及用户信息
74   - String uuid = (String) claims.get(Constants.LOGIN_USER_KEY);
  81 +// String uuid = (String) claims.get(Constants.LOGIN_USER_KEY);
75 82 String userKey = getTokenKey(uuid);
76 83 LoginUser user = redisCache.getCacheObject(userKey);
77 84 return user;
78   - }
79   - catch (Exception e)
80   - {
  85 + } catch (Exception e) {
  86 + log.error("解下token异常:[{}]", token, e);
81 87 }
82 88 }
83 89 return null;
... ... @@ -86,10 +92,8 @@ public class TokenService
86 92 /**
87 93 * 设置用户身份信息
88 94 */
89   - public void setLoginUser(LoginUser loginUser)
90   - {
91   - if (StringUtils.isNotNull(loginUser) && StringUtils.isNotEmpty(loginUser.getToken()))
92   - {
  95 + public void setLoginUser(LoginUser loginUser) {
  96 + if (StringUtils.isNotNull(loginUser) && StringUtils.isNotEmpty(loginUser.getToken())) {
93 97 refreshToken(loginUser);
94 98 }
95 99 }
... ... @@ -97,10 +101,8 @@ public class TokenService
97 101 /**
98 102 * 删除用户身份信息
99 103 */
100   - public void delLoginUser(String token)
101   - {
102   - if (StringUtils.isNotEmpty(token))
103   - {
  104 + public void delLoginUser(String token) {
  105 + if (StringUtils.isNotEmpty(token)) {
104 106 String userKey = getTokenKey(token);
105 107 redisCache.deleteObject(userKey);
106 108 }
... ... @@ -112,15 +114,24 @@ public class TokenService
112 114 * @param loginUser 用户信息
113 115 * @return 令牌
114 116 */
115   - public String createToken(LoginUser loginUser)
116   - {
  117 + public String createToken(LoginUser loginUser) {
  118 + return createToken(loginUser, Constants.LOGIN_USER_KEY);
  119 + }
  120 +
  121 + /**
  122 + * 创建令牌
  123 + *
  124 + * @param loginUser 用户信息
  125 + * @return 令牌
  126 + */
  127 + public String createToken(LoginUser loginUser, String key) {
117 128 String token = IdUtils.fastUUID();
118 129 loginUser.setToken(token);
119 130 setUserAgent(loginUser);
120 131 refreshToken(loginUser);
121 132  
122 133 Map<String, Object> claims = new HashMap<>();
123   - claims.put(Constants.LOGIN_USER_KEY, token);
  134 + claims.put(key, token);
124 135 return createToken(claims);
125 136 }
126 137  
... ... @@ -130,8 +141,7 @@ public class TokenService
130 141 * @param loginUser 用户信息
131 142 * @return 令牌
132 143 */
133   - public String getLocalToken(LoginUser loginUser)
134   - {
  144 + public String getLocalToken(LoginUser loginUser) {
135 145 String token = IdUtils.fastUUID();
136 146 loginUser.setToken(token);
137 147 setUserAgent(loginUser);
... ... @@ -141,6 +151,7 @@ public class TokenService
141 151 claims.put(Constants.LOGIN_USER_KEY, token);
142 152 return getUserToken(loginUser.getUserId());
143 153 }
  154 +
144 155 private String getUserToken(Long userId) {
145 156 SysUser sysUser = userService.selectUserById(userId);
146 157 return sysUser.getRemark();
... ... @@ -153,12 +164,10 @@ public class TokenService
153 164 * @param loginUser
154 165 * @return 令牌
155 166 */
156   - public void verifyToken(LoginUser loginUser)
157   - {
  167 + public void verifyToken(LoginUser loginUser) {
158 168 long expireTime = loginUser.getExpireTime();
159 169 long currentTime = System.currentTimeMillis();
160   - if (expireTime - currentTime <= MILLIS_MINUTE_TEN)
161   - {
  170 + if (expireTime - currentTime <= MILLIS_MINUTE_TEN) {
162 171 refreshToken(loginUser);
163 172 }
164 173 }
... ... @@ -168,8 +177,7 @@ public class TokenService
168 177 *
169 178 * @param loginUser 登录信息
170 179 */
171   - public void refreshToken(LoginUser loginUser)
172   - {
  180 + public void refreshToken(LoginUser loginUser) {
173 181 loginUser.setLoginTime(System.currentTimeMillis());
174 182 loginUser.setExpireTime(loginUser.getLoginTime() + expireTime * MILLIS_MINUTE);
175 183 // 根据uuid将loginUser缓存
... ... @@ -182,8 +190,7 @@ public class TokenService
182 190 *
183 191 * @param loginUser 登录信息
184 192 */
185   - public void setUserAgent(LoginUser loginUser)
186   - {
  193 + public void setUserAgent(LoginUser loginUser) {
187 194 UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent"));
188 195 String ip = IpUtils.getIpAddr();
189 196 loginUser.setIpaddr(ip);
... ... @@ -198,8 +205,7 @@ public class TokenService
198 205 * @param claims 数据声明
199 206 * @return 令牌
200 207 */
201   - private String createToken(Map<String, Object> claims)
202   - {
  208 + private String createToken(Map<String, Object> claims) {
203 209 String token = Jwts.builder()
204 210 .setClaims(claims)
205 211 .signWith(SignatureAlgorithm.HS512, secret).compact();
... ... @@ -212,8 +218,7 @@ public class TokenService
212 218 * @param token 令牌
213 219 * @return 数据声明
214 220 */
215   - private Claims parseToken(String token)
216   - {
  221 + private Claims parseToken(String token) {
217 222 return Jwts.parser()
218 223 .setSigningKey(secret)
219 224 .parseClaimsJws(token)
... ... @@ -226,8 +231,7 @@ public class TokenService
226 231 * @param token 令牌
227 232 * @return 用户名
228 233 */
229   - public String getUsernameFromToken(String token)
230   - {
  234 + public String getUsernameFromToken(String token) {
231 235 Claims claims = parseToken(token);
232 236 return claims.getSubject();
233 237 }
... ... @@ -238,18 +242,15 @@ public class TokenService
238 242 * @param request
239 243 * @return token
240 244 */
241   - private String getToken(HttpServletRequest request)
242   - {
  245 + private String getToken(HttpServletRequest request) {
243 246 String token = request.getHeader(header);
244   - if (StringUtils.isNotEmpty(token) && token.startsWith(Constants.TOKEN_PREFIX))
245   - {
  247 + if (StringUtils.isNotEmpty(token) && token.startsWith(Constants.TOKEN_PREFIX)) {
246 248 token = token.replace(Constants.TOKEN_PREFIX, "");
247 249 }
248 250 return token;
249 251 }
250 252  
251   - private String getTokenKey(String uuid)
252   - {
  253 + private String getTokenKey(String uuid) {
253 254 return CacheConstants.LOGIN_TOKEN_KEY + uuid;
254 255 }
255 256 }
... ...
Bsth-system/pom.xml
... ... @@ -22,6 +22,12 @@
22 22 <groupId>com.Bsth</groupId>
23 23 <artifactId>Bsth-common</artifactId>
24 24 </dependency>
  25 + <dependency>
  26 + <groupId>com.baomidou</groupId>
  27 + <artifactId>mybatis-plus-extension</artifactId>
  28 + <version>3.4.1</version>
  29 + <scope>compile</scope>
  30 + </dependency>
25 31  
26 32 </dependencies>
27 33  
... ...
Bsth-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java
1 1 package com.ruoyi.system.mapper;
2 2  
3 3 import java.util.List;
  4 +
  5 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 6 import org.apache.ibatis.annotations.Param;
5 7 import com.ruoyi.common.core.domain.entity.SysDictData;
6 8  
... ... @@ -9,7 +11,7 @@ import com.ruoyi.common.core.domain.entity.SysDictData;
9 11 *
10 12 * @author ruoyi
11 13 */
12   -public interface SysDictDataMapper
  14 +public interface SysDictDataMapper extends BaseMapper<SysDictData>
13 15 {
14 16 /**
15 17 * 根据条件分页查询字典数据
... ...
Bsth-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java
1 1 package com.ruoyi.system.mapper;
2 2  
3 3 import java.util.List;
  4 +
  5 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 6 import com.ruoyi.common.core.domain.entity.SysDictType;
5 7  
6 8 /**
... ... @@ -8,7 +10,7 @@ import com.ruoyi.common.core.domain.entity.SysDictType;
8 10 *
9 11 * @author ruoyi
10 12 */
11   -public interface SysDictTypeMapper
  13 +public interface SysDictTypeMapper extends BaseMapper<SysDictType>
12 14 {
13 15 /**
14 16 * 根据条件分页查询字典类型
... ...
Bsth-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java
1 1 package com.ruoyi.system.service;
2 2  
  3 +import java.util.Collection;
3 4 import java.util.List;
  5 +
  6 +import com.baomidou.mybatisplus.extension.service.IService;
4 7 import com.ruoyi.common.core.domain.entity.SysDictData;
5 8  
6 9 /**
7 10 * 字典 业务层
8   - *
  11 + *
9 12 * @author ruoyi
10 13 */
11   -public interface ISysDictDataService
12   -{
  14 +public interface ISysDictDataService extends IService<SysDictData> {
13 15 /**
14 16 * 根据条件分页查询字典数据
15   - *
  17 + *
16 18 * @param dictData 字典数据信息
17 19 * @return 字典数据集合信息
18 20 */
19 21 public List<SysDictData> selectDictDataList(SysDictData dictData);
20 22  
  23 + List<SysDictData> queryDictDateList(SysDictData dictData);
  24 +
  25 + List<SysDictData> queryDictDateList(SysDictData dictData, Collection<String> types);
  26 +
21 27 /**
22 28 * 根据字典类型和字典键值查询字典数据信息
23   - *
24   - * @param dictType 字典类型
  29 + *
  30 + * @param dictType 字典类型
25 31 * @param dictValue 字典键值
26 32 * @return 字典标签
27 33 */
... ... @@ -29,7 +35,7 @@ public interface ISysDictDataService
29 35  
30 36 /**
31 37 * 根据字典数据ID查询信息
32   - *
  38 + *
33 39 * @param dictCode 字典数据ID
34 40 * @return 字典数据
35 41 */
... ... @@ -37,14 +43,14 @@ public interface ISysDictDataService
37 43  
38 44 /**
39 45 * 批量删除字典数据信息
40   - *
  46 + *
41 47 * @param dictCodes 需要删除的字典数据ID
42 48 */
43 49 public void deleteDictDataByIds(Long[] dictCodes);
44 50  
45 51 /**
46 52 * 新增保存字典数据信息
47   - *
  53 + *
48 54 * @param dictData 字典数据信息
49 55 * @return 结果
50 56 */
... ... @@ -52,7 +58,7 @@ public interface ISysDictDataService
52 58  
53 59 /**
54 60 * 修改保存字典数据信息
55   - *
  61 + *
56 62 * @param dictData 字典数据信息
57 63 * @return 结果
58 64 */
... ...
Bsth-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java
1 1 package com.ruoyi.system.service;
2 2  
  3 +import java.util.Collection;
3 4 import java.util.List;
  5 +
  6 +import com.baomidou.mybatisplus.extension.service.IService;
4 7 import com.ruoyi.common.core.domain.entity.SysDictData;
5 8 import com.ruoyi.common.core.domain.entity.SysDictType;
6 9  
... ... @@ -9,7 +12,7 @@ import com.ruoyi.common.core.domain.entity.SysDictType;
9 12 *
10 13 * @author ruoyi
11 14 */
12   -public interface ISysDictTypeService
  15 +public interface ISysDictTypeService extends IService<SysDictType>
13 16 {
14 17 /**
15 18 * 根据条件分页查询字典类型
... ... @@ -19,6 +22,8 @@ public interface ISysDictTypeService
19 22 */
20 23 public List<SysDictType> selectDictTypeList(SysDictType dictType);
21 24  
  25 + List<SysDictType> queryDicTypeList(SysDictType dictType, Collection<String> types);
  26 +
22 27 /**
23 28 * 根据所有字典类型
24 29 *
... ...
Bsth-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java
1 1 package com.ruoyi.system.service.impl;
2 2  
  3 +import java.util.Collection;
3 4 import java.util.List;
  5 +
  6 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  7 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  8 +import org.apache.commons.collections4.CollectionUtils;
4 9 import org.springframework.beans.factory.annotation.Autowired;
5 10 import org.springframework.stereotype.Service;
6 11 import com.ruoyi.common.core.domain.entity.SysDictData;
... ... @@ -10,62 +15,71 @@ import com.ruoyi.system.service.ISysDictDataService;
10 15  
11 16 /**
12 17 * 字典 业务层处理
13   - *
  18 + *
14 19 * @author ruoyi
15 20 */
16 21 @Service
17   -public class SysDictDataServiceImpl implements ISysDictDataService
18   -{
  22 +public class SysDictDataServiceImpl extends ServiceImpl<SysDictDataMapper, SysDictData> implements ISysDictDataService {
19 23 @Autowired
20 24 private SysDictDataMapper dictDataMapper;
21 25  
22 26 /**
23 27 * 根据条件分页查询字典数据
24   - *
  28 + *
25 29 * @param dictData 字典数据信息
26 30 * @return 字典数据集合信息
27 31 */
28 32 @Override
29   - public List<SysDictData> selectDictDataList(SysDictData dictData)
30   - {
  33 + public List<SysDictData> selectDictDataList(SysDictData dictData) {
31 34 return dictDataMapper.selectDictDataList(dictData);
32 35 }
33 36  
  37 + @Override
  38 + public List<SysDictData> queryDictDateList(SysDictData dictData) {
  39 + LambdaQueryWrapper<SysDictData> wrapper = new LambdaQueryWrapper<>(dictData);
  40 + return list(wrapper);
  41 + }
  42 +
  43 + @Override
  44 + public List<SysDictData> queryDictDateList(SysDictData dictData, Collection<String> types) {
  45 + LambdaQueryWrapper<SysDictData> wrapper = new LambdaQueryWrapper<>(dictData);
  46 + if (CollectionUtils.isNotEmpty(types)) {
  47 + wrapper.in(SysDictData::getDictType, types);
  48 + }
  49 + return list(wrapper);
  50 + }
  51 +
34 52 /**
35 53 * 根据字典类型和字典键值查询字典数据信息
36   - *
37   - * @param dictType 字典类型
  54 + *
  55 + * @param dictType 字典类型
38 56 * @param dictValue 字典键值
39 57 * @return 字典标签
40 58 */
41 59 @Override
42   - public String selectDictLabel(String dictType, String dictValue)
43   - {
  60 + public String selectDictLabel(String dictType, String dictValue) {
44 61 return dictDataMapper.selectDictLabel(dictType, dictValue);
45 62 }
46 63  
47 64 /**
48 65 * 根据字典数据ID查询信息
49   - *
  66 + *
50 67 * @param dictCode 字典数据ID
51 68 * @return 字典数据
52 69 */
53 70 @Override
54   - public SysDictData selectDictDataById(Long dictCode)
55   - {
  71 + public SysDictData selectDictDataById(Long dictCode) {
56 72 return dictDataMapper.selectDictDataById(dictCode);
57 73 }
58 74  
59 75 /**
60 76 * 批量删除字典数据信息
61   - *
  77 + *
62 78 * @param dictCodes 需要删除的字典数据ID
63 79 */
64 80 @Override
65   - public void deleteDictDataByIds(Long[] dictCodes)
66   - {
67   - for (Long dictCode : dictCodes)
68   - {
  81 + public void deleteDictDataByIds(Long[] dictCodes) {
  82 + for (Long dictCode : dictCodes) {
69 83 SysDictData data = selectDictDataById(dictCode);
70 84 dictDataMapper.deleteDictDataById(dictCode);
71 85 List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType());
... ... @@ -75,16 +89,14 @@ public class SysDictDataServiceImpl implements ISysDictDataService
75 89  
76 90 /**
77 91 * 新增保存字典数据信息
78   - *
  92 + *
79 93 * @param data 字典数据信息
80 94 * @return 结果
81 95 */
82 96 @Override
83   - public int insertDictData(SysDictData data)
84   - {
  97 + public int insertDictData(SysDictData data) {
85 98 int row = dictDataMapper.insertDictData(data);
86   - if (row > 0)
87   - {
  99 + if (row > 0) {
88 100 List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType());
89 101 DictUtils.setDictCache(data.getDictType(), dictDatas);
90 102 }
... ... @@ -93,16 +105,14 @@ public class SysDictDataServiceImpl implements ISysDictDataService
93 105  
94 106 /**
95 107 * 修改保存字典数据信息
96   - *
  108 + *
97 109 * @param data 字典数据信息
98 110 * @return 结果
99 111 */
100 112 @Override
101   - public int updateDictData(SysDictData data)
102   - {
  113 + public int updateDictData(SysDictData data) {
103 114 int row = dictDataMapper.updateDictData(data);
104   - if (row > 0)
105   - {
  115 + if (row > 0) {
106 116 List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType());
107 117 DictUtils.setDictCache(data.getDictType(), dictDatas);
108 118 }
... ...
Bsth-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java
1 1 package com.ruoyi.system.service.impl;
2 2  
  3 +import java.util.Collection;
3 4 import java.util.Comparator;
4 5 import java.util.List;
5 6 import java.util.Map;
6 7 import java.util.stream.Collectors;
7 8 import javax.annotation.PostConstruct;
  9 +
  10 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  11 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  12 +import org.apache.commons.collections4.CollectionUtils;
8 13 import org.springframework.beans.factory.annotation.Autowired;
9 14 import org.springframework.stereotype.Service;
10 15 import org.springframework.transaction.annotation.Transactional;
... ... @@ -20,12 +25,11 @@ import com.ruoyi.system.service.ISysDictTypeService;
20 25  
21 26 /**
22 27 * 字典 业务层处理
23   - *
  28 + *
24 29 * @author ruoyi
25 30 */
26 31 @Service
27   -public class SysDictTypeServiceImpl implements ISysDictTypeService
28   -{
  32 +public class SysDictTypeServiceImpl extends ServiceImpl<SysDictTypeMapper, SysDictType> implements ISysDictTypeService {
29 33 @Autowired
30 34 private SysDictTypeMapper dictTypeMapper;
31 35  
... ... @@ -36,51 +40,54 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
36 40 * 项目启动时,初始化字典到缓存
37 41 */
38 42 @PostConstruct
39   - public void init()
40   - {
  43 + public void init() {
41 44 loadingDictCache();
42 45 }
43 46  
44 47 /**
45 48 * 根据条件分页查询字典类型
46   - *
  49 + *
47 50 * @param dictType 字典类型信息
48 51 * @return 字典类型集合信息
49 52 */
50 53 @Override
51   - public List<SysDictType> selectDictTypeList(SysDictType dictType)
52   - {
  54 + public List<SysDictType> selectDictTypeList(SysDictType dictType) {
53 55 return dictTypeMapper.selectDictTypeList(dictType);
54 56 }
55 57  
  58 + @Override
  59 + public List<SysDictType> queryDicTypeList(SysDictType dictType, Collection<String> types) {
  60 + LambdaQueryWrapper<SysDictType> wrapper = new LambdaQueryWrapper<>(dictType);
  61 + if (CollectionUtils.isNotEmpty(types)) {
  62 + wrapper.in(SysDictType::getDictType, types);
  63 + }
  64 + return list(wrapper);
  65 + }
  66 +
56 67 /**
57 68 * 根据所有字典类型
58   - *
  69 + *
59 70 * @return 字典类型集合信息
60 71 */
61 72 @Override
62   - public List<SysDictType> selectDictTypeAll()
63   - {
  73 + public List<SysDictType> selectDictTypeAll() {
64 74 return dictTypeMapper.selectDictTypeAll();
65 75 }
66 76  
67 77 /**
68 78 * 根据字典类型查询字典数据
69   - *
  79 + *
70 80 * @param dictType 字典类型
71 81 * @return 字典数据集合信息
72 82 */
73 83 @Override
74   - public List<SysDictData> selectDictDataByType(String dictType)
75   - {
  84 + public List<SysDictData> selectDictDataByType(String dictType) {
76 85 List<SysDictData> dictDatas = DictUtils.getDictCache(dictType);
77   - if (StringUtils.isNotEmpty(dictDatas))
78   - {
  86 + if (StringUtils.isNotEmpty(dictDatas)) {
79 87 return dictDatas;
80 88 }
81 89 dictDatas = dictDataMapper.selectDictDataByType(dictType);
82   - if (StringUtils.isNotEmpty(dictDatas))
83   - {
  90 + if (StringUtils.isNotEmpty(dictDatas)) {
84 91 DictUtils.setDictCache(dictType, dictDatas);
85 92 return dictDatas;
86 93 }
... ... @@ -89,41 +96,36 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
89 96  
90 97 /**
91 98 * 根据字典类型ID查询信息
92   - *
  99 + *
93 100 * @param dictId 字典类型ID
94 101 * @return 字典类型
95 102 */
96 103 @Override
97   - public SysDictType selectDictTypeById(Long dictId)
98   - {
  104 + public SysDictType selectDictTypeById(Long dictId) {
99 105 return dictTypeMapper.selectDictTypeById(dictId);
100 106 }
101 107  
102 108 /**
103 109 * 根据字典类型查询信息
104   - *
  110 + *
105 111 * @param dictType 字典类型
106 112 * @return 字典类型
107 113 */
108 114 @Override
109   - public SysDictType selectDictTypeByType(String dictType)
110   - {
  115 + public SysDictType selectDictTypeByType(String dictType) {
111 116 return dictTypeMapper.selectDictTypeByType(dictType);
112 117 }
113 118  
114 119 /**
115 120 * 批量删除字典类型信息
116   - *
  121 + *
117 122 * @param dictIds 需要删除的字典ID
118 123 */
119 124 @Override
120   - public void deleteDictTypeByIds(Long[] dictIds)
121   - {
122   - for (Long dictId : dictIds)
123   - {
  125 + public void deleteDictTypeByIds(Long[] dictIds) {
  126 + for (Long dictId : dictIds) {
124 127 SysDictType dictType = selectDictTypeById(dictId);
125   - if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0)
126   - {
  128 + if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) {
127 129 throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName()));
128 130 }
129 131 dictTypeMapper.deleteDictTypeById(dictId);
... ... @@ -135,13 +137,11 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
135 137 * 加载字典缓存数据
136 138 */
137 139 @Override
138   - public void loadingDictCache()
139   - {
  140 + public void loadingDictCache() {
140 141 SysDictData dictData = new SysDictData();
141 142 dictData.setStatus("0");
142 143 Map<String, List<SysDictData>> dictDataMap = dictDataMapper.selectDictDataList(dictData).stream().collect(Collectors.groupingBy(SysDictData::getDictType));
143   - for (Map.Entry<String, List<SysDictData>> entry : dictDataMap.entrySet())
144   - {
  144 + for (Map.Entry<String, List<SysDictData>> entry : dictDataMap.entrySet()) {
145 145 DictUtils.setDictCache(entry.getKey(), entry.getValue().stream().sorted(Comparator.comparing(SysDictData::getDictSort)).collect(Collectors.toList()));
146 146 }
147 147 }
... ... @@ -150,8 +150,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
150 150 * 清空字典缓存数据
151 151 */
152 152 @Override
153   - public void clearDictCache()
154   - {
  153 + public void clearDictCache() {
155 154 DictUtils.clearDictCache();
156 155 }
157 156  
... ... @@ -159,24 +158,21 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
159 158 * 重置字典缓存数据
160 159 */
161 160 @Override
162   - public void resetDictCache()
163   - {
  161 + public void resetDictCache() {
164 162 clearDictCache();
165 163 loadingDictCache();
166 164 }
167 165  
168 166 /**
169 167 * 新增保存字典类型信息
170   - *
  168 + *
171 169 * @param dict 字典类型信息
172 170 * @return 结果
173 171 */
174 172 @Override
175   - public int insertDictType(SysDictType dict)
176   - {
  173 + public int insertDictType(SysDictType dict) {
177 174 int row = dictTypeMapper.insertDictType(dict);
178   - if (row > 0)
179   - {
  175 + if (row > 0) {
180 176 DictUtils.setDictCache(dict.getDictType(), null);
181 177 }
182 178 return row;
... ... @@ -184,19 +180,17 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
184 180  
185 181 /**
186 182 * 修改保存字典类型信息
187   - *
  183 + *
188 184 * @param dict 字典类型信息
189 185 * @return 结果
190 186 */
191 187 @Override
192 188 @Transactional
193   - public int updateDictType(SysDictType dict)
194   - {
  189 + public int updateDictType(SysDictType dict) {
195 190 SysDictType oldDict = dictTypeMapper.selectDictTypeById(dict.getDictId());
196 191 dictDataMapper.updateDictDataType(oldDict.getDictType(), dict.getDictType());
197 192 int row = dictTypeMapper.updateDictType(dict);
198   - if (row > 0)
199   - {
  193 + if (row > 0) {
200 194 List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dict.getDictType());
201 195 DictUtils.setDictCache(dict.getDictType(), dictDatas);
202 196 }
... ... @@ -205,17 +199,15 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
205 199  
206 200 /**
207 201 * 校验字典类型称是否唯一
208   - *
  202 + *
209 203 * @param dict 字典类型
210 204 * @return 结果
211 205 */
212 206 @Override
213   - public boolean checkDictTypeUnique(SysDictType dict)
214   - {
  207 + public boolean checkDictTypeUnique(SysDictType dict) {
215 208 Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId();
216 209 SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType());
217   - if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue())
218   - {
  210 + if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) {
219 211 return UserConstants.NOT_UNIQUE;
220 212 }
221 213 return UserConstants.UNIQUE;
... ...