package com.gk.hotwork.Service.ServiceImpl;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.gk.hotwork.Domain.InspectionExpert;
|
import com.gk.hotwork.Domain.InspectionExpertGroup;
|
import com.gk.hotwork.Domain.SafetySelfInspection;
|
import com.gk.hotwork.Domain.UserInfo;
|
import com.gk.hotwork.Domain.Utils.StringUtils;
|
import com.gk.hotwork.Mapper.InspectionExpertGroupMapper;
|
import com.gk.hotwork.Service.InspectionExpertGroupService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
import java.util.Map;
|
|
/**
|
* @email 1603559716@qq.com
|
* @author: zf
|
* @date: 2023/7/19
|
* @time: 17:30
|
*/
|
@Service
|
public class InspectionExpertGroupServiceImpl extends ServiceImpl<InspectionExpertGroupMapper, InspectionExpertGroup> implements InspectionExpertGroupService {
|
|
@Autowired
|
private InspectionExpertGroupMapper inspectionExpertGroupMapper;
|
|
|
@Override
|
public IPage selectPage(Page<InspectionExpertGroup> page, Map<String, Object> filter, UserInfo user) {
|
Integer type = user.getType();
|
//普通用户
|
if (type.equals(3)) {
|
Long companyid = user.getCompanyid();
|
filter.put("checkedCompanyId",companyid);
|
}
|
//监管用户
|
if (type.equals(2)) {
|
//获取企业信息
|
filter.put("province",user.getProvince());
|
filter.put("city",user.getCity());
|
filter.put("area",user.getCounty());
|
}
|
IPage<InspectionExpertGroup> res = inspectionExpertGroupMapper.selectPages(page, filter);
|
return res;
|
}
|
|
@Override
|
public InspectionExpertGroup getBySelfInspectionId(Long selfInspectionId) {
|
|
return inspectionExpertGroupMapper.selectOne(new LambdaQueryWrapper<InspectionExpertGroup>()
|
.eq(InspectionExpertGroup::getValidFlag,true)
|
.eq(InspectionExpertGroup::getSelfInspectionId,selfInspectionId)
|
);
|
}
|
}
|