Merge branch 'main' of http://124.243.245.42:3000/zkr/shz-backend
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package com.ruoyi.cms.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.cms.domain.CrossCityAlliance;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 跨域联合招聘会-联盟城市 Service。
|
||||
*/
|
||||
public interface ICrossCityAllianceService extends IService<CrossCityAlliance>
|
||||
{
|
||||
/**
|
||||
* 查询联盟城市列表(支持按城市名称模糊查询)。
|
||||
*/
|
||||
List<CrossCityAlliance> selectAllianceList(CrossCityAlliance query);
|
||||
}
|
||||
@@ -16,13 +16,14 @@ public interface IOutdoorFairDeviceService extends IService<OutdoorFairDevice>
|
||||
List<OutdoorFairDevice> selectDeviceList(OutdoorFairDevice query);
|
||||
|
||||
/**
|
||||
* 批量生成设备码(UUID)。
|
||||
* 新增设备码(由用户手动填写设备码,可选同时绑定参会企业)。
|
||||
*
|
||||
* @param fairId 招聘会ID
|
||||
* @param quantity 生成数量
|
||||
* @return 已生成的设备码列表
|
||||
* @param fairId 招聘会ID
|
||||
* @param deviceCode 设备码(全局唯一)
|
||||
* @param companyId 参会企业ID,为空表示暂不绑定
|
||||
* @return 新增的设备码
|
||||
*/
|
||||
List<OutdoorFairDevice> batchGenerate(Long fairId, Integer quantity);
|
||||
OutdoorFairDevice addDevice(Long fairId, String deviceCode, Long companyId);
|
||||
|
||||
/**
|
||||
* 绑定/解绑参会企业(companyId 为空表示解绑)。
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.ruoyi.cms.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.cms.domain.CrossCityAlliance;
|
||||
import com.ruoyi.cms.mapper.CrossCityAllianceMapper;
|
||||
import com.ruoyi.cms.service.ICrossCityAllianceService;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 跨域联合招聘会-联盟城市 Service 实现。
|
||||
*/
|
||||
@Service
|
||||
public class CrossCityAllianceServiceImpl
|
||||
extends ServiceImpl<CrossCityAllianceMapper, CrossCityAlliance>
|
||||
implements ICrossCityAllianceService
|
||||
{
|
||||
@Override
|
||||
public List<CrossCityAlliance> selectAllianceList(CrossCityAlliance query)
|
||||
{
|
||||
LambdaQueryWrapper<CrossCityAlliance> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.like(StringUtils.isNotBlank(query.getName()), CrossCityAlliance::getName, query.getName());
|
||||
wrapper.orderByAsc(CrossCityAlliance::getId);
|
||||
return list(wrapper);
|
||||
}
|
||||
}
|
||||
@@ -15,10 +15,8 @@ import com.ruoyi.common.utils.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 户外招聘会设备码 Service 实现。
|
||||
@@ -47,28 +45,45 @@ public class OutdoorFairDeviceServiceImpl
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OutdoorFairDevice> batchGenerate(Long fairId, Integer quantity)
|
||||
public OutdoorFairDevice addDevice(Long fairId, String deviceCode, Long companyId)
|
||||
{
|
||||
if (fairId == null) {
|
||||
throw new ServiceException("招聘会ID不能为空");
|
||||
}
|
||||
int count = quantity == null ? 0 : quantity;
|
||||
if (count <= 0) {
|
||||
throw new ServiceException("生成数量必须大于0");
|
||||
if (StringUtils.isBlank(deviceCode)) {
|
||||
throw new ServiceException("设备码不能为空");
|
||||
}
|
||||
if (count > 1000) {
|
||||
throw new ServiceException("单次生成数量不能超过1000");
|
||||
// 设备码全局唯一(H5 端按设备码查询)
|
||||
Long exists = baseMapper.selectCount(new LambdaQueryWrapper<OutdoorFairDevice>()
|
||||
.eq(OutdoorFairDevice::getDeviceCode, deviceCode));
|
||||
if (exists != null && exists > 0) {
|
||||
throw new ServiceException("设备码已存在");
|
||||
}
|
||||
List<OutdoorFairDevice> devices = new ArrayList<>(count);
|
||||
for (int i = 0; i < count; i++) {
|
||||
OutdoorFairDevice device = new OutdoorFairDevice();
|
||||
device.setFairId(fairId);
|
||||
// 去掉中划线,得到 32 位十六进制设备码
|
||||
device.setDeviceCode(UUID.randomUUID().toString().replace("-", ""));
|
||||
devices.add(device);
|
||||
OutdoorFairDevice device = new OutdoorFairDevice();
|
||||
device.setFairId(fairId);
|
||||
device.setDeviceCode(deviceCode);
|
||||
if (companyId != null) {
|
||||
// 仅允许绑定已参加当前招聘会的企业
|
||||
Long count = fairCompanyMapper.selectCount(new LambdaQueryWrapper<FairCompany>()
|
||||
.eq(FairCompany::getJobFairId, fairId)
|
||||
.eq(FairCompany::getCompanyId, companyId));
|
||||
if (count == null || count == 0) {
|
||||
throw new ServiceException("该企业未参加当前招聘会");
|
||||
}
|
||||
// 同一招聘会下,一个企业只能绑定一个设备码
|
||||
Long bound = baseMapper.selectCount(new LambdaQueryWrapper<OutdoorFairDevice>()
|
||||
.eq(OutdoorFairDevice::getFairId, fairId)
|
||||
.eq(OutdoorFairDevice::getCompanyId, companyId));
|
||||
if (bound != null && bound > 0) {
|
||||
throw new ServiceException("该企业已绑定其他设备码");
|
||||
}
|
||||
Company company = companyMapper.selectById(companyId);
|
||||
device.setCompanyId(companyId);
|
||||
device.setCompanyName(company == null ? null : company.getName());
|
||||
device.setBindTime(new Date());
|
||||
}
|
||||
saveBatch(devices);
|
||||
return devices;
|
||||
save(device);
|
||||
return device;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -100,4 +100,9 @@ public interface IPublicJobFairService {
|
||||
* 查询招聘会报名列表
|
||||
*/
|
||||
List<JobFairSignUpVO> selectSignUpList(String jobFairId);
|
||||
|
||||
/**
|
||||
* 查询跨域招聘会下的岗位(可按联盟城市过滤,cityNames 为逗号分隔的城市名称)
|
||||
*/
|
||||
List<CrossDomainJobVO> selectCrossDomainJobs(String cityNames);
|
||||
}
|
||||
|
||||
@@ -219,4 +219,9 @@ public class PublicJobFairServiceImpl implements IPublicJobFairService {
|
||||
public List<JobFairSignUpVO> selectSignUpList(String jobFairId) {
|
||||
return publicJobFairMapper.selectSignUpListByJobFairId(jobFairId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CrossDomainJobVO> selectCrossDomainJobs(String cityNames) {
|
||||
return publicJobFairMapper.selectCrossDomainJobs(cityNames);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user