|
|
@@ -8,8 +8,12 @@ import cn.hutool.poi.excel.ExcelUtil;
|
|
|
import com.zhongzheng.common.core.domain.entity.SysDictData;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
|
+import com.zhongzheng.modules.recruit.bo.RecruitNeedsQueryBo;
|
|
|
import com.zhongzheng.modules.recruit.domain.RecruitCompanyTrade;
|
|
|
+import com.zhongzheng.modules.recruit.domain.RecruitNeeds;
|
|
|
import com.zhongzheng.modules.recruit.service.IRecruitCompanyTradeService;
|
|
|
+import com.zhongzheng.modules.recruit.service.IRecruitNeedsService;
|
|
|
+import com.zhongzheng.modules.recruit.vo.RecruitCompanyNeedVo;
|
|
|
import com.zhongzheng.modules.recruit.vo.RecruitCompanyTradeVo;
|
|
|
import com.zhongzheng.modules.system.service.ISysDictDataService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -52,6 +56,9 @@ public class RecruitCompanyServiceImpl extends ServiceImpl<RecruitCompanyMapper,
|
|
|
@Autowired
|
|
|
private IRecruitCompanyTradeService iRecruitCompanyTradeService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IRecruitNeedsService iRecruitNeedsService;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public RecruitCompanyVo queryById(Long companyId){
|
|
|
@@ -81,11 +88,18 @@ public class RecruitCompanyServiceImpl extends ServiceImpl<RecruitCompanyMapper,
|
|
|
lqw.eq(RecruitCompany::getStatus, 1);
|
|
|
lqw.eq(bo.getTenantId() != null, RecruitCompany::getTenantId, bo.getTenantId());
|
|
|
List<RecruitCompanyVo> companyVos = entity2Vo(this.list(lqw));
|
|
|
+ String TenantId = ServletUtils.getRequest().getHeader("TenantId");
|
|
|
+ bo.setTenantId(Convert.toLong(TenantId));
|
|
|
+ RecruitCompanyVo companyList = baseMapper.selectCompanyList(bo);
|
|
|
+ companyList.setCompanyId(0L);
|
|
|
+ companyVos.add(companyList);
|
|
|
for (RecruitCompanyVo companyVo : companyVos) {
|
|
|
- SysDictData sysDictData = dictDataService.selectDictDataById(companyVo.getCompanyTypeId());
|
|
|
- SysDictData sysDictData1 = dictDataService.selectDictDataById(companyVo.getCompanySizeId());
|
|
|
- companyVo.setCompanyType(sysDictData.getDictLabel());
|
|
|
- companyVo.setCompanySize(sysDictData1.getDictLabel());
|
|
|
+ if (companyVo.getCompanyTypeId() != null && companyVo.getCompanySizeId() != null) {
|
|
|
+ SysDictData sysDictData = dictDataService.selectDictDataById(companyVo.getCompanyTypeId());
|
|
|
+ SysDictData sysDictData1 = dictDataService.selectDictDataById(companyVo.getCompanySizeId());
|
|
|
+ companyVo.setCompanyType(sysDictData.getDictLabel());
|
|
|
+ companyVo.setCompanySize(sysDictData1.getDictLabel());
|
|
|
+ }
|
|
|
}
|
|
|
return companyVos;
|
|
|
}
|
|
|
@@ -124,11 +138,21 @@ public class RecruitCompanyServiceImpl extends ServiceImpl<RecruitCompanyMapper,
|
|
|
|
|
|
@Override
|
|
|
public Boolean updateByEditBo(RecruitCompanyEditBo bo) {
|
|
|
+ RecruitCompanyTradeVo companyTradeVo = iRecruitCompanyTradeService.queryById(bo.getIndustryTypeId());
|
|
|
+ if (bo.getCompanyId() == 0){
|
|
|
+ RecruitCompany update = BeanUtil.toBean(bo, RecruitCompany.class);
|
|
|
+ update.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ update.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ update.setIndustryTypeName(companyTradeVo.getTradeName());
|
|
|
+ String TenantId = ServletUtils.getRequest().getHeader("TenantId");
|
|
|
+ update.setTenantId(Convert.toLong(TenantId));
|
|
|
+ return baseMapper.updateSysTent(update)==1;
|
|
|
+ }
|
|
|
RecruitCompany update = BeanUtil.toBean(bo, RecruitCompany.class);
|
|
|
validEntityBeforeSave(update);
|
|
|
update.setUpdateTime(DateUtils.getNowTime());
|
|
|
update.setUpdateTime(DateUtils.getNowTime());
|
|
|
- RecruitCompanyTradeVo companyTradeVo = iRecruitCompanyTradeService.queryById(bo.getIndustryTypeId());
|
|
|
+
|
|
|
update.setIndustryTypeName(companyTradeVo.getTradeName());
|
|
|
return this.updateById(update);
|
|
|
}
|
|
|
@@ -200,4 +224,68 @@ public class RecruitCompanyServiceImpl extends ServiceImpl<RecruitCompanyMapper,
|
|
|
}
|
|
|
return this.saveBatch(companyList);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<RecruitCompanyNeedVo> queryNeedsList(RecruitCompanyQueryBo bo) {
|
|
|
+ LambdaQueryWrapper<RecruitCompany> lqw = Wrappers.lambdaQuery();
|
|
|
+ lqw.like(StrUtil.isNotBlank(bo.getCompanyName()), RecruitCompany::getCompanyName, bo.getCompanyName());
|
|
|
+ lqw.eq(bo.getCompanyTypeId() != null, RecruitCompany::getCompanyTypeId, bo.getCompanyTypeId());
|
|
|
+ lqw.eq(bo.getCompanySizeId() != null, RecruitCompany::getCompanySizeId, bo.getCompanySizeId());
|
|
|
+ lqw.eq(bo.getIndustryTypeId() != null, RecruitCompany::getIndustryTypeId, bo.getIndustryTypeId());
|
|
|
+ lqw.like(StrUtil.isNotBlank(bo.getIndustryTypeName()), RecruitCompany::getIndustryTypeName, bo.getIndustryTypeName());
|
|
|
+ lqw.eq(StrUtil.isNotBlank(bo.getCompanyIntroduce()), RecruitCompany::getCompanyIntroduce, bo.getCompanyIntroduce());
|
|
|
+ lqw.eq(StrUtil.isNotBlank(bo.getLogoUrl()), RecruitCompany::getLogoUrl, bo.getLogoUrl());
|
|
|
+ lqw.eq(StrUtil.isNotBlank(bo.getLicenseUrl()), RecruitCompany::getLicenseUrl, bo.getLicenseUrl());
|
|
|
+ lqw.eq(StrUtil.isNotBlank(bo.getSocietyCode()), RecruitCompany::getSocietyCode, bo.getSocietyCode());
|
|
|
+ lqw.eq(StrUtil.isNotBlank(bo.getProvince()), RecruitCompany::getProvince, bo.getProvince());
|
|
|
+ lqw.eq(StrUtil.isNotBlank(bo.getCity()), RecruitCompany::getCity, bo.getCity());
|
|
|
+ lqw.eq(StrUtil.isNotBlank(bo.getDistrict()), RecruitCompany::getDistrict, bo.getDistrict());
|
|
|
+ lqw.eq(StrUtil.isNotBlank(bo.getAddress()), RecruitCompany::getAddress, bo.getAddress());
|
|
|
+ lqw.eq(StrUtil.isNotBlank(bo.getCompanyPh()), RecruitCompany::getCompanyPh, bo.getCompanyPh());
|
|
|
+ lqw.eq(StrUtil.isNotBlank(bo.getLinkMan()), RecruitCompany::getLinkMan, bo.getLinkMan());
|
|
|
+ lqw.eq(StrUtil.isNotBlank(bo.getPostBox()), RecruitCompany::getPostBox, bo.getPostBox());
|
|
|
+ lqw.eq(RecruitCompany::getStatus, 1);
|
|
|
+ lqw.eq(bo.getTenantId() != null, RecruitCompany::getTenantId, bo.getTenantId());
|
|
|
+ List<RecruitCompanyVo> companyVos = entity2Vo(this.list(lqw));
|
|
|
+ String TenantId = ServletUtils.getRequest().getHeader("TenantId");
|
|
|
+ bo.setTenantId(Convert.toLong(TenantId));
|
|
|
+ RecruitCompanyVo companyList = baseMapper.selectCompanyList(bo);
|
|
|
+ companyList.setCompanyId(0L);
|
|
|
+ companyVos.add(companyList);
|
|
|
+
|
|
|
+ List<RecruitCompanyNeedVo> recruitCompanyNeedVos = entityNeedsVo(companyVos);
|
|
|
+ for (RecruitCompanyNeedVo companyVo : recruitCompanyNeedVos) {
|
|
|
+ if (companyVo.getCompanyTypeId() != null && companyVo.getCompanySizeId() != null) {
|
|
|
+ SysDictData sysDictData = dictDataService.selectDictDataById(companyVo.getCompanyTypeId());
|
|
|
+ SysDictData sysDictData1 = dictDataService.selectDictDataById(companyVo.getCompanySizeId());
|
|
|
+ companyVo.setCompanyType(sysDictData.getDictLabel());
|
|
|
+ companyVo.setCompanySize(sysDictData1.getDictLabel());
|
|
|
+ }
|
|
|
+ RecruitNeedsQueryBo recruitNeedsQueryBo = new RecruitNeedsQueryBo();
|
|
|
+ recruitNeedsQueryBo.setCompanyId(companyVo.getCompanyId());
|
|
|
+ List<String> list = iRecruitNeedsService.queryRecruitNeedsListString(recruitNeedsQueryBo);
|
|
|
+ companyVo.setRecruitNeedsVoList(list);
|
|
|
+ }
|
|
|
+ return recruitCompanyNeedVos;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 实体类转化成视图对象
|
|
|
+ *
|
|
|
+ * @param collection 实体类集合
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private List<RecruitCompanyNeedVo> entityNeedsVo(Collection<RecruitCompanyVo> collection) {
|
|
|
+ List<RecruitCompanyNeedVo> voList = collection.stream()
|
|
|
+ .map(any -> BeanUtil.toBean(any, RecruitCompanyNeedVo.class))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ if (collection instanceof Page) {
|
|
|
+ Page<RecruitCompanyVo> page = (Page<RecruitCompanyVo>)collection;
|
|
|
+ Page<RecruitCompanyNeedVo> pageVo = new Page<>();
|
|
|
+ BeanUtil.copyProperties(page,pageVo);
|
|
|
+ pageVo.addAll(voList);
|
|
|
+ voList = pageVo;
|
|
|
+ }
|
|
|
+ return voList;
|
|
|
+ }
|
|
|
}
|