| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.config.DataSyncConfig; |
| | | import com.doumee.config.Jwt.JwtPayLoad; |
| | | import com.doumee.config.Jwt.JwtTokenUtil; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | |
| | | import com.doumee.dao.business.join.DeviceEventJoinMapper; |
| | | import com.doumee.dao.business.join.VisitEventJoinMapper; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.service.business.ERPSyncService; |
| | | import com.doumee.service.business.ext.ERPSyncService; |
| | | import com.doumee.service.business.InterfaceLogService; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import lombok.Synchronized; |
| | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | @Autowired |
| | | private DataSyncConfig dataSyncConfig; |
| | | @Autowired |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | | |
| | |
| | | @Transactional |
| | | @Synchronized |
| | | public String syncCompany(OrgListRequest param){ |
| | | if(!StringUtils.equals(Constants.ONE+"", systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.ORG_USER_ORIGIN).getCode())){ |
| | | if( Constants.formatIntegerNum(dataSyncConfig.getOrgUserDataOrigin()) != DataSyncConfig.origin.erp){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,当前不支持组织同步操作~"); |
| | | } |
| | | //获取ERP组织信息(全量同步) |
| | |
| | | @Transactional |
| | | @Synchronized |
| | | public String syncUsers(UserListRequest param){ |
| | | if(!StringUtils.equals(Constants.ONE+"", systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.ORG_USER_ORIGIN).getCode())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,当前不支持人员同步操作~"); |
| | | if( Constants.formatIntegerNum(dataSyncConfig.getOrgUserDataOrigin()) != DataSyncConfig.origin.erp){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,当前不支持组织同步操作~"); |
| | | } |
| | | List<ErpUserListResponse> list = erpTool.getErpUserList(ErpConstants.userListUrl,param); |
| | | if(list !=null && list.size()>0) { |
| | |
| | | } |
| | | Member member = memberMapper.selectOne(new QueryWrapper<Member>().lambda().eq(Member::getErpId,param.getUserId()).last("limit 1")); |
| | | if(Objects.isNull(member)){ |
| | | return; |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,用户信息不存在!"); |
| | | } |
| | | List<Integer> doorIds = getRoleIdByParam(param.getRoleIds(),member); |
| | | //更新授权有效期 |
| | |
| | | ||StringUtils.isBlank(param.getCarCode())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | if(param.getValidStartTime()!=null && param.getValidEndTime()!=null&¶m.getValidStartTime().getTime()> param.getValidEndTime().getTime()){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,有效期时间不合法!"); |
| | | } |
| | | Member member = memberMapper.selectOne(new QueryWrapper<Member>().lambda().eq(Member::getErpId,param.getUserId()).last("limit 1")); |
| | | if(Objects.isNull(member)){ |
| | | return; |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,用户信息不存在!"); |
| | | } |
| | | //删除车量库记录数据 |
| | | parkBookMapper.update(null,new UpdateWrapper<ParkBook>().lambda() |
| | |
| | | parkBookList.add(parkBook); |
| | | } |
| | | parkBookMapper.insertBatchSomeColumn(parkBookList); |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,停车库信息不存在,授权失败"); |
| | | } |
| | | |
| | | } |