| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.alibaba.druid.sql.visitor.functions.Concat; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.dao.business.JkKeysMapper; |
| | | import com.doumee.dao.business.model.Cars; |
| | | import com.doumee.dao.business.model.JkCabinet; |
| | | import com.doumee.dao.business.model.JkKeys; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.dto.OptGridDTO; |
| | | import com.doumee.dao.business.dto.CloseGridDTO; |
| | | import com.doumee.dao.business.dto.GetDriverGridDTO; |
| | | import com.doumee.dao.business.dto.OpenGridDriverDTO; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.service.business.third.model.LoginUserInfo; |
| | | import com.doumee.service.business.third.model.PageData; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.JkCabinetGridMapper; |
| | | import com.doumee.dao.business.model.JkCabinetGrid; |
| | | import com.doumee.service.business.JkCabinetGridService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.doumee.service.business.third.model.PageWrap; |
| | | import com.github.yulichang.toolkit.MPJWrappers; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private JkKeysMapper jkKeysMapper; |
| | | |
| | | @Autowired |
| | | private JkCabinetMapper jkCabinetMapper; |
| | | @Autowired |
| | | private JkCabinetLogMapper jkCabinetLogMapper; |
| | | |
| | | |
| | | |
| | | @Override |
| | | public Integer create(JkCabinetGrid jkCabinetGrid) { |
| | |
| | | |
| | | @Override |
| | | public void updateById(JkCabinetGrid jkCabinetGrid) { |
| | | jkCabinetGridMapper.updateById(jkCabinetGrid); |
| | | if(Objects.isNull(jkCabinetGrid) |
| | | || Objects.isNull(jkCabinetGrid.getId()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | LoginUserInfo loginUserInfo = jkCabinetGrid.getLoginUserInfo(); |
| | | JkCabinetGrid model = jkCabinetGridMapper.selectById(jkCabinetGrid.getId()); |
| | | if(Objects.isNull(model)|| Constants.equalsInteger(model.getIsdeleted(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(Objects.nonNull(jkCabinetGrid.getKeyId())){ |
| | | if(Objects.nonNull(model.getKeyId())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"已绑定,请勿重复绑定"); |
| | | } |
| | | JkKeys keysModel = jkKeysMapper.selectById(jkCabinetGrid.getKeyId()); |
| | | if(Objects.isNull(keysModel)|| Constants.equalsInteger(keysModel.getIsdeleted(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!Constants.equalsInteger(keysModel.getStatus(), (Constants.ZERO))){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"钥匙已被绑定,请选择其他钥匙绑定"); |
| | | } |
| | | //更新钥匙柜信息 |
| | | jkCabinetGridMapper.update(new UpdateWrapper<JkCabinetGrid>().lambda() |
| | | .set(JkCabinetGrid::getKeyId,jkCabinetGrid.getKeyId()) |
| | | .set(JkCabinetGrid::getEditor,loginUserInfo.getId()) |
| | | .set(JkCabinetGrid::getEditDate,DateUtil.getCurrDateTime()) |
| | | .set(JkCabinetGrid::getEditDate, DateUtil.getCurrDateTime()) |
| | | .eq(JkCabinetGrid::getId,jkCabinetGrid.getId())); |
| | | //标记钥匙信息 |
| | | jkKeysMapper.update(new UpdateWrapper<JkKeys>().lambda() |
| | | .set(JkKeys::getStatus,Constants.ONE) |
| | | .eq(JkKeys::getId,jkCabinetGrid.getKeyId()) |
| | | ); |
| | | return; |
| | | }else if(Objects.nonNull(jkCabinetGrid.getChannelCode())||Objects.nonNull(jkCabinetGrid.getBoardCode())){ |
| | | jkCabinetGridMapper.update(new UpdateWrapper<JkCabinetGrid>().lambda() |
| | | .set(Objects.nonNull(jkCabinetGrid.getChannelCode()),JkCabinetGrid::getChannelCode,jkCabinetGrid.getChannelCode()) |
| | | .set(Objects.nonNull(jkCabinetGrid.getBoardCode()),JkCabinetGrid::getBoardCode,jkCabinetGrid.getBoardCode()) |
| | | .set(JkCabinetGrid::getEditDate, DateUtil.getCurrDateTime()) |
| | | .eq(JkCabinetGrid::getId,jkCabinetGrid.getId())); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void bindingKeys(JkCabinetGrid jkCabinetGrid){ |
| | | public void updateStatusById(JkCabinetGrid jkCabinetGrid) { |
| | | if(Objects.isNull(jkCabinetGrid) |
| | | || Objects.isNull(jkCabinetGrid.getId()) |
| | | || Objects.isNull(jkCabinetGrid.getKeyId())){ |
| | | || Objects.isNull(jkCabinetGrid.getId()) |
| | | || Objects.isNull(jkCabinetGrid.getStatus())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | JkCabinetGrid model = jkCabinetGridMapper.selectById(jkCabinetGrid.getId()); |
| | | if(Objects.isNull(model)|| Constants.equalsInteger(model.getIsdeleted(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(Objects.nonNull(model.getKeyId())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"已绑定,请勿重复绑定"); |
| | | } |
| | | JkKeys keysModel = jkKeysMapper.selectById(jkCabinetGrid.getKeyId()); |
| | | if(Objects.isNull(keysModel)|| Constants.equalsInteger(keysModel.getIsdeleted(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!Constants.equalsInteger(keysModel.getStatus(), (Constants.ZERO))){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"钥匙已被绑定,请选择其他钥匙绑定"); |
| | | } |
| | | //更新钥匙柜信息 |
| | | jkCabinetGridMapper.update(new UpdateWrapper<JkCabinetGrid>().lambda() |
| | | .set(JkCabinetGrid::getKeyId,jkCabinetGrid.getKeyId()) |
| | | jkCabinetGridMapper.update(null,new UpdateWrapper<JkCabinetGrid>() |
| | | .lambda().set(JkCabinetGrid::getStatus,jkCabinetGrid.getStatus()) |
| | | .set(JkCabinetGrid::getEditDate, DateUtil.getCurrDateTime()) |
| | | .eq(JkCabinetGrid::getId,jkCabinetGrid.getId())); |
| | | //标记钥匙信息 |
| | | jkKeysMapper.update(new UpdateWrapper<JkKeys>().lambda() |
| | | .set(JkKeys::getStatus,Constants.ONE) |
| | | .eq(JkKeys::getId,jkCabinetGrid.getKeyId()) |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 标记故障 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void markFault(OptGridDTO dto){ |
| | | if(Objects.isNull(dto) |
| | | || Objects.isNull(dto.getCabinetId()) |
| | | || CollectionUtils.isEmpty(dto.getGridIdList())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | List<JkCabinetGrid> jkCabinetGridList = jkCabinetGridMapper.selectList(new QueryWrapper<JkCabinetGrid>().lambda().eq(JkCabinetGrid::getIsdeleted,Constants.ZERO) |
| | | .eq(JkCabinetGrid::getWorkingStatus,Constants.ZERO) |
| | | .eq(JkCabinetGrid::getCabinetId,dto.getCabinetId()) |
| | | .in(JkCabinetGrid::getId,dto.getGridIdList()) |
| | | ); |
| | | if(CollectionUtils.isEmpty(jkCabinetGridList)){ |
| | | return; |
| | | } |
| | | LoginUserInfo loginUserInfo = dto.getLoginUserInfo(); |
| | | for (JkCabinetGrid jkCabinetGrid:jkCabinetGridList) { |
| | | jkCabinetGrid.setEditor(loginUserInfo.getId()); |
| | | jkCabinetGrid.setEditDate(new Date()); |
| | | jkCabinetGrid.setWorkingStatus(Constants.ONE); |
| | | jkCabinetGridMapper.updateById(jkCabinetGrid); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 标记维修保养 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void markRepair(OptGridDTO dto){ |
| | | if(Objects.isNull(dto) |
| | | || Objects.isNull(dto.getCabinetId()) |
| | | || CollectionUtils.isEmpty(dto.getGridIdList())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | List<JkCabinetGrid> jkCabinetGridList = jkCabinetGridMapper.selectJoinList(JkCabinetGrid.class, |
| | | new MPJLambdaWrapper<JkCabinetGrid>().selectAll(JkCabinetGrid.class) |
| | | .selectAs(JkKeys::getCode,JkCabinetGrid::getKeyCode) |
| | | .selectAs(JkKeys::getCarCode,JkCabinetGrid::getCarCode) |
| | | .selectAs(JkKeys::getCarId,JkCabinetGrid::getCarId) |
| | | .leftJoin(JkKeys.class,JkKeys::getId,JkCabinetGrid::getKeyId) |
| | | .eq(JkCabinetGrid::getIsdeleted,Constants.ZERO) |
| | | .eq(JkKeys::getStatus,Constants.ONE) |
| | | .eq(JkCabinetGrid::getWorkingStatus,Constants.ZERO) |
| | | .eq(JkCabinetGrid::getCabinetId,dto.getCabinetId()) |
| | | .isNotNull(JkCabinetGrid::getKeyId) |
| | | .in(JkCabinetGrid::getId,dto.getGridIdList()) |
| | | ); |
| | | if(CollectionUtils.isEmpty(jkCabinetGridList)){ |
| | | return; |
| | | } |
| | | for (JkCabinetGrid jkCabinetGrid:jkCabinetGridList) { |
| | | jkKeysMapper.update(null,new UpdateWrapper<JkKeys>().lambda() |
| | | .set(JkKeys::getEditDate,DateUtil.getCurrDateTime()) |
| | | .set(JkKeys::getStatus,Constants.TWO) |
| | | .eq(JkKeys::getId,jkCabinetGrid.getKeyId()) |
| | | ); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 取消故障 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void cancelFault(OptGridDTO dto){ |
| | | if(Objects.isNull(dto) |
| | | || Objects.isNull(dto.getCabinetId()) |
| | | || CollectionUtils.isEmpty(dto.getGridIdList())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | List<JkCabinetGrid> jkCabinetGridList = jkCabinetGridMapper.selectList(new QueryWrapper<JkCabinetGrid>().lambda().eq(JkCabinetGrid::getIsdeleted,Constants.ZERO) |
| | | .eq(JkCabinetGrid::getWorkingStatus,Constants.ONE) |
| | | .eq(JkCabinetGrid::getCabinetId,dto.getCabinetId()) |
| | | .in(JkCabinetGrid::getId,dto.getGridIdList()) |
| | | ); |
| | | if(CollectionUtils.isEmpty(jkCabinetGridList)){ |
| | | return; |
| | | } |
| | | LoginUserInfo loginUserInfo = dto.getLoginUserInfo(); |
| | | for (JkCabinetGrid jkCabinetGrid:jkCabinetGridList) { |
| | | jkCabinetGrid.setEditor(loginUserInfo.getId()); |
| | | jkCabinetGrid.setEditDate(new Date()); |
| | | jkCabinetGrid.setWorkingStatus(Constants.ZERO); |
| | | jkCabinetGridMapper.updateById(jkCabinetGrid); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 设备管理员批量开锁 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void batchOpenGridAdmin(OptGridDTO dto){ |
| | | if(Objects.isNull(dto) |
| | | || Objects.isNull(dto.getCabinetId()) |
| | | || CollectionUtils.isEmpty(dto.getGridIdList())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | List<JkCabinetGrid> jkCabinetGridList = jkCabinetGridMapper.selectList(new QueryWrapper<JkCabinetGrid>().lambda().eq(JkCabinetGrid::getIsdeleted,Constants.ZERO) |
| | | .eq(JkCabinetGrid::getCabinetId,dto.getCabinetId()) |
| | | .in(JkCabinetGrid::getId,dto.getGridIdList()) |
| | | ); |
| | | if(CollectionUtils.isEmpty(jkCabinetGridList)){ |
| | | return; |
| | | } |
| | | LoginUserInfo loginUserInfo = dto.getLoginUserInfo(); |
| | | if(org.apache.commons.collections.CollectionUtils.isNotEmpty(jkCabinetGridList)){ |
| | | List<JkCabinetLog> jkCabinetLogs = new ArrayList<>(); |
| | | for (JkCabinetGrid jkCabinetGrid:jkCabinetGridList) { |
| | | JkCabinetLog jkCabinetLog = new JkCabinetLog(); |
| | | jkCabinetLog.setCreateDate(new Date()); |
| | | jkCabinetLog.setCreator(loginUserInfo.getId()); |
| | | jkCabinetLog.setIsdeleted(Constants.ZERO); |
| | | jkCabinetLog.setCabinetId(dto.getCabinetId()); |
| | | jkCabinetLog.setGridId(jkCabinetGrid.getId()); |
| | | jkCabinetLog.setAuthType(Constants.TWO); |
| | | jkCabinetLog.setMemberId(loginUserInfo.getMemberId()); |
| | | if(Objects.nonNull(jkCabinetGrid.getKeyId())){ |
| | | JkKeys jkKeys = jkKeysMapper.selectById(jkCabinetGrid.getKeyId()); |
| | | if(Objects.nonNull(jkKeys)){ |
| | | if(!Constants.equalsInteger(jkKeys.getStatus(),Constants.ZERO)){ |
| | | jkCabinetLog.setCarId(jkKeys.getCarId()); |
| | | jkCabinetLog.setKeyInfo(jkKeys.getCarCode() + "_" + jkKeys.getCode() ); |
| | | } |
| | | jkCabinetLog.setRoleType(jkKeys.getRoleType()); |
| | | } |
| | | } |
| | | jkCabinetLog.setType(Constants.ZERO); |
| | | jkCabinetLogs.add(jkCabinetLog); |
| | | } |
| | | jkCabinetLogMapper.insert(jkCabinetLogs); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 钥匙柜关门 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void closeGrid(CloseGridDTO dto){ |
| | | if(Objects.isNull(dto) |
| | | || Objects.isNull(dto.getGridId()) |
| | | || Objects.isNull(dto.getCabinetId()) |
| | | || Objects.isNull(dto.getKeyStatus()) |
| | | || Objects.isNull(dto.getAuthType()) |
| | | || Objects.isNull(dto.getMemberId()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | JkCabinetGrid jkCabinetGrid = jkCabinetGridMapper.selectOne(new QueryWrapper<JkCabinetGrid>().lambda().eq(JkCabinetGrid::getIsdeleted,Constants.ZERO) |
| | | .eq(JkCabinetGrid::getCabinetId,dto.getCabinetId()) |
| | | .eq(JkCabinetGrid::getId,dto.getGridId()) |
| | | .last(" limit 1 ") |
| | | ); |
| | | if(Objects.isNull(jkCabinetGrid)){ |
| | | return; |
| | | } |
| | | JkCabinetLog jkCabinetLog = new JkCabinetLog(); |
| | | jkCabinetLog.setCreateDate(new Date()); |
| | | jkCabinetLog.setIsdeleted(Constants.ZERO); |
| | | jkCabinetLog.setCabinetId(dto.getCabinetId()); |
| | | jkCabinetLog.setGridId(jkCabinetGrid.getId()); |
| | | jkCabinetLog.setAuthType(dto.getAuthType()); |
| | | jkCabinetLog.setMemberId(dto.getMemberId()); |
| | | if(Objects.nonNull(jkCabinetGrid.getKeyId())){ |
| | | //只有钥匙柜绑定了钥匙信息 才会更新钥匙的信息 |
| | | JkKeys jkKeys = jkKeysMapper.selectById(jkCabinetGrid.getKeyId()); |
| | | if(Objects.nonNull(jkKeys)){ |
| | | if(!Constants.equalsInteger(jkKeys.getStatus(),Constants.ZERO)){ |
| | | jkCabinetLog.setCarId(jkKeys.getCarId()); |
| | | jkCabinetLog.setKeyInfo(jkKeys.getCarCode() + "_" + jkKeys.getCode() ); |
| | | } |
| | | jkCabinetLog.setRoleType(jkKeys.getRoleType()); |
| | | //钥匙状态与当前操作状态不一致,则进行更新钥匙状态 |
| | | if(!Constants.equalsInteger(jkKeys.getStatus(),dto.getKeyStatus())){ |
| | | jkKeysMapper.update(null,new UpdateWrapper<JkKeys>().lambda() |
| | | .set(JkKeys::getEditDate,DateUtil.getCurrDateTime()) |
| | | .set(JkKeys::getStatus,dto.getKeyStatus()) |
| | | .eq(JkKeys::getId,jkKeys.getId()) |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | jkCabinetLog.setType(Constants.ONE); |
| | | jkCabinetLogMapper.insert(jkCabinetLog); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 司机获取可操作的钥匙柜柜格 |
| | | */ |
| | | @Override |
| | | public List<JkCabinetGrid> getDriverGrid(GetDriverGridDTO dto){ |
| | | if(Objects.isNull(dto.getCabinetId()) |
| | | || Objects.isNull(dto.getCabinetId()) |
| | | || Objects.isNull(dto.getMemberId()) |
| | | || Objects.isNull(dto.getType())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | List<JkCabinetGrid> jkCabinetGridList = jkCabinetGridMapper.selectJoinList(JkCabinetGrid.class, |
| | | new MPJLambdaWrapper<JkCabinetGrid>().selectAll(JkCabinetGrid.class) |
| | | .selectAs(JkKeys::getCode,JkCabinetGrid::getKeyCode) |
| | | .selectAs(JkKeys::getCarCode,JkCabinetGrid::getCarCode) |
| | | .selectAs(JkKeys::getCarId,JkCabinetGrid::getCarId) |
| | | .leftJoin(JkKeys.class,JkKeys::getId,JkCabinetGrid::getKeyId) |
| | | .eq(JkCabinetGrid::getIsdeleted,Constants.ZERO) |
| | | .eq(JkCabinetGrid::getWorkingStatus,Constants.ZERO) |
| | | .eq(JkCabinetGrid::getCabinetId,dto.getCabinetId()) |
| | | .in(Constants.equalsInteger(dto.getType(),Constants.ONE),JkKeys::getStatus,Constants.TWO,Constants.THREE) |
| | | .in(Constants.equalsInteger(dto.getType(),Constants.ZERO),JkKeys::getStatus,Constants.ONE) |
| | | .isNotNull(JkCabinetGrid::getKeyId) |
| | | .apply(" t1.car_id in ( select c.CAR_ID from car_driver c left join cars c1 on c.car_id = c1.id where c.ISDELETED = 0 and c.TYPE != 0 and c.MEMBER_ID = "+dto.getMemberId()+" ) ") |
| | | ); |
| | | return jkCabinetGridList; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 司机开启柜格 |
| | | * @param openGridDriverDTO |
| | | */ |
| | | @Override |
| | | public void openGridDriver(OpenGridDriverDTO openGridDriverDTO){ |
| | | JkCabinetGrid jkCabinetGrid = jkCabinetGridMapper.selectOne(new QueryWrapper<JkCabinetGrid>().lambda().eq(JkCabinetGrid::getIsdeleted,Constants.ZERO) |
| | | .eq(JkCabinetGrid::getCabinetId,openGridDriverDTO.getCabinetId()) |
| | | .eq(JkCabinetGrid::getId,openGridDriverDTO.getGridId()) |
| | | .last(" limit 1 ") |
| | | ); |
| | | if(Objects.isNull(jkCabinetGrid)){ |
| | | return; |
| | | } |
| | | LoginUserInfo loginUserInfo = openGridDriverDTO.getLoginUserInfo(); |
| | | List<JkCabinetLog> jkCabinetLogs = new ArrayList<>(); |
| | | JkCabinetLog jkCabinetLog = new JkCabinetLog(); |
| | | jkCabinetLog.setCreateDate(new Date()); |
| | | jkCabinetLog.setCreator(loginUserInfo.getId()); |
| | | jkCabinetLog.setIsdeleted(Constants.ZERO); |
| | | jkCabinetLog.setCabinetId(openGridDriverDTO.getCabinetId()); |
| | | jkCabinetLog.setGridId(jkCabinetGrid.getId()); |
| | | jkCabinetLog.setAuthType(openGridDriverDTO.getAuthType()); |
| | | jkCabinetLog.setMemberId(loginUserInfo.getMemberId()); |
| | | jkCabinetLog.setType(Constants.ZERO); |
| | | if(Objects.nonNull(jkCabinetGrid.getKeyId())){ |
| | | JkKeys jkKeys = jkKeysMapper.selectById(jkCabinetGrid.getKeyId()); |
| | | if(Objects.nonNull(jkKeys)){ |
| | | if(!Constants.equalsInteger(jkKeys.getStatus(),Constants.ZERO)){ |
| | | jkCabinetLog.setCarId(jkKeys.getCarId()); |
| | | jkCabinetLog.setKeyInfo(jkKeys.getCarCode() + "_" + jkKeys.getCode() ); |
| | | } |
| | | jkCabinetLog.setRoleType(jkKeys.getRoleType()); |
| | | } |
| | | } |
| | | jkCabinetLogMapper.insert(jkCabinetLogs); |
| | | } |
| | | |
| | | } |